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 @@ -25085,6 +25085,7 @@ struct sip_pvt *p; int newmsgs = 0, oldmsgs = 0; const char *vmexten = NULL; + char *s = NULL; ao2_lock(peer); @@ -25138,6 +25139,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_t_unlink(dialogs, p, "About to change the callid -- remove the old name"); build_callid_pvt(p);