--- asterisk-1.6.2.18.orig/channels/chan_sip.c +++ asterisk-1.6.2.18/channels/chan_sip.c @@ -13809,6 +13809,7 @@ static enum check_auth_result register_v } if (!res) { ast_devstate_changed(AST_DEVICE_UNKNOWN, "SIP/%s", peer->name); + sip_send_mwi_to_peer(peer, NULL, 0); } if (res < 0) { switch (res) { @@ -23283,6 +23284,7 @@ static int sip_send_mwi_to_peer(struct s } /* Send MWI */ + peer->lastmsgssent = ((newmsgs > 0x7fff ? 0x7fff0000 : (newmsgs << 16)) | (oldmsgs > 0xffff ? 0xffff : oldmsgs)); ast_set_flag(&p->flags[0], SIP_OUTGOING); /* the following will decrement the refcount on p as it finishes */ transmit_notify_with_mwi(p, newmsgs, oldmsgs, peer->vmexten);