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@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)