1 /*
2   eXosip - This is the eXtended osip library.
3   Copyright (C) 2001-2020 Aymeric MOIZARD amoizard@antisip.com
4 
5   eXosip is free software; you can redistribute it and/or modify
6   it under the terms of the GNU General Public License as published by
7   the Free Software Foundation; either version 2 of the License, or
8   (at your option) any later version.
9 
10   eXosip is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   GNU General Public License for more details.
14 
15   You should have received a copy of the GNU General Public License
16   along with this program; if not, write to the Free Software
17   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 
19   In addition, as a special exception, the copyright holders give
20   permission to link the code of portions of this program with the
21   OpenSSL library under certain conditions as described in each
22   individual source file, and distribute linked combinations
23   including the two.
24   You must obey the GNU General Public License in all respects
25   for all of the code used other than OpenSSL.  If you modify
26   file(s) with this exception, you may extend this exception to your
27   version of the file(s), but you are not obligated to do so.  If you
28   do not wish to do so, delete this exception statement from your
29   version.  If you delete this exception statement from all source
30   files in the program, then also delete it here.
31 */
32 
33 #ifdef ENABLE_MPATROL
34 #include <mpatrol.h>
35 #endif
36 
37 #ifndef MINISIZE
38 
39 #ifndef __EX_OPTIONS_H__
40 #define __EX_OPTIONS_H__
41 
42 #include <osipparser2/osip_parser.h>
43 #include <time.h>
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 /**
50  * @file eX_options.h
51  * @brief eXosip options request API
52  *
53  * This file provide the API needed to control OPTIONS requests. You can
54  * use it to:
55  *
56  * <ul>
57  * <li>build OPTIONS requests.</li>
58  * <li>send OPTIONS requests.</li>
59  * <li>build OPTIONS answers.</li>
60  * <li>send OPTIONS answers.</li>
61  * </ul>
62  */
63 
64 /**
65  * @defgroup eXosip2_options eXosip2 OPTIONS and UA capabilities Management
66  * @ingroup eXosip2_msg
67  * @{
68  */
69 
70 /**
71  * Build a default OPTIONS message.
72  *
73  * @param excontext eXosip_t instance.
74  * @param options   Pointer for the SIP request to build.
75  * @param to        SIP url for callee.
76  * @param from      SIP url for caller.
77  * @param route     Route header for INVITE. (optional)
78  */
79 int eXosip_options_build_request(struct eXosip_t *excontext, osip_message_t **options, const char *to, const char *from, const char *route);
80 
81 /**
82  * Send an OPTIONS request.
83  *
84  * @param excontext       eXosip_t instance.
85  * @param options         SIP OPTIONS message to send.
86  */
87 int eXosip_options_send_request(struct eXosip_t *excontext, osip_message_t *options);
88 
89 /**
90  * Build answer for an OPTIONS request.
91  *
92  * @param excontext       eXosip_t instance.
93  * @param tid             id of OPTIONS transaction.
94  * @param status          status for SIP answer to build.
95  * @param answer          The SIP answer to build.
96  */
97 int eXosip_options_build_answer(struct eXosip_t *excontext, int tid, int status, osip_message_t **answer);
98 
99 /**
100  * Send answer for an OPTIONS request.
101  *
102  * @param excontext       eXosip_t instance.
103  * @param tid             id of OPTIONS transaction.
104  * @param status          status for SIP answer to send.
105  * @param answer          The SIP answer to send. (default will be sent if NULL)
106  */
107 int eXosip_options_send_answer(struct eXosip_t *excontext, int tid, int status, osip_message_t *answer);
108 
109 /** @} */
110 
111 #ifdef __cplusplus
112 }
113 #endif
114 #endif
115 #endif
116