Can’t use ‘Follow Me’ because of non e164 caller ID format that get passed on

Hello, I’m not able to make use of Follow Me because calls never get through.

I contacted the trunk provider Voxbeam and I was told that the calls are being rejected by the downstream carrier because the Caller ID is invalid and that I need to format the CLI in e164 format.

Being UK based the calls inbound calls come through like so (London) 02081237333 and then this cid is passed on through Follow Me in the same way 02081237333.
When going through Follow Me the cid numbers need to have the 0 dropped and a 44 added so they get pass on as 442081237333 for example.

I tried to do this a while back but with no success, help!

It is all about “normalizing” the calls , both inbound and outbound

You can do that ideally by normalizing the inbound calls to your locale, the template is in using the inbound context /etc/asterisk/extensions.conf [from-pstn-e164-us] but you need to modify it to


The outbound rule needs to similarly transform your users habit of dialing 0033XXXXXX. for France to +33XXXXXXX.

If you need to get Follow Me working immediately, set Change External CID Configuration to Outside Calls Fixed CID Value and set Fixed CID Value to your main company number (or DDI for the extension, if it has one), starting with the 44 country code. Of course, the destination phone will see your company number, rather than the number of the original caller.

To fix it properly (pass the original caller’s number), you need to adjust the caller ID to suit the trunking provider. Search for macro-dialout-trunk-predial-hook and you’ll find many posts showing this sort of modification.

I’m somewhat puzzled because I have a Voxbeam DDI 44208077XXXX and incoming calls have caller ID in E.164 format. Was the incoming call from another source (different SIP provider, analogue, E1, etc.)? Do just a few calls show the national format? Are you rewriting caller ID on the incoming leg? Are all outbound calls sent via Voxbeam? Please provide some details about your trunks and the number formats used in your system.

IMO your changes should be thought out to also cover other situations, e.g. forwarding, ring groups or queues with external agents, etc.

in a dial string (in or out) + is considered a “meta character” in the UK it is translated to 011 , In NANP land it translates to 011, you need to “normalize” that for both in and out dialing for your customers.
If your carrier does e164, and your users understand it ( they wont) then no problem. Otherwise take the time to replace + with 001 for inbound calls, and similarly replace 001 with + for outbound calls if your carrier requires e164

Thank you both, I didn’t expect to see any responses so soon, I feel confident I’ll get this resolved with help here!

Yes the other providers (incoming) are UK based - Voipfone & Sipgate.

@Stewart1 Thanks I got ‘Follow Me’ working immediately using ‘Change External CID Configuration’ on one freepbx setup.

Ideally I’d like to keep the incoming caller ID’s being displayed on extensions in the standard local way, for example 02081237333 (not 442081237333).

Later today I’ll look into the macro-dialout-trunk-predial-hook

Thanks guys.

I did a quick test with the code below, which should get you started. Add it to extensions_custom.conf with Config Edit and Apply Config.

exten => s,1,GotoIf($["${custom}" != "SIP/Voxbeam"]?exit)
exten => s,n,Noop(Fixing outbound caller ID for Voxbeam)
exten => s,n,ExecIf($["${CALLERID(num):0:2}" = "00"]?Set(CALLERID(num)=${CALLERID(num):2})) ; foreign -> E.164
exten => s,n,ExecIf($["${CALLERID(num):0:1}" = "0"]?Set(CALLERID(num)=44${CALLERID(num):1})) ; UK domestic -> E.164
exten => s,n(exit),MacroExit()

If your Voxbeam trunk is chan_sip, edit the first line to match your trunk name. Unfortunately, I ran into a bug related to pjsip. If your Voxbeam trunk is pjsip, some changes will be needed.

Also, please note that this code does not handle Anonymous or other situations without valid caller ID. I have not tested whether this causes a problem for Voxbeam.

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