]> git.ipfire.org Git - thirdparty/asterisk.git/commit
channels/chan_sip: Fix RealTime error during SIP unregistration with MariaDB
authorMatthew Jordan <mjordan@digium.com>
Wed, 11 Feb 2015 17:11:41 +0000 (17:11 +0000)
committerMatthew Jordan <mjordan@digium.com>
Wed, 11 Feb 2015 17:11:41 +0000 (17:11 +0000)
commite5d1dbafe0dddbb361f88709f42543e90452bdd1
tree3d4aa3e2d72ecd735a3ee79ced90813fef02f8d9
parentb1720c411def49a55079f9c669e2735e34a16d4c
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)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@431673 65c4cc65-6c06-0410-ace0-fbb531ad65f3
channels/chan_sip.c