mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 13:12:03 +00:00
fix issue in monitor_early_media_fail issue
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12271 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -1532,7 +1532,7 @@ SWITCH_STANDARD_APP(att_xfer_function)
|
||||
switch_channel_clear_flag(peer_channel, CF_INNER_BRIDGE);
|
||||
switch_channel_clear_flag(channel, CF_INNER_BRIDGE);
|
||||
|
||||
if (!switch_channel_get_state(peer_channel) >= CS_HANGUP) {
|
||||
if (!switch_channel_down(peer_channel)) {
|
||||
switch_core_session_rwunlock(peer_session);
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -1091,7 +1091,7 @@ static switch_status_t negotiate_media(switch_core_session_t *session)
|
||||
now = switch_micro_time_now();
|
||||
elapsed = (unsigned int) ((now - started) / 1000);
|
||||
|
||||
if (switch_channel_get_state(channel) >= CS_HANGUP || switch_test_flag(tech_pvt, TFLAG_BYE)) {
|
||||
if (switch_channel_down(channel) || switch_test_flag(tech_pvt, TFLAG_BYE)) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -1119,7 +1119,7 @@ static switch_status_t negotiate_media(switch_core_session_t *session)
|
||||
switch_cond_next();
|
||||
}
|
||||
|
||||
if (switch_channel_get_state(channel) >= CS_HANGUP || switch_test_flag(tech_pvt, TFLAG_BYE)) {
|
||||
if (switch_channel_down(channel) || switch_test_flag(tech_pvt, TFLAG_BYE)) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -2542,7 +2542,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "using Existing session for %s\n", ldl_session_get_id(dlsession));
|
||||
|
||||
if (switch_channel_get_state(channel) >= CS_HANGUP) {
|
||||
if (switch_channel_down(channel)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Call %s is already over\n", switch_channel_get_name(channel));
|
||||
status = LDL_STATUS_FALSE;
|
||||
goto done;
|
||||
|
||||
@@ -1081,7 +1081,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_iax_runtime)
|
||||
break;
|
||||
case IAX_EVENT_VOICE:
|
||||
if (tech_pvt && (tech_pvt->read_frame.datalen = iaxevent->datalen) != 0) {
|
||||
if (channel && switch_channel_get_state(channel) <= CS_HANGUP) {
|
||||
if (channel && switch_channel_up(channel)) {
|
||||
int bytes = 0, frames = 1;
|
||||
|
||||
if (!switch_test_flag(tech_pvt, TFLAG_CODEC) || !tech_pvt->read_codec.implementation) {
|
||||
|
||||
@@ -959,7 +959,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
||||
private_object_t *tech_pvt = switch_core_session_get_private(session);
|
||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
|
||||
if (switch_channel_get_state(channel) >= CS_HANGUP || !tech_pvt) {
|
||||
if (switch_channel_down(channel) || !tech_pvt) {
|
||||
status = SWITCH_STATUS_FALSE;
|
||||
goto end;
|
||||
}
|
||||
@@ -997,7 +997,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
||||
/* ones that do need to lock sofia mutex */
|
||||
switch_mutex_lock(tech_pvt->sofia_mutex);
|
||||
|
||||
if (switch_channel_get_state(channel) >= CS_HANGUP || !tech_pvt) {
|
||||
if (switch_channel_down(channel) || !tech_pvt) {
|
||||
status = SWITCH_STATUS_FALSE;
|
||||
goto end_lock;
|
||||
}
|
||||
|
||||
@@ -364,7 +364,7 @@ void sofia_event_callback(nua_event_t event,
|
||||
}
|
||||
|
||||
if (session) {
|
||||
if (channel && switch_channel_get_state(channel) >= CS_HANGUP) {
|
||||
if (channel && switch_channel_down(channel)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel is already hungup.\n");
|
||||
goto done;
|
||||
}
|
||||
@@ -3325,7 +3325,7 @@ void *SWITCH_THREAD_FUNC nightmare_xfer_thread_run(switch_thread_t *thread, void
|
||||
|
||||
status = switch_ivr_originate(a_session, &tsession, &cause, nhelper->exten, timeout, NULL, NULL, NULL, NULL, NULL, SOF_NONE);
|
||||
|
||||
if ((switch_channel_get_state(channel_a) < CS_HANGUP)) {
|
||||
if ((switch_channel_up(channel_a))) {
|
||||
|
||||
if (status != SWITCH_STATUS_SUCCESS || cause != SWITCH_CAUSE_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot Create Outgoing Channel! [%s]\n", nhelper->exten);
|
||||
|
||||
@@ -1234,7 +1234,7 @@ SWITCH_STANDARD_APP(erlang_outbound_function)
|
||||
switch_ivr_park(session, NULL);
|
||||
|
||||
/* keep app thread running for lifetime of session */
|
||||
if (switch_channel_get_state(switch_core_session_get_channel(session)) >= CS_HANGUP) {
|
||||
if (switch_channel_down(switch_core_session_get_channel(session))) {
|
||||
while (switch_test_flag(session_element, LFLAG_SESSION_ALIVE)) {
|
||||
switch_yield(100000);
|
||||
}
|
||||
|
||||
@@ -430,7 +430,7 @@ SWITCH_STANDARD_APP(socket_function)
|
||||
listener_run(NULL, (void *) listener);
|
||||
}
|
||||
|
||||
if (switch_channel_get_state(channel) >= CS_HANGUP) {
|
||||
if (switch_channel_down(channel)) {
|
||||
while (switch_test_flag(listener, LFLAG_SESSION)) {
|
||||
switch_yield(100000);
|
||||
}
|
||||
@@ -1192,7 +1192,7 @@ static switch_status_t read_packet(listener_t *listener, switch_event_t **event,
|
||||
}
|
||||
}
|
||||
|
||||
if (channel && switch_channel_get_state(channel) >= CS_HANGUP && !switch_test_flag(listener, LFLAG_HANDLE_DISCO)) {
|
||||
if (channel && switch_channel_down(channel) && !switch_test_flag(listener, LFLAG_HANDLE_DISCO)) {
|
||||
switch_set_flag_locked(listener, LFLAG_HANDLE_DISCO);
|
||||
if (switch_test_flag(listener, LFLAG_LINGER)) {
|
||||
char message[128] = "";
|
||||
|
||||
@@ -2152,7 +2152,7 @@ static JSBool session_wait_for_media(JSContext * cx, JSObject * obj, uintN argc,
|
||||
saveDepth = JS_SuspendRequest(cx);
|
||||
for (;;) {
|
||||
if (((elapsed = (unsigned int) ((switch_micro_time_now() - started) / 1000)) > (switch_time_t) timeout)
|
||||
|| switch_channel_get_state(channel) >= CS_HANGUP) {
|
||||
|| switch_channel_down(channel)) {
|
||||
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
|
||||
break;
|
||||
}
|
||||
@@ -2200,7 +2200,7 @@ static JSBool session_wait_for_answer(JSContext * cx, JSObject * obj, uintN argc
|
||||
saveDepth = JS_SuspendRequest(cx);
|
||||
for (;;) {
|
||||
if (((elapsed = (unsigned int) ((switch_micro_time_now() - started) / 1000)) > (switch_time_t) timeout)
|
||||
|| switch_channel_get_state(channel) >= CS_HANGUP) {
|
||||
|| switch_channel_down(channel)) {
|
||||
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user