FreeSWITCH has a module named CID Lookup (mod_cidlookup). We will leverage this module to connect it to the SuperCNAM endpoint and pull the Caller ID information inline with the call as it comes in.
CID Lookup Module Setup
- Edit the modules.conf.xml file (usually in the /etc/freeswitch/autoload_configs/ directory) and make sure there is a line like:
<load module="mod_cidlookup"/> - Edit the cidlookup.conf.xml file, (usually in the /etc/freeswitch/autoload_configs/ directory) and delete its content and put the following:
<configuration name="cidlookup.conf" description="cidlookup Configuration">
<settings>
<param name="url" value = "https://query.supercnam.com/vA/${caller_id_number}"/>
<param name="cache" value="true"/>
<param name="cache-expire" value="86400"/>
</settings>
</configuration> - Apply the changes. You can do it by restarting FreeSWITCH or load/reload de module.
- To restart the FreeSWITCH daemon, try service freeswitch restart if you are in a SystemV system or systemctl restart freeswitch if you are in a SystemD system.
- To load the module, inside fs_cli type load mod_cidlookup.
- To reload the module, inside fs_cli type reload mod_cidlookup.
Dialplan Configuration
- Add or edit a dialplan that executes at the very beginning of an incoming call. For example:<extension name="caller-details" continue="true" ><condition field="" expression="" break="never"><action application="set" data="caller_id_name = ${cidlookup(${caller_id_number})}" inline="true"/><action application="set" data="effective_caller_id_name = ${caller_id_number}" inline="true"/></condition></extension>
Optionally, you may want to put a pre_answer before the set lines. - Restart FreeSwITCH daemon or inside fs_cli type reloadxml.