aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_zap.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-11-13 23:56:50 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-11-13 23:56:50 +0000
commit01d14a1b4361c23a34deae214f41ad0e89923d39 (patch)
tree31866d7ce1bdf28e71eb3e294d10de9d85eccd4b /channels/chan_zap.c
parent0cb7e1d1213a736678db0461df98ffbc51bedf0e (diff)
Send progress before in-band indications for BUSY/CONGESTION
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4232 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_zap.c')
-rwxr-xr-xchannels/chan_zap.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 223378984..a98bc26a6 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -4262,6 +4262,17 @@ static int zt_indicate(struct ast_channel *chan, int condition)
chan->hangupcause = AST_CAUSE_USER_BUSY;
chan->_softhangup |= AST_SOFTHANGUP_DEV;
res = 0;
+ } else if (!p->proceeding && p->sig==SIG_PRI && p->pri && !p->outgoing) {
+ if (p->pri->pri) {
+ if (!pri_grab(p, p->pri)) {
+ pri_progress(p->pri->pri,p->call, PVT_TO_CHANNEL(p), 1);
+ pri_rel(p->pri);
+ }
+ else
+ ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->span);
+ }
+ p->proceeding=1;
+ res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_BUSY);
} else
#endif
res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_BUSY);
@@ -4332,6 +4343,17 @@ static int zt_indicate(struct ast_channel *chan, int condition)
chan->hangupcause = AST_CAUSE_SWITCH_CONGESTION;
chan->_softhangup |= AST_SOFTHANGUP_DEV;
res = 0;
+ } else if (!p->proceeding && p->sig==SIG_PRI && p->pri && !p->outgoing) {
+ if (p->pri->pri) {
+ if (!pri_grab(p, p->pri)) {
+ pri_progress(p->pri->pri,p->call, PVT_TO_CHANNEL(p), 1);
+ pri_rel(p->pri);
+ }
+ else
+ ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->span);
+ }
+ p->proceeding=1;
+ res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_CONGESTION);
} else
#endif
res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_CONGESTION);