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
*
* Opal-H323 gluer for Freeswitch
* This file implements fontend of OpalH323 module functions
* Opal gluer for Freeswitch
* This file implements fontend of Opal module functions
* that is all functions that are used for communication
* between FreeSWITCH core and this module
*
@ -24,7 +24,7 @@
*
* Contributor(s):
*
* $Log: mod_opalh323.cpp,v $
* $Log: mod_opal.cpp,v $
*
* Revision 1.00 2007/10/24 07:29:52 lzwierko
* 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_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE,"Starting loading mod_opal\n");
/* frontend initialization*/
*module_interface =NULL;
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
@ -118,6 +119,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_opal_load)
assert(*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;
}
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);
if(!opal_manager)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE,"Can not create opal manger\n");
return SWITCH_STATUS_MEMERR;
}
if(!opal_manager->initialize(modname,pool,opalh323_endpoint_interface))
{
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 */
}
/* 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;
}
@ -149,7 +154,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_opal_load)
* it dealocates OPAL core
*
*/
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_opalh323_shutdown)
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_opal_shutdown)
{
/* deallocate OPAL manager */
delete opal_manager;

View File

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

View File

@ -1,7 +1,7 @@
/*
* opalh323_backend.cpp
*
* Backend for OpalH323 module, implements
* Backend for Opal module, implements
* H323 handling via OPAL library
*
* Copyright (c) 2007 Lukasz Zwierko (lzwierko@gmail.com)
@ -21,7 +21,7 @@
*
* Contributor(s):
*
* $Log: opalh323_backend.cpp,v $
* $Log: opal_backend.cpp,v $
*
* Revision 1.00 2007/10/24 07:29:52 lzwierko
* Initial revision
@ -229,7 +229,7 @@ BOOL FSOpalManager::OnIncomingConnection(
if(!session)
{
///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;
}
@ -239,7 +239,7 @@ BOOL FSOpalManager::OnIncomingConnection(
{
///TODO add cause to the connection
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;
}
tech_pvt->m_opalConnection = &connection;
@ -299,7 +299,7 @@ BOOL FSOpalManager::OnIncomingConnection(
/** lunch thread */
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());
switch_mutex_unlock(tech_pvt->m_mutex);
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)
{
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;
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;
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 */
//tech_prv->m_opalConnection->AnsweringCall(AnswerCallNow);
break;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
}

View File

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