SIP Witch 1.9.15
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
osip_message.h File Reference

oSIP SIP Message Accessor Routines More...

#include <osipparser2/osip_const.h>
#include <osipparser2/osip_headers.h>
#include <osipparser2/osip_body.h>
Include dependency graph for osip_message.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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_tosip_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...
 

Detailed Description

oSIP SIP Message Accessor Routines

This is the SIP accessor and parser related API.

Definition in file osip_message.h.