mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-17 09:12:25 +00:00
MODENDP-302
This commit is contained in:
parent
70d73cafb7
commit
9e152e0f74
@ -181,6 +181,17 @@ SWITCH_STANDARD_API(pa_cmd);
|
|||||||
static switch_status_t channel_on_init(switch_core_session_t *session)
|
static switch_status_t channel_on_init(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);
|
||||||
|
|
||||||
|
/* Move channel's state machine to ROUTING */
|
||||||
|
switch_channel_set_state(channel, CS_ROUTING);
|
||||||
|
|
||||||
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static switch_status_t channel_on_routing(switch_core_session_t *session)
|
||||||
|
{
|
||||||
|
|
||||||
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
private_t *tech_pvt = switch_core_session_get_private(session);
|
private_t *tech_pvt = switch_core_session_get_private(session);
|
||||||
switch_time_t last;
|
switch_time_t last;
|
||||||
int waitsec = globals.ring_interval * 1000000;
|
int waitsec = globals.ring_interval * 1000000;
|
||||||
@ -201,12 +212,8 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
|
|||||||
if (hold_file) {
|
if (hold_file) {
|
||||||
tech_pvt->hold_file = switch_core_session_strdup(session, hold_file);
|
tech_pvt->hold_file = switch_core_session_strdup(session, hold_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
|
if (switch_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
|
||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s CHANNEL INIT %d %d\n",
|
|
||||||
switch_channel_get_name(channel), switch_channel_get_state(channel), switch_test_flag(tech_pvt, TFLAG_ANSWER));
|
|
||||||
|
|
||||||
if (engage_device(0) != SWITCH_STATUS_SUCCESS) {
|
if (engage_device(0) != SWITCH_STATUS_SUCCESS) {
|
||||||
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
@ -309,14 +316,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 ROUTING */
|
|
||||||
switch_channel_set_state(channel, CS_ROUTING);
|
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static switch_status_t channel_on_routing(switch_core_session_t *session)
|
|
||||||
{
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s CHANNEL ROUTING\n",
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s CHANNEL ROUTING\n",
|
||||||
switch_channel_get_name(switch_core_session_get_channel(session)));
|
switch_channel_get_name(switch_core_session_get_channel(session)));
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user