<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Sounds like it might be a codec issue. Paste the logs from the call, when answer fails.<br><br>/Peter</div><div><br>
24 dec 2013 kl. 16:50 skrev &quot;Yisroel M. Olewski&quot; &lt;<a href="mailto:yisroel@machshevet.com">yisroel@machshevet.com</a>&gt;:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><meta name="Generator" content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.WordSection1
        {page:WordSection1;}
--></style><div class="WordSection1"><p class="MsoNormal">Hello everyone</p><p class="MsoNormal">This is my first posting via the mailing list</p><p class="MsoNormal">I’m trying my hand at freeswitch esl with .net</p><p class="MsoNormal">
I’ve managed to get a hold of all incoming events, but can’t seem to &quot;pick up the phone&quot;</p><p class="MsoNormal">my first goal is to pick up the phone and read out some text via tts<span style="font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"></span></p>
<p class="MsoNormal">I’ve scoured the web, tried everything I can find or think of but no luck<span style="font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p><p class="MsoNormal">here’s my code<span lang="HE" dir="RTL" style="font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>
<p class="MsoNormal"> </p><p class="MsoNormal">    Private Sub winMain_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded</p><p class="MsoNormal">        ThreadPool.QueueUserWorkItem(New WaitCallback(Sub(stateInfo)</p>
<p class="MsoNormal">                                                          FreeSwitch = New ESLconnection(&quot;10.0.0.1&quot;, 8021, &quot;mypass&quot;)</p><p class="MsoNormal">                                                          Dim eslEvent = FreeSwitch.SendRecv(&quot;event plain ALL&quot;)</p>
<p class="MsoNormal">                                                          FreeSwitch.SendRecv(&quot;event plain DTMF&quot;)</p><p class="MsoNormal">                                                          If eslEvent IsNot Nothing Then</p>
<p class="MsoNormal">                                                              AddEvent(eslEvent)</p><p class="MsoNormal">                                                              While FreeSwitch.Connected</p><p class="MsoNormal">
                                                                  eslEvent = FreeSwitch.RecvEvent</p><p class="MsoNormal">                                                                  AddEvent(eslEvent)</p><p class="MsoNormal">
                                                              End While</p><p class="MsoNormal">                                                          End If</p><p class="MsoNormal">                                                      End Sub))</p>
<p class="MsoNormal"> </p><p class="MsoNormal">    End Sub</p><p class="MsoNormal"> </p><p class="MsoNormal">    Private Sub AddEvent(e As ESLevent)</p><p class="MsoNormal">        Dim dd = TextCollection(e.Serialize(&quot;&quot;), &quot;: &quot;, vbLf)</p>
<p class="MsoNormal">        Dim eventname = dd(&quot;event-name&quot;)</p><p class="MsoNormal">        &#39;Dim uid = dd(&quot;Unique-ID&quot;)</p><p class="MsoNormal">        Dim uid = dd(&quot;Channel-Call-UUID&quot;)</p>
<p class="MsoNormal">        If dd(&quot;Caller-Network-Addr&quot;) &lt;&gt; &quot;&quot; Then</p><p class="MsoNormal">            Dim dcx = DBEntities()</p><p class="MsoNormal">            Dim ses = dcx.Sessions.SingleOrDefault(Function(x) x.ServerCode = uid)</p>
<p class="MsoNormal">            Dim ChannelState = dd(&quot;Channel-State&quot;)</p><p class="MsoNormal">            Dim ChannelCallState = dd(&quot;Channel-Call-State&quot;).ToLower</p><p class="MsoNormal">            Select Case eventname</p>
<p class="MsoNormal">                Case &quot;CHANNEL_STATE&quot;</p><p class="MsoNormal">                    If ses Is Nothing Then</p><p class="MsoNormal">                        ses = New Session</p><p class="MsoNormal">
                        dcx.Sessions.AddObject(ses)</p><p class="MsoNormal">                    End If</p><p class="MsoNormal">                    ses.CallerHost = dd(&quot;Caller-Network-Addr&quot;)</p><p class="MsoNormal">
                    ses.CallerName = UrlDecoded(dd(&quot;Caller-Caller-ID-Name&quot;))</p><p class="MsoNormal">                    ses.CallerPhone = dd(&quot;Caller-Caller-ID-Number&quot;)</p><p class="MsoNormal">                    ses.CallerUser = dd(&quot;Caller-Username&quot;)</p>
