]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
This mod for bug_7506, to make the manager code output the proper event
authorSteve Murphy <murf@digium.com>
Tue, 7 Nov 2006 18:22:01 +0000 (18:22 +0000)
committerSteve Murphy <murf@digium.com>
Tue, 7 Nov 2006 18:22:01 +0000 (18:22 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@47274 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channel.c
include/asterisk/channel.h

index ae5d5f79c308e5fbc85e4753575f56168320ead9..9a54db0598f31bd20ccaed1747feced235c8a5d5 100644 (file)
--- a/channel.c
+++ b/channel.c
@@ -2590,6 +2590,7 @@ struct ast_channel *ast_request(const char *type, int format, void *data, int *c
                                      c->cid.cid_num ? c->cid.cid_num : "<unknown>",
                                      c->cid.cid_name ? c->cid.cid_name : "<unknown>",
                                      c->uniqueid);
+                       ast_set_flag(c, AST_FLAG_NOTNEW);
                }
                return c;
        }
@@ -3253,7 +3254,7 @@ int ast_setstate(struct ast_channel *chan, int state)
        chan->_state = state;
        ast_device_state_changed_literal(chan->name);
        manager_event(EVENT_FLAG_CALL,
-                     (oldstate == AST_STATE_DOWN) ? "Newchannel" : "Newstate",
+                     (oldstate == AST_STATE_DOWN && !ast_test_flag(chan, AST_FLAG_NOTNEW)) ? "Newchannel" : "Newstate",
                      "Channel: %s\r\n"
                      "State: %s\r\n"
                      "CallerID: %s\r\n"
index 38b33ed2d31859b21f3bca7516b2b769f56faba6..dd78844c989263dfeb040234036b7df4e9dc260e 100644 (file)
@@ -435,6 +435,7 @@ struct ast_channel {
                                                   so when ->priority is set, it will get incremented before
                                                   finding the next priority to run
                                                */
+#define AST_FLAG_NOTNEW        (1 << 10)       /*!< see bug:7855 incorrect Newchannel event generation */
 /* @} */
 
 #define AST_FEATURE_PLAY_WARNING       (1 << 0)