[Freeswitch-dev] error in con:pop wrong number of args

Michael Collins msc at freeswitch.org
Thu Apr 5 20:41:09 MSD 2012


what happens if you try it without the ",5"? Does it block and wait for an
event?
-MC

On Tue, Apr 3, 2012 at 6:25 PM, adam harris <admharris at gmx.com> wrote:

> I am getting this error from the test code below. I have used 2 arguments
> but it is picking up 3?
>
>
> 2012-04-03 21:16:08.583714 [ERR] mod_lua.cpp:191 Error in pop expected
> 1..2 args, got 3
> stack traceback:
>         [C]: in function 'pop'
>         /usr/local/freeswitch/scripts/aprompt.lua:21: in function '(for
> generator)'
>         /usr/local/freeswitch/scripts/aprompt.lua:21: in main chunk
>
>
> ---------------------------------------------------
>
> dtmfbuffer = ""
>
> con = freeswitch.EventConsumer("DTMF")
>
> session:setVariable("playback_terminators", "0123456789")
> session:execute("playback", "sound/test.wav")
>
>
> while ((session:ready() == true)) do
>
>
>  for e in (function() return con:pop(1,5) end) do
>
>  event_name = e:getHeader("Event-Name") or ""
>
>  if (event_name == "DTMF") then
>
>  print(dtmfbuffer)
>  end
>
>  end
>
> end
>
> session:hangup()
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20120405/451a8a4e/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-dev mailing list