Summary:ASTERISK-21208: 'sip set options {on|off}' command to explicitly enable 200 OK responses to OPTIONS
Reporter:Ashley Winters (awinters)Labels:
Date Opened:2013-03-05 12:48:44.000-0600Date Closed:2013-04-09 18:08:15
Versions:11.2.1 Frequency of
Environment:CentOS 6.3 x86_64Attachments:( 0) sip_set_options-11.patch
( 1) sip_set_options-trunk.patch
Description:I want asterisk to be able to inform a call distribution proxy which is performing OPTIONS pings that it doesn't want to receive any calls -- without setting the ast_shutting_down() flag. The ast_shutting_down() flag causes channel creation to fail in ast_channel_alloc(), but I want calls in-progress to be able to proceed with their IVR dialplans which often result in an outbound Dial.

'core stop gracefully' is actually not sufficiently "graceful" since it blocks new outbound calls, and 'core stop when convenient' makes asterisk continue to respond to OPTIONS with 200 OK.
Comments:By: Ashley Winters (awinters) 2013-03-05 12:53:26.862-0600

I'm currently using the attached 'sip set options \{on|off\}' command to explicitly enable 200 OK responses to OPTIONS. Defaults to on.

By: Rusty Newton (rnewton) 2013-03-08 09:50:05.082-0600

New features need to include a patch for trunk. Can you test your patch on trunk?

By: Ashley Winters (awinters) 2013-03-11 13:58:24.932-0500

Updated the patch against trunk.

By: Walter Doekes (wdoekes) 2013-03-11 14:46:55.273-0500

While I could see a use for this. I'd think that altering your [default] context would be a decent workaround.

If user-part exists in [default] you return 200. If you want to shutdown, remove that user-part exten from [default] and you start returning 404. I'd expect your distribution proxy to be configurable so it can differentiate between 200 as good and 404 as bad (*).

Removing an exten can be done using CLI commands as well AFAIK. (Replace [default] with a specific context in case your matched peer has a different context.)

The problems I have with patch are:
- the naming: you're not disabling/enabling options, you're altering the response code, but only in a limited manner (*)
- "optionsenable = TRUE;" is initialized between debug-related vars
- there is no way to set it other than through a CLI command (and it gets reset on sip reload)

My suggestion would be to either (a) use the workaround or (b) suggest your problem on the developers mailing list and explain why you chose this solution.


(*) Do you perhaps want a 503 instead of a 404 on SIP_GET_DEST_EXTEN_NOT_FOUND?

By: Rusty Newton (rnewton) 2013-03-25 19:59:30.480-0500

Per Walter's comments this really should be discussed on the [mailing list|http://lists.digium.com/mailman/listinfo/asterisk-dev] before it moves any further. I'm going to leave this in feedback for a couple weeks. If you get a consensus on the mailing list please let us know on the JIRA issue.

By: Rusty Newton (rnewton) 2013-04-09 18:08:04.431-0500

Suspended due to lack of activity. Please request a bug marshal in #asterisk-bugs on the IRC network irc.freenode.net to reopen the issue should you have the additional information requested.  Further information can be found at http://www.asterisk.org/developers/bug-guidelines

I'm going to suspend this until there is a consensus on the asterisk-dev list that the development community would want this feature in Asterisk. You can always ping me directly on irc.freenode.net "newtonr" or preferably in the #asterisk-bugs or #asterisk-dev chatroom.