MWI and MetaSwitch

Hey all,

I have an asterisk box configured as a voicemail application server in our primary MetaSwitch that isn’t receiving MWI.

In previous versions of chan_sip.c, I could make changes that allowed unsolicited MWI SIP Notify messages to be sent to the MetaSwitch, but variations of the code changes in newer versions of chan_sip (I’m on 1.4.13) don’t have the same effect.

Here are the changes I used previously, from voip-info.org:

--- channels/chan_sip.c.orig    Thu Jul 14 12:03:18 2005
+++ channels/chan_sip.c Thu Jul 14 12:05:26 2005
@@ -9710,6 +9710,7 @@
        /* Called with peerl lock, but releases it */
        struct sip_pvt *p;
        int newmsgs, oldmsgs;
+       char *s;

        /* Check for messages */
        ast_app_messagecount(peer->mailbox, &newmsgs, &oldmsgs);
@@ -9735,6 +9736,10 @@
        /* Recalculate our side, and recalculate Call ID */
        if (ast_sip_ouraddrfor(&p->sa.sin_addr,&p->ourip))
                memcpy(&p->ourip, &__ourip, sizeof(p->ourip));
+       strcpy(p -> username, peer -> mailbox);  /* Username = Mailbox name */
+       s = strchr(p -> username, '@');          /* Remove the context part */
+       if (s != NULL)
+                *s = 0;
        build_via(p, p->via, sizeof(p->via));
        build_callid(p->callid, sizeof(p->callid), p->ourip, p->fromdomain);
        /* Send MWI */

Is there a better way to get Asterisk to send unsolicited MWI Notifications to the MetaSwitch?

There are some other suggestions regarding fromdomain, fromuser, the mailbox= line which is set, etc., but without some code changes like above, the SIP dialog still shows the user as Unknown in the From header which breaks MWI for the MetaSwitch.

It seems like I just need the created SIP Notify to include the voicemail extension in the From field but nothing I try gets it in there - it is always ‘Unknown’.

Any suggestions? I appreciate any tips/pointers.
Dustin

use the external notify script setting (see the app voicemail config) and fire off a script that uses sipsak to do the notify… this will allow you to acomplish the task w/ no code modifications to asterisk… also this works with things like SER

Did you ever figure out how to get MWI to work with MetaSwitch?