Index: channels/chan_sip.c diff -Nau channels/chan_sip.c.orig channels/chan_sip.c --- channels/chan_sip.c.orig 2011-01-14 18:32:52.000000000 +0100 +++ channels/chan_sip.c 2011-03-13 14:34:29.000000000 +0100 @@ -26449,6 +26449,7 @@ struct sip_pvt *p; int newmsgs = 0, oldmsgs = 0; const char *vmexten = NULL; + char *s = NULL; ao2_lock(peer); @@ -26510,6 +26511,11 @@ } /* Recalculate our side, and recalculate Call ID */ ast_sip_ouraddrfor(&p->sa, &p->ourip, p); + /* 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); ao2_lock(peer);