CallerID change


we have a problem in FreePBX. Some numbers are coming from our provider in 9955XXXXXXXX format.
Some numbers as 5XXXXXXXX. Because of it we have problems in CRM.
How can we get rid of 995 on Callid of icomung call?

Pretty sure that’s something you’ve gotta do in a custom dial plan.

Do you mean I need to make changes in configuration files?
If so, as I can guess I need to analyze dial plan in extensions file, right?
As I see it is a bit complex file with many incudes in it, so is there any means to amalyze it quickly, or I need to copy/paste all inclusions and create a big file and then look through it?

As in programming in asterisk. This might be a good starting point:

1 Like

Create a Set CallerID object with Destination same as your Inbound Route is now.
Set CallerID Name to ${CALLERID(name)} and
set CallerID Number to ${CALLERID(num):-9}

Then, change the Inbound Route to point to the Set CallerID object.

This assumes that all affected numbers have 9 digits after the 995 and no unaffected numbers are longer than 9 digits. Otherwise, you need a more complex rule.

1 Like

Much better solution! Thanks Stewart.

Thank you.

One mode question please.
Say I will need a bit more complex change of CallerID and create a custom dial plan like, say this:

exten => _X.,1,NoOp(-------- fixed CID begin --------)

same => n,NoOp(“${LEN(${CALLERID(num)})}”)
same => n,NoOp(“${CALLERID(num)}”)

same => n,GotoIf($[${LEN(${CALLERID(num)})}=12]?fix12)

same => n(fix12),Set(CALLERID(num)=${CALLERID(num):0:11})
same => n,NoOp(-------- fix12 CID end --------)
same => n,Goto(from-trunk,${EXTEN},1)

How should I put it inside existing dial plan?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.