[Freeswitch-svn] [commit] r6078 - freeswitch/trunk/src/mod/endpoints/mod_opal
Freeswitch SVN
lzwierko at freeswitch.org
Sun Oct 28 17:55:21 EDT 2007
Author: lzwierko
Date: Sun Oct 28 17:55:20 2007
New Revision: 6078
Modified:
freeswitch/trunk/src/mod/endpoints/mod_opal/opalh323_backend.cpp
freeswitch/trunk/src/mod/endpoints/mod_opal/opalh323_backend.h
Log:
still lots of compile errors, but I got to get some sleep ;)
Modified: freeswitch/trunk/src/mod/endpoints/mod_opal/opalh323_backend.cpp
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_opal/opalh323_backend.cpp (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_opal/opalh323_backend.cpp Sun Oct 28 17:55:20 2007
@@ -29,7 +29,6 @@
#include <switch.h>
#include "opalh323_backend.h"
-#include <include/h323/h323ep.h>
/**
* Private structre
@@ -52,7 +51,7 @@
assert(0);
return false;
}
- if(SWITCH_STATUS_SUCCESS != switch_mutex_init(&tech_pvt->m_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(i_session))
+ if(SWITCH_STATUS_SUCCESS != switch_mutex_init(&(*o_private)->m_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(i_session)))
{
assert(0);
return false;
@@ -64,7 +63,7 @@
static bool OpalH323Private_Delete(OpalH323Private_t *o_private)
{
- switch_mutex_destroy(tech_pvt->m_mutex);
+ switch_mutex_destroy(o_private->m_mutex);
}
/** Default constructor
@@ -84,7 +83,7 @@
/** Destructor
*
*/
-~FSOpalManager::FSOpalManager()
+FSOpalManager::~FSOpalManager()
{
/**
* Destroy all allocated resources, if any
@@ -93,28 +92,24 @@
{
delete m_pH323Endpoint;
switch_mutex_destroy(m_pSessionsHashTableMutex);
- switch_core_hash_destroy(m_pSessionsHashTable);
+ switch_core_hash_destroy(&m_pSessionsHashTable);
}
}
/**
* Method does real initialization of the manager
- */
+ */
bool FSOpalManager::initialize(
- char *i_modName,
- switch_memory_pool_t *i_memoryPool,
- switch_endpoint_interface_t *i_endpointInterface
- )
+ const char* i_modName,
+ switch_memory_pool_t* i_memoryPool,
+ switch_endpoint_interface_t *i_endpointInterface
+ )
{
bool result = true;
- /* check if everything is not initialized */
+ /* check if not initialized */
assert(m_isInitialized);
- assert(!m_pH323Endpoint);
- assert(!m_pMemoryPool)
- assert(!m_pEndpointInterface);
- assert(!m_pSessionsHashTable);
/* check input parameters */
assert(i_modName);
@@ -138,19 +133,19 @@
return false;
}
- if(switch_mutex_init(&m_pSessionsHashTableMutex,SWITCH_THREAD_MUTEX_UNNESTED,m_pMemoryPool)!=SWITCH_STATUS_SUCCESS)
+ if(switch_mutex_init(&m_pSessionsHashTableMutex,SWITCH_MUTEX_UNNESTED,m_pMemoryPool)!=SWITCH_STATUS_SUCCESS)
{
assert(0);
- switch_core_hash_destroy(m_pSessionsHashTable);
+ switch_core_hash_destroy(&m_pSessionsHashTable);
return false;
}
/* create h323 endpoint */
- m_pH323Endpoint = new H323EndPoint(this); ///TODO, replace prefix and signaling port by values from configuration
+ m_pH323Endpoint = new H323EndPoint( *(static_cast<OpalManager*>(this)) ); ///TODO, replace prefix and signaling port by values from configuration
if(!m_pH323Endpoint)
{
assert(0);
- switch_core_hash_destroy(m_pSessionsHashTable);
+ switch_core_hash_destroy(&m_pSessionsHashTable);
switch_mutex_destroy(m_pSessionsHashTableMutex);
return false;
}
@@ -172,9 +167,9 @@
if(!m_pH323Endpoint->StartListeners(opalTransportAddress))
{
assert(0);
- swith_core_hash_destroy(m_pSessionsHashTable);
+ switch_core_hash_destroy(&m_pSessionsHashTable);
switch_mutex_destroy(m_pSessionsHashTableMutex);
- delete m_pH323Endpoint:
+ delete m_pH323Endpoint;
return false;
}
@@ -189,21 +184,21 @@
{
assert(m_pSessionsHashTable);
assert(m_pSessionsHashTableMutex);
- return static_cast<switch_core_session_t*>(switch_core_hash_find_locked(m_pSessionsHashTable,*i_token,m_pSessionsHashTableMutex));
+ return static_cast<switch_core_session_t*>(switch_core_hash_find_locked(m_pSessionsHashTable,(const char*)i_token,m_pSessionsHashTableMutex));
}
void FSOpalManager::saveSessionToken(PString &i_token,switch_core_session_t* i_session)
{
assert(m_pSessionsHashTable);
assert(m_pSessionsHashTableMutex);
- switch_core_hash_insert_locked(m_pSessionsHashTable,*i_token,i_session,m_pSessionsHashTableMutex);
+ switch_core_hash_insert_locked(m_pSessionsHashTable,(const char*)i_token,i_session,m_pSessionsHashTableMutex);
}
void FSOpalManager::deleteToken(PString &i_token)
{
assert(m_pSessionsHashTable);
assert(m_pSessionsHashTableMutex);
- switch_core_hash_delete_locked(m_pSessionsHashTable,*i_token,m_pSessionsHashTableMutex);
+ switch_core_hash_delete_locked(m_pSessionsHashTable,(const char*)i_token,m_pSessionsHashTableMutex);
}
@@ -521,4 +516,4 @@
{
assert(m_isInitialized);
return SWITCH_STATUS_SUCCESS;
-}
\ No newline at end of file
+}
Modified: freeswitch/trunk/src/mod/endpoints/mod_opal/opalh323_backend.h
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_opal/opalh323_backend.h (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_opal/opalh323_backend.h Sun Oct 28 17:55:20 2007
@@ -31,6 +31,8 @@
#define __FREESWITCH_OPALH323_BACKEND__
#include <switch.h>
+#include <ptlib.h>
+#include <opal/buildopts.h>
#include <opal/manager.h>
#include <h323/h323ep.h>
@@ -100,13 +102,13 @@
void deleteToken(PString &i_token);
- char *m_pModuleName; /* name of this module */
- bool m_isInitilized; /* true if module has been initialized properly */
- H323EndPoint *m_pH323Endpoint; /* h323 endpoint control */
- switch_memory_pool_t *m_pMemoryPool; /* FS memory pool */
- switch_endpoint_interface_t *m_pEndpointInterface; /* FS endpoint inerface */
- switch_hash_t *m_pSessionsHashTable; /* Stores pointrs to session object for each Opal connection */
- switch_mutex_t *m_pSessionsHashTableMutex; /* Protects hash table */
+ const char *m_pModuleName; /* name of this module */
+ bool m_isInitialized; /* true if module has been initialized properly */
+ H323EndPoint *m_pH323Endpoint; /* h323 endpoint control */
+ switch_memory_pool_t *m_pMemoryPool; /* FS memory pool */
+ switch_endpoint_interface_t *m_pEndpointInterface; /* FS endpoint inerface */
+ switch_hash_t *m_pSessionsHashTable; /* Stores pointrs to session object for each Opal connection */
+ switch_mutex_t *m_pSessionsHashTableMutex; /* Protects hash table */
};
More information about the Freeswitch-svn
mailing list