Changing the last patch of chan_zap.c
authorMartin Pycko <martinp@digium.com>
Fri, 16 May 2003 14:57:35 +0000 (14:57 +0000)
committerMartin Pycko <martinp@digium.com>
Fri, 16 May 2003 14:57:35 +0000 (14:57 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1028 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index 46b789a..a1019ec 100755 (executable)
@@ -3432,13 +3432,14 @@ static int zt_indicate(struct ast_channel *chan, int condition)
                        ast_log(LOG_DEBUG,"Received AST_CONTROL_PROGRESS on %s\n",chan->name);
 #ifdef ZAPATA_PRI
 #ifdef PRI_EVENT_PROCEEDING
-                       if (!p->proceeding && (!p->pri || p->pri->overlapdial) && p->sig==SIG_PRI) {
-                               if (p->pri && p->pri->pri) {            
-                                       if (!pri_grab(p, p->pri))
+                       if (!p->proceeding && p->sig==SIG_PRI && p->pri && p->pri->overlapdial) {
+                               if (p->pri->pri) {              
+                                       if (!pri_grab(p, p->pri)) {
                                                pri_acknowledge(p->pri->pri,p->call, p->prioffset, 1);
+                                               pri_rel(p->pri);
+                                       }
                                        else
                                                ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->span);
-                                       pri_rel(p->pri);
                                }
                                p->proceeding=1;
                        }