<div dir="ltr">You are right. I tried this now and it works. I believe the root of your problem is that the dialplan finished executing before your ESL client could respond. By parking the call you avoid that.</div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, Dec 27, 2013 at 11:09 AM, Peter Olsson <span dir="ltr"><<a href="mailto:peter@olssononline.se" target="_blank">peter@olssononline.se</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Inbound works as well. But you need to add the park application in the dialplan, so it won't exit too early.<div><br></div><div>The park applications just places the call inside a loop, to let you do whatever you want to from ESL.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/12/27 Yisroel M. Olewski <span dir="ltr"><<a href="mailto:yisroel@machshevet.com" target="_blank">yisroel@machshevet.com</a>></span><div><div class="h5">
<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">From <a href="http://lists.freeswitch.org/pipermail/freeswitch-users/2011-October/077209.html" target="_blank">http://lists.freeswitch.org/pipermail/freeswitch-users/2011-October/077209.html</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">“if you want to control an incoming call (a call that hits an extension managed by freeswitch) you'll be better served by using a socket outbound connection. Off course this is from a design perspective, not because there are limitations when using an inbound connection.”<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Is he wrong?<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Is there any documentation this way or the other?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Changing to outbound is really a last resort, as this would disallow me to just connect to any arbitrary freeswitch instance at will<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">But rather requires freeswitch having precise knowledge of my application<u></u><u></u></span></p><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">While im considering outbound, I see that I have in my event_socket file:<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"><</span><span style="font-size:9.5pt;font-family:Consolas;color:#a31515;background:white">configuration</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"> </span><span style="font-size:9.5pt;font-family:Consolas;color:red;background:white">name</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">=</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">event_socket.conf</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"> </span><span style="font-size:9.5pt;font-family:Consolas;color:red;background:white">description</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">=</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">Socket Client</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">></span><span style="background:white;font-size:9.5pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"> <</span><span style="font-size:9.5pt;font-family:Consolas;color:#a31515;background:white">settings</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">></span><span style="background:white;font-size:9.5pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"> <</span><span style="font-size:9.5pt;font-family:Consolas;color:#a31515;background:white">param</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"> </span><span style="font-size:9.5pt;font-family:Consolas;color:red;background:white">name</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">=</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">nat-map</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"> </span><span style="font-size:9.5pt;font-family:Consolas;color:red;background:white">value</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">=</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">false</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">/></span><span style="background:white;font-size:9.5pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"> <</span><span style="font-size:9.5pt;font-family:Consolas;color:#a31515;background:white">param</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"> </span><span style="font-size:9.5pt;font-family:Consolas;color:red;background:white">name</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">=</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">listen-ip</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"> </span><span style="font-size:9.5pt;font-family:Consolas;color:red;background:white">value</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">=</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">0.0.0.0</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">/></span><span style="background:white;font-size:9.5pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"> <</span><span style="font-size:9.5pt;font-family:Consolas;color:#a31515;background:white">param</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"> </span><span style="font-size:9.5pt;font-family:Consolas;color:red;background:white">name</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">=</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">listen-port</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"> </span><span style="font-size:9.5pt;font-family:Consolas;color:red;background:white">value</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">=</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">8021</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">/></span><span style="background:white;font-size:9.5pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"> <</span><span style="font-size:9.5pt;font-family:Consolas;color:#a31515;background:white">param</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"> </span><span style="font-size:9.5pt;font-family:Consolas;color:red;background:white">name</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">=</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">password</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"> </span><span style="font-size:9.5pt;font-family:Consolas;color:red;background:white">value</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">=</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">mypass</span><span style="background:white;font-size:9.5pt;font-family:Consolas">"</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">/></span><span style="background:white;font-size:9.5pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"> <!--</span><span style="font-size:9.5pt;font-family:Consolas;color:green;background:white"> <param name="apply-inbound-acl" value="lan"/> </span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">--></span><span style="background:white;font-size:9.5pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"> </</span><span style="font-size:9.5pt;font-family:Consolas;color:#a31515;background:white">settings</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">></span><span style="background:white;font-size:9.5pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"></</span><span style="font-size:9.5pt;font-family:Consolas;color:#a31515;background:white">configuration</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white">><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d;background:white">Could this be confusing freeswitch to think I’m using outbound?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Thanks!<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><i><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#0f243e">Sincerely,<u></u><u></u></span></i></p>
<p class="MsoNormal"><i><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#0f243e">Yisroel M. Olewski <u></u><u></u></span></i></p><p class="MsoNormal"><i><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#0f243e">CEO<u></u><u></u></span></i></p>
<p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><img border="0" width="280" height="69" src="cid:image001.png@01CF02F9.D4409BF0"><u></u><u></u></span></p>
<p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><a href="tel:%2B1%20%28718%29%20514-2721" value="+17185142721" target="_blank">+1 (718) 514-2721</a><u></u><u></u></span></p>
<p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><a href="tel:%2B972%20%2852%29%20764-9971" value="+972527649971" target="_blank">+972 (52) 764-9971</a></span><span lang="HE" dir="RTL" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal" align="center" style="text-align:center"><b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Websites </span></b><b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d">·</span></b><b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> CRM </span></b><b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d">·</span></b><b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> ERP </span></b><b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d">·</span></b><b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> Telephony </span></b><b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d">·</span></b><b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> Inventory </span></b><b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d">·</span></b><b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> Content Management</span></b><b><span lang="HE" dir="RTL" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u><u></u></span></b></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Duvid Rottenberg [mailto:<a href="mailto:adrottenberg@gmail.com" target="_blank">adrottenberg@gmail.com</a>] <br>
<b>Sent:</b> Thursday, December 26, 2013 4:50 PM<br><b>To:</b> FreeSWITCH Users Help<br><b>Subject:</b> Re: [Freeswitch-users] answer via .net esl is getting ignored<u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p>
<div><p class="MsoNormal">If you are trying to handle incoming calls you probably will have to use outbound socket, otherwise Freeswitch will finish running the dialplan and hangup before your ESL client has a chance to send it any commands. As you can see from the log there are no dialplan matches found so FS responds with a 480. When using outbound mode you put the socket app in the dialplan so that FS knows to hand over the call handling to your ESL client.<u></u><u></u></p>
</div><div><p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p><div><p class="MsoNormal">On Thu, Dec 26, 2013 at 7:15 AM, Yisroel M. Olewski <<a href="mailto:yisroel@machshevet.com" target="_blank">yisroel@machshevet.com</a>> wrote:<u></u><u></u></p>
<div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Thanks fellows</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Sorry for the delay, we were a bit busy here lately</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I’m attaching the fs log. I don’t even see a the word “answer” there. </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">It seems fs is totally ignoring the incoming commands</span><u></u><u></u></p><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">if there’s a way to use inbound (which should be according to the docs) I’d rather not switch around the whole architecture just right now</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">If there won’t be any other choice, I guess I’ll try that</span><u></u><u></u></p><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Thank again</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><i><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#0f243e">Sincerely,</span></i><u></u><u></u></p><p class="MsoNormal"><i><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#0f243e">Yisroel M. Olewski </span></i><u></u><u></u></p>
<p class="MsoNormal"><i><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#0f243e">CEO</span></i><u></u><u></u></p><p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><img border="0" width="280" height="69" src="cid:image002.png@01CF02F9.D4409BF0"></span><u></u><u></u></p>
<p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><a href="tel:%2B1%20%28718%29%20514-2721" target="_blank">+1 (718) 514-2721</a></span><u></u><u></u></p>
<p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><a href="tel:%2B972%20%2852%29%20764-9971" target="_blank">+972 (52) 764-9971</a></span><u></u><u></u></p>
<p class="MsoNormal" align="center" style="text-align:center"><b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Websites · CRM · ERP · Telephony · Inventory · Content Management</span></b><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Duvid Rottenberg [mailto:<a href="mailto:adrottenberg@gmail.com" target="_blank">adrottenberg@gmail.com</a>] <br>
<b>Sent:</b> Tuesday, December 24, 2013 8:51 PM<br><b>To:</b> FreeSWITCH Users Help<br><b>Subject:</b> Re: [Freeswitch-users] answer via .net esl is getting ignored</span><u></u><u></u></p><div><div><p class="MsoNormal">
<u></u><u></u></p>
<div><p class="MsoNormal">Try using ESL Outbound mode, I am not sure why it would make a difference, but I have recently used outbound mode and I was able to answer the call. See the mod_event_socket wiki page and the sample code in the managed_esl project for more information.<u></u><u></u></p>
<div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">Duvid Rottenberg<u></u><u></u></p><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div></div></div>
<div><p class="MsoNormal" style="margin-bottom:12.0pt"> <u></u><u></u></p><div><p class="MsoNormal">On Tue, Dec 24, 2013 at 10:47 AM, Moishe Grunstein <<a href="mailto:max@nysolutions.com" target="_blank">max@nysolutions.com</a>> wrote:<u></u><u></u></p>
<div><div><p class="MsoNormal"><span style="color:#1f497d">What are you seeing in the logs?</span><u></u><u></u></p><p class="MsoNormal"><span style="color:#1f497d"> </span><u></u><u></u></p><div><p class="MsoNormal"><span style="color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#333399">Thanks,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#333399"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#333399">Moishe Grunstein</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#333399">Tornado Computer Systems, Inc.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#333399"><a href="tel:212.400.7650" target="_blank">212.400.7650</a> <a href="http://888.IPPBX.US" target="_blank">888.IPPBX.US</a><br>
</span><b><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#76923c">Service Request Email: <a href="mailto:support@nysolutions.com" target="_blank">support@nysolutions.com</a> </span></b><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#333399">Polycom Certified VAR<br>Microsoft Small Business Specialist, Cisco SMB Select Certified</span><u></u><u></u></p>
<p class="MsoNormal"><a href="http://www.nysolutions.com/" target="_blank"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d;text-decoration:none"><img border="0" width="147" height="68" src="cid:image003.jpg@01CF02F9.D4409BF0" alt="cid:image001.jpg@01C72F94.9EE45D60"></span></a><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:8.0pt;color:#c0504d">Computer Networking * Managed Services * IP Video Surveillance * Network Assessments * Web Solutions * Voice over IP * Disaster Recovery * Network Security * Site Surveys * CMS</span><u></u><u></u></p>
</div><p class="MsoNormal"><span style="color:#1f497d"> </span><u></u><u></u></p><div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>] <b>On Behalf Of </b>Yisroel M. Olewski<br>
<b>Sent:</b> Tuesday, December 24, 2013 4:23 AM<br><b>To:</b> <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br><b>Subject:</b> [Freeswitch-users] answer via .net esl is getting ignored</span><u></u><u></u></p>
</div></div><div><div><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">Hello everyone<u></u><u></u></p><p class="MsoNormal">This is my first posting via the mailing list<u></u><u></u></p><p class="MsoNormal">
I’m trying my hand at freeswitch esl with .net<u></u><u></u></p>
<p class="MsoNormal">I’ve managed to get a hold of all incoming events, but can’t seem to "pick up the phone"<u></u><u></u></p><p class="MsoNormal">my first goal is to pick up the phone and read out some text via tts<u></u><u></u></p>
<p class="MsoNormal">I’ve scoured the web, tried everything I can find or think of but no luck<u></u><u></u></p><p class="MsoNormal">here’s my code<u></u><u></u></p><p class="MsoNormal"><span dir="RTL"></span><span dir="RTL"></span><span lang="HE" dir="RTL"><span dir="RTL"></span><span dir="RTL"></span> </span><u></u><u></u></p>
<p class="MsoNormal"> Private Sub winMain_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded<u></u><u></u></p><p class="MsoNormal"> ThreadPool.QueueUserWorkItem(New WaitCallback(Sub(stateInfo)<u></u><u></u></p>
<p class="MsoNormal"> FreeSwitch = New ESLconnection("10.0.0.1", 8021, "mypass")<u></u><u></u></p><p class="MsoNormal"> Dim eslEvent = FreeSwitch.SendRecv("event plain ALL")<u></u><u></u></p>
<p class="MsoNormal"> FreeSwitch.SendRecv("event plain DTMF")<u></u><u></u></p><p class="MsoNormal"> If eslEvent IsNot Nothing Then<u></u><u></u></p>
<p class="MsoNormal"> AddEvent(eslEvent)<u></u><u></u></p><p class="MsoNormal"> While FreeSwitch.Connected<u></u><u></u></p>
<p class="MsoNormal"> eslEvent = FreeSwitch.RecvEvent<u></u><u></u></p><p class="MsoNormal"> AddEvent(eslEvent)<u></u><u></u></p>
<p class="MsoNormal"> End While<u></u><u></u></p><p class="MsoNormal"> End If<u></u><u></u></p><p class="MsoNormal">
End Sub))<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"> End Sub<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">
Private Sub AddEvent(e As ESLevent)<u></u><u></u></p><p class="MsoNormal"> Dim dd = TextCollection(e.Serialize(""), ": ", vbLf)<u></u><u></u></p><p class="MsoNormal"> Dim eventname = dd("event-name")<u></u><u></u></p>
<p class="MsoNormal"> 'Dim uid = dd("Unique-ID")<u></u><u></u></p><p class="MsoNormal"> Dim uid = dd("Channel-Call-UUID")<u></u><u></u></p><p class="MsoNormal"> If dd("Caller-Network-Addr") <> "" Then<u></u><u></u></p>
<p class="MsoNormal"> Dim dcx = DBEntities()<u></u><u></u></p><p class="MsoNormal"> Dim ses = dcx.Sessions.SingleOrDefault(Function(x) x.ServerCode = uid)<u></u><u></u></p><p class="MsoNormal"> Dim ChannelState = dd("Channel-State")<u></u><u></u></p>
<p class="MsoNormal"> Dim ChannelCallState = dd("Channel-Call-State").ToLower<u></u><u></u></p><p class="MsoNormal"> Select Case eventname<u></u><u></u></p><p class="MsoNormal"> Case "CHANNEL_STATE"<u></u><u></u></p>
<p class="MsoNormal"> If ses Is Nothing Then<u></u><u></u></p><p class="MsoNormal"> ses = New Session<u></u><u></u></p><p class="MsoNormal"> dcx.Sessions.AddObject(ses)<u></u><u></u></p>
<p class="MsoNormal"> End If<u></u><u></u></p><p class="MsoNormal"> ses.CallerHost = dd("Caller-Network-Addr")<u></u><u></u></p><p class="MsoNormal"> ses.CallerName = UrlDecoded(dd("Caller-Caller-ID-Name"))<u></u><u></u></p>
<p class="MsoNormal"> ses.CallerPhone = dd("Caller-Caller-ID-Number")<u></u><u></u></p><p class="MsoNormal"> ses.CallerUser = dd("Caller-Username")<u></u><u></u></p>
<p class="MsoNormal"> ses.CalleeUser = dd("Caller-Destination-Number")<u></u><u></u></p><p class="MsoNormal"> ses.ServerCode = uid<u></u><u></u></p><p class="MsoNormal"> If {"cs_destroy", "cs_hangup"}.Contains(ChannelState) Then ses.HungUpOn = Now<u></u><u></u></p>
<p class="MsoNormal"> Case "CHANNEL_CALLSTATE"<u></u><u></u></p><p class="MsoNormal"> If ChannelCallState = "ringing" Then<u></u><u></u></p><p class="MsoNormal"> Dim evn = FreeSwitch.Execute("answer", String.Empty, uid)<u></u><u></u></p>
<p class="MsoNormal"> Dim res = evn.Serialize("")<u></u><u></u></p><p class="MsoNormal"> End If<u></u><u></u></p><p class="MsoNormal"> Case "CHANNEL_DESTROY"<u></u><u></u></p>
<p class="MsoNormal"> If ses IsNot Nothing Then ses.HungUpOn = Now<u></u><u></u></p><p class="MsoNormal"> End Select<u></u><u></u></p><p class="MsoNormal"> dcx.SaveChanges()<u></u><u></u></p>
<p class="MsoNormal"> End If<u></u><u></u></p><p class="MsoNormal"> End Sub<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">the answer line is getting reached, and the result is "+OK" but the phone still keeps ringing<u></u><u></u></p>
<p class="MsoNormal">please note that I’m unsure which is the correct uuid, but trying both of them gave me identical results<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">As per advise from Nuwan Wijerathne, I put the “answer” action in the dialplan, and tried just the playback from code (just a wav file), but the result is the same. Freeswitch ignores entirely my commands.<u></u><u></u></p>
<p class="MsoNormal">It picks up, and immediately hangs up because it has finished the whole dialplan<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">I’d appreciate your help. I’m pretty new to freeswitch and esl<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">Please advise<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"><i><span style="color:#0f243e">Sincerely,</span></i><u></u><u></u></p>
<p class="MsoNormal"><i><span style="color:#0f243e">ymo</span></i><u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"><span dir="RTL"></span><span dir="RTL"></span><span lang="HE" dir="RTL"><span dir="RTL"></span><span dir="RTL"></span> </span><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p></div></div></div></div><p class="MsoNormal" style="margin-bottom:12.0pt"><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><u></u><u></u></p></div><p class="MsoNormal"> <u></u><u></u></p></div></div></div></div></div><p class="MsoNormal" style="margin-bottom:12.0pt">
<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><u></u><u></u></p>
</div><p class="MsoNormal"><u></u> <u></u></p></div></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></div></div><br></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>
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>