Commit 46ca5deb authored by Pekka Pessi's avatar Pekka Pessi

nta.c: request missing To tag matched dialog leg always.

Now the request with missing To tag matches only dialogs where the tag has
been added after creation of the leg.

This partly fixes the problem reported by Fabio Margarido.

darcs-hash:20070206175119-65a35-6105d75cc87166e14f486b380b45723b34e67404.gz
parent 4a8826a4
......@@ -3621,6 +3621,7 @@ char const *nta_leg_tag(nta_leg_t *leg, char const *tag)
if (tag) {
if (sip_to_tag(leg->leg_home, leg->leg_local, tag) < 0)
return NULL;
leg->leg_tagged = 1;
return leg->leg_local->a_tag;
}
......@@ -3629,6 +3630,8 @@ char const *nta_leg_tag(nta_leg_t *leg, char const *tag)
if (!tag || sip_to_add_param(leg->leg_home, leg->leg_local, tag) < 0)
return NULL;
leg->leg_tagged = 1;
return leg->leg_local->a_tag;
}
......@@ -3977,6 +3980,14 @@ nta_leg_t *leg_find(nta_agent_t const *sa,
/* Do not match if the incoming To has tag, but the local does not */
if (!local_tag && to_tag)
continue;
/*
* Do not match if incoming To has no tag and we have local tag
* and the tag has been there from the beginning.
*/
if (local_tag && !to_tag && !leg->leg_tagged)
continue;
/* Do not match if incoming From has no tag but remote has a tag */
if (remote_tag && !from_tag)
continue;
......
......@@ -346,6 +346,11 @@ struct nta_leg_s
unsigned leg_loose_route : 1; /**< Topmost route in set is LR */
#endif
unsigned leg_local_is_to : 1; /**< Backwards-compatibility. */
unsigned leg_tagged : 1; /**< Tagged after creation.
*
* Request missing To tag matches it
* even after tagging.
*/
unsigned:0;
nta_request_f *leg_callback;
nta_leg_magic_t *leg_magic;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment