diff options
author | Benny Prijono <bennylp@teluu.com> | 2010-08-01 09:48:51 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2010-08-01 09:48:51 +0000 |
commit | 059d687249f0f95e0b30785c418e1aa47555615a (patch) | |
tree | 792e10acf82954faca0a2b7fe937064a1ecb81d8 /pjsip/include/pjsip-ua/sip_inv.h | |
parent | 1426b8301e4d99837bd70ce73b350d03fafbfd45 (diff) |
Implemented core multipart support and support in the invite session (re #1070)
- incoming multipart message will be handled automatically
- for testing, enable HAVE_MULTIPART_TEST in pjsua_app.c
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3243 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include/pjsip-ua/sip_inv.h')
-rw-r--r-- | pjsip/include/pjsip-ua/sip_inv.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/pjsip/include/pjsip-ua/sip_inv.h b/pjsip/include/pjsip-ua/sip_inv.h index 122a148a..309cded4 100644 --- a/pjsip/include/pjsip-ua/sip_inv.h +++ b/pjsip/include/pjsip-ua/sip_inv.h @@ -382,6 +382,34 @@ struct pjsip_inv_session /** + * This structure represents SDP information in a pjsip_rx_data. Application + * retrieve this information by calling #pjsip_rdata_get_sdp_info(). This + * mechanism supports multipart message body. + */ +typedef struct pjsip_rdata_sdp_info +{ + /** + * Pointer and length of the text body in the incoming message. If + * the pointer is NULL, it means the message does not contain SDP + * body. + */ + pj_str_t body; + + /** + * This will contain non-zero if an invalid SDP body is found in the + * message. + */ + pj_status_t sdp_err; + + /** + * A parsed and validated SDP body. + */ + pjmedia_sdp_session *sdp; + +} pjsip_rdata_sdp_info; + + +/** * Initialize the invite usage module and register it to the endpoint. * The callback argument contains pointer to functions to be called on * occurences of events in invite sessions. @@ -874,6 +902,21 @@ PJ_DECL(pj_status_t) pjsip_create_sdp_body(pj_pool_t *pool, pjmedia_sdp_session *sdp, pjsip_msg_body **p_body); +/** + * Retrieve SDP information from an incoming message. Application should + * prefer to use this function rather than parsing the SDP manually since + * this function supports multipart message body. + * + * This function will only parse the SDP once, the first time it is called + * on the same message. Subsequent call on the same message will just pick + * up the already parsed SDP from the message. + * + * @param rdata The incoming message. + * + * @return The SDP info. + */ +PJ_DECL(pjsip_rdata_sdp_info*) pjsip_rdata_get_sdp_info(pjsip_rx_data *rdata); + PJ_END_DECL |