Module: sip-router Branch: 3.1 Commit: cc4bcb18b064f7d66b16db2b452c0e36f14aecc3 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=cc4bcb18...
Author: Juha Heinanen jh@tutpro.com Committer: Juha Heinanen jh@tutpro.com Date: Mon Aug 8 11:22:23 2011 +0300
modules/tm: reverted previous commit on t_load_contacts()
---
modules/tm/t_serial.c | 49 +++++++++++++++++-------------------------------- 1 files changed, 17 insertions(+), 32 deletions(-)
diff --git a/modules/tm/t_serial.c b/modules/tm/t_serial.c index bd5ae27..899cb5b 100644 --- a/modules/tm/t_serial.c +++ b/modules/tm/t_serial.c @@ -242,21 +242,15 @@ int t_load_contacts(struct sip_msg* msg, char* key, char* value) }
ruri = (str *)0; - if (ruri_is_new) { - /* Take first q from Request-URI */ - ruri = GET_RURI(msg); - if (!ruri) { - LM_ERR("no Request-URI found\n"); - return -1; - } - first_q = get_ruri_q(); - first_idx = 0; - } else { - /* Take first q from first branch */ - uri.s = get_branch(0, &uri.len, &first_q, &dst_uri, &path, &flags, - &sock); - first_idx = 1; + + /* Take first q from Request-URI */ + ruri = GET_RURI(msg); + if (!ruri) { + LM_ERR("no Request-URI found\n"); + return -1; } + first_q = get_ruri_q(); + first_idx = 0;
/* Check if all q values are equal */ for(idx = first_idx; (tmp.s = get_branch(idx, &tmp.len, &q, 0, 0, 0, 0)) @@ -278,24 +272,15 @@ rest: return -1; }
- if (ruri_is_new) { - /* Insert Request-URI branch to first contact */ - contacts->uri.s = ruri->s; - contacts->uri.len = ruri->len; - contacts->dst_uri = msg->dst_uri; - contacts->sock = msg->force_send_socket; - getbflagsval(0, &contacts->flags); - contacts->path = msg->path_vec; - } else { - /* Insert first branch to first contact */ - contacts->uri = uri; - contacts->dst_uri = dst_uri; - contacts->sock = sock; - contacts->flags = flags; - contacts->path = path; - } - contacts->q = first_q; - contacts->next = (struct contact *)0; + /* Insert Request-URI branch to first contact */ + contacts->uri.s = ruri->s; + contacts->uri.len = ruri->len; + contacts->dst_uri = msg->dst_uri; + contacts->sock = msg->force_send_socket; + getbflagsval(0, &contacts->flags); + contacts->path = msg->path_vec; + contacts->q = first_q; + contacts->next = (struct contact *)0;
/* Insert (remaining) branches to contact list in increasing q order */