[asterisk-commits] mjordan: branch 13 r431674 - in /branches/13: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 11 11:12:10 CST 2015


Author: mjordan
Date: Wed Feb 11 11:12:08 2015
New Revision: 431674

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=431674
Log:
channels/chan_sip: Fix RealTime error during SIP unregistration with MariaDB

When a SIP device that has its registration stored in RealTime unregisters,
the entry for that device is updated with blank values, i.e., "", indicating
that it is no longer registered. Unfortunately, one of those values that is
'blanked' is the device's port. If the column type for the port is not a
string datatype (the recommended type is integer), an ODBC or database error
will be thrown. MariaDB does not coerce empty strings to a valid integer value.

This patch updates the query run from chan_sip such that it replaces the port
value with a value of '0', as opposed to a blank value. This is the value that
other database backends coerce the empty string ("") to already, and the
handling of reading a RealTime registration value from a backend already
anticipates receiving a port of '0' from the backends.

ASTERISK-24772 #close
Reported by: Richard Miller
patches:
  chan_sip.diff uploaded by Richard Miller (License 5685)
........

Merged revisions 431673 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    branches/13/   (props changed)
    branches/13/channels/chan_sip.c

Propchange: branches/13/
------------------------------------------------------------------------------
--- branch-11-merged (original)
+++ branch-11-merged Wed Feb 11 11:12:08 2015
@@ -1,1 +1,1 @@
-/branches/11:1-429517,429539,429632,429783,429804,429825,429867,429893,429982,430009,430126,430415,430487,430506,430564,430589,430795,430798,430920,430993,430996-430997,431049,431135,431187,431218,431384,431423,431617,431662,431669
+/branches/11:1-429517,429539,429632,429783,429804,429825,429867,429893,429982,430009,430126,430415,430487,430506,430564,430589,430795,430798,430920,430993,430996-430997,431049,431135,431187,431218,431384,431423,431617,431662,431669,431673

Modified: branches/13/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/channels/chan_sip.c?view=diff&rev=431674&r1=431673&r2=431674
==============================================================================
--- branches/13/channels/chan_sip.c (original)
+++ branches/13/channels/chan_sip.c Wed Feb 11 11:12:08 2015
@@ -15900,7 +15900,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", "0", SENTINEL);
+			ast_update_realtime(tablename, "name", peer->name, "fullcontact", "", "ipaddr", "", "port", "0", "regseconds", "0", "regserver", "", "useragent", "", "lastms", "0", SENTINEL);
 		} else {
 			ast_db_del("SIP/Registry", peer->name);
 			ast_db_del("SIP/RegistryPath", peer->name);




More information about the asterisk-commits mailing list