[OpenSIPS-Devel] [OpenSIPS/opensips] 8f5489: Fix dialplan module when using db_text backend.

Bogdan-Andrei Iancu bogdan at opensips.org
Fri Jun 24 16:24:12 CEST 2016


  Branch: refs/heads/2.2
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 8f548976389ee3968bf06f649b54d88db694f949
      https://github.com/OpenSIPS/opensips/commit/8f548976389ee3968bf06f649b54d88db694f949
  Author: Bogdan-Andrei Iancu <bogdan at opensips.org>
  Date:   2016-06-24 (Fri, 24 Jun 2016)

  Changed paths:
    M db/schema/dialplan.xml
    M modules/dialplan/dialplan.c
    M modules/dialplan/dp_db.c
    M scripts/dbtext/opensips/dialplan
    M scripts/mysql/dialplan-create.sql
    M scripts/postgres/dialplan-create.sql
    M scripts/sqlite/dialplan-create.sql

  Log Message:
  -----------
  Fix dialplan module when using db_text backend.

The db_text makes no difference between NULL or "empty string" values in DB -> both are internally translated as NULL . The dialplan module, in a very abusive way, forces "not null" (in DB schema and in the code for data validation) even for columns that are optional (like subst_exp, repl_exp, timerec and attrs). Besides being bogus (if a column is not to be used, you have to set it to empty string rather than let it NULL), it makes impossible the usage of db_text with dialplan.
This fix allows (DB and code) the mentioned DB columns to be also NULL.
The change is backward compatible, it should not break any existing usage of the dialplan module.




More information about the Devel mailing list