[Asterisk-cvs] asterisk/channels chan_iax2.c, 1.258, 1.259 chan_sip.c, 1.690, 1.691

markster at lists.digium.com markster at lists.digium.com
Wed Mar 23 23:08:25 CST 2005


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv27085/channels

Modified Files:
	chan_iax2.c chan_sip.c 
Log Message:
Fix SIP/IAX caching (bug #3671)


Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.258
retrieving revision 1.259
diff -u -d -r1.258 -r1.259
--- chan_iax2.c	23 Mar 2005 05:56:31 -0000	1.258
+++ chan_iax2.c	24 Mar 2005 05:02:49 -0000	1.259
@@ -2566,8 +2566,12 @@
 				peerl.peers = peer;
 				ast_mutex_unlock(&peerl.lock);
 				ast_copy_flags(peer, &globalflags, IAX_RTAUTOCLEAR|IAX_RTCACHEFRIENDS);
-				if (ast_test_flag(peer, IAX_RTAUTOCLEAR))
+				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, (void *)peer);
+				}
 			} else {
 		    		ast_set_flag(peer, IAX_TEMPONLY);	
 			}

Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.690
retrieving revision 1.691
diff -u -d -r1.690 -r1.691
--- chan_sip.c	24 Mar 2005 00:53:18 -0000	1.690
+++ chan_sip.c	24 Mar 2005 05:02:49 -0000	1.691
@@ -1292,6 +1292,9 @@
 			if(ast_test_flag((&global_flags_page2), SIP_PAGE2_RTCACHEFRIENDS)) {
 				ast_copy_flags((&peer->flags_page2),(&global_flags_page2), SIP_PAGE2_RTAUTOCLEAR|SIP_PAGE2_RTCACHEFRIENDS);
 				if(ast_test_flag((&global_flags_page2), SIP_PAGE2_RTAUTOCLEAR)) {
+					if (peer->expire > -1) {
+						ast_sched_del(sched, peer->expire);
+					}
 					peer->expire = ast_sched_add(sched, (global_rtautoclear) * 1000, expire_register, (void *)peer);
 				}
 				ASTOBJ_CONTAINER_LINK(&peerl,peer);




More information about the svn-commits mailing list