mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
HTTP: Stop accepting requests on final system shutdown.
There are three CLI commands to stop and restart Asterisk each. 1) core stop/restart now - Hangup all calls and stop or restart Asterisk. New channels are prevented while the shutdown request is pending. 2) core stop/restart gracefully - Stop or restart Asterisk when there are no calls remaining in the system. New channels are prevented while the shutdown request is pending. 3) core stop/restart when convenient - Stop or restart Asterisk when there are no calls in the system. New calls are not prevented while the shutdown request is pending. ARI has made stopping/restarting Asterisk more problematic. While a shutdown request is pending it is desirable to continue to process ARI HTTP requests for current calls. To handle the current calls while a shutdown request is pending, a new committed to shutdown phase is needed so ARI applications can deal with the calls until the system is fully committed to shutdown. * Added a new shutdown committed phase so ARI applications can deal with calls until the final committed to shutdown phase is reached. * Made refuse new HTTP requests when the system has reached the final system shutdown phase. Starting anything while the system is actively releasing resources and unloading modules is not a good thing. * Split the bridging framework shutdown to not cleanup the global bridging containers when shutting down in a hurry. This is similar to how other modules prevent crashes on rapid system shutdown. * Moved ast_begin_shutdown(), ast_cancel_shutdown(), and ast_shutting_down(). You should not have to include channel.h just to access these system functions. ASTERISK-24752 #close Reported by: Matthew Jordan Review: https://reviewboard.asterisk.org/r/4399/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@431692 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1509,6 +1509,14 @@ const struct ast_channel_tech *ast_get_channel_tech(const char *name);
|
||||
*/
|
||||
void ast_hangup(struct ast_channel *chan);
|
||||
|
||||
/*!
|
||||
* \brief Soft hangup all active channels.
|
||||
* \since 13.3.0
|
||||
*
|
||||
* \return Nothing
|
||||
*/
|
||||
void ast_softhangup_all(void);
|
||||
|
||||
/*!
|
||||
* \brief Softly hangup up a channel
|
||||
*
|
||||
@@ -2202,23 +2210,12 @@ int ast_channel_defer_dtmf(struct ast_channel *chan);
|
||||
/*! Undo defer. ast_read will return any DTMF characters that were queued */
|
||||
void ast_channel_undefer_dtmf(struct ast_channel *chan);
|
||||
|
||||
/*! Initiate system shutdown -- prevents new channels from being allocated.
|
||||
* \param hangup If "hangup" is non-zero, all existing channels will receive soft
|
||||
* hangups */
|
||||
void ast_begin_shutdown(int hangup);
|
||||
|
||||
/*! Cancels an existing shutdown and returns to normal operation */
|
||||
void ast_cancel_shutdown(void);
|
||||
|
||||
/*! \return number of channels available for lookup */
|
||||
int ast_active_channels(void);
|
||||
|
||||
/*! \return the number of channels not yet destroyed */
|
||||
int ast_undestroyed_channels(void);
|
||||
|
||||
/*! \return non-zero if Asterisk is being shut down */
|
||||
int ast_shutting_down(void);
|
||||
|
||||
/*! Activate a given generator */
|
||||
int ast_activate_generator(struct ast_channel *chan, struct ast_generator *gen, void *params);
|
||||
|
||||
|
Reference in New Issue
Block a user