Home --> Documentations --> PJSIP Reference
SIP message (request and response) structure and operations.
More...
|
pjsip_msg * | pjsip_msg_create (pj_pool_t *pool, pjsip_msg_type_e type) |
|
pjsip_msg * | pjsip_msg_clone (pj_pool_t *pool, const pjsip_msg *msg) |
|
void * | pjsip_msg_find_hdr (const pjsip_msg *msg, pjsip_hdr_e type, const void *start) |
|
void * | pjsip_msg_find_hdr_by_name (const pjsip_msg *msg, const pj_str_t *name, const void *start) |
|
void * | pjsip_msg_find_hdr_by_names (const pjsip_msg *msg, const pj_str_t *name, const pj_str_t *sname, const void *start) |
|
void * | pjsip_msg_find_remove_hdr (pjsip_msg *msg, pjsip_hdr_e hdr, void *start) |
|
void | pjsip_msg_add_hdr (pjsip_msg *msg, pjsip_hdr *hdr) |
|
void | pjsip_msg_insert_first_hdr (pjsip_msg *msg, pjsip_hdr *hdr) |
|
pj_ssize_t | pjsip_msg_print (const pjsip_msg *msg, char *buf, pj_size_t size) |
|
◆ PJSIP_MSG_CID_HDR
Find Call-ID header.
- Parameters
-
- Returns
- Call-ID header instance.
◆ PJSIP_MSG_CSEQ_HDR
Find CSeq header.
- Parameters
-
- Returns
- CSeq header instance.
◆ PJSIP_MSG_FROM_HDR
Find From header.
- Parameters
-
- Returns
- From header instance.
◆ PJSIP_MSG_TO_HDR
Find To header.
- Parameters
-
- Returns
- To header instance.
◆ pjsip_msg_type_e
Message type (request or response).
Enumerator |
---|
PJSIP_REQUEST_MSG | Indicates request message.
|
PJSIP_RESPONSE_MSG | Indicates response message.
|
◆ pjsip_msg_create()
Create new request or response message.
- Parameters
-
pool | The pool. |
type | Message type. |
- Returns
- New message, or THROW exception if failed.
◆ pjsip_msg_clone()
Perform a deep clone of a SIP message.
- Parameters
-
pool | The pool for creating the new message. |
msg | The message to be duplicated. |
- Returns
- New message, which is duplicated from the original message.
◆ pjsip_msg_find_hdr()
Find a header in the message by the header type.
- Parameters
-
msg | The message. |
type | The header type to find. |
start | The first header field where the search should begin. If NULL is specified, then the search will begin from the first header, otherwise the search will begin at the specified header. |
- Returns
- The header field, or NULL if no header with the specified type is found.
◆ pjsip_msg_find_hdr_by_name()
void * pjsip_msg_find_hdr_by_name |
( |
const pjsip_msg * |
msg, |
|
|
const pj_str_t * |
name, |
|
|
const void * |
start |
|
) |
| |
Find a header in the message by its name.
- Parameters
-
msg | The message. |
name | The header name to find. |
start | The first header field where the search should begin. If NULL is specified, then the search will begin from the first header, otherwise the search will begin at the specified header. |
- Returns
- The header field, or NULL if no header with the specified type is found.
◆ pjsip_msg_find_hdr_by_names()
void * pjsip_msg_find_hdr_by_names |
( |
const pjsip_msg * |
msg, |
|
|
const pj_str_t * |
name, |
|
|
const pj_str_t * |
sname, |
|
|
const void * |
start |
|
) |
| |
Find a header in the message by its name and short name version.
- Parameters
-
msg | The message. |
name | The header name to find. |
sname | The short name version of the header name. |
start | The first header field where the search should begin. If NULL is specified, then the search will begin from the first header, otherwise the search will begin at the specified header. |
- Returns
- The header field, or NULL if no header with the specified type is found.
◆ pjsip_msg_find_remove_hdr()
Find and remove a header in the message.
- Parameters
-
msg | The message. |
hdr | The header type to find. |
start | The first header field where the search should begin, or NULL to search from the first header in the message. |
- Returns
- The header field, or NULL if not found.
◆ pjsip_msg_add_hdr()
Add a header to the message, putting it last in the header list.
- Parameters
-
msg | The message. |
hdr | The header to add. |
- Bug:
- Once the header is put in a list (or message), it can not be put in other list (or message). Otherwise Real Bad Thing will happen.
References pjsip_msg::hdr, PJ_INLINE, and pj_list_insert_before().
◆ pjsip_msg_insert_first_hdr()
Add header field to the message, putting it in the front of the header list.
- Parameters
-
msg | The message. |
hdr | The header to add. |
- Bug:
- Once the header is put in a list (or message), it can not be put in other list (or message). Otherwise Real Bad Thing will happen.
References pjsip_msg::hdr, PJ_INLINE, and pj_list_insert_after().
◆ pjsip_msg_print()
Print the message to the specified buffer.
- Parameters
-
msg | The message to print. |
buf | The buffer |
size | The size of the buffer. |
- Returns
- The length of the printed characters (in bytes), or NEGATIVE value if the message is too large for the specified buffer.
PJSIP Open Source, high performance, small footprint, and very very portable SIP stack
Copyright (C) 2006-2008 Teluu Inc.
|