aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-01-18 11:37:08 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-01-18 11:37:08 +0000
commit29dd0c8e46fd8f07e3f9dd2727b052f699dba574 (patch)
tree3db96a5af81d7900428623f12174f39331515983 /channels
parent493670b15a037cb801d2872f4544d4a376129b7a (diff)
Fix recently introduced zap crash from HOLD/UNHOLD patch (bug #3365)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4831 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_zap.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 36efc2176..c32149cb6 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -4392,12 +4392,11 @@ static int zt_indicate(struct ast_channel *chan, int condition)
chan->_softhangup |= AST_SOFTHANGUP_DEV;
res = 0;
} else if (!p->proceeding && p->sig==SIG_PRI && p->pri && !p->outgoing) {
- if (p->pri->pri) {
+ if (p->pri) {
if (!pri_grab(p, p->pri)) {
pri_progress(p->pri->pri,p->call, PVT_TO_CHANNEL(p), 1);
pri_rel(p->pri);
- }
- else
+ } else
ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->span);
}
p->proceeding=1;
@@ -4408,10 +4407,22 @@ static int zt_indicate(struct ast_channel *chan, int condition)
break;
#ifdef ZAPATA_PRI
case AST_CONTROL_HOLD:
- res = pri_notify(p->pri->pri, p->call, p->prioffset, PRI_NOTIFY_REMOTE_HOLD);
+ if (p->pri) {
+ if (!pri_grab(p, p->pri)) {
+ res = pri_notify(p->pri->pri, p->call, p->prioffset, PRI_NOTIFY_REMOTE_HOLD);
+ pri_rel(p->pri);
+ } else
+ ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->span);
+ }
break;
case AST_CONTROL_UNHOLD:
- res = pri_notify(p->pri->pri, p->call, p->prioffset, PRI_NOTIFY_REMOTE_RETRIEVAL);
+ if (p->pri) {
+ if (!pri_grab(p, p->pri)) {
+ res = pri_notify(p->pri->pri, p->call, p->prioffset, PRI_NOTIFY_REMOTE_RETRIEVAL);
+ pri_rel(p->pri);
+ } else
+ ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->span);
+ }
break;
#endif
case AST_CONTROL_RADIO_KEY: