Add 00 country code to incoming caller id

Have the following problems

Dutch incoming trunk.
typically dutch callers have a caller id’s start with 0 example 020 amsterdam than the number example 0201234567

Our calls are sometime forwarded to a mobile phone.
The trunk provider lets us set any caller id as long as 00 country code is used.
If 00 is not used anonyous is shown.

This means we need to modify incoming caller id.

if caller id starts with 0Z this should be replaced with 0031
if caller id starts with 00 the caller id should remain the same

Calls are normaly sent to a ring group
the ring group has normal voip extensions but also a mobile number set as extension. The modified incoming caller if should be transfered

I have read several ways how to do this but after 3 hours testing and trialing I give up, I can’t get it to work.

In elastix I modified the extensions_custom.conf and can see in the log things happen but only failures. Either the call does not come thru or no change in caller id.

Hope someone can help me with this.

Tried addin this to extesnions_custom.conf

[from-trunk-custom]
exten => _X!,1,Set(CALLERID(num)=0031${CALLERID(num):1:10})
exten => _X!,n,Goto(from-trunk,${EXTEN},1)

added this to trunk peer settings: context=from-trunk-custom

got following error message: rejected because extension not found in context ‘from-trunk-custom’.