mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-08 22:27:07 +00:00
Only play announce time on first pass
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2464,19 +2464,23 @@ int ast_channel_bridge(struct ast_channel *c0, struct ast_channel *c1, struct as
|
|||||||
struct ast_channel *who = NULL;
|
struct ast_channel *who = NULL;
|
||||||
int res=0;
|
int res=0;
|
||||||
int nativefailed=0;
|
int nativefailed=0;
|
||||||
|
int firstpass;
|
||||||
struct timeval start_time,precise_now;
|
struct timeval start_time,precise_now;
|
||||||
long elapsed_ms=0, time_left_ms=0;
|
long elapsed_ms=0, time_left_ms=0;
|
||||||
int playit=0, playitagain=1, first_time=1;
|
int playit=0, playitagain=1, first_time=1;
|
||||||
|
|
||||||
flags = (config->allowdisconnect_out||config->allowredirect_out ? AST_BRIDGE_DTMF_CHANNEL_0 : 0) + (config->allowdisconnect_in||config->allowredirect_in ? AST_BRIDGE_DTMF_CHANNEL_1 : 0);
|
flags = (config->allowdisconnect_out||config->allowredirect_out ? AST_BRIDGE_DTMF_CHANNEL_0 : 0) + (config->allowdisconnect_in||config->allowredirect_in ? AST_BRIDGE_DTMF_CHANNEL_1 : 0);
|
||||||
|
|
||||||
|
firstpass = config->firstpass;
|
||||||
|
config->firstpass = 0;
|
||||||
|
|
||||||
/* timestamp */
|
/* timestamp */
|
||||||
gettimeofday(&start_time,NULL);
|
gettimeofday(&start_time,NULL);
|
||||||
time_left_ms = config->timelimit;
|
time_left_ms = config->timelimit;
|
||||||
|
|
||||||
if (config->play_to_caller && config->start_sound)
|
if (config->play_to_caller && config->start_sound && firstpass)
|
||||||
bridge_playfile(c0,c1,config->start_sound,time_left_ms / 1000);
|
bridge_playfile(c0,c1,config->start_sound,time_left_ms / 1000);
|
||||||
if (config->play_to_callee && config->start_sound)
|
if (config->play_to_callee && config->start_sound && firstpass)
|
||||||
bridge_playfile(c1,c0,config->start_sound,time_left_ms / 1000);
|
bridge_playfile(c1,c0,config->start_sound,time_left_ms / 1000);
|
||||||
|
|
||||||
/* Stop if we're a zombie or need a soft hangup */
|
/* Stop if we're a zombie or need a soft hangup */
|
||||||
|
@@ -279,6 +279,7 @@ struct ast_bridge_config {
|
|||||||
char *warning_sound;
|
char *warning_sound;
|
||||||
char *end_sound;
|
char *end_sound;
|
||||||
char *start_sound;
|
char *start_sound;
|
||||||
|
int firstpass;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct chanmon;
|
struct chanmon;
|
||||||
|
@@ -274,6 +274,7 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
|
|||||||
allowdisconnect_out = config->allowdisconnect_out;
|
allowdisconnect_out = config->allowdisconnect_out;
|
||||||
allowredirect_in = config->allowredirect_in;
|
allowredirect_in = config->allowredirect_in;
|
||||||
allowredirect_out = config->allowredirect_out;
|
allowredirect_out = config->allowredirect_out;
|
||||||
|
config->firstpass = 1;
|
||||||
|
|
||||||
/* Answer if need be */
|
/* Answer if need be */
|
||||||
if (ast_answer(chan))
|
if (ast_answer(chan))
|
||||||
|
Reference in New Issue
Block a user