diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-03-02 21:18:58 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-03-02 21:18:58 +0000 |
commit | aad76a0bb1ea62caaf67e6fecaea5786b5f2811a (patch) | |
tree | 8183f5a20882579ad310e060115a832a2e6eb444 /pjsip/src/pjsip-simple/evsub.c | |
parent | cf626e119a5f0b8b424c7cf473f514f1710ce209 (diff) |
Added IM and composition indication, and tested
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@268 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsip-simple/evsub.c')
-rw-r--r-- | pjsip/src/pjsip-simple/evsub.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/pjsip/src/pjsip-simple/evsub.c b/pjsip/src/pjsip-simple/evsub.c index 874f9204..0f0b974c 100644 --- a/pjsip/src/pjsip-simple/evsub.c +++ b/pjsip/src/pjsip-simple/evsub.c @@ -956,6 +956,15 @@ PJ_DEF(pj_status_t) pjsip_evsub_accept( pjsip_evsub *sub, pjsip_msg_add_hdr( tdata->msg, pjsip_hdr_shallow_clone(tdata->pool, sub->expires)); + /* Add additional header, if any. */ + if (hdr_list) { + const pjsip_hdr *hdr = hdr_list->next; + while (hdr != hdr_list) { + pjsip_msg_add_hdr( tdata->msg, + pjsip_hdr_clone(tdata->pool, hdr)); + hdr = hdr->next; + } + } /* Send the response: */ status = pjsip_dlg_send_response( sub->dlg, tsx, tdata ); @@ -1324,13 +1333,11 @@ static pj_status_t create_response( pjsip_evsub *sub, /* Add msg body, if any */ if (body) { - tdata->msg->body = pj_pool_zalloc(tdata->pool, - sizeof(pjsip_msg_body)); - status = pjsip_msg_body_clone(tdata->pool, - tdata->msg->body, - body); - if (status != PJ_SUCCESS) { - tdata->msg->body = NULL; + tdata->msg->body = pjsip_msg_body_clone(tdata->pool, body); + if (tdata->msg->body == NULL) { + + PJ_LOG(4,(THIS_FILE, "Error: unable to clone msg body")); + /* Ignore */ return PJ_SUCCESS; } |