Example #1
0
apt_bool_t UmcProcessMsg(apt_task_t *pTask, apt_task_msg_t *pMsg)
{
	if(pMsg->type != TASK_MSG_USER)
		return FALSE;

	apt_consumer_task_t* pConsumerTask = (apt_consumer_task_t*) apt_task_object_get(pTask);
	UmcFramework* pFramework = (UmcFramework*) apt_consumer_task_object_get(pConsumerTask);
	UmcTaskMsg* pUmcMsg = (UmcTaskMsg*) pMsg->data;
	switch(pMsg->sub_type) 
	{
		case UMC_TASK_CLIENT_MSG:
		{
			static const mrcp_app_message_dispatcher_t applicationDispatcher = 
			{
				AppOnSessionUpdate,
				AppOnSessionTerminate,
				AppOnChannelAdd,
				AppOnChannelRemove,
				AppOnMessageReceive,
				AppOnTerminateEvent,
				AppOnResourceDiscover
			};

			mrcp_application_message_dispatch(&applicationDispatcher,pUmcMsg->m_pAppMessage);
			break;
		}
		case UMC_TASK_RUN_SESSION_MSG:
		{
			pFramework->ProcessRunRequest(pUmcMsg->m_ScenarioName,pUmcMsg->m_ProfileName);
			break;
		}
		case UMC_TASK_STOP_SESSION_MSG:
		{
			pFramework->ProcessStopRequest(pUmcMsg->m_SessionId);
			break;
		}
		case UMC_TASK_KILL_SESSION_MSG:
		{
			pFramework->ProcessKillRequest(pUmcMsg->m_SessionId);
			break;
		}
		case UMC_TASK_SHOW_SCENARIOS_MSG:
		{
			pFramework->ProcessShowScenarios();
			break;
		}
		case UMC_TASK_SHOW_SESSIONS_MSG:
		{
			pFramework->ProcessShowSessions();
			break;
		}
		case UMC_TASK_EXIT_SESSION_MSG:
		{
			pFramework->ProcessSessionExit(pUmcMsg->m_pSession);
			break;
		}
	}
	return TRUE;
}
/* Process UniMRCP messages for the synthesizer application.  All MRCP synthesizer callbacks start here first. */
static apt_bool_t synth_message_handler(const mrcp_app_message_t *app_message)
{
	/* Call the appropriate callback in the dispatcher function table based on the app_message received. */
	if (app_message)
		return mrcp_application_message_dispatch(&mrcpsynth->dispatcher, app_message);

	ast_log(LOG_ERROR, "(unknown) app_message error!\n");
	return TRUE;
}
Example #3
0
static apt_bool_t UniSynthAppMsgHandler(mrcp_app_message_t const* msg)
{
	static const mrcp_app_message_dispatcher_t appDisp =
	{
		NULL,  // Update
		OnSessionTerminate,
		OnChannelAdd,
		NULL,  /* OnChannelRemove */
		OnMessageReceive,
		OnTerminateEvent,
		NULL   /* Resource discover */
	};
	return mrcp_application_message_dispatch(&appDisp, msg);
}
/** Handle the messages sent from the MRCP client stack */
static apt_bool_t synth_application_handler(demo_application_t *application, const mrcp_app_message_t *app_message)
{
	/* app_message should be dispatched now,
	*  the default dispatcher is used in demo. */
	return mrcp_application_message_dispatch(&synth_application_dispatcher,app_message);
}
Example #5
0
/** \brief UniMRCP message handler */
static apt_bool_t uni_message_handler(const mrcp_app_message_t *app_message)
{
	ast_log(LOG_DEBUG, "Received message from client stack\n");
	return mrcp_application_message_dispatch(&uni_dispatcher,app_message);
}
/** \brief UniMRCP message handler */
static apt_bool_t uni_message_handler(const mrcp_app_message_t *app_message)
{
	return mrcp_application_message_dispatch(&uni_dispatcher,app_message);
}