Please note: mod_avmd is *not* answering machine detection. There is a private mod_amd specifically for this purpose. Contact <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a> if you are interested in that.<div>
<br></div><div>mod_avmd is designed to detect the "beep" played by voicemail systems and answering machines. If a beep is detected then mod_avmd emits an event to the FreeSWITCH event sub-system. I would attach with fs_cli and listen for the event. Try this at fs_cli:</div>
<div><br></div><div>/log 0</div><div>/event plain CUSTOM</div><div><br></div><div>Then make some test calls and see if there is actually a detection. Once you confirm positive detection then you can see what's up with the Lua input callback.</div>
<div>-MC</div><div><br><div class="gmail_quote">On Thu, Nov 3, 2011 at 10:39 AM, Dave <span dir="ltr"><<a href="mailto:dave@clancysystems.com">dave@clancysystems.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<u></u>
<div bgcolor="#ffffff">
<div><font size="2" face="Arial">Hello, </font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">I am creating an external application that uses
FreeSWITCH ESL to initiate an outbound call and then run a LUA
script. Within the LUA script I am executing AVMD. I want to see if its a
human or voicemail on the other end. The outbound call is made
and the LUA script executes.</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">Currently I would just like to see a consoleLog
entry made by the onInput function in the LUA script, but that function does not
seem to be called. AVMD starts the file is streamed then AVMD stops. As
shown in the log.</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">I think I'm missing something.</font></div>
<div><font size="2" face="Arial">Dave Goodwin</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">Pertinent FreeSWITCH Log Info:</font></div>
<div><font size="2" face="Arial">-------------------------------------------------------------------------------------------------------</font></div>
<div><font size="2" face="Arial">EXECUTE <a href="mailto:sofia/internal/7202126254@xxx.xx.xxx.xx" target="_blank">sofia/internal/7202126254@xxx.xx.xxx.xx</a>
avmd(start)<br>2011-11-03 11:05:27.291678 [DEBUG] switch_core_media_bug.c:360
Attaching BUG to <a href="mailto:sofia/internal/3035649554@xxx.xx.xxx.xx" target="_blank">sofia/internal/7202126254@xxx.xx.xxx.xx</a><br>2011-11-03
11:05:28.311249 [DEBUG] switch_ivr_play_say.c:1279 Codec Activated <a href="mailto:L16@8000hz" target="_blank">L16@8000hz</a> 1 channels 20ms<br>2011-11-03
11:05:28.350313 [DEBUG] switch_rtp.c:3082 Correct ip/port
confirmed.<br>2011-11-03 11:05:40.235535 [DEBUG] switch_ivr_play_say.c:1649 done
playing file<br>EXECUTE <a href="mailto:sofia/internal/3035649554@xxx.xx.xxx.xx" target="_blank">sofia/internal/7202126254@xxx.xx.xxx.xx</a>
avmd(stop)<br>2011-11-03 11:05:40.237488 [DEBUG] switch_core_media_bug.c:467
Removing BUG from <a href="mailto:sofia/internal/3035649554@xxx.xx.xxx.xx" target="_blank">sofia/internal/7202126254@xxx.xx.xxx.xx</a><br></font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">Lua Script: </font></div>
<div><font size="2" face="Arial">-------------------------------------------------------------------------------------------------------</font></div>
<div><font size="2" face="Arial">function onInput(session, type,
obj)<br> if type == "dtmf" and obj['digit'] == '1' and
human_detected == false then<br>
human_detected = true<br>
freeswitch.consoleLog("INFO","Human Detected\n")<br> return
"break"<br> end<br> if type == "event" and
voicemail_detected == false then<br>
voicemail_detected = true<br>
freeswitch.consoleLog("INFO","Voicemail
Detected\n")<br> return
"break"<br> else<br>
freeswitch.consoleLog("INFO","Nothing
Happened\n")<br> return
"break"<br> end<br>end</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">if session:ready() then<br> --- the call
has been
answered.<br> session:setInputCallback("onInput")<br> session:sleep(1000)<br> session:execute("avmd","start")<br> session:sleep(1000)<br> session:streamFile("ivr/"
..
wav_file)<br> session:execute("avmd","stop")<br> session:sleep(1000)<br> fileName
= "Completed " .. tostring(call_from_num) .. os.time() ..
tostring(call_to_num)<br> freeswitch.consoleLog("INFO","FileName = " ..
fileName .. "\n")<br> local myfile, ErrStr = io.open("log/outcall/" ..
fileName,"w")<br> if myfile then<br> myfile:write(call_from_num
.. "|", call_to_num .. "|" ,
os.date())<br> myfile:flush()<br> myfile:close()<br> else<br> freeswitch.consoleLog("INFO","Error
writing File = '" .. ErrStr .. "'\n")<br> end --if<br>end
--if<br></font></div></div>
<br><br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>