diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2009-08-05 18:41:23 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2009-08-05 18:41:23 +0000 |
commit | d0c5ad00ee36fb9c0922734dbba059d69b9830dd (patch) | |
tree | 3eeffefcce4cb75a4f1a825b424434a8d62d9d00 /pjsip/src/pjsip/sip_util.c | |
parent | a3dcee2a2b4e375e5f9efdac20896923f244d932 (diff) |
Ticket #930:
- Updated semantic of contact param in functions pjsip_dlg_create_uac(), pjsip_dlg_create_uas(), pjsip_endpt_create_request() and also variable pjsua_acc.contact to be Contact header value (was Contact URI).
- Updated docs related to above modifications.
- Fixed pjsua_im_send() in generating contact header, it should use pjsua_acc.contact instead, if it is set.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2855 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsip/sip_util.c')
-rw-r--r-- | pjsip/src/pjsip/sip_util.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pjsip/src/pjsip/sip_util.c b/pjsip/src/pjsip/sip_util.c index 01948a50..cc5d71d0 100644 --- a/pjsip/src/pjsip/sip_util.c +++ b/pjsip/src/pjsip/sip_util.c @@ -307,6 +307,7 @@ PJ_DEF(pj_status_t) pjsip_endpt_create_request( pjsip_endpoint *endpt, pjsip_cid_hdr *call_id; pj_str_t tmp; pj_status_t status; + const pj_str_t STR_CONTACT = { "Contact", 7 }; PJ_USE_EXCEPTION; status = pjsip_endpt_create_tdata(endpt, &tdata); @@ -348,11 +349,11 @@ PJ_DEF(pj_status_t) pjsip_endpt_create_request( pjsip_endpoint *endpt, /* Contact. */ if (param_contact) { - contact = pjsip_contact_hdr_create(tdata->pool); pj_strdup_with_null(tdata->pool, &tmp, param_contact); - contact->uri = pjsip_parse_uri( tdata->pool, tmp.ptr, tmp.slen, - PJSIP_PARSE_URI_AS_NAMEADDR); - if (contact->uri == NULL) { + contact = (pjsip_contact_hdr*) + pjsip_parse_hdr(tdata->pool, &STR_CONTACT, tmp.ptr, + tmp.slen, NULL); + if (contact == NULL) { status = PJSIP_EINVALIDHDR; goto on_error; } |