Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 168737) +++ channels/chan_sip.c (working copy) @@ -15481,7 +15481,7 @@ parse_ok_contact(p, req); build_contact(p); - if (gotdest) { + if (strcmp(event, "message-summary") && gotdest) { transmit_response(p, "404 Not Found", req); ast_set_flag(&p->flags[0], SIP_NEEDDESTROY); if (authpeer) @@ -16165,6 +16165,22 @@ if (peer->mwipvt) { /* Base message on subscription */ p = peer->mwipvt; + + /* call-id@domain */ + char callid[32 + 1 + AST_MAX_EXTENSION]; + /* domain:port */ + char host[AST_MAX_EXTENSION + 1 + 5]; + char *stringp; + + ast_copy_string(callid, p->callid, sizeof(callid)); + stringp = callid; + + if (strsep(&stringp, "@")) { + ast_copy_string(host, S_OR(p->fromdomain, ast_inet_ntoa(p->ourip)), sizeof(host)); + stringp = host; + strsep(&stringp, ":"); + ast_string_field_build(p, callid, "%s@%s", callid, host); + } } else { /* Build temporary dialog for this message */ if (!(p = sip_alloc(NULL, NULL, 0, SIP_NOTIFY)))