diff options
author | Benny Prijono <bennylp@teluu.com> | 2009-01-14 15:34:00 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2009-01-14 15:34:00 +0000 |
commit | 7db34fc4727b16b52dd11fc3aa25ef9e080a2e2c (patch) | |
tree | 976f2db617cc8bb64031fee0128526237aafee75 | |
parent | 70249012a6292c4c01c9de268f08f4a6fe443063 (diff) |
Inconsistent implementation vs documentation in pjsip_endpt_create_request_from_hdr(): it should allow NULL Call-ID to be specified. Thanks Cedric Leveque for the report
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2421 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjsip/src/pjsip/sip_util.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pjsip/src/pjsip/sip_util.c b/pjsip/src/pjsip/sip_util.c index 6d8b8fdb..18116c08 100644 --- a/pjsip/src/pjsip/sip_util.c +++ b/pjsip/src/pjsip/sip_util.c @@ -441,7 +441,12 @@ PJ_DEF(pj_status_t) pjsip_endpt_create_request_from_hdr( pjsip_endpoint *endpt, } else { contact = NULL; } - call_id = (pjsip_cid_hdr*) pjsip_hdr_clone(tdata->pool, param_call_id); + call_id = pjsip_cid_hdr_create(tdata->pool); + if (param_call_id != NULL && param_call_id->id.slen) + pj_strdup(tdata->pool, &call_id->id, ¶m_call_id->id); + else + pj_create_unique_string(tdata->pool, &call_id->id); + cseq = pjsip_cseq_hdr_create(tdata->pool); if (param_cseq >= 0) cseq->cseq = param_cseq; |