I'm doing some outbound dialing, and want to use mod_vmd to detect if a live person picks up or a voicemail picks up. I've read the wiki, and have been pl<span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif;">aying around with the dialplan implementation and the lua implementation, along with capturing the mod_vmd</span></span><span class="Apple-style-span" style="line-height: 19px; white-space: pre; "><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif;"></span></span></span><div>
<span class="Apple-style-span" style="line-height: 19px; white-space: pre; "><span class="Apple-style-span" style="font-size: small;"><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif;">vmd::beep event.</span></span></span></div>
<div><span class="Apple-style-span" style="line-height: 19px; white-space: pre;"><br></span></div><div><span class="Apple-style-span" style="line-height: 19px; white-space: pre;">Using the examples on the wiki, I am able to call a number, sleep for 25 seconds, and mod_vmd usually detects a Beep (the answering machine beep right before you are to speak your message).</span></div>
<div><span class="Apple-style-span" style="line-height: 19px; white-space: pre;"><br></span></div><div><span class="Apple-style-span" style="line-height: 19px; white-space: pre;">My question is, is there a way to use mod_vmd to detect if an answering machine or human has picked up within the first 1-2 seconds after being answered? If so, can I get an example of how to set this up?</span></div>
<div><span class="Apple-style-span" style="line-height: 19px; white-space: pre;"><br></span></div><div><span class="Apple-style-span" style="line-height: 19px; white-space: pre;">my dialplan to test my lua implementation looks like</span></div>
<div><span class="Apple-style-span" style="line-height: 19px; white-space: pre;"><br></span></div><div><span class="Apple-style-span" style="line-height: 19px; white-space: pre;"> <!-- mod_vmd test extension (new mod)-->
<extension name="vmdtest">
<condition field="destination_number" expression="^1986$">
<action application="answer"/>
<action application="lua" data="matt_vmd.lua"/>
<action application="hangup"/>
</condition>
</extension><br></span></div><div><span class="Apple-style-span" style="line-height: 19px; white-space: pre;"><br></span></div><div><span class="Apple-style-span" style="line-height: 19px; white-space: pre;">and matt_vmd.lua looks like</span></div>
<div><span class="Apple-style-span" style="line-height: 19px; white-space: pre;"><br></span></div><div><span class="Apple-style-span" style="line-height: 19px; white-space: pre;">
print ("--matt_vmd.lua START--")
local human_detected = false;
local voicemail_detected = false;
function onInput(session, type, obj)
if type == "dtmf" and obj['digit'] == '1' and human_detected == false then
print('MATT--I detected a HUMAN');
human_detected = true;
return "break";
end
if type == "event" and voicemail_detected == false then
print('MATT--I detected a VOICEMAIL');
voicemail_detected = true;
return "break";
end
end
session:setInputCallback("onInput");
session:execute("vmd");
session:sleep(25000);
print ("--matt_vmd.lua FINISHED--")<br></span></div><div><span class="Apple-style-span" style="line-height: 19px; white-space: pre;"><br></span></div><div><span class="Apple-style-span" style="line-height: 19px; white-space: pre;"><br>
</span></div><div><span class="Apple-style-span" style="line-height: 19px; white-space: pre;">Thanks.</span></div><div><span class="Apple-style-span" style="line-height: 19px; white-space: pre;"><br></span></div><div><span class="Apple-style-span" style="line-height: 19px; white-space: pre;">--matt</span></div>
<div><span class="Apple-style-span" style="line-height: 19px; white-space: pre;"><br></span></div>