Httapi: getting digits in playback
Hi. After playback I ask to the user to digit a number between 1 and 9999 with or without terminating the input with '#'. The first httapi xml I tried was the following: <document type="text/freeswitch-httapi"> <work> <playback file="ivr/please_enter_number_between_1_9999.wav" digit-timeout="5000" name="user_input" terminators="#"> <bind>~\d{1,4}#{0,1}</bind> </playback> </work> </document> Freeswitch calls my action as soon as the user input the first digit. So I modified the xml in order to use two bindings: <document type="text/freeswitch-httapi"> <work> <playback file="ivr/please_enter_number_between_1_9999.wav" digit-timeout="5000" name="user_input" terminators="#"> <bind>~\d{1,3}#{0,1}</bind> <bind>~\d{4}#{0,1}</bind> </playback> </work> </document> Using this xml I get the user input only if the user press "#" after inserting the number. If the user presses 123 and then waits for timeout, Freeswitch doesn't send any digits to my action (but sometimes it does). Why?
From the logs I see that the digits are always received from Freeswitch.
Thank you in advance for your help. Denis Gasparin
Hi. The problem seems definetely due to bind_digit_action (used by <bind> tag of httapi). I tried to execute the "play_and_get_digits" dialplan application in xml returned to freeswitch and reading a channel var with stored digits and all is working fine. This is the working xml: <document type="text/freeswitch-httapi"> <work> <execute application="play_and_get_digits" data="1 4 1 5000 # ivr/ivr-please_enter_the_number_where_we_can_reach_you.wav '' myChannelVar \d+" /> <getVariable name=" myChannelVar "/> </work> </document> This is not the first time I have problem with bind_digit_action. I tried the same configuration on different linux distributions (Sles 11.1 and Centos 5.9) and mac os x with the same results: bind_digit_action sometimes works sometimes not. A question for Freeswitch developers: why has been bind_digit_action used in place of switch_play_and_get_digits for developing httapi? Lua mod uses switch_play_and_get_digits and has a more predictable and stable behaviour than httapi. I tried successfully to make a patch for httapi in order to use play_and_get_digits. If useful I can post it to jira. Thank you in advance Denis Gasparin ----- Messaggio originale ----- Da: "Denis Gasparin" <denis.gasparin@edistar.com> A: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Inviato: Mercoledì, 14 agosto 2013 18:49:03 Oggetto: Httapi: getting digits in playback Hi. After playback I ask to the user to digit a number between 1 and 9999 with or without terminating the input with '#'. The first httapi xml I tried was the following: <document type="text/freeswitch-httapi"> <work> <playback file="ivr/please_enter_number_between_1_9999.wav" digit-timeout="5000" name="user_input" terminators="#"> <bind>~\d{1,4}#{0,1}</bind> </playback> </work> </document> Freeswitch calls my action as soon as the user input the first digit. So I modified the xml in order to use two bindings: <document type="text/freeswitch-httapi"> <work> <playback file="ivr/please_enter_number_between_1_9999.wav" digit-timeout="5000" name="user_input" terminators="#"> <bind>~\d{1,3}#{0,1}</bind> <bind>~\d{4}#{0,1}</bind> </playback> </work> </document> Using this xml I get the user input only if the user press "#" after inserting the number. If the user presses 123 and then waits for timeout, Freeswitch doesn't send any digits to my action (but sometimes it does). Why?
From the logs I see that the digits are always received from Freeswitch.
Thank you in advance for your help. Denis Gasparin
participants (1)
-
Denis Gasparin