Skip to main content

TL_RECORDING not inserting calls into DB correctly when CallerID contains comma

Posted by matthewmalk248 on Thu, 05/31/2018

I'm wondering if I'm missing something in my script that I use to record hunt lists. I use the TL_RECORDING ODBC call, and about 95/100 it records and inserts an entry into the 'recording' database table just fine, but when a call comes in and the ${CALLERID(name)} contains a comma (e.g. "DOE,JOHN" ) It causes the last 3 fields of the insert to be incorrect. Basically the comma is causing the persons first name to be stored as the DID in the database record.

Is my formatting missing something? Or should I modify the caller ID name in someway to remove the comma from the caller Id name before it hits TL_RECORDING.

exten => s,n,NoOp(result=${TL_RECORDING(${UNIQUEID},${RELPATHTORECORDING},${RECORD_CALLER},${RECORD_CALLEE},queue,${TOUCH},${CALLERID(num)},${ARG1},${CALLERID(name)},${DIALED_NUMBER},${STRFTIME(,,%F-%H-%M-%S)},${TOUCH},${tenant})})


Submitted by matthewmalk248 on Mon, 06/04/2018 Permalink

As in modifying the ${CALLERID(num)} variable itself and finding the comma, then inserting backslashes in front of that? To be honest I don't know where to begin on trying to do that with Asterisk code :/

Submitted by eeman on Mon, 06/04/2018 Permalink

in PHP the function is AddSlashes, check to see if there is a application or function that does the same thing in asterisk dialplan.