what happens if you try it without the ",5"? Does it block and wait for an event?<br>-MC<br><br><div class="gmail_quote">On Tue, Apr 3, 2012 at 6:25 PM, adam harris <span dir="ltr"><<a href="mailto:admharris@gmx.com">admharris@gmx.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am getting this error from the test code below. I have used 2 arguments but it is picking up 3?<br>
<br>
<br>
2012-04-03 21:16:08.583714 [ERR] mod_lua.cpp:191 Error in pop expected 1..2 args, got 3<br>
stack traceback:<br>
[C]: in function 'pop'<br>
/usr/local/freeswitch/scripts/aprompt.lua:21: in function '(for generator)'<br>
/usr/local/freeswitch/scripts/aprompt.lua:21: in main chunk<br>
<br>
<br>
---------------------------------------------------<br>
<br>
dtmfbuffer = ""<br>
<br>
con = freeswitch.EventConsumer("DTMF")<br>
<br>
session:setVariable("playback_terminators", "0123456789")<br>
session:execute("playback", "sound/test.wav")<br>
<br>
<br>
while ((session:ready() == true)) do<br>
<br>
<br>
for e in (function() return con:pop(1,5) end) do<br>
<br>
event_name = e:getHeader("Event-Name") or ""<br>
<br>
if (event_name == "DTMF") then<br>
<br>
print(dtmfbuffer)<br>
end<br>
<br>
end<br>
<br>
end<br>
<br>
session:hangup()<br>
<br><br></blockquote></div>