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 Gerrit
parent b369ac56e3
commit 77adb9998f
3 changed files with 46 additions and 4 deletions

View File

@@ -0,0 +1,7 @@
Subject: func_odbc
A SQL_ESC_BACKSLASHES dialplan function has been added which
escapes backslashes. Usage of this is dependent on whether the
database in use can use backslashes to escape ticks or not. If
it can, then usage of this prevents a broken SQL query depending
on how the SQL query is constructed.