mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	Fix multiple SIP realtime issues
1. Set lastms to 0 when clearing instead of "" 2. Don't set ipaddr or port to the string "(null)" when they are empty 3. Add missing required fields, set default for lastms to 0, and modify the length of the ipaddr field to 45 in the Postgresql realtime.sql file. (closes issue ASTERISK-19172) Review: https://reviewboard.asterisk.org/r/1703/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@354348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -4517,8 +4517,8 @@ static void realtime_update_peer(const char *peername, struct ast_sockaddr *addr | ||||
| 
 | ||||
| 	snprintf(str_lastms, sizeof(str_lastms), "%d", lastms); | ||||
| 	snprintf(regseconds, sizeof(regseconds), "%d", (int)nowtime);	/* Expiration time */ | ||||
| 	ast_copy_string(ipaddr, ast_sockaddr_stringify_addr(addr), sizeof(ipaddr)); | ||||
| 	ast_copy_string(port, ast_sockaddr_stringify_port(addr), sizeof(port)); | ||||
| 	ast_copy_string(ipaddr, ast_sockaddr_isnull(addr) ? "" : ast_sockaddr_stringify_addr(addr), sizeof(ipaddr)); | ||||
| 	ast_copy_string(port, ast_sockaddr_port(addr) ? ast_sockaddr_stringify_port(addr) : "", sizeof(port)); | ||||
| 
 | ||||
| 	if (ast_strlen_zero(sysname))	/* No system name, disable this */ | ||||
| 		sysname = NULL; | ||||
| @@ -13651,7 +13651,7 @@ static void destroy_association(struct sip_peer *peer) | ||||
| 
 | ||||
| 	if (!sip_cfg.ignore_regexpire) { | ||||
| 		if (peer->rt_fromcontact && sip_cfg.peer_rtupdate) { | ||||
| 			ast_update_realtime(tablename, "name", peer->name, "fullcontact", "", "ipaddr", "", "port", "", "regseconds", "0", "regserver", "", "useragent", "", "lastms", "", SENTINEL); | ||||
| 			ast_update_realtime(tablename, "name", peer->name, "fullcontact", "", "ipaddr", "", "port", "", "regseconds", "0", "regserver", "", "useragent", "", "lastms", "0", SENTINEL); | ||||
| 		} else { | ||||
| 			ast_db_del("SIP/Registry", peer->name); | ||||
| 			ast_db_del("SIP/PeerMethods", peer->name); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user