[sr-dev] git:pd/outbound: modules/registrar: fill in ruid in msg and branch structures during lookup()

Peter Dunkley peter.dunkley at crocodile-rcs.com
Thu Mar 14 23:59:20 CET 2013


Module: sip-router
Branch: pd/outbound
Commit: ac7b94dbd991ba5c25d9afece2b6172b829f514b
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ac7b94dbd991ba5c25d9afece2b6172b829f514b

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Thu Mar 14 22:46:08 2013 +0000

modules/registrar: fill in ruid in msg and branch structures during lookup()

---

 modules/registrar/lookup.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/modules/registrar/lookup.c b/modules/registrar/lookup.c
index 91ccb8e..8872577 100644
--- a/modules/registrar/lookup.c
+++ b/modules/registrar/lookup.c
@@ -273,6 +273,13 @@ int lookup(struct sip_msg* _m, udomain_t* _d, str* _uri)
 		
 		_m->reg_id = ptr->reg_id;
 
+		if (ptr->ruid.len) {
+		    if (set_ruid(_m, &(ptr->ruid)) < 0) {
+				ret = -3;
+				goto done;
+		    }
+		}
+
 		set_ruri_q(ptr->q);
 
 		old_bflags = 0;
@@ -316,7 +323,8 @@ int lookup(struct sip_msg* _m, udomain_t* _d, str* _uri)
 					  &ptr->path, ptr->q, ptr->cflags,
 					  ptr->sock,
 					  ptr->instance.len?&(ptr->instance):0,
-				          ptr->instance.len?ptr->reg_id:0)
+				          ptr->instance.len?ptr->reg_id:0,
+					  &ptr->ruid)
 			    == -1) {
 				LM_ERR("failed to append a branch\n");
 				/* Also give a chance to the next branches*/
@@ -351,6 +359,7 @@ int reset_ruri_branch(sip_msg_t *msg)
 	setbflagsval(0, 0);
 	reset_instance(msg);
 	msg->reg_id = 0;
+	reset_ruid(msg);
 	return 0;
 }
 
@@ -375,6 +384,7 @@ int lookup_branches(sip_msg_t *msg, udomain_t *d)
 	flag_t ruri_b_flags = 0;
 	str ruri_b_instance = {0};
 	unsigned int ruri_b_reg_id = 0;
+	str ruri_b_ruid = {0};
 	branch_t *crt = NULL;
 
 	ret = 1;
@@ -399,6 +409,7 @@ int lookup_branches(sip_msg_t *msg, udomain_t *d)
 	getbflagsval(0, &ruri_b_flags);
 	ruri_b_instance = msg->instance;
 	ruri_b_reg_id = msg->reg_id;
+	ruri_b_ruid = msg->ruid;
 	reset_ruri_branch(msg);
 
 	for(i=0; i<nr_branches_start; i++) {
@@ -478,6 +489,7 @@ done:
 	setbflagsval(0, ruri_b_flags);
 	msg->instance = ruri_b_instance;
 	msg->reg_id = ruri_b_reg_id;
+	msg->ruid = ruri_b_ruid;
 
 	return (found)?1:ret;
 }




More information about the sr-dev mailing list