Module: sip-router
Branch: pd/outbound
Commit: dd90d9685cb66843ff48c55b0100de9f98bfdf52
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=dd90d96…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Date: Thu Mar 14 23:05:32 2013 +0000
modules/registrar: tidied up unregister() function
---
modules/registrar/save.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/registrar/save.c b/modules/registrar/save.c
index bfcbaf6..a164683 100644
--- a/modules/registrar/save.c
+++ b/modules/registrar/save.c
@@ -968,10 +968,6 @@ int unregister(struct sip_msg* _m, udomain_t* _d, str* _uri, str
*_ruid)
urecord_t *r;
ucontact_t *c;
- u = parse_to_uri(_m);
- if(u==NULL)
- return -2;
-
if (extract_aor(_uri, &aor, NULL) < 0) {
LM_ERR("failed to extract Address Of Record\n");
return -1;
@@ -980,6 +976,10 @@ int unregister(struct sip_msg* _m, udomain_t* _d, str* _uri, str
*_ruid)
if (_ruid == NULL) {
/* No ruid provided - remove all contacts for aor */
+ u = parse_to_uri(_m);
+ if(u==NULL)
+ return -2;
+
if (star(_m, _d, &aor, &u->host) < 0)
{
LM_ERR("error unregistering user [%.*s]\n", aor.len, aor.s);