MWI and VOIP Provider


I recently installed FreePBX and I have had no issues setting this up with my VOIP provider ( However I would like to just use their voicemail instead of the built in solution. Is there anyways to get the MWI routed from to freepbx. I know this works because my old setup uses the SIP proxy on my router to connect my deskphone. I can see the MWI and the SIP Notify in the logs.

On the wiki it mentions that you have to use this to get MWI to work with Asterisk:

Getting Message Waiting Indicator to Work with Voicemail sends MWI notifications unsolicited. Please make the following changes in your configurations.

Remove this Line please.

[general] Section

mwi => 123456:[email protected]/65000

Add this Line please.

[voipms] Section


I have added the unsolicited_mailbox to the sip_custom.conf but I still don’t see any MWI and restarted. I have also added this to the Chan SIP (A) Settings > Other SIP Settings.

Does anyone have any ideas?


Undo the changes to sip_custom.conf and chan sip settings. You want to add the “unsolicited_mailbox” line to the Peer Details field for your trunk config.

That will get parameter set, but you will need to do a few other things before’s MWI is delivered to an endpoint. Please follow up with your working setup.


You should add [email protected] to your sip trunk configuration.
Please report back for results.

Thank you,

Daniel Friedman
Trixton LTD.

Edit Sorry it’s not actually working as stated below Updated post below

Wow thanks guys, that worked a treat. So I have half way there. My working setup is as follows, I have freepbx running on server 2012 essentials with virtual box. For my endpoints I have avaya 9600’s and 9641’s. The only other thing is the feature codes *97 normally dial However, they are enabled in the system and dial the internal voicemail.

I have voicemail disabled but I still get the basic prompt. If I disable the feature codes i just get a busy signal so the issue now is using *97 to get out externally.



You should verify that the *97 is really dialling through the sip trunk. I would have set also the voice mail of your extension to *[email protected][your_voip.ms_trunk].

Thank you,

Daniel Friedman
Trixton LTD.

alright so in playing around with this I realize that my router still had the sip proxy enabled for my other phones which was the key to allowing the mwi to work. It is only when I deactivated that for another issue that I realized that there needs to be some additional configuration required.

So I am back to square one. So I have added the unsolicited line and now I have to figure out next steps.

@Lorne I know you mentioned there are some additional steps, what else is required?
That SIP proxy (Milkfish) on DD-WRT was what I was using to get these Avaya phones working really takes care of quite a lot, so now I have disabled that.

I also verified that when dialing *97 it does not go out to my sip provider based on the log files it looks like it is still accessing the internal voicemail system. Even after adding the voicemail extension as *[email protected][voipms]


The field after the *97 should be a context (without the square brackets).

Thank you,

Daniel Friedman
Trixton LTD.

Hi Daniel,

Thanks for that, I had tried both ways before but it looks like it is still referencing the internal voicemail.

[2015-11-05 08:25:17] VERBOSE[21164][C-00000000] pbx.c: Executing [[email protected]:300] NoOp("SIP/201-00000000", "") in new stack
[2015-11-05 08:25:17] VERBOSE[21164][C-00000000] pbx.c: Executing [*[email protected]:5] Set("SIP/201-00000000", "VMBOXEXISTSSTATUS=FAILED") in new stack
[2015-11-05 08:25:17] VERBOSE[21164][C-00000000] pbx.c: Executing [*[email protected]:6] GotoIf("SIP/201-00000000", "0?mbexist") in new stack
[2015-11-05 08:25:17] VERBOSE[21164][C-00000000] pbx.c: Executing [*[email protected]:7] VoiceMailMain("SIP/201-00000000", "") in new stack
[2015-11-05 08:25:17] VERBOSE[21164][C-00000000] file.c: <SIP/201-00000000> Playing 'vm-login.ulaw' (language 'en')
[2015-11-05 08:25:23] WARNING[21164][C-00000000] app_voicemail.c: Couldn't read username
[2015-11-05 08:25:23] VERBOSE[21164][C-00000000] pbx.c: Executing [[email protected]:1] Hangup("SIP/201-00000000", "") in new stack
[2015-11-05 08:25:23] VERBOSE[21164][C-00000000] pbx.c: Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/201-00000000'

I can see the [from-internal] context so not sure why it is pulling from that. Just to clarify as well I putting *[email protected] in the “voicemail extensions” field in the extension itself.

Thank you.


That is because there is a dialplan with *97 configured in your context (from-internal). You can configure a small bypass through your outbound routes or trunks. Configure a pattern of 9797 in your main outbound rule, or a specific outbound rule (Do not forget to change its position to be before your main outbound rule), and then remove the 2 first digits and add the *.

Thank you,

Daniel Friedman
Trixton LTD.

So just wanted to thank Lorne and Daniel for their help on this. For the MWI and Voicemail redirection both are working. Here are the steps that are required to get them going:


There are two components the first as mentioned above is to add the “unsolicited_mailbox” line to the “PEER Details” for your Trunk.

Go to "Connectivity > Trunks"
Under “PEER Details” add the last line in the config below

context=mycontext ;(one of our multiple servers, you can choose the one closer to your location)
secret=johnspassword ;your password
username=100000 ;(Replace with your 6 digit Main SIP Account User ID or Sub Account username, i.e. 123456 or 123456_sub)
; allow=g729 ; Uncomment if you support G729
fromuser=100000 ;(Replace with your 6 digit Main SIP Account User ID or Sub Account username, i.e. 123456 or 123456_sub)
unsolicited_mailbox=65000 ; 65000 being your mailbox ID which is different from your SIP account ID. Login to you account and look under "DID Numbers > Voicemail" 

Next you need to go to “Applications > Extensions” and you have to go to “Mailbox” and then add the following line:

[email protected]_Remote

Again replace 65000 with your mailbox ID.

Now I am working with Avaya phones as well which make this a little more iffy, they don’t seem to love a non-Avaya environment. I will post some additional details below on how to get them registering with Freepbx.

Voicemail Redirection

Now to get your voicemail calling for *97 redirected to you will have to either go to “Admin > Feature Codes” go down to the last one voicemail and change it to something else I used *88 and save and apply config and then disable it.

Next go back to “Connectivity > Trunks” and create a new Outbound rule and name it whatever you want. In the dialplan section just add *97 to the first field after prefix. I also added *xx as a secondary one but I don’t think it’s necessary. Ok save and apply config.

Lastly in the top Right hand corner where you see your outbound routes, drag the new route to be first in order and again apply config.

Some Notes on Avaya Phones and asterisk/freepbx

First you need to update your phones to a SIP firmware you can download them from Avaya’s website.

just an example:

Setup an HTTP server and make sure that port 80 is open and available. I used HFS

In your Avaya phone you need to enter the config settings. In order to do this you can either hit the * key when you see the program button when the phone is booting up. Or if it is already booted up you can use the following key sequence:


That will get you into the config menu and you can then you can go to ADDR and setup the address for the HTTP server.

You will also need to setup a 46xxsettings.txt file where all your settings are stored for the phone:

This is an example of some possible settings to use:

post by salabie has the necessary details:


these are the most important.

Next in your extension settings in Freebpx you have to turn off “NAT” so “Nat Mode” set to “No- (no)” and also set your Protocol “Transport” to “TCP Only”.

Also go to “Settings > Asterisk SIP Settings” then in the top right hand corner select “Chan SIP” and then locate the “Other SIP Settings” field and add the following:

tcpenable = yes

Any questions shoot me a PM. Thanks again to all of those who helped, I appreciate it. I hope some of the info here is useful to anyone else.



Good to hear to you have sort it out. Just one thing though, Are you sure that you need to replace the voicemail context of the extension to: @SIP_Remote ? Did you tried to leave the @default context of the Freepbx as is?

Thank you,

Daniel Friedman
Trixton LTD.

Hi Daniel,

Yes it’s what seemed to do the trick. When left @default it does not work. Not sure why exactly. There is another post that Lorne sent me in which the user setup the mailbox as @SIP_Remote.

Thanks again for your help, I am going to be getting all the rest of this up an running at least this tricky part is out of the way.



After reading a little bit more, I have found another piece of the sip.conf:

;----------------------------------------- OUTBOUND MWI SUBSCRIPTIONS -------------------------
; Asterisk can subscribe to receive the MWI from another SIP server and store it locally for retrieval
; by other phones. At this time, you can only subscribe using UDP as the transport.
; Format for the mwi register statement is:
;       mwi => user[:secret[:authuser]]@host[:port]/mailbox
; Examples:
;mwi => 1234:[email protected]/1234
;mwi => 1234:[email protected]:6969/1234
;mwi => 1234:password:[email protected]
;mwi => 1234:password:[email protected]:6969/1234
; MWI received will be stored in the 1234 mailbox of the SIP_Remote context.
; It can be used by other phones by following the below:
; [email protected]_Remote

Apparently, the SIP_Remote is a hard coded context in the Asterisk code and you should use it for unsolicited_mailbox.

Thank you,

Daniel Friedman
Trixton LTD.