<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 "Yisroel M. Olewski" <<a href="mailto:yisroel@machshevet.com">yisroel@machshevet.com</a>>:<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 "pick up the phone"</p><p class="MsoNormal">my first goal is to pick up the phone and read out some text via tts<span style="font-family:"Arial","sans-serif""></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:"Times New Roman","serif""></span></p><p class="MsoNormal">here’s my code<span lang="HE" dir="RTL" style="font-family:"Times New Roman","serif""></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("10.0.0.1", 8021, "mypass")</p><p class="MsoNormal"> Dim eslEvent = FreeSwitch.SendRecv("event plain ALL")</p>
<p class="MsoNormal"> FreeSwitch.SendRecv("event plain DTMF")</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(""), ": ", vbLf)</p>
<p class="MsoNormal"> Dim eventname = dd("event-name")</p><p class="MsoNormal"> 'Dim uid = dd("Unique-ID")</p><p class="MsoNormal"> Dim uid = dd("Channel-Call-UUID")</p>
<p class="MsoNormal"> If dd("Caller-Network-Addr") <> "" 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("Channel-State")</p><p class="MsoNormal"> Dim ChannelCallState = dd("Channel-Call-State").ToLower</p><p class="MsoNormal"> Select Case eventname</p>
<p class="MsoNormal"> Case "CHANNEL_STATE"</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("Caller-Network-Addr")</p><p class="MsoNormal">
ses.CallerName = UrlDecoded(dd("Caller-Caller-ID-Name"))</p><p class="MsoNormal"> ses.CallerPhone = dd("Caller-Caller-ID-Number")</p><p class="MsoNormal"> ses.CallerUser = dd("Caller-Username")</p>
<p class="MsoNormal"> ses.CalleeUser = dd("Caller-Destination-Number")</p><p class="MsoNormal"> ses.ServerCode = uid</p><p class="MsoNormal"> If {"cs_destroy", "cs_hangup"}.Contains(ChannelState) Then ses.HungUpOn = Now</p>
<p class="MsoNormal"> Case "CHANNEL_CALLSTATE"</p><p class="MsoNormal"> If ChannelCallState = "ringing" Then</p><p class="MsoNormal"> Dim evn = FreeSwitch.Execute("answer", String.Empty, uid)</p>
<p class="MsoNormal"> Dim res = evn.Serialize("")</p><p class="MsoNormal"> End If</p><p class="MsoNormal"> Case "CHANNEL_DESTROY"</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 "+OK" 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:"Arial","sans-serif";color:#1f497d"></span></b></p>
<p class="MsoNormal"><span style="font-family:"Times New Roman","serif""> </span></p><p class="MsoNormal"><span lang="HE" dir="RTL" style="font-family:"Times New Roman","serif""> </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>