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

Bogdan-Andrei Iancu bogdan at opensips.org
Mon Jun 27 10:18:35 CEST 2016


  Branch: refs/heads/1.11
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 947b923e37f9aa90126272fd366fa77bef3dd16e
      https://github.com/OpenSIPS/opensips/commit/947b923e37f9aa90126272fd366fa77bef3dd16e
  Author: Bogdan-Andrei Iancu <bogdan at opensips.org>
  Date:   2016-06-27 (Mon, 27 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

  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.

(cherry picked from commit 8f548976389ee3968bf06f649b54d88db694f949)
(cherry picked from commit 618ff9254472e6f4e3c4af6f49b7513bbd49593d)




More information about the Devel mailing list