提交 a9101cb8 authored 作者: Tuyan Özipek's avatar Tuyan Özipek

Cleaning for the new code


git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6223 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 77405bd5
AM_CFLAGS = $(SWITCH_AM_CFLAGS)
AM_CPPFLAGS = $(SWITCH_AM_CXXFLAGS)
AM_LDFLAGS = $(SWITCH_AM_LDFLAGS)
#we should set all these vars from configure, no reason to have these in each Makefile.am
LIBTOOL = echo "`link=\`echo $@|grep .la;echo $@|grep .so;echo $@|grep .dll\`;if test -n "$$link"; then echo Creating $@;fi`";`if test -z "$(VERBOSE)" ; \
then echo $(SHELL) $(switch_builddir)/quiet_libtool ;else echo $(SHELL) $(switch_builddir)/libtool; fi`
AM_MAKEFLAGS=`test -n "$(VERBOSE)" || echo -s`
# Dirty trick to override the link output
LIBS+=> $(MODNAME).log || error="yes";if test -n "$(VERBOSE)" -o "$$error" = "yes";then cat $(MODNAME).log;fi;if test "$$error" = "yes";then exit 1;fi
moddir=$(prefix)/mod
MODNAME=mod_opal
OPALDIR=$(switch_builddir)/libs/opal/opal
PWLIBDIR=$(switch_builddir)/libs/opal/pwlib
mod_LTLIBRARIES = mod_opal.la
mod_opal_la_SOURCES = opal_backend.cpp mod_opal.cpp
mod_opal_la_CPPFLAGS = $(AM_CPPFLAGS) -D_REENTRANT -fno-exceptions -Wall -DPTRACING -Os -felide-constructors -Wreorder -I$(OPALDIR)/include -I$(PWLIBDIR)/include
mod_opal_la_LIBADD = $(switch_builddir)/libfreeswitch.la
mod_opal_la_LDFLAGS = -avoid-version -module -no-undefined -export-symbols-regex ^switch_module_.*$ -rpath $(PREFIX)/$(libdir) -L$(PWLIBDIR)/lib -L$(OPALDIR)/lib -lopal_linux_x86_r -lpt_linux_x86_r -lpthread -ldl -fPIC -DPIC
#Override the linstall target so we just install the .so/.dylib
install-data-am: $(DESTDIR)$(PREFIX)/$(moddir)/$(MODNAME).$(DYNAMIC_LIB_EXTEN)
$(DESTDIR)$(PREFIX)/$(moddir)/$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).la
@echo installing $(MODNAME).$(DYNAMIC_LIB_EXTEN)
@if [ -f .libs/$(MODNAME).$(DYNAMIC_LIB_EXTEN) ] ; then \
$(LIBTOOL) --mode=install $(INSTALL) .libs/$(MODNAME).$(DYNAMIC_LIB_EXTEN) $(DESTDIR)$(PREFIX)/$(moddir) >/dev/null ; \
else \
$(LIBTOOL) --mode=install $(INSTALL) $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(DESTDIR)$(PREFIX)/$(moddir) >/dev/null ; \
fi
/*
* mod_opalh323.h
*
* Opal gluer for Freeswitch header file
*
* Copyright (c) 2007 Lukasz Zwierko (lzwierko@gmail.com)
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
*
* The Initial Developer of the Original Code is Lukasz Zwierko (lzwierko@gmail.com)
*
* Contributor(s): ______________________________________.
*
* $Log: mod_opal.cpp,v $
*
* Revision 1.00 2007/10/24 07:29:52 lzwierko
* Initial revision
*/
#ifndef __FREESWITCH_MOD_OPAL__
#define __FREESWITCH_MOD_OPAL__
#define HAVE_APR /* what do I need this for?? copied from mod_sofia */
#include <switch.h>
#include <switch_version.h>
#define MODNAME "mod_opal"
#endif /* __FREESWITCH_MOD_OPAL__ */
/*
* mod_opalh323.cpp
*
* Opal-H323 gluer for Freeswitch
* This file implements fontend of OpalH323 module functions
* that is all functions that are used for communication
* between FreeSWITCH core and this module
*
*
* Copyright (c) 2007 Lukasz Zwierko (lzwierko@gmail.com)
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
*
* The Initial Developer of the Original Code is Lukasz Zwierko (lzwierko@gmail.com)
*
* Contributor(s):
*
* $Log: mod_opalh323.cpp,v $
*
* Revision 1.00 2007/10/24 07:29:52 lzwierko
* Initial revision
*/
#include "mod_opalh323.h"
#include "opalh323_backend.h"
#include <switch.h>
/*
* IO routines handlers definitions
*/
static switch_call_cause_t opalh323_outgoing_channel(switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **);
static switch_status_t opalh323_read_frame(switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
static switch_status_t opalh323_write_frame(switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
static switch_status_t opalh323_kill_channel(switch_core_session_t *, int);
static switch_status_t opalh323_waitfor_read(switch_core_session_t *, int, int);
static switch_status_t opalh323_waitfor_write(switch_core_session_t *, int, int);
static switch_status_t opalh323_send_dtmf(switch_core_session_t *, char *);
static switch_status_t opalh323_receive_message(switch_core_session_t *, switch_core_session_message_t *);
static switch_status_t opalh323_receive_event(switch_core_session_t *, switch_event_t *);
static switch_status_t opalh323_state_change(switch_core_session_t *);
static switch_status_t opalh323_read_video_frame(switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
static switch_status_t opalh323_write_video_frame(switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
/*
* Event handlers declaration
*/
static switch_status_t opalh323_on_init(switch_core_session_t *session);
static switch_status_t opalh323_on_ring(switch_core_session_t *session);
static switch_status_t opalh323_on_execute(switch_core_session_t *session);
static switch_status_t opalh323_on_hangup(switch_core_session_t *session);
static switch_status_t opalh323_on_loopback(switch_core_session_t *session);
static switch_status_t opalh323_on_transmit(switch_core_session_t *session);
/**
* Declaration of private variables
*/
static FSOpalManager *opalh323_manager = NULL;
static switch_memory_pool_t *opalh323_pool = NULL;
static switch_endpoint_interface_t *opalh323_endpoint_interface;
/*
* IO routines handlers set declaration
*/
static switch_io_routines_t opalh323_io_routines = {
/*.outgoing_channel */ opalh323_outgoing_channel,
/*.read_frame */ opalh323_read_frame,
/*.write_frame */ opalh323_write_frame,
/*.kill_channel */ opalh323_kill_channel,
/*.waitfor_read */ opalh323_waitfor_read,
/*.waitfor_read */ opalh323_waitfor_write,
/*.send_dtmf */ opalh323_send_dtmf,
/*.receive_message */ opalh323_receive_message,
/*.receive_event */ opalh323_receive_event,
/*.state_change*/ opalh323_state_change,
/*.read_video_frame*/ opalh323_read_video_frame,
/*.write_video_frame*/ opalh323_write_video_frame
};
static switch_state_handler_table_t opalh323_event_handlers = {
/*.on_init */ opalh323_on_init,
/*.on_ring */ opalh323_on_ring,
/*.on_execute */ opalh323_on_execute,
/*.on_hangup */ opalh323_on_hangup,
/*.on_loopback */ opalh323_on_loopback,
/*.on_transmit */ opalh323_on_transmit
};
/*
* Loadable FreeSWITCH module functions declaration
*/
SWITCH_MODULE_LOAD_FUNCTION(mod_opalh323_load);
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_opalh323_shutdown);
SWITCH_MODULE_DEFINITION(mod_opalh323, mod_opalh323_load, mod_opalh323_shutdown, NULL);
/*
* This function is called on module load
* It sets up:
* 1. frontend - interface to FreeSWITCH core
* 2. backend - inerface to OPAL core
*
*/
SWITCH_MODULE_LOAD_FUNCTION(mod_opalh323_load)
{
/* frontend initialization*/
*module_interface =NULL;
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
assert(*module_interface);
if(!module_interface)
{
return SWITCH_STATUS_MEMERR;
}
opalh323_endpoint_interface = (switch_endpoint_interface_t*)switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
opalh323_endpoint_interface->interface_name = "OPALH323";
opalh323_endpoint_interface->io_routines = &opalh323_io_routines;
opalh323_endpoint_interface->state_handler = &opalh323_event_handlers;
/* backend initialization */
opalh323_manager = new FSOpalManager();
assert(opalh323_manager);
if(!opalh323_manager)
{
return SWITCH_STATUS_MEMERR;
}
if(!opalh323_manager->initialize(modname,pool,opalh323_endpoint_interface))
{
delete opalh323_manager;
return SWITCH_STATUS_FALSE; /* if can't initialize return general error */
}
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
}
/*
* This functionis called on module teardown
* It releases all internal resources, i.e.
* it dealocates OPAL core
*
*/
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_opalh323_shutdown)
{
/* deallocate OPAL manager */
delete opalh323_manager;
return SWITCH_STATUS_SUCCESS;
}
/*
* IO routines handlers definitions
*/
static switch_call_cause_t opalh323_outgoing_channel(
switch_core_session_t *session,
switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session,
switch_memory_pool_t **pool)
{
return opalh323_manager->io_outgoing_channel(session,outbound_profile,new_session,pool);
}
static switch_status_t opalh323_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout, switch_io_flag_t flags, int stream_id)
{
return opalh323_manager->io_read_frame(session,frame,timeout,flags,stream_id);
}
static switch_status_t opalh323_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout, switch_io_flag_t flags, int stream_id)
{
return opalh323_manager->io_write_frame(session,frame,timeout,flags,stream_id);
}
static switch_status_t opalh323_kill_channel(switch_core_session_t *session, int sig)
{
return opalh323_manager->io_kill_channel(session,sig);
}
static switch_status_t opalh323_waitfor_read(switch_core_session_t *session, int ms, int stream_id)
{
return opalh323_manager->io_waitfor_read(session,ms,stream_id);
}
static switch_status_t opalh323_waitfor_write(switch_core_session_t *session, int ms, int stream_id)
{
return opalh323_manager->io_waitfor_write(session,ms,stream_id);
}
static switch_status_t opalh323_send_dtmf(switch_core_session_t *session, char *dtmf)
{
return opalh323_manager->io_send_dtmf(session,dtmf);
}
static switch_status_t opalh323_receive_message(switch_core_session_t *session, switch_core_session_message_t *msg)
{
return opalh323_manager->io_receive_message(session,msg);
}
static switch_status_t opalh323_receive_event(switch_core_session_t *session, switch_event_t *event)
{
return opalh323_manager->io_receive_event(session,event);
}
static switch_status_t opalh323_state_change(switch_core_session_t *session)
{
return opalh323_manager->io_state_change(session);
}
static switch_status_t opalh323_read_video_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout, switch_io_flag_t flag, int stream_id)
{
return opalh323_manager->io_read_video_frame(session,frame,timeout,flag,stream_id);
}
static switch_status_t opalh323_write_video_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout, switch_io_flag_t flag, int stream_id)
{
return opalh323_manager->io_write_video_frame(session,frame,timeout,flag,stream_id);
}
/*
* Event handlers
*/
static switch_status_t opalh323_on_init(switch_core_session_t *session)
{
return opalh323_manager->callback_on_init(session);
}
static switch_status_t opalh323_on_ring(switch_core_session_t *session)
{
return opalh323_manager->callback_on_ring(session);
}
static switch_status_t opalh323_on_execute(switch_core_session_t *session)
{
return opalh323_manager->callback_on_execute(session);
}
static switch_status_t opalh323_on_hangup(switch_core_session_t *session)
{
return opalh323_manager->callback_on_hangup(session);
}
static switch_status_t opalh323_on_loopback(switch_core_session_t *session)
{
return opalh323_manager->callback_on_loopback(session);
}
static switch_status_t opalh323_on_transmit(switch_core_session_t *session)
{
return opalh323_manager->callback_on_transmit(session);
}
/*
* mod_opalh323.h
*
* Opal-H323 gluer for Freeswitch header file
*
* Copyright (c) 2007 Lukasz Zwierko (lzwierko@gmail.com)
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
*
* The Initial Developer of the Original Code is Lukasz Zwierko (lzwierko@gmail.com)
*
* Contributor(s): ______________________________________.
*
* $Log: mod_opalh323.cpp,v $
*
* Revision 1.00 2007/10/24 07:29:52 lzwierko
* Initial revision
*/
#ifndef __FREESWITCH_MOD_OPALH323__
#define __FREESWITCH_MOD_OPALH323__
#define HAVE_APR /* what do I need this for?? copied from mod_sofia */
#include <switch.h>
#include <switch_version.h>
#define MODNAME "mod_opalh323"
#endif /* __FREESWITCH_MOD_OPALH323__ */
/*
* opalh323_backend.cpp
*
* Backend for OpalH323 module, implements
* H323 handling via OPAL library
*
* Copyright (c) 2007 Lukasz Zwierko (lzwierko@gmail.com)
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
*
* The Initial Developer of the Original Code is Lukasz Zwierko (lzwierko@gmail.com)
*
* Contributor(s):
*
* $Log: opal_backend.cpp,v $
*
* Revision 1.00 2007/10/24 07:29:52 lzwierko
* Initial revision
*/
#ifndef __FREESWITCH_OPAL_BACKEND__
#define __FREESWITCH_OPAL_BACKEND__
#include <switch.h>
#include <ptlib.h>
#include <opal/buildopts.h>
#include <opal/manager.h>
#include <h323/h323ep.h>
/**
* Helper class for mutex use
*
**/
class SLock
{
public:
SLock(switch_mutex_t* i_mutex) :
m_mutex(NULL)
{
assert(i_mutex);
m_mutex = i_mutex;
switch_mutex_lock(m_mutex);
}
~SLock()
{
switch_mutex_unlock(m_mutex);
}
private:
switch_mutex_t* m_mutex;
};
/** This class is OpalManager implementation
* for FreeSWITCH OpalH323 module.
* All methods are inherited from base OpalManagerClass.
* Event callbacks will be filed with valid code
* Additional functions have been implemented to be called, or called by
*/
class FSOpalManager : public OpalManager
{
PCLASSINFO(FSOpalManager, PObject);
public:
/** Default constructor
*
*/
FSOpalManager();
/** Destructor
*
*/
~FSOpalManager();
/**
* Method does real initialization of the manager
*/
bool initialize(
const char* i_modName,
switch_memory_pool_t* i_memoryPool,
switch_endpoint_interface_t *i_endpointInterface
);
/** FS callback handlers declarations
*
*/
switch_status_t callback_on_init(switch_core_session_t *io_session);
switch_status_t callback_on_ring(switch_core_session_t *io_session);
switch_status_t callback_on_execute(switch_core_session_t *io_session);
switch_status_t callback_on_hangup(switch_core_session_t *io_session);
switch_status_t callback_on_loopback(switch_core_session_t *io_session);
switch_status_t callback_on_transmit(switch_core_session_t *io_session);
/** FS io functions
*
*/
switch_call_cause_t io_outgoing_channel(switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **);
switch_status_t io_read_frame(switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
switch_status_t io_write_frame(switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
switch_status_t io_kill_channel(switch_core_session_t *, int);
switch_status_t io_waitfor_read(switch_core_session_t *, int, int);
switch_status_t io_waitfor_write(switch_core_session_t *, int, int);
switch_status_t io_send_dtmf(switch_core_session_t *, char *);
switch_status_t io_receive_message(switch_core_session_t *, switch_core_session_message_t *);
switch_status_t io_receive_event(switch_core_session_t *, switch_event_t *);
switch_status_t io_state_change(switch_core_session_t *);
switch_status_t io_read_video_frame(switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
switch_status_t io_write_video_frame(switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
/**
* Following OnIncomingConnection functions
* have been overriden for serving
* connections comming from H323 network
* They are called on receiving SETUP
*/
virtual BOOL OnIncomingConnection(
OpalConnection & connection, ///< Connection that is calling
unsigned options, ///< options for new connection (can't use default as overrides will fail)
OpalConnection::StringOptions * stringOptions
);
virtual BOOL OnIncomingConnection(
OpalConnection & connection, ///< Connection that is calling
unsigned options ///< options for new connection (can't use default as overrides will fail)
);
virtual BOOL OnIncomingConnection(
OpalConnection & connection ///< Connection that is calling
);
/**
* OnAnswerCall function is overriden for
* serving a situation where H323 driver has send
* CALL PROCEEDING message
*/
virtual OpalConnection::AnswerCallResponse OnAnswerCall(
OpalConnection &connection,
const PString &caller);
//virtual PString OnRouteConnection (OpalConnection &connection)
/**
* OnAlerting function is overriden for
* serving callbacks when remote side sent ALERTING message
*/
virtual void OnAlerting (OpalConnection &connection);
/**
* OnReleased function is overriden, for
* serving callbacks when remote side released the call
*/
virtual void OnReleased (OpalConnection &connection);
/**
* OnConnected function is overriden for
* serving callbacks when remote side sent CONNECT message
*/
virtual void OnConnected (OpalConnection &connection);
/**
* OnEstablished function is overriden for
* serving callbacks when the call was fully established
* It can happen upon receiving/sending CONNECT PDU with
* fast start or when logical channels where established
*/
virtual void OnEstablished (OpalConnection &connection);
/*
* AdjustMediaFormats is overriden so manager can set it's own
* media format list. It's great for us, as we want to set,
* our private media list from FS codecs
*/
virtual void AdjustMediaFormats(const OpalConnection & connection,
OpalMediaFormatList & mediaFormats) const;
//virtual void OnHold (OpalConnection &connection)
//virtual BOOL OnForwarded (OpalConnection &connection, const PString &remoteParty)
private:
void saveSessionToken(const PString &i_token,switch_core_session_t* i_session);
switch_core_session_t* getSessionToken(const PString &i_token) const;
void deleteSessionToken(const PString &i_token);
switch_call_cause_t causeH323ToOpal(OpalConnection::CallEndReason i_cause);
OpalConnection::CallEndReason causeOpalToH323(switch_call_cause_t i_cause);
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_pH323EndpointInterface; /* FS endpoint inerface */
switch_hash_t *m_pSessionsHashTable; /* Stores pointrs to session object
* for each OpalCall. Each OpalCall object
* as used in this module, stores only one
* OpalConnection. Neither OpalCall or
* OpalConnection have any private data pointer,
* so I can't store pointer to switch session
* with them. Still, each OpalCall has unique
* Token, so I store all sessions in hash table
* where the token is the key. I could of course
* make custom OpalCall class, which would be
* expanded with private pointer field (which would
* be faster), but I don't want to touch OPAL
* code if I don't have to
*/
switch_mutex_t *m_pSessionsHashTableMutex; /* Protects hash table */
};
#endif /* __FREESWITCH_OPAL_BACKEND__ */
/*
* opalh323_backend.cpp
*
* Backend for OpalH323 module, implements
* H323 handling via OPAL library
*
* Copyright (c) 2007 Lukasz Zwierko (lzwierko@gmail.com)
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
*
* The Initial Developer of the Original Code is Lukasz Zwierko (lzwierko@gmail.com)
*
* Contributor(s):
*
* $Log: opalh323_backend.cpp,v $
*
* Revision 1.00 2007/10/24 07:29:52 lzwierko
* Initial revision
*/
#ifndef __FREESWITCH_OPALH323_BACKEND__
#define __FREESWITCH_OPALH323_BACKEND__
#include <switch.h>
#include <ptlib.h>
#include <opal/buildopts.h>
#include <opal/manager.h>
#include <h323/h323ep.h>
/** This class is OpalManager implementation
* for FreeSWITCH OpalH323 module.
* All methods are inherited from base OpalManagerClass.
* Event callbacks will be filed with valid code
* Additional functions have been implemented to be called, or called by
*/
class FSOpalManager : public OpalManager
{
PCLASSINFO(FSOpalManager, PObject);
public:
/** Default constructor
*
*/
FSOpalManager();
/** Destructor
*
*/
~FSOpalManager();
/**
* Method does real initialization of the manager
*/
bool initialize(
const char* i_modName,
switch_memory_pool_t* i_memoryPool,
switch_endpoint_interface_t *i_endpointInterface
);
/** FS callback handlers declarations
*
*/
switch_status_t callback_on_init(switch_core_session_t *io_session);
switch_status_t callback_on_ring(switch_core_session_t *io_session);
switch_status_t callback_on_execute(switch_core_session_t *io_session);
switch_status_t callback_on_hangup(switch_core_session_t *io_session);
switch_status_t callback_on_loopback(switch_core_session_t *io_session);
switch_status_t callback_on_transmit(switch_core_session_t *io_session);
/** FS io functions
*
*/
switch_call_cause_t io_outgoing_channel(switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **);
switch_status_t io_read_frame(switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
switch_status_t io_write_frame(switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
switch_status_t io_kill_channel(switch_core_session_t *, int);
switch_status_t io_waitfor_read(switch_core_session_t *, int, int);
switch_status_t io_waitfor_write(switch_core_session_t *, int, int);
switch_status_t io_send_dtmf(switch_core_session_t *, char *);
switch_status_t io_receive_message(switch_core_session_t *, switch_core_session_message_t *);
switch_status_t io_receive_event(switch_core_session_t *, switch_event_t *);
switch_status_t io_state_change(switch_core_session_t *);
switch_status_t io_read_video_frame(switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
switch_status_t io_write_video_frame(switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
virtual BOOL OnIncomingConnection(
OpalConnection & connection, ///< Connection that is calling
unsigned options, ///< options for new connection (can't use default as overrides will fail)
OpalConnection::StringOptions * stringOptions
);
virtual BOOL OnIncomingConnection(
OpalConnection & connection, ///< Connection that is calling
unsigned options ///< options for new connection (can't use default as overrides will fail)
);
virtual BOOL OnIncomingConnection(
OpalConnection & connection ///< Connection that is calling
);
private:
void saveSessionToken(const PString &i_token,switch_core_session_t* i_session);
switch_core_session_t* getSessionToken(const PString &i_token);
void deleteSessionToken(const PString &i_token);
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 */
};
#endif
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论