<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><div id="yiv1121826549"><table id="yiv1121826549bodyDrftID" class="yiv1121826549" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td id="yiv1121826549drftMsgContent" style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit; -x-system-font: none;">It has not made a difference when I used the <a rel="nofollow" target="_blank" href="http://wiki.freeswitch.org/wiki/Channel_Variables#playback_terminators">playback_terminators</a> .<br><br>My problem happens when the code gets to the while loop, this is past the playback command.<br><br>As can been seen from the debug log the code does go into the while loop and waits for events it catches all events apart from dtmf. It seems the detection of dtmf events is not happening after the
 playback command<br><br><br><br>[DEBUG] src/esl.c:1042 esl_recv_event() RECV MESSAGE<br>Event-Name: SOCKET_DATA<br>Content-Length: 5015<br>Content-Type: text/event-plain<br><br>got event<br>test event<br>wait for event<br><br><br>The full test script: <br><br><br>require 'rubygems'<br>require "ESL"<br>require 'socket'<br>include
 Socket::Constants<br><br>#Log<br>ESL::eslSetLogLevel(7)<br><br><br><br>@ring_ring = "tone_stream://%(400,200,400,450);%(400,2200,400,450);loops=2"<br><br><br><br><br>&nbsp;&nbsp;&nbsp; def pick_up_call<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; @con.execute("answer")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; @con.setEventLock("true")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; @con.execute("sleep", "1000")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; @con.execute("playback", @ring_ring)<br>&nbsp;&nbsp;&nbsp; end<br><br><br><br><br>bind_address = "127.0.0.1"<br>bind_port = 8084<br><br>socket = Socket.new(AF_INET, SOCK_STREAM, 0)<br>sockaddr = Socket.sockaddr_in(bind_port, bind_address)<br>socket.bind(sockaddr)<br>socket.listen(5)<br><br>puts "Listening for connections on #{bind_address}:#{bind_port}"<br>loop do<br>&nbsp; client_socket, client_sockaddr = socket.accept<br>&nbsp; pid = fork do<br>&nbsp;&nbsp;&nbsp; @con =
 ESL::ESLconnection.new(client_socket.fileno)<br>&nbsp;&nbsp;&nbsp; info = @con.getInfo<br>&nbsp;&nbsp;&nbsp; @uuid = info.getHeader("UNIQUE-ID")<br>&nbsp;&nbsp;&nbsp; @con.sendRecv("myevents")<br>&nbsp;&nbsp;&nbsp; @con.sendRecv("divert_events on")<br><br>&nbsp;&nbsp;&nbsp; pick_up_call<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while @con.connected<br>puts "wait for event"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; e = @con.recvEvent<br>puts "got event"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (!e.nil?)<br>puts "test event"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; name = e.getHeader("Event-Name")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break if name == "SERVER_DISCONNECTED"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if name == "DTMF"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; digit = e.getHeader("DTMF-DIGIT")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; duration = e.getHeader("DTMF-DURATION")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; puts "*** dtmf #{digit} #{duration}"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; <br><br>&nbsp;&nbsp;&nbsp; puts "Connection closed"<br>&nbsp; end<br><br>&nbsp; Process.detach(pid)<br>end<br><br><br><br>--- On <b>Thu, 2/9/10, Michael Collins
 <i>&lt;msc@freeswitch.org&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Michael Collins &lt;msc@freeswitch.org&gt;<br>Subject: Re: [Freeswitch-users] Problems getting dtmf events - code and debug now attached<br>To: "FreeSWITCH Users Help" &lt;freeswitch-users@lists.freeswitch.org&gt;<br>Date: Thursday, 2 September, 2010, 18:54<br><br><div id="yiv1121826549yiv1334973621">Did you do this?<br><a rel="nofollow" target="_blank" href="http://wiki.freeswitch.org/wiki/Channel_Variables#playback_terminators">http://wiki.freeswitch.org/wiki/Channel_Variables#playback_terminators</a><br>-MC<br><br><div class="yiv1121826549yiv1334973621gmail_quote">On Thu, Sep 2, 2010 at 6:26 AM, Nigel Kent <span dir="ltr">&lt;<a rel="nofollow">ktngl@yahoo.co.uk</a>&gt;</span> wrote:<br>
<blockquote class="yiv1121826549yiv1334973621gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">
code below and debug log now attached. It seems once playback file is played no further dtmf events come through? Any ideas!<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while @con.connected<br>puts "wait for event"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; e = @con.recvEvent<br>
puts "got event"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (!e.nil?)<br>puts "test event"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; name = e.getHeader("Event-Name")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break if name == "SERVER_DISCONNECTED"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if name == "DTMF"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; digit = e.getHeader("DTMF-DIGIT")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; duration = e.getHeader("DTMF-DURATION")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; puts "*** dtmf #{digit} #{duration}"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end<br><br><br><br>--- On <b>Wed, 1/9/10, Nigel Kent <i>&lt;<a rel="nofollow">ktngl@yahoo.co.uk</a>&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">
<br>From: Nigel Kent &lt;<a rel="nofollow">ktngl@yahoo.co.uk</a>&gt;<br>Subject: [Freeswitch-users] Problems getting dtmf events<br>To:
 <a rel="nofollow">freeswitch-users@lists.freeswitch.org</a><br>Date: Wednesday, 1 September, 2010, 21:15<br><br><div><table border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">I am trying to catch dtmf events but am having problems. It seems no dtmfs are being recieved. I can filter to other events and it gets picked up so this section of the code is doing the indented action of getting events. <br>
<br>However I notice that during the execution of the playback command while the sound file is playing if a key press is done at this time the dtmf does get received.<br><br>So my thought are what conditions does the playback command set in order to be able to have dtmf get recognized.<br>
<br><br><br></td></tr></tbody></table><br>



      </div><br>-----Inline Attachment Follows-----<br><br><div>_______________________________________________<br>FreeSWITCH-users mailing list<br><a rel="nofollow" target="_blank" href="http://mc/compose?to=FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a rel="nofollow" target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br></div></blockquote></td></tr></tbody></table><br>



      <br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a rel="nofollow">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a rel="nofollow" target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>
</div><br>-----Inline Attachment Follows-----<br><br><div class="yiv1121826549plainMail">_______________________________________________<br>FreeSWITCH-users mailing list<br><a rel="nofollow">FreeSWITCH-users@lists.freeswitch.org</a><br><a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a rel="nofollow" target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br></div></blockquote></td></tr></tbody></table></div></td></tr></table><br>