<p class="MsoNormal">                    ses.CalleeUser = dd(&quot;Caller-Destination-Number&quot;)</p><p class="MsoNormal">                    ses.ServerCode = uid</p><p class="MsoNormal">                    If {&quot;cs_destroy&quot;, &quot;cs_hangup&quot;}.Contains(ChannelState) Then ses.HungUpOn = Now</p>
<p class="MsoNormal">                Case &quot;CHANNEL_CALLSTATE&quot;</p><p class="MsoNormal">                    If ChannelCallState = &quot;ringing&quot; Then</p><p class="MsoNormal">                        Dim evn = FreeSwitch.Execute(&quot;answer&quot;, String.Empty, uid)</p>
<p class="MsoNormal">                        Dim res = evn.Serialize(&quot;&quot;)</p><p class="MsoNormal">                    End If</p><p class="MsoNormal">                Case &quot;CHANNEL_DESTROY&quot;</p><p class="MsoNormal">
                    If ses IsNot Nothing Then ses.HungUpOn = Now</p><p class="MsoNormal">            End Select</p><p class="MsoNormal">            dcx.SaveChanges()</p><p class="MsoNormal">        End If</p><p class="MsoNormal">
    End Sub</p><p class="MsoNormal"> </p><p class="MsoNormal">the answer line is getting reached, and the result is &quot;+OK&quot; but the phone still keeps ringing</p><p class="MsoNormal">please note that I’m unsure which is the correct uuid, but trying both of them gave me identical results</p>
<p class="MsoNormal"> </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.</p>
<p class="MsoNormal">It picks up, and immediately hangs up because it has finished the whole dialplan</p><p class="MsoNormal"> </p><p class="MsoNormal">I’d appreciate your help. I’m pretty new to freeswitch and esl</p><p class="MsoNormal">
 </p><p class="MsoNormal">Please advise</p><p class="MsoNormal"> </p><p class="MsoNormal"><i><span style="color:#0f243e">Sincerely,</span></i></p><p class="MsoNormal"><i><span style="color:#0f243e">ymo</span></i><b><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"></span></b></p>
<p class="MsoNormal"><span style="font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"> </span></p><p class="MsoNormal"><span lang="HE" dir="RTL" style="font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"> </span></p>
<p class="MsoNormal"> </p><p class="MsoNormal"> </p></div></div></blockquote><blockquote type="cite"><div><span>_________________________________________________________________________</span><br><span>Professional FreeSWITCH Consulting Services:</span><br>
<span><a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a></span><br><span><a href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a></span><br><span></span><br><span>FreeSWITCH-powered IP PBX: The CudaTel Communication Server</span><br>
<span><a href="http://www.cudatel.com">http://www.cudatel.com</a></span><br><span></span><br><span>Official FreeSWITCH Sites</span><br><span><a href="http://www.freeswitch.org">http://www.freeswitch.org</a></span><br><span><a href="http://wiki.freeswitch.org">http://wiki.freeswitch.org</a></span><br>
<span><a href="http://www.cluecon.com">http://www.cluecon.com</a></span><br><span></span><br><span>FreeSWITCH-users mailing list</span><br><span><a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a></span><br>
<span><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a></span><br><span>UNSUBSCRIBE:http://<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">lists.freeswitch.org/mailman/options/freeswitch-users</a></span><br>
<span><a href="http://www.freeswitch.org">http://www.freeswitch.org</a></span><br></div></blockquote></body></html>