Exemplo n.º 1
0
bool SetParamSession::OnMessageReceive(mrcp_channel_t* pMrcpChannel, mrcp_message_t* pMrcpMessage)
{
    if(!UmcSession::OnMessageReceive(pMrcpChannel,pMrcpMessage))
        return false;

    if(pMrcpMessage->start_line.message_type == MRCP_MESSAGE_TYPE_RESPONSE)
    {
        /* received MRCP response */
        if(pMrcpMessage->start_line.method_id == RECOGNIZER_SET_PARAMS || pMrcpMessage->start_line.method_id == RECOGNIZER_GET_PARAMS)
        {
            /* received the response */
            if(pMrcpMessage->start_line.request_state == MRCP_REQUEST_STATE_COMPLETE)
            {
                m_CurrentRequest++;
                ProcessNextRequest(pMrcpChannel);
            }
            else
            {
                /* received unexpected response, terminate the session */
                Terminate();
            }
        }
        else
        {
            /* received unexpected response */
            Terminate();
        }
    }
    return true;
}
Exemplo n.º 2
0
void CAsyncRequestQueue::OnProcessQueue(wxCommandEvent &event)
{
	ProcessNextRequest();

	if (!m_requestList.empty())
	{
		wxCommandEvent evt(fzEVT_PROCESSASYNCREQUESTQUEUE);
		wxPostEvent(this, evt);
	}
}
Exemplo n.º 3
0
void CAsyncRequestQueue::OnProcessQueue(wxCommandEvent &)
{
	if (m_inside_request)
		return;

	m_inside_request = true;
	bool success = ProcessNextRequest();
	m_inside_request = false;

	if (success && !m_requestList.empty()) {
		QueueEvent(new wxCommandEvent(fzEVT_PROCESSASYNCREQUESTQUEUE));
	}
}
Exemplo n.º 4
0
bool SetParamSession::OnChannelAdd(mrcp_channel_t* pMrcpChannel, mrcp_sig_status_code_e status)
{
    if(!UmcSession::OnChannelAdd(pMrcpChannel,status))
        return false;

    if(status != MRCP_SIG_STATUS_CODE_SUCCESS)
    {
        /* error case, just terminate the demo */
        return Terminate();
    }

    if(!CreateRequestQueue(pMrcpChannel))
    {
        return Terminate();
    }

    return ProcessNextRequest(pMrcpChannel);
}