Add a manager event for PRI events: this will help manager users detect when a D...
authorTilghman Lesher <tilghman@meg.abyt.es>
Thu, 6 Dec 2007 23:47:07 +0000 (23:47 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Thu, 6 Dec 2007 23:47:07 +0000 (23:47 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91618 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index 6283023..63b2414 100644 (file)
@@ -9851,8 +9851,19 @@ static void *pri_dchannel(void *vpri)
                                        /* Check for an event */
                                        x = 0;
                                        res = ioctl(pri->fds[which], ZT_GETEVENT, &x);
-                                       if (x) 
+                                       if (x) {
                                                ast_log(LOG_NOTICE, "PRI got event: %s (%d) on %s D-channel of span %d\n", event2str(x), x, pri_order(which), pri->span);
+                                               manager_event(EVENT_FLAG_SYSTEM, "PRIEvent",
+                                                       "PRIEvent: %s\r\n"
+                                                       "PRIEventCode: %d\r\n"
+                                                       "D-channel: %s\r\n"
+                                                       "Span: %d\r\n",
+                                                       event2str(x),
+                                                       x,
+                                                       pri_order(which),
+                                                       pri->span
+                                                       );
+                                       }
                                        /* Keep track of alarm state */ 
                                        if (x == ZT_EVENT_ALARM) {
                                                pri->dchanavail[which] &= ~(DCHAN_NOTINALARM | DCHAN_UP);