Author: raulfragoso Date: Sun Jun 28 00:38:45 2009 New Revision: 14022 Log: Reverted back to call CM_CONNECT; Add (empty for now) channel_on_destroy callback; Modified: freeswitch/trunk/contrib/mod/endpoints/mod_khomp/include/mod_khomp.h freeswitch/trunk/contrib/mod/endpoints/mod_khomp/mod_khomp.cpp 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 Sun Jun 28 00:38:45 2009 @@ -123,6 +123,7 @@ static switch_status_t channel_on_exchange_media( switch_core_session_t *session); static switch_status_t channel_on_soft_execute(switch_core_session_t *session); +static switch_status_t channel_on_destroy(switch_core_session_t *session); switch_state_handler_table_t khomp_state_handlers = { /*.on_init */ channel_on_init, @@ -130,7 +131,13 @@ /*.on_execute */ channel_on_execute, /*.on_hangup */ channel_on_hangup, /*.on_exchange_media */ channel_on_exchange_media, - /*.on_soft_execute */ channel_on_soft_execute + /*.on_soft_execute */ channel_on_soft_execute, + /*.on_consume_media */ NULL, + /*.on_hibernate */ NULL, + /*.on_reset */ NULL, + /*.on_park*/ NULL, + /*.on_reporting*/ NULL, + /*.on_destroy*/ channel_on_destroy }; /* Callbacks for FreeSWITCH */ 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 Sun Jun 28 00:38:45 2009 @@ -205,6 +205,13 @@ return SWITCH_STATUS_SUCCESS; } +static switch_status_t channel_on_destroy(switch_core_session_t *session) +{ + /* Doesn't do anything for now */ + + return SWITCH_STATUS_SUCCESS; +} + static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL KILL, kill = %d\n", sig); @@ -952,6 +959,9 @@ static int32 Kstdcall khomp_event_callback(int32 obj, K3L_EVENT * e) { /* TODO: How do we make sure channels inside FreeSWITCH only change to valid states on K3L? */ + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "New Khomp Event: on %u/%u: %x\n", e->DeviceId, obj, e->Code); + switch(e->Code) { case EV_NEW_CALL: @@ -963,7 +973,8 @@ } try { - Globals::_k3lapi.command(e->DeviceId, obj, CM_RINGBACK, NULL); + Globals::_k3lapi.command(e->DeviceId, obj, CM_RINGBACK, NULL); + Globals::_k3lapi.command(e->DeviceId, obj, CM_CONNECT, NULL); } catch (K3LAPI::failed_command & err) {