Try a more generally correct solution, for NFAS (bug #5179)
authorMark Spencer <markster@digium.com>
Tue, 13 Sep 2005 02:27:32 +0000 (02:27 +0000)
committerMark Spencer <markster@digium.com>
Tue, 13 Sep 2005 02:27:32 +0000 (02:27 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6567 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index 7c2829b..44b3fe1 100755 (executable)
@@ -2205,8 +2205,6 @@ int pri_find_dchan(struct zt_pri *pri)
                ast_log(LOG_NOTICE, "Switching from from d-channel %d to channel %d!\n",
                        pri->dchannels[oldslot], pri->dchannels[newslot]);
        pri->pri = pri->dchans[newslot];
                ast_log(LOG_NOTICE, "Switching from from d-channel %d to channel %d!\n",
                        pri->dchannels[oldslot], pri->dchannels[newslot]);
        pri->pri = pri->dchans[newslot];
-       if (!pri_is_up(pri) && !(pri->dchanavail[newslot] & DCHAN_NOTINALARM))
-               pri_restart(pri->dchans[newslot]);
        return 0;
 }
 #endif
        return 0;
 }
 #endif
@@ -8067,7 +8065,7 @@ static void *pri_dchannel(void *vpri)
                                                pri_find_dchan(pri);
                                        } else if (x == ZT_EVENT_NOALARM) {
                                                pri->dchanavail[which] |= DCHAN_NOTINALARM;
                                                pri_find_dchan(pri);
                                        } else if (x == ZT_EVENT_NOALARM) {
                                                pri->dchanavail[which] |= DCHAN_NOTINALARM;
-                                               pri_find_dchan(pri);
+                                               pri_restart(pri->dchans[which]);
                                        }
                                
                                        if (option_debug)
                                        }
                                
                                        if (option_debug)