Well posted - nicely done for a self-proclaimed n00b. For better readability you might want to try selecting syntax highlighting, kinda like <a href="http://pastebin.freeswitch.org/19580">http://pastebin.freeswitch.org/19580</a>.<br>
<br>If I had to wager a guess as to what&#39;s going on I&#39;d say &lt;shameless_plug&gt;you didn&#39;t get the FreeSWITCH &#39;bridge book&#39; and read chapter 7&lt;shameless_plug&gt;. At first blush I&#39;d say that your DTMFs are getting eaten by play_and_get_digits. Maybe try playback instead? And read chapter 7 - there&#39;s an example in there about reading digits w/ the input callback function.<br>
<br>As far as the avmd stuff goes I&#39;m not sure at this point. If I get a sec I&#39;ll tinker with it and see if I can replicate.<br><br>-MC <br><br><div class="gmail_quote">On Mon, Jul 23, 2012 at 4:03 PM, BF <span dir="ltr">&lt;<a href="mailto:bfmtl@hotmail.com" target="_blank">bfmtl@hotmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">It&#39;s my very first pastebin. I hope this is what you&#39;re expecting:  <a href="http://pastebin.freeswitch.org/19579" target="_blank">http://pastebin.freeswitch.org/19579</a><div>
<br><div><div>On Jul 23, 2012, at 6:40 PM, Michael Collins wrote:</div><br><blockquote type="cite">Can you pastebin the entire script?<br>-MC<br><br><div class="gmail_quote">On Mon, Jul 23, 2012 at 3:38 PM, Bernard Fluixa <span dir="ltr">&lt;<a href="mailto:fluixab@bellsouth.net" target="_blank">fluixab@bellsouth.net</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hello,</div><div><br></div><div>I can start mod_avmd and it detects voicemail beep when calling my cellphone. However, when I pickup the phone and press a key to use IVR, I would like to stop mod_avmd. I copied the input callback example from FreeSWITCH Wiki. My issue is that my input handler is never triggered, neither when I key a DTMF nor when beep is detected. </div>

<div><br></div><div><b>1) My handler is: </b></div><div><font color="#00aa45">function onInput(s, type, obj)</font></div><div><font color="#00aa45">    if (type == &quot;dtmf&quot;) then<span style="white-space:pre-wrap">                                                                </span></font></div>

<div><font color="#00aa45">        avmd_result = 1;</font></div><div><font color="#00aa45"><span style="white-space:pre-wrap">                </span>if ( debug_mode &gt; 0 ) then </font></div><div><font color="#00aa45"><span style="white-space:pre-wrap">                        </span>print(&quot;onInput - Human detected&quot;);<span style="white-space:pre-wrap">        </span></font></div>

<div><font color="#00aa45"><span style="white-space:pre-wrap">                </span>end</font></div><div><font color="#00aa45">        return &quot;break&quot;;</font></div><div><font color="#00aa45">    end</font></div><div><font color="#00aa45">    if (type == &quot;event&quot; ) then<span style="white-space:pre-wrap">                                                        </span></font></div>

<div><font color="#00aa45">        avmd_result = 2;</font></div><div><font color="#00aa45"><span style="white-space:pre-wrap">                </span>if ( debug_mode &gt; 0 ) then </font></div><div><font color="#00aa45"><span style="white-space:pre-wrap">                        </span>print(&quot;onInput - Voicemail detected&quot;);<span style="white-space:pre-wrap">        </span></font></div>

<div><font color="#00aa45"><span style="white-space:pre-wrap">                </span>end</font></div><div><font color="#00aa45">        avmd_result = 2;</font></div><div><font color="#00aa45">        return &quot;break&quot;;</font></div>

<div><font color="#00aa45">    end</font></div><div><font color="#00aa45">end</font></div><div><br></div><div><b>2) To start mod_avmd, play file and collect digits:</b></div><div><div><i><font color="#00aa45"><span style="white-space:pre-wrap">                </span>session:setInputCallback(&quot;onInput&quot;);</font></i></div>

<div><i><font color="#00aa45"><span style="white-space:pre-wrap">                </span>session:execute(&quot;avmd&quot;,&quot;start&quot;);</font></i></div></div><div><br></div><div><div><span style="white-space:pre-wrap">                </span><font color="#00aa12">digits = session:playAndGetDigits(…….);</font></div>

</div><div><br></div><div><b>3) To stop mod_avmd:</b></div><div><div><font color="#00aa12"><span style="white-space:pre-wrap">                </span>session:execute(&quot;avmd&quot;,&quot;stop&quot;);</font></div></div><div><br></div>
<div>
<b>4) Output when keying DTMF (*3 in this case). Input handler does not kick off upon DTMF: </b></div><div>EXECUTE sofia/external/<a href="tel:%2B19543307528" value="+19543307528" target="_blank">+19543307528</a> avmd(start)</div>

