[Freeswitch-svn] [commit] r9968 - freeswitch/trunk/src/mod/endpoints/mod_loopback
Freeswitch SVN
brian at freeswitch.org
Sat Oct 11 16:50:49 EDT 2008
Author: brian
Date: Sat Oct 11 16:50:48 2008
New Revision: 9968
Modified:
freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c
Log:
NEXT...
Modified: freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c Sat Oct 11 16:50:48 2008
@@ -44,7 +44,6 @@
static switch_memory_pool_t *module_pool = NULL;
-
typedef enum {
TFLAG_LINKED = (1 << 0),
TFLAG_OUTBOUND = (1 << 1),
@@ -77,13 +76,13 @@
switch_caller_profile_t *caller_profile;
int32_t bowout_frame_count;
};
+
typedef struct private_object private_t;
static struct {
int debug;
} globals;
-
static switch_status_t channel_on_init(switch_core_session_t *session);
static switch_status_t channel_on_hangup(switch_core_session_t *session);
static switch_status_t channel_on_routing(switch_core_session_t *session);
@@ -155,7 +154,6 @@
tech_pvt->read_frame.buflen = sizeof(tech_pvt->databuf);
tech_pvt->read_frame.codec = &tech_pvt->read_codec;
-
tech_pvt->write_frame.data = tech_pvt->write_databuf;
tech_pvt->write_frame.buflen = sizeof(tech_pvt->write_databuf);
@@ -194,9 +192,6 @@
return status;
}
-
-
-
/*
State methods they get called when the state changes to the specific state
returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next
@@ -235,7 +230,6 @@
switch_core_session_destroy(&b_session);
goto end;
}
-
caller_profile = switch_caller_profile_clone(b_session, tech_pvt->caller_profile);
caller_profile->source = switch_core_strdup(caller_profile->pool, modname);
@@ -272,14 +266,12 @@
goto end;
}
-
switch_channel_set_variable(channel, "loopback_leg", switch_test_flag(tech_pvt, TFLAG_OUTBOUND) ? "B" : "A");
switch_channel_set_state(channel, CS_ROUTING);
end:
return SWITCH_STATUS_SUCCESS;
-
}
static void do_reset(private_t *tech_pvt)
@@ -313,7 +305,6 @@
static switch_status_t channel_on_execute(switch_core_session_t *session)
{
-
switch_channel_t *channel = NULL;
private_t *tech_pvt = NULL;
@@ -325,7 +316,6 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL EXECUTE\n", switch_channel_get_name(channel));
-
return SWITCH_STATUS_SUCCESS;
}
@@ -391,7 +381,6 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL KILL\n", switch_channel_get_name(channel));
-
return SWITCH_STATUS_SUCCESS;
}
@@ -417,7 +406,6 @@
return SWITCH_STATUS_SUCCESS;
}
-
static switch_status_t channel_on_reset(switch_core_session_t *session)
{
private_t *tech_pvt = (private_t *) switch_core_session_get_private(session);
@@ -429,7 +417,6 @@
return SWITCH_STATUS_SUCCESS;
}
-
static switch_status_t channel_on_hibernate(switch_core_session_t *session)
{
private_t *tech_pvt = switch_core_session_get_private(session);
@@ -440,8 +427,6 @@
return SWITCH_STATUS_SUCCESS;
}
-
-
static switch_status_t channel_on_consume_media(switch_core_session_t *session)
{
switch_channel_t *channel = NULL;
@@ -458,7 +443,6 @@
return SWITCH_STATUS_FALSE;
}
-
static switch_status_t channel_send_dtmf(switch_core_session_t *session, const switch_dtmf_t *dtmf)
{
private_t *tech_pvt = NULL;
@@ -554,7 +538,6 @@
if (switch_test_flag(frame, SFF_CNG) || switch_test_flag(tech_pvt, TFLAG_CNG) || switch_test_flag(tech_pvt, TFLAG_BOWOUT)) {
return SWITCH_STATUS_SUCCESS;
}
-
if (!switch_test_flag(tech_pvt, TFLAG_BOWOUT) &&
tech_pvt->other_tech_pvt &&
@@ -615,7 +598,6 @@
tech_pvt = switch_core_session_get_private(session);
assert(tech_pvt != NULL);
-
switch (msg->message_id) {
case SWITCH_MESSAGE_INDICATE_ANSWER:
@@ -648,14 +630,12 @@
return SWITCH_STATUS_SUCCESS;
}
-
static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
{
char name[128];
-
if (session) {
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_channel_clear_flag(channel, CF_PROXY_MEDIA);
@@ -730,7 +710,6 @@
}
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
-
}
static switch_state_handler_table_t channel_event_handlers = {
@@ -754,13 +733,8 @@
/*.receive_message */ channel_receive_message
};
-
-
SWITCH_MODULE_LOAD_FUNCTION(mod_loopback_load)
{
-
- //switch_status_t status;
-
if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
return SWITCH_STATUS_TERM;
@@ -775,19 +749,15 @@
loopback_endpoint_interface->io_routines = &channel_io_routines;
loopback_endpoint_interface->state_handler = &channel_event_handlers;
-
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
}
-
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_loopback_shutdown)
{
return SWITCH_STATUS_SUCCESS;
}
-
-
/* For Emacs:
* Local Variables:
* mode:c
More information about the Freeswitch-svn
mailing list