Free US number and Caller ID manipulation

Callcentric offers US numbers in NY area code, with zero recurring costs. This is very convenient if you want your USA customers to connect to your PBX. After ordering a free number, you create a SIP account and route the DID to it. The service allows to register multiple free numbers. Forwarding to SIP URI is not supported.

Upon receiving a call, the caller ID in From field will look like 16313335447, with the country code without any leading symbols. The following piece of FreeSWITCH configuration (in public context) alters the caller ID in order to look like a normal number in a European dial plan:

  <extension name="intl_normalize" continue="true">
    <!-- remove Swiss country code -->
    <condition field="${caller_id_number}" expression="^41(\d+)" break="on-true">
      <action application="set" data="effective_caller_id_number=0$1"/>
      <action application="set" data="effective_caller_id_name=0$1"/>
    </condition>
    <!-- add 00 in front of country code -->
    <condition field="${caller_id_number}" expression="^[1-9]" break="on-true">
      <action application="set" data="effective_caller_id_number=00${caller_id_number}"/>
      <action application="set" data="effective_caller_id_name=00${caller_id_number}"/>
    </condition>
  </extension>

It is important to set both effective_caller_id_number and effective_caller_id_name variables. If only effective_caller_id_number is set, the effective_caller_id_name still keeps the original caller ID number, and if the call is bridged to a local extension, the SIP phone may want to use it for displaying the caller.

 

 

Advertisements

, , ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: