if (call_info) {
char *call_info_state = "active";
- if (!switch_channel_up(channel)) {
+ if (!switch_channel_up_nosig(channel)) {
call_info_state = "idle";
} else if (!strcasecmp(status, "hold-private")) {
call_info_state = "held-private";
for (;;) {
if ((channel->state == channel->running_state && channel->running_state == want_state) ||
- (other_channel && switch_channel_down(other_channel)) || switch_channel_down(channel)) {
+ (other_channel && switch_channel_down_nosig(other_channel)) || switch_channel_down_nosig(channel)) {
break;
}
switch_yield(20000);
return SWITCH_STATUS_FALSE;
}
- if (switch_channel_down(channel)) {
+ if (switch_channel_down_nosig(channel)) {
return SWITCH_STATUS_FALSE;
}
SWITCH_DECLARE(int) switch_channel_state_change_pending(switch_channel_t *channel)
{
- if (switch_channel_down(channel) || !switch_core_session_in_thread(channel->session)) {
+ if (switch_channel_down_nosig(channel) || !switch_core_session_in_thread(channel->session)) {
return 0;
}
switch_io_event_hook_video_write_frame_t *ptr;
switch_status_t status = SWITCH_STATUS_FALSE;
- if (switch_channel_down(session->channel)) {
+ if (switch_channel_down_nosig(session->channel)) {
return SWITCH_STATUS_FALSE;
}
switch_assert(session != NULL);
- if (switch_channel_down(session->channel)) {
+ if (switch_channel_down_nosig(session->channel)) {
return SWITCH_STATUS_FALSE;
}
}
}
- if (switch_channel_down(session->channel) || !switch_core_codec_ready(session->read_codec)) {
+ if (switch_channel_down_nosig(session->channel) || !switch_core_codec_ready(session->read_codec)) {
*frame = NULL;
status = SWITCH_STATUS_FALSE;
goto even_more_done;
while (switch_buffer_inuse(session->raw_write_buffer) >= session->write_impl.decoded_bytes_per_packet) {
int rate;
- if (switch_channel_down(session->channel) || !session->raw_write_buffer) {
+ if (switch_channel_down_nosig(session->channel) || !session->raw_write_buffer) {
goto error;
}
if ((session->raw_write_frame.datalen = (uint32_t)
switch_dtmf_t new_dtmf;
int fed = 0;
- if (switch_channel_down(session->channel)) {
+ if (switch_channel_down_nosig(session->channel)) {
return SWITCH_STATUS_FALSE;
}
switch_status_t status = SWITCH_STATUS_FALSE;
switch_dtmf_t new_dtmf;
- if (switch_channel_down(session->channel)) {
+ if (switch_channel_down_nosig(session->channel)) {
return SWITCH_STATUS_FALSE;
}
dtmf.flags = 0;
}
- if (switch_channel_down(session->channel)) {
+ if (switch_channel_down_nosig(session->channel)) {
return SWITCH_STATUS_FALSE;
}
switch_status_t status = SWITCH_STATUS_FALSE;
if (session->rwlock) {
- if (switch_test_flag(session, SSF_DESTROYED) || switch_channel_down(session->channel)) {
+ if (switch_test_flag(session, SSF_DESTROYED) || switch_channel_down_nosig(session->channel)) {
status = SWITCH_STATUS_FALSE;
if (switch_thread_rwlock_tryrdlock(session->rwlock) == SWITCH_STATUS_SUCCESS) {
if (switch_channel_test_flag(session->channel, CF_THREAD_SLEEPING)) {
for(np = head; np; np = np->next) {
if ((session = switch_core_session_locate(np->str))) {
const char *this_val;
- if (switch_channel_up(session->channel) &&
+ if (switch_channel_up_nosig(session->channel) &&
(this_val = switch_channel_get_variable(session->channel, var_name)) && (!strcmp(this_val, var_val))) {
switch_channel_hangup(session->channel, cause);
}
if ((session = switch_core_hash_find(session_manager.session_table, uuid_str)) != 0) {
/* Acquire a read lock on the session or forget it the channel is dead */
if (switch_core_session_read_lock(session) == SWITCH_STATUS_SUCCESS) {
- if (switch_channel_up(session->channel)) {
+ if (switch_channel_up_nosig(session->channel)) {
status = switch_core_session_receive_message(session, message);
}
switch_core_session_rwunlock(session);
if ((session = switch_core_hash_find(session_manager.session_table, uuid_str)) != 0) {
/* Acquire a read lock on the session or forget it the channel is dead */
if (switch_core_session_read_lock(session) == SWITCH_STATUS_SUCCESS) {
- if (switch_channel_up(session->channel)) {
+ if (switch_channel_up_nosig(session->channel)) {
status = switch_core_session_queue_event(session, event);
}
switch_core_session_rwunlock(session);
goto end;
}
- if (switch_channel_down(session->channel) && message->message_id != SWITCH_MESSAGE_INDICATE_SIGNAL_DATA) {
+ if (switch_channel_down_nosig(session->channel) && message->message_id != SWITCH_MESSAGE_INDICATE_SIGNAL_DATA) {
switch_log_printf(SWITCH_CHANNEL_ID_LOG, message->_file, message->_func, message->_line,
switch_core_session_get_uuid(session), SWITCH_LOG_DEBUG, "%s skip receive message [%s] (channel is hungup already)\n",
switch_channel_get_name(session->channel), message_names[message->message_id]);
message->_func = NULL;
message->_line = 0;
- if (switch_channel_up(session->channel)) {
+ if (switch_channel_up_nosig(session->channel)) {
switch (message->message_id) {
case SWITCH_MESSAGE_REDIRECT_AUDIO:
case SWITCH_MESSAGE_INDICATE_ANSWER:
/* Acquire a read lock on the session or forget it the channel is dead */
if (switch_core_session_read_lock(session) == SWITCH_STATUS_SUCCESS) {
- if (switch_channel_up(session->channel)) {
+ if (switch_channel_up_nosig(session->channel)) {
if (session->endpoint_interface->io_routines->receive_event) {
status = session->endpoint_interface->io_routines->receive_event(session, *event);
}
switch_application_interface_t *application_interface;
switch_status_t status = SWITCH_STATUS_SUCCESS;
- if (switch_channel_down(session->channel)) {
+ if (switch_channel_down_nosig(session->channel)) {
char *p;
if (!arg && (p = strstr(app, "::"))) {
*p++ = '0';
msg.message_id = SWITCH_MESSAGE_INDICATE_DISPLAY;
switch_core_session_receive_message(session, &msg);
- while (switch_channel_up(tchannel) && switch_channel_ready(channel)) {
+ while (switch_channel_up_nosig(tchannel) && switch_channel_ready(channel)) {
uint32_t len = sizeof(buf);
switch_event_t *event = NULL;
char *fcommand = NULL;
sth->ready = 1;
- while (switch_channel_up(channel) && !switch_test_flag(sth->ah, SWITCH_ASR_FLAG_CLOSED)) {
+ while (switch_channel_up_nosig(channel) && !switch_test_flag(sth->ah, SWITCH_ASR_FLAG_CLOSED)) {
char *xmlstr = NULL;
switch_thread_cond_wait(sth->cond, sth->mutex);
- if (switch_channel_down(channel) || switch_test_flag(sth->ah, SWITCH_ASR_FLAG_CLOSED)) {
+ if (switch_channel_down_nosig(channel) || switch_test_flag(sth->ah, SWITCH_ASR_FLAG_CLOSED)) {
break;
}
goto end_of_bridge_loop;
}
- if ((b_state = switch_channel_down(chan_b))) {
+ if ((b_state = switch_channel_down_nosig(chan_b))) {
goto end_of_bridge_loop;
}
switch_safe_free(stream.data);
}
- if (!inner_bridge && switch_channel_up(chan_a)) {
+ if (!inner_bridge && switch_channel_up_nosig(chan_a)) {
if ((app_name = switch_channel_get_variable(chan_a, SWITCH_EXEC_AFTER_BRIDGE_APP_VARIABLE))) {
switch_caller_extension_t *extension = NULL;
if ((extension = switch_caller_extension_new(session_a, app_name, app_name)) == 0) {
switch_channel_set_variable(other_channel, SWITCH_BRIDGE_VARIABLE, NULL);
switch_channel_set_variable(other_channel, "call_uuid", switch_core_session_get_uuid(other_session));
- if (switch_channel_up(other_channel)) {
+ if (switch_channel_up_nosig(other_channel)) {
if (switch_true(switch_channel_get_variable(other_channel, SWITCH_PARK_AFTER_BRIDGE_VARIABLE))) {
switch_ivr_park_session(other_session);
switch_channel_t *peer_channel = switch_core_session_get_channel(peer_session);
switch_event_t *event;
- if (switch_channel_down(peer_channel)) {
+ if (switch_channel_down_nosig(peer_channel)) {
switch_channel_hangup(caller_channel, switch_channel_get_cause(peer_channel));
return SWITCH_STATUS_FALSE;
}
- if (!switch_channel_up(caller_channel)) {
+ if (!switch_channel_up_nosig(caller_channel)) {
switch_channel_hangup(peer_channel, SWITCH_CAUSE_ORIGINATOR_CANCEL);
return SWITCH_STATUS_FALSE;
}
switch_channel_set_variable(caller_channel, SWITCH_BRIDGE_HANGUP_CAUSE_VARIABLE, switch_channel_cause2str(cause));
}
- if (switch_channel_down(peer_channel) && switch_true(switch_channel_get_variable(peer_channel, SWITCH_COPY_XML_CDR_VARIABLE))) {
+ if (switch_channel_down_nosig(peer_channel) && switch_true(switch_channel_get_variable(peer_channel, SWITCH_COPY_XML_CDR_VARIABLE))) {
switch_xml_t cdr = NULL;
char *xml_text;
}
- if (switch_channel_down(originator_channel)) {
+ if (switch_channel_down_nosig(originator_channel)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s is hungup refusing to bridge.\n", switch_channel_get_name(originatee_channel));
switch_core_session_rwunlock(originator_session);
switch_core_session_rwunlock(originatee_session);
switch_core_session_exec(collect->session, application_interface, app_data);
- if (switch_channel_up(channel)) {
+ if (switch_channel_up_nosig(channel)) {
switch_channel_set_flag(channel, CF_WINNER);
}
goto wbreak;
}
- if (!switch_channel_up(channel)) {
+ if (!switch_channel_up_nosig(channel)) {
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
goto wbreak;
}
}
}
- if (originate_status[i].peer_channel && switch_channel_up(originate_status[i].peer_channel)) {
+ if (originate_status[i].peer_channel && switch_channel_up_nosig(originate_status[i].peer_channel)) {
if (originate_status[i].per_channel_progress_timelimit_sec && elapsed > originate_status[i].per_channel_progress_timelimit_sec &&
!(switch_channel_test_flag(originate_status[i].peer_channel, CF_RING_READY) ||
switch_channel_test_flag(originate_status[i].peer_channel, CF_ANSWERED) ||
switch_channel_t *channel = switch_core_session_get_channel(originate_status[i].peer_session);
uint32_t j;
- if (switch_channel_down(channel)) {
+ if (switch_channel_down_nosig(channel)) {
switch_call_cause_t cause = switch_channel_get_cause(channel);
for (j = 0; j < len; j++) {
end:
if (!switch_channel_media_ready(peer_channel)) {
- if (switch_channel_up(peer_channel)) {
+ if (switch_channel_up_nosig(peer_channel)) {
switch_channel_hangup(peer_channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
}
status = SWITCH_STATUS_FALSE;
}
}
- if (caller_channel && !switch_channel_up(caller_channel)) {
+ if (caller_channel && !switch_channel_up_nosig(caller_channel)) {
status = SWITCH_STATUS_FALSE;
}
}
pchannel = switch_core_session_get_channel(originate_status[i].peer_session);
- if (switch_channel_down(pchannel)) {
+ if (switch_channel_down_nosig(pchannel)) {
int neg, pos;
cause_str = switch_channel_cause2str(switch_channel_get_cause(pchannel));
neg = *fail_on_single_reject_var == '!';
if (!peer_eligible(originate_status[i].peer_channel)) {
continue;
}
- if (switch_channel_up(originate_status[i].peer_channel)) {
+ if (switch_channel_up_nosig(originate_status[i].peer_channel)) {
peer_session = originate_status[i].peer_session;
peer_channel = originate_status[i].peer_channel;
originate_status[i].peer_channel = NULL;
end_search:
- if (peer_channel && switch_channel_down(peer_channel)) {
+ if (peer_channel && switch_channel_down_nosig(peer_channel)) {
switch_core_session_rwunlock(peer_session);
peer_session = NULL;
peer_channel = NULL;
switch_ivr_uuid_bridge(holding, switch_core_session_get_uuid(peer_session));
holding = NULL;
oglobals.idx = IDX_NADA;
- if (caller_channel && switch_channel_up(caller_channel)) {
+ if (caller_channel && switch_channel_up_nosig(caller_channel)) {
switch_channel_hangup(caller_channel, SWITCH_CAUSE_ATTENDED_TRANSFER);
}
caller_channel = NULL;
reason = SWITCH_CAUSE_LOSE_RACE;
} else if (!switch_channel_ready(originate_status[i].peer_channel)) {
wait_for_cause(originate_status[i].peer_channel);
- if (switch_channel_down(originate_status[i].peer_channel)) {
+ if (switch_channel_down_nosig(originate_status[i].peer_channel)) {
reason = switch_channel_get_cause(originate_status[i].peer_channel);
}
} else {
}
}
}
- if (switch_channel_up(originate_status[i].peer_channel)) {
+ if (switch_channel_up_nosig(originate_status[i].peer_channel)) {
if (caller_channel && i == 0) {
holding = switch_channel_get_variable(caller_channel, SWITCH_SOFT_HOLDING_UUID_VARIABLE);
switch_channel_set_variable(caller_channel, SWITCH_SOFT_HOLDING_UUID_VARIABLE, NULL);
wait_for_cause(originate_status[i].peer_channel);
- if (switch_channel_down(originate_status[i].peer_channel)) {
+ if (switch_channel_down_nosig(originate_status[i].peer_channel)) {
*cause = switch_channel_get_cause(originate_status[i].peer_channel);
break;
}
pchannel = switch_core_session_get_channel(originate_status[i].peer_session);
wait_for_cause(pchannel);
- if (switch_channel_down(pchannel)) {
+ if (switch_channel_down_nosig(pchannel)) {
int neg, pos;
cause_str = switch_channel_cause2str(switch_channel_get_cause(pchannel));