Skip to main content

Calls not being recorded with special character in CID

Posted by acraft on Tue, 02/13/2018

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


Submitted by volodya on Tue, 02/13/2018 Permalink

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.

Submitted by acraft on Wed, 02/14/2018 Permalink

Volodya,

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

-Andrew

Submitted by volodya on Mon, 02/19/2018 Permalink

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

Submitted by acraft on Wed, 02/28/2018 Permalink

Volodya,

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

Andrew