aboutsummaryrefslogtreecommitdiffstats
path: root/pbx.c
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-16 06:25:26 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-16 06:25:26 +0000
commitac241207a517b21b6ce60bfecce9e174c30f1d0c (patch)
tree41cdd60a1dd856b353e485ec9d1c7bc183487333 /pbx.c
parent061f59c391a40772ee64c68ab909dd836c3e7f42 (diff)
Don't force a busy state that will break channel signalling if the channel
already is up. (Reported by Steve Davies in e-mail, waiting for 1.2 approval) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@34433 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rw-r--r--pbx.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pbx.c b/pbx.c
index 2b4ceea1e..7bbe3bcdd 100644
--- a/pbx.c
+++ b/pbx.c
@@ -4938,7 +4938,10 @@ static int pbx_builtin_ringing(struct ast_channel *chan, void *data)
static int pbx_builtin_busy(struct ast_channel *chan, void *data)
{
ast_indicate(chan, AST_CONTROL_BUSY);
- ast_setstate(chan, AST_STATE_BUSY);
+ /* Don't change state of an UP channel, just indicate
+ busy in audio */
+ if (chan->_state != AST_STATE_UP)
+ ast_setstate(chan, AST_STATE_BUSY);
wait_for_hangup(chan, data);
return -1;
}
@@ -4949,7 +4952,10 @@ static int pbx_builtin_busy(struct ast_channel *chan, void *data)
static int pbx_builtin_congestion(struct ast_channel *chan, void *data)
{
ast_indicate(chan, AST_CONTROL_CONGESTION);
- ast_setstate(chan, AST_STATE_BUSY);
+ /* Don't change state of an UP channel, just indicate
+ congestion in audio */
+ if (chan->_state != AST_STATE_UP)
+ ast_setstate(chan, AST_STATE_BUSY);
wait_for_hangup(chan, data);
return -1;
}