mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-18 15:49:56 +00:00
move common conditions to the outside block.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
20
channel.c
20
channel.c
@@ -3465,10 +3465,10 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha
|
|||||||
if (time_left_ms < to)
|
if (time_left_ms < to)
|
||||||
to = time_left_ms;
|
to = time_left_ms;
|
||||||
|
|
||||||
if (time_left_ms <= 0) {
|
if (time_left_ms <= 0 && config->end_sound) {
|
||||||
if (caller_warning && config->end_sound)
|
if (caller_warning)
|
||||||
bridge_playfile(c0, c1, config->end_sound, 0);
|
bridge_playfile(c0, c1, config->end_sound, 0);
|
||||||
if (callee_warning && config->end_sound)
|
if (callee_warning)
|
||||||
bridge_playfile(c1, c0, config->end_sound, 0);
|
bridge_playfile(c1, c0, config->end_sound, 0);
|
||||||
*fo = NULL;
|
*fo = NULL;
|
||||||
if (who)
|
if (who)
|
||||||
@@ -3478,14 +3478,12 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!to) {
|
if (!to) {
|
||||||
if (time_left_ms >= 5000) {
|
if (time_left_ms >= 5000 && config->warning_sound && config->play_warning) {
|
||||||
/* force the time left to round up if appropriate */
|
int t = (time_left_ms + 500) / 1000; /* round to nearest second */
|
||||||
if (caller_warning && config->warning_sound && config->play_warning)
|
if (caller_warning)
|
||||||
bridge_playfile(c0, c1, config->warning_sound,
|
bridge_playfile(c0, c1, config->warning_sound, t);
|
||||||
(time_left_ms + 500) / 1000);
|
if (callee_warning)
|
||||||
if (callee_warning && config->warning_sound && config->play_warning)
|
bridge_playfile(c1, c0, config->warning_sound, t);
|
||||||
bridge_playfile(c1, c0, config->warning_sound,
|
|
||||||
(time_left_ms + 500) / 1000);
|
|
||||||
}
|
}
|
||||||
if (config->warning_freq) {
|
if (config->warning_freq) {
|
||||||
nexteventts = ast_tvadd(nexteventts, ast_samp2tv(config->warning_freq, 1000));
|
nexteventts = ast_tvadd(nexteventts, ast_samp2tv(config->warning_freq, 1000));
|
||||||
|
|||||||
Reference in New Issue
Block a user