Don't double generate events
authorMark Spencer <markster@digium.com>
Fri, 15 Aug 2003 18:29:33 +0000 (18:29 +0000)
committerMark Spencer <markster@digium.com>
Fri, 15 Aug 2003 18:29:33 +0000 (18:29 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1339 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channel.c

index 5cc58d0..a97f0e8 100755 (executable)
--- a/channel.c
+++ b/channel.c
@@ -1540,12 +1540,14 @@ struct ast_channel *ast_request(char *type, int format, void *data)
                                c = chan->requester(type, capabilities, data);
                        if (c) {
 //                             ast_device_state_changed(c->name);
-                               manager_event(EVENT_FLAG_CALL, "Newchannel",
-                               "Channel: %s\r\n"
-                               "State: %s\r\n"
-                               "Callerid: %s\r\n"
-                               "Uniqueid: %s\r\n",
-                               c->name, ast_state2str(c->_state), c->callerid ? c->callerid : "<unknown>", c->uniqueid);
+                               if (c->_state == AST_STATE_DOWN) {
+                                       manager_event(EVENT_FLAG_CALL, "Newchannel",
+                                       "Channel: %s\r\n"
+                                       "State: %s\r\n"
+                                       "Callerid: %s\r\n"
+                                       "Uniqueid: %s\r\n",
+                                       c->name, ast_state2str(c->_state), c->callerid ? c->callerid : "<unknown>", c->uniqueid);
+                               }
                        }
                        return c;
                }