コード例 #1
0
ファイル: umcframework.cpp プロジェクト: Jared-Prime/UniMRCP
void UmcFramework::ProcessShowSessions()
{
	UmcSession* pSession;
	void* pVal;
	printf("%d Session(s)\n", apr_hash_count(m_pSessionTable));
	apr_hash_index_t* it = apr_hash_first(m_pPool,m_pSessionTable);
	for(; it; it = apr_hash_next(it)) 
	{
		apr_hash_this(it,NULL,NULL,&pVal);
		pSession = (UmcSession*) pVal;
		if(pSession)
		{
			printf("[%s] - %s\n", pSession->GetId(), pSession->GetScenario()->GetName());
		}
	}
}
コード例 #2
0
ファイル: umcframework.cpp プロジェクト: Jared-Prime/UniMRCP
void UmcFramework::ProcessKillRequest(const char* id)
{
	UmcSession* pSession;
	void* pVal;
	apr_hash_index_t* it = apr_hash_first(m_pPool,m_pSessionTable);
	for(; it; it = apr_hash_next(it)) 
	{
		apr_hash_this(it,NULL,NULL,&pVal);
		pSession = (UmcSession*) pVal;
		if(pSession && strcasecmp(pSession->GetId(),id) == 0)
		{
			/* first, terminate session */
			pSession->Terminate();
			return;
		}
	}
}
コード例 #3
0
ファイル: umcframework.cpp プロジェクト: calejost/unimrcp
void UmcFramework::ProcessStopRequest(const char* id)
{
	UmcSession* pSession;
	void* pVal;
	apr_hash_index_t* it = apr_hash_first(m_pPool,m_pSessionTable);
	for(; it; it = apr_hash_next(it)) 
	{
		apr_hash_this(it,NULL,NULL,&pVal);
		pSession = (UmcSession*) pVal;
		if(pSession && strcasecmp(pSession->GetId(),id) == 0)
		{
			/* stop in-progress request */
			pSession->Stop();
			return;
		}
	}
}
コード例 #4
0
ファイル: umcframework.cpp プロジェクト: Jared-Prime/UniMRCP
bool UmcFramework::ProcessRunRequest(const char* pScenarioName, const char* pProfileName)
{
	UmcScenario* pScenario = (UmcScenario*) apr_hash_get(m_pScenarioTable,pScenarioName,APR_HASH_KEY_STRING);
	if(!pScenario)
		return false;

	UmcSession* pSession = pScenario->CreateSession();
	if(!pSession)
		return false;

	printf("[%s]\n",pSession->GetId());
	pSession->SetMrcpProfile(pProfileName);
	pSession->SetMrcpApplication(m_pMrcpApplication);
	if(!pSession->Run())
	{
		delete pSession;
		return false;
	}

	AddSession(pSession);
	return true;
}