<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> def pick_up_call<br> @con.execute("answer")<br> @con.setEventLock("true")<br> @con.execute("sleep", "1000")<br> @con.execute("playback", @ring_ring)<br> 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> client_socket, client_sockaddr = socket.accept<br> pid = fork do<br> @con =
ESL::ESLconnection.new(client_socket.fileno)<br> info = @con.getInfo<br> @uuid = info.getHeader("UNIQUE-ID")<br> @con.sendRecv("myevents")<br> @con.sendRecv("divert_events on")<br><br> pick_up_call<br> <br> while @con.connected<br>puts "wait for event"<br> e = @con.recvEvent<br>puts "got event"<br> if (!e.nil?)<br>puts "test event"<br> name = e.getHeader("Event-Name")<br> break if name == "SERVER_DISCONNECTED"<br>
if name == "DTMF"<br> digit = e.getHeader("DTMF-DIGIT")<br> duration = e.getHeader("DTMF-DURATION")<br> puts "*** dtmf #{digit} #{duration}"<br> end<br> end<br> end<br> <br><br> puts "Connection closed"<br> end<br><br> Process.detach(pid)<br>end<br><br><br><br>--- On <b>Thu, 2/9/10, Michael Collins
<i><msc@freeswitch.org></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Michael Collins <msc@freeswitch.org><br>Subject: Re: [Freeswitch-users] Problems getting dtmf events - code and debug now attached<br>To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org><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"><<a rel="nofollow">ktngl@yahoo.co.uk</a>></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> while @con.connected<br>puts "wait for event"<br> e = @con.recvEvent<br>
puts "got event"<br> if (!e.nil?)<br>puts "test event"<br> name = e.getHeader("Event-Name")<br> break if name == "SERVER_DISCONNECTED"<br>
if name == "DTMF"<br>
digit = e.getHeader("DTMF-DIGIT")<br> duration = e.getHeader("DTMF-DURATION")<br> puts "*** dtmf #{digit} #{duration}"<br> end<br>
end<br> end<br><br><br><br>--- On <b>Wed, 1/9/10, Nigel Kent <i><<a rel="nofollow">ktngl@yahoo.co.uk</a>></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">
<br>From: Nigel Kent <<a rel="nofollow">ktngl@yahoo.co.uk</a>><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>