Tue Jul 7 13:08:02 CDT 2009 Pekka Pessi <first.last@nokia.com>

* nta: treat user-via and previously-added via differently



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14172 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2009-07-09 16:15:06 +00:00
parent 2cb29fd42b
commit b24218957b
2 changed files with 9 additions and 7 deletions

View File

@ -1 +1 @@
Thu Jul 9 11:04:18 CDT 2009
Thu Jul 9 11:05:06 CDT 2009

View File

@ -513,7 +513,8 @@ struct nta_outgoing_s
unsigned orq_default:1; /**< This is default transaction */
unsigned orq_inserted:1;
unsigned orq_resolved:1;
unsigned orq_prepared:1; /**< outgoing_prepare() called */
unsigned orq_via_added:1;
unsigned orq_prepared:1;
unsigned orq_canceled:1;
unsigned orq_terminated:1;
unsigned orq_destroyed:1;
@ -2533,19 +2534,22 @@ int outgoing_insert_via(nta_outgoing_t *orq,
msg_t *msg = orq->orq_request;
sip_t *sip = sip_object(msg);
char const *branch = orq->orq_via_branch;
int already = orq->orq_user_via || orq->orq_via_added;
int user_via = orq->orq_user_via;
sip_via_t *v;
int clear = 0;
assert(sip); assert(via);
if (user_via && sip->sip_via) {
/* Use existing @Via provided by application */
if (already && sip->sip_via) {
/* Use existing @Via */
v = sip->sip_via;
}
else if (msg && via && sip->sip_request &&
(v = sip_via_copy(msg_home(msg), via))) {
msg_header_insert(msg, (msg_pub_t *)sip, (msg_header_t *)v);
if (msg_header_insert(msg, (msg_pub_t *)sip, (msg_header_t *)v) < 0)
return -1;
orq->orq_via_added = 1;
}
else
return -1;
@ -7973,8 +7977,6 @@ outgoing_send_via(nta_outgoing_t *orq, tport_t *tp)
return;
}
orq->orq_user_via = 1;
#if HAVE_SOFIA_SMIME
{
sm_object_t *smime = sa->sa_smime;