[Home]

Summary:ASTERISK-15387: [patch] Realtime is broken, blank strings aren't valid any more
Reporter:Sergey Tamkovich (sergee)Labels:
Date Opened:2010-01-02 16:03:44.000-0600Date Closed:2010-01-04 12:44:17.000-0600
Priority:MajorRegression?Yes
Status:Closed/CompleteComponents:Addons/res_config_mysql
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 200100104__issue16533.diff.txt
( 1) aa160-r1082.diff
Description:For a few years i've used a blank strings for values that i didn't wish to specify. Recent commit into asterisk-addons 1.6.0 (revision 1070) broke everything. A lot of problems arise, since my blank values aren't blank anymore. For example, former blank fields 'fromuser' and 'fromdomain' become not blank with this patch, and i get an error: SIP/2.0 400 Bad Request – ‘Malformed/Missing FROM: field’.
Because my From header looks like this: From: "1000" <sip: @ >tag=as3e28b5d2

This problem doesn't have a simple solution, if you wish to support two different blank values (empty strings and NULL) you should implement that in the asterisk first. Replacing either value with non-empty strings is a very bad idea, because there will be a lot of problems in both cases.

For now i wish that change would be reverted. Thank you in advance!
Comments:By: Tilghman Lesher (tilghman) 2010-01-04 10:39:47.000-0600

Patch uploaded against Asterisk 1.6.0.

By: Sergey Tamkovich (sergee) 2010-01-04 12:22:59.000-0600

Works fine, thank you! but i would suggest one more change.

Why not to keep blank string unchanged from database to asterisk functions?
NULL is a special case, so let's invent something (e.g. ' ') for NULL values, and not for blank strings.

By: Tilghman Lesher (tilghman) 2010-01-04 12:40:04.000-0600

Well, the actual problem is that you're not using the NULL values in the database to specify that you don't want the values.  While this worked for you before, it wasn't exactly to specification, so it was open to change.

In realtime, if you want the default values for a column, you should specify the value as NULL, not blank.

By: Digium Subversion (svnbot) 2010-01-04 12:42:11.000-0600

Repository: asterisk
Revision: 237410

U   trunk/main/config.c

------------------------------------------------------------------------
r237410 | tilghman | 2010-01-04 12:42:11 -0600 (Mon, 04 Jan 2010) | 7 lines

Further reduce the encoded blank values back to blank in the realtime API.
(closes issue ASTERISK-15387)
Reported by: sergee
Patches:
      200100104__issue16533.diff.txt uploaded by tilghman (license 14)
Tested by: sergee

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=237410

By: Digium Subversion (svnbot) 2010-01-04 12:43:04.000-0600

Repository: asterisk
Revision: 237411

_U  branches/1.6.0/
U   branches/1.6.0/main/config.c

------------------------------------------------------------------------
r237411 | tilghman | 2010-01-04 12:43:04 -0600 (Mon, 04 Jan 2010) | 14 lines

Merged revisions 237410 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r237410 | tilghman | 2010-01-04 12:42:10 -0600 (Mon, 04 Jan 2010) | 7 lines
 
 Further reduce the encoded blank values back to blank in the realtime API.
 (closes issue ASTERISK-15387)
  Reported by: sergee
  Patches:
        200100104__issue16533.diff.txt uploaded by tilghman (license 14)
  Tested by: sergee
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=237411

By: Digium Subversion (svnbot) 2010-01-04 12:43:40.000-0600

Repository: asterisk
Revision: 237412

_U  branches/1.6.1/
U   branches/1.6.1/main/config.c

------------------------------------------------------------------------
r237412 | tilghman | 2010-01-04 12:43:40 -0600 (Mon, 04 Jan 2010) | 14 lines

Merged revisions 237410 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r237410 | tilghman | 2010-01-04 12:42:10 -0600 (Mon, 04 Jan 2010) | 7 lines
 
 Further reduce the encoded blank values back to blank in the realtime API.
 (closes issue ASTERISK-15387)
  Reported by: sergee
  Patches:
        200100104__issue16533.diff.txt uploaded by tilghman (license 14)
  Tested by: sergee
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=237412

By: Digium Subversion (svnbot) 2010-01-04 12:44:16.000-0600

Repository: asterisk
Revision: 237413

_U  branches/1.6.2/
U   branches/1.6.2/main/config.c

------------------------------------------------------------------------
r237413 | tilghman | 2010-01-04 12:44:16 -0600 (Mon, 04 Jan 2010) | 14 lines

Merged revisions 237410 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r237410 | tilghman | 2010-01-04 12:42:10 -0600 (Mon, 04 Jan 2010) | 7 lines
 
 Further reduce the encoded blank values back to blank in the realtime API.
 (closes issue ASTERISK-15387)
  Reported by: sergee
  Patches:
        200100104__issue16533.diff.txt uploaded by tilghman (license 14)
  Tested by: sergee
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=237413