git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6104 d0543943-73ff-0310-b7d9-9358b9ac24b2

This commit is contained in:
Łukasz Zwierko 2007-10-31 19:57:31 +00:00
parent 21c10158d1
commit edf08043ff
4 changed files with 33 additions and 28 deletions

View File

@ -1,8 +1,8 @@
/* /*
* mod_opalh323.cpp * mod_opalh323.cpp
* *
* Opal-H323 gluer for Freeswitch * Opal gluer for Freeswitch
* This file implements fontend of OpalH323 module functions * This file implements fontend of Opal module functions
* that is all functions that are used for communication * that is all functions that are used for communication
* between FreeSWITCH core and this module * between FreeSWITCH core and this module
* *
@ -24,7 +24,7 @@
* *
* Contributor(s): * Contributor(s):
* *
* $Log: mod_opalh323.cpp,v $ * $Log: mod_opal.cpp,v $
* *
* Revision 1.00 2007/10/24 07:29:52 lzwierko * Revision 1.00 2007/10/24 07:29:52 lzwierko
* Initial revision * Initial revision
@ -111,6 +111,7 @@ SWITCH_MODULE_DEFINITION(mod_opal, mod_opal_load, mod_opal_shutdown, NULL);
SWITCH_MODULE_LOAD_FUNCTION(mod_opal_load) SWITCH_MODULE_LOAD_FUNCTION(mod_opal_load)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE,"Starting loading mod_opal\n");
/* frontend initialization*/ /* frontend initialization*/
*module_interface =NULL; *module_interface =NULL;
*module_interface = switch_loadable_module_create_module_interface(pool, modname); *module_interface = switch_loadable_module_create_module_interface(pool, modname);
@ -118,6 +119,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_opal_load)
assert(*module_interface); assert(*module_interface);
if(!module_interface) if(!module_interface)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE,"Can not create loadable module interfacer\n");
return SWITCH_STATUS_MEMERR; return SWITCH_STATUS_MEMERR;
} }
opalh323_endpoint_interface = (switch_endpoint_interface_t*)switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE); opalh323_endpoint_interface = (switch_endpoint_interface_t*)switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
@ -130,16 +132,19 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_opal_load)
assert(opal_manager); assert(opal_manager);
if(!opal_manager) if(!opal_manager)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE,"Can not create opal manger\n");
return SWITCH_STATUS_MEMERR; return SWITCH_STATUS_MEMERR;
} }
if(!opal_manager->initialize(modname,pool,opalh323_endpoint_interface)) if(!opal_manager->initialize(modname,pool,opalh323_endpoint_interface))
{ {
delete opal_manager; delete opal_manager;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE,"Can not initialize opal manger\n");
return SWITCH_STATUS_FALSE; /* if can't initialize return general error */ return SWITCH_STATUS_FALSE; /* if can't initialize return general error */
} }
/* indicate that the module should continue to be loaded */ /* indicate that the module should continue to be loaded */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE,"mod_opal loaded ok!\n");
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
@ -149,7 +154,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_opal_load)
* it dealocates OPAL core * it dealocates OPAL core
* *
*/ */
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_opalh323_shutdown) SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_opal_shutdown)
{ {
/* deallocate OPAL manager */ /* deallocate OPAL manager */
delete opal_manager; delete opal_manager;

View File

@ -1,7 +1,7 @@
/* /*
* mod_opalh323.h * mod_opalh323.h
* *
* Opal-H323 gluer for Freeswitch header file * Opal gluer for Freeswitch header file
* *
* Copyright (c) 2007 Lukasz Zwierko (lzwierko@gmail.com) * Copyright (c) 2007 Lukasz Zwierko (lzwierko@gmail.com)
* *
@ -20,7 +20,7 @@
* *
* Contributor(s): ______________________________________. * Contributor(s): ______________________________________.
* *
* $Log: mod_opalh323.cpp,v $ * $Log: mod_opal.cpp,v $
* *
* Revision 1.00 2007/10/24 07:29:52 lzwierko * Revision 1.00 2007/10/24 07:29:52 lzwierko
* Initial revision * Initial revision

View File

@ -1,7 +1,7 @@
/* /*
* opalh323_backend.cpp * opalh323_backend.cpp
* *
* Backend for OpalH323 module, implements * Backend for Opal module, implements
* H323 handling via OPAL library * H323 handling via OPAL library
* *
* Copyright (c) 2007 Lukasz Zwierko (lzwierko@gmail.com) * Copyright (c) 2007 Lukasz Zwierko (lzwierko@gmail.com)
@ -21,7 +21,7 @@
* *
* Contributor(s): * Contributor(s):
* *
* $Log: opalh323_backend.cpp,v $ * $Log: opal_backend.cpp,v $
* *
* Revision 1.00 2007/10/24 07:29:52 lzwierko * Revision 1.00 2007/10/24 07:29:52 lzwierko
* Initial revision * Initial revision
@ -229,7 +229,7 @@ BOOL FSOpalManager::OnIncomingConnection(
if(!session) if(!session)
{ {
///TODO add cause to the connection ///TODO add cause to the connection
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Could not allocate session object?\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Could not allocate session object?\n");
return FALSE; return FALSE;
} }
@ -239,7 +239,7 @@ BOOL FSOpalManager::OnIncomingConnection(
{ {
///TODO add cause to the connection ///TODO add cause to the connection
switch_core_session_destroy(&session); switch_core_session_destroy(&session);
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Could not allocate private object?\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Could not allocate private object?\n");
return false; return false;
} }
tech_pvt->m_opalConnection = &connection; tech_pvt->m_opalConnection = &connection;
@ -299,7 +299,7 @@ BOOL FSOpalManager::OnIncomingConnection(
/** lunch thread */ /** lunch thread */
if (switch_core_session_thread_launch(session) != SWITCH_STATUS_SUCCESS) if (switch_core_session_thread_launch(session) != SWITCH_STATUS_SUCCESS)
{ {
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Error spawning thread\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Error spawning thread\n");
deleteSessionToken(connection.GetToken()); deleteSessionToken(connection.GetToken());
switch_mutex_unlock(tech_pvt->m_mutex); switch_mutex_unlock(tech_pvt->m_mutex);
OpalH323Private_Delete(tech_pvt); OpalH323Private_Delete(tech_pvt);
@ -436,55 +436,55 @@ switch_status_t FSOpalManager::io_receive_message(switch_core_session_t *i_sessi
switch(i_message->message_id) switch(i_message->message_id)
{ {
case SWITCH_MESSAGE_REDIRECT_AUDIO: case SWITCH_MESSAGE_REDIRECT_AUDIO:
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG "SWITCH_MESSAGE_REDIRECT_AUDIO\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG ,"SWITCH_MESSAGE_REDIRECT_AUDIO\n");
break; break;
case SWITCH_MESSAGE_TRANSMIT_TEXT: case SWITCH_MESSAGE_TRANSMIT_TEXT:
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG "SWITCH_MESSAGE_TRANSMIT_TEXT\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"SWITCH_MESSAGE_TRANSMIT_TEXT\n");
break; break;
case SWITCH_MESSAGE_INDICATE_ANSWER: case SWITCH_MESSAGE_INDICATE_ANSWER:
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG "SWITCH_MESSAGE_INDICATE_ANSWER\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"SWITCH_MESSAGE_INDICATE_ANSWER\n");
/* set call answer */ /* set call answer */
//tech_prv->m_opalConnection->AnsweringCall(AnswerCallNow); //tech_prv->m_opalConnection->AnsweringCall(AnswerCallNow);
break; break;
case SWITCH_MESSAGE_INDICATE_PROGRESS: case SWITCH_MESSAGE_INDICATE_PROGRESS:
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG "SWITCH_MESSAGE_INDICATE_PROGRESS\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"SWITCH_MESSAGE_INDICATE_PROGRESS\n");
break; break;
case SWITCH_MESSAGE_INDICATE_BRIDGE: case SWITCH_MESSAGE_INDICATE_BRIDGE:
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG "SWITCH_MESSAGE_INDICATE_BRIDGE\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"SWITCH_MESSAGE_INDICATE_BRIDGE\n");
break; break;
case SWITCH_MESSAGE_INDICATE_UNBRIDGE: case SWITCH_MESSAGE_INDICATE_UNBRIDGE:
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG "SWITCH_MESSAGE_INDICATE_UNBRIDGE\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"SWITCH_MESSAGE_INDICATE_UNBRIDGE\n");
break; break;
case SWITCH_MESSAGE_INDICATE_TRANSFER: case SWITCH_MESSAGE_INDICATE_TRANSFER:
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG "SWITCH_MESSAGE_INDICATE_TRANSFER\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"SWITCH_MESSAGE_INDICATE_TRANSFER\n");
break; break;
case SWITCH_MESSAGE_INDICATE_RINGING: case SWITCH_MESSAGE_INDICATE_RINGING:
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG "SWITCH_MESSAGE_INDICATE_RINGING\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"SWITCH_MESSAGE_INDICATE_RINGING\n");
break; break;
case SWITCH_MESSAGE_INDICATE_MEDIA: case SWITCH_MESSAGE_INDICATE_MEDIA:
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG "SWITCH_MESSAGE_INDICATE_MEDIA\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"SWITCH_MESSAGE_INDICATE_MEDIA\n");
break; break;
case SWITCH_MESSAGE_INDICATE_NOMEDIA: case SWITCH_MESSAGE_INDICATE_NOMEDIA:
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG "SWITCH_MESSAGE_INDICATE_NOMEDIA\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"SWITCH_MESSAGE_INDICATE_NOMEDIA\n");
break; break;
case SWITCH_MESSAGE_INDICATE_HOLD: case SWITCH_MESSAGE_INDICATE_HOLD:
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG "SWITCH_MESSAGE_INDICATE_HOLD\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"SWITCH_MESSAGE_INDICATE_HOLD\n");
break; break;
case SWITCH_MESSAGE_INDICATE_UNHOLD: case SWITCH_MESSAGE_INDICATE_UNHOLD:
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG "SWITCH_MESSAGE_INDICATE_UNHOLD\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"SWITCH_MESSAGE_INDICATE_UNHOLD\n");
break; break;
case SWITCH_MESSAGE_INDICATE_REDIRECT: case SWITCH_MESSAGE_INDICATE_REDIRECT:
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG "SWITCH_MESSAGE_INDICATE_REDIRECT\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"SWITCH_MESSAGE_INDICATE_REDIRECT\n");
break; break;
case SWITCH_MESSAGE_INDICATE_REJECT: case SWITCH_MESSAGE_INDICATE_REJECT:
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG "SWITCH_MESSAGE_INDICATE_REJECT\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"SWITCH_MESSAGE_INDICATE_REJECT\n");
break; break;
case SWITCH_MESSAGE_INDICATE_BROADCAST: case SWITCH_MESSAGE_INDICATE_BROADCAST:
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG "SWITCH_MESSAGE_INDICATE_BROADCAST\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"SWITCH_MESSAGE_INDICATE_BROADCAST\n");
break; break;
case SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT: case SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT:
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG "SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT\n");
break; break;
} }

View File

@ -21,7 +21,7 @@
* *
* Contributor(s): * Contributor(s):
* *
* $Log: opalh323_backend.cpp,v $ * $Log: opal_backend.cpp,v $
* *
* Revision 1.00 2007/10/24 07:29:52 lzwierko * Revision 1.00 2007/10/24 07:29:52 lzwierko
* Initial revision * Initial revision