Asterisk 1.6 MySQL

tfransen
Joined: Thu 17 of Jun, 2010

Re: Asterisk 1.6 MySQL

Posted:Thu 17 of Jun, 2010 (18:33 UTC)
Well, I kinda fixed it by adding ` around the table name:

INSERT INTO `bit_test` SET id= 'test'

BUT now when Visual Dialplan saves the sql statement, it addes a bunch of backslashes.

INSERT\ INTO\ \`test\`\ SET\ id=\ \'test\'
tfransen
Joined: Thu 17 of Jun, 2010

Asterisk 1.6 MySQL

Posted:Thu 17 of Jun, 2010 (18:24 UTC)
I am having an issue with my asterisk version 1.6.

Asterisk seems to not be removing the backslashes when it passes my query to the mysql server.

Here is my extensions.conf code:

exten => s,n,MYSQL(Query MYSQL_RESULT ${DATABASE_CONN} INSERT INTO test SET id=\'test\')

On my MySQL server, I get the following in the logs:

Connect root@192.168.0.201 on test
41 Query INSERT INTO test SET id=\'test\'
41 Quit

Which obviously errors out... any ideas how I can fix this?