Module: sip-router
Branch: master
Commit: 2a895f5dcfd5b7ce003e37b2b1db6690852e3ff5
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2a895f5…
Author: Juha Heinanen <jh(a)tutpro.com>
Committer: Juha Heinanen <jh(a)tutpro.com>
Date: Tue Apr 9 18:28:01 2013 +0300
modules/tm: load_contacts() now prefers contacts whose path is empty
- For contacts with the same q, order contacts so that contacts that
have empty path are preferred over ones that have path defined. In
practice, this affects only contacts with the same ua instance id.
---
modules/tm/t_serial.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/modules/tm/t_serial.c b/modules/tm/t_serial.c
index bf87256..24f89ab 100644
--- a/modules/tm/t_serial.c
+++ b/modules/tm/t_serial.c
@@ -251,7 +251,9 @@ int t_load_contacts(struct sip_msg* msg, char* key, char* value)
prev = (struct contact *)0;
curr = contacts;
- while (curr && (curr->q < branch->q)) {
+ while (curr &&
+ ((curr->q < next->q) ||
+ ((curr->q == next->q) && (next->path.len == 0)))) {
prev = curr;
curr = curr->next;
}