[svn-commits] tilghman: branch 1.6.1 r247790 - in /branches/1.6.1: ./ channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Feb 18 15:49:40 CST 2010


Author: tilghman
Date: Thu Feb 18 15:49:35 2010
New Revision: 247790

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=247790
Log:
Merged revisions 247787 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r247787 | tilghman | 2010-02-18 15:42:53 -0600 (Thu, 18 Feb 2010) | 17 lines
  
  If the peer record is from realtime, it could be set to 0, due to MySQL not representing NULL well in integer columns.
  
  NULL means the value is not specified for the column, which normally means
  the driver uses whatever is the default value.  However, on MySQL, placing
  a NULL in either a float or integer column results in a retrieval of the 0
  value.  Hence, users get an errant error on load.  This patch suppresses
  that error and makes the value as if it was not there.
  
  Note that this cannot be done in the realtime driver, because the lack of
  difference between NULL and 0 can only be intepreted correctly by the
  driver itself.  If we did it in the realtime driver, then it would be
  effectively impossible to set any realtime field to 0, because it would act
  as if the field were unspecified and possibly take on a different value.
  
  (closes issue #16683)
   Reported by: wdoekes
........

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

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.1/channels/chan_sip.c?view=diff&rev=247790&r1=247789&r2=247790
==============================================================================
--- branches/1.6.1/channels/chan_sip.c (original)
+++ branches/1.6.1/channels/chan_sip.c Thu Feb 18 15:49:35 2010
@@ -22897,7 +22897,12 @@
 			} else if (!strcasecmp(v->name, "port")) {
 				peer->portinuri = 1;
 				if (!(port = port_str2int(v->value, 0))) {
-					ast_log(LOG_WARNING, "Invalid peer port configuration at line %d : %s\n", v->lineno, v->value);
+					if (realtime) {
+						/* If stored as integer, could be 0 for some DBs (notably MySQL) */
+						peer->portinuri = 0;
+					} else {
+						ast_log(LOG_WARNING, "Invalid peer port configuration at line %d : %s\n", v->lineno, v->value);
+					}
 				}
 			} else if (!strcasecmp(v->name, "callingpres")) {
 				peer->callingpres = ast_parse_caller_presentation(v->value);




More information about the svn-commits mailing list