Using Voxbeam for outbound calls with FreeSWITCH

Voxbeam is providing worldwide PSTN connectivity at competitive rates, and it allows you to use any Caller ID, which is very convenient for call forwarding. The Voxbeam gateway authenticates the clients by their IP addresses only, so you need a static IP address, and no username or password are required. The FreeSWITCH configuration shown below allows you to control which destinations should be routed to Voxbeam. With a bit of further extension, you can also control which destinations would use different tariff plans at Voxbeam. This configuration covers only their Standard pricing plan. Here INTERNALDOMAIN is a name of the SIP realm that is used for registered users. We assume that the variable “outbound_caller_id_number” is set elsewhere above in the dialplan.

--- File: ip_profiles/external/voxbeam.xml ---
<include>
  <gateway name="voxbeam_outbound">
    <param name="realm" value="sbc.voxbeam.com" />
    <param name="register" value="false" />
    <!-- important, so that your caller ID is transmitted properly -->
    <param name="caller-id-in-from" value="true"/> 
  </gateway>
</include> 

--- File: dialplan/INTERNALDOMAIN/05_pstn_outbound.xml ---
<include>
  <!-- Express destination and caller numbers in E.164 notation without leading plus sign.
       Note that we treat numbers with one leading zero as local Swiss numbers -->
  <extension name="pstn_normalize" continue="true">
    <condition field="destination_number" expression="^00([1-9]\d+)$" break="never">
      <action inline="true" application="set" data="e164_dest=$1"/>
    </condition>
    <condition field="destination_number" expression="^0([1-9]\d+)$" break="never">
      <action inline="true" application="set" data="e164_dest=41$1"/>
    </condition>
    <condition field="${outbound_caller_id_number}" expression="^00([1-9]\d+)$" break="never">
      <action inline="true" application="set" data="e164_cid=$1"/>
    </condition>
    <condition field="${outbound_caller_id_number}" expression="^0([1-9]\d+)$" break="never">
      <action inline="true" application="set" data="e164_cid=41$1"/>
    </condition>
  </extension>

  <!-- Here we define that calls to Russia and Ukraine should go through Voxbeam -->
  <extension name="pstn_select_itsp" continue="true">
    <condition field="${e164_dest}" expression="^(7|38)" break="on-true">
      <action inline="true" application="set" data="outbound_itsp=voxbeam"/>
    </condition>
  </extension>

  <!-- send matched calls to Voxbeam -->
  <extension name="pstn_voxbeam">
    <condition field="${outbound_itsp}" expression="^voxbeam$" break="on-false">
      <action application="set" data="effective_caller_id_number=${e164_cid}"/>
      <action application="bridge" data="sofia/gateway/voxbeam_outbound/0011103${e164_dest}"/>
    </condition>
  </extension>

  <!-- send everything else to Sipcall.ch -->
  <extension name="pstn_sipcall">
    <condition field="destination_number" expression="^(0\d+)$">
      <action application="set" data="effective_caller_id_number=${outbound_caller_id_number}"/>
      <action application="bridge" data="sofia/gateway/sipcall/$1"/>
    </condition>
  </extension>
</include>

This is a very simple example, and a bit more logic can be introduced, such as looking up in some kind of a database for least cost routing, and so on.

 

Advertisements

, , ,

  1. #1 by Aron Einhorn on March 27, 2015 - 6:15 pm

    Thanks for the reference to Voxbeam, their international prices are really cheap.

    I use Callcentric for incoming calls and Google voice for outgoing calls within the USA, i have no problems.

    But unfortunately with Voxbeam the calls are being placed, but there is no audio on both sides.
    Any ideas?

    • #2 by txlab on March 27, 2015 - 7:00 pm

      If you send be a full packet trace, I could have a look

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: