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 8def066077
commit 80e5a7cf0a
2 changed files with 20 additions and 0 deletions

View File

@ -955,6 +955,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

@ -3144,6 +3144,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)
@ -3183,6 +3193,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;
}
@ -3319,6 +3331,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;
}
@ -3598,6 +3612,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;
}