How to remove plus signs from CallerID in FreePBX

Howto


Many times Incoming phone calls (especially on SIP trunks) will contain a “+” on the CallerID. This can be annoying for users who try to call back numbers from their call history on their phones. The following solution fixes this problem at the root.

Edit /etc/asterisk/extensions_custom.conf and add the following custom context to it:

[from-trunk-remove-plus]
exten => _X!,1,GotoIf($["${CALLERID(num):0:2}" != "+1"]?noplusatstart)
exten => _X!,n,Set(CALLERID(num)=${CALLERID(num):1})
exten => _X!,n(noplusatstart),Goto(from-trunk,${EXTEN},1)

By default. Incoming phone calls that are coming from some sort of trunk are going to be placed inside the “from-trunk” context. What you want to do is change this context to the one we just created so the dialplan that removes the plus is applied. To do so, you need to edit your trunk configuration inside FreePBX and under the Peer section modify the context to “from-trunk-remove-plus”

Save and then click Apply Changes from the FreePBX GUI

After the changes are applied, “+” should no longer show up on incoming CallerIDs and wont be on the recording filename either.

The information was gathered from this article.