1 /* 2 belle-sip - SIP (RFC3261) library. 3 Copyright (C) 2010 Belledonne Communications SARL 4 5 This program 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 This program 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, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #ifndef HEADERS_H_ 20 #define HEADERS_H_ 21 22 #include "belle-sip/defs.h" 23 #include "belle-sip/sip-uri.h" 24 #include "belle-sip/generic-uri.h" 25 #include "belle-sip/utils.h" 26 #include "belle-sip/parameters.h" 27 28 #include <time.h> 29 30 BELLE_SIP_BEGIN_DECLS 31 32 33 /*************************************************************************************** 34 * header address 35 * 36 **************************************************************************************/ 37 38 typedef struct _belle_sip_header_address belle_sip_header_address_t; 39 40 BELLESIP_EXPORT belle_sip_header_address_t* belle_sip_header_address_new(void); 41 /* 42 * creates an address from a display name and an uri 43 * Note the uri not copied but only its ref count is incremented 44 * @param display display name. May be null. 45 * @param uri uri set to the newly created header_address 46 * @return 47 * */ 48 BELLESIP_EXPORT belle_sip_header_address_t* belle_sip_header_address_create(const char* display, belle_sip_uri_t* uri); 49 50 /* 51 * creates an address from a display name and an absolute uri 52 * Note the uri not copied but only its ref count is incremented 53 * @param display display name. May be null. 54 * @param uri uri set to the newly created header_address 55 * @return 56 * */ 57 BELLESIP_EXPORT belle_sip_header_address_t* belle_sip_header_address_create2(const char* display, belle_generic_uri_t* uri); 58 59 60 BELLESIP_EXPORT belle_sip_header_address_t* belle_sip_header_address_parse (const char* address) ; 61 62 /* 63 same as belle_sip_header_address_parse but with less syntax checking 64 */ 65 BELLESIP_EXPORT belle_sip_header_address_t* belle_sip_header_address_fast_parse (const char* address) ; 66 67 68 /** 69 * returns a sip uri. A header address cannot have both a sip uri and an absolute uri. 70 */ 71 BELLESIP_EXPORT belle_sip_uri_t* belle_sip_header_address_get_uri(const belle_sip_header_address_t* address); 72 /** 73 * set an absolute uri. A header address cannot have both a sip uri and an absolute uri. This function also to absolute uri to NULL 74 */ 75 BELLESIP_EXPORT void belle_sip_header_address_set_uri(belle_sip_header_address_t* address, belle_sip_uri_t* uri); 76 77 /** 78 * returns an absolute uri. A header address cannot have both a sip uri and an absolute uri. 79 */ 80 BELLESIP_EXPORT belle_generic_uri_t* belle_sip_header_address_get_absolute_uri(const belle_sip_header_address_t* address); 81 /** 82 * set an absolute uri. A header address cannot have both a sip uri and an absolute uri. This function also to uri to NULL 83 */ 84 BELLESIP_EXPORT void belle_sip_header_address_set_absolute_uri(belle_sip_header_address_t* address, belle_generic_uri_t* uri); 85 86 /** 87 * 88 */ 89 BELLESIP_EXPORT const char* belle_sip_header_address_get_displayname(const belle_sip_header_address_t* address); 90 /** 91 * 92 */ 93 BELLESIP_EXPORT void belle_sip_header_address_set_displayname(belle_sip_header_address_t* address, const char* uri); 94 95 #define BELLE_SIP_HEADER_ADDRESS(t) BELLE_SIP_CAST(t,belle_sip_header_address_t) 96 97 98 99 /*************************************************************************************** 100 * header common 101 * 102 **************************************************************************************/ 103 104 BELLESIP_EXPORT belle_sip_header_t* belle_sip_header_parse (const char* header); 105 BELLESIP_EXPORT belle_sip_header_t* belle_sip_header_create (const char* name,const char* value); 106 BELLESIP_EXPORT belle_sip_header_t* belle_http_header_create (const char* name,const char* value); 107 BELLESIP_EXPORT const char* belle_sip_header_get_name (const belle_sip_header_t* obj); 108 BELLESIP_EXPORT void belle_sip_header_set_name (belle_sip_header_t* obj,const char* value); 109 BELLESIP_EXPORT belle_sip_error_code belle_sip_header_marshal(belle_sip_header_t* header, char* buff, size_t buff_size, size_t *offset); 110 BELLESIP_EXPORT const char *belle_sip_header_get_unparsed_value(belle_sip_header_t* obj); 111 112 #define BELLE_SIP_HEADER(t) BELLE_SIP_CAST(t,belle_sip_header_t) 113 114 /****************************** 115 * 116 * Allow header inherit from header 117 * 118 ******************************/ 119 typedef struct _belle_sip_header_allow belle_sip_header_allow_t; 120 121 belle_sip_header_allow_t* belle_sip_header_allow_new(void); 122 123 BELLESIP_EXPORT belle_sip_header_allow_t* belle_sip_header_allow_parse (const char* allow) ; 124 BELLESIP_EXPORT belle_sip_header_allow_t* belle_sip_header_allow_create (const char* methods) ; 125 126 BELLESIP_EXPORT const char* belle_sip_header_allow_get_method(const belle_sip_header_allow_t* allow); 127 BELLESIP_EXPORT void belle_sip_header_allow_set_method(belle_sip_header_allow_t* allow,const char* method); 128 #define BELLE_SIP_HEADER_ALLOW(t) BELLE_SIP_CAST(t,belle_sip_header_allow_t) 129 #define BELLE_SIP_ALLOW "Allow" 130 131 /*********************** 132 * Contact header object 133 ************************/ 134 typedef struct _belle_sip_header_contact belle_sip_header_contact_t; 135 136 BELLESIP_EXPORT belle_sip_header_contact_t* belle_sip_header_contact_new(void); 137 138 139 BELLESIP_EXPORT belle_sip_header_contact_t* belle_sip_header_contact_parse (const char* contact) ; 140 141 BELLESIP_EXPORT belle_sip_header_contact_t* belle_sip_header_contact_create (const belle_sip_header_address_t* contact) ; 142 143 144 /** 145 * Returns the value of the expires parameter or -1 if no expires parameter was specified or if the parameter value cannot be parsed as an int. 146 *@returns value of the expires parameter measured in delta-seconds, O implies removal of Registration specified in Contact Header. 147 * 148 */ 149 BELLESIP_EXPORT int belle_sip_header_contact_get_expires(const belle_sip_header_contact_t* contact); 150 /** 151 * Returns the value of the q-value parameter of this ContactHeader. The q-value parameter indicates the relative preference amongst a set of locations. q-values are decimal numbers from 0 to 1, with higher values indicating higher preference. 152 * @return the q-value parameter of this ContactHeader, -1 if the q-value is not set. 153 */ 154 BELLESIP_EXPORT float belle_sip_header_contact_get_qvalue(const belle_sip_header_contact_t* contact); 155 /** 156 * Returns a boolean value that indicates if the contact header has the format of Contact: *. 157 * @return true if this is a wildcard address, false otherwise. 158 */ 159 BELLESIP_EXPORT unsigned int belle_sip_header_contact_is_wildcard(const belle_sip_header_contact_t* contact); 160 /** 161 * 162 */ 163 BELLESIP_EXPORT int belle_sip_header_contact_set_expires(belle_sip_header_contact_t* contact, int expires); 164 /** 165 * Sets the qValue value of the Name Address. 166 */ 167 BELLESIP_EXPORT int belle_sip_header_contact_set_qvalue(belle_sip_header_contact_t* contact, float qvalue); 168 /** 169 * Sets a wildcard on this contact address that is "*" is assigned to the contact header so that the header will have the format of Contact: *. 170 * 171 */ 172 BELLESIP_EXPORT void belle_sip_header_contact_set_wildcard(belle_sip_header_contact_t* contact,unsigned int is_wildcard); 173 /** Contact heaader equality function 174 * @return 0 if not equals 175 * 176 * */ 177 BELLESIP_EXPORT unsigned int belle_sip_header_contact_equals(const belle_sip_header_contact_t* a,const belle_sip_header_contact_t* b); 178 179 /** Contact heaader equality function, same as #belle_sip_header_contact_equals but return 0 if equals, very useful with #belle_sip_list 180 * @return 0 if equals 181 * 182 * */ 183 BELLESIP_EXPORT unsigned int belle_sip_header_contact_not_equals(const belle_sip_header_contact_t* a,const belle_sip_header_contact_t* b); 184 185 /** 186 * Enable automatic filling of the contact ip, port and transport according to the channel that sends this message. 187 **/ 188 BELLESIP_EXPORT void belle_sip_header_contact_set_automatic(belle_sip_header_contact_t *a, int enabled); 189 190 BELLESIP_EXPORT int belle_sip_header_contact_get_automatic(const belle_sip_header_contact_t *a); 191 192 /** 193 * Indicates whether a contact in automatic mode (see belle_sip_header_contact_set_automatic()) could be filled properly when the message was sent. 194 * If a message is sent through a connection that has just been initiated, public IP and port are unknown, they will be learned after receiving the first response. 195 * This can be used by the upper layer to decide to resubmit the request. 196 **/ 197 BELLESIP_EXPORT int belle_sip_header_contact_is_unknown(const belle_sip_header_contact_t *a); 198 199 #define BELLE_SIP_RANDOM_TAG ((const char*)-1) 200 #define BELLE_SIP_HEADER_CONTACT(t) BELLE_SIP_CAST(t,belle_sip_header_contact_t) 201 #define BELLE_SIP_CONTACT "Contact" 202 /****************************** 203 * From header object inherent from header_address 204 * 205 ******************************/ 206 typedef struct _belle_sip_header_from belle_sip_header_from_t; 207 208 BELLESIP_EXPORT belle_sip_header_from_t* belle_sip_header_from_new(void); 209 210 BELLESIP_EXPORT belle_sip_header_from_t* belle_sip_header_from_create(const belle_sip_header_address_t* address, const char *tag); 211 212 BELLESIP_EXPORT belle_sip_header_from_t* belle_sip_header_from_create2(const char *address, const char *tag); 213 214 BELLESIP_EXPORT belle_sip_header_from_t* belle_sip_header_from_parse(const char* from) ; 215 216 BELLESIP_EXPORT void belle_sip_header_from_set_tag(belle_sip_header_from_t* from, const char* tag); 217 218 BELLESIP_EXPORT const char* belle_sip_header_from_get_tag(const belle_sip_header_from_t* from); 219 220 BELLESIP_EXPORT void belle_sip_header_from_set_random_tag(belle_sip_header_from_t *obj); 221 222 #define BELLE_SIP_HEADER_FROM(t) BELLE_SIP_CAST(t,belle_sip_header_from_t) 223 #define BELLE_SIP_FROM "From" 224 /****************************** 225 * To header object inherent from header_address 226 * 227 ******************************/ 228 typedef struct _belle_sip_header_to belle_sip_header_to_t; 229 230 BELLESIP_EXPORT belle_sip_header_to_t* belle_sip_header_to_new(void); 231 232 BELLESIP_EXPORT belle_sip_header_to_t* belle_sip_header_to_parse(const char* to) ; 233 234 BELLESIP_EXPORT belle_sip_header_to_t* belle_sip_header_to_create(const belle_sip_header_address_t *address, const char *tag); 235 236 BELLESIP_EXPORT belle_sip_header_to_t* belle_sip_header_to_create2(const char *address, const char *tag); 237 238 BELLESIP_EXPORT void belle_sip_header_to_set_tag(belle_sip_header_to_t* from, const char* tag); 239 240 BELLESIP_EXPORT const char* belle_sip_header_to_get_tag(const belle_sip_header_to_t* from); 241 242 BELLESIP_EXPORT void belle_sip_header_to_set_random_tag(belle_sip_header_to_t *obj); 243 244 #define BELLE_SIP_HEADER_TO(t) BELLE_SIP_CAST(t,belle_sip_header_to_t) 245 #define BELLE_SIP_TO "To" 246 247 /****************************** 248 * Diversion header object inherent from header_address 249 * 250 ******************************/ 251 typedef struct _belle_sip_header_diversion belle_sip_header_diversion_t; 252 253 BELLESIP_EXPORT belle_sip_header_diversion_t* belle_sip_header_diversion_new(void); 254 255 BELLESIP_EXPORT belle_sip_header_diversion_t* belle_sip_header_diversion_parse(const char* diversion) ; 256 257 BELLESIP_EXPORT belle_sip_header_diversion_t* belle_sip_header_diversion_create(const belle_sip_header_address_t *address, const char *tag); 258 259 BELLESIP_EXPORT belle_sip_header_diversion_t* belle_sip_header_diversion_create2(const char *address, const char *tag); 260 261 BELLESIP_EXPORT void belle_sip_header_diversion_set_tag(belle_sip_header_diversion_t* diversion, const char* tag); 262 263 BELLESIP_EXPORT const char* belle_sip_header_diversion_get_tag(const belle_sip_header_diversion_t* from); 264 265 BELLESIP_EXPORT void belle_sip_header_diversion_set_random_tag(belle_sip_header_diversion_t *obj); 266 267 #define BELLE_SIP_HEADER_DIVERSION(t) BELLE_SIP_CAST(t,belle_sip_header_diversion_t) 268 #define BELLE_SIP_DIVERSION "Diversion" 269 270 /****************************** 271 * Via header object inherent from header_address 272 * 273 ******************************/ 274 typedef struct _belle_sip_header_via belle_sip_header_via_t; 275 276 BELLESIP_EXPORT belle_sip_header_via_t* belle_sip_header_via_new(void); 277 BELLESIP_EXPORT belle_sip_header_via_t* belle_sip_header_via_create(const char *host, int port, const char *transport, const char *branch); 278 BELLESIP_EXPORT belle_sip_header_via_t* belle_sip_header_via_parse (const char* via) ; 279 BELLESIP_EXPORT const char* belle_sip_header_via_get_branch(const belle_sip_header_via_t* via); 280 BELLESIP_EXPORT const char* belle_sip_header_via_get_transport(const belle_sip_header_via_t* via); 281 /** 282 * Get lower case version of the transport 283 * @return the lower case version of the transport if from tcp,udp,tls or dtls else, return the value from #belle_sip_header_via_get_transport 284 */ 285 BELLESIP_EXPORT const char* belle_sip_header_via_get_transport_lowercase(const belle_sip_header_via_t* via); 286 BELLESIP_EXPORT const char* belle_sip_header_via_get_host(const belle_sip_header_via_t* via); 287 BELLESIP_EXPORT int belle_sip_header_via_get_port(const belle_sip_header_via_t* via); 288 BELLESIP_EXPORT int belle_sip_header_via_get_listening_port(const belle_sip_header_via_t *via); 289 290 BELLESIP_EXPORT const char* belle_sip_header_via_get_maddr(const belle_sip_header_via_t* via); 291 BELLESIP_EXPORT const char* belle_sip_header_via_get_protocol(const belle_sip_header_via_t* via); 292 BELLESIP_EXPORT const char* belle_sip_header_via_get_received(const belle_sip_header_via_t* via); 293 BELLESIP_EXPORT int belle_sip_header_via_get_rport(const belle_sip_header_via_t* via); 294 BELLESIP_EXPORT int belle_sip_header_via_get_ttl(const belle_sip_header_via_t* via); 295 296 BELLESIP_EXPORT void belle_sip_header_via_set_branch(belle_sip_header_via_t* via,const char* branch); 297 BELLESIP_EXPORT void belle_sip_header_via_set_host(belle_sip_header_via_t* via, const char* host); 298 BELLESIP_EXPORT int belle_sip_header_via_set_port(belle_sip_header_via_t* via,int port); 299 BELLESIP_EXPORT void belle_sip_header_via_set_maddr(belle_sip_header_via_t* via, const char* maddr); 300 BELLESIP_EXPORT void belle_sip_header_via_set_protocol(belle_sip_header_via_t* via, const char* protocol); 301 BELLESIP_EXPORT void belle_sip_header_via_set_received(belle_sip_header_via_t* via, const char* received); 302 BELLESIP_EXPORT int belle_sip_header_via_set_rport(belle_sip_header_via_t* via,int rport); 303 BELLESIP_EXPORT void belle_sip_header_via_set_transport(belle_sip_header_via_t* via,const char* transport); 304 BELLESIP_EXPORT int belle_sip_header_via_set_ttl(belle_sip_header_via_t* via, int ttl); 305 #define BELLE_SIP_HEADER_VIA(t) BELLE_SIP_CAST(t,belle_sip_header_via_t) 306 #define BELLE_SIP_VIA "Via" 307 308 /****************************** 309 * Call id object inherent from object 310 * 311 ******************************/ 312 typedef struct _belle_sip_header_call_id belle_sip_header_call_id_t; 313 314 BELLESIP_EXPORT belle_sip_header_call_id_t* belle_sip_header_call_id_new(void); 315 316 BELLESIP_EXPORT belle_sip_header_call_id_t* belle_sip_header_call_id_parse (const char* call_id) ; 317 BELLESIP_EXPORT const char* belle_sip_header_call_id_get_call_id(const belle_sip_header_call_id_t* call_id); 318 BELLESIP_EXPORT void belle_sip_header_call_id_set_call_id(belle_sip_header_call_id_t* call_id,const char* id); 319 unsigned int belle_sip_header_call_id_equals(const belle_sip_header_call_id_t* a,const belle_sip_header_call_id_t* b); 320 #define BELLE_SIP_HEADER_CALL_ID(t) BELLE_SIP_CAST(t,belle_sip_header_call_id_t) 321 #define BELLE_SIP_CALL_ID "Call-ID" 322 /****************************** 323 * cseq object inherent from object 324 * 325 ******************************/ 326 typedef struct _belle_sip_header_cseq belle_sip_header_cseq_t; 327 328 BELLESIP_EXPORT belle_sip_header_cseq_t* belle_sip_header_cseq_new(void); 329 BELLESIP_EXPORT belle_sip_header_cseq_t* belle_sip_header_cseq_create(unsigned int number, const char *method); 330 BELLESIP_EXPORT belle_sip_header_cseq_t* belle_sip_header_cseq_parse (const char* cseq) ; 331 BELLESIP_EXPORT const char* belle_sip_header_cseq_get_method(const belle_sip_header_cseq_t* cseq); 332 BELLESIP_EXPORT void belle_sip_header_cseq_set_method(belle_sip_header_cseq_t* cseq,const char* method); 333 BELLESIP_EXPORT unsigned int belle_sip_header_cseq_get_seq_number(const belle_sip_header_cseq_t* cseq); 334 BELLESIP_EXPORT void belle_sip_header_cseq_set_seq_number(belle_sip_header_cseq_t* cseq,unsigned int seq_number); 335 #define BELLE_SIP_HEADER_CSEQ(t) BELLE_SIP_CAST(t,belle_sip_header_cseq_t) 336 #define BELLE_SIP_CSEQ "CSeq" 337 /****************************** 338 * content type object inherent from parameters 339 * 340 ******************************/ 341 typedef struct _belle_sip_header_content_type belle_sip_header_content_type_t; 342 343 BELLESIP_EXPORT belle_sip_header_content_type_t* belle_sip_header_content_type_new(void); 344 BELLESIP_EXPORT belle_sip_header_content_type_t* belle_sip_header_content_type_parse (const char* content_type) ; 345 BELLESIP_EXPORT belle_sip_header_content_type_t* belle_sip_header_content_type_create (const char* type,const char* sub_type) ; 346 347 BELLESIP_EXPORT belle_sip_header_content_type_t* belle_sip_header_content_type_parse (const char* content_type) ; 348 BELLESIP_EXPORT const char* belle_sip_header_content_type_get_type(const belle_sip_header_content_type_t* content_type); 349 BELLESIP_EXPORT void belle_sip_header_content_type_set_type(belle_sip_header_content_type_t* content_type,const char* type); 350 BELLESIP_EXPORT const char* belle_sip_header_content_type_get_subtype(const belle_sip_header_content_type_t* content_type); 351 BELLESIP_EXPORT void belle_sip_header_content_type_set_subtype(belle_sip_header_content_type_t* content_type,const char* sub_type); 352 #define BELLE_SIP_HEADER_CONTENT_TYPE(t) BELLE_SIP_CAST(t,belle_sip_header_content_type_t) 353 #define BELLE_SIP_CONTENT_TYPE "Content-Type" 354 /****************************** 355 * 356 * Expires inherit from header 357 * 358 ******************************/ 359 typedef struct _belle_sip_header_expires belle_sip_header_expires_t; 360 361 BELLESIP_EXPORT belle_sip_header_expires_t* belle_sip_header_expires_new(void); 362 363 BELLESIP_EXPORT belle_sip_header_expires_t* belle_sip_header_expires_parse (const char* expires) ; 364 BELLESIP_EXPORT int belle_sip_header_expires_get_expires(const belle_sip_header_expires_t* expires); 365 BELLESIP_EXPORT void belle_sip_header_expires_set_expires(belle_sip_header_expires_t* expires,int value); 366 BELLESIP_EXPORT int belle_sip_header_expires_decrement_expires(belle_sip_header_expires_t* expires); 367 BELLESIP_EXPORT belle_sip_header_expires_t* belle_sip_header_expires_create(int expires); 368 #define BELLE_SIP_HEADER_EXPIRES(t) BELLE_SIP_CAST(t,belle_sip_header_expires_t) 369 #define BELLE_SIP_EXPIRES "Expires" 370 /****************************** 371 * Route header object inherent from header_address 372 * 373 ******************************/ 374 typedef struct _belle_sip_header_route belle_sip_header_route_t; 375 376 BELLESIP_EXPORT belle_sip_header_route_t* belle_sip_header_route_new(void); 377 BELLESIP_EXPORT belle_sip_header_route_t* belle_sip_header_route_parse (const char* route) ; 378 BELLESIP_EXPORT belle_sip_header_route_t* belle_sip_header_route_create(const belle_sip_header_address_t* route); 379 380 #define BELLE_SIP_HEADER_ROUTE(t) BELLE_SIP_CAST(t,belle_sip_header_route_t) 381 #define BELLE_SIP_ROUTE "Route" 382 /****************************** 383 * Record route header object inherent from header_address 384 * 385 ******************************/ 386 typedef struct _belle_sip_header_record_route belle_sip_header_record_route_t; 387 388 BELLESIP_EXPORT belle_sip_header_record_route_t* belle_sip_header_record_route_new(void); 389 BELLESIP_EXPORT belle_sip_header_record_route_t* belle_sip_header_record_route_parse (const char* route); 390 BELLESIP_EXPORT belle_sip_header_record_route_t* belle_sip_header_record_route_new_auto_outgoing(void); 391 392 BELLESIP_EXPORT unsigned char belle_sip_header_record_route_get_auto_outgoing(const belle_sip_header_record_route_t *a); 393 394 395 396 #define BELLE_SIP_HEADER_RECORD_ROUTE(t) BELLE_SIP_CAST(t,belle_sip_header_record_route_t) 397 #define BELLE_SIP_RECORD_ROUTE "Record-route" 398 /****************************** 399 * Service route header object inherent from header_address 400 * 401 ******************************/ 402 typedef struct _belle_sip_header_service_route belle_sip_header_service_route_t; 403 404 BELLESIP_EXPORT belle_sip_header_service_route_t* belle_sip_header_service_route_new(void); 405 BELLESIP_EXPORT belle_sip_header_service_route_t* belle_sip_header_service_route_parse (const char* route) ; 406 407 #define BELLE_SIP_HEADER_SERVICE_ROUTE(t) BELLE_SIP_CAST(t,belle_sip_header_service_route_t) 408 #define BELLE_SIP_SERVICE_ROUTE "Service-route" 409 /****************************** 410 * 411 * user-Agent header inherit from header 412 * 413 ******************************/ 414 typedef struct _belle_sip_header_user_agent belle_sip_header_user_agent_t; 415 416 BELLESIP_EXPORT belle_sip_header_user_agent_t* belle_sip_header_user_agent_new(void); 417 418 BELLESIP_EXPORT belle_sip_header_user_agent_t* belle_sip_header_user_agent_parse (const char* user_agent) ; 419 BELLESIP_EXPORT belle_sip_list_t* belle_sip_header_user_agent_get_products(const belle_sip_header_user_agent_t* user_agent); 420 /** 421 * concatenates products 422 * @param user_agent [in] user agent header 423 * @param value [out]buffer where to put result in 424 * @param value_size [in] size of the buffer 425 * @return number of written characters or -1 inca se of error; 426 */ 427 BELLESIP_EXPORT int belle_sip_header_user_agent_get_products_as_string(const belle_sip_header_user_agent_t* user_agent,char* value,unsigned int value_size); 428 BELLESIP_EXPORT void belle_sip_header_user_agent_set_products(belle_sip_header_user_agent_t* user_agent,belle_sip_list_t* value); 429 BELLESIP_EXPORT void belle_sip_header_user_agent_add_product(belle_sip_header_user_agent_t* user_agent,const char* product); 430 #define BELLE_SIP_HEADER_USER_AGENT(t) BELLE_SIP_CAST(t,belle_sip_header_user_agent_t) 431 #define BELLE_SIP_USER_AGENT "User-Agent" 432 433 /****************************** 434 * Content length inherent from object 435 * 436 ******************************/ 437 typedef struct _belle_sip_header_content_length belle_sip_header_content_length_t; 438 439 BELLESIP_EXPORT belle_sip_header_content_length_t* belle_sip_header_content_length_new(void); 440 441 BELLESIP_EXPORT belle_sip_header_content_length_t* belle_sip_header_content_length_parse (const char* content_length) ; 442 BELLESIP_EXPORT belle_sip_header_content_length_t* belle_sip_header_content_length_create (size_t content_length) ; 443 BELLESIP_EXPORT size_t belle_sip_header_content_length_get_content_length(const belle_sip_header_content_length_t* content_length); 444 BELLESIP_EXPORT void belle_sip_header_content_length_set_content_length(belle_sip_header_content_length_t* content_length,size_t length); 445 #define BELLE_SIP_HEADER_CONTENT_LENGTH(t) BELLE_SIP_CAST(t,belle_sip_header_content_length_t) 446 #define BELLE_SIP_CONTENT_LENGTH "Content-Length" 447 448 /****************************** 449 * authorization header inherit from parameters 450 * 451 ******************************/ 452 typedef struct _belle_sip_header_authorization belle_sip_header_authorization_t; 453 454 BELLESIP_EXPORT belle_sip_header_authorization_t* belle_sip_header_authorization_new(void); 455 BELLESIP_EXPORT belle_sip_header_authorization_t* belle_sip_header_authorization_parse(const char* authorization); 456 BELLESIP_EXPORT const char* belle_sip_header_authorization_get_algorithm(const belle_sip_header_authorization_t* authorization ); 457 BELLESIP_EXPORT const char* belle_sip_header_authorization_get_cnonce(const belle_sip_header_authorization_t* authorization ); 458 BELLESIP_EXPORT const char* belle_sip_header_authorization_get_nonce(const belle_sip_header_authorization_t* authorization); 459 /*convert nonce count as string id present 460 * @return 0 in case of success 461 * */ 462 BELLESIP_EXPORT int belle_sip_header_authorization_get_nonce_count_as_string(const belle_sip_header_authorization_t* authorization,char nounce_count[9]); 463 BELLESIP_EXPORT int belle_sip_header_authorization_get_nonce_count(const belle_sip_header_authorization_t* authorization); 464 BELLESIP_EXPORT const char* belle_sip_header_authorization_get_opaque(const belle_sip_header_authorization_t* authorization); 465 BELLESIP_EXPORT const char* belle_sip_header_authorization_get_qop(const belle_sip_header_authorization_t* authorization); 466 BELLESIP_EXPORT const char* belle_sip_header_authorization_get_realm(const belle_sip_header_authorization_t* authorization); 467 BELLESIP_EXPORT const char* belle_sip_header_authorization_get_response(const belle_sip_header_authorization_t* authorization); 468 BELLESIP_EXPORT const char* belle_sip_header_authorization_get_scheme(const belle_sip_header_authorization_t* authorization); 469 BELLESIP_EXPORT belle_sip_uri_t* belle_sip_header_authorization_get_uri(const belle_sip_header_authorization_t* authorization); 470 BELLESIP_EXPORT const char* belle_sip_header_authorization_get_username(const belle_sip_header_authorization_t* authorization); 471 BELLESIP_EXPORT void belle_sip_header_authorization_set_algorithm(belle_sip_header_authorization_t* authorization, const char* algorithm); 472 BELLESIP_EXPORT void belle_sip_header_authorization_set_cnonce(belle_sip_header_authorization_t* authorization, const char* cNonce); 473 BELLESIP_EXPORT void belle_sip_header_authorization_set_nonce(belle_sip_header_authorization_t* authorization, const char* nonce); 474 BELLESIP_EXPORT void belle_sip_header_authorization_set_nonce_count(belle_sip_header_authorization_t* authorization, int nonceCount); 475 BELLESIP_EXPORT void belle_sip_header_authorization_set_opaque(belle_sip_header_authorization_t* authorization, const char* opaque); 476 BELLESIP_EXPORT void belle_sip_header_authorization_set_qop(belle_sip_header_authorization_t* authorization, const char* qop); 477 BELLESIP_EXPORT void belle_sip_header_authorization_add_qop(belle_sip_header_authorization_t* authorization, const char* qop); 478 BELLESIP_EXPORT void belle_sip_header_authorization_set_realm(belle_sip_header_authorization_t* authorization, const char* realm); 479 BELLESIP_EXPORT void belle_sip_header_authorization_set_response(belle_sip_header_authorization_t* authorization, const char* response); 480 BELLESIP_EXPORT void belle_sip_header_authorization_set_scheme(belle_sip_header_authorization_t* authorization, const char* scheme); 481 BELLESIP_EXPORT void belle_sip_header_authorization_set_uri(belle_sip_header_authorization_t* authorization, belle_sip_uri_t* uri); 482 BELLESIP_EXPORT void belle_sip_header_authorization_set_username(belle_sip_header_authorization_t* authorization, const char* username); 483 484 #define BELLE_SIP_HEADER_AUTHORIZATION(t) BELLE_SIP_CAST(t,belle_sip_header_authorization_t) 485 #define BELLE_SIP_AUTHORIZATION "Authorization" 486 487 /******************************* 488 * proxy_authorization inherit from Authorization 489 */ 490 typedef struct _belle_sip_header_proxy_authorization belle_sip_header_proxy_authorization_t; 491 BELLESIP_EXPORT belle_sip_header_proxy_authorization_t* belle_sip_header_proxy_authorization_new(void); 492 BELLESIP_EXPORT belle_sip_header_proxy_authorization_t* belle_sip_header_proxy_authorization_parse(const char* proxy_authorization); 493 #define BELLE_SIP_HEADER_PROXY_AUTHORIZATION(t) BELLE_SIP_CAST(t,belle_sip_header_proxy_authorization_t) 494 #define BELLE_SIP_PROXY_AUTHORIZATION "Proxy-Authorization" 495 496 /******************************* 497 * http_authorization inherit from Authorization 498 */ 499 typedef struct _belle_http_header_authorization belle_http_header_authorization_t; 500 BELLESIP_EXPORT belle_http_header_authorization_t* belle_http_header_authorization_new(void); 501 /*cannot be parsed for now 502 BELLESIP_EXPORT belle_http_header_authorization_t* belle_http_header_authorization_parse(const char* proxy_authorization); 503 */ 504 BELLESIP_EXPORT void belle_http_header_authorization_set_uri(belle_http_header_authorization_t* authorization, belle_generic_uri_t* uri); 505 BELLESIP_EXPORT belle_generic_uri_t* belle_http_header_authorization_get_uri(const belle_http_header_authorization_t* authorization); 506 #define BELLE_HTTP_HEADER_AUTHORIZATION(t) BELLE_SIP_CAST(t,belle_http_header_authorization_t) 507 #define BELLE_HTTP_AUTHORIZATION "Authorization" 508 509 510 /******************************* 511 * www_authenticate inherit from parameters 512 */ 513 typedef struct _belle_sip_header_www_authenticate belle_sip_header_www_authenticate_t; 514 BELLESIP_EXPORT belle_sip_header_www_authenticate_t* belle_sip_header_www_authenticate_new(void); 515 BELLESIP_EXPORT belle_sip_header_www_authenticate_t* belle_sip_header_www_authenticate_parse(const char* www_authenticate); 516 BELLESIP_EXPORT const char* belle_sip_header_www_authenticate_get_algorithm(const belle_sip_header_www_authenticate_t* www_authenticate ); 517 BELLESIP_EXPORT const char* belle_sip_header_www_authenticate_get_nonce(const belle_sip_header_www_authenticate_t* www_authenticate); 518 BELLESIP_EXPORT const char* belle_sip_header_www_authenticate_get_opaque(const belle_sip_header_www_authenticate_t* www_authenticate); 519 BELLESIP_EXPORT belle_sip_list_t* belle_sip_header_www_authenticate_get_qop(const belle_sip_header_www_authenticate_t* www_authetication); 520 BELLESIP_EXPORT const char* belle_sip_header_www_authenticate_get_qop_first(const belle_sip_header_www_authenticate_t* www_authetication); 521 BELLESIP_EXPORT const char* belle_sip_header_www_authenticate_get_realm(const belle_sip_header_www_authenticate_t* www_authenticate); 522 BELLESIP_EXPORT const char* belle_sip_header_www_authenticate_get_scheme(const belle_sip_header_www_authenticate_t* www_authenticate); 523 BELLESIP_EXPORT const char* belle_sip_header_www_authenticate_get_domain(const belle_sip_header_www_authenticate_t* www_authenticate); 524 BELLESIP_EXPORT unsigned int belle_sip_header_www_authenticate_is_stale(const belle_sip_header_www_authenticate_t* www_authenticate); 525 BELLESIP_EXPORT void belle_sip_header_www_authenticate_set_algorithm(belle_sip_header_www_authenticate_t* www_authenticate, const char* algorithm); 526 BELLESIP_EXPORT void belle_sip_header_www_authenticate_set_nonce(belle_sip_header_www_authenticate_t* www_authenticate, const char* nonce); 527 BELLESIP_EXPORT void belle_sip_header_www_authenticate_set_opaque(belle_sip_header_www_authenticate_t* www_authenticate, const char* opaque); 528 BELLESIP_EXPORT void belle_sip_header_www_authenticate_set_qop(belle_sip_header_www_authenticate_t* www_authentication, belle_sip_list_t* qop); 529 BELLESIP_EXPORT void belle_sip_header_www_authenticate_add_qop(belle_sip_header_www_authenticate_t* www_authentication, const char* qop_param); 530 BELLESIP_EXPORT void belle_sip_header_www_authenticate_set_realm(belle_sip_header_www_authenticate_t* www_authenticate, const char* realm); 531 BELLESIP_EXPORT void belle_sip_header_www_authenticate_set_scheme(belle_sip_header_www_authenticate_t* www_authenticate, const char* scheme); 532 BELLESIP_EXPORT void belle_sip_header_www_authenticate_set_domain(belle_sip_header_www_authenticate_t* www_authenticate,const char* domain); 533 BELLESIP_EXPORT void belle_sip_header_www_authenticate_set_stale(belle_sip_header_www_authenticate_t* www_authenticate, unsigned int enable); 534 #define BELLE_SIP_HEADER_WWW_AUTHENTICATE(t) BELLE_SIP_CAST(t,belle_sip_header_www_authenticate_t) 535 #define BELLE_SIP_WWW_AUTHENTICATE "WWW-Authenticate" 536 537 /******************************* 538 * proxy_authenticate inherit from www_authenticate 539 */ 540 typedef struct _belle_sip_header_proxy_authenticate belle_sip_header_proxy_authenticate_t; 541 BELLESIP_EXPORT belle_sip_header_proxy_authenticate_t* belle_sip_header_proxy_authenticate_new(void); 542 BELLESIP_EXPORT belle_sip_header_proxy_authenticate_t* belle_sip_header_proxy_authenticate_parse(const char* proxy_authenticate); 543 #define BELLE_SIP_HEADER_PROXY_AUTHENTICATE(t) BELLE_SIP_CAST(t,belle_sip_header_proxy_authenticate_t) 544 #define BELLE_SIP_PROXY_AUTHENTICATE "Proxy-Authenticate" 545 546 /****************************** 547 * 548 * Max forward inherit from header 549 * 550 ******************************/ 551 typedef struct _belle_sip_header_max_forwards belle_sip_header_max_forwards_t; 552 553 BELLESIP_EXPORT belle_sip_header_max_forwards_t* belle_sip_header_max_forwards_new(void); 554 BELLESIP_EXPORT belle_sip_header_max_forwards_t* belle_sip_header_max_forwards_create(int value); 555 556 BELLESIP_EXPORT belle_sip_header_max_forwards_t* belle_sip_header_max_forwards_parse (const char* max_forwards) ; 557 BELLESIP_EXPORT int belle_sip_header_max_forwards_get_max_forwards(const belle_sip_header_max_forwards_t* max_forwards); 558 BELLESIP_EXPORT void belle_sip_header_max_forwards_set_max_forwards(belle_sip_header_max_forwards_t* max_forwards,int value); 559 BELLESIP_EXPORT int belle_sip_header_max_forwards_decrement_max_forwards(belle_sip_header_max_forwards_t* max_forwards); 560 #define BELLE_SIP_HEADER_MAX_FORWARDS(t) BELLE_SIP_CAST(t,belle_sip_header_max_forwards_t) 561 #define BELLE_SIP_MAX_FORWARDS "Max-Forwards" 562 563 /****************************** 564 * 565 * Subscription state inherit from parameters 566 * 567 ******************************/ 568 typedef struct _belle_sip_header_subscription_state belle_sip_header_subscription_state_t; 569 570 BELLESIP_EXPORT belle_sip_header_subscription_state_t* belle_sip_header_subscription_state_new(void); 571 572 BELLESIP_EXPORT belle_sip_header_subscription_state_t* belle_sip_header_subscription_state_parse (const char* subscription_state) ; 573 BELLESIP_EXPORT belle_sip_header_subscription_state_t* belle_sip_header_subscription_state_create (const char* subscription_state,int expires); 574 575 BELLESIP_EXPORT const char* belle_sip_header_subscription_state_get_state(const belle_sip_header_subscription_state_t* subscription_state); 576 BELLESIP_EXPORT int belle_sip_header_subscription_state_get_expires(const belle_sip_header_subscription_state_t* subscription_state); 577 BELLESIP_EXPORT const char* belle_sip_header_subscription_state_get_reason(const belle_sip_header_subscription_state_t* subscription_state); 578 BELLESIP_EXPORT int belle_sip_header_subscription_state_get_retry_after(const belle_sip_header_subscription_state_t* subscription_state); 579 580 BELLESIP_EXPORT void belle_sip_header_subscription_state_set_state(belle_sip_header_subscription_state_t* subscription_state,const char* state); 581 BELLESIP_EXPORT void belle_sip_header_subscription_state_set_expires(belle_sip_header_subscription_state_t* subscription_state,int expire); 582 BELLESIP_EXPORT void belle_sip_header_subscription_state_set_reason(belle_sip_header_subscription_state_t* subscription_state, const char* reason); 583 BELLESIP_EXPORT void belle_sip_header_subscription_state_set_retry_after(belle_sip_header_subscription_state_t* subscription_state, int retry_after ); 584 585 586 #define BELLE_SIP_HEADER_SUBSCRIPTION_STATE(t) BELLE_SIP_CAST(t,belle_sip_header_subscription_state_t) 587 #define BELLE_SIP_SUBSCRIPTION_STATE "Subscription-State" 588 #define BELLE_SIP_SUBSCRIPTION_STATE_ACTIVE "active" 589 #define BELLE_SIP_SUBSCRIPTION_STATE_PENDING "pending" 590 #define BELLE_SIP_SUBSCRIPTION_STATE_TERMINATED "terminated" 591 592 /****************************** 593 * Refer-To header object inherent from header_address 594 * 595 ******************************/ 596 typedef struct _belle_sip_header_refer_to belle_sip_header_refer_to_t; 597 BELLESIP_EXPORT belle_sip_header_refer_to_t* belle_sip_header_refer_to_new(void); 598 BELLESIP_EXPORT belle_sip_header_refer_to_t* belle_sip_header_refer_to_parse(const char* refer_to) ; 599 BELLESIP_EXPORT belle_sip_header_refer_to_t* belle_sip_header_refer_to_create(const belle_sip_header_address_t *address); 600 #define BELLE_SIP_HEADER_REFER_TO(t) BELLE_SIP_CAST(t,belle_sip_header_refer_to_t) 601 #define BELLE_SIP_REFER_TO "Refer-To" 602 603 /****************************** 604 * Referred-by header object inherent from header_address 605 * 606 ******************************/ 607 typedef struct _belle_sip_header_referred_by belle_sip_header_referred_by_t; 608 BELLESIP_EXPORT belle_sip_header_referred_by_t* belle_sip_header_referred_by_new(void); 609 BELLESIP_EXPORT belle_sip_header_referred_by_t* belle_sip_header_referred_by_parse(const char* referred_by) ; 610 BELLESIP_EXPORT belle_sip_header_referred_by_t* belle_sip_header_referred_by_create(const belle_sip_header_address_t *address); 611 #define BELLE_SIP_HEADER_REFERRED_BY(t) BELLE_SIP_CAST(t,belle_sip_header_referred_by_t) 612 #define BELLE_SIP_REFERRED_BY "Referred-By" 613 614 /****************************** 615 * Replace header object inherent from parameters 616 * 617 ******************************/ 618 typedef struct _belle_sip_header_replaces belle_sip_header_replaces_t; 619 BELLESIP_EXPORT belle_sip_header_replaces_t* belle_sip_header_replaces_new(void); 620 BELLESIP_EXPORT belle_sip_header_replaces_t* belle_sip_header_replaces_parse(const char* replaces) ; 621 622 BELLESIP_EXPORT belle_sip_header_replaces_t* belle_sip_header_replaces_create(const char* call_id,const char* from_tag,const char* to_tag); 623 /* 624 * Creates a Eeplaces header from an escaped value that can be found in Referred-by header 625 * @param escaped_replace ex : 12345%40192.168.118.3%3Bto-tag%3D12345%3Bfrom-tag%3D5FFE-3994 626 * @return a newly allocated Replace header 627 * */ 628 BELLESIP_EXPORT belle_sip_header_replaces_t* belle_sip_header_replaces_create2(const char* escaped_replace); 629 BELLESIP_EXPORT const char* belle_sip_header_replaces_get_call_id(const belle_sip_header_replaces_t* obj); 630 BELLESIP_EXPORT const char* belle_sip_header_replaces_get_from_tag(const belle_sip_header_replaces_t* obj); 631 BELLESIP_EXPORT const char* belle_sip_header_replaces_get_to_tag(const belle_sip_header_replaces_t* obj); 632 BELLESIP_EXPORT void belle_sip_header_replaces_set_call_id(belle_sip_header_replaces_t* obj, const char* callid); 633 BELLESIP_EXPORT void belle_sip_header_replaces_set_from_tag(belle_sip_header_replaces_t* obj,const char* from_tag); 634 BELLESIP_EXPORT void belle_sip_header_replaces_set_to_tag(belle_sip_header_replaces_t* obj,const char* to_tag); 635 /*return a newly allocated string with the content of the header value in escaped form. 636 * <br> Purpose of this function is to be used to set Refer-To uri header Replaces 637 * @param obj Replaces object 638 * @return newly allocated string ex: 12345%40192.168.118.3%3Bto-tag%3D12345%3Bfrom-tag%3D5FFE-3994*/ 639 BELLESIP_EXPORT char* belle_sip_header_replaces_value_to_escaped_string(const belle_sip_header_replaces_t* obj); 640 #define BELLE_SIP_HEADER_REPLACES(t) BELLE_SIP_CAST(t,belle_sip_header_replaces_t) 641 #define BELLE_SIP_REPLACES "Replaces" 642 643 /******* 644 * Date header 645 *******/ 646 647 typedef struct belle_sip_header_date belle_sip_header_date_t; 648 649 BELLESIP_EXPORT belle_sip_header_date_t* belle_sip_header_date_new(void); 650 BELLESIP_EXPORT belle_sip_header_date_t* belle_sip_header_date_parse(const char* date) ; 651 652 BELLESIP_EXPORT belle_sip_header_date_t* belle_sip_header_date_create_from_time(const time_t *utc_time); 653 654 BELLESIP_EXPORT time_t belle_sip_header_date_get_time(belle_sip_header_date_t *obj); 655 656 BELLESIP_EXPORT void belle_sip_header_date_set_time(belle_sip_header_date_t *obj, const time_t *utc_time); 657 658 BELLESIP_EXPORT const char * belle_sip_header_date_get_date(const belle_sip_header_date_t *obj); 659 660 BELLESIP_EXPORT void belle_sip_header_date_set_date(belle_sip_header_date_t *obj, const char *date); 661 662 #define BELLE_SIP_HEADER_DATE(obj) BELLE_SIP_CAST(obj,belle_sip_header_date_t) 663 #define BELLE_SIP_DATE "Date" 664 665 /****************************** 666 * P-Preferred-Identity header object inherent from header_address 667 * 668 ******************************/ 669 typedef struct _belle_sip_header_p_preferred_identity belle_sip_header_p_preferred_identity_t; 670 671 BELLESIP_EXPORT belle_sip_header_p_preferred_identity_t* belle_sip_header_p_preferred_identity_new(void); 672 673 BELLESIP_EXPORT belle_sip_header_p_preferred_identity_t* belle_sip_header_p_preferred_identity_parse(const char* p_preferred_identity) ; 674 675 BELLESIP_EXPORT belle_sip_header_p_preferred_identity_t* belle_sip_header_p_preferred_identity_create(const belle_sip_header_address_t *address); 676 677 #define BELLE_SIP_HEADER_P_PREFERRED_IDENTITY(t) BELLE_SIP_CAST(t,belle_sip_header_p_preferred_identity_t) 678 #define BELLE_SIP_P_PREFERRED_IDENTITY "P-Preferred-Identity" 679 680 /****************************** 681 * Privacy header object inherent from header 682 * 683 ******************************/ 684 typedef struct _belle_sip_header_privacy belle_sip_header_privacy_t; 685 686 BELLESIP_EXPORT belle_sip_header_privacy_t* belle_sip_header_privacy_new(void); 687 688 BELLESIP_EXPORT belle_sip_header_privacy_t* belle_sip_header_privacy_parse(const char* privacy) ; 689 690 BELLESIP_EXPORT belle_sip_header_privacy_t* belle_sip_header_privacy_create(const char* privacy); 691 692 BELLESIP_EXPORT void belle_sip_header_privacy_add_privacy(belle_sip_header_privacy_t* privacy, const char* value); 693 694 BELLESIP_EXPORT void belle_sip_header_privacy_set_privacy(belle_sip_header_privacy_t* privacy, belle_sip_list_t* privacy_values); 695 696 BELLESIP_EXPORT belle_sip_list_t* belle_sip_header_privacy_get_privacy(const belle_sip_header_privacy_t* privacy); 697 698 699 #define BELLE_SIP_HEADER_PRIVACY(t) BELLE_SIP_CAST(t,belle_sip_header_privacy_t) 700 #define BELLE_SIP_PRIVACY "Privacy" 701 702 703 /****************************** 704 * Event header object inherent from parameters 705 * 706 ******************************/ 707 typedef struct _belle_sip_header_event belle_sip_header_event_t; 708 BELLESIP_EXPORT belle_sip_header_event_t* belle_sip_header_event_new(void); 709 BELLESIP_EXPORT belle_sip_header_event_t* belle_sip_header_event_parse(const char* event) ; 710 BELLESIP_EXPORT belle_sip_header_event_t* belle_sip_header_event_create(const char* event); 711 BELLESIP_EXPORT const char* belle_sip_header_event_get_package_name(const belle_sip_header_event_t* event); 712 BELLESIP_EXPORT void belle_sip_header_event_set_package_name(belle_sip_header_event_t* event, const char* package_name); 713 BELLESIP_EXPORT const char* belle_sip_header_event_get_id(const belle_sip_header_event_t* event); 714 BELLESIP_EXPORT void belle_sip_header_event_set_id(belle_sip_header_event_t* event, const char* id); 715 #define BELLE_SIP_HEADER_EVENT(t) BELLE_SIP_CAST(t,belle_sip_header_event_t) 716 #define BELLE_SIP_EVENT "Event" 717 718 719 /****************************** 720 * Supported header object inherent from header 721 * 722 ******************************/ 723 typedef struct _belle_sip_header_supported belle_sip_header_supported_t; 724 BELLESIP_EXPORT belle_sip_header_supported_t* belle_sip_header_supported_new(void); 725 BELLESIP_EXPORT belle_sip_header_supported_t* belle_sip_header_supported_parse(const char* supported) ; 726 BELLESIP_EXPORT belle_sip_header_supported_t* belle_sip_header_supported_create(const char* supported); 727 BELLESIP_EXPORT void belle_sip_header_supported_add_supported(belle_sip_header_supported_t* supported, const char* value); 728 BELLESIP_EXPORT void belle_sip_header_supported_set_supported(belle_sip_header_supported_t* supported, belle_sip_list_t* supported_values); 729 BELLESIP_EXPORT belle_sip_list_t* belle_sip_header_supported_get_supported(const belle_sip_header_supported_t* supported); 730 #define BELLE_SIP_HEADER_SUPPORTED(t) BELLE_SIP_CAST(t,belle_sip_header_supported_t) 731 #define BELLE_SIP_SUPPORTED "Supported" 732 733 /****************************** 734 * Content Disposition header object inherent from header 735 * 736 ******************************/ 737 typedef struct _belle_sip_header_content_disposition belle_sip_header_content_disposition_t; 738 BELLESIP_EXPORT belle_sip_header_content_disposition_t* belle_sip_header_content_disposition_new(void); 739 BELLESIP_EXPORT belle_sip_header_content_disposition_t* belle_sip_header_content_disposition_parse (const char* content_disposition) ; 740 BELLESIP_EXPORT belle_sip_header_content_disposition_t* belle_sip_header_content_disposition_create (const char* content_disposition); 741 BELLESIP_EXPORT const char* belle_sip_header_content_disposition_get_content_disposition(const belle_sip_header_content_disposition_t* content_disposition); 742 BELLESIP_EXPORT void belle_sip_header_content_disposition_set_content_disposition(belle_sip_header_content_disposition_t* obj,const char* content_disposition); 743 #define BELLE_SIP_HEADER_CONTENT_DISPOSITION(t) BELLE_SIP_CAST(t,belle_sip_header_content_disposition_t) 744 #define BELLE_SIP_CONTENT_DISPOSITION "Content-Disposition" 745 746 /****************************** 747 * Accept header object inherent from parameters 748 * 749 ******************************/ 750 typedef struct _belle_sip_header_accept belle_sip_header_accept_t; 751 BELLESIP_EXPORT belle_sip_header_accept_t* belle_sip_header_accept_new(void); 752 BELLESIP_EXPORT belle_sip_header_accept_t* belle_sip_header_accept_parse (const char* accept) ; 753 BELLESIP_EXPORT belle_sip_header_accept_t* belle_sip_header_accept_create (const char* type,const char* sub_type) ; 754 BELLESIP_EXPORT belle_sip_header_accept_t* belle_sip_header_accept_parse (const char* accept) ; 755 BELLESIP_EXPORT const char* belle_sip_header_accept_get_type(const belle_sip_header_accept_t* accept); 756 BELLESIP_EXPORT void belle_sip_header_accept_set_type(belle_sip_header_accept_t* accept,const char* type); 757 BELLESIP_EXPORT const char* belle_sip_header_accept_get_subtype(const belle_sip_header_accept_t* accept); 758 BELLESIP_EXPORT void belle_sip_header_accept_set_subtype(belle_sip_header_accept_t* accept,const char* sub_type); 759 #define BELLE_SIP_HEADER_ACCEPT(t) BELLE_SIP_CAST(t,belle_sip_header_accept_t) 760 #define BELLE_SIP_ACCEPT "Accept" 761 762 /****************************** 763 * Reason header object inherent from parameters 764 * 765 ******************************/ 766 typedef struct _belle_sip_header_reason belle_sip_header_reason_t; 767 BELLESIP_EXPORT belle_sip_header_reason_t* belle_sip_header_reason_new(void); 768 BELLESIP_EXPORT belle_sip_header_reason_t* belle_sip_header_reason_parse (const char* reason) ; 769 BELLESIP_EXPORT const char* belle_sip_header_reason_get_protocol(const belle_sip_header_reason_t* reason); 770 BELLESIP_EXPORT void belle_sip_header_reason_set_protocol(belle_sip_header_reason_t* reason,const char* protocol); 771 BELLESIP_EXPORT int belle_sip_header_reason_get_cause(const belle_sip_header_reason_t* reason); 772 BELLESIP_EXPORT void belle_sip_header_reason_set_cause(belle_sip_header_reason_t* reason,int cause); 773 BELLESIP_EXPORT void belle_sip_header_reason_set_text(belle_sip_header_reason_t* reason,const char* text); 774 BELLESIP_EXPORT const char* belle_sip_header_reason_get_text(const belle_sip_header_reason_t* reason); 775 776 #define BELLE_SIP_HEADER_REASON(t) BELLE_SIP_CAST(t,belle_sip_header_reason_t) 777 #define BELLE_SIP_REASON "Reason" 778 779 780 /****************************** 781 * Authentication-Info header inherit from header 782 * 783 ******************************/ 784 typedef struct _belle_sip_header_authentication_info belle_sip_header_authentication_info_t; 785 786 BELLESIP_EXPORT belle_sip_header_authentication_info_t* belle_sip_header_authentication_info_new(void); 787 BELLESIP_EXPORT belle_sip_header_authentication_info_t* belle_sip_header_authentication_info_parse(const char* authentication_info ); 788 BELLESIP_EXPORT const char* belle_sip_header_authentication_info_get_next_nonce(const belle_sip_header_authentication_info_t* authentication_info ); 789 BELLESIP_EXPORT void belle_sip_header_authentication_info_set_next_nonce(belle_sip_header_authentication_info_t* authentication_info, const char* next_nonce); 790 791 /*limited to a sinle value*/ 792 BELLESIP_EXPORT const char* belle_sip_header_authentication_info_get_qop(const belle_sip_header_authentication_info_t* authentication_info); 793 BELLESIP_EXPORT void belle_sip_header_authentication_info_set_qop(belle_sip_header_authentication_info_t* authentication_info, const char* qop); 794 795 BELLESIP_EXPORT const char* belle_sip_header_authentication_info_get_rsp_auth(const belle_sip_header_authentication_info_t* rsp_auth); 796 BELLESIP_EXPORT void belle_sip_header_authentication_info_set_rsp_auth(belle_sip_header_authentication_info_t* authentication_info, const char* rsp_auth); 797 798 BELLESIP_EXPORT const char* belle_sip_header_authentication_info_get_cnonce(const belle_sip_header_authentication_info_t* authentication_info); 799 BELLESIP_EXPORT void belle_sip_header_authentication_info_set_cnonce(belle_sip_header_authentication_info_t* authentication_info, const char* cNonce); 800 801 BELLESIP_EXPORT void belle_sip_header_authentication_info_set_nonce_count(belle_sip_header_authentication_info_t* authentication_info, int nonceCount); 802 BELLESIP_EXPORT int belle_sip_header_authentication_info_get_nonce_count(const belle_sip_header_authentication_info_t* authentication_info); 803 804 805 #define BELLE_SIP_HEADER_AUTHENTICATION_INFO(t) BELLE_SIP_CAST(t,belle_sip_header_authentication_info_t) 806 #define BELLE_SIP_AUTHENTICATION_INFO "Authentication-Info" 807 808 BELLE_SIP_END_DECLS 809 810 811 #endif /* HEADERS_H_ */ 812