Merged revisions 38982 via svnmerge from
authorRussell Bryant <russell@russellbryant.com>
Sat, 5 Aug 2006 09:03:27 +0000 (09:03 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sat, 5 Aug 2006 09:03:27 +0000 (09:03 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38982 | russell | 2006-08-05 05:01:37 -0400 (Sat, 05 Aug 2006) | 6 lines

Always generate a Newstate event in ast_setstate() instead of making it a
Newchannel event if the state was AST_STATE_DOWN.  The Newchannel event will
always be generated in ast_request(), so this just causes a duplicated
Newchannel event in some cases.
(issue #7506, repoted by capouch, fixed by me)

........

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

channel.c

index fffcc8d..8060bca 100644 (file)
--- a/channel.c
+++ b/channel.c
@@ -3357,8 +3357,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",
+       manager_event(EVENT_FLAG_CALL, "Newstate",
                      "Channel: %s\r\n"
                      "State: %s\r\n"
                      "CallerID: %s\r\n"