summaryrefslogtreecommitdiff
path: root/pjsip/include/pjsip/sip_msg.h
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-03-02 21:16:00 +0000
committerBenny Prijono <bennylp@teluu.com>2006-03-02 21:16:00 +0000
commitd4f5064c25f3000771921ffc18ceab3810c3d9d2 (patch)
treefbf6cbfe2d4f2b40cba2893c818e9652b2a119a7 /pjsip/include/pjsip/sip_msg.h
parent9c6c63de6a5564b32ee1239bb77ef605c8a69837 (diff)
Changed pjsip_msg_body_clone(), added pjsip_msg_body_create()
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@266 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include/pjsip/sip_msg.h')
-rw-r--r--pjsip/include/pjsip/sip_msg.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/pjsip/include/pjsip/sip_msg.h b/pjsip/include/pjsip/sip_msg.h
index f4649d9e..df764152 100644
--- a/pjsip/include/pjsip/sip_msg.h
+++ b/pjsip/include/pjsip/sip_msg.h
@@ -610,12 +610,44 @@ PJ_DECL(void*) pjsip_clone_text_data( pj_pool_t *pool, const void *data,
*
* @return PJ_SUCCESS on success.
*/
-PJ_DECL(pj_status_t) pjsip_msg_body_clone(pj_pool_t *pool,
+PJ_DECL(pj_status_t) pjsip_msg_body_copy( pj_pool_t *pool,
pjsip_msg_body *dst_body,
const pjsip_msg_body *src_body );
/**
+ * Create cloned message body. This will duplicate the contents of the message
+ * body using the \a clone_data member of the source message body.
+ *
+ * @param pool Pool to use to duplicate the message body.
+ * @param body Source message body to duplicate.
+ *
+ * @return The cloned message body on successfull.
+ */
+PJ_DECL(pjsip_msg_body*) pjsip_msg_body_clone( pj_pool_t *pool,
+ const pjsip_msg_body *body );
+
+
+/**
+ * Create a text message body. Use this function to create message body when
+ * the content is a simple text. For non-text message body (e.g.
+ * pjmedia_sdp_session or pj_xml_node), application must construct the message
+ * manually.
+ *
+ * @param pool Pool to allocate message body and its contents.
+ * @param type MIME type (e.g. "text").
+ * @param subtype MIME subtype (e.g. "plain").
+ * @param text The text content to be put in the message body.
+ *
+ * @return A new message body with the specified Content-Type and
+ * text.
+ */
+PJ_DECL(pjsip_msg_body*) pjsip_msg_body_create( pj_pool_t *pool,
+ const pj_str_t *type,
+ const pj_str_t *subtype,
+ const pj_str_t *text );
+
+/**
* @}
*/