提交 480ef2a9 authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-5778 --resolve use switch_core_event_hook_remove_receive_message() to bind to…

FS-5778 --resolve use switch_core_event_hook_remove_receive_message() to bind to receive_message and case for new SWITCH_MESSAGE_ANSWER_EVENT, SWITCH_MESSAGE_PROGRESS_EVENT, SWITCH_MESSAGE_RING_EVENT
上级 ab63580e
...@@ -945,6 +945,9 @@ typedef enum { ...@@ -945,6 +945,9 @@ typedef enum {
SWITCH_MESSAGE_INDICATE_BLIND_TRANSFER_RESPONSE, SWITCH_MESSAGE_INDICATE_BLIND_TRANSFER_RESPONSE,
SWITCH_MESSAGE_INDICATE_STUN_ERROR, SWITCH_MESSAGE_INDICATE_STUN_ERROR,
SWITCH_MESSAGE_INDICATE_MEDIA_RENEG, SWITCH_MESSAGE_INDICATE_MEDIA_RENEG,
SWITCH_MESSAGE_ANSWER_EVENT,
SWITCH_MESSAGE_PROGRESS_EVENT,
SWITCH_MESSAGE_RING_EVENT,
SWITCH_MESSAGE_INVALID SWITCH_MESSAGE_INVALID
} switch_core_session_message_types_t; } switch_core_session_message_types_t;
......
...@@ -3139,6 +3139,16 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_chan ...@@ -3139,6 +3139,16 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_chan
return channel->state; return channel->state;
} }
static switch_status_t send_ind(switch_channel_t *channel, switch_core_session_message_types_t msg_id, const char *file, const char *func, int line)
{
switch_core_session_message_t msg = { 0 };
msg.message_id = msg_id;
msg.from = channel->name;
return switch_core_session_perform_receive_message(channel->session, &msg, file, func, line);
}
SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_ring_ready_value(switch_channel_t *channel, SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_ring_ready_value(switch_channel_t *channel,
switch_ring_ready_t rv, switch_ring_ready_t rv,
const char *file, const char *func, int line) const char *file, const char *func, int line)
...@@ -3178,6 +3188,8 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_ring_ready_value(swi ...@@ -3178,6 +3188,8 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_ring_ready_value(swi
switch_channel_set_callstate(channel, CCS_RINGING); switch_channel_set_callstate(channel, CCS_RINGING);
send_ind(channel, SWITCH_MESSAGE_RING_EVENT, file, func, line);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
...@@ -3302,6 +3314,8 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_pre_answered(switch_ ...@@ -3302,6 +3314,8 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_pre_answered(switch_
switch_channel_set_callstate(channel, CCS_EARLY); switch_channel_set_callstate(channel, CCS_EARLY);
send_ind(channel, SWITCH_MESSAGE_PROGRESS_EVENT, file, func, line);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
...@@ -3579,6 +3593,9 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_chan ...@@ -3579,6 +3593,9 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_chan
switch_channel_set_callstate(channel, CCS_ACTIVE); switch_channel_set_callstate(channel, CCS_ACTIVE);
send_ind(channel, SWITCH_MESSAGE_ANSWER_EVENT, file, func, line);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论