[sr-dev] git:master:63bd356c: pua_reginfo: use ul.get_urecord_by_ruid instead of ul.get_urecord

Victor Seva linuxmaniac at torreviejawireless.org
Wed Jul 15 21:36:08 CEST 2015


Module: kamailio
Branch: master
Commit: 63bd356cc3c7aa64d64361283f630f88b8db88af
URL: https://github.com/kamailio/kamailio/commit/63bd356cc3c7aa64d64361283f630f88b8db88af

Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2015-07-15T15:51:26+02:00

pua_reginfo: use ul.get_urecord_by_ruid instead of ul.get_urecord

---

Modified: modules/pua_reginfo/usrloc_cb.c

---

Diff:  https://github.com/kamailio/kamailio/commit/63bd356cc3c7aa64d64361283f630f88b8db88af.diff
Patch: https://github.com/kamailio/kamailio/commit/63bd356cc3c7aa64d64361283f630f88b8db88af.patch

---

diff --git a/modules/pua_reginfo/usrloc_cb.c b/modules/pua_reginfo/usrloc_cb.c
index 6b8cd68..0c68cec 100644
--- a/modules/pua_reginfo/usrloc_cb.c
+++ b/modules/pua_reginfo/usrloc_cb.c
@@ -218,9 +218,9 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) {
 	str content_type;
 	udomain_t * domain;
 	urecord_t * record;
+	ucontact_t* _c = NULL;
 	int res;
 	str uri = {NULL, 0};
-	str user = {NULL, 0};
 
 	char* at = NULL;
 	char id_buf[512];
@@ -245,9 +245,6 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) {
 		LM_ERR("Unknown Type %i\n", type);
 		return;
 	}
-	/* make a local copy of the AOR */
-	user.len = c->aor->len;
-	user.s = c->aor->s;
 
 	/* Get the UDomain for this account */
 	res = ul.get_udomain(c->domain->s, &domain);
@@ -256,10 +253,11 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) {
 		return;
 	}
 
-	/* Get the URecord for this AOR */
-	res = ul.get_urecord(domain, &user, &record);
-	if (res > 0) {
-		LM_ERR("' %.*s (%.*s)' Not found in usrloc\n", c->aor->len, c->aor->s, c->domain->len, c->domain->s);
+	/* Get the URecord for this ruid */
+	res = ul.get_urecord_by_ruid(domain, ul.get_aorhash(c->aor), &(c->ruid),
+		&record, &_c);
+	if (res < 0) {
+		LM_ERR("'%.*s (%.*s)' Not found in usrloc\n", c->aor->len, c->aor->s, c->domain->len, c->domain->s);
 		return;
 	}
 




More information about the sr-dev mailing list