Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a park timeout #49

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Add a park timeout #49

wants to merge 5 commits into from

Conversation

goodboy
Copy link
Member

@goodboy goodboy commented Nov 30, 2017

This is to address concerns that @k4ml had in #47.

I've added the use of the park_timeout channel variable to our CI dialplan as well as a test to verify that it works as intended and rejects unhanded sessions after 3 seconds. There is an additional test case which verifies that if a session which is parked (with a timeout) is moved out of the CHANNEL_PARK state the timeout is not carried into the downstream app.

@@ -4,6 +4,7 @@
<!-- Park call and transfer control to esl -->
<extension name="switchiopark">
<condition field="destination_number" expression="^(.*)$">
<action application="set" data="park_timeout=3:DESTINATION_OUT_OF_ORDER"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The NETWORK_OUT_OF_ORDER cause seems more appropriate (is not a particular upstream destination number/uri that is out of order). As an add-on benefit that cause code also returns a SIP 503 which could be complemented by a 'Retry-After' header (setting variable sip_rh_Retry-After [0]) suggesting to retry after X number of secs to throttle down requests if possible and desired.

[0] https://wiki.freeswitch.org/wiki/Sofia-SIP#Adding_Response_Headers

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be aware this timeout might have unintended side effects. See my comments on issue #47.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@moises-silva nice! I'll change it.

@goodboy goodboy mentioned this pull request Dec 2, 2017
@goodboy goodboy mentioned this pull request Dec 3, 2017
@goodboy goodboy force-pushed the park_timeout branch 3 times, most recently from 719d910 to b5f9820 Compare December 6, 2017 17:45
@goodboy
Copy link
Member Author

goodboy commented Dec 12, 2017

Just as a note for anyone who's following this and #47 - I've spoken to core FS and they'll consider a PR for a park_activity_timeout which would be a timeout that's reset each time the park app loop is re-entered after each app invocation. This would serve as a type of idle timeout where if no app are activated in time the channel will be destroyed.

I just need to find the time to write up the patch.

Tyler Goodlet added 5 commits December 12, 2017 17:38
This is a safeguard in case the ESL connection drops while inbound calls
are being received but no longer processed by switchio.

Resolves #47
Verify that when a session is parked but not handled within the timeout
period (in this case 3 seconds as set in our CI dialplan) it is cancelled
by FS. In the contrary case verify that a simple `session.answer()` within
the timeout results in a successful SIPp `uac` client scenario.

Resolves #47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants