summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ua.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ua.c b/src/ua.c
index cb99011..5e05e98 100644
--- a/src/ua.c
+++ b/src/ua.c
@@ -474,18 +474,18 @@ int ua_alloc(struct ua **uap, const char *aor)
ua->af = AF_INET;
#endif
- /* generate a unique contact-user, this is needed to route
- incoming requests when using multiple useragents */
- err = re_sdprintf(&ua->cuser, "%p", ua);
- if (err)
- goto out;
-
/* Decode SIP address */
err = account_alloc(&ua->acc, aor);
if (err)
goto out;
+ /* generate a unique contact-user, this is needed to route
+ incoming requests when using multiple useragents */
+ err = re_sdprintf(&ua->cuser, "%r-%p", &ua->acc->luri.user, ua);
+ if (err)
+ goto out;
+
if (ua->acc->sipnat) {
ua_printf(ua, "Using sipnat: `%s'\n", ua->acc->sipnat);
}