Facebook tracking pixel
Documentation
Resources
Integration Guides

FreeSWITCH Integration Guide

Share:

Introduction

FreeSWITCH has a module named CID Lookup. We will leverage this module to connect it to the OpenCNAM endpoint and pull the Caller ID information inline with the call as it comes in.

Operation

In this guide, we will be using FusionPBX as well as the command line version of FreeSWITCH. Both will have the same call flows with the GUI or the CLI.

As a call come into the FreeSWITCH box, the CID Lookup module will intercept the call and send it to OpenCNAM to query the Caller ID. Once it receives that information, it will get added to the invite sent to the endpoint. As a result, the endpoint will see the name of the calling party.

Enabling the CID Module

From the FusionPBX screen, go to Advanced -> Modules and find the module called CID LOOKUP. Make sure it is enabled. Save the config and start the process.

FreeSWITCH 1FreeSWITCH 2FreeSWITCH 3

Once the Module is enabled verify that setting took effect from the command line by typing "cidlookup".

FreeSWITCH 4

Configure OpenCNAM

First, create an account with OpenCNAM at www.opencnam.com. Once the account is created, you will receive an SID and an AUTHTOKEN. The SID and AUTHTOKEN can be found by logging into your customer Dashboard. You will need these credentials to configure the module correctly.

Once your account has been created, edit the following file, and add the following lines.

/usr/share/freeswitch/conf/vanilla/autoload_configs/cidlookup.conf.xml

--------------------------------------------
add the following:
<!-- OPENCNAM CONFIG -->
<param name="url" value="https://api.opencnam.com/v3/
phone/+${caller_id_number}?account_sid=SID&auth_token=AUTH_TOKEN"/>
--------------------------------------------

Comment out the following line containing "odbc-dsn"

Save the file and then from the CLI, reload the CID Lookup module.

FreeSWITCH 5

At this point, OpenCNAM is configured and the CID Lookup module in FreeSWITCH is enabled. Now we just need to add it to the dial plan to make this work.

Adding Dial Plan

Go to Dial Plan -> Inbound Routes

  1. Create a route in the public context and make it Global in case of multi-tenant use. Give it an order of 2 so that no other route will ever come before this one.
    • Set destination number to whatever number of digits you receive from the carrier
    • Set action to call_direction=inbound
    • Set action to effective_caller_id_name=${cidlookup(${caller_id_ number})}
    • Set the effective_caller_id_name line to inline=true

FreeSWITCH 6

Once this piece is done, CNAM will be enabled, but you will still need to add it to each individual DID. So again, go to dial plan -> Inbound Routes and select the DID you would like to enable CNAM on.

  1. Add action to effective_caller_id_name=${cidlookup(${caller_id_ number})} before the call gets transferred to an extension.

FreeSWITCH 7

If you are not using the GUI, you will need to add the following to your dial plan:

<extension name="cnam" continue="true">
  <condition field="context" expression="public">
    <action application="set" data="caller_id_
name=${cidlookup(${caller_id_number})}"/>
  </condition>
</extension>

Test it and make sure that the CNAM is working as expected.

Troubleshooting

  1. If you are seeing "UNKNOWN" in the Caller ID, please verify that you are getting 200 result codes and not 400 or 404.
  2. Validate that you have funds in your OpenCNAM account.
  3. Make sure that the CID Lookup service is enabled and started by going to the modules section and checking. Also try to reload mod_cidlookup from the CLI.
  4. Look at the CLI and see what the call is doing. Make sure it is going out to OpenCNAM.

Support / Assistance

We are happy to assist with your integration. Our team can be reached in any of the following ways:

Phone: +1-888-315-8356 (TELO) or +1-678-631-8356 (TELO)
Email: support@opencnam.com

Overview

OpenCNAM has several interfaces available through which customers may perform CNAM queries. This document details the system and method for querying OpenCNAM using a RESTful API and provides integration instructions for FreeSwitch. FreeSWITCH has a module named CID Lookup. We will leverage this module to connect it to the OpenCNAM endpoint and pull the Caller ID information inline with the call as it comes in.

Support / Assistance

We are happy to assist with your integration. Our team can be reached in any of the following ways:

Phone: +1-888-315-8356 (TELO) or +1-678-631-8356 (TELO)
Email: support@opencnam.com

Ready to integrate OpenCNAM?

GET STARTED Try it free! No card required.