<div dir="ltr">I have changed my email , not sure if you got my last email so sending again, thanks for your help</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 26, 2013 at 11:48 AM, Rajput R Singh <span dir="ltr">&lt;<a href="mailto:srraghu45@gmail.com" target="_blank">srraghu45@gmail.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"><br><div><br><div>Begin forwarded message:</div><br><blockquote type="cite"><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
<span style="font-family:&#39;Helvetica&#39;;font-size:medium;color:rgba(0,0,0,1.0)"><b>From: </b></span><span style="font-family:&#39;Helvetica&#39;;font-size:medium">Michael Collins &lt;<a href="mailto:msc@freeswitch.org" target="_blank">msc@freeswitch.org</a>&gt;<br>
</span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:&#39;Helvetica&#39;;font-size:medium;color:rgba(0,0,0,1.0)"><b>Subject: </b></span><span style="font-family:&#39;Helvetica&#39;;font-size:medium"><b>Re: [Freeswitch-users] Issues with using avmd from python script</b><br>
</span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:&#39;Helvetica&#39;;font-size:medium;color:rgba(0,0,0,1.0)"><b>Date: </b></span><span style="font-family:&#39;Helvetica&#39;;font-size:medium">July 25, 2013 12:14:49 PM PDT<br>
</span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:&#39;Helvetica&#39;;font-size:medium;color:rgba(0,0,0,1.0)"><b>To: </b></span><span style="font-family:&#39;Helvetica&#39;;font-size:medium">FreeSWITCH Users Help &lt;<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>&gt;<br>
</span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:&#39;Helvetica&#39;;font-size:medium;color:rgba(0,0,0,1.0)"><b>Reply-To: </b></span><span style="font-family:&#39;Helvetica&#39;;font-size:medium">FreeSWITCH Users Help &lt;<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>&gt;<br>
</span></div><br><div dir="ltr"><div>I copied the logs to <a href="http://pastebin.freeswitch.org/21239" target="_blank">http://pastebin.freeswitch.org/21239</a> so that I could see them more easily. It looks to me like you&#39;re just hanging up the call after you detect the beep. If you want to do something else I would just add whatever dialplan apps you want to run.<br>

<br></div>-MC<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 25, 2013 at 10:56 AM, Raghu <span dir="ltr">&lt;<a href="mailto:srraghu45@gmail.com" target="_blank">srraghu45@gmail.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 dir="ltr">I have pasted the console debug logs <a href="http://pastebin.com/anN768su" target="_blank">here</a> , please review it<div>

<br></div><div>Thanks</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 25, 2013 at 9:06 AM, Michael Collins <span dir="ltr">&lt;<a href="mailto:msc@freeswitch.org" target="_blank">msc@freeswitch.org</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Get a complete console debug log of the call and put onto pastebin so that the gang here can review what&#39;s happening.<span><font color="#888888"><br>


</font></span></div><span><font color="#888888">-MC<br></font></span></div><div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Jul 24, 2013 at 11:01 PM, Raghu <span dir="ltr">&lt;<a href="mailto:srraghu45@gmail.com" target="_blank">srraghu45@gmail.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 dir="ltr">Thanks MC, i made the change and avmd was able to detect beep on few occasions everything else remaining same. Also, i wasnt able to send the message to voicemail, i tried with invoking sleep of 3secs<div>


<br>

</div><div>----------------------------------------</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(&quot;info&quot;,&quot;hangup hook for RAJ  %s!!\n\n&quot; % what)</div><div>    return </div><div><br></div><div>def input_callback(session, what, obj):</div><div><br></div><div>    if (what == &quot;dtmf&quot;):</div>




