aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-07-22 15:16:55 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-07-22 15:16:55 +0000
commitba03580bbaf8135fc29bfb8cecd7f190fc583cdd (patch)
treef5c0ee06cd9a2bb5e73ad8dbb7a74e3afb19f3f2 /apps
parenta9cde193751ee91611483f129ae4e4cfbd04bc78 (diff)
Don't hold channel resources longer than we need them
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1200 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rwxr-xr-xapps/app_dial.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 38f70bc5c..953e799a6 100755
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -148,7 +148,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
watchers[0] = in;
while(o) {
/* Keep track of important channels */
- if (o->stillgoing) {
+ if (o->stillgoing && o->chan) {
watchers[pos++] = o->chan;
found = 1;
}
@@ -228,6 +228,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
case AST_CONTROL_BUSY:
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "%s is busy\n", o->chan->name);
+ ast_hangup(o->chan)
+ o->chan = NULL;
o->stillgoing = 0;
if (in->cdr)
ast_cdr_busy(in->cdr);
@@ -236,6 +238,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
case AST_CONTROL_CONGESTION:
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "%s is circuit-busy\n", o->chan->name);
+ ast_hangup(o->chan)
+ o->chan = NULL;
o->stillgoing = 0;
if (in->cdr)
ast_cdr_busy(in->cdr);
@@ -277,6 +281,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
}
ast_frfree(f);
} else {
+ ast_hangup(o->chan)
+ o->chan = NULL;
o->stillgoing = 0;
}
}