Fix order and redundancy of channel rename manager events in ast_do_masquerade.
authorMark Michelson <mmichelson@digium.com>
Mon, 3 Aug 2009 14:29:17 +0000 (14:29 +0000)
committerMark Michelson <mmichelson@digium.com>
Mon, 3 Aug 2009 14:29:17 +0000 (14:29 +0000)
Patch contributed by Mark Spencer.

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

main/channel.c

index 1052d0f..eb6995c 100644 (file)
@@ -5024,19 +5024,15 @@ int ast_do_masquerade(struct ast_channel *original)
        /* Create the masq name */
        snprintf(masqn, sizeof(masqn), "%s<MASQ>", newn);
 
-       /* Copy the name from the clone channel */
-       ast_change_name(original, newn);
-
        /* Mangle the name of the clone channel */
        ast_change_name(clonechan, masqn);
 
+       /* Copy the name from the clone channel */
+       ast_change_name(original, newn);
+
        /* share linked id's */
        ast_channel_set_linkgroup(original, clonechan);
 
-       /* Notify any managers of the change, first the masq then the other */
-       manager_event(EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", newn, masqn, clonechan->uniqueid);
-       manager_event(EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", orig, newn, original->uniqueid);
-
        /* Swap the technologies */
        t = original->tech;
        original->tech = clonechan->tech;