[asterisk-commits] trunk r30607 - /trunk/channels/chan_iax2.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri May 26 13:00:49 MST 2006


Author: file
Date: Fri May 26 15:00:48 2006
New Revision: 30607

URL: http://svn.digium.com/view/asterisk?rev=30607&view=rev
Log:
Few more expire_registry changes

Modified:
    trunk/channels/chan_iax2.c

Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?rev=30607&r1=30606&r2=30607&view=diff
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Fri May 26 15:00:48 2006
@@ -1893,7 +1893,7 @@
 	} else if ((peer = find_peer(argv[3], 0))) {
 		if(ast_test_flag(peer, IAX_RTCACHEFRIENDS)) {
 			ast_set_flag(peer, IAX_RTAUTOCLEAR);
-			expire_registry(peer);
+			expire_registry(peer->name);
 			ast_cli(fd, "OK peer %s was removed from the cache.\n", argv[3]);
 		} else {
 			ast_cli(fd, "SORRY peer %s is not eligible for this operation.\n", argv[3]);
@@ -2531,7 +2531,7 @@
 		if (ast_test_flag(peer, IAX_RTAUTOCLEAR)) {
 			if (peer->expire > -1)
 				ast_sched_del(sched, peer->expire);
-			peer->expire = ast_sched_add(sched, (global_rtautoclear) * 1000, expire_registry, peer);
+			peer->expire = ast_sched_add(sched, (global_rtautoclear) * 1000, expire_registry, (void*)peer->name);
 		}
 		AST_LIST_LOCK(&peers);
 		AST_LIST_INSERT_HEAD(&peers, peer, entry);
@@ -5521,6 +5521,7 @@
 			/* If we are set to auto clear then remove ourselves */
 			if (ast_test_flag(p, IAX_RTAUTOCLEAR))
 				AST_LIST_REMOVE_CURRENT(&peers, entry);
+			p->expire = -1;
 			break;
 		}
 	}
@@ -5552,9 +5553,6 @@
 
 static int expire_registry(void *data)
 {
-	struct iax2_peer *p = data;
-	/* Reset expire notice */
-	p->expire = -1;
 #ifdef SCHED_MULTITHREADED
 	if (schedule_action(__expire_registry, data))
 #endif		



More information about the asterisk-commits mailing list