From 650962b183c865dcc9c62d14172e4324f8e59823 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Tue, 3 Jun 2008 18:57:34 +0000 Subject: [PATCH] Tue Jun 3 13:43:59 EDT 2008 Pekka Pessi * 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 --- libs/sofia-sip/.update | 2 +- libs/sofia-sip/libsofia-sip-ua/nta/nta.c | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index b991cb080c..3dc57e3c0b 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Tue May 27 11:32:48 EDT 2008 +Tue Jun 3 14:56:27 EDT 2008 diff --git a/libs/sofia-sip/libsofia-sip-ua/nta/nta.c b/libs/sofia-sip/libsofia-sip-ua/nta/nta.c index f264bcac05..f8bcce170b 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nta/nta.c +++ b/libs/sofia-sip/libsofia-sip-ua/nta/nta.c @@ -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;