?? osip_message.h
字號(hào):
*/#define MSG_IS_RESPONSE(msg) ((msg)->status_code!=0)/** * Test if the message is a SIP REQUEST * @param msg the SIP message. */#define MSG_IS_REQUEST(msg) ((msg)->status_code==0)/** * Test if the message is an INVITE REQUEST * @param msg the SIP message. */#define MSG_IS_INVITE(msg) (MSG_IS_REQUEST(msg) && \ 0==strcmp((msg)->sip_method,"INVITE"))/** * Test if the message is an ACK REQUEST * @param msg the SIP message. */#define MSG_IS_ACK(msg) (MSG_IS_REQUEST(msg) && \ 0==strcmp((msg)->sip_method,"ACK"))/** * Test if the message is a REGISTER REQUEST * @param msg the SIP message. */#define MSG_IS_REGISTER(msg) (MSG_IS_REQUEST(msg) && \ 0==strcmp((msg)->sip_method,"REGISTER"))/** * Test if the message is a BYE REQUEST * @param msg the SIP message. */#define MSG_IS_BYE(msg) (MSG_IS_REQUEST(msg) && \ 0==strcmp((msg)->sip_method,"BYE"))/** * Test if the message is an OPTIONS REQUEST * @param msg the SIP message. */#define MSG_IS_OPTIONS(msg) (MSG_IS_REQUEST(msg) && \ 0==strcmp((msg)->sip_method,"OPTIONS"))/** * Test if the message is an INFO REQUEST * @param msg the SIP message. */#define MSG_IS_INFO(msg) (MSG_IS_REQUEST(msg) && \ 0==strcmp((msg)->sip_method,"INFO"))/** * Test if the message is a CANCEL REQUEST * @param msg the SIP message. */#define MSG_IS_CANCEL(msg) (MSG_IS_REQUEST(msg) && \ 0==strcmp((msg)->sip_method,"CANCEL"))/** * Test if the message is a REFER REQUEST * @param msg the SIP message. */#define MSG_IS_REFER(msg) (MSG_IS_REQUEST(msg) && \ 0==strcmp((msg)->sip_method,"REFER"))/** * Test if the message is a NOTIFY REQUEST * @param msg the SIP message. */#define MSG_IS_NOTIFY(msg) (MSG_IS_REQUEST(msg) && \ 0==strcmp((msg)->sip_method,"NOTIFY"))/** * Test if the message is a SUBSCRIBE REQUEST * @def MSG_IS_SUBSCRIBE * @param msg the SIP message. */#define MSG_IS_SUBSCRIBE(msg) (MSG_IS_REQUEST(msg) && \ 0==strcmp((msg)->sip_method,"SUBSCRIBE"))/** * Test if the message is a MESSAGE REQUEST * @param msg the SIP message. */#define MSG_IS_MESSAGE(msg) (MSG_IS_REQUEST(msg) && \ 0==strcmp((msg)->sip_method,"MESSAGE"))/** * Test if the message is a PRACK REQUEST (!! PRACK IS NOT SUPPORTED by the fsm!!) * @param msg the SIP message. */#define MSG_IS_PRACK(msg) (MSG_IS_REQUEST(msg) && \ 0==strcmp((msg)->sip_method,"PRACK"))/** * Test if the message is an UPDATE REQUEST * @param msg the SIP message. */#define MSG_IS_UPDATE(msg) (MSG_IS_REQUEST(msg) && \ 0==strcmp((msg)->sip_method,"UPDATE"))/** * Test if the message is an UPDATE REQUEST * @param msg the SIP message. */#define MSG_IS_PUBLISH(msg) (MSG_IS_REQUEST(msg) && \ 0==strcmp((msg)->sip_method,"PUBLISH"))/** * Test if the message is a response with status between 100 and 199 * @param msg the SIP message. */#define MSG_IS_STATUS_1XX(msg) ((msg)->status_code >= 100 && \ (msg)->status_code < 200)/** * Test if the message is a response with status between 200 and 299 * @param msg the SIP message. */#define MSG_IS_STATUS_2XX(msg) ((msg)->status_code >= 200 && \ (msg)->status_code < 300)/** * Test if the message is a response with status between 300 and 399 * @param msg the SIP message. */#define MSG_IS_STATUS_3XX(msg) ((msg)->status_code >= 300 && \ (msg)->status_code < 400)/** * Test if the message is a response with status between 400 and 499 * @param msg the SIP message. */#define MSG_IS_STATUS_4XX(msg) ((msg)->status_code >= 400 && \ (msg)->status_code < 500)/** * Test if the message is a response with status between 500 and 599 * @param msg the SIP message. */#define MSG_IS_STATUS_5XX(msg) ((msg)->status_code >= 500 && \ (msg)->status_code < 600)/** * Test if the message is a response with status between 600 and 699 * @param msg the SIP message. */#define MSG_IS_STATUS_6XX(msg) ((msg)->status_code >= 600 && \ (msg)->status_code < 700)/** * Test if the message is a response with a status set to the code value. * @param msg the SIP message. * @param code the status code. */#define MSG_TEST_CODE(msg,code) (MSG_IS_RESPONSE(msg) && \ (code)==(msg)->status_code)/** * Test if the message is a response for a REQUEST of certain type * @param msg the SIP message. * @param requestname the method name to match. */#define MSG_IS_RESPONSE_FOR(msg,requestname) (MSG_IS_RESPONSE(msg) && \ 0==strcmp((msg)->cseq->method,(requestname)))/** * Allocate a generic parameter element. * @param GP The element to work on. */#define osip_generic_param_init(GP) osip_uri_param_init(GP)/** * Free a generic parameter element. * @param GP The element to work on. */#define osip_generic_param_free(GP) osip_uri_param_free(GP)/** * Set values of a generic parameter element. * @param GP The element to work on. * @param NAME The token name. * @param VALUE The token value. */#define osip_generic_param_set(GP, NAME, VALUE) osip_uri_param_set(GP, NAME, VALUE)/** * Clone a generic parameter element. * @param GP The element to work on. * @param DEST The resulting new allocated buffer. */#define osip_generic_param_clone osip_uri_param_clone#ifndef DOXYGEN/* * Free a list of a generic parameter element. * @param LIST The list of generic parameter element to free. */#define osip_generic_param_freelist(LIST) osip_uri_param_freelist(LIST)#endif/** * Allocate and add a generic parameter element in a list. * @param LIST The list of generic parameter element to work on. * @param NAME The token name. * @param VALUE The token value. */#define osip_generic_param_add(LIST,NAME,VALUE) osip_uri_param_add(LIST,NAME,VALUE)/** * Find in a generic parameter element in a list. * @param LIST The list of generic parameter element to work on. * @param NAME The name of the parameter element to find. * @param DEST A pointer on the element found. */#define osip_generic_param_get_byname(LIST,NAME,DEST) osip_uri_param_get_byname(LIST,NAME,DEST)/** * Set the name of a generic parameter element. * @param generic_param The element to work on. * @param name the token name to set. */ void osip_generic_param_set_name (osip_generic_param_t * generic_param, char *name);/** * Get the name of a generic parameter element. * @param generic_param The element to work on. */ char *osip_generic_param_get_name (const osip_generic_param_t * generic_param);/** * Set the value of a generic parameter element. * @param generic_param The element to work on. * @param value the token name to set. */ void osip_generic_param_set_value (osip_generic_param_t * generic_param, char *value);/** * Get the value of a generic parameter element. * @param generic_param The element to work on. */ char *osip_generic_param_get_value (const osip_generic_param_t * generic_param);/** * Get the a known header from a list of known header. * @param header_list The element to work on. * @param pos The index of the element to get. * @param dest A pointer on the header found. */ int osip_message_get_knownheaderlist (osip_list_t *header_list, int pos, void **dest);/** @} */#ifdef __cplusplus}#endif#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -