mwi.lua

Status
Not open for further replies.

franklin1

New Member
Jul 12, 2020
3
2
3
54
When you clear the VMs out of the Message Center on a Polycom, but MWI will never appear again.

Been reading and found the post http://wiki.fusionpbx.com/index.php?title=Voicemail

when I run

fs_cli -x 'luarun app/voicemail/resources/scripts/mwi.lua'

I get this:

freeswitch@pbx.gran.com>
2020-07-13 14:57:58.708822 [ERR] mod_lua.cpp:202 ...eeswitch/scripts/app/voicemail/resources/scripts/mwi.lua:47: /usr/share/freeswitch/scripts/run/voicemail-mwi.tmp: No such file or directory
stack traceback:
[C]: in function 'assert'
...eeswitch/scripts/app/voicemail/resources/scripts/mwi.lua:47: in main chunk

I have a /etc/freeswitch/autoload_configs/lua.conf.xml
and

/usr/share/freeswitch/scripts/app/voicemail/resources/scripts/mwi.lua
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,412
376
83
In most cases we never need to use this script. The script is just designed to send out MWI reminder messages for phones that can't/don't remember their MWI state.

I think you are seeing the error because the script is unable to create the run file voicemail-mwi.tmp. Check that a directory exists called
/usr/share/freeswitch/scripts/run and that it is writable by the user that FreeSWITCH is running as (commonly www-data on Debian systems).

The purpose of the run file is that the script checks for its existence on each iteration of the program loop and if the file no longer exists it exits the script, thus providing a simple way of stopping the script.

If you are not seeing the MWI when a new message comes in, there may be another reason for that, I don't know enough about Polycom phones.
 
Last edited:
  • Like
Reactions: franklin1

franklin1

New Member
Jul 12, 2020
3
2
3
54
Thank you. We seem to be getting a handle on this. In certain circumstances the Polycoms lose the message info. We're working with the scripts to suit.
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,043
565
113
That wiki is ancient and largely getting more and more useless all the time. It was brought back in an era when the official documentation was nowhere what it is now.
 
  • Like
Reactions: franklin1

Dick Ollett

New Member
Nov 5, 2017
9
3
3
Interestingly

locate lua.conf.xml

returns both

/var/www/fusionpbx/resources/templates/conf/autoload_configs/lua.conf.xml
and

/etc/freeswitch/autoload_configs/lua.conf.xml

autostarting in /etc/freeswitch/autoload_configs/lua.conf.xml appears to work, not so much in
/var/www/fusionpbx/resources/templates/conf/autoload_configs/lua.conf.xml


. . . .
 
  • Like
Reactions: franklin1

Scubadave112

Member
Jan 24, 2020
122
19
18
36
Side note on this topic, I have been struggling to setup pager notifications for voicemails and couple of u seem very knowledgeable on MWI. I was wondering if I can somehow use MWI to trigger a script to to call a specified number every ten minutes until the voicemail is acknowledged or deleted.
Any advice I would even be willing to pay if someone can offer a solution to this
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,412
376
83
Interestingly

locate lua.conf.xml

returns both

/var/www/fusionpbx/resources/templates/conf/autoload_configs/lua.conf.xml
and

/etc/freeswitch/autoload_configs/lua.conf.xml

autostarting in /etc/freeswitch/autoload_configs/lua.conf.xml appears to work, not so much in
/var/www/fusionpbx/resources/templates/conf/autoload_configs/lua.conf.xml


. . . .
The files you found under /var/www/fusionpbx are used in the install / upgrade process, it is the ones under /etc that are actually in use.
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,412
376
83
Side note on this topic, I have been struggling to setup pager notifications for voicemails and couple of u seem very knowledgeable on MWI. I was wondering if I can somehow use MWI to trigger a script to to call a specified number every ten minutes until the voicemail is acknowledged or deleted.
Any advice I would even be willing to pay if someone can offer a solution to this
You may get more responses if you start a new thread for this question.

FusionPBX does not have such a facility currently, you could try putting in a feature request to the Fusion team. I don't think looking at MWI is the right way to go with this, but I like your thinking. FusionPBX does currently send out emails when voicemail arrives so it may be worth you looking at that mechanism.

Have a look at the code in /usr/share/freeswitch/scripts/app/voicemail/index.lua, look at the save function. Also have a look at the FreeSWITCH documentation for mod_voicemail, there is a lot of useful information there:

https://freeswitch.org/confluence/display/FREESWITCH/mod_voicemail
 
Status
Not open for further replies.