SIP Witch 1.9.15
|
Data Structures | |
struct | osip_message |
Structure for SIP Message (REQUEST and RESPONSE). More... | |
Macros | |
#define | SIP_MESSAGE_MAX_LENGTH 8000 |
You can re-define your own maximum length for SIP message. More... | |
#define | BODY_MESSAGE_MAX_SIZE 4000 |
You can define the maximum length for a body inside a SIP message. More... | |
#define | MSG_IS_RESPONSE(msg) ((msg)->status_code!=0) |
Test if the message is a SIP RESPONSE. More... | |
#define | MSG_IS_REQUEST(msg) ((msg)->status_code==0) |
Test if the message is a SIP REQUEST. More... | |
#define | MSG_IS_INVITE(msg) |
Test if the message is an INVITE REQUEST. More... | |
#define | MSG_IS_ACK(msg) |
Test if the message is an ACK REQUEST. More... | |
#define | MSG_IS_REGISTER(msg) |
Test if the message is a REGISTER REQUEST. More... | |
#define | MSG_IS_BYE(msg) |
Test if the message is a BYE REQUEST. More... | |
#define | MSG_IS_OPTIONS(msg) |
Test if the message is an OPTIONS REQUEST. More... | |
#define | MSG_IS_INFO(msg) |
Test if the message is an INFO REQUEST. More... | |
#define | MSG_IS_CANCEL(msg) |
Test if the message is a CANCEL REQUEST. More... | |
#define | MSG_IS_REFER(msg) |
Test if the message is a REFER REQUEST. More... | |
#define | MSG_IS_NOTIFY(msg) |
Test if the message is a NOTIFY REQUEST. More... | |
#define | MSG_IS_SUBSCRIBE(msg) |
Test if the message is a SUBSCRIBE REQUEST. More... | |
#define | MSG_IS_MESSAGE(msg) |
Test if the message is a MESSAGE REQUEST. More... | |
#define | MSG_IS_PRACK(msg) |
Test if the message is a PRACK REQUEST (!! PRACK IS NOT SUPPORTED by the fsm!!) More... | |
#define | MSG_IS_UPDATE(msg) |
Test if the message is an UPDATE REQUEST. More... | |
#define | MSG_IS_PUBLISH(msg) |
Test if the message is an UPDATE REQUEST. More... | |
#define | MSG_IS_STATUS_1XX(msg) |
Test if the message is a response with status between 100 and 199. More... | |
#define | MSG_IS_STATUS_2XX(msg) |
Test if the message is a response with status between 200 and 299. More... | |
#define | MSG_IS_STATUS_3XX(msg) |
Test if the message is a response with status between 300 and 399. More... | |
#define | MSG_IS_STATUS_4XX(msg) |
Test if the message is a response with status between 400 and 499. More... | |
#define | MSG_IS_STATUS_5XX(msg) |
Test if the message is a response with status between 500 and 599. More... | |
#define | MSG_IS_STATUS_6XX(msg) |
Test if the message is a response with status between 600 and 699. More... | |
#define | MSG_TEST_CODE(msg, code) |
Test if the message is a response with a status set to the code value. More... | |
#define | MSG_IS_RESPONSE_FOR(msg, requestname) |
Test if the message is a response for a REQUEST of certain type. More... | |
#define | osip_generic_param_init(GP) osip_uri_param_init(GP) |
Allocate a generic parameter element. More... | |
#define | osip_generic_param_free(GP) osip_uri_param_free(GP) |
Free a generic parameter element. More... | |
#define | osip_generic_param_set(GP, NAME, VALUE) osip_uri_param_set(GP, NAME, VALUE) |
Set values of a generic parameter element. More... | |
#define | osip_generic_param_clone osip_uri_param_clone |
Clone a generic parameter element. More... | |
#define | osip_generic_param_freelist(LIST) osip_uri_param_freelist(LIST) |
#define | osip_generic_param_add(LIST, NAME, VALUE) osip_uri_param_add(LIST,NAME,VALUE) |
Allocate and add a generic parameter element in a list. More... | |
#define | osip_generic_param_get_byname(LIST, NAME, DEST) osip_uri_param_get_byname(LIST,NAME,DEST) |
Find in a generic parameter element in a list. More... | |
Typedefs | |
typedef struct osip_message | osip_message_t |
Structure for SIP Message (REQUEST and RESPONSE). More... | |
Functions | |
int | osip_message_init (osip_message_t **sip) |
Allocate a osip_message_t element. More... | |
void | osip_message_free (osip_message_t *sip) |
Free all resource in a osip_message_t element. More... | |
int | osip_message_parse (osip_message_t *sip, const char *buf, size_t length) |
Parse a osip_message_t element. More... | |
int | osip_message_parse_sipfrag (osip_message_t *sip, const char *buf, size_t length) |
Parse a message/sipfrag part and store it in an osip_message_t element. More... | |
int | osip_message_to_str (osip_message_t *sip, char **dest, size_t *message_length) |
Get a string representation of a osip_message_t element. More... | |
int | osip_message_to_str_sipfrag (osip_message_t *sip, char **dest, size_t *message_length) |
Get a string representation of a message/sipfrag part stored in an osip_message_t element. More... | |
int | osip_message_clone (const osip_message_t *sip, osip_message_t **dest) |
Clone a osip_message_t element. More... | |
void | osip_message_set_reason_phrase (osip_message_t *sip, char *reason) |
Set the reason phrase. More... | |
char * | osip_message_get_reason_phrase (const osip_message_t *sip) |
Get the reason phrase. More... | |
void | osip_message_set_status_code (osip_message_t *sip, int statuscode) |
Set the status code. More... | |
int | osip_message_get_status_code (const osip_message_t *sip) |
Get the status code. More... | |
void | osip_message_set_method (osip_message_t *sip, char *method) |
Set the method. More... | |
char * | osip_message_get_method (const osip_message_t *sip) |
Get the method name. More... | |
void | osip_message_set_version (osip_message_t *sip, char *version) |
Set the SIP version used. More... | |
char * | osip_message_get_version (const osip_message_t *sip) |
Get the SIP version. More... | |
void | osip_message_set_uri (osip_message_t *sip, osip_uri_t *uri) |
Set the Request-URI. More... | |
osip_uri_t * | osip_message_get_uri (const osip_message_t *sip) |
Get the Request-URI. More... | |
void | osip_generic_param_set_name (osip_generic_param_t *generic_param, char *name) |
Set the name of a generic parameter element. More... | |
char * | osip_generic_param_get_name (const osip_generic_param_t *generic_param) |
Get the name of a generic parameter element. More... | |
void | osip_generic_param_set_value (osip_generic_param_t *generic_param, char *value) |
Set the value of a generic parameter element. More... | |
char * | osip_generic_param_get_value (const osip_generic_param_t *generic_param) |
Get the value of a generic parameter element. More... | |
int | osip_message_get_knownheaderlist (osip_list_t *header_list, int pos, void **dest) |
Get the a known header from a list of known header. More... | |
#define BODY_MESSAGE_MAX_SIZE 4000 |
#include <osip_message.h>
You can define the maximum length for a body inside a SIP message.
Definition at line 123 of file osip_message.h.
#define MSG_IS_ACK | ( | msg | ) |
#include <osip_message.h>
Test if the message is an ACK REQUEST.
msg | the SIP message. |
Definition at line 257 of file osip_message.h.
#define MSG_IS_BYE | ( | msg | ) |
#include <osip_message.h>
Test if the message is a BYE REQUEST.
msg | the SIP message. |
Definition at line 269 of file osip_message.h.
#define MSG_IS_CANCEL | ( | msg | ) |
#include <osip_message.h>
Test if the message is a CANCEL REQUEST.
msg | the SIP message. |
Definition at line 287 of file osip_message.h.
#define MSG_IS_INFO | ( | msg | ) |
#include <osip_message.h>
Test if the message is an INFO REQUEST.
msg | the SIP message. |
Definition at line 281 of file osip_message.h.
#define MSG_IS_INVITE | ( | msg | ) |
#include <osip_message.h>
Test if the message is an INVITE REQUEST.
msg | the SIP message. |
Definition at line 251 of file osip_message.h.
#define MSG_IS_MESSAGE | ( | msg | ) |
#include <osip_message.h>
Test if the message is a MESSAGE REQUEST.
msg | the SIP message. |
Definition at line 312 of file osip_message.h.
#define MSG_IS_NOTIFY | ( | msg | ) |
#include <osip_message.h>
Test if the message is a NOTIFY REQUEST.
msg | the SIP message. |
Definition at line 299 of file osip_message.h.
#define MSG_IS_OPTIONS | ( | msg | ) |
#include <osip_message.h>
Test if the message is an OPTIONS REQUEST.
msg | the SIP message. |
Definition at line 275 of file osip_message.h.
#define MSG_IS_PRACK | ( | msg | ) |
#include <osip_message.h>
Test if the message is a PRACK REQUEST (!! PRACK IS NOT SUPPORTED by the fsm!!)
msg | the SIP message. |
Definition at line 318 of file osip_message.h.
#define MSG_IS_PUBLISH | ( | msg | ) |
#include <osip_message.h>
Test if the message is an UPDATE REQUEST.
msg | the SIP message. |
Definition at line 333 of file osip_message.h.
#define MSG_IS_REFER | ( | msg | ) |
#include <osip_message.h>
Test if the message is a REFER REQUEST.
msg | the SIP message. |
Definition at line 293 of file osip_message.h.
#define MSG_IS_REGISTER | ( | msg | ) |
#include <osip_message.h>
Test if the message is a REGISTER REQUEST.
msg | the SIP message. |
Definition at line 263 of file osip_message.h.
#define MSG_IS_REQUEST | ( | msg | ) | ((msg)->status_code==0) |
#include <osip_message.h>
Test if the message is a SIP REQUEST.
msg | the SIP message. |
Definition at line 245 of file osip_message.h.
#define MSG_IS_RESPONSE | ( | msg | ) | ((msg)->status_code!=0) |
#include <osip_message.h>
Test if the message is a SIP RESPONSE.
msg | the SIP message. |
Definition at line 240 of file osip_message.h.
#define MSG_IS_RESPONSE_FOR | ( | msg, | |
requestname | |||
) |
#include <osip_message.h>
Test if the message is a response for a REQUEST of certain type.
msg | the SIP message. |
requestname | the method name to match. |
Definition at line 385 of file osip_message.h.
#define MSG_IS_STATUS_1XX | ( | msg | ) |
#include <osip_message.h>
Test if the message is a response with status between 100 and 199.
msg | the SIP message. |
Definition at line 341 of file osip_message.h.
#define MSG_IS_STATUS_2XX | ( | msg | ) |
#include <osip_message.h>
Test if the message is a response with status between 200 and 299.
msg | the SIP message. |
Definition at line 347 of file osip_message.h.
#define MSG_IS_STATUS_3XX | ( | msg | ) |
#include <osip_message.h>
Test if the message is a response with status between 300 and 399.
msg | the SIP message. |
Definition at line 353 of file osip_message.h.
#define MSG_IS_STATUS_4XX | ( | msg | ) |
#include <osip_message.h>
Test if the message is a response with status between 400 and 499.
msg | the SIP message. |
Definition at line 359 of file osip_message.h.
#define MSG_IS_STATUS_5XX | ( | msg | ) |
#include <osip_message.h>
Test if the message is a response with status between 500 and 599.
msg | the SIP message. |
Definition at line 365 of file osip_message.h.
#define MSG_IS_STATUS_6XX | ( | msg | ) |
#include <osip_message.h>
Test if the message is a response with status between 600 and 699.
msg | the SIP message. |
Definition at line 371 of file osip_message.h.
#define MSG_IS_SUBSCRIBE | ( | msg | ) |
#include <osip_message.h>
Test if the message is a SUBSCRIBE REQUEST.
msg | the SIP message. |
Definition at line 306 of file osip_message.h.
#define MSG_IS_UPDATE | ( | msg | ) |
#include <osip_message.h>
Test if the message is an UPDATE REQUEST.
msg | the SIP message. |
Definition at line 326 of file osip_message.h.
#define MSG_TEST_CODE | ( | msg, | |
code | |||
) |
#include <osip_message.h>
Test if the message is a response with a status set to the code value.
msg | the SIP message. |
code | the status code. |
Definition at line 378 of file osip_message.h.
#define osip_generic_param_add | ( | LIST, | |
NAME, | |||
VALUE | |||
) | osip_uri_param_add(LIST,NAME,VALUE) |
#include <osip_message.h>
Allocate and add a generic parameter element in a list.
LIST | The list of generic parameter element to work on. |
NAME | The token name. |
VALUE | The token value. |
Definition at line 425 of file osip_message.h.
#define osip_generic_param_clone osip_uri_param_clone |
#include <osip_message.h>
Clone a generic parameter element.
GP | The element to work on. |
DEST | The resulting new allocated buffer. |
Definition at line 411 of file osip_message.h.
#define osip_generic_param_free | ( | GP | ) | osip_uri_param_free(GP) |
#include <osip_message.h>
Free a generic parameter element.
GP | The element to work on. |
Definition at line 398 of file osip_message.h.
#define osip_generic_param_freelist | ( | LIST | ) | osip_uri_param_freelist(LIST) |
#include <osip_message.h>
Definition at line 417 of file osip_message.h.
#define osip_generic_param_get_byname | ( | LIST, | |
NAME, | |||
DEST | |||
) | osip_uri_param_get_byname(LIST,NAME,DEST) |
#include <osip_message.h>
Find in a generic parameter element in a list.
LIST | The list of generic parameter element to work on. |
NAME | The name of the parameter element to find. |
DEST | A pointer on the element found. |
Definition at line 432 of file osip_message.h.
#define osip_generic_param_init | ( | GP | ) | osip_uri_param_init(GP) |
#include <osip_message.h>
Allocate a generic parameter element.
GP | The element to work on. |
Definition at line 393 of file osip_message.h.
#define osip_generic_param_set | ( | GP, | |
NAME, | |||
VALUE | |||
) | osip_uri_param_set(GP, NAME, VALUE) |
#include <osip_message.h>
Set values of a generic parameter element.
GP | The element to work on. |
NAME | The token name. |
VALUE | The token value. |
Definition at line 405 of file osip_message.h.
#define SIP_MESSAGE_MAX_LENGTH 8000 |
#include <osip_message.h>
You can re-define your own maximum length for SIP message.
Definition at line 116 of file osip_message.h.
#include <osip_message.h>
Structure for SIP Message (REQUEST and RESPONSE).
Definition at line 49 of file osip_message.h.
char* osip_generic_param_get_name | ( | const osip_generic_param_t * | generic_param | ) |
#include <osip_message.h>
Get the name of a generic parameter element.
generic_param | The element to work on. |
char* osip_generic_param_get_value | ( | const osip_generic_param_t * | generic_param | ) |
#include <osip_message.h>
Get the value of a generic parameter element.
generic_param | The element to work on. |
void osip_generic_param_set_name | ( | osip_generic_param_t * | generic_param, |
char * | name | ||
) |
#include <osip_message.h>
Set the name of a generic parameter element.
generic_param | The element to work on. |
name | the token name to set. |
void osip_generic_param_set_value | ( | osip_generic_param_t * | generic_param, |
char * | value | ||
) |
#include <osip_message.h>
Set the value of a generic parameter element.
generic_param | The element to work on. |
value | the token name to set. |
int osip_message_clone | ( | const osip_message_t * | sip, |
osip_message_t ** | dest | ||
) |
#include <osip_message.h>
Clone a osip_message_t element.
sip | The element to clone. |
dest | The new allocated element cloned. |
void osip_message_free | ( | osip_message_t * | sip | ) |
#include <osip_message.h>
Free all resource in a osip_message_t element.
sip | The element to free. |
int osip_message_get_knownheaderlist | ( | osip_list_t * | header_list, |
int | pos, | ||
void ** | dest | ||
) |
#include <osip_message.h>
Get the a known header from a list of known header.
header_list | The element to work on. |
pos | The index of the element to get. |
dest | A pointer on the header found. |
char* osip_message_get_method | ( | const osip_message_t * | sip | ) |
char* osip_message_get_reason_phrase | ( | const osip_message_t * | sip | ) |
#include <osip_message.h>
Get the reason phrase.
This is entirely free in SIP.
sip | The element to work on. |
int osip_message_get_status_code | ( | const osip_message_t * | sip | ) |
osip_uri_t* osip_message_get_uri | ( | const osip_message_t * | sip | ) |
char* osip_message_get_version | ( | const osip_message_t * | sip | ) |
int osip_message_init | ( | osip_message_t ** | sip | ) |
int osip_message_parse | ( | osip_message_t * | sip, |
const char * | buf, | ||
size_t | length | ||
) |
#include <osip_message.h>
Parse a osip_message_t element.
sip | The resulting element. |
buf | The buffer to parse. |
length | The length of the buffer to parse. |
int osip_message_parse_sipfrag | ( | osip_message_t * | sip, |
const char * | buf, | ||
size_t | length | ||
) |
#include <osip_message.h>
Parse a message/sipfrag part and store it in an osip_message_t element.
sip | The resulting element. |
buf | The buffer to parse. |
length | The length of the buffer to parse. |
void osip_message_set_method | ( | osip_message_t * | sip, |
char * | method | ||
) |
#include <osip_message.h>
Set the method.
You can set any string here.
sip | The element to work on. |
method | The method name. |
void osip_message_set_reason_phrase | ( | osip_message_t * | sip, |
char * | reason | ||
) |
#include <osip_message.h>
Set the reason phrase.
This is entirely free in SIP.
sip | The element to work on. |
reason | The reason phrase. |
void osip_message_set_status_code | ( | osip_message_t * | sip, |
int | statuscode | ||
) |
#include <osip_message.h>
Set the status code.
This is entirely free in SIP.
sip | The element to work on. |
statuscode | The status code. |
void osip_message_set_uri | ( | osip_message_t * | sip, |
osip_uri_t * | uri | ||
) |
#include <osip_message.h>
Set the Request-URI.
sip | The element to work on. |
uri | The uri to set. |
void osip_message_set_version | ( | osip_message_t * | sip, |
char * | version | ||
) |
#include <osip_message.h>
Set the SIP version used.
(default is "SIP/2.0")
sip | The element to work on. |
version | The version of SIP. |
int osip_message_to_str | ( | osip_message_t * | sip, |
char ** | dest, | ||
size_t * | message_length | ||
) |
#include <osip_message.h>
Get a string representation of a osip_message_t element.
NOTE: You need to release the sip buffer returned by this API when you are done with the buffer. ie: osip_free(dest)
sip | The element to work on. |
dest | new allocated buffer returned. |
message_length | The length of the returned buffer. |
int osip_message_to_str_sipfrag | ( | osip_message_t * | sip, |
char ** | dest, | ||
size_t * | message_length | ||
) |
#include <osip_message.h>
Get a string representation of a message/sipfrag part stored in an osip_message_t element.
NOTE: You need to release the sip buffer returned by this API when you are done with the buffer. ie: osip_free(dest)
sip | The element to work on. |
dest | new allocated buffer returned. |
message_length | The length of the returned buffer. |