diff options
author | David M. Lee <dlee@digium.com> | 2013-07-05 22:08:27 +0000 |
---|---|---|
committer | David M. Lee <dlee@digium.com> | 2013-07-05 22:08:27 +0000 |
commit | c54b26a18ced70ee31e27b4f545d2d5289d73043 (patch) | |
tree | 33843fb56c77a57a802118d09ebb806b1335a866 /res | |
parent | cc3478d2e83f8d9ee52d88aecda3693ee463ea96 (diff) |
ARI: return a 503 if Asterisk isn't fully booted
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r-- | res/res_stasis_http.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/res/res_stasis_http.c b/res/res_stasis_http.c index 4b2e1ccd7..e30dc7100 100644 --- a/res/res_stasis_http.c +++ b/res/res_stasis_http.c @@ -851,6 +851,11 @@ static int stasis_http_callback(struct ast_tcptls_session_instance *ser, conf->general->auth_realm); response.message = ast_json_pack("{s: s}", "error", "Authentication required"); + } else if (!ast_fully_booted) { + response.response_code = 503; + response.response_text = "Service Unavailable"; + response.message = ast_json_pack("{s: s}", + "error", "Asterisk not booted"); } else if (user->read_only && method != AST_HTTP_GET && method != AST_HTTP_OPTIONS) { response.message = ast_json_pack("{s: s}", "error", "Write access denied"); |