func_odbc: Add SQL_ESC_BACKSLASHES dialplan function.

Some databases depending on their configuration using backslashes
for escaping. When combined with the use of ' this can result in
a broken func_odbc query.

This change adds a SQL_ESC_BACKSLASHES dialplan function which can
be used to escape the backslashes.

This is done as a dialplan function instead of being always done
as some databases do not require this, and always doing it would
result in incorrect data being put into the database.

ASTERISK-29838

Change-Id: I152bf34899b96ddb09cca3e767254d8d78f0c83d
This commit is contained in:
Joshua C. Colp
2022-02-10 08:02:23 -04:00
committed by Joshua Colp
parent ca53a8a833
commit 1e3ffda3db
3 changed files with 46 additions and 4 deletions

View File

@@ -36,6 +36,10 @@
; to use the dialplan function SQL_ESC() to escape the data prior to its
; inclusion in the SQL statement.
;
; If you have data which may potentially contain backslashes, you may wish to
; use the dialplan function SQL_ESC_BACKSLASHES() to escape the backslashes.
; Note that not all databases may require escaping of the backslashes.
;
;
; The following options are available in this configuration file:
;