From: Michael Jerris Date: Wed, 10 Sep 2008 16:23:59 +0000 (+0000) Subject: Wed Sep 10 11:46:36 EDT 2008 Pekka Pessi X-Git-Tag: v1.0.2~1244 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07f024c9b9998820887244bb1460448c1b8be7d5;p=thirdparty%2Ffreeswitch.git Wed Sep 10 11:46:36 EDT 2008 Pekka Pessi * test_s2.c: add From tag to s2-generated requests git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9517 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/test_s2.c b/libs/sofia-sip/libsofia-sip-ua/nua/test_s2.c index 17a3955d14..d9f1918df2 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/test_s2.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/test_s2.c @@ -629,6 +629,20 @@ s2_request_to(struct dialog *d, if (sip->sip_payload) l->l_length = sip->sip_payload->pl_len; + if (d->local->a_tag == NULL) { + char const *ltag = s2_generate_tag(d->home); + + if (sip_from_tag(d->home, d->local, ltag) < 0) { + assert(!"add To tag"); + } + + if (sip->sip_from && sip->sip_from->a_tag == NULL) { + if (sip_from_tag(msg_home(msg), sip->sip_from, ltag) < 0) { + assert(!"add To tag"); + } + } + } + sip_add_tl(msg, sip, TAG_IF(!sip->sip_from, SIPTAG_FROM(d->local)), TAG_IF(!sip->sip_contact, SIPTAG_CONTACT(d->contact)),