mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-07 08:21:08 +00:00
Refactor if blocks
Since the first branch doesn't need to do anything, we invert it and pull a sub-branch out a level into the main conditional.
This commit is contained in:
parent
ae3cf0a1a9
commit
4ec5e5af47
@ -3038,22 +3038,17 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
|||||||
switch_channel_set_variable(session->channel, "media_audio_mode", NULL);
|
switch_channel_set_variable(session->channel, "media_audio_mode", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(switch_media_handle_test_media_flag(smh, SCMF_DISABLE_HOLD)
|
||||||
if (switch_media_handle_test_media_flag(smh, SCMF_DISABLE_HOLD) ||
|
|| ((val = switch_channel_get_variable(session->channel, "rtp_disable_hold"))
|
||||||
((val = switch_channel_get_variable(session->channel, "rtp_disable_hold")) && switch_true(val))) {
|
&& switch_true(val)))
|
||||||
} else {
|
&& !smh->mparams->hold_laps) {
|
||||||
|
|
||||||
if (!smh->mparams->hold_laps) {
|
|
||||||
smh->mparams->hold_laps++;
|
smh->mparams->hold_laps++;
|
||||||
if (switch_core_media_toggle_hold(session, sendonly)) {
|
if (switch_core_media_toggle_hold(session, sendonly)) {
|
||||||
reneg = switch_media_handle_test_media_flag(smh, SCMF_RENEG_ON_HOLD);
|
reneg = switch_media_handle_test_media_flag(smh, SCMF_RENEG_ON_HOLD);
|
||||||
|
|
||||||
if ((val = switch_channel_get_variable(session->channel, "rtp_renegotiate_codec_on_hold"))) {
|
if ((val = switch_channel_get_variable(session->channel, "rtp_renegotiate_codec_on_hold"))) {
|
||||||
reneg = switch_true(val);
|
reneg = switch_true(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reneg) {
|
if (reneg) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user