<div dir="ltr">Hi Jeff,<div><br></div><div>Hello all. Still not able to figure out avmd in C# managed code. Please guide me.</div><div><br></div><div>1. My <span style="font-family:arial,sans-serif;font-size:13.333333969116211px">EventReceivedFunction</span><span style="font-family:arial,sans-serif;font-size:13.333333969116211px"> takes </span><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">only</span><span style="font-family:arial,sans-serif;font-size:13.333333969116211px"> </span><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">one argument (ev). There is a compile time error in visual studio if I pass (ev,s). My FreeSwitch.Managed.dll version is 1.0.5. Interesting thing is the intellisense does show as if </span><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">EventReceivedFunction takes two arguments as you've shown. </span><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">dtmf function works with two arguments.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">2. Now, I look at examples on this page: </span><font face="arial, sans-serif"><a href="http://wiki.freeswitch.org/wiki/Mod_avmd">http://wiki.freeswitch.org/wiki/Mod_avmd</a></font></div>
<div><font face="arial, sans-serif">What is C# managed equivalent? My code:</font></div><div><font face="arial, sans-serif"><div> mObjMainSession.Answer();</div><div><div> mObjMainSession.Execute("avmd", "start");</div>
</div><div><div> mObjMainSession.DtmfReceivedFunction = (d, t) =></div><div> {</div><div> Log.WriteLine(LogLevel.Notice, aObjCntx.Session.uuid + "-" + "Received {0} for {1}.", d, t);</div>
<div> return "";<br></div><div> };</div><div><br></div><div> if (check this is an outbound call)<br></div><div> {</div><div> mObjMainSession.EventReceivedFunction = (ev) =></div>
<div> {</div><div> Log.WriteLine(LogLevel.Notice, aObjCntx.Session.uuid + "-" + "Event type {0} / Event body {2} .", ev.GetEventType(), ev.GetBody());<br></div>
<div><br></div><div> if (mObjMainSession.GetVariable("avmd_detect") == "TRUE")</div><div> {</div><div> Log.WriteLine(LogLevel.Notice, aObjCntx.Session.uuid + "-" + "VM detected");</div>
<div> }<br></div><div> return "";<br></div><div> };</div><div> }</div><div><br></div></div><div>If "VM detected", what do I do? Just call hang up from EventReceivedFunction?</div>
<div>Do I call "mObjMainSession.Execute("avmd", "stop");" anywhere?</div></font></div><div><font face="arial, sans-serif">Tutorial also says, one must wait a few seconds after answering the call before starting avmd. What does that mean?</font></div>
<div><font face="arial, sans-serif">How do I find out load on CPU being put by avmd? I will be making 50 concurrent outbound calls.</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">3. Same managed code on my extension handles inbound (uses calling system) as well as outbound calls (system calling users). Should I only enable/check avmd when it is an outbound call?</font></div>
<div><font face="arial, sans-serif"><br></font></div><div><span style="font-family:arial,sans-serif">Please help.</span><br></div><div><span style="font-family:arial,sans-serif"><br></span></div><div><span style="font-family:arial,sans-serif">Thanks.</span></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Mar 6, 2011 at 11:07 AM, Jeff Lenk <span dir="ltr"><<a href="mailto:jeff@jefflenk.com" target="_blank">jeff@jefflenk.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sure,<br>
<br>
Modify this sample out of demo.csx from the source tree. maybe enough here<br>
to get you started.<br>
<br>
using System;<br>
using FreeSWITCH;<br>
using FreeSWITCH.Native;<br>
<br>
public class AppDemo : IAppPlugin {<br>
<br>
ManagedSession Session;<br>
public void Run(AppContext context) {<br>
Session = context.Session;<br>
Session.Answer();<br>
Session.DtmfReceivedFunction = (d, t) => {<br>
Log.WriteLine(LogLevel.Notice, "Received {0} for {1}.", d, t);<br>
return "";<br>
};<br>
<br>
Session.EventReceivedFunction = (ev, s) => {<br>
return "";<br>
};<br>
<br>
// add your stuff here<br>
<br>
Log.WriteLine(LogLevel.Notice, "AppDemo is finishing its run and<br>
will now hang up.");<br>
Session.Hangup("USER_BUSY");<br>
}<br>
<br>
}<br>
<br>
--<br>
View this message in context: <a href="http://freeswitch-users.2379917.n2.nabble.com/avmd-from-mod-managed-tp6092621p6094692.html" target="_blank">http://freeswitch-users.2379917.n2.nabble.com/avmd-from-mod-managed-tp6092621p6094692.html</a><br>
Sent from the freeswitch-users mailing list archive at Nabble.com.<br>
<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>
</blockquote></div><br></div>