From 332aff9e3345114e37b22f85a360091032d2f99f Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Thu, 27 Mar 2014 22:43:10 +0100 Subject: ua: prefix contact-user cookie with SIP username --- src/ua.c | 12 ++++++------ 1 file 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); } -- cgit v1.2.3