summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xapps/app_dial.c22
-rwxr-xr-xchannel.c10
2 files changed, 22 insertions, 10 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 3492c1004..10017e687 100755
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -518,12 +518,22 @@ static int dial_exec(struct ast_channel *chan, void *data)
warning_sound=NULL;
}
calldurationlimit=0; /* undo effect of S(x) in case they are both used */
- if(! play_warning && ! start_sound && ! end_sound && timelimit) { /* more efficient do it like S(x) does since no advanced opts*/
- calldurationlimit=timelimit/1000;
- timelimit=play_to_caller=play_to_callee=play_warning=warning_freq=0;
- }
- else
- ast_verbose(VERBOSE_PREFIX_3"Limit Data: timelimit=%ld\n -- play_warning=%ld\n -- play_to_caller=%s\n -- play_to_callee=%s\n -- warning_freq=%ld\n -- warning_sound=%s\n -- end_sound=%s\n -- start_sound=%s\n",timelimit,play_warning,play_to_caller ? "yes" : "no",play_to_callee ? "yes" : "no",warning_freq,warning_sound ? warning_sound : "UNDEF",end_sound ? end_sound : "UNDEF",start_sound ? start_sound : "UNDEF");
+ /* more efficient do it like S(x) does since no advanced opts*/
+ if(! play_warning && ! start_sound && ! end_sound && timelimit) {
+ calldurationlimit=timelimit/1000;
+ timelimit=play_to_caller=play_to_callee=play_warning=warning_freq=0;
+ }
+ else {
+ ast_verbose(VERBOSE_PREFIX_3"Limit Data:\n");
+ ast_verbose(VERBOSE_PREFIX_3"timelimit=%ld\n",timelimit);
+ ast_verbose(VERBOSE_PREFIX_3"play_warning=%ld\n",play_warning);
+ ast_verbose(VERBOSE_PREFIX_3"play_to_caller=%s\n",play_to_caller ? "yes" : "no");
+ ast_verbose(VERBOSE_PREFIX_3"play_to_callee=%s\n",play_to_callee ? "yes" : "no");
+ ast_verbose(VERBOSE_PREFIX_3"warning_freq=%ld\n",warning_freq);
+ ast_verbose(VERBOSE_PREFIX_3"start_sound=%s\n",start_sound ? start_sound : "UNDEF");
+ ast_verbose(VERBOSE_PREFIX_3"warning_sound=%s\n",warning_sound ? warning_sound : "UNDEF");
+ ast_verbose(VERBOSE_PREFIX_3"end_sound=%s\n",end_sound ? end_sound : "UNDEF");
+ }
}
diff --git a/channel.c b/channel.c
index 9a083fd36..0ea7f7430 100755
--- a/channel.c
+++ b/channel.c
@@ -2335,7 +2335,7 @@ static long tvdiff(struct timeval *now,struct timeval *then) {
return (((now->tv_sec * 1000) + now->tv_usec / 1000) - ((then->tv_sec * 1000) + then->tv_usec / 1000));
}
-static void bridge_playfile(struct ast_channel *chan,char *sound,int remain) {
+static void bridge_playfile(struct ast_channel *chan,char *sound,int remain) {
int res=0,min=0,sec=0;
if(remain > 0) {
@@ -2381,7 +2381,7 @@ int ast_channel_bridge(struct ast_channel *c0,struct ast_channel *c1,struct ast_
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||config->allowredirect_out ? AST_BRIDGE_DTMF_CHANNEL_0 : 0) + (config->allowredirect_in ? AST_BRIDGE_DTMF_CHANNEL_1 : 0);
@@ -2450,7 +2450,6 @@ int ast_channel_bridge(struct ast_channel *c0,struct ast_channel *c1,struct ast_
}
}
}
-
if(time_left_ms <= 0) {
if(config->play_to_caller && config->end_sound){
bridge_playfile(c0,config->end_sound,0);
@@ -2458,7 +2457,10 @@ int ast_channel_bridge(struct ast_channel *c0,struct ast_channel *c1,struct ast_
if(config->play_to_callee && config->end_sound){
bridge_playfile(c1,config->end_sound,0);
- }
+ }
+ *fo = NULL;
+ if (who) *rc = who;
+ res = 0;
break;
}