[svn-commits] twilson: branch 10 r354349 - in /branches/10: ./ channels/ contrib/realtime/p...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Feb 7 15:17:15 CST 2012


Author: twilson
Date: Tue Feb  7 15:17:10 2012
New Revision: 354349

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=354349
Log:
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/
........

Merged revisions 354348 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/channels/chan_sip.c
    branches/10/contrib/realtime/postgresql/realtime.sql

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/channels/chan_sip.c?view=diff&rev=354349&r1=354348&r2=354349
==============================================================================
--- branches/10/channels/chan_sip.c (original)
+++ branches/10/channels/chan_sip.c Tue Feb  7 15:17:10 2012
@@ -4547,8 +4547,8 @@
 
 	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;
@@ -14047,7 +14047,7 @@
 
 	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);

Modified: branches/10/contrib/realtime/postgresql/realtime.sql
URL: http://svnview.digium.com/svn/asterisk/branches/10/contrib/realtime/postgresql/realtime.sql?view=diff&rev=354349&r1=354348&r2=354349
==============================================================================
--- branches/10/contrib/realtime/postgresql/realtime.sql (original)
+++ branches/10/contrib/realtime/postgresql/realtime.sql Tue Feb  7 15:17:10 2012
@@ -65,10 +65,14 @@
 allow character varying(100) DEFAULT 'g729;ilbc;gsm;ulaw;alaw',
 musiconhold character varying(100),
 regseconds bigint DEFAULT 0::bigint NOT NULL,
-ipaddr character varying(40) DEFAULT '' NOT NULL,
+ipaddr character varying(45) DEFAULT '' NOT NULL,
 regexten character varying(80) DEFAULT '' NOT NULL,
 cancallforward character varying(3) DEFAULT 'yes',
-lastms integer DEFAULT -1 NOT NULL
+lastms integer DEFAULT 0 NOT NULL,
+defaultuser character varying(80),
+fullcontact character varying(80),
+regserver character varying(30),
+useragent character varying(40)
 );
 
 drop table voicemail_users;




More information about the svn-commits mailing list