Skip to content

Commit

Permalink
Bugfix: Ommit Username in uri, if AOR is empty.
Browse files Browse the repository at this point in the history
- Thanks to Gnaneshwar Gatla for reporting.
  • Loading branch information
carstenbock committed May 7, 2012
1 parent 002b3b5 commit 41e228e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules_k/pua_reginfo/usrloc_cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 41e228e

Please sign in to comment.