5 posts / 0 new
Last post
acraft
acraft's picture
Joined: 2015/08/31
Points: 0

Calls are not being recorded when there's a special character in the CID name, in this case an apostrophe ('). We have call recording enabled on a queue. Below are the error messages we received. The CID name in question is "D'AMICO EDWARD". We're on version 8.3.1.1. Any assistance would be appreciated.

[2018-02-08 16:51:17] WARNING[24709][C-0000e106] func_odbc.c: SQL
Execute returned an error -1: 42000: [MySQL][ODBC 5.1
Driver][mysqld-5.1.73-log]You have an error in your SQL syntax; check
the manual that corresponds to your MySQL server version for the right
syntax to use near 'AMICO EDWARD <9876543210>', '1234567890',
'2018-02-08 16:50:55' ,'', 'exampl (269)
[2018-02-08 16:51:17] WARNING[24709][C-0000e106] func_odbc.c: SQL Exec
Direct failed (-1)![call
set_recording('localhost-1518126605.204002.1',
'queues/Sales-exampletenant/2018/02/08/queue-Sales-exampletenant-2018-02-08-16-50-55-9876543210-exampletenant-localhost-1518126605.204002.1.wav49',
'', '', 'queue', '', '9876543210', 'Sales-exampletenant',
'Queue-D'AMICO EDWARD <9876543210>', '1234567890', '2018-02-08
16:50:55' ,'', 'exampletenant')]
[2018-02-08 16:51:17] WARNING[24709][C-0000e106] func_odbc.c: SQL
Execute returned an error -1: 42000: [MySQL][ODBC 5.1
Driver][mysqld-5.1.73-log]You have an error in your SQL syntax; check
the manual that corresponds to your MySQL server version for the right
syntax to use near 'AMICO EDWARD <9876543210>', '1234567890',
'2018-02-08 16:50:55' ,'', 'exampl (269)
[2018-02-08 16:51:17] WARNING[24709][C-0000e106] func_odbc.c: SQL Exec
Direct failed (-1)![call
set_recording('localhost-1518126605.204002.1',
'queues/Sales-exampletenant/2018/02/08/queue-Sales-exampletenant-2018-02-08-16-50-55-9876543210-exampletenant-localhost-1518126605.204002.1.wav49',
'', '', 'queue', '', '9876543210', 'Sales-exampletenant',
'Queue-D'AMICO EDWARD <9876543210>', '1234567890', '2018-02-08
16:50:55' ,'', 'exampletenant')]
[2018-02-08 16:51:17] ERROR[24709][C-0000e106] func_odbc.c: Unable to
execute query [call set_recording('localhost-1518126605.204002.1',
'queues/Sales-exampletenant/2018/02/08/queue-Sales-exampletenant-2018-02-08-16-50-55-9876543210-exampletenant-localhost-1518126605.204002.1.wav49',
'', '', 'queue', '', '9876543210', 'Sales-exampletenant',
'Queue-D'AMICO EDWARD <9876543210>', '1234567890', '2018-02-08
16:50:55' ,'', 'exampletenant')]

-Andrew

volodya
volodya's picture
Joined: 2017/01/05
Points: 100

Hello Andrew,

You can check and modify CallerID name by uncommenting and customizing from-outside-fixinbound context in
/etc/asterisk/special_features_custom_inbound.include configuration file. Please let me know if you need assistance.

acraft
acraft's picture
Joined: 2015/08/31
Points: 0

Volodya,

Thanks for the quick response. Could you provide some specific pointers on doing this? Thanks!

-Andrew

volodya
volodya's picture
Joined: 2017/01/05
Points: 100

Hello Andrew,

Below is an example of from-outside-fixinbound context that will remove all ' characters from CallerID Name variable. Please be sure to test it outside of business hours to be safe in case your system has some spesific configuration.

[from-outside-fixinbound]
exten => _.X.,1,NoOp(CHAN=${CHANNEL(name)} PEER=${CHANNEL(peername)} CID=${CALLERID(num)} CIDN=${CALLERID(name)})

exten => _.X.,n,Set(CALLERID(name)=${STRREPLACE(CALLERID(name),"'","")})
exten => _.X.,n,NoOp(Updated CIDN=${CALLERID(name)})

exten => _.X.,n,Return

acraft
acraft's picture
Joined: 2015/08/31
Points: 0

Volodya,

Thanks! The CNAM fix worked with minor modification to existing script.

Andrew