[commit] r14017 - in freeswitch/trunk/contrib/mod/endpoints/mod_khomp: . commons include src
Author: jmesquita Date: Sat Jun 27 22:09:07 2009 New Revision: 14017 Log: A little more documentation on the code. Modified: freeswitch/trunk/contrib/mod/endpoints/mod_khomp/commons/k3lapi.hpp freeswitch/trunk/contrib/mod/endpoints/mod_khomp/include/khomp_pvt.h freeswitch/trunk/contrib/mod/endpoints/mod_khomp/include/mod_khomp.h freeswitch/trunk/contrib/mod/endpoints/mod_khomp/mod_khomp.cpp freeswitch/trunk/contrib/mod/endpoints/mod_khomp/src/khomp_pvt.cpp Modified: freeswitch/trunk/contrib/mod/endpoints/mod_khomp/commons/k3lapi.hpp ============================================================================== --- freeswitch/trunk/contrib/mod/endpoints/mod_khomp/commons/k3lapi.hpp (original) +++ freeswitch/trunk/contrib/mod/endpoints/mod_khomp/commons/k3lapi.hpp Sat Jun 27 22:09:07 2009 @@ -122,9 +122,14 @@ return (valid_device(dev) && obj >= 0 && obj < ((int32)_link_count[dev])); } - /* identificadores alto-nivel de objectos */ + /*! + \brief High level object identifier + Since Khomp works with an object concept, this is used to map the + object id with its proper type. + */ struct target { + /*! The types a target can have */ typedef enum { DEVICE, CHANNEL, MIXER, LINK } target_type; target(K3LAPI & k3lapi, target_type type_init, int32 device_value, int32 object_value) Modified: freeswitch/trunk/contrib/mod/endpoints/mod_khomp/include/khomp_pvt.h ============================================================================== --- freeswitch/trunk/contrib/mod/endpoints/mod_khomp/include/khomp_pvt.h (original) +++ freeswitch/trunk/contrib/mod/endpoints/mod_khomp/include/khomp_pvt.h Sat Jun 27 22:09:07 2009 @@ -5,15 +5,15 @@ /*! \brief This struct holds a static linked list representing all the Khomp channels - \ found in the host. It's also a place holder for session objects and some - \ other opaque members used by the module. + found in the host. It's also a place holder for session objects and some + other opaque members used by the module. */ struct KhompPvt { - typedef std::vector < KhompPvt * > PvtVectorType; - typedef std::vector < PvtVectorType > PvtVector2Type; - typedef PvtVector2Type KhompPvtVector; + typedef std::vector < KhompPvt * > PvtVectorType; /*!< Collection of pointers of KhompPvts */ + typedef std::vector < PvtVectorType > PvtVector2Type; /*!< Collection of PvtVectorType */ + typedef PvtVector2Type KhompPvtVector; /*!< A bidimensional array o KhompPvts, meaning [board][channel] */ KhompPvt(K3LAPI::target & target) : _target(target), _session(NULL) {}; @@ -75,7 +75,7 @@ } K3LAPI::target _target; - switch_core_session_t * _session; + switch_core_session_t * _session; /*!< The session to which this pvt is associated with */ unsigned int flags; //TODO: Alterar o nome depois @@ -93,13 +93,13 @@ switch_mutex_t *_mutex; switch_mutex_t *flag_mutex; //TODO: Alterar o nome depois - unsigned int _KDeviceId; // Represent de board we are making the call from - unsigned int _KChannelId; // Represent the channel we are making the call from + unsigned int _KDeviceId; /*!< Represent de board we are making the call from */ + unsigned int _KChannelId; /*!< Represent the channel we are making the call from */ /* static stuff */ static switch_mutex_t *_pvts_mutex; - static KhompPvtVector _pvts; + static KhompPvtVector _pvts; /*!< Static structure that contains all the pvts. Will be initialized by KhompPvt::initialize */ }; Modified: freeswitch/trunk/contrib/mod/endpoints/mod_khomp/include/mod_khomp.h ============================================================================== --- freeswitch/trunk/contrib/mod/endpoints/mod_khomp/include/mod_khomp.h (original) +++ freeswitch/trunk/contrib/mod/endpoints/mod_khomp/include/mod_khomp.h Sat Jun 27 22:09:07 2009 @@ -80,6 +80,9 @@ /*! \brief Defined by mod_reference, defines statuses for the switch_channel + \param TFLAG_IO Enables the IO state of a channel + \param TFLAG_INBOUND Sets a channel as inbound + \param TFLAG_OUTBOUND Sets a channel as outbound */ typedef enum { @@ -95,7 +98,19 @@ } TFLAGS; -/* Module management routines */ +/*! + \brief Load the module. Expadend by a FreeSWITCH macro. + Things we do here: + \li Initialize a static structure on KhompPvt + \li Load the configuration + \li Start the K3L API, responsible for connecting to KServer + \li Register mod APIs and APPs + \li Register audio callback for KServer + \li Register event callback for KServer + \see Opt Where all the configs are handled + \see khomp_event_callback To where we bind the event handler + \see khomp_audio_listener To where we bind the audio handlers + */ SWITCH_MODULE_LOAD_FUNCTION(mod_khomp_load); SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_khomp_shutdown); SWITCH_MODULE_DEFINITION(mod_khomp, mod_khomp_load, mod_khomp_shutdown, NULL); Modified: freeswitch/trunk/contrib/mod/endpoints/mod_khomp/mod_khomp.cpp ============================================================================== --- freeswitch/trunk/contrib/mod/endpoints/mod_khomp/mod_khomp.cpp (original) +++ freeswitch/trunk/contrib/mod/endpoints/mod_khomp/mod_khomp.cpp Sat Jun 27 22:09:07 2009 @@ -413,7 +413,7 @@ return cause; } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Dialing to %s out from Board:%u, Channel:%u.\n", + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Dialing to %u out from Board:%u, Channel:%u.\n", argv[2], tech_pvt->_KDeviceId, tech_pvt->_KChannelId); Modified: freeswitch/trunk/contrib/mod/endpoints/mod_khomp/src/khomp_pvt.cpp ============================================================================== --- freeswitch/trunk/contrib/mod/endpoints/mod_khomp/src/khomp_pvt.cpp (original) +++ freeswitch/trunk/contrib/mod/endpoints/mod_khomp/src/khomp_pvt.cpp Sat Jun 27 22:09:07 2009 @@ -25,7 +25,9 @@ /* Let's setup our own vars on tech_pvt */ if ((argc = switch_separate_string(allocation_string, '/', argv, (sizeof(argv) / sizeof(argv[0])))) < 3) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid dial string (%s). Should be on the format:[Khomp/BoardID (or A for first free board)/CHANNEL (or A for first free channel)]\n", allocation_string); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + "Invalid dial string (%s). Should be on the format:[Khomp/BoardID (or A for first free board)/CHANNEL (or A for first free channel)]\n", + allocation_string); return NULL; } @@ -73,6 +75,7 @@ { channel_low = 0; channel_high = Globals::_k3lapi.channel_count(board); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Just to check we are getting on the first_channel\n", board_low, board_high, channel_low, channel_high); } else { @@ -131,4 +134,4 @@ switch_mutex_unlock(_pvts_mutex); return pvt; -} \ No newline at end of file +}
participants (1)
-
FreeSWITCH SVN