summaryrefslogtreecommitdiff
path: root/pjsip/src/pjsip/sip_util.c
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-02-07 18:48:01 +0000
committerBenny Prijono <bennylp@teluu.com>2006-02-07 18:48:01 +0000
commit813cd5ef6791ddf9778ca61c08ce19f48202b3bc (patch)
tree4fcb5e984e0d06def8a8b1b3f4144bee31ac1ab6 /pjsip/src/pjsip/sip_util.c
parentda1de0865a23a7eb5cde2b4160979164dbc08a39 (diff)
Tested initial implementation: basic UAC, client registration, authentication, etc
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@141 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsip/sip_util.c')
-rw-r--r--pjsip/src/pjsip/sip_util.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/pjsip/src/pjsip/sip_util.c b/pjsip/src/pjsip/sip_util.c
index ba068675..1a3fc3b6 100644
--- a/pjsip/src/pjsip/sip_util.c
+++ b/pjsip/src/pjsip/sip_util.c
@@ -441,10 +441,11 @@ PJ_DEF(pj_status_t) pjsip_endpt_create_ack( pjsip_endpoint *endpt,
const pjsip_cid_hdr *cid_hdr;
const pjsip_cseq_hdr *cseq_hdr;
const pjsip_hdr *hdr;
+ pjsip_hdr *via;
pjsip_to_hdr *to;
pj_status_t status;
- /* rdata must be a final response. */
+ /* rdata must be a non-2xx final response. */
pj_assert(rdata->msg_info.msg->type==PJSIP_RESPONSE_MSG &&
rdata->msg_info.msg->line.status.code >= 300);
@@ -487,11 +488,14 @@ PJ_DEF(pj_status_t) pjsip_endpt_create_ack( pjsip_endpoint *endpt,
to = (pjsip_to_hdr*) pjsip_msg_find_hdr(ack->msg, PJSIP_H_TO, NULL);
pj_strdup(ack->pool, &to->tag, &rdata->msg_info.to->tag);
+
+ /* Clear Via headers in the new request. */
+ while ((via=pjsip_msg_find_hdr(ack->msg, PJSIP_H_VIA, NULL)) != NULL)
+ pj_list_erase(via);
+
/* Must contain single Via, just as the original INVITE. */
hdr = pjsip_msg_find_hdr( invite_msg, PJSIP_H_VIA, NULL);
- if (hdr) {
- pjsip_msg_insert_first_hdr( ack->msg, pjsip_hdr_clone(ack->pool,hdr) );
- }
+ pjsip_msg_insert_first_hdr( ack->msg, pjsip_hdr_clone(ack->pool,hdr) );
/* If the original INVITE has Route headers, those header fields MUST
* appear in the ACK.