mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-24 20:24:16 +00:00
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6228 d0543943-73ff-0310-b7d9-9358b9ac24b2
64 lines
1.5 KiB
C++
64 lines
1.5 KiB
C++
|
|
#include "fsmanager.h"
|
|
|
|
FSManager::FSManager()
|
|
:SessionsHashTable(NULL), SessionsHashTableMutex(NULL),
|
|
h323ep(NULL), fsep(NULL)
|
|
{
|
|
|
|
}
|
|
|
|
FSManager::~FSManager()
|
|
{
|
|
switch_mutex_destroy(SessionsHashTableMutex);
|
|
switch_core_hash_destroy(&SessionsHashTable);
|
|
}
|
|
|
|
BOOL FSManager::Initialize(switch_memory_pool_t* MemoryPool)
|
|
{
|
|
silenceDetectParams.m_mode = OpalSilenceDetector::NoSilenceDetection;
|
|
SetAudioJitterDelay(800, 3000);
|
|
|
|
if(switch_core_hash_init(&SessionsHashTable,MemoryPool)!=SWITCH_STATUS_SUCCESS)
|
|
{
|
|
assert(0);
|
|
return FALSE;
|
|
}
|
|
|
|
if(switch_mutex_init(&SessionsHashTableMutex,SWITCH_MUTEX_UNNESTED,MemoryPool)!=SWITCH_STATUS_SUCCESS)
|
|
{
|
|
assert(0);
|
|
switch_core_hash_destroy(&SessionsHashTable);
|
|
return FALSE;
|
|
}
|
|
|
|
sipep = new FSSIPEndPoint( *(static_cast<OpalManager*>(this)));
|
|
h323ep = new FSH323EndPoint( *(static_cast<OpalManager*>(this)));
|
|
fsep = new FSEndPoint( *(static_cast<OpalManager*>(this)));
|
|
|
|
PIPSocket::Address addr("10.0.0.1");
|
|
|
|
OpalTransportAddress sipTransportAddress(addr,5060, "udp");
|
|
OpalTransportAddress h323TransportAddress(addr,1726);
|
|
|
|
|
|
fsep->SetRTPAddress(addr);
|
|
|
|
if(!sipep->StartListeners(sipTransportAddress)){
|
|
delete sipep;
|
|
return FALSE;
|
|
}
|
|
|
|
if(!h323ep->StartListeners(h323TransportAddress)){
|
|
delete h323ep;
|
|
delete sipep;
|
|
return FALSE;
|
|
}
|
|
//SetSTUNServer("stun.voxgratia.org");
|
|
PStringArray routes;
|
|
routes += "h323:.* = fs:<da>";
|
|
SetRouteTable(routes);
|
|
|
|
return TRUE;
|
|
}
|