]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Only play announce time on first pass
authorMark Spencer <markster@digium.com>
Fri, 6 Aug 2004 14:43:25 +0000 (14:43 +0000)
committerMark Spencer <markster@digium.com>
Fri, 6 Aug 2004 14:43:25 +0000 (14:43 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3583 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channel.c
include/asterisk/channel.h
res/res_features.c

index 1f3848ae4b61d64fd9344a73d8265e8ad31ca9ff..464e15c02691f19ca2d1b933b32fae466ca3b73b 100755 (executable)
--- a/channel.c
+++ b/channel.c
@@ -2464,19 +2464,23 @@ int ast_channel_bridge(struct ast_channel *c0, struct ast_channel *c1, struct as
        struct ast_channel *who = NULL;
        int res=0;
        int nativefailed=0;
+       int firstpass;
        struct timeval start_time,precise_now;
        long elapsed_ms=0, time_left_ms=0;
        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);
 
+       firstpass = config->firstpass;
+       config->firstpass = 0;
+
        /* timestamp */
        gettimeofday(&start_time,NULL);
        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);
-       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);
 
        /* Stop if we're a zombie or need a soft hangup */
index b12121947e97d1e644fffcd2c04025694f74a9c6..5eb25dabb7fef50f93467d02b16445e2f451be80 100755 (executable)
@@ -279,6 +279,7 @@ struct ast_bridge_config {
        char *warning_sound;
        char *end_sound;
        char *start_sound;
+       int firstpass;
 };
 
 struct chanmon;
index 67042062c437ac7ac41976a23d6a091c0e46d126..669060c8889b8b5fb6304a92cd466ea8b64fa126 100755 (executable)
@@ -274,6 +274,7 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
        allowdisconnect_out = config->allowdisconnect_out;
        allowredirect_in = config->allowredirect_in;
        allowredirect_out = config->allowredirect_out;
+       config->firstpass = 1;
 
        /* Answer if need be */
        if (ast_answer(chan))