michael@202: Index: channels/chan_sip.c michael@202: diff -Nau channels/chan_sip.c.orig channels/chan_sip.c michael@202: --- channels/chan_sip.c.orig 2009-04-24 00:51:58.000000000 +0200 michael@202: +++ channels/chan_sip.c 2009-04-24 00:52:33.000000000 +0200 michael@202: @@ -16428,6 +16428,7 @@ michael@202: /* Called with peerl lock, but releases it */ michael@202: struct sip_pvt *p; michael@202: int newmsgs, oldmsgs; michael@202: + char *s = NULL; michael@202: michael@202: /* Do we have an IP address? If not, skip this peer */ michael@202: if (!peer->addr.sin_addr.s_addr && !peer->defaddr.sin_addr.s_addr) michael@202: @@ -16461,6 +16462,11 @@ michael@202: /* Recalculate our side, and recalculate Call ID */ michael@202: if (ast_sip_ouraddrfor(&p->sa.sin_addr, &p->ourip)) michael@202: p->ourip = __ourip; michael@202: + /* Set the username = mailbox and remove the context */ michael@202: + ast_string_field_build(p, username, "%s", peer->name); michael@202: + s = strchr(p->username, '@'); michael@202: + if (s != NULL) michael@202: + *s = 0; michael@202: build_via(p); michael@202: build_callid_pvt(p); michael@202: /* Destroy this session after 32 secs */