summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-07-07 16:02:13 +0000
committerMark Spencer <markster@digium.com>2004-07-07 16:02:13 +0000
commit432bb121f3072122cfec1ed05272d46aecad226e (patch)
tree4bc8239e616b4e9961f2fcab1ad96d4e3b77f776 /apps
parent52549b25cd8ee6e313191cb2e5a11fb76870583d (diff)
Cleanups to the ordering of events in dial, don't freak out on the wrong codec
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rwxr-xr-xapps/app_dial.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 4b05ad478..dfb1a3e8e 100755
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -142,7 +142,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
if (single) {
/* Turn off hold music, etc */
- ast_indicate(in, -1);
+ ast_deactivate_generator(in);
/* If we are calling a single channel, make them compatible for in-band tone purpose */
ast_channel_make_compatible(outgoing->chan, in);
}
@@ -853,13 +853,6 @@ static int dial_exec(struct ast_channel *chan, void *data)
pbx_builtin_setvar_helper(chan, "DIALEDPEERNAME", peer->name);
if (numsubst)
pbx_builtin_setvar_helper(chan, "DIALEDPEERNUMBER", numsubst);
- /* Make sure channels are compatible */
- res = ast_channel_make_compatible(chan, peer);
- if (res < 0) {
- ast_log(LOG_WARNING, "Had to drop call because I couldn't make %s compatible with %s\n", chan->name, peer->name);
- ast_hangup(peer);
- return -1;
- }
/* JDG: sendurl */
if( url && !ast_strlen_zero(url) && ast_channel_supports_html(peer) ) {
ast_log(LOG_DEBUG, "app_dial: sendurl=%s.\n", url);
@@ -913,6 +906,15 @@ static int dial_exec(struct ast_channel *chan, void *data)
sentringing = 0;
ast_indicate(chan, -1);
}
+ /* Be sure no generators are left on it */
+ ast_deactivate_generator(chan);
+ /* Make sure channels are compatible */
+ res = ast_channel_make_compatible(chan, peer);
+ if (res < 0) {
+ ast_log(LOG_WARNING, "Had to drop call because I couldn't make %s compatible with %s\n", chan->name, peer->name);
+ ast_hangup(peer);
+ return -1;
+ }
res = ast_bridge_call(chan,peer,&config);
} else
res = -1;