Best way to handle request to 'reset_uri'

5 views
Skip to first unread message

Jose Gavine Cueto

unread,
Apr 14, 2015, 2:33:10 AM4/14/15
to liverpie...@googlegroups.com
Hi, I understand that the GET request to reset_uri , and that is to notify a state machine reset (unless I'm wrong).

However, my webapp did not handle this in my first pass of coding (still evaluating) and everything just worked fine.  When I tried to refactor it by letting it to consume the events as 
logical as possible, my webapp seemed to miss the first CHANNEL_DATA event which contained the information for the call state = RINGING.

I noticed that at the first call, a CHANNEL_DATA was received by liverpie but it wasn't sent to my webapp, instead a reset notification was sent.  At this state, my webapp does not know
what state to go since the said event was missed.

What is the best way to handle the reset requests especially when a call is made ?  Do I need to handle the reset request first ?  If yes, how do I query for the call state so my webapp 
can proceed to a correct state ?

Cheers


alexand...@gmail.com

unread,
Apr 14, 2015, 2:55:57 AM4/14/15
to liverpie...@googlegroups.com
Hi,

The reset_uri is being called the very first time data is received from Freeswitch, after the connection has been initialized with the @initial_commands (currently just 'myevents').

It's odd that you get the CHANNEL_DATA instead of the result to "myevents". Perhaps make sure that line 10 in lib/liverpie_server.rb still says "myevents"?

Your reset requests should simply set everything as they should be at the start of the IVR flow. As your webapp's response to the reset method is currently being ignored, there's no way to query the call state at that point, I'm afraid.

Did you try to run your state machine from a browser, or some other HTTP client? Normally, if you call reset first, then call the state method a few times, you should see it perform as expected. I remember I was about to write a small utility that simulated Freeswitch (giving you a menu to simulate some common FS events) but that was six years ago, and... well, I didn't. :)

Jose Gavine Cueto

unread,
Apr 14, 2015, 3:10:52 AM4/14/15
to liverpie...@googlegroups.com
Hi Alex, thanks for the reply.  Yes, I've consistently seen in the liverpie logs that CHANNEL_DATA was sent first and then the reset GET request.  If the webapp handles the reset GET request, how does it answer the call if it does not know the call state, for example if the call is already ringing.

Cheers

alexand...@gmail.com

unread,
Apr 14, 2015, 3:13:46 AM4/14/15
to liverpie...@googlegroups.com
Hey,

You don't need to answer the call. Freeswitch will answer the call (based on the FS app rules) and reset your state machine, right away.
Reply all
Reply to author
Forward
0 new messages