Module: sip-router Branch: hpw/branch_failure_route Commit: 1d8597f99b43154c1a078ade47984e6faf9f149c URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1d8597f9...
Author: Hugh Waite hugh.waite@crocodile-rcs.com Committer: Hugh Waite hugh.waite@crocodile-rcs.com Date: Thu Mar 28 09:48:04 2013 +0000
modules/tm: Fix setting instance in uac branches
---
modules/tm/t_fwd.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/modules/tm/t_fwd.c b/modules/tm/t_fwd.c index f463db9..e070518 100644 --- a/modules/tm/t_fwd.c +++ b/modules/tm/t_fwd.c @@ -304,7 +304,7 @@ static int prepare_new_uac( struct cell *t, struct sip_msg *i_req, can change/update msg->instance */ if (instance==&i_req->instance) instance=&instance_bak; - /* zero it first so that set_instancetor will work */ + /* zero it first so that set_instance will work */ i_req->instance.s=0; i_req->instance.len=0; if (unlikely(instance)){ @@ -419,6 +419,13 @@ static int prepare_new_uac( struct cell *t, struct sip_msg *i_req, i_req->path_vec.s=0; i_req->path_vec.len=0; } + if (unlikely(instance && (i_req->instance.s!=instance->s || + i_req->instance.len!=instance->len))){ + i_req->instance=*instance; + }else if (unlikely(instance==0 && i_req->instance.len!=0)){ + i_req->instance.s=0; + i_req->instance.len=0; + } } if (likely(next_hop!=0 || (flags & UAC_DNS_FAILOVER_F))){