<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I have this code below in which I want to receive and extract dtmf events.<br>It seems all previous events are queued and received together at this point as the while loop is run. I don't know why it does this I only need the current events to be received.<br><br>Another issue happening at this point when I press any digit 0-9 on the phone it is not getting an incoming dtmf events<br><br><br><br>while @con.connected<br> #debug <br> puts "start loop" <br> <br> #no digits<br> if dtmfbuffer.length == 0<br> e = @con.recvEventTimed(response_timeout)<br> # there are digits<br> elsif dtmfbuffer.length > 0<br> e =
@con.recvEventTimed(interdigit_timeout)<br> end<br><br><br> if e<br> name = e.getHeader("Event-Name")<br> puts "#{name}"<br> break if name == "SERVER_DISCONNECTED"<br> if name == "DTMF"<br> digit = e.getHeader("DTMF-Digit")<br> duration = e.getHeader("DTMF-Duration") <br> dtmfbuffer << digit<br> puts "*** Dtmf #{digit} dur:#{duration} from #{@cli}"<br> end<br> end<br><br> if dtmfbuffer.length > 9<br>
break<br> end<br> #debug<br> puts "end loop"<br>end<br></td></tr></table><br>