Connect to The Demo VM Using SSH

localhost:~$ ssh 

Configure Flowroute as the Default Provider

Once connected, drop the root for the remainder of the commands, as shown in the following example:$ su

  1. Using your preferred text editor, edit the Freeswitch config file /etc/freeswitch/vars.xml by changing the default values to the SIP credentials from your Flowroute account:
  2. <X-PRE-PROCESS cmd="set" data=""/><X-PRE-PROCESS cmd="set" data="default_provider_username=[SIP_USERNAME]"/>
    <X-PRE-PROCESS cmd="set" data="default_provider_password=[SIP_PASSWORD]"/>
    <X-PRE-PROCESS cmd="set" data=""/>
    <X-PRE-PROCESS cmd="set" data="default_provider_register=true"/>
  3. Save the changes.

Disable IPV6 Support

IPv6 support must be disabled in Freeswitch.

  • 1. Run the following to delete /etc/freeswitch/sip_profiles/external-ipv6.xml:
  • rm -f /etc/freeswitch/sip_profiles/external-ipv6.xml
  • Restart Freeswitch by running the following:
  • /etc/init.d/freeswitch restart

    Check the registration status in Freeswitch CLI

    At this point the Freeswitch instance should be registered with the Flowroute servers.

    1. Run the following to connect to the Freeswitch CLI:
  • Within fs_cli run the following:
  • sofia status

    This returns your account information and system IP addresses:

    freeswitch@internal> sofia status                     Name    Type                                       Data  State
           alias                                   internal  ALIASED
                     external profile     RUNNING (0) gateway       sip:[SIP_USERNAME]  REGED
                internal-ipv6 profile     RUNNING (0)
                     internal profile     RUNNING (0)
    3 profiles 1 alias

    If the gateway line does not display in a REGED state, verify the credentials set in /etc/freeswitch/vars.xml.

    Download and Edit the Call Anonymizing Script

    With Freeswitch now connected to the Flowroute servers, functionality can be added.

    For the demo environment, a basic two-way call anonymizing script has been added.

    1. Run the following to download the script:
    2. cd /usr/share/freeswitch/scripts/ wget
    3. Open the downloaded file.
    4. Change the following line to include the mobile phone number you want to mask with the anonymizing service. If you are using a US/NANP number, you must include +1.
    local my_cell = "+15554443333"; # Replace this number with the mobile phone number to mask.        
    <extension name="pstn_nat_check">   <condition field="destination_number" expression="^(.*)$">
       <action application="lua" data="pstn_nat.lua"/>

    Configure the Freeswitch Dialplan to Trigger the Script on Receiving a Call

    Each Flowroute demo account has already been assigned an inbound Direct Inward Dialing (DID). Configure the Freeswitch dialplan to trigger the call anonymizing script when an inbound call is received.

    1. Open /etc/freeswitch/dialplan/public.xml in a text editor, and add the following lines within the XML block:
    2. XML
      <extension name="pstn_nat_check">    <condition field="destination_number" expression="^(.*)$">
          <action application="lua" data="pstn_nat.lua"/>

      This triggers the pstn_nat.lua script on any incoming calls.

    3. Run `fs_cli` again to connect to Freeswitch CLI and run `reloadxml`.
    4. Test the Setup

      Log on to the Manage your DIDs page on Flowroute Manage to get your account's assigned DID, and then call the number from any number other than your mobile phone. You should receive the call from the Flowroute DID. Calling that number back from your mobile phone number automatically connects the call back to the original calling number, also showing the Flowroute DID as the calling number. Boom. Call anonymized.