[Asterisk-cvs] asterisk/channels chan_sip.c,1.740,1.741

markster at lists.digium.com markster at lists.digium.com
Wed May 25 13:41:25 CDT 2005


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

Modified Files:
	chan_sip.c 
Log Message:
Fix SIP registration (bug #4138)


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.740
retrieving revision 1.741
diff -u -d -r1.740 -r1.741
--- chan_sip.c	25 May 2005 17:18:05 -0000	1.740
+++ chan_sip.c	25 May 2005 17:45:31 -0000	1.741
@@ -1305,8 +1305,6 @@
 	if (!ast_test_flag((&global_flags_page2), SIP_PAGE2_RTNOUPDATE) && 
 		(ast_test_flag(p, SIP_REALTIME) || 
 		 ast_test_flag(&(p->flags_page2), SIP_PAGE2_RTCACHEFRIENDS))) {
-		if (p->expire == -1)
-			expiry = 0;	/* Unregister realtime peer */
 		realtime_update_peer(p->name, &p->addr, p->username, expiry);
 	}
 }
@@ -5145,7 +5143,8 @@
 		p->expire = -1;
 	pvt->expiry = expiry;
 	snprintf(data, sizeof(data), "%s:%d:%d:%s:%s", ast_inet_ntoa(iabuf, sizeof(iabuf), p->addr.sin_addr), ntohs(p->addr.sin_port), expiry, p->username, p->fullcontact);
-	ast_db_put("SIP/Registry", p->name, data);
+	if (!ast_test_flag(p, SIP_REALTIME))
+		ast_db_put("SIP/Registry", p->name, data);
 	manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: SIP/%s\r\nPeerStatus: Registered\r\n", p->name);
 	if (inaddrcmp(&p->addr, &oldsin)) {
 		sip_poke_peer(p);
@@ -10419,7 +10418,7 @@
 		}
 	}
 	ast_copy_flags(peer, &peerflags, mask.flags);
-	if (!found && ast_test_flag(peer, SIP_DYNAMIC))
+	if (!found && ast_test_flag(peer, SIP_DYNAMIC) && !ast_test_flag(peer, SIP_REALTIME))
 		reg_source_db(peer);
 	ASTOBJ_UNMARK(peer);
 	ast_free_ha(oldha);




More information about the svn-commits mailing list