diff options
author | Russell Bryant <russell@russellbryant.com> | 2007-10-17 18:01:38 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2007-10-17 18:01:38 +0000 |
commit | ba2768f4df14a498d5218a6863d86eef780eab06 (patch) | |
tree | 52f83bde4a3a9e9670987811884598cb02bcd9e8 /channels | |
parent | 6b9841b141ce4b33099e59ea17a4d56c0a9f2cab (diff) |
Merged revisions 86149 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r86149 | russell | 2007-10-17 12:57:45 -0500 (Wed, 17 Oct 2007) | 8 lines
If Asterisk is in the middle of shutting down, respond to OPTIONS
with 503 Unavailable.
(closes issue #10994)
Reported by: eserra
Patches:
sip-options-503.patch uploaded by eserra (license 45)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86150 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 837b12d9b..a31f5c590 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -14429,13 +14429,19 @@ static int handle_request_options(struct sip_pvt *p, struct sip_request *req) res = get_destination(p, req); build_contact(p); + /* XXX Should we authenticate OPTIONS? XXX */ + if (ast_strlen_zero(p->context)) ast_string_field_set(p, context, default_context); - if (res < 0) + + if (ast_shutting_down()) + transmit_response_with_allow(p, "503 Unavailable", req, 0); + else if (res < 0) transmit_response_with_allow(p, "404 Not Found", req, 0); else transmit_response_with_allow(p, "200 OK", req, 0); + /* Destroy if this OPTIONS was the opening request, but not if it's in the middle of a normal call flow. */ if (!p->lastinvite) |