diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk.h | 36 | ||||
-rw-r--r-- | include/asterisk/channel.h | 19 |
2 files changed, 44 insertions, 11 deletions
diff --git a/include/asterisk.h b/include/asterisk.h index ee1a9c337..edb100b6b 100644 --- a/include/asterisk.h +++ b/include/asterisk.h @@ -111,6 +111,42 @@ int ast_register_cleanup(void (*func)(void)); */ void ast_unregister_atexit(void (*func)(void)); +/*! + * \brief Cancel an existing shutdown and return to normal operation. + * + * \note Shutdown can be cancelled while the server is waiting for + * any existing channels to be destroyed before shutdown becomes + * irreversible. + * + * \return non-zero if shutdown cancelled. + */ +int ast_cancel_shutdown(void); + +/*! + * \details + * The server is preventing new channel creation in preparation for + * shutdown and may actively be releasing resources. The shutdown + * process may be canceled by ast_cancel_shutdown() if it is not too + * late. + * + * \note The preparation to shutdown phase can be quite lengthy + * if we are gracefully shutting down. How long existing calls will + * last is not up to us. + * + * \return non-zero if the server is preparing to or actively shutting down. + */ +int ast_shutting_down(void); + +/*! + * \return non-zero if the server is actively shutting down. + * \since 13.3.0 + * + * \details + * The server is releasing resources and unloading modules. + * It won't be long now. + */ +int ast_shutdown_final(void); + #if !defined(LOW_MEMORY) /*! * \brief Register the version of a source code file with the core. diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 48645c9bb..33735ef20 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -1510,6 +1510,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 * * \param chan channel to be soft-hung-up @@ -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); |