<div>        consoleLog(&quot;info&quot;, what + &quot; from callback &quot; + obj.digit + &quot;\n&quot;)</div><div>        return </div><div>    elif (what == &quot;event&quot; and session.getVariable(&#39;avmd_detect&#39;) == &quot;TRUE&quot;):</div>




<div>        consoleLog(&quot;info&quot;, &quot;Voicemail Detected\n&quot;)</div><div><br></div><div>    </div><div>    return &quot;TRUE&quot;</div><div><br></div><div>def handler(session, args):</div><div><br></div><div>




    session.answer()</div><div>    callback = session.setInputCallback(&quot;input_callback&quot;)</div><div>    session.execute(&quot;avmd&quot;, &quot;start&quot;)</div><div>    consoleLog(&quot;info&quot;, &quot;AVMD start\n&quot;)</div>




<div>    session.execute(&quot;sleep&quot;, &quot;16000&quot;)</div><div>    consoleLog(&quot;info&quot;, &quot;AVMD status %s\n&quot; % session.getVariable(&#39;avmd_detect&#39;))</div><div>    if session.getVariable(&#39;avmd_detect&#39;):</div>




<div>         session.execute(&quot;sleep&quot;, &quot;3000&quot;)</div><div>         consoleLog(&quot;info&quot;, &quot;Beep Detected\n&quot;)</div><div>         session.execute(&quot;speak&quot;, &quot;flite|kal|&#39;Hi this is &#39;&quot;)</div>




<div>         session.execute(&quot;avmd&quot;, &quot;stop&quot;)</div><div>    session.execute(&quot;speak&quot;, &quot;flite|kal|&#39;Hi this is &#39;&quot;)</div><div>    consoleLog(&quot;info&quot;,&quot;callback returned for  %s!!\n\n&quot; % callback)</div>




<div>    session.execute(&quot;avmd&quot;, &quot;stop&quot;)</div><div>    consoleLog(&quot;info&quot;, &quot;AVMD stop\n&quot;)</div><div>    session.setHangupHook(hangup_hook)</div><div>  </div><div>    </div><div>    session.hangup() #hangup the call</div>




</div><div>-----------------------------------------------------------------</div><div><br></div><div>Please suggest</div><div><br></div><div>Thanks</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 24, 2013 at 4:08 PM, Michael Collins <span dir="ltr">&lt;<a href="mailto:msc@freeswitch.org" target="_blank">msc@freeswitch.org</a>&gt;</span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Raghu,<br><br>I would put the setInputCallback before the sleep, that way if the avmd is detected while you&#39;re sleeping then it should work.<br>




<br></div>-MC<br></div><div class="gmail_extra"><br>
<br><div class="gmail_quote"><div>On Wed, Jul 24, 2013 at 1:30 PM, Raghu <span dir="ltr">&lt;<a href="mailto:srraghu45@gmail.com" target="_blank">srraghu45@gmail.com</a>&gt;</span> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<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(&quot;info&quot;,&quot;hangup hook   %s!!\n\n&quot; % what)</div>






<div>    return</div><div><br></div><div>def input_callback(session, what, obj):</div><div><br></div><div>    if (what == &quot;dtmf&quot;):</div><div>        consoleLog(&quot;info&quot;, what + &quot; from callback &quot; + obj.digit + &quot;\n&quot;)</div>






<div>        return</div><div>    elif (what == &quot;event&quot; and session.getVariable(&#39;avmd_detect&#39;) == &quot;TRUE&quot;):</div><div>        consoleLog(&quot;info&quot;, &quot;Voicemail Detected\n&quot;)</div>






<div>    return &quot;true&quot;</div><div><br></div><div>def handler(session, args):</div><div><br></div><div>    session.answer()</div><div>    session.execute(&quot;avmd&quot;, &quot;start&quot;)</div><div>    session.execute(&quot;sleep&quot;, &quot;25000&quot;)</div>






<div>    callback = session.setInputCallback(input_callback)</div><div>    consoleLog(&quot;info&quot;,&quot;callback returned %s!!\n\n&quot; % callback)</div><div>    while session.getVariable(&#39;avmd_detect&#39;):</div>






<div>         session.execute(&quot;speak&quot;, &quot;flite|kal|&#39;Hi how are you&#39;&quot;)</div><div><br></div><div>    session.execute(&quot;avmd&quot;, &quot;stop&quot;)</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 &#39;originate&#39;?</div>






<div><br></div><div>Thanks</div></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>
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><span><font color="#888888"><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>
</font></span></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>
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></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>
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>
</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>
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></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>
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>
</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>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></blockquote></div><br></div>