add manager events for Zaptel DND state changes (bug #4070, with mods)
authorKevin P. Fleming <kpfleming@digium.com>
Wed, 27 Apr 2005 04:03:49 +0000 (04:03 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Wed, 27 Apr 2005 04:03:49 +0000 (04:03 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5513 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c
doc/manager.txt

index 95fef3c..621842e 100755 (executable)
@@ -5291,8 +5291,12 @@ static void *ss_thread(void *data)
                                break;
                        } else if (!strcmp(exten, "*78")) {
                                /* Do not disturb */
-                               if (option_verbose > 2)
+                               if (option_verbose > 2) {
                                        ast_verbose(VERBOSE_PREFIX_3 "Enabled DND on channel %d\n", p->channel);
+                                       manager_event(EVENT_FLAG_SYSTEM, "DNDState",
+                                                               "Channel: Zap/%d\r\n"
+                                                               "Status: enabled\r\n", p->channel);
+                               }
                                res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
                                p->dnd = 1;
                                getforward = 0;
@@ -5300,8 +5304,12 @@ static void *ss_thread(void *data)
                                len = 0;
                        } else if (!strcmp(exten, "*79")) {
                                /* Do not disturb */
-                               if (option_verbose > 2)
+                               if (option_verbose > 2) {
                                        ast_verbose(VERBOSE_PREFIX_3 "Disabled DND on channel %d\n", p->channel);
+                                       manager_event(EVENT_FLAG_SYSTEM, "DNDState",
+                                                               "Channel: Zap/%d\r\n"
+                                                               "Status: disabled\r\n", p->channel);
+                               }
                                res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
                                p->dnd = 0;
                                getforward = 0;
@@ -9353,10 +9361,12 @@ static int action_zapshowchannels(struct mansession *s, struct message *m)
                                "Channel: %d\r\n"
                                "Signalling: %s\r\n"
                                "Context: %s\r\n"
+                               "DND: %s\r\n"
                                "Alarm: %s\r\n"
                                "%s"
                                "\r\n",
                                tmp->channel, sig2str(tmp->sig), tmp->context, 
+                               tmp->dnd ? "Enabled" : "Disabled",
                                alarm2str(alarm), idText);
                        ast_mutex_unlock(&s->lock);             
                } 
index 4d03fb1..7769d7a 100755 (executable)
@@ -275,6 +275,7 @@ Some standard AMI headers:
  Status:                       -- Peer status (if monitored)  ** Will change name **
                                        "unknown", "lagged", "ok"
  Status: <num>                 -- Queue Status
+ Status:                       -- DND status (DNDState)
  Time: <sec>                   -- Roundtrip time (latency)
  Timeout:                      -- Parking timeout time
  Timeout:                      -- Timeout for call setup (Originate)