Is there a way to detect and replace/remove a character in the incoming CID?
From our sip provider we receive calls where the incoming CID look like this 12345678#200. What I would like to do is remove or replace the # with the digit 0. Is this some how possible using the module Add Caller ID?
My problem is that the incoming cid can vary in lenght, depending on we receive an international call for instance. So I think I need to find the # some how, since I cant depend on its placement. Even the numbers after the # can vary in length.
Here is an even better way, and should solve your problem. This will cut a string of any length into sections separated with a # then assembles section 1 & digit zero & section 2. It stops working if there is more than one # character:
“WARNING[2207] func_callerid.c: CALLERPRES is deprecated. Use CALLERID(name-pres) or CALLERID(num-pres) instead.”
I tried to add this line in the Set CallerID module on the relevant trunk, but unfortunately it didnt work. I only get the warning on the first call, so it seems I’m not getting it to trigger the module correctly. I can see the CID number is as expected in the log file with the #
shouldn’t be missing from the above…please provide the actual extension and console output from test call. Also you need to put a zero between your two CUT() functions there, if you want to replace #.