[sr-dev] git:master: Bugfix: Ommit Username in uri, if AOR is empty.
admin at sip-router.org
admin at sip-router.org
Mon May 7 11:57:43 CEST 2012
Module: sip-router
Branch: master
Commit: 41e228e5a2166d796a2b52a6c2fea31603088a18
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=41e228e5a2166d796a2b52a6c2fea31603088a18
Author: Carsten Bock <carsten at ng-voice.com>
Committer: Carsten Bock <carsten at ng-voice.com>
Date: Mon May 7 11:56:03 2012 +0200
Bugfix: Ommit Username in uri, if AOR is empty.
- Thanks to Gnaneshwar Gatla for reporting.
---
modules_k/pua_reginfo/usrloc_cb.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/modules_k/pua_reginfo/usrloc_cb.c b/modules_k/pua_reginfo/usrloc_cb.c
index addeea9..c2528ca 100644
--- a/modules_k/pua_reginfo/usrloc_cb.c
+++ b/modules_k/pua_reginfo/usrloc_cb.c
@@ -233,7 +233,10 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) {
LM_ERR("Error allocating memory for URI!\n");
goto error;
}
- uri.len = snprintf(uri.s, uri.len, "sip:%.*s@%.*s", record->aor.len, record->aor.s, default_domain.len, default_domain.s);
+ if (record->aor.len > 0)
+ uri.len = snprintf(uri.s, uri.len, "sip:%.*s@%.*s", record->aor.len, record->aor.s, default_domain.len, default_domain.s);
+ else
+ uri.len = snprintf(uri.s, uri.len, "sip:%.*s", default_domain.len, default_domain.s);
} else {
uri.len = record->aor.len + 6;
uri.s = (char*)pkg_malloc(sizeof(char) * uri.len);
More information about the sr-dev
mailing list