This commit is contained in:
wmasilva 2025-01-17 16:41:08 +00:00 committed by GitHub
commit cf419eec10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 1 deletions

View File

@ -155,6 +155,8 @@ SWITCH_BEGIN_EXTERN_C
#define SWITCH_CHANNEL_EXECUTE_ON_ORIGINATE_VARIABLE "execute_on_originate"
#define SWITCH_CHANNEL_EXECUTE_ON_POST_ORIGINATE_VARIABLE "execute_on_post_originate"
#define SWITCH_CHANNEL_EXECUTE_ON_PRE_ORIGINATE_VARIABLE "execute_on_pre_originate"
#define SWITCH_CHANNEL_EXECUTE_ON_HOLD_VARIABLE "execute_on_hold"
#define SWITCH_CHANNEL_EXECUTE_ON_UNHOLD_VARIABLE "execute_on_unhold"
#define SWITCH_CHANNEL_EXECUTE_ON_PRE_BRIDGE_VARIABLE "execute_on_pre_bridge"
#define SWITCH_CHANNEL_EXECUTE_ON_POST_BRIDGE_VARIABLE "execute_on_post_bridge"
@ -167,6 +169,8 @@ SWITCH_BEGIN_EXTERN_C
#define SWITCH_CHANNEL_API_ON_ORIGINATE_VARIABLE "api_on_originate"
#define SWITCH_CHANNEL_API_ON_POST_ORIGINATE_VARIABLE "api_on_post_originate"
#define SWITCH_CHANNEL_API_ON_PRE_ORIGINATE_VARIABLE "api_on_pre_originate"
#define SWITCH_CHANNEL_API_ON_HOLD_VARIABLE "api_on_hold"
#define SWITCH_CHANNEL_API_ON_UNHOLD_VARIABLE "api_on_unhold"
#define SWITCH_CALL_TIMEOUT_VARIABLE "call_timeout"
#define SWITCH_HOLDING_UUID_VARIABLE "holding_uuid"

View File

@ -868,8 +868,12 @@ SWITCH_DECLARE(void) switch_channel_mark_hold(switch_channel_t *channel, switch_
if (on) {
switch_channel_set_flag(channel, CF_LEG_HOLDING);
switch_channel_execute_on(channel, SWITCH_CHANNEL_EXECUTE_ON_HOLD_VARIABLE);
switch_channel_api_on(channel, SWITCH_CHANNEL_API_ON_HOLD_VARIABLE);
} else {
switch_channel_clear_flag(channel, CF_LEG_HOLDING);
switch_channel_execute_on(channel, SWITCH_CHANNEL_EXECUTE_ON_UNHOLD_VARIABLE);
switch_channel_api_on(channel, SWITCH_CHANNEL_API_ON_UNHOLD_VARIABLE);
}
if (switch_event_create(&event, on ? SWITCH_EVENT_CHANNEL_HOLD : SWITCH_EVENT_CHANNEL_UNHOLD) == SWITCH_STATUS_SUCCESS) {

View File

@ -1555,12 +1555,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_hold(switch_core_session_t *session,
}
}
switch_channel_execute_on(channel, SWITCH_CHANNEL_EXECUTE_ON_HOLD_VARIABLE);
switch_channel_api_on(channel, SWITCH_CHANNEL_API_ON_HOLD_VARIABLE);
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_HOLD) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(channel, event);
switch_event_fire(&event);
}
return SWITCH_STATUS_SUCCESS;
}
@ -1634,6 +1636,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_unhold(switch_core_session_t *session
switch_core_session_rwunlock(b_session);
}
switch_channel_execute_on(channel, SWITCH_CHANNEL_EXECUTE_ON_UNHOLD_VARIABLE);
switch_channel_api_on(channel, SWITCH_CHANNEL_API_ON_UNHOLD_VARIABLE);
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_UNHOLD) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(channel, event);