Home --> Documentations --> PJSIP Reference
Support for multipart message bodies.
More...
|
pjsip_msg_body * | pjsip_multipart_create (pj_pool_t *pool, const pjsip_media_type *ctype, const pj_str_t *boundary) |
|
pjsip_multipart_part * | pjsip_multipart_create_part (pj_pool_t *pool) |
|
pjsip_multipart_part * | pjsip_multipart_clone_part (pj_pool_t *pool, const pjsip_multipart_part *part) |
|
pj_status_t | pjsip_multipart_add_part (pj_pool_t *pool, pjsip_msg_body *mp, pjsip_multipart_part *part) |
|
pjsip_multipart_part * | pjsip_multipart_get_first_part (const pjsip_msg_body *mp) |
|
pjsip_multipart_part * | pjsip_multipart_get_next_part (const pjsip_msg_body *mp, pjsip_multipart_part *part) |
|
pjsip_multipart_part * | pjsip_multipart_find_part (const pjsip_msg_body *mp, const pjsip_media_type *content_type, const pjsip_multipart_part *start) |
|
pjsip_multipart_part * | pjsip_multipart_find_part_by_header (pj_pool_t *pool, const pjsip_msg_body *mp, void *search_hdr, const pjsip_multipart_part *start) |
|
pjsip_multipart_part * | pjsip_multipart_find_part_by_header_str (pj_pool_t *pool, const pjsip_msg_body *mp, const pj_str_t *hdr_name, const pj_str_t *hdr_value, const pjsip_multipart_part *start) |
|
pjsip_multipart_part * | pjsip_multipart_find_part_by_cid_str (pj_pool_t *pool, const pjsip_msg_body *mp, pj_str_t *cid) |
|
pjsip_multipart_part * | pjsip_multipart_find_part_by_cid_uri (pj_pool_t *pool, const pjsip_msg_body *mp, pjsip_other_uri *cid) |
|
pjsip_msg_body * | pjsip_multipart_parse (pj_pool_t *pool, char *buf, pj_size_t len, const pjsip_media_type *ctype, unsigned options) |
|
pj_status_t | pjsip_multipart_get_raw (pjsip_msg_body *mp, pj_str_t *boundary, pj_str_t *raw_data) |
|
◆ pjsip_multipart_create()
Create an empty multipart body.
- Parameters
-
pool | Memory pool to allocate memory from. |
ctype | Optional MIME media type of the multipart bodies. If not specified, "multipart/mixed" will be used. |
boundary | Optional string to be set as part boundary. The boundary string excludes the leading hyphens. If this parameter is NULL or empty, a random boundary will be generated. |
- Returns
- Multipart body instance with no part.
◆ pjsip_multipart_create_part()
Create an empty multipart part.
- Parameters
-
- Returns
- The multipart part.
◆ pjsip_multipart_clone_part()
Perform a deep clone to a multipart part.
- Parameters
-
pool | The memory pool. |
part | The part to be duplicated. |
- Returns
- Copy of the multipart part.
◆ pjsip_multipart_add_part()
Add a part into multipart bodies.
- Parameters
-
pool | The memory pool. |
mp | The multipart bodies. |
part | The part to be added into the bodies. |
- Returns
- PJ_SUCCESS on success.
◆ pjsip_multipart_get_first_part()
Get the first part of multipart bodies.
- Parameters
-
- Returns
- The first part, or NULL if the multipart bodies currently doesn't hold any elements.
◆ pjsip_multipart_get_next_part()
Get the next part after the specified part.
- Parameters
-
mp | The multipart bodies. |
part | The part. |
- Returns
- The next part, or NULL if there is no other part after the part.
◆ pjsip_multipart_find_part()
Find a body inside multipart bodies which has the specified content type.
- Parameters
-
mp | The multipart body. |
content_type | Content type to find. |
start | If specified, the search will begin at start->next. Otherwise it will begin at the first part in the multipart bodies. |
- Returns
- The first part with the specified content type if found, or NULL.
◆ pjsip_multipart_find_part_by_header()
Find a body inside multipart bodies which has a header matching the supplied one. Most useful for finding a part with a specific Content-ID.
- Parameters
-
pool | Memory pool to use for temp space. |
mp | The multipart body. |
search_hdr | Header to search for. |
start | If specified, the search will begin at start->next part. Otherwise it will begin at the first part in the multipart bodies. |
- Returns
- The first part which has a header matching the specified one, or NULL if not found.
◆ pjsip_multipart_find_part_by_header_str()
Find a body inside multipart bodies which has a header matching the supplied name and value. Most useful for finding a part with a specific Content-ID.
- Parameters
-
pool | Memory pool to use for temp space. |
mp | The multipart body. |
hdr_name | Header name to search for. |
hdr_value | Header value search for. |
start | If specified, the search will begin at start->next part. Otherwise it will begin at the first part in the multipart bodies. |
- Returns
- The first part which has a header matching the specified one, or NULL if not found.
◆ pjsip_multipart_find_part_by_cid_str()
Find a body inside multipart bodies which has a Content-ID value matching the supplied "cid" URI in pj_str form. The "cid:" scheme will be assumed if the URL doesn't start with it. Enclosing angle brackets will also be handled correctly if they exist.
- See also
- RFC2392 Content-ID and Message-ID Uniform Resource Locators
- Parameters
-
pool | Memory pool to use for temp space. |
mp | The multipart body. |
cid | The "cid" URI to search for in pj_str form. |
- Returns
- The first part which has a Content-ID header matching the specified "cid" URI. or NULL if not found.
◆ pjsip_multipart_find_part_by_cid_uri()
Find a body inside multipart bodies which has a Content-ID value matching the supplied "cid" URI.
- See also
- RFC2392 Content-ID and Message-ID Uniform Resource Locators
- Parameters
-
pool | Memory pool to use for temp space. |
mp | The multipart body. |
cid | The "cid" URI to search for. |
- Returns
- The first part which had a Content-ID header matching the specified "cid" URI. or NULL if not found.
◆ pjsip_multipart_parse()
Parse multipart message.
- Parameters
-
pool | Memory pool. |
buf | Input buffer. |
len | The buffer length. |
ctype | Content type of the multipart body. |
options | Parsing options, must be zero for now. |
- Returns
- Multipart message body.
◆ pjsip_multipart_get_raw()
Get the boundary string and the raw message body of the specified multipart message body. Note that raw message body will only be available if the multipart message body is generated by pjsip_multipart_parse().
- Parameters
-
mp | The multipart message body. |
boundary | Optional parameter to receive the boundary string. |
raw_data | Optional parameter to receive the raw message body. |
- Returns
- PJ_SUCCESS on success.
PJSIP Open Source, high performance, small footprint, and very very portable SIP stack
Copyright (C) 2006-2008 Teluu Inc.
|