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

This commit is contained in:
Anthony Minessale 2013-09-11 22:58:00 +05:00
parent ab63580e2d
commit 480ef2a92d
2 changed files with 20 additions and 0 deletions

View File

@ -945,6 +945,9 @@ typedef enum {
SWITCH_MESSAGE_INDICATE_BLIND_TRANSFER_RESPONSE,
SWITCH_MESSAGE_INDICATE_STUN_ERROR,
SWITCH_MESSAGE_INDICATE_MEDIA_RENEG,
SWITCH_MESSAGE_ANSWER_EVENT,
SWITCH_MESSAGE_PROGRESS_EVENT,
SWITCH_MESSAGE_RING_EVENT,
SWITCH_MESSAGE_INVALID
} switch_core_session_message_types_t;

View File

@ -3139,6 +3139,16 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_chan
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_ring_ready_t rv,
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
switch_channel_set_callstate(channel, CCS_RINGING);
send_ind(channel, SWITCH_MESSAGE_RING_EVENT, file, func, line);
return SWITCH_STATUS_SUCCESS;
}
@ -3302,6 +3314,8 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_pre_answered(switch_
switch_channel_set_callstate(channel, CCS_EARLY);
send_ind(channel, SWITCH_MESSAGE_PROGRESS_EVENT, file, func, line);
return SWITCH_STATUS_SUCCESS;
}
@ -3579,6 +3593,9 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_chan
switch_channel_set_callstate(channel, CCS_ACTIVE);
send_ind(channel, SWITCH_MESSAGE_ANSWER_EVENT, file, func, line);
return SWITCH_STATUS_SUCCESS;
}