Bugfix: Ommit Username in uri, if AOR is empty.
authorCarsten Bock <carsten@ng-voice.com>
Mon, 7 May 2012 09:56:03 +0000 (11:56 +0200)
committerCarsten Bock <carsten@ng-voice.com>
Mon, 7 May 2012 09:56:03 +0000 (11:56 +0200)
- Thanks to Gnaneshwar Gatla for reporting.

modules_k/pua_reginfo/usrloc_cb.c

index addeea9..c2528ca 100644 (file)
@@ -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);