Tue Jun 3 13:43:59 EDT 2008 Pekka Pessi <first.last@nokia.com>

* nta.c: accepting CANCEL with To tag copied from preliminary response



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8746 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2008-06-03 18:57:34 +00:00
parent 7f4c8a6d46
commit 650962b183
2 changed files with 14 additions and 12 deletions

View File

@ -1 +1 @@
Tue May 27 11:32:48 EDT 2008
Tue Jun 3 14:56:27 EDT 2008

View File

@ -5405,14 +5405,8 @@ static nta_incoming_t *incoming_find(nta_agent_t const *agent,
/* From tag, Call-ID, and CSeq number has been matched above */
/* Match To tag */
if (str0casecmp(irq->irq_to->a_tag, to->a_tag) &&
/* Ignore failing match if tag has been set */
/* and retransmitted request had no to tag */
!(irq->irq_tag_set && to->a_tag == NULL))
;
/* Match top Via header field */
else if (str0casecmp(irq->irq_via->v_branch, v->v_branch) != 0 ||
if (str0casecmp(irq->irq_via->v_branch, v->v_branch) != 0 ||
strcasecmp(irq->irq_via->v_host, v->v_host) != 0 ||
str0cmp(irq->irq_via->v_port, v->v_port) != 0)
;
@ -5423,10 +5417,18 @@ static nta_incoming_t *incoming_find(nta_agent_t const *agent,
/* Match CSeq */
if (irq->irq_method == cseq->cs_method &&
strcmp(irq->irq_cseq->cs_method_name,
cseq->cs_method_name) == 0)
return irq; /* found */
if (return_ack && irq->irq_method == sip_method_invite)
cseq->cs_method_name) == 0) {
/* Match To tag */
if (!str0casecmp(irq->irq_to->a_tag, to->a_tag))
return irq; /* found */
}
else if (
/* Tag set by UAS */
str0casecmp(irq->irq_tag, to->a_tag) &&
/* Original tag */
str0casecmp(irq->irq_to->a_tag, to->a_tag))
;
else if (return_ack && irq->irq_method == sip_method_invite)
return *return_ack = irq, NULL;
else if (return_cancel && irq->irq_method != sip_method_ack)
return *return_cancel = irq, NULL;