summaryrefslogtreecommitdiff
path: root/pjsip/src/pjsip-ua/sip_xfer.c
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2010-08-01 09:24:58 +0000
committerBenny Prijono <bennylp@teluu.com>2010-08-01 09:24:58 +0000
commit42cd3a38756cc1baef47cd808273435518c56401 (patch)
tree2092f37d8bcc0bb0cb170a08a79a4d382fb92fc2 /pjsip/src/pjsip-ua/sip_xfer.c
parent311528e2bc573606fb611175fbd7b981780664e2 (diff)
Re #1070 (support for multipart bodies): modified the param field of pjsip_media_type from a simple string to pjsip_param, to support a more complex use of this field
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3241 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsip-ua/sip_xfer.c')
-rw-r--r--pjsip/src/pjsip-ua/sip_xfer.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/pjsip/src/pjsip-ua/sip_xfer.c b/pjsip/src/pjsip-ua/sip_xfer.c
index eb932655..47608d74 100644
--- a/pjsip/src/pjsip-ua/sip_xfer.c
+++ b/pjsip/src/pjsip-ua/sip_xfer.c
@@ -374,6 +374,7 @@ PJ_DEF(pj_status_t) pjsip_xfer_notify( pjsip_evsub *sub,
{
pjsip_tx_data *tdata;
pjsip_xfer *xfer;
+ pjsip_param *param;
const pj_str_t reason = { "noresource", 10 };
char *body;
int bodylen;
@@ -422,14 +423,18 @@ PJ_DEF(pj_status_t) pjsip_xfer_notify( pjsip_evsub *sub,
/* Create SIP message body. */
msg_body = PJ_POOL_ZALLOC_T(tdata->pool, pjsip_msg_body);
- msg_body->content_type.type = STR_MESSAGE;
- msg_body->content_type.subtype = STR_SIPFRAG;
- msg_body->content_type.param = STR_SIPFRAG_VERSION;
+ pjsip_media_type_init(&msg_body->content_type, (pj_str_t*)&STR_MESSAGE,
+ (pj_str_t*)&STR_SIPFRAG);
msg_body->data = body;
msg_body->len = bodylen;
msg_body->print_body = &pjsip_print_text_body;
msg_body->clone_data = &pjsip_clone_text_data;
+ param = PJ_POOL_ALLOC_T(tdata->pool, pjsip_param);
+ param->name = pj_str("version");
+ param->value = pj_str("2.0");
+ pj_list_push_back(&msg_body->content_type.param, param);
+
/* Attach sipfrag body. */
tdata->msg->body = msg_body;