mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-31 02:43:32 +00:00
fix no_media mode
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4192 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
3b6d163b73
commit
59d4d0b071
@ -83,7 +83,6 @@ static void audio_bridge_function(switch_core_session_t *session, char *data)
|
|||||||
if (no_media_bridge) {
|
if (no_media_bridge) {
|
||||||
switch_channel_t *peer_channel = switch_core_session_get_channel(peer_session);
|
switch_channel_t *peer_channel = switch_core_session_get_channel(peer_session);
|
||||||
switch_frame_t *read_frame;
|
switch_frame_t *read_frame;
|
||||||
|
|
||||||
/* SIP won't let us redir media until the call has been answered #$^#%& so we will proxy any early media until they do */
|
/* SIP won't let us redir media until the call has been answered #$^#%& so we will proxy any early media until they do */
|
||||||
while(switch_channel_ready(caller_channel) && switch_channel_ready(peer_channel) && !switch_channel_test_flag(peer_channel, CF_ANSWERED)) {
|
while(switch_channel_ready(caller_channel) && switch_channel_ready(peer_channel) && !switch_channel_test_flag(peer_channel, CF_ANSWERED)) {
|
||||||
switch_status_t status = switch_core_session_read_frame(peer_session, &read_frame, -1, 0);
|
switch_status_t status = switch_core_session_read_frame(peer_session, &read_frame, -1, 0);
|
||||||
@ -92,7 +91,6 @@ static void audio_bridge_function(switch_core_session_t *session, char *data)
|
|||||||
if (SWITCH_READ_ACCEPTABLE(status) && switch_core_session_write_frame(session, read_frame, -1, 0) == SWITCH_STATUS_SUCCESS) {
|
if (SWITCH_READ_ACCEPTABLE(status) && switch_core_session_write_frame(session, read_frame, -1, 0) == SWITCH_STATUS_SUCCESS) {
|
||||||
bad = 0;
|
bad = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bad) {
|
if (bad) {
|
||||||
switch_channel_hangup(caller_channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
switch_channel_hangup(caller_channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||||
switch_channel_hangup(peer_channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
switch_channel_hangup(peer_channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||||
|
@ -162,6 +162,15 @@ static void answer_function(switch_core_session_t *session, char *data)
|
|||||||
switch_channel_answer(channel);
|
switch_channel_answer(channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void pre_answer_function(switch_core_session_t *session, char *data)
|
||||||
|
{
|
||||||
|
switch_channel_t *channel;
|
||||||
|
channel = switch_core_session_get_channel(session);
|
||||||
|
|
||||||
|
assert(channel != NULL);
|
||||||
|
switch_channel_pre_answer(channel);
|
||||||
|
}
|
||||||
|
|
||||||
static void redirect_function(switch_core_session_t *session, char *data)
|
static void redirect_function(switch_core_session_t *session, char *data)
|
||||||
{
|
{
|
||||||
switch_core_session_message_t msg = {0};
|
switch_core_session_message_t msg = {0};
|
||||||
@ -595,13 +604,23 @@ static const switch_application_interface_t answer_application_interface = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const switch_application_interface_t pre_answer_application_interface = {
|
||||||
|
/*.interface_name */ "pre_answer",
|
||||||
|
/*.application_function */ pre_answer_function,
|
||||||
|
/* long_desc */ "Pre-Answer the call for a channel.",
|
||||||
|
/* short_desc */ "Pre-Answer the call",
|
||||||
|
/* syntax */ "",
|
||||||
|
/*.next */ &hangup_application_interface
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
static const switch_application_interface_t eval_application_interface = {
|
static const switch_application_interface_t eval_application_interface = {
|
||||||
/*.interface_name */ "eval",
|
/*.interface_name */ "eval",
|
||||||
/*.application_function */ eval_function,
|
/*.application_function */ eval_function,
|
||||||
/* long_desc */ "Do Nothing",
|
/* long_desc */ "Do Nothing",
|
||||||
/* short_desc */ "Do Nothing",
|
/* short_desc */ "Do Nothing",
|
||||||
/* syntax */ "",
|
/* syntax */ "",
|
||||||
/*.next */ &answer_application_interface
|
/*.next */ &pre_answer_application_interface
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1604,47 +1604,47 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
|
|||||||
tech_pvt = (private_object_t *) switch_core_session_get_private(session);
|
tech_pvt = (private_object_t *) switch_core_session_get_private(session);
|
||||||
assert(tech_pvt != NULL);
|
assert(tech_pvt != NULL);
|
||||||
|
|
||||||
|
|
||||||
if (switch_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION)) {
|
|
||||||
char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
|
|
||||||
if (tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) {
|
|
||||||
switch_channel_set_variable(channel, "endpoint_disposition", "CODEC NEGOTIATION ERROR");
|
|
||||||
nua_respond(tech_pvt->nh, SIP_488_NOT_ACCEPTABLE, TAG_END());
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
switch_clear_flag_locked(tech_pvt, TFLAG_LATE_NEGOTIATION);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (switch_channel_test_flag(channel, CF_NOMEDIA)) {
|
|
||||||
switch_set_flag_locked(tech_pvt, TFLAG_NOMEDIA);
|
|
||||||
tech_absorb_sdp(tech_pvt);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!switch_test_flag(tech_pvt, TFLAG_ANS) && !switch_channel_test_flag(channel, CF_OUTBOUND)) {
|
if (!switch_test_flag(tech_pvt, TFLAG_ANS) && !switch_channel_test_flag(channel, CF_OUTBOUND)) {
|
||||||
switch_set_flag_locked(tech_pvt, TFLAG_ANS);
|
switch_set_flag_locked(tech_pvt, TFLAG_ANS);
|
||||||
|
|
||||||
|
if (switch_channel_test_flag(channel, CF_NOMEDIA)) {
|
||||||
if ((status = tech_choose_port(tech_pvt)) != SWITCH_STATUS_SUCCESS) {
|
char *sdp = NULL;
|
||||||
return status;
|
switch_set_flag_locked(tech_pvt, TFLAG_NOMEDIA);
|
||||||
}
|
if ((sdp = switch_channel_get_variable(channel, SWITCH_B_SDP_VARIABLE))) {
|
||||||
|
tech_pvt->local_sdp_str = switch_core_session_strdup(session, sdp);
|
||||||
set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
|
}
|
||||||
activate_rtp(tech_pvt);
|
} else {
|
||||||
|
if (switch_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION)) {
|
||||||
if (tech_pvt->nh) {
|
char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
|
||||||
if (tech_pvt->local_sdp_str) {
|
if (tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Local SDP %s:\n%s\n",
|
switch_channel_set_variable(channel, "endpoint_disposition", "CODEC NEGOTIATION ERROR");
|
||||||
switch_channel_get_name(channel),
|
nua_respond(tech_pvt->nh, SIP_488_NOT_ACCEPTABLE, TAG_END());
|
||||||
tech_pvt->local_sdp_str);
|
return SWITCH_STATUS_FALSE;
|
||||||
|
}
|
||||||
|
switch_clear_flag_locked(tech_pvt, TFLAG_LATE_NEGOTIATION);
|
||||||
}
|
}
|
||||||
nua_respond(tech_pvt->nh, SIP_200_OK,
|
|
||||||
SIPTAG_CONTACT_STR(tech_pvt->profile->url),
|
|
||||||
SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
|
|
||||||
SOATAG_AUDIO_AUX("cn telephone-event"),
|
|
||||||
NUTAG_INCLUDE_EXTRA_SDP(1),
|
|
||||||
TAG_END());
|
|
||||||
|
|
||||||
|
if ((status = tech_choose_port(tech_pvt)) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
|
||||||
|
activate_rtp(tech_pvt);
|
||||||
|
|
||||||
|
if (tech_pvt->nh) {
|
||||||
|
if (tech_pvt->local_sdp_str) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Local SDP %s:\n%s\n",
|
||||||
|
switch_channel_get_name(channel),
|
||||||
|
tech_pvt->local_sdp_str);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
nua_respond(tech_pvt->nh, SIP_200_OK,
|
||||||
|
SIPTAG_CONTACT_STR(tech_pvt->profile->url),
|
||||||
|
SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
|
||||||
|
SOATAG_AUDIO_AUX("cn telephone-event"),
|
||||||
|
NUTAG_INCLUDE_EXTRA_SDP(1),
|
||||||
|
TAG_END());
|
||||||
}
|
}
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
@ -1842,7 +1842,9 @@ static switch_status_t sofia_kill_channel(switch_core_session_t *session, int si
|
|||||||
|
|
||||||
switch(sig) {
|
switch(sig) {
|
||||||
case SWITCH_SIG_BREAK:
|
case SWITCH_SIG_BREAK:
|
||||||
switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_BREAK);
|
if (switch_rtp_ready(tech_pvt->rtp_session)) {
|
||||||
|
switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_BREAK);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case SWITCH_SIG_KILL:
|
case SWITCH_SIG_KILL:
|
||||||
default:
|
default:
|
||||||
@ -2024,36 +2026,38 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
|||||||
tech_pvt = switch_core_session_get_private(session);
|
tech_pvt = switch_core_session_get_private(session);
|
||||||
assert(tech_pvt != NULL);
|
assert(tech_pvt != NULL);
|
||||||
|
|
||||||
|
if (!switch_test_flag(tech_pvt, TFLAG_ANS)) {
|
||||||
if (switch_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION)) {
|
|
||||||
char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
|
|
||||||
if (tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) {
|
|
||||||
switch_channel_set_variable(channel, "endpoint_disposition", "CODEC NEGOTIATION ERROR");
|
|
||||||
nua_respond(tech_pvt->nh, SIP_488_NOT_ACCEPTABLE, TAG_END());
|
|
||||||
return SWITCH_STATUS_FALSE;
|
|
||||||
}
|
|
||||||
switch_clear_flag_locked(tech_pvt, TFLAG_LATE_NEGOTIATION);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!switch_test_flag(tech_pvt, TFLAG_EARLY_MEDIA) && !switch_test_flag(tech_pvt, TFLAG_ANS)) {
|
|
||||||
switch_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA);
|
switch_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA);
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Asked to send early media by %s\n", msg->from);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Asked to send early media by %s\n", msg->from);
|
||||||
|
|
||||||
|
|
||||||
if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
|
|
||||||
tech_absorb_sdp(tech_pvt);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Transmit 183 Progress with SDP */
|
/* Transmit 183 Progress with SDP */
|
||||||
if ((status=tech_choose_port(tech_pvt)) != SWITCH_STATUS_SUCCESS) {
|
if (switch_channel_test_flag(channel, CF_NOMEDIA)) {
|
||||||
return status;
|
char *sdp = NULL;
|
||||||
}
|
switch_set_flag_locked(tech_pvt, TFLAG_NOMEDIA);
|
||||||
set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
|
if ((sdp = switch_channel_get_variable(channel, SWITCH_B_SDP_VARIABLE))) {
|
||||||
activate_rtp(tech_pvt);
|
tech_pvt->local_sdp_str = switch_core_session_strdup(session, sdp);
|
||||||
if (tech_pvt->local_sdp_str) {
|
}
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Ring SDP:\n%s\n", tech_pvt->local_sdp_str);
|
} else {
|
||||||
}
|
if (switch_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION)) {
|
||||||
|
char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
|
||||||
|
if (tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
switch_channel_set_variable(channel, "endpoint_disposition", "CODEC NEGOTIATION ERROR");
|
||||||
|
nua_respond(tech_pvt->nh, SIP_488_NOT_ACCEPTABLE, TAG_END());
|
||||||
|
return SWITCH_STATUS_FALSE;
|
||||||
|
}
|
||||||
|
switch_clear_flag_locked(tech_pvt, TFLAG_LATE_NEGOTIATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((status=tech_choose_port(tech_pvt)) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
|
||||||
|
activate_rtp(tech_pvt);
|
||||||
|
if (tech_pvt->local_sdp_str) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Ring SDP:\n%s\n", tech_pvt->local_sdp_str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
nua_respond(tech_pvt->nh,
|
nua_respond(tech_pvt->nh,
|
||||||
SIP_183_SESSION_PROGRESS,
|
SIP_183_SESSION_PROGRESS,
|
||||||
SIPTAG_CONTACT_STR(tech_pvt->profile->url),
|
SIPTAG_CONTACT_STR(tech_pvt->profile->url),
|
||||||
@ -2786,24 +2790,31 @@ static void sip_i_state(int status,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r_sdp) {
|
if (r_sdp) {
|
||||||
if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
|
if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
|
||||||
switch_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA);
|
switch_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA);
|
||||||
switch_channel_mark_pre_answered(channel);
|
switch_channel_mark_pre_answered(channel);
|
||||||
if ((uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
|
if ((uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
|
||||||
other_channel = switch_core_session_get_channel(other_session);
|
other_channel = switch_core_session_get_channel(other_session);
|
||||||
|
if (!switch_channel_get_variable(other_channel, SWITCH_B_SDP_VARIABLE)) {
|
||||||
|
switch_channel_set_variable(other_channel, SWITCH_B_SDP_VARIABLE, (char *)r_sdp);
|
||||||
|
}
|
||||||
|
|
||||||
switch_channel_pre_answer(other_channel);
|
switch_channel_pre_answer(other_channel);
|
||||||
switch_core_session_rwunlock(other_session);
|
switch_core_session_rwunlock(other_session);
|
||||||
}
|
}
|
||||||
goto done;
|
goto done;
|
||||||
} else if (!switch_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION)) {
|
} else {
|
||||||
if (tech_media(tech_pvt, (char *)r_sdp) != SWITCH_STATUS_SUCCESS) {
|
if (switch_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION)) {
|
||||||
switch_channel_set_variable(channel, "endpoint_disposition", "CODEC NEGOTIATION ERROR");
|
switch_channel_set_variable(channel, "endpoint_disposition", "DELAYED NEGOTIATION");
|
||||||
nua_respond(nh, SIP_488_NOT_ACCEPTABLE, TAG_END());
|
} else {
|
||||||
}
|
if (tech_media(tech_pvt, (char *)r_sdp) != SWITCH_STATUS_SUCCESS) {
|
||||||
goto done;
|
switch_channel_set_variable(channel, "endpoint_disposition", "CODEC NEGOTIATION ERROR");
|
||||||
} else {
|
nua_respond(nh, SIP_488_NOT_ACCEPTABLE, TAG_END());
|
||||||
switch_channel_set_variable(channel, "endpoint_disposition", "DELAYED NEGOTIATION");
|
}
|
||||||
|
}
|
||||||
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2932,12 +2943,29 @@ static void sip_i_state(int status,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (channel) {
|
if (channel) {
|
||||||
|
if (switch_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) {
|
||||||
|
switch_set_flag_locked(tech_pvt, TFLAG_ANS);
|
||||||
|
switch_channel_mark_answered(channel);
|
||||||
|
if ((uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
|
||||||
|
other_channel = switch_core_session_get_channel(other_session);
|
||||||
|
switch_channel_answer(other_channel);
|
||||||
|
switch_core_session_rwunlock(other_session);
|
||||||
|
}
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!r_sdp) {
|
||||||
|
r_sdp = (const char *) switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
|
||||||
|
}
|
||||||
if (r_sdp) {
|
if (r_sdp) {
|
||||||
if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
|
if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
|
||||||
switch_set_flag_locked(tech_pvt, TFLAG_ANS);
|
switch_set_flag_locked(tech_pvt, TFLAG_ANS);
|
||||||
switch_channel_mark_answered(channel);
|
switch_channel_mark_answered(channel);
|
||||||
if ((uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
|
if ((uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
|
||||||
other_channel = switch_core_session_get_channel(other_session);
|
other_channel = switch_core_session_get_channel(other_session);
|
||||||
|
if (!switch_channel_get_variable(other_channel, SWITCH_B_SDP_VARIABLE)) {
|
||||||
|
switch_channel_set_variable(other_channel, SWITCH_B_SDP_VARIABLE, (char *)r_sdp);
|
||||||
|
}
|
||||||
switch_channel_answer(other_channel);
|
switch_channel_answer(other_channel);
|
||||||
switch_core_session_rwunlock(other_session);
|
switch_core_session_rwunlock(other_session);
|
||||||
}
|
}
|
||||||
@ -2970,16 +2998,8 @@ static void sip_i_state(int status,
|
|||||||
switch_channel_set_variable(channel, "endpoint_disposition", "NO CODECS");
|
switch_channel_set_variable(channel, "endpoint_disposition", "NO CODECS");
|
||||||
nua_respond(nh, SIP_488_NOT_ACCEPTABLE, TAG_END());
|
nua_respond(nh, SIP_488_NOT_ACCEPTABLE, TAG_END());
|
||||||
}
|
}
|
||||||
} else if (switch_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) {
|
}
|
||||||
switch_set_flag_locked(tech_pvt, TFLAG_ANS);
|
|
||||||
switch_channel_mark_answered(channel);
|
|
||||||
if ((uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
|
|
||||||
other_channel = switch_core_session_get_channel(other_session);
|
|
||||||
switch_channel_answer(other_channel);
|
|
||||||
switch_core_session_rwunlock(other_session);
|
|
||||||
}
|
|
||||||
goto done;
|
|
||||||
} //else probably an ack
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -2552,7 +2552,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
|||||||
file = NULL;
|
file = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((var_val = switch_event_get_header(var_event, "noanswer_early_media")) && switch_true(var_val)) {
|
if ((var_val = switch_event_get_header(var_event, "ignore_early_media")) && switch_true(var_val)) {
|
||||||
early_ok = 0;
|
early_ok = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2755,9 +2755,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
|||||||
switch_channel_pre_answer(caller_channel);
|
switch_channel_pre_answer(caller_channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (session && (ringback_data || !switch_channel_test_flag(caller_channel, CF_NOMEDIA))) {
|
if (session && (read_codec = switch_core_session_get_read_codec(session)) &&
|
||||||
read_codec = switch_core_session_get_read_codec(session);
|
(ringback_data || !switch_channel_test_flag(caller_channel, CF_NOMEDIA))) {
|
||||||
assert(read_codec != NULL);
|
|
||||||
|
|
||||||
if (!(pass = (uint8_t)switch_test_flag(read_codec, SWITCH_CODEC_FLAG_PASSTHROUGH))) {
|
if (!(pass = (uint8_t)switch_test_flag(read_codec, SWITCH_CODEC_FLAG_PASSTHROUGH))) {
|
||||||
if (switch_core_codec_init(&write_codec,
|
if (switch_core_codec_init(&write_codec,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user