mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 05:02:10 +00:00
[core] Add SHUTDOWN_REQUESTED event. Bind to this event to know when ASAP or elegant shutdown has been requested.
This commit is contained in:
committed by
Andrey Volk
parent
9248aa05ec
commit
562079376a
+5
-1
@@ -2809,7 +2809,11 @@ SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, void *
|
||||
{
|
||||
int x = 19;
|
||||
uint32_t count;
|
||||
|
||||
switch_event_t *shutdown_requested_event = NULL;
|
||||
if (switch_event_create(&shutdown_requested_event, SWITCH_EVENT_SHUTDOWN_REQUESTED) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(shutdown_requested_event, SWITCH_STACK_BOTTOM, "Event-Info", "%s", cmd == SCSC_SHUTDOWN_ASAP ? "ASAP" : "elegant");
|
||||
switch_event_fire(&shutdown_requested_event);
|
||||
}
|
||||
switch_set_flag((&runtime), SCF_SHUTDOWN_REQUESTED);
|
||||
if (cmd == SCSC_SHUTDOWN_ASAP) {
|
||||
switch_set_flag((&runtime), SCF_NO_NEW_SESSIONS);
|
||||
|
||||
Reference in New Issue
Block a user