Outbound CID how to add +country code


My SIP provider expects CID/DID numbers in format:
+country code - area code - number

How to add +country code to CID.

My extensions is in format area code - number

For incoming calls I will delete + country code: as in from-pstn-e164-us

They expect the CID, or the dialed number to be with the country code?

Can you provide an example with numbers of what you want?


I will try to explain

Incoming call to my FreePBX:
CID: + country code - area code - number
DID: + country code - my extension

  1. I want to delete from CID “+ country code” if it is +44
  2. I want to delete from DID “+ country code” because my extension is 113334455 and not +44113334455

An outgoing connection from my FreePBX
CID: my extension
DID: area code - number

  1. I want to add to the CID “+ country code” (+44)
  2. I want to add to the DID “+ country code” (+44) if the dialed number is “area code - number”, or change 00 to +

I agree with the concept but not the specifics. Your internal format should match what is used on UK landlines and mobiles.

On an incoming call from London, you would change +442072345678 to 02072345678. On a call from Paris, you would change +33123456789 to 0033123456789. If the called number comes in as +44113334455 it would be changed to 0113334455. These changes would be done with a custom context similar to from-pstn-e164-us, but modified for UK.

On outgoing calls, you would define [macro-dialout-trunk-predial-hook] to rewrite caller ID. See

Rewriting the outbound number can be done in the Dialed Number Manipulation Rules for the trunk.

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