[Freeswitch-users] How to change Music-on-hold while digit_bind_action is used ?

julien terrasson julien.terrasson at gmail.com
Mon Apr 22 13:09:41 MSD 2013


Hi,

First of all, i've been discovering freeswitch recently and i found that
this is an awesome piece of software. I really enjoy discovering the
possibilities of the software and creating scenarios. Thanks for all the
people who made this possible and available.

The reason i'm posting is that i need help me to guide me in
troubleshooting..

This is the scenario i would like to acheive :*
*
***************************************************

* A & B are registered on FS
* A call B.
* When A press the star key
=> B is play a prompt that ask him if he would like to receive an email.
=> B can then choose to accept (by pressing "1") or reject (by pressing "2")
Meanwhile, A is played a specific moh that tell him that he have to wait
for B answer.

This the way i tried to implement it :
******************************************

DIALPLAN :

i'm using bind_digit_action with "*" to start a lua script on the *b_leg
context*.
=> "bind_digit_action","my_context,*,exec:lua,send_email.lua,a,*peer*"

EMAIL.LUA  :

*=> Change the moh on the A leg
*api:executeString("uuid_setvar ".. a_leg_uuid .. " hold_music
/usr/local/freeswitch/sounds/fr/ca/june/voxService/fr_wait_email.wav");

*=> Play and request digit (B leg)*
digit = session:playAndGetDigits(1, 1, 1, 5000, '#',
'/usr/local/freeswitch/sounds/fr/ca/june/voxService/fr_ask_email.wav', '',
'\\d+');

3/ Result :
*************
When "*" is pressed for the 1st time, FS act as if moh wasn't change.
It does only take into account the change the second time "*" is pressed.

i assume thats moh change can only be taken into account when
bind_digit_action is over.

So i would like to know if there is any existing way to change this
behaviour ?
If not, what would be the best way of implementing this scenario ?

Thanks for your answers.

Julien
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130422/11a65d21/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list