[Freeswitch-users] onInputCallback unstable in Python

Adam Wilt wiltingtree at gmail.com
Mon Dec 29 06:28:30 PST 2008


Should I add this to Jira?



On Sat, Dec 27, 2008 at 9:15 PM, Adam Wilt <wiltingtree at gmail.com> wrote:

> I'm using builds 10724 and 10914 to place an outbound call from the
> FreeSwitch console and use the onInputCallback functionality. My goal is to
> get mod_vmd working for me.
>
> When I run my script and press a touchtone to invoke the callback
> function,  I get some unstable behavior; sometimes it works fine, sometimes
> I get a core dump (send me an email at wiltingtree at gmail.com if anybody
> wants the core dump),  sometimes it gives me the following error:
>
>    TypeError: onInputCallback() takes exactly 3 arguments (0 given)
>
> In the documentation onInputCallback() takes 3 arguments, and I don't see
> how it would be very useful with zero.
>
> Here is a test script I put together which shows this behavior:
>
> import os
> from freeswitch import *
> def onInputCallback(session, what, obj):
>   consoleLog("INFO","IM IN THE CALLBACK!\n")
>   return("continue")
>
> def fsapi(session, stream, env, args):
>   consoleLog("INFO","Hello there!!!\n")
>   session =
> Session("{ignore_early_media=true}sofia/gateway/gafachi/1xxxxxxxxxx")
>   session.sleep(500)
>   session.setInputCallback(onInputCallback)
>   session.streamFile("/root/intro.wav")
>   consoleLog("info","Bye!\n")
>   session.hangup()
>   return(session)
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20081229/b5a3b8b7/attachment.html 


More information about the Freeswitch-users mailing list