summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2014-03-27 22:43:10 +0100
committerAlfred E. Heggestad <aeh@db.org>2014-03-27 22:43:10 +0100
commit332aff9e3345114e37b22f85a360091032d2f99f (patch)
tree0c09f87afd00f19a49f4c67135db007e36e334a9 /src
parent6bcde343f8e5bc88c4f1599f398cab0ecd6d3d57 (diff)
ua: prefix contact-user cookie with SIP username
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);
}