<div dir="ltr">I am new to freeswitch. I am trying to send a message to voicemail using avmd for voicemail detection, here is the code which i am using with originate command:<div><br></div><div><div>from freeswitch import *</div>
<div><br></div><div># WARNING: known bugs with hangup hooks, use with extreme caution</div><div>def hangup_hook(session, what):</div><div><br></div><div> consoleLog("info","hangup hook %s!!\n\n" % what)</div>
<div> return</div><div><br></div><div>def input_callback(session, what, obj):</div><div><br></div><div> if (what == "dtmf"):</div><div> consoleLog("info", what + " from callback " + obj.digit + "\n")</div>
<div> return</div><div> elif (what == "event" and session.getVariable('avmd_detect') == "TRUE"):</div><div> consoleLog("info", "Voicemail Detected\n")</div>
<div> return "true"</div><div><br></div><div>def handler(session, args):</div><div><br></div><div> session.answer()</div><div> session.execute("avmd", "start")</div><div> session.execute("sleep", "25000")</div>
<div> callback = session.setInputCallback(input_callback)</div><div> consoleLog("info","callback returned %s!!\n\n" % callback)</div><div> while session.getVariable('avmd_detect'):</div>
<div> session.execute("speak", "flite|kal|'Hi how are you'")</div><div><br></div><div> session.execute("avmd", "stop")</div><div> session.setHangupHook(hangup_hook)</div>
<div> session.hangup() #hangup the call</div></div><div><br></div><div><br></div><div>I can see avmd getting started but it does detect any beep. Is there a simpler way to check if avmd is working without using 'originate'?</div>
<div><br></div><div>Thanks</div></div>