<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Arial; font-size: 12pt; color: #000000'><span>Hi.</span><div><span><br></span></div><div><span>The problem seems definetely due to bind_digit_action (used by <bind> tag of httapi).</span></div><div><span>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.</span></div><div><span><br></span></div><div><span>This is the working xml:</span></div><div><span><br></span></div><div><div><document type="text/freeswitch-httapi"></div><div> <work></div><div> <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+" /></div><div> <getVariable name="myChannelVar"/></div></div><div> </work></div><div></document></div><div><span><br></span></div><div><span>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.</span></div><div><span><br></span></div><div><span>A question for Freeswitch developers: why has been bind_digit_action used in place of switch_play_and_get_digits for developing httapi?</span></div><div><span>Lua mod uses </span><span style="font-size: 12pt; ">switch_play_and_get_digits and has a more predictable and stable behaviour than httapi.</span></div><div><span style="font-size: 12pt; ">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.</span></div><div><br></div><div>Thank you in advance</div><div>Denis Gasparin</div><div><br></div><div><br><hr id="zwchr"><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;"><b>Da: </b>"Denis Gasparin" <denis.gasparin@edistar.com><br><b>A: </b>"FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org><br><b>Inviato: </b>Mercoledì, 14 agosto 2013 18:49:03<br><b>Oggetto: </b>Httapi: getting digits in playback<br><br><style>p { margin: 0; }</style><div style="font-family: Arial; font-size: 12pt; color: #000000"><span style="font-size: 12pt; font-family: Arial;">Hi.</span><div style="font-size: 12pt; font-family: Arial;"><span><br></span></div><div style="font-size: 12pt; font-family: Arial;"><span>After playback I ask to the user to digit a number between 1 and 9999 with or without terminating the input with '#'.</span></div><div style="font-size: 12pt; font-family: Arial;"><span><br></span></div><div style="font-size: 12pt; font-family: Arial;"><span>The first httapi xml I tried was the following:</span></div><div style="font-size: 12pt; font-family: Arial;"><span><br></span></div><div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><document type="text/freeswitch-httapi"></font></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: small;"> <work></span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: small;"> <playback file="ivr/please_enter_number_between_1_9999.wav" digit-timeout="5000" name="user_input" terminators="#"></span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: small;"> <bind>~\d{1,4}#{0,1}</bind></span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: small;"> </playback></span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: small;"> </work></span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: small;"></document></span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: small;"><br></span></div><div><span style="font-family: Arial; font-size: 16px;">Freeswitch calls my action as soon as the user input the first digit.</span></div><div><span style="font-family: Arial; font-size: 16px;">So I modified the xml in order to use two bindings:</span></div><div><span style="font-family: Arial; font-size: 16px;"><br></span></div><div><div><font face="Courier New, courier, monaco, monospace, sans-serif" size="2"><document type="text/freeswitch-httapi"></font></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: small;"> <work></span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: small;"> <playback file="ivr/please_enter_number_between_1_9999.wav" digit-timeout="5000" name="user_input" terminators="#"></span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: small;"> <bind>~\d{1,3}#{0,1}</bind></span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: small;"> <bind>~\d{4}#{0,1}</bind></span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: small;"> </playback></span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: small;"> </work></span></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: small;"></document></span></div></div><div><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: small;"><br></span></div><div style="font-size: 12pt; font-family: Arial;">Using this xml I get the user input only if the user press "#" after inserting the number.</div></div><div style="font-size: 12pt; font-family: Arial;">If the user presses 123 and then waits for timeout, Freeswitch doesn't send any digits to my action (but sometimes it does). Why?</div><div style="font-size: 12pt; font-family: Arial;"><br></div><div style="font-size: 12pt; font-family: Arial;">From the logs I see that the digits are always received from Freeswitch.</div><div style="font-size: 12pt; font-family: Arial;"><br></div><div style="font-size: 12pt; font-family: Arial;">Thank you in advance for your help.</div><div style="font-size: 12pt; font-family: Arial;">Denis Gasparin</div></div></blockquote><br></div></div></body></html>