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