<div dir="ltr"><div><div>Hi,<br><br></div>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.<br>
<br></div><div>The reason i'm posting is that i need help me to guide me in troubleshooting..<br></div><div><br></div>This is the scenario i would like to acheive :<u><br></u><div><div>***************************************************<br>
<br><div>* A & B are registered on FS<br>* A call B.<br></div><div>* When A press the star key<br>=> B is play a prompt that ask him if he would like to receive an email.<br></div><div>=> B can then choose to accept (by pressing "1") or reject (by pressing "2")<br>
</div><div>Meanwhile, A is played a specific moh that tell him that he have to wait for B answer.<br></div><div><br></div><div>This the way i tried to implement it :<br>******************************************<br><br></div>
<div>DIALPLAN :<br><br>i'm using bind_digit_action with "*" to start a lua script on the <b>b_leg context</b>.<br></div><div>=> "bind_digit_action","my_context,*,exec:lua,send_email.lua,a,<b>peer</b>"<br>
</div><div><br></div><div>EMAIL.LUA :<br></div><div><br></div><div><u>=> Change the moh on the A leg<br></u>api:executeString("uuid_setvar ".. a_leg_uuid .. " hold_music /usr/local/freeswitch/sounds/fr/ca/june/voxService/fr_wait_email.wav");<br>
<br><u>=> Play and request digit (B leg)</u><br></div><div>digit = session:playAndGetDigits(1, 1, 1, 5000, '#', '/usr/local/freeswitch/sounds/fr/ca/june/voxService/fr_ask_email.wav', '', '\\d+');<br>
</div><div><br></div><div>3/ Result :<br></div><div>*************<br></div><div>When "*" is pressed for the 1st time, FS act as if moh wasn't change.<br>It does only take into account the change the second time "*" is pressed.<br>
<br>i assume thats moh change can only be taken into account when bind_digit_action is over.<br></div><div><br>So i would like to know if there is any existing way to change this behaviour ?<br></div><div>If not, what would be the best way of implementing this scenario ?<br>
<br></div><div>Thanks for your answers.<br><br></div><div>Julien <br></div><div><br></div></div></div></div>