static apt_bool_t mrcp_client_on_termination_subtract(mrcp_client_session_t *session, const mpf_message_t *mpf_message) { rtp_termination_slot_t *termination_slot; if(!session) { return FALSE; } apt_obj_log(APT_LOG_MARK,APT_PRIO_DEBUG,session->base.log_obj,"Media Termination Subtracted "APT_NAMESIDRES_FMT, MRCP_SESSION_NAMESID(session), mpf_termination_name_get(mpf_message->termination)); termination_slot = mrcp_client_rtp_termination_find(session,mpf_message->termination); if(termination_slot) { /* rtp termination */ if(termination_slot->waiting == FALSE) { return FALSE; } termination_slot->waiting = FALSE; if(mrcp_client_session_subrequest_remove(session) == TRUE) { mrcp_app_session_terminate_raise(session,MRCP_SIG_STATUS_CODE_SUCCESS); } } else { /* channel termination */ mrcp_channel_t *channel = mrcp_client_channel_termination_find(session,mpf_message->termination); if(channel && channel->waiting_for_termination == TRUE) { channel->waiting_for_termination = FALSE; if(mrcp_client_session_subrequest_remove(session) == TRUE) { /* raise app response */ mrcp_app_sig_response_raise(session,TRUE); } } } return TRUE; }
static apt_bool_t mrcp_client_on_termination_subtract(mrcp_client_session_t *session, const mpf_message_t *mpf_message) { rtp_termination_slot_t *termination_slot; if(!session) { return FALSE; } termination_slot = mrcp_client_rtp_termination_find(session,mpf_message->termination); if(termination_slot) { /* rtp termination */ if(termination_slot->waiting == FALSE) { return FALSE; } termination_slot->waiting = FALSE; if(mrcp_client_session_subrequest_remove(session) == TRUE) { mrcp_app_session_terminate_raise(session,MRCP_SIG_STATUS_CODE_SUCCESS); } } else { /* channel termination */ mrcp_channel_t *channel = mrcp_client_channel_termination_find(session,mpf_message->termination); if(channel && channel->waiting_for_termination == TRUE) { channel->waiting_for_termination = FALSE; if(mrcp_client_session_subrequest_remove(session) == TRUE) { /* raise app response */ mrcp_app_sig_response_raise(session,TRUE); } } } return TRUE; }
apt_bool_t mrcp_client_session_terminate_response_process(mrcp_client_session_t *session) { apt_obj_log(APT_LOG_MARK,APT_PRIO_INFO,session->base.log_obj,"Session Terminated "APT_NAMESID_FMT, MRCP_SESSION_NAMESID(session)); if(mrcp_client_session_subrequest_remove(session) == TRUE) { mrcp_app_session_terminate_raise(session,MRCP_SIG_STATUS_CODE_SUCCESS); } return TRUE; }
apt_bool_t mrcp_client_session_terminate_response_process(mrcp_client_session_t *session) { apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Receive Terminate Response "APT_PTRSID_FMT, MRCP_SESSION_PTRSID(&session->base)); if(mrcp_client_session_subrequest_remove(session) == TRUE) { mrcp_app_session_terminate_raise(session,MRCP_SIG_STATUS_CODE_SUCCESS); } return TRUE; }
apt_bool_t mrcp_client_session_terminate_response_process(mrcp_client_session_t *session) { apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Receive Terminate Response <%s>", mrcp_session_str(session)); if(session->terminate_flag_count) { session->terminate_flag_count--; } if(!session->terminate_flag_count) { mrcp_app_session_terminate_raise(session,MRCP_SIG_STATUS_CODE_SUCCESS); } return TRUE; }
apt_bool_t mrcp_client_on_channel_remove(mrcp_channel_t *channel, apt_bool_t status) { mrcp_client_session_t *session = (mrcp_client_session_t*)channel->session; apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"On Control Channel Remove "APT_PTRSID_FMT, MRCP_SESSION_PTRSID(&session->base)); if(!channel->waiting_for_channel) { return FALSE; } channel->waiting_for_channel = FALSE; if(mrcp_client_session_subrequest_remove(session) == TRUE) { mrcp_app_session_terminate_raise( session, status == TRUE ? MRCP_SIG_STATUS_CODE_SUCCESS : MRCP_SIG_STATUS_CODE_FAILURE); } return TRUE; }
apt_bool_t mrcp_client_on_channel_remove(mrcp_channel_t *channel) { mrcp_client_session_t *session = (mrcp_client_session_t*)channel->session; apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"On Control Channel Remove"); if(!channel->waiting_for_channel) { return FALSE; } channel->waiting_for_channel = FALSE; if(session->terminate_flag_count) { session->terminate_flag_count--; if(!session->terminate_flag_count) { mrcp_app_session_terminate_raise(session,MRCP_SIG_STATUS_CODE_SUCCESS); } } return TRUE; }
apt_bool_t mrcp_client_on_channel_remove(mrcp_channel_t *channel, apt_bool_t status) { mrcp_client_session_t *session = (mrcp_client_session_t*)channel->session; apt_obj_log(APT_LOG_MARK,APT_PRIO_DEBUG,session->base.log_obj,"Control Channel Removed "APT_NAMESIDRES_FMT, MRCP_SESSION_NAMESID(session), channel->resource->name.buf); if(!channel->waiting_for_channel) { return FALSE; } channel->waiting_for_channel = FALSE; if(mrcp_client_session_subrequest_remove(session) == TRUE) { mrcp_app_session_terminate_raise( session, status == TRUE ? MRCP_SIG_STATUS_CODE_SUCCESS : MRCP_SIG_STATUS_CODE_FAILURE); } return TRUE; }