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
This commit is contained in:
parent
cc3478d2e8
commit
c54b26a18c
|
@ -851,6 +851,11 @@ static int stasis_http_callback(struct ast_tcptls_session_instance *ser,
|
||||||
conf->general->auth_realm);
|
conf->general->auth_realm);
|
||||||
response.message = ast_json_pack("{s: s}",
|
response.message = ast_json_pack("{s: s}",
|
||||||
"error", "Authentication required");
|
"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) {
|
} else if (user->read_only && method != AST_HTTP_GET && method != AST_HTTP_OPTIONS) {
|
||||||
response.message = ast_json_pack("{s: s}",
|
response.message = ast_json_pack("{s: s}",
|
||||||
"error", "Write access denied");
|
"error", "Write access denied");
|
||||||
|
|
Loading…
Reference in New Issue