<div>012-07-23 18:13:28.025981 [INFO] mod_avmd.c:538 &lt;&lt;&lt; AVMD v=0.073060 f=0.900987 1147.172790Hz sma=0.090099 sqa=0.081178 &gt;&gt;&gt;</div><div>... </div><div><div>012-07-23 18:13:30.492866 [INFO] mod_avmd.c:538 &lt;&lt;&lt; AVMD v=0.052551 f=0.764130 972.920758Hz sma=0.076413 sqa=0.058389 &gt;&gt;&gt;</div>

<div><font color="#fb0047">2012-07-23 18:13:30.586854 [DEBUG] switch_rtp.c:3795 RTP RECV DTMF *:800</font></div><div>2012-07-23 18:13:30.605660 [INFO] mod_avmd.c:538 &lt;&lt;&lt; AVMD v=0.067196 f=0.864073 1100.171521Hz sma=0.086407 sqa=0.074662 &gt;&gt;&gt;</div>

</div><div>…</div><div><div>2012-07-23 18:13:30.998715 [INFO] mod_avmd.c:538 &lt;&lt;&lt; AVMD v=0.030803 f=0.585023 744.874518Hz sma=0.058502 sqa=0.034225 &gt;&gt;&gt;</div><div><font color="#fb0047">2012-07-23 18:13:31.085676 [DEBUG] switch_rtp.c:3795 RTP RECV DTMF 3:640</font></div>

</div><div>...</div><div>012-07-23 18:13:36.645609 [INFO] mod_avmd.c:538 &lt;&lt;&lt; AVMD v=0.030380 f=0.580996 739.747695Hz sma=0.058100 sqa=0.033756 &gt;&gt;&gt;</div><div><br></div><div><b>5) Output when beep is detected - Mod_avmd stops output after beep detection but input handler does not kick off</b></div>

<div><div>2012-07-23 18:04:04.992856 [INFO] mod_avmd.c:538 &lt;&lt;&lt; AVMD v=0.000048 f=0.812668 1034.721179Hz sma=0.811125 sqa=0.657971 &gt;&gt;&gt;</div><div>2012-07-23 18:04:04.992856 [INFO] mod_avmd.c:561 &lt;&lt;&lt; AVMD - Beep Detected &gt;&gt;&gt;</div>

</div><div><br></div><div>What am I missing?</div><div><br></div><div>Thank you</div><div><br></div><div>Bernard</div><div><br></div><div><br></div><div><br></div><br><div><div>On Jul 23, 2012, at 2:16 PM, Bernard Fluixa wrote:</div>

<br><blockquote type="cite"><div style="word-wrap:break-word">OK. I&#39;m clear now. Thanks again.<br><div><div>On Jul 23, 2012, at 1:17 PM, Michael Collins wrote:</div><br><blockquote type="cite">Precisely. <br>-MC<br><br>

<div class="gmail_quote">On Mon, Jul 23, 2012 at 9:59 AM, Bernard Fluixa <span dir="ltr">&lt;<a href="mailto:fluixab@bellsouth.net" target="_blank">fluixab@bellsouth.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div style="word-wrap:break-word">Michael,<div><br></div><div>Thank you or your response. So it is my responsibility to do whatever needs to be done while mod_avmd attempts to detect a beep and to manually stop it after a beep as been detected or after a certain timeout. Correct?</div>


<div><br></div><div>Bernard</div><div><br></div><div>  </div><div><br></div><div><br><div><div>On Jul 23, 2012, at 11:59 AM, Michael Collins wrote:</div><br><blockquote type="cite">Bernard,<br><br>Keep in mind that avmd is non-blocking, that is, it won&#39;t cause your dialplan or script to pause while it is attempting to detect the beep. Your dialplan will keep doing what it normally does, and if avmd detects a beep then it will throw an event which you catch and handle in your onInput function.<br>



<br>-MC<br><br><div class="gmail_quote">On Mon, Jul 23, 2012 at 6:47 AM, BF <span dir="ltr">&lt;<a href="mailto:bfmtl@hotmail.com" target="_blank">bfmtl@hotmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



