<br><div class="h5"><br>
</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">It shouldn't be hard to do with a small lua script with an input<br>
callback handling DTMFs.<br>
<br>
You could even create a small DTMF editor with a digit for "backspace"<br>
character for example, that would erase the last digit, or a digit that<br>
would say the current sequence....<br>
<br>
Check out:<br>
<a href="http://wiki.freeswitch.org/wiki/Lua#session:setInputCallback" target="_blank">http://wiki.freeswitch.org/wiki/Lua#session:setInputCallback</a><br>
<br>
François.<br>
<br></blockquote><div><br>Nice!<br><br> i wrote a small script:<br><br><br></div></div>function onInput(s, type, obj)<br> if (type == "dtmf") then<br> freeswitch.consoleLog("info", "DTMF Digit: " .. obj.digit .. "\n");<br>
freeswitch.consoleLog("info", "DTMF Duration: " .. obj.duration .. "\n");<br> if (obj.duration > 2000) then<br> freeswitch.consoleLog("info", "we got long DTMF \n");<br>
end<br> end<br>end<br><br><br>session:answer();<br>session:setInputCallback("onInput");<br>session:sleep(200);<br><br>while (session:ready() == true) do<br> session:sleep(100);<br>end<br><br><br><br><br>
i run it in dialplan as:<br><br><br><include><br> <extension name="longPound"><br> <condition field="destination_number" expression="^pound$"><br> <action application="lua" data="Pound.lua"/><br>
<br> <action application="playback" data="bla1"/><br> <action application="playback" data="bla2"/><br> <action application="playback" data="bla3"/><br>
<br><br> <!-- <action application="sleep" data="10000"/> --><br> </condition><br> </extension><br></include><br><br><br><br>but it seems the lua scripts is blocking .... i never get to playback part. I need to make it run in background for the entire duration of the session<br>
<br>how can i do it?<br><br>T.<br><br>