Merged revisions 25123 via svnmerge from
authorRussell Bryant <russell@russellbryant.com>
Sat, 6 May 2006 00:06:58 +0000 (00:06 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sat, 6 May 2006 00:06:58 +0000 (00:06 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r25123 | russell | 2006-05-05 20:05:27 -0400 (Fri, 05 May 2006) | 3 lines

ensure that the appropriate manager events are sent in all of the places where
alarms are detected or cleared (issue #6866, flefoll)

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@25124 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index 86cf8bd..b51292d 100644 (file)
@@ -6431,11 +6431,17 @@ static int handle_init_event(struct zt_pvt *i, int event)
                i->inalarm = 0;
                ast_log(LOG_NOTICE, "Alarm cleared on channel %d\n", i->channel);
                break;
+               manager_event(EVENT_FLAG_SYSTEM, "AlarmClear",
+                                                       "Channel: %d\r\n", i->channel);
        case ZT_EVENT_ALARM:
                i->inalarm = 1;
                res = get_alarms(i);
                ast_log(LOG_WARNING, "Detected alarm on channel %d: %s\n", i->channel, alarm2str(res));
                /* fall thru intentionally */
+               manager_event(EVENT_FLAG_SYSTEM, "Alarm",
+                                                       "Alarm: %s\r\n"
+                                                       "Channel: %d\r\n",
+                                                       alarm2str(res), i->channel);
        case ZT_EVENT_ONHOOK:
                if (i->radio) break;
                /* Back on hook.  Hang up. */