Revert "Revert "and added files""
[bcm963xx.git] / userapps / opensource / libosip2 / include / osipparser2 / headers / osip_call_id.h
1 /*
2   The oSIP library implements the Session Initiation Protocol (SIP -rfc2543-)
3   Copyright (C) 2001  Aymeric MOIZARD jack@atosc.org
4   
5   This library is free software; you can redistribute it and/or
6   modify it under the terms of the GNU Lesser General Public
7   License as published by the Free Software Foundation; either
8   version 2.1 of the License, or (at your option) any later version.
9   
10   This library 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 GNU
13   Lesser General Public License for more details.
14   
15   You should have received a copy of the GNU Lesser General Public
16   License along with this library; if not, write to the Free Software
17   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 */
19
20
21 #ifndef _OSIP_CALL_ID_H_
22 #define _OSIP_CALL_ID_H_
23
24 /**
25  * @file osip_call_id.h
26  * @brief oSIP osip_call_id header definition.
27  */
28
29 /**
30  * @defgroup oSIP_CALL_ID oSIP call-id header definition.
31  * @ingroup oSIP_HEADERS
32  * @{
33  */
34
35 /**
36  * Structure for Call-Id headers.
37  * @defvar osip_call_id_t
38  */
39   typedef struct osip_call_id osip_call_id_t;
40
41   struct osip_call_id
42   {
43     char *number;
44     char *host;
45   };
46
47 #ifdef __cplusplus
48 extern "C"
49 {
50 #endif
51
52 /**
53  * Allocate a Call-id element.
54  * @param header The element to work on.
55  */
56   int osip_call_id_init (osip_call_id_t ** header);
57 /**
58  * Free a Call-id element.
59  * @param header The element to work on.
60  */
61   void osip_call_id_free (osip_call_id_t * header);
62 /**
63  * Parse a Call-id element.
64  * @param header The element to work on.
65  * @param hvalue The string to parse.
66  */
67   int osip_call_id_parse (osip_call_id_t * header, const char *hvalue);
68 /**
69  * Get a string representation of a Call-id element.
70  * @param header The element to work on.
71  * @param dest A pointer on the new allocated string.
72  */
73   int osip_call_id_to_str (const osip_call_id_t * header, char **dest);
74 /**
75  * Clone a Call-id element.
76  * @param header The element to work on.
77  * @param dest A pointer on the copy of the element.
78  */
79   int osip_call_id_clone (const osip_call_id_t * header, osip_call_id_t ** dest);
80 /**
81  * Set the number in the Call-Id element.
82  * @param header The element to work on.
83  * @param value The value of the element.
84  */
85   void osip_call_id_set_number (osip_call_id_t * header, char *value);
86 /**
87  * Get the number from a Call-Id header.
88  * @param header The element to work on.
89  */
90   char *osip_call_id_get_number (osip_call_id_t * header);
91 /**
92  * Set the host in the Call-Id element.
93  * @param header The element to work on.
94  * @param value The value of the element.
95  */
96   void osip_call_id_set_host (osip_call_id_t * header, char *value);
97 /**
98  * Get the host from a Call-Id header.
99  * @param header The element to work on.
100  */
101   char *osip_call_id_get_host (osip_call_id_t * header);
102
103 /**
104  * Check if the Call-Id headers match.
105  * NOTE: THIS IS AN INTERNAL METHOD ONLY
106  * @param callid1 The initial Call-Id header.
107  * @param callid2 The new Call-Id header.
108  */
109   int osip_call_id_match (osip_call_id_t * callid1, osip_call_id_t * callid2);
110
111 #ifdef __cplusplus
112 }
113 #endif
114
115 /** @} */
116
117 #endif