Hello,<br>
<br>
I&#39;m trying to use it from a Lua script. My understanding is that mod_avmd detects beep from voicemail systems and is CPU intensive, please correct me if I&#39;m wrong.<br>
<br>
The Lua example at FreeSWITCH Wiki is<br>
local human_detected = false;<br>
local voicemail_detected = false;<br>
<br>
function onInput(session, type, obj)<br>
    if type == &quot;dtmf&quot; and obj[&#39;digit&#39;] == &#39;1&#39; and human_detected == false then<br>
        human_detected = true;<br>
        return &quot;break&quot;;<br>
    end<br>
<br>
    if type == &quot;event&quot; and voicemail_detected == false then<br>
        voicemail_detected = true;<br>
        return &quot;break&quot;;<br>
    end<br>
end<br>
<br>
session:setInputCallback(&quot;onInput&quot;);<br>
session:execute(&quot;avmd&quot;,&quot;start&quot;);<br>
In order to implement this example, the script must wait for the beep to be detected or not to process the case accordingly. What is no beep is detected? How can I prevent called party to hear only silence while potential beep detection is being executed?<br>




<br>
Thank you<br>
<br>
Bernard<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com/" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com/" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org/" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a><br>
<br>
Join Us At ClueCon - Aug 7-9, 2012<br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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>
</blockquote></div><br><br clear="all"><br>-- <br>Michael S Collins<br>Twitter: @mercutioviz<br><a href="http://www.FreeSWITCH.org/" target="_blank">http://www.FreeSWITCH.org</a><br><a href="http://www.ClueCon.com/" target="_blank">http://www.ClueCon.com</a><br>



<a href="http://www.OSTAG.org/" target="_blank">http://www.OSTAG.org</a><br><br><br>
_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services:<br><a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br><a href="http://www.freeswitchsolutions.com/" target="_blank">http://www.freeswitchsolutions.com</a><br>


<br>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br><a href="http://www.cudatel.com/" target="_blank">http://www.cudatel.com</a><br><br>Official FreeSWITCH Sites<br><a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br>


<a href="http://wiki.freeswitch.org/" target="_blank">http://wiki.freeswitch.org</a><br><a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a><br><br>Join Us At ClueCon - Aug 7-9, 2012<br><br>FreeSWITCH-users mailing list<br>


<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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>


</blockquote></div><br></div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com/" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com/" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org/" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a><br>
<br>
Join Us At ClueCon - Aug 7-9, 2012<br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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><br clear="all"><br>-- <br>Michael S Collins<br>Twitter: @mercutioviz<br><a href="http://www.FreeSWITCH.org/" target="_blank">http://www.FreeSWITCH.org</a><br><a href="http://www.ClueCon.com/" target="_blank">http://www.ClueCon.com</a><br>


<a href="http://www.OSTAG.org/" target="_blank">http://www.OSTAG.org</a><br><br><br>
_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services:<br><a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br><a href="http://www.freeswitchsolutions.com/" target="_blank">http://www.freeswitchsolutions.com</a><br>

<br>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br><a href="http://www.cudatel.com/" target="_blank">http://www.cudatel.com</a><br><br>Official FreeSWITCH Sites<br><a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br>

<a href="http://wiki.freeswitch.org/" target="_blank">http://wiki.freeswitch.org</a><br><a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a><br><br>Join Us At ClueCon - Aug 7-9, 2012<br><br>FreeSWITCH-users mailing list<br>

<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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>

</blockquote></div><br></div>_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services:<br><a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>

<a href="http://www.freeswitchsolutions.com/" target="_blank">http://www.freeswitchsolutions.com</a><br><br>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br><a href="http://www.cudatel.com/" target="_blank">http://www.cudatel.com</a><br>

<br>Official FreeSWITCH Sites<br><a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br><a href="http://wiki.freeswitch.org/" target="_blank">http://wiki.freeswitch.org</a><br><a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a><br>

<br>Join Us At ClueCon - Aug 7-9, 2012<br><br>FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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>

</blockquote></div><br></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com/" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com/" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org/" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a><br>
<br>
Join Us At ClueCon - Aug 7-9, 2012<br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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><br clear="all"><br>-- <br>Michael S Collins<br>Twitter: @mercutioviz<br><a href="http://www.FreeSWITCH.org/" target="_blank">http://www.FreeSWITCH.org</a><br><a href="http://www.ClueCon.com/" target="_blank">http://www.ClueCon.com</a><br>

<a href="http://www.OSTAG.org/" target="_blank">http://www.OSTAG.org</a><br><br><br>
_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services:<br><a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br><a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br><a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br><br>Official FreeSWITCH Sites<br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br><a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br><br>Join Us At ClueCon - Aug 7-9, 2012<br><br>FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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>
</blockquote></div><br></div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
Join Us At ClueCon - Aug 7-9, 2012<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><br clear="all"><br>-- <br>Michael S Collins<br>Twitter: @mercutioviz<br><a href="http://www.FreeSWITCH.org" target="_blank">http://www.FreeSWITCH.org</a><br><a href="http://www.ClueCon.com" target="_blank">http://www.ClueCon.com</a><br>
<a href="http://www.OSTAG.org" target="_blank">http://www.OSTAG.org</a><br><br><br>