change names to protect the innocent

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8263 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-05-05 15:30:55 +00:00
parent b79c36dacc
commit 4b929592cc
30 changed files with 231 additions and 231 deletions

View File

@ -63,17 +63,17 @@ struct switch_state_handler_table {
/*! executed when the state changes to init */ /*! executed when the state changes to init */
switch_state_handler_t on_init; switch_state_handler_t on_init;
/*! executed when the state changes to ring */ /*! executed when the state changes to ring */
switch_state_handler_t on_ring; switch_state_handler_t on_routing;
/*! executed when the state changes to execute */ /*! executed when the state changes to execute */
switch_state_handler_t on_execute; switch_state_handler_t on_execute;
/*! executed when the state changes to hangup */ /*! executed when the state changes to hangup */
switch_state_handler_t on_hangup; switch_state_handler_t on_hangup;
/*! executed when the state changes to loopback */ /*! executed when the state changes to loopback */
switch_state_handler_t on_loopback; switch_state_handler_t on_exchange_media;
/*! executed when the state changes to transmit */ /*! executed when the state changes to transmit */
switch_state_handler_t on_transmit; switch_state_handler_t on_soft_execute;
/*! executed when the state changes to hold */ /*! executed when the state changes to hold */
switch_state_handler_t on_hold; switch_state_handler_t on_consume_media;
/*! executed when the state changes to hibernate */ /*! executed when the state changes to hibernate */
switch_state_handler_t on_hibernate; switch_state_handler_t on_hibernate;
/*! executed when the state changes to reset */ /*! executed when the state changes to reset */

View File

@ -628,16 +628,16 @@ typedef enum {
/*! /*!
\enum switch_channel_state_t \enum switch_channel_state_t
\brief Channel States \brief Channel States (these are the defaults, CS_SOFT_EXECUTE, CS_EXCHANGE_MEDIA, and CS_CONSUME_MEDIA are often overridden by specific apps)
<pre> <pre>
CS_NEW - Channel is newly created CS_NEW - Channel is newly created
CS_INIT - Channel has been initilized CS_INIT - Channel has been initilized
CS_RING - Channel is looking for a dialplan CS_ROUTING - Channel is looking for an extension to execute
CS_TRANSMIT - Channel is in a passive transmit state CS_SOFT_EXECUTE - Channel is ready to execute from 3rd party control
CS_EXECUTE - Channel is executing it's dialplan CS_EXECUTE - Channel is executing it's dialplan
CS_LOOPBACK - Channel is in loopback CS_EXCHANGE_MEDIA - Channel is exchanging media with another channel.
CS_PARK - Channel is parked CS_PARK - Channel is accepting media awaiting commands.
CS_HOLD - Channel is on hold CS_CONSUME_MEDIA - Channel is consuming all media and dropping it.
CS_HIBERNATE - Channel is in a sleep state CS_HIBERNATE - Channel is in a sleep state
CS_RESET - Channel is in a reset state CS_RESET - Channel is in a reset state
CS_HANGUP - Channel is flagged for hangup and ready to end CS_HANGUP - Channel is flagged for hangup and ready to end
@ -647,12 +647,12 @@ CS_DONE - Channel is ready to be destroyed and out of the state machine
typedef enum { typedef enum {
CS_NEW, CS_NEW,
CS_INIT, CS_INIT,
CS_RING, CS_ROUTING,
CS_TRANSMIT, CS_SOFT_EXECUTE,
CS_EXECUTE, CS_EXECUTE,
CS_LOOPBACK, CS_EXCHANGE_MEDIA,
CS_PARK, CS_PARK,
CS_HOLD, CS_CONSUME_MEDIA,
CS_HIBERNATE, CS_HIBERNATE,
CS_RESET, CS_RESET,
CS_HANGUP, CS_HANGUP,

View File

@ -348,7 +348,7 @@ static switch_status_t conference_play_file(conference_obj_t * conference, char
static switch_status_t conference_say(conference_obj_t * conference, const char *text, uint32_t leadin); static switch_status_t conference_say(conference_obj_t * conference, const char *text, uint32_t leadin);
static void conference_list(conference_obj_t * conference, switch_stream_handle_t *stream, char *delim); static void conference_list(conference_obj_t * conference, switch_stream_handle_t *stream, char *delim);
SWITCH_STANDARD_API(conf_api_main); SWITCH_STANDARD_API(conf_api_main);
static switch_status_t audio_bridge_on_ring(switch_core_session_t *session); static switch_status_t audio_bridge_on_routing(switch_core_session_t *session);
static switch_status_t conference_outcall(conference_obj_t * conference, static switch_status_t conference_outcall(conference_obj_t * conference,
char *conference_name, char *conference_name,
switch_core_session_t *session, switch_core_session_t *session,
@ -581,7 +581,7 @@ static switch_status_t conference_add_member(conference_obj_t * conference, conf
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", EC++); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", EC++);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "unique-id", "%s", conference->name); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "unique-id", "%s", conference->name);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", "CS_RING"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", "CS_ROUTING");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", conference->count == 1 ? "early" : "confirmed"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", conference->count == 1 ? "early" : "confirmed");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-direction", "%s", conference->count == 1 ? "outbound" : "inbound"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-direction", "%s", conference->count == 1 ? "outbound" : "inbound");
switch_event_fire(&event); switch_event_fire(&event);
@ -723,7 +723,7 @@ static switch_status_t conference_del_member(conference_obj_t * conference, conf
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", EC++); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", EC++);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "unique-id", "%s", conference->name); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "unique-id", "%s", conference->name);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", "CS_RING"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", "CS_ROUTING");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", conference->count == 1 ? "early" : "confirmed"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", conference->count == 1 ? "early" : "confirmed");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-direction", "%s", conference->count == 1 ? "outbound" : "inbound"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-direction", "%s", conference->count == 1 ? "outbound" : "inbound");
switch_event_fire(&event); switch_event_fire(&event);
@ -3726,7 +3726,7 @@ SWITCH_STANDARD_API(conf_api_main)
} }
/* outbound call bridge progress call state callback handler */ /* outbound call bridge progress call state callback handler */
static switch_status_t audio_bridge_on_ring(switch_core_session_t *session) static switch_status_t audio_bridge_on_routing(switch_core_session_t *session)
{ {
switch_channel_t *channel = NULL; switch_channel_t *channel = NULL;
@ -3735,18 +3735,18 @@ static switch_status_t audio_bridge_on_ring(switch_core_session_t *session)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CUSTOM RING\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CUSTOM RING\n");
/* put the channel in a passive state so we can loop audio to it */ /* put the channel in a passive state so we can loop audio to it */
switch_channel_set_state(channel, CS_TRANSMIT); switch_channel_set_state(channel, CS_SOFT_EXECUTE);
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
static switch_state_handler_table_t audio_bridge_peer_state_handlers = { static switch_state_handler_table_t audio_bridge_peer_state_handlers = {
/*.on_init */ NULL, /*.on_init */ NULL,
/*.on_ring */ audio_bridge_on_ring, /*.on_routing */ audio_bridge_on_routing,
/*.on_execute */ NULL, /*.on_execute */ NULL,
/*.on_hangup */ NULL, /*.on_hangup */ NULL,
/*.on_loopback */ NULL, /*.on_exchange_media */ NULL,
/*.on_transmit */ NULL, /*.on_soft_execute */ NULL,
/*.on_hold */ NULL, /*.on_consume_media */ NULL,
}; };
@ -5124,7 +5124,7 @@ static void pres_event_handler(switch_event_t *event)
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", EC++); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", EC++);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "unique-id", "%s", conf_name); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "unique-id", "%s", conf_name);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", "CS_RING"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", "CS_ROUTING");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", conference->count == 1 ? "early" : "confirmed"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", conference->count == 1 ? "early" : "confirmed");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-direction", "%s", conference->count == 1 ? "outbound" : "inbound"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-direction", "%s", conference->count == 1 ? "outbound" : "inbound");
switch_event_fire(&event); switch_event_fire(&event);

View File

@ -1341,7 +1341,7 @@ static switch_status_t hanguphook(switch_core_session_t *session)
switch_channel_state_t state = switch_channel_get_state(channel); switch_channel_state_t state = switch_channel_get_state(channel);
const char *id = NULL; const char *id = NULL;
if (state == CS_HANGUP || state == CS_RING) { if (state == CS_HANGUP || state == CS_ROUTING) {
if ((id = switch_channel_get_variable(channel, "xfer_uuids"))) { if ((id = switch_channel_get_variable(channel, "xfer_uuids"))) {
switch_stream_handle_t stream = { 0 }; switch_stream_handle_t stream = { 0 };
SWITCH_STANDARD_STREAM(stream); SWITCH_STANDARD_STREAM(stream);
@ -1703,7 +1703,7 @@ SWITCH_STANDARD_APP(audio_bridge_function)
} }
} }
if (!switch_channel_test_flag(caller_channel, CF_TRANSFER) && switch_channel_get_state(caller_channel) != CS_RING) { if (!switch_channel_test_flag(caller_channel, CF_TRANSFER) && switch_channel_get_state(caller_channel) != CS_ROUTING) {
switch_channel_hangup(caller_channel, cause); switch_channel_hangup(caller_channel, cause);
} }
return; return;

View File

