[asterisk-commits] twilson: trunk r354360 - in /trunk: ./ channels/ contrib/realtime/postgresql/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Feb 7 15:33:48 CST 2012
Author: twilson
Date: Tue Feb 7 15:33:42 2012
New Revision: 354360
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=354360
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
........
Merged revisions 354349 from http://svn.asterisk.org/svn/asterisk/branches/10
Modified:
trunk/ (props changed)
trunk/channels/chan_sip.c
trunk/contrib/realtime/postgresql/realtime.sql
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.
Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=354360&r1=354359&r2=354360
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Feb 7 15:33:42 2012
@@ -4550,8 +4550,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;
@@ -14081,7 +14081,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: trunk/contrib/realtime/postgresql/realtime.sql
URL: http://svnview.digium.com/svn/asterisk/trunk/contrib/realtime/postgresql/realtime.sql?view=diff&rev=354360&r1=354359&r2=354360
==============================================================================
--- trunk/contrib/realtime/postgresql/realtime.sql (original)
+++ trunk/contrib/realtime/postgresql/realtime.sql Tue Feb 7 15:33:42 2012
@@ -64,10 +64,14 @@
allow character varying(200) DEFAULT '!all,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 asterisk-commits
mailing list