[asterisk-commits] russell: branch russell/chan_refcount r99641 - /team/russell/chan_refcount/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 22 13:59:39 CST 2008


Author: russell
Date: Tue Jan 22 13:59:38 2008
New Revision: 99641

URL: http://svn.digium.com/view/asterisk?view=rev&rev=99641
Log:
Fix ast_change_name(), we have to unlink with the previous value for the hash key.

(Thanks to Marta for pointing this out!)

Modified:
    team/russell/chan_refcount/main/channel.c

Change Statistics:
 0 files changed

Modified: team/russell/chan_refcount/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/main/channel.c?view=diff&rev=99641&r1=99640&r2=99641
==============================================================================
--- team/russell/chan_refcount/main/channel.c (original)
+++ team/russell/chan_refcount/main/channel.c Tue Jan 22 13:59:38 2008
@@ -3423,13 +3423,14 @@
 
 void ast_change_name(struct ast_channel *chan, char *newname)
 {
+	/* Re-link, so that the hash value gets re-calculated */
+	ao2_unlink(channels, chan);
+
 	ast_channel_lock(chan);
 	manager_event(EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", chan->name, newname, chan->uniqueid);
 	ast_string_field_set(chan, name, newname);
 	ast_channel_unlock(chan);
 
-	/* Re-link, so that the hash value gets re-calculated */
-	ao2_unlink(channels, chan);
 	ao2_link(channels, chan);
 }
 




More information about the asterisk-commits mailing list