@ -294,7 +294,7 @@ static void send_presence(fifo_node_t *node)
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", 0); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", 0);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", wait_count > 0 ? "CS_RING" : "CS_HANGUP"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", wait_count > 0 ? "CS_ROUTING" : "CS_HANGUP");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "unique-id", "%s", node->name); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "unique-id", "%s", node->name);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", wait_count > 0 ? "early" : "terminated"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", wait_count > 0 ? "early" : "terminated");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-direction", "%s", "inbound"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-direction", "%s", "inbound");

View File

@ -281,7 +281,7 @@ static switch_status_t hanguphook(switch_core_session_t *session)
const char *id = NULL; const char *id = NULL;
char *sql = NULL; char *sql = NULL;
if (state == CS_HANGUP || state == CS_RING) { if (state == CS_HANGUP || state == CS_ROUTING) {
id = switch_channel_get_variable(channel, "limit_id"); id = switch_channel_get_variable(channel, "limit_id");
realm = switch_channel_get_variable(channel, "limit_realm"); realm = switch_channel_get_variable(channel, "limit_realm");
sql = switch_mprintf("delete from limit_data where uuid='%q' and hostname='%q' and realm='%q'and id='%q';", sql = switch_mprintf("delete from limit_data where uuid='%q' and hostname='%q' and realm='%q'and id='%q';",

View File

@ -143,9 +143,9 @@ static void add_pvt(private_t * tech_pvt, int master);
static void remove_pvt(private_t * tech_pvt); static void remove_pvt(private_t * tech_pvt);
static switch_status_t channel_on_init(switch_core_session_t *session); 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_hangup(switch_core_session_t *session);
static switch_status_t channel_on_ring(switch_core_session_t *session); static switch_status_t channel_on_routing(switch_core_session_t *session);
static switch_status_t channel_on_loopback(switch_core_session_t *session); static switch_status_t channel_on_exchange_media(switch_core_session_t *session);
static switch_status_t channel_on_transmit(switch_core_session_t *session); static switch_status_t channel_on_soft_execute(switch_core_session_t *session);
static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile, switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags); switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
@ -294,13 +294,13 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
switch_set_flag_locked(tech_pvt, TFLAG_IO); switch_set_flag_locked(tech_pvt, TFLAG_IO);
/* Move Channel's State Machine to RING */ /* Move Channel's State Machine to RING */
switch_channel_set_state(channel, CS_RING); switch_channel_set_state(channel, CS_ROUTING);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t channel_on_ring(switch_core_session_t *session) static switch_status_t channel_on_routing(switch_core_session_t *session)
{ {
switch_channel_t *channel = NULL; switch_channel_t *channel = NULL;
private_t *tech_pvt = NULL; private_t *tech_pvt = NULL;
@ -478,13 +478,13 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t channel_on_transmit(switch_core_session_t *session) static switch_status_t channel_on_soft_execute(switch_core_session_t *session)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL TRANSMIT\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL TRANSMIT\n");
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t channel_on_loopback(switch_core_session_t *session) static switch_status_t channel_on_exchange_media(switch_core_session_t *session)
{ {
switch_channel_t *channel = NULL; switch_channel_t *channel = NULL;
private_t *tech_pvt = NULL; private_t *tech_pvt = NULL;
@ -737,11 +737,11 @@ static switch_api_interface_t channel_api_interface = {
static switch_state_handler_table_t channel_event_handlers = { static switch_state_handler_table_t channel_event_handlers = {
/*.on_init */ channel_on_init, /*.on_init */ channel_on_init,
/*.on_ring */ channel_on_ring, /*.on_routing */ channel_on_routing,
/*.on_execute */ channel_on_execute, /*.on_execute */ channel_on_execute,
/*.on_hangup */ channel_on_hangup, /*.on_hangup */ channel_on_hangup,
/*.on_loopback */ channel_on_loopback, /*.on_exchange_media */ channel_on_exchange_media,
/*.on_transmit */ channel_on_transmit /*.on_soft_execute */ channel_on_soft_execute
}; };
static switch_io_routines_t channel_io_routines = { static switch_io_routines_t channel_io_routines = {

View File

@ -205,9 +205,9 @@ SWITCH_STANDARD_API(dl_pres);
SWITCH_STANDARD_API(dl_debug); SWITCH_STANDARD_API(dl_debug);
static switch_status_t channel_on_init(switch_core_session_t *session); 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_hangup(switch_core_session_t *session);
static switch_status_t channel_on_ring(switch_core_session_t *session); static switch_status_t channel_on_routing(switch_core_session_t *session);
static switch_status_t channel_on_loopback(switch_core_session_t *session); static switch_status_t channel_on_exchange_media(switch_core_session_t *session);
static switch_status_t channel_on_transmit(switch_core_session_t *session); static switch_status_t channel_on_soft_execute(switch_core_session_t *session);
static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile, switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags); switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
@ -1166,13 +1166,13 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
if (negotiate_media(session) == SWITCH_STATUS_SUCCESS) { if (negotiate_media(session) == SWITCH_STATUS_SUCCESS) {
/* Move Channel's State Machine to RING */ /* Move Channel's State Machine to RING */
switch_channel_set_state(channel, CS_RING); switch_channel_set_state(channel, CS_ROUTING);
} }
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t channel_on_ring(switch_core_session_t *session) static switch_status_t channel_on_routing(switch_core_session_t *session)
{ {
switch_channel_t *channel = switch_core_session_get_channel(session); switch_channel_t *channel = switch_core_session_get_channel(session);
struct private_object *tech_pvt = NULL; struct private_object *tech_pvt = NULL;
@ -1294,13 +1294,13 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t channel_on_loopback(switch_core_session_t *session) static switch_status_t channel_on_exchange_media(switch_core_session_t *session)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL LOOPBACK\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL LOOPBACK\n");
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t channel_on_transmit(switch_core_session_t *session) static switch_status_t channel_on_soft_execute(switch_core_session_t *session)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL TRANSMIT\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL TRANSMIT\n");
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
@ -1564,11 +1564,11 @@ static switch_status_t channel_receive_event(switch_core_session_t *session, swi
switch_state_handler_table_t dingaling_event_handlers = { switch_state_handler_table_t dingaling_event_handlers = {
/*.on_init */ channel_on_init, /*.on_init */ channel_on_init,
/*.on_ring */ channel_on_ring, /*.on_routing */ channel_on_routing,
/*.on_execute */ channel_on_execute, /*.on_execute */ channel_on_execute,
/*.on_hangup */ channel_on_hangup, /*.on_hangup */ channel_on_hangup,
/*.on_loopback */ channel_on_loopback, /*.on_exchange_media */ channel_on_exchange_media,
/*.on_transmit */ channel_on_transmit /*.on_soft_execute */ channel_on_soft_execute
}; };
switch_io_routines_t dingaling_io_routines = { switch_io_routines_t dingaling_io_routines = {

View File

@ -416,9 +416,9 @@ static switch_status_t iax_set_codec(private_t * tech_pvt, struct iax_session *i
static switch_status_t channel_on_init(switch_core_session_t *session); 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_hangup(switch_core_session_t *session);
static switch_status_t channel_on_ring(switch_core_session_t *session); static switch_status_t channel_on_routing(switch_core_session_t *session);
static switch_status_t channel_on_loopback(switch_core_session_t *session); static switch_status_t channel_on_exchange_media(switch_core_session_t *session);
static switch_status_t channel_on_transmit(switch_core_session_t *session); static switch_status_t channel_on_soft_execute(switch_core_session_t *session);
static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile, switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags); switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
@ -468,7 +468,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
switch_set_flag_locked(tech_pvt, TFLAG_IO); switch_set_flag_locked(tech_pvt, TFLAG_IO);
/* Move Channel's State Machine to RING */ /* Move Channel's State Machine to RING */
switch_channel_set_state(switch_core_session_get_channel(session), CS_RING); switch_channel_set_state(switch_core_session_get_channel(session), CS_ROUTING);
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
globals.calls++; globals.calls++;
switch_mutex_unlock(globals.mutex); switch_mutex_unlock(globals.mutex);
@ -476,7 +476,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t channel_on_ring(switch_core_session_t *session) static switch_status_t channel_on_routing(switch_core_session_t *session)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL RING\n", switch_channel_get_name(switch_core_session_get_channel(session))); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL RING\n", switch_channel_get_name(switch_core_session_get_channel(session)));
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
@ -545,13 +545,13 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t channel_on_loopback(switch_core_session_t *session) static switch_status_t channel_on_exchange_media(switch_core_session_t *session)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL LOOPBACK\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL LOOPBACK\n");
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t channel_on_transmit(switch_core_session_t *session) static switch_status_t channel_on_soft_execute(switch_core_session_t *session)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL TRANSMIT\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL TRANSMIT\n");
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
@ -800,11 +800,11 @@ static switch_status_t channel_receive_event(switch_core_session_t *session, swi
switch_state_handler_table_t iax_state_handlers = { switch_state_handler_table_t iax_state_handlers = {
/*.on_init */ channel_on_init, /*.on_init */ channel_on_init,
/*.on_ring */ channel_on_ring, /*.on_routing */ channel_on_routing,
/*.on_execute */ channel_on_execute, /*.on_execute */ channel_on_execute,
/*.on_hangup */ channel_on_hangup, /*.on_hangup */ channel_on_hangup,
/*.on_loopback */ channel_on_loopback, /*.on_exchange_media */ channel_on_exchange_media,
/*.on_transmit */ channel_on_transmit /*.on_soft_execute */ channel_on_soft_execute
}; };
switch_io_routines_t iax_io_routines = { switch_io_routines_t iax_io_routines = {

View File

@ -140,9 +140,9 @@ static void add_pvt(private_t * tech_pvt, int master);
static void remove_pvt(private_t * tech_pvt); static void remove_pvt(private_t * tech_pvt);
static switch_status_t channel_on_init(switch_core_session_t *session); 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_hangup(switch_core_session_t *session);
static switch_status_t channel_on_ring(switch_core_session_t *session); static switch_status_t channel_on_routing(switch_core_session_t *session);
static switch_status_t channel_on_loopback(switch_core_session_t *session); static switch_status_t channel_on_exchange_media(switch_core_session_t *session);
static switch_status_t channel_on_transmit(switch_core_session_t *session); static switch_status_t channel_on_soft_execute(switch_core_session_t *session);
static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile, switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags); switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
@ -284,12 +284,12 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
switch_set_flag_locked(tech_pvt, TFLAG_IO); switch_set_flag_locked(tech_pvt, TFLAG_IO);
/* Move Channel's State Machine to RING */ /* Move Channel's State Machine to RING */
switch_channel_set_state(channel, CS_RING); switch_channel_set_state(channel, CS_ROUTING);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t channel_on_ring(switch_core_session_t *session) static switch_status_t channel_on_routing(switch_core_session_t *session)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL RING\n", switch_channel_get_name(switch_core_session_get_channel(session))); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL RING\n", switch_channel_get_name(switch_core_session_get_channel(session)));
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
@ -435,13 +435,13 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t channel_on_transmit(switch_core_session_t *session) static switch_status_t channel_on_soft_execute(switch_core_session_t *session)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL TRANSMIT\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL TRANSMIT\n");
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t channel_on_loopback(switch_core_session_t *session) static switch_status_t channel_on_exchange_media(switch_core_session_t *session)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL LOOPBACK\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL LOOPBACK\n");
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
@ -622,11 +622,11 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
switch_state_handler_table_t portaudio_event_handlers = { switch_state_handler_table_t portaudio_event_handlers = {
/*.on_init */ channel_on_init, /*.on_init */ channel_on_init,
/*.on_ring */ channel_on_ring, /*.on_routing */ channel_on_routing,
/*.on_execute */ channel_on_execute, /*.on_execute */ channel_on_execute,
/*.on_hangup */ channel_on_hangup, /*.on_hangup */ channel_on_hangup,
/*.on_loopback */ channel_on_loopback, /*.on_exchange_media */ channel_on_exchange_media,
/*.on_transmit */ channel_on_transmit /*.on_soft_execute */ channel_on_soft_execute
}; };
switch_io_routines_t portaudio_io_routines = { switch_io_routines_t portaudio_io_routines = {

View File

@ -100,9 +100,9 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_ip, globals.ip);
static switch_status_t channel_on_init(switch_core_session_t *session); 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_hangup(switch_core_session_t *session);
static switch_status_t channel_on_ring(switch_core_session_t *session); static switch_status_t channel_on_routing(switch_core_session_t *session);
static switch_status_t channel_on_loopback(switch_core_session_t *session); static switch_status_t channel_on_exchange_media(switch_core_session_t *session);
static switch_status_t channel_on_transmit(switch_core_session_t *session); static switch_status_t channel_on_soft_execute(switch_core_session_t *session);
static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile, switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags); switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
@ -140,7 +140,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
switch_set_flag_locked(tech_pvt, TFLAG_IO); switch_set_flag_locked(tech_pvt, TFLAG_IO);
/* Move Channel's State Machine to RING */ /* Move Channel's State Machine to RING */
switch_channel_set_state(channel, CS_RING); switch_channel_set_state(channel, CS_ROUTING);
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
globals.calls++; globals.calls++;
switch_mutex_unlock(globals.mutex); switch_mutex_unlock(globals.mutex);
@ -148,7 +148,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t channel_on_ring(switch_core_session_t *session) static switch_status_t channel_on_routing(switch_core_session_t *session)
{ {
switch_channel_t *channel = NULL; switch_channel_t *channel = NULL;
private_t *tech_pvt = NULL; private_t *tech_pvt = NULL;
@ -245,13 +245,13 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t channel_on_loopback(switch_core_session_t *session) static switch_status_t channel_on_exchange_media(switch_core_session_t *session)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL LOOPBACK\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL LOOPBACK\n");
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t channel_on_transmit(switch_core_session_t *session) static switch_status_t channel_on_soft_execute(switch_core_session_t *session)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL TRANSMIT\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL TRANSMIT\n");
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
@ -479,11 +479,11 @@ static switch_status_t channel_receive_event(switch_core_session_t *session, swi
switch_state_handler_table_t reference_state_handlers = { switch_state_handler_table_t reference_state_handlers = {
/*.on_init */ channel_on_init, /*.on_init */ channel_on_init,
/*.on_ring */ channel_on_ring, /*.on_routing */ channel_on_routing,
/*.on_execute */ channel_on_execute, /*.on_execute */ channel_on_execute,
/*.on_hangup */ channel_on_hangup, /*.on_hangup */ channel_on_hangup,
/*.on_loopback */ channel_on_loopback, /*.on_exchange_media */ channel_on_exchange_media,
/*.on_transmit */ channel_on_transmit /*.on_soft_execute */ channel_on_soft_execute
}; };
switch_io_routines_t reference_io_routines = { switch_io_routines_t reference_io_routines = {

View File

@ -50,8 +50,8 @@ static char silence_data[13] = "";
static switch_status_t sofia_on_init(switch_core_session_t *session); static switch_status_t sofia_on_init(switch_core_session_t *session);
static switch_status_t sofia_on_loopback(switch_core_session_t *session); static switch_status_t sofia_on_exchange_media(switch_core_session_t *session);
static switch_status_t sofia_on_transmit(switch_core_session_t *session); static switch_status_t sofia_on_soft_execute(switch_core_session_t *session);
static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session, static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile, switch_core_session_t **new_session, switch_caller_profile_t *outbound_profile, switch_core_session_t **new_session,
switch_memory_pool_t **pool, switch_originate_flag_t flags); switch_memory_pool_t **pool, switch_originate_flag_t flags);
@ -104,12 +104,12 @@ static switch_status_t sofia_on_init(switch_core_session_t *session)
} }
/* Move Channel's State Machine to RING */ /* Move Channel's State Machine to RING */
switch_channel_set_state(channel, CS_RING); switch_channel_set_state(channel, CS_ROUTING);
assert( switch_channel_get_state(channel) != CS_INIT); assert( switch_channel_get_state(channel) != CS_INIT);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t sofia_on_ring(switch_core_session_t *session) static switch_status_t sofia_on_routing(switch_core_session_t *session)
{ {
private_object_t *tech_pvt = (private_object_t *) switch_core_session_get_private(session); private_object_t *tech_pvt = (private_object_t *) switch_core_session_get_private(session);
switch_assert(tech_pvt != NULL); switch_assert(tech_pvt != NULL);
@ -316,13 +316,13 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t sofia_on_loopback(switch_core_session_t *session) static switch_status_t sofia_on_exchange_media(switch_core_session_t *session)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SOFIA LOOPBACK\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SOFIA LOOPBACK\n");
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t sofia_on_transmit(switch_core_session_t *session) static switch_status_t sofia_on_soft_execute(switch_core_session_t *session)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SOFIA TRANSMIT\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SOFIA TRANSMIT\n");
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
@ -1635,12 +1635,12 @@ switch_io_routines_t sofia_io_routines = {
switch_state_handler_table_t sofia_event_handlers = { switch_state_handler_table_t sofia_event_handlers = {
/*.on_init */ sofia_on_init, /*.on_init */ sofia_on_init,
/*.on_ring */ sofia_on_ring, /*.on_routing */ sofia_on_routing,
/*.on_execute */ sofia_on_execute, /*.on_execute */ sofia_on_execute,
/*.on_hangup */ sofia_on_hangup, /*.on_hangup */ sofia_on_hangup,
/*.on_loopback */ sofia_on_loopback, /*.on_exchange_media */ sofia_on_exchange_media,
/*.on_transmit */ sofia_on_transmit, /*.on_soft_execute */ sofia_on_soft_execute,
/*.on_hold */ NULL, /*.on_consume_media */ NULL,
/*.on_hibernate*/ sofia_on_hibernate, /*.on_hibernate*/ sofia_on_hibernate,
/*.on_reset*/ sofia_on_reset /*.on_reset*/ sofia_on_reset
}; };

View File

@ -701,7 +701,7 @@ static int sofia_presence_resub_callback(void *pArg, int argc, char **argv, char
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", "CS_HANGUP"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", "CS_HANGUP");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", "resubscribe"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", "resubscribe");
} else { } else {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", "CS_RING"); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", "CS_ROUTING");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "unique-id", "%s", uuid); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "unique-id", "%s", uuid);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", state); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", state);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "astate", "%s", state); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "astate", "%s", state);

View File

@ -52,7 +52,7 @@ static struct sangoma_pri_event_list SANGOMA_PRI_EVENT_LIST[] = {
{2, SANGOMA_PRI_EVENT_DCHAN_DOWN, "DCHAN_DOWN"}, {2, SANGOMA_PRI_EVENT_DCHAN_DOWN, "DCHAN_DOWN"},
{3, SANGOMA_PRI_EVENT_RESTART, "RESTART"}, {3, SANGOMA_PRI_EVENT_RESTART, "RESTART"},
{4, SANGOMA_PRI_EVENT_CONFIG_ERR, "CONFIG_ERR"}, {4, SANGOMA_PRI_EVENT_CONFIG_ERR, "CONFIG_ERR"},
{5, SANGOMA_PRI_EVENT_RING, "RING"}, {5, SANGOMA_PRI_EVENT_RING, "ROUTING"},
{6, SANGOMA_PRI_EVENT_HANGUP, "HANGUP"}, {6, SANGOMA_PRI_EVENT_HANGUP, "HANGUP"},
{7, SANGOMA_PRI_EVENT_RINGING, "RINGING"}, {7, SANGOMA_PRI_EVENT_RINGING, "RINGING"},
{8, SANGOMA_PRI_EVENT_ANSWER, "ANSWER"}, {8, SANGOMA_PRI_EVENT_ANSWER, "ANSWER"},

View File

@ -464,8 +464,8 @@ static int str2node(char *node);
static int str2switch(char *swtype); static int str2switch(char *swtype);
static switch_status_t wanpipe_on_init(switch_core_session_t *session); static switch_status_t wanpipe_on_init(switch_core_session_t *session);
static switch_status_t wanpipe_on_hangup(switch_core_session_t *session); static switch_status_t wanpipe_on_hangup(switch_core_session_t *session);
static switch_status_t wanpipe_on_loopback(switch_core_session_t *session); static switch_status_t wanpipe_on_exchange_media(switch_core_session_t *session);
static switch_status_t wanpipe_on_transmit(switch_core_session_t *session); static switch_status_t wanpipe_on_soft_execute(switch_core_session_t *session);
static switch_call_cause_t wanpipe_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile, static switch_call_cause_t wanpipe_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags); switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
static switch_status_t wanpipe_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout, static switch_status_t wanpipe_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
@ -474,7 +474,7 @@ static switch_status_t wanpipe_write_frame(switch_core_session_t *session, switc
switch_io_flag_t flags, int stream_id); switch_io_flag_t flags, int stream_id);
static int on_info(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri_event *pevent); static int on_info(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri_event *pevent);
static int on_hangup(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri_event *pevent); static int on_hangup(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri_event *pevent);
static int on_ring(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri_event *pevent); static int on_routing(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri_event *pevent);
static int check_flags(struct sangoma_pri *spri); static int check_flags(struct sangoma_pri *spri);
static int on_restart(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri_event *pevent); static int on_restart(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri_event *pevent);
static int on_anything(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri_event *pevent); static int on_anything(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri_event *pevent);
@ -614,11 +614,11 @@ static switch_status_t wanpipe_on_init(switch_core_session_t *session)
done: done:
/* Move Channel's State Machine to RING */ /* Move Channel's State Machine to RING */
switch_channel_set_state(channel, CS_RING); switch_channel_set_state(channel, CS_ROUTING);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t wanpipe_on_ring(switch_core_session_t *session) static switch_status_t wanpipe_on_routing(switch_core_session_t *session)
{ {
switch_channel_t *channel = NULL; switch_channel_t *channel = NULL;
private_object_t *tech_pvt = NULL; private_object_t *tech_pvt = NULL;
@ -694,13 +694,13 @@ static switch_status_t wanpipe_on_hangup(switch_core_session_t *session)
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t wanpipe_on_loopback(switch_core_session_t *session) static switch_status_t wanpipe_on_exchange_media(switch_core_session_t *session)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "WANPIPE LOOPBACK\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "WANPIPE LOOPBACK\n");
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t wanpipe_on_transmit(switch_core_session_t *session) static switch_status_t wanpipe_on_soft_execute(switch_core_session_t *session)
{ {
private_object_t *tech_pvt; private_object_t *tech_pvt;
switch_channel_t *channel; switch_channel_t *channel;
@ -1001,11 +1001,11 @@ switch_io_routines_t wanpipe_io_routines = {
switch_state_handler_table_t wanpipe_state_handlers = { switch_state_handler_table_t wanpipe_state_handlers = {
/*.on_init */ wanpipe_on_init, /*.on_init */ wanpipe_on_init,
/*.on_ring */ wanpipe_on_ring, /*.on_routing */ wanpipe_on_routing,
/*.on_execute */ NULL, /*.on_execute */ NULL,
/*.on_hangup */ wanpipe_on_hangup, /*.on_hangup */ wanpipe_on_hangup,
/*.on_loopback */ wanpipe_on_loopback, /*.on_exchange_media */ wanpipe_on_exchange_media,
/*.on_transmit */ wanpipe_on_transmit /*.on_soft_execute */ wanpipe_on_soft_execute
}; };
static switch_call_cause_t wanpipe_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile, static switch_call_cause_t wanpipe_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
@ -1463,7 +1463,7 @@ static int on_proceed(struct sangoma_pri *spri, sangoma_pri_event_t event_type,
} }
static int on_ringing(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri_event *pevent) static int on_routinging(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri_event *pevent)
{ {
switch_core_session_t *session; switch_core_session_t *session;
switch_channel_t *channel; switch_channel_t *channel;
@ -1489,7 +1489,7 @@ static int on_ringing(struct sangoma_pri *spri, sangoma_pri_event_t event_type,
} }
static int on_ring(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri_event *pevent) static int on_routing(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri_event *pevent)
{ {
char name[128]; char name[128];
switch_core_session_t *session = NULL; switch_core_session_t *session = NULL;
@ -1671,8 +1671,8 @@ static void *SWITCH_THREAD_FUNC pri_thread_run(switch_thread_t *thread, void *ob
switch_mutex_init(&chanmap.mutex, SWITCH_MUTEX_NESTED, module_pool); switch_mutex_init(&chanmap.mutex, SWITCH_MUTEX_NESTED, module_pool);
SANGOMA_MAP_PRI_EVENT((*spri), SANGOMA_PRI_EVENT_ANY, on_anything); SANGOMA_MAP_PRI_EVENT((*spri), SANGOMA_PRI_EVENT_ANY, on_anything);
SANGOMA_MAP_PRI_EVENT((*spri), SANGOMA_PRI_EVENT_RING, on_ring); SANGOMA_MAP_PRI_EVENT((*spri), SANGOMA_PRI_EVENT_RING, on_routing);
SANGOMA_MAP_PRI_EVENT((*spri), SANGOMA_PRI_EVENT_RINGING, on_ringing); SANGOMA_MAP_PRI_EVENT((*spri), SANGOMA_PRI_EVENT_RINGING, on_routinging);
//SANGOMA_MAP_PRI_EVENT((*spri), SANGOMA_PRI_EVENT_SETUP_ACK, on_proceed); //SANGOMA_MAP_PRI_EVENT((*spri), SANGOMA_PRI_EVENT_SETUP_ACK, on_proceed);
SANGOMA_MAP_PRI_EVENT((*spri), SANGOMA_PRI_EVENT_PROCEEDING, on_proceed); SANGOMA_MAP_PRI_EVENT((*spri), SANGOMA_PRI_EVENT_PROCEEDING, on_proceed);
SANGOMA_MAP_PRI_EVENT((*spri), SANGOMA_PRI_EVENT_ANSWER, on_answer); SANGOMA_MAP_PRI_EVENT((*spri), SANGOMA_PRI_EVENT_ANSWER, on_answer);

View File

@ -170,9 +170,9 @@ static woomera_profile default_profile;
static switch_status_t woomera_on_init(switch_core_session_t *session); static switch_status_t woomera_on_init(switch_core_session_t *session);
static switch_status_t woomera_on_hangup(switch_core_session_t *session); static switch_status_t woomera_on_hangup(switch_core_session_t *session);
static switch_status_t woomera_on_ring(switch_core_session_t *session); static switch_status_t woomera_on_routing(switch_core_session_t *session);
static switch_status_t woomera_on_loopback(switch_core_session_t *session); static switch_status_t woomera_on_exchange_media(switch_core_session_t *session);
static switch_status_t woomera_on_transmit(switch_core_session_t *session); static switch_status_t woomera_on_soft_execute(switch_core_session_t *session);
static switch_call_cause_t woomera_outgoing_channel(switch_core_session_t *session, static switch_call_cause_t woomera_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile, switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags); switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
@ -238,7 +238,7 @@ static switch_status_t woomera_on_init(switch_core_session_t *session)
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t woomera_on_ring(switch_core_session_t *session) static switch_status_t woomera_on_routing(switch_core_session_t *session)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s WOOMERA RING\n", switch_channel_get_name(switch_core_session_get_channel(session))); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s WOOMERA RING\n", switch_channel_get_name(switch_core_session_get_channel(session)));
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
@ -310,13 +310,13 @@ static switch_status_t woomera_kill_channel(switch_core_session_t *session, int
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t woomera_on_loopback(switch_core_session_t *session) static switch_status_t woomera_on_exchange_media(switch_core_session_t *session)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "WOOMERA LOOPBACK\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "WOOMERA LOOPBACK\n");
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t woomera_on_transmit(switch_core_session_t *session) static switch_status_t woomera_on_soft_execute(switch_core_session_t *session)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "WOOMERA TRANSMIT\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "WOOMERA TRANSMIT\n");
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
@ -405,11 +405,11 @@ static switch_status_t woomera_write_frame(switch_core_session_t *session, switc
static switch_state_handler_table_t woomera_event_handlers = { static switch_state_handler_table_t woomera_event_handlers = {
/*.on_init */ woomera_on_init, /*.on_init */ woomera_on_init,
/*.on_ring */ woomera_on_ring, /*.on_routing */ woomera_on_routing,
/*.on_execute */ woomera_on_execute, /*.on_execute */ woomera_on_execute,
/*.on_hangup */ woomera_on_hangup, /*.on_hangup */ woomera_on_hangup,
/*.on_loopback */ woomera_on_loopback, /*.on_exchange_media */ woomera_on_exchange_media,
/*.on_transmit */ woomera_on_transmit /*.on_soft_execute */ woomera_on_soft_execute
}; };
static switch_io_routines_t woomera_io_routines = { static switch_io_routines_t woomera_io_routines = {
@ -1044,7 +1044,7 @@ static void *woomera_channel_thread_run(switch_thread_t * thread, void *obj)
} }
/* Move Channel's State Machine to RING */ /* Move Channel's State Machine to RING */
switch_channel_answer(channel); switch_channel_answer(channel);
switch_channel_set_state(channel, CS_RING); switch_channel_set_state(channel, CS_ROUTING);
if (switch_sockaddr_info_get(&tech_pvt->udpwrite, if (switch_sockaddr_info_get(&tech_pvt->udpwrite,
ip, SWITCH_UNSPEC, port, 0, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) { ip, SWITCH_UNSPEC, port, 0, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {

View File

@ -255,11 +255,11 @@ static void event_handler(switch_event_t *event)
static switch_state_handler_table_t state_handlers = { static switch_state_handler_table_t state_handlers = {
/*.on_init */ NULL, /*.on_init */ NULL,
/*.on_ring */ NULL, /*.on_routing */ NULL,
/*.on_execute */ NULL, /*.on_execute */ NULL,
/*.on_hangup */ my_on_hangup, /*.on_hangup */ my_on_hangup,
/*.on_loopback */ NULL, /*.on_exchange_media */ NULL,
/*.on_transmit */ NULL /*.on_soft_execute */ NULL
}; };

View File

@ -130,7 +130,7 @@ static rc_handle * my_radius_init(void)
return rad_config; return rad_config;
} }
static switch_status_t my_on_ring(switch_core_session_t *session) static switch_status_t my_on_routing(switch_core_session_t *session)
{ {
switch_xml_t cdr; switch_xml_t cdr;
switch_channel_t *channel = switch_core_session_get_channel(session); switch_channel_t *channel = switch_core_session_get_channel(session);
@ -149,7 +149,7 @@ static switch_status_t my_on_ring(switch_core_session_t *session)
switch_time_exp_t tm; switch_time_exp_t tm;
char buffer[32]; char buffer[32];
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "[mod_radius_cdr] Entering my_on_ring\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "[mod_radius_cdr] Entering my_on_routing\n");
rad_config = my_radius_init(); rad_config = my_radius_init();
@ -716,11 +716,11 @@ static switch_status_t load_config(void)
static const switch_state_handler_table_t state_handlers = { static const switch_state_handler_table_t state_handlers = {
/*.on_init */ NULL, /*.on_init */ NULL,
/*.on_ring */ my_on_ring, /*.on_routing */ my_on_routing,
/*.on_execute */ NULL, /*.on_execute */ NULL,
/*.on_hangup */ my_on_hangup, /*.on_hangup */ my_on_hangup,
/*.on_loopback */ NULL, /*.on_exchange_media */ NULL,
/*.on_transmit */ NULL /*.on_soft_execute */ NULL
}; };
SWITCH_MODULE_LOAD_FUNCTION(mod_radius_cdr_load) SWITCH_MODULE_LOAD_FUNCTION(mod_radius_cdr_load)

View File

@ -71,7 +71,7 @@ bool Session::ready() {
void Session::check_hangup_hook() void Session::check_hangup_hook()
{ {
if (hangup_func_str && (hook_state == CS_HANGUP || hook_state == CS_RING)) { if (hangup_func_str && (hook_state == CS_HANGUP || hook_state == CS_ROUTING)) {
hh++; hh++;
} }
} }

View File

@ -67,7 +67,7 @@ bool Session::ready() {
void Session::check_hangup_hook() void Session::check_hangup_hook()
{ {
if (hangup_func_str && (hook_state == CS_HANGUP || hook_state == CS_RING)) { if (hangup_func_str && (hook_state == CS_HANGUP || hook_state == CS_ROUTING)) {
hh++; hh++;
} }
} }

View File

@ -2924,19 +2924,19 @@ extern "C"
PyDict_SetItemString(d, "CS_INIT", SWIG_From_int((int) (CS_INIT))); PyDict_SetItemString(d, "CS_INIT", SWIG_From_int((int) (CS_INIT)));
} }
{ {
PyDict_SetItemString(d, "CS_RING", SWIG_From_int((int) (CS_RING))); PyDict_SetItemString(d, "CS_ROUTING", SWIG_From_int((int) (CS_ROUTING)));
} }
{ {
PyDict_SetItemString(d, "CS_TRANSMIT", SWIG_From_int((int) (CS_TRANSMIT))); PyDict_SetItemString(d, "CS_SOFT_EXECUTE", SWIG_From_int((int) (CS_SOFT_EXECUTE)));
} }
{ {
PyDict_SetItemString(d, "CS_EXECUTE", SWIG_From_int((int) (CS_EXECUTE))); PyDict_SetItemString(d, "CS_EXECUTE", SWIG_From_int((int) (CS_EXECUTE)));
} }
{ {
PyDict_SetItemString(d, "CS_LOOPBACK", SWIG_From_int((int) (CS_LOOPBACK))); PyDict_SetItemString(d, "CS_EXCHANGE_MEDIA", SWIG_From_int((int) (CS_EXCHANGE_MEDIA)));
} }
{ {
PyDict_SetItemString(d, "CS_HOLD", SWIG_From_int((int) (CS_HOLD))); PyDict_SetItemString(d, "CS_CONSUME_MEDIA", SWIG_From_int((int) (CS_CONSUME_MEDIA)));
} }
{ {
PyDict_SetItemString(d, "CS_HIBERNATE", SWIG_From_int((int) (CS_HIBERNATE))); PyDict_SetItemString(d, "CS_HIBERNATE", SWIG_From_int((int) (CS_HIBERNATE)));

View File

@ -1560,7 +1560,7 @@ static void check_hangup_hook(struct js_session *jss)
int argc = 0; int argc = 0;
jsval ret; jsval ret;
if (jss->on_hangup && (jss->hook_state == CS_HANGUP || jss->hook_state == CS_RING)) { if (jss->on_hangup && (jss->hook_state == CS_HANGUP || jss->hook_state == CS_ROUTING)) {
argv[argc++] = OBJECT_TO_JSVAL(jss->obj); argv[argc++] = OBJECT_TO_JSVAL(jss->obj);
if (jss->hook_state == CS_HANGUP) { if (jss->hook_state == CS_HANGUP) {
argv[argc++] = STRING_TO_JSVAL(JS_NewStringCopyZ(jss->cx, "hangup")); argv[argc++] = STRING_TO_JSVAL(JS_NewStringCopyZ(jss->cx, "hangup"));
@ -2754,7 +2754,7 @@ static JSBool session_originate(JSContext * cx, JSObject * obj, uintN argc, jsva
jss->session = peer_session; jss->session = peer_session;
switch_set_flag(jss, S_HUP); switch_set_flag(jss, S_HUP);
*rval = BOOLEAN_TO_JSVAL(JS_TRUE); *rval = BOOLEAN_TO_JSVAL(JS_TRUE);
switch_channel_set_state(switch_core_session_get_channel(jss->session), CS_TRANSMIT); switch_channel_set_state(switch_core_session_get_channel(jss->session), CS_SOFT_EXECUTE);
} else { } else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Missing Args\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Missing Args\n");

View File

@ -241,11 +241,11 @@ error:
static switch_state_handler_table_t state_handlers = { static switch_state_handler_table_t state_handlers = {
/*.on_init */ NULL, /*.on_init */ NULL,
/*.on_ring */ NULL, /*.on_routing */ NULL,
/*.on_execute */ NULL, /*.on_execute */ NULL,
/*.on_hangup */ my_on_hangup, /*.on_hangup */ my_on_hangup,
/*.on_loopback */ NULL, /*.on_exchange_media */ NULL,
/*.on_transmit */ NULL /*.on_soft_execute */ NULL
}; };
SWITCH_MODULE_LOAD_FUNCTION(mod_xml_cdr_load) SWITCH_MODULE_LOAD_FUNCTION(mod_xml_cdr_load)

View File

@ -721,7 +721,7 @@ SWITCH_DECLARE(uint8_t) switch_channel_ready(switch_channel_t *channel)
switch_assert(channel != NULL); switch_assert(channel != NULL);
if (!channel->hangup_cause && channel->state > CS_RING && channel->state < CS_HANGUP && channel->state != CS_RESET && if (!channel->hangup_cause && channel->state > CS_ROUTING && channel->state < CS_HANGUP && channel->state != CS_RESET &&
!switch_test_flag(channel, CF_TRANSFER)) { !switch_test_flag(channel, CF_TRANSFER)) {
ret++; ret++;
} }
@ -732,12 +732,12 @@ SWITCH_DECLARE(uint8_t) switch_channel_ready(switch_channel_t *channel)
static const char *state_names[] = { static const char *state_names[] = {
"CS_NEW", "CS_NEW",
"CS_INIT", "CS_INIT",
"CS_RING", "CS_ROUTING",
"CS_TRANSMIT", "CS_SOFT_EXECUTE",
"CS_EXECUTE", "CS_EXECUTE",
"CS_LOOPBACK", "CS_EXCHANGE_MEDIA",
"CS_PARK", "CS_PARK",
"CS_HOLD", "CS_CONSUME_MEDIA",
"CS_HIBERNATE", "CS_HIBERNATE",
"CS_RESET", "CS_RESET",
"CS_HANGUP", "CS_HANGUP",
@ -776,7 +776,7 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_running_state(
channel->state_flags = 0; channel->state_flags = 0;
} }
if (channel->state >= CS_RING) { if (channel->state >= CS_ROUTING) {
switch_clear_flag(channel, CF_TRANSFER); switch_clear_flag(channel, CF_TRANSFER);
switch_channel_presence(channel, "unknown", (char *) state_names[state]); switch_channel_presence(channel, "unknown", (char *) state_names[state]);
} }
@ -784,7 +784,7 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_running_state(
if (state < CS_HANGUP) { if (state < CS_HANGUP) {
switch_event_t *event; switch_event_t *event;
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_STATE) == SWITCH_STATUS_SUCCESS) { if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_STATE) == SWITCH_STATUS_SUCCESS) {
if (state == CS_RING) { if (state == CS_ROUTING) {
switch_channel_event_set_data(channel, event); switch_channel_event_set_data(channel, event);
} else { } else {
char state_num[25]; char state_num[25];
@ -838,9 +838,9 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_state(switch_c
case CS_NEW: case CS_NEW:
case CS_INIT: case CS_INIT:
case CS_LOOPBACK: case CS_EXCHANGE_MEDIA:
case CS_TRANSMIT: case CS_SOFT_EXECUTE:
case CS_RING: case CS_ROUTING:
case CS_EXECUTE: case CS_EXECUTE:
case CS_HANGUP: case CS_HANGUP:
case CS_DONE: case CS_DONE:
@ -863,12 +863,12 @@ default:
case CS_INIT: case CS_INIT:
switch (state) { switch (state) {
case CS_LOOPBACK: case CS_EXCHANGE_MEDIA:
case CS_TRANSMIT: case CS_SOFT_EXECUTE:
case CS_RING: case CS_ROUTING:
case CS_EXECUTE: case CS_EXECUTE:
case CS_PARK: case CS_PARK:
case CS_HOLD: case CS_CONSUME_MEDIA:
case CS_HIBERNATE: case CS_HIBERNATE:
case CS_RESET: case CS_RESET:
ok++; ok++;
@ -877,13 +877,13 @@ default:
} }
break; break;
case CS_LOOPBACK: case CS_EXCHANGE_MEDIA:
switch (state) { switch (state) {
case CS_TRANSMIT: case CS_SOFT_EXECUTE:
case CS_RING: case CS_ROUTING:
case CS_EXECUTE: case CS_EXECUTE:
case CS_PARK: case CS_PARK:
case CS_HOLD: case CS_CONSUME_MEDIA:
case CS_HIBERNATE: case CS_HIBERNATE:
case CS_RESET: case CS_RESET:
ok++; ok++;
@ -892,13 +892,13 @@ default:
} }
break; break;
case CS_TRANSMIT: case CS_SOFT_EXECUTE:
switch (state) { switch (state) {
case CS_LOOPBACK: case CS_EXCHANGE_MEDIA:
case CS_RING: case CS_ROUTING:
case CS_EXECUTE: case CS_EXECUTE:
case CS_PARK: case CS_PARK:
case CS_HOLD: case CS_CONSUME_MEDIA:
case CS_HIBERNATE: case CS_HIBERNATE:
case CS_RESET: case CS_RESET:
ok++; ok++;
@ -909,25 +909,25 @@ default:
case CS_PARK: case CS_PARK:
switch (state) { switch (state) {
case CS_LOOPBACK: case CS_EXCHANGE_MEDIA:
case CS_RING: case CS_ROUTING:
case CS_EXECUTE: case CS_EXECUTE:
case CS_TRANSMIT: case CS_SOFT_EXECUTE:
case CS_HIBERNATE: case CS_HIBERNATE:
case CS_RESET: case CS_RESET:
case CS_HOLD: case CS_CONSUME_MEDIA:
ok++; ok++;
default: default:
break; break;
} }
break; break;
case CS_HOLD: case CS_CONSUME_MEDIA:
switch (state) { switch (state) {
case CS_LOOPBACK: case CS_EXCHANGE_MEDIA:
case CS_RING: case CS_ROUTING:
case CS_EXECUTE: case CS_EXECUTE:
case CS_TRANSMIT: case CS_SOFT_EXECUTE:
case CS_HIBERNATE: case CS_HIBERNATE:
case CS_RESET: case CS_RESET:
case CS_PARK: case CS_PARK:
@ -938,13 +938,13 @@ default:
break; break;
case CS_HIBERNATE: case CS_HIBERNATE:
switch (state) { switch (state) {
case CS_LOOPBACK: case CS_EXCHANGE_MEDIA:
case CS_INIT: case CS_INIT:
case CS_RING: case CS_ROUTING:
case CS_EXECUTE: case CS_EXECUTE:
case CS_TRANSMIT: case CS_SOFT_EXECUTE:
case CS_PARK: case CS_PARK:
case CS_HOLD: case CS_CONSUME_MEDIA:
case CS_RESET: case CS_RESET:
ok++; ok++;
default: default:
@ -952,13 +952,13 @@ default:
} }
break; break;
case CS_RING: case CS_ROUTING:
switch (state) { switch (state) {
case CS_LOOPBACK: case CS_EXCHANGE_MEDIA:
case CS_EXECUTE: case CS_EXECUTE:
case CS_TRANSMIT: case CS_SOFT_EXECUTE:
case CS_PARK: case CS_PARK:
case CS_HOLD: case CS_CONSUME_MEDIA:
case CS_HIBERNATE: case CS_HIBERNATE:
case CS_RESET: case CS_RESET:
ok++; ok++;
@ -969,11 +969,11 @@ default:
case CS_EXECUTE: case CS_EXECUTE:
switch (state) { switch (state) {
case CS_LOOPBACK: case CS_EXCHANGE_MEDIA:
case CS_TRANSMIT: case CS_SOFT_EXECUTE:
case CS_RING: case CS_ROUTING:
case CS_PARK: case CS_PARK:
case CS_HOLD: case CS_CONSUME_MEDIA:
case CS_HIBERNATE: case CS_HIBERNATE:
case CS_RESET: case CS_RESET:
ok++; ok++;

View File

@ -287,7 +287,7 @@ static void core_event_handler(switch_event_t *event)
case CS_HANGUP: case CS_HANGUP:
case CS_DONE: case CS_DONE:
break; break;
case CS_RING: case CS_ROUTING:
sql = switch_mprintf("update channels set state='%s',cid_name='%q',cid_num='%q',ip_addr='%s',dest='%q' " sql = switch_mprintf("update channels set state='%s',cid_name='%q',cid_num='%q',ip_addr='%s',dest='%q' "
"where uuid='%s'", "where uuid='%s'",
switch_event_get_header(event, "channel-state"), switch_event_get_header(event, "channel-state"),

View File

@ -54,7 +54,7 @@ static void switch_core_standard_on_reset(switch_core_session_t *session)
switch_channel_get_name(session->channel)); switch_channel_get_name(session->channel));
} }
static void switch_core_standard_on_ring(switch_core_session_t *session) static void switch_core_standard_on_routing(switch_core_session_t *session)
{ {
switch_dialplan_interface_t *dialplan_interface = NULL; switch_dialplan_interface_t *dialplan_interface = NULL;
switch_caller_profile_t *caller_profile; switch_caller_profile_t *caller_profile;
@ -103,7 +103,7 @@ static void switch_core_standard_on_ring(switch_core_session_t *session)
if (!count) { if (!count) {
if (switch_channel_test_flag(session->channel, CF_OUTBOUND)) { if (switch_channel_test_flag(session->channel, CF_OUTBOUND)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "No Dialplan, changing state to HOLD\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "No Dialplan, changing state to HOLD\n");
switch_channel_set_state(session->channel, CS_HOLD); switch_channel_set_state(session->channel, CS_CONSUME_MEDIA);
goto end; goto end;
} }
} }
@ -157,14 +157,14 @@ static void switch_core_standard_on_execute(switch_core_session_t *session)
} }
} }
static void switch_core_standard_on_loopback(switch_core_session_t *session) static void switch_core_standard_on_exchange_media(switch_core_session_t *session)
{ {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard LOOPBACK\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard LOOPBACK\n");
switch_ivr_session_echo(session); switch_ivr_session_echo(session);
} }
static void switch_core_standard_on_transmit(switch_core_session_t *session) static void switch_core_standard_on_soft_execute(switch_core_session_t *session)
{ {
switch_assert(session != NULL); switch_assert(session != NULL);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard TRANSMIT\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard TRANSMIT\n");
@ -179,7 +179,7 @@ static void switch_core_standard_on_park(switch_core_session_t *session)
switch_ivr_park(session, NULL); switch_ivr_park(session, NULL);
} }
static void switch_core_standard_on_hold(switch_core_session_t *session) static void switch_core_standard_on_consume_media(switch_core_session_t *session)
{ {
switch_assert(session != NULL); switch_assert(session != NULL);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard HOLD\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard HOLD\n");
@ -413,9 +413,9 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
STATE_MACRO(init, "INIT"); STATE_MACRO(init, "INIT");
switch_core_session_signal_unlock(session); switch_core_session_signal_unlock(session);
break; break;
case CS_RING: /* Look for a dialplan and find something to do */ case CS_ROUTING: /* Look for a dialplan and find something to do */
switch_core_session_signal_lock(session); switch_core_session_signal_lock(session);
STATE_MACRO(ring, "RING"); STATE_MACRO(routing, "ROUTING");
switch_core_session_signal_unlock(session); switch_core_session_signal_unlock(session);
break; break;
case CS_RESET: /* Reset */ case CS_RESET: /* Reset */
@ -427,17 +427,17 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
case CS_EXECUTE: /* Execute an Operation */ case CS_EXECUTE: /* Execute an Operation */
STATE_MACRO(execute, "EXECUTE"); STATE_MACRO(execute, "EXECUTE");
break; break;
case CS_LOOPBACK: /* loop all data back to source */ case CS_EXCHANGE_MEDIA: /* loop all data back to source */
STATE_MACRO(loopback, "LOOPBACK"); STATE_MACRO(exchange_media, "EXCHANGE_MEDIA");
break; break;
case CS_TRANSMIT: /* send/recieve data to/from another channel */ case CS_SOFT_EXECUTE: /* send/recieve data to/from another channel */
STATE_MACRO(transmit, "TRANSMIT"); STATE_MACRO(soft_execute, "SOFT_EXECUTE");
break; break;
case CS_PARK: /* wait in limbo */ case CS_PARK: /* wait in limbo */
STATE_MACRO(park, "PARK"); STATE_MACRO(park, "PARK");
break; break;
case CS_HOLD: /* wait in limbo */ case CS_CONSUME_MEDIA: /* wait in limbo */
STATE_MACRO(hold, "HOLD"); STATE_MACRO(consume_media, "CONSUME_MEDIA");
break; break;
case CS_HIBERNATE: /* sleep */ case CS_HIBERNATE: /* sleep */
STATE_MACRO(hibernate, "HIBERNATE"); STATE_MACRO(hibernate, "HIBERNATE");

View File

@ -352,7 +352,7 @@ SWITCH_DECLARE_CONSTRUCTOR CoreSession::CoreSession(char *nuuid)
allocated = 1; allocated = 1;
switch_set_flag(this, S_HUP); switch_set_flag(this, S_HUP);
uuid = strdup(switch_core_session_get_uuid(session)); uuid = strdup(switch_core_session_get_uuid(session));
switch_channel_set_state(switch_core_session_get_channel(session), CS_TRANSMIT); switch_channel_set_state(switch_core_session_get_channel(session), CS_SOFT_EXECUTE);
} }
} }
} }
@ -694,7 +694,7 @@ SWITCH_DECLARE(int) CoreSession::originate(CoreSession *a_leg_session, char *des
if (a_leg_session) a_leg_session->end_allow_threads(); if (a_leg_session) a_leg_session->end_allow_threads();
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
allocated = 1; allocated = 1;
switch_channel_set_state(switch_core_session_get_channel(session), CS_TRANSMIT); switch_channel_set_state(switch_core_session_get_channel(session), CS_SOFT_EXECUTE);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;

View File

@ -1023,7 +1023,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_
switch_channel_set_caller_profile(channel, new_profile); switch_channel_set_caller_profile(channel, new_profile);
switch_channel_set_flag(channel, CF_TRANSFER); switch_channel_set_flag(channel, CF_TRANSFER);
switch_channel_set_state(channel, CS_RING); switch_channel_set_state(channel, CS_ROUTING);
msg.message_id = SWITCH_MESSAGE_INDICATE_TRANSFER; msg.message_id = SWITCH_MESSAGE_INDICATE_TRANSFER;
msg.from = __FILE__; msg.from = __FILE__;

View File

@ -354,7 +354,7 @@ static void *audio_bridge_thread(switch_thread_t * thread, void *obj)
return NULL; return NULL;
} }
static switch_status_t audio_bridge_on_loopback(switch_core_session_t *session) static switch_status_t audio_bridge_on_exchange_media(switch_core_session_t *session)
{ {
switch_channel_t *channel = switch_core_session_get_channel(session); switch_channel_t *channel = switch_core_session_get_channel(session);
switch_ivr_bridge_data_t *bd = switch_channel_get_private(channel, "_bridge_"); switch_ivr_bridge_data_t *bd = switch_channel_get_private(channel, "_bridge_");
@ -374,25 +374,25 @@ static switch_status_t audio_bridge_on_loopback(switch_core_session_t *session)
state = switch_channel_get_state(channel); state = switch_channel_get_state(channel);
if (!switch_channel_test_flag(channel, CF_TRANSFER) && state != CS_PARK && state != CS_RING) { if (!switch_channel_test_flag(channel, CF_TRANSFER) && state != CS_PARK && state != CS_ROUTING) {
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
} }
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
static switch_status_t audio_bridge_on_ring(switch_core_session_t *session) static switch_status_t audio_bridge_on_routing(switch_core_session_t *session)
{ {
switch_channel_t *channel = switch_core_session_get_channel(session); switch_channel_t *channel = switch_core_session_get_channel(session);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CUSTOM RING\n", switch_channel_get_name(channel)); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CUSTOM RING\n", switch_channel_get_name(channel));
/* put the channel in a passive state so we can loop audio to it */ /* put the channel in a passive state so we can loop audio to it */
switch_channel_set_state(channel, CS_HOLD); switch_channel_set_state(channel, CS_CONSUME_MEDIA);
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
static switch_status_t audio_bridge_on_hold(switch_core_session_t *session) static switch_status_t audio_bridge_on_consume_media(switch_core_session_t *session)
{ {
switch_channel_t *channel = switch_core_session_get_channel(session); switch_channel_t *channel = switch_core_session_get_channel(session);
@ -404,12 +404,12 @@ static switch_status_t audio_bridge_on_hold(switch_core_session_t *session)
static const switch_state_handler_table_t audio_bridge_peer_state_handlers = { static const switch_state_handler_table_t audio_bridge_peer_state_handlers = {
/*.on_init */ NULL, /*.on_init */ NULL,
/*.on_ring */ audio_bridge_on_ring, /*.on_routing */ audio_bridge_on_routing,
/*.on_execute */ NULL, /*.on_execute */ NULL,
/*.on_hangup */ NULL, /*.on_hangup */ NULL,
/*.on_loopback */ audio_bridge_on_loopback, /*.on_exchange_media */ audio_bridge_on_exchange_media,
/*.on_transmit */ NULL, /*.on_soft_execute */ NULL,
/*.on_hold */ audio_bridge_on_hold, /*.on_consume_media */ audio_bridge_on_consume_media,
}; };
static switch_status_t uuid_bridge_on_reset(switch_core_session_t *session) static switch_status_t uuid_bridge_on_reset(switch_core_session_t *session)
@ -421,13 +421,13 @@ static switch_status_t uuid_bridge_on_reset(switch_core_session_t *session)
switch_channel_clear_flag(channel, CF_TRANSFER); switch_channel_clear_flag(channel, CF_TRANSFER);
if (switch_channel_test_flag(channel, CF_ORIGINATOR)) { if (switch_channel_test_flag(channel, CF_ORIGINATOR)) {
switch_channel_set_state(channel, CS_TRANSMIT); switch_channel_set_state(channel, CS_SOFT_EXECUTE);
} }
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t uuid_bridge_on_transmit(switch_core_session_t *session) static switch_status_t uuid_bridge_on_soft_execute(switch_core_session_t *session)
{ {
switch_channel_t *channel = switch_core_session_get_channel(session); switch_channel_t *channel = switch_core_session_get_channel(session);
switch_core_session_t *other_session; switch_core_session_t *other_session;
@ -459,10 +459,10 @@ static switch_status_t uuid_bridge_on_transmit(switch_core_session_t *session)
} }
if (switch_channel_get_state(other_channel) == CS_RESET) { if (switch_channel_get_state(other_channel) == CS_RESET) {
switch_channel_set_state(other_channel, CS_TRANSMIT); switch_channel_set_state(other_channel, CS_SOFT_EXECUTE);
} }
switch_channel_wait_for_state(channel, other_channel, CS_TRANSMIT); switch_channel_wait_for_state(channel, other_channel, CS_SOFT_EXECUTE);
switch_channel_clear_flag(channel, CF_TRANSFER); switch_channel_clear_flag(channel, CF_TRANSFER);
switch_channel_clear_flag(other_channel, CF_TRANSFER); switch_channel_clear_flag(other_channel, CF_TRANSFER);
@ -512,12 +512,12 @@ static switch_status_t uuid_bridge_on_transmit(switch_core_session_t *session)
static const switch_state_handler_table_t uuid_bridge_state_handlers = { static const switch_state_handler_table_t uuid_bridge_state_handlers = {
/*.on_init */ NULL, /*.on_init */ NULL,
/*.on_ring */ NULL, /*.on_routing */ NULL,
/*.on_execute */ NULL, /*.on_execute */ NULL,
/*.on_hangup */ NULL, /*.on_hangup */ NULL,
/*.on_loopback */ NULL, /*.on_exchange_media */ NULL,
/*.on_transmit */ uuid_bridge_on_transmit, /*.on_soft_execute */ uuid_bridge_on_soft_execute,
/*.on_hold */ NULL, /*.on_consume_media */ NULL,
/*.on_hibernate*/ NULL, /*.on_hibernate*/ NULL,
/*.on_reset*/ uuid_bridge_on_reset /*.on_reset*/ uuid_bridge_on_reset
}; };
@ -572,12 +572,12 @@ static switch_status_t signal_bridge_on_hangup(switch_core_session_t *session)
static const switch_state_handler_table_t signal_bridge_state_handlers = { static const switch_state_handler_table_t signal_bridge_state_handlers = {
/*.on_init */ NULL, /*.on_init */ NULL,
/*.on_ring */ NULL, /*.on_routing */ NULL,
/*.on_execute */ NULL, /*.on_execute */ NULL,
/*.on_hangup */ signal_bridge_on_hangup, /*.on_hangup */ signal_bridge_on_hangup,
/*.on_loopback */ NULL, /*.on_exchange_media */ NULL,
/*.on_transmit */ NULL, /*.on_soft_execute */ NULL,
/*.on_hold */ NULL, /*.on_consume_media */ NULL,
/*.on_hibernate */ signal_bridge_on_hibernate /*.on_hibernate */ signal_bridge_on_hibernate
}; };
@ -681,7 +681,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
const switch_application_interface_t *application_interface; const switch_application_interface_t *application_interface;
const char *app, *data; const char *app, *data;
switch_channel_set_state(peer_channel, CS_HOLD); switch_channel_set_state(peer_channel, CS_CONSUME_MEDIA);
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_BRIDGE) == SWITCH_STATUS_SUCCESS) { if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_BRIDGE) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(caller_channel, event); switch_channel_event_set_data(caller_channel, event);
@ -697,7 +697,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
if ((status = switch_ivr_wait_for_answer(session, peer_session)) != SWITCH_STATUS_SUCCESS) { if ((status = switch_ivr_wait_for_answer(session, peer_session)) != SWITCH_STATUS_SUCCESS) {
switch_channel_state_t w_state = switch_channel_get_state(caller_channel); switch_channel_state_t w_state = switch_channel_get_state(caller_channel);
switch_channel_hangup(peer_channel, SWITCH_CAUSE_ALLOTTED_TIMEOUT); switch_channel_hangup(peer_channel, SWITCH_CAUSE_ALLOTTED_TIMEOUT);
if (w_state < CS_HANGUP && w_state != CS_RING && w_state != CS_PARK && !switch_channel_test_flag(caller_channel, CF_TRANSFER) && if (w_state < CS_HANGUP && w_state != CS_ROUTING && w_state != CS_PARK && !switch_channel_test_flag(caller_channel, CF_TRANSFER) &&
w_state != CS_EXECUTE) { w_state != CS_EXECUTE) {
const char *ext = switch_channel_get_variable(peer_channel, "original_destination_number"); const char *ext = switch_channel_get_variable(peer_channel, "original_destination_number");
if (!ext) { if (!ext) {
@ -757,17 +757,17 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
} }
switch_channel_set_private(peer_channel, "_bridge_", b_leg); switch_channel_set_private(peer_channel, "_bridge_", b_leg);
switch_channel_set_state(peer_channel, CS_LOOPBACK); switch_channel_set_state(peer_channel, CS_EXCHANGE_MEDIA);
audio_bridge_thread(NULL, (void *) a_leg); audio_bridge_thread(NULL, (void *) a_leg);
switch_channel_clear_flag(caller_channel, CF_ORIGINATOR); switch_channel_clear_flag(caller_channel, CF_ORIGINATOR);
//make sure this doesnt break anything //make sure this doesnt break anything
if (!switch_channel_test_flag(peer_channel, CF_TRANSFER) && switch_channel_get_state(peer_channel) == CS_LOOPBACK) { if (!switch_channel_test_flag(peer_channel, CF_TRANSFER) && switch_channel_get_state(peer_channel) == CS_EXCHANGE_MEDIA) {
switch_channel_set_state(peer_channel, CS_RESET); switch_channel_set_state(peer_channel, CS_RESET);
} }
while (switch_channel_get_state(peer_channel) == CS_LOOPBACK) { while (switch_channel_get_state(peer_channel) == CS_EXCHANGE_MEDIA) {
switch_yield(1000); switch_yield(1000);
} }
@ -800,7 +800,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
state = switch_channel_get_state(caller_channel); state = switch_channel_get_state(caller_channel);
if (!switch_channel_test_flag(caller_channel, CF_TRANSFER)) { if (!switch_channel_test_flag(caller_channel, CF_TRANSFER)) {
if ((state != CS_EXECUTE && state != CS_PARK && state != CS_RING) || if ((state != CS_EXECUTE && state != CS_PARK && state != CS_ROUTING) ||
(switch_channel_test_flag(peer_channel, CF_ANSWERED) && state < CS_HANGUP && (switch_channel_test_flag(peer_channel, CF_ANSWERED) && state < CS_HANGUP &&
switch_true(switch_channel_get_variable(caller_channel, SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE)))) { switch_true(switch_channel_get_variable(caller_channel, SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE)))) {
switch_channel_hangup(caller_channel, switch_channel_get_cause(peer_channel)); switch_channel_hangup(caller_channel, switch_channel_get_cause(peer_channel));
@ -849,7 +849,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(const char *originator_uu
/* override transmit state for originator_channel to bridge to originatee_channel /* override transmit state for originator_channel to bridge to originatee_channel
* install pointer to originatee_session into originator_channel * install pointer to originatee_session into originator_channel
* set CF_TRANSFER on both channels and change state to CS_TRANSMIT to * set CF_TRANSFER on both channels and change state to CS_SOFT_EXECUTE to
* inturrupt anything they are already doing. * inturrupt anything they are already doing.
* originatee_session will fall asleep and originator_session will bridge to it * originatee_session will fall asleep and originator_session will bridge to it
*/ */

View File

@ -34,11 +34,11 @@
static const switch_state_handler_table_t originate_state_handlers; static const switch_state_handler_table_t originate_state_handlers;
static switch_status_t originate_on_hold_transmit(switch_core_session_t *session) static switch_status_t originate_on_consume_media_transmit(switch_core_session_t *session)
{ {
switch_channel_t *channel = switch_core_session_get_channel(session); switch_channel_t *channel = switch_core_session_get_channel(session);
while(switch_channel_get_state(channel) == CS_HOLD) { while(switch_channel_get_state(channel) == CS_CONSUME_MEDIA) {
switch_ivr_sleep(session, 10); switch_ivr_sleep(session, 10);
} }
@ -47,24 +47,24 @@ static switch_status_t originate_on_hold_transmit(switch_core_session_t *session
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
static switch_status_t originate_on_ring(switch_core_session_t *session) static switch_status_t originate_on_routing(switch_core_session_t *session)
{ {
switch_channel_t *channel = switch_core_session_get_channel(session); switch_channel_t *channel = switch_core_session_get_channel(session);
/* put the channel in a passive state until it is answered */ /* put the channel in a passive state until it is answered */
switch_channel_set_state(channel, CS_HOLD); switch_channel_set_state(channel, CS_CONSUME_MEDIA);
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
static const switch_state_handler_table_t originate_state_handlers = { static const switch_state_handler_table_t originate_state_handlers = {
/*.on_init */ NULL, /*.on_init */ NULL,
/*.on_ring */ originate_on_ring, /*.on_routing */ originate_on_routing,
/*.on_execute */ NULL, /*.on_execute */ NULL,
/*.on_hangup */ NULL, /*.on_hangup */ NULL,
/*.on_loopback */ NULL, /*.on_exchange_media */ NULL,
/*.on_transmit */ originate_on_hold_transmit, /*.on_soft_execute */ originate_on_consume_media_transmit,
/*.on_hold */ originate_on_hold_transmit /*.on_consume_media */ originate_on_consume_media_transmit
}; };
typedef enum { typedef enum {
@ -113,7 +113,7 @@ static void *SWITCH_THREAD_FUNC collect_thread_run(switch_thread_t * thread, voi
goto wbreak; goto wbreak;
} }
switch_channel_set_state(channel, CS_TRANSMIT); switch_channel_set_state(channel, CS_SOFT_EXECUTE);
switch_core_session_exec(collect->session, application_interface, app_data); switch_core_session_exec(collect->session, application_interface, app_data);
if (switch_channel_get_state(channel) < CS_HANGUP) { if (switch_channel_get_state(channel) < CS_HANGUP) {
@ -884,7 +884,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
if (!switch_core_session_running(peer_sessions[i])) { if (!switch_core_session_running(peer_sessions[i])) {
//if (!(flags & SOF_NOBLOCK)) { //if (!(flags & SOF_NOBLOCK)) {
//switch_channel_set_state(peer_channels[i], CS_RING); //switch_channel_set_state(peer_channels[i], CS_ROUTING);
//} //}
//} else { //} else {
switch_core_session_thread_launch(peer_sessions[i]); switch_core_session_thread_launch(peer_sessions[i]);
@ -910,7 +910,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
continue; continue;
} }
if (state >= CS_RING) { if (state >= CS_ROUTING) {
goto endfor1; goto endfor1;
} }