Function description: Filter the number of the call
step:
1. Compile the mod_blacklist module: Go to the source directory /usr/local/src/freeswitch --> make mod_blacklist-install
2. Load mod_blacklist module: fs_cli --> reload mod_blacklist or modules.conf.xml Add --> <load module="mod_blacklist"/> Restart FS
3. Set mod_blacklist module: The default blacklist.conf.xml is as follows:
<configuration name="mod_blacklist.conf" description="Blacklist module">
<lists>
<list name=" example " filename "/usr/local/freeswitch/blacklists/blocked.list"/>
</lists>
</configuration>
Create a blocked.list in the /usr/local/freeswitch/blacklists directory, enter the contents of the blacklist, one per line, save, modify the user group of the file to be the same as the FS, and read and write permissions.
4. set the dialing rules:
1> To call out the blacklist restriction, add the following rule in the default.xml
<extension name="blacklist_check">
<condition field="${blacklist(check example ${destination_number})}" expression="^true$">
<action application="answer" data=""/>
<action application="playback" data="$${base_dir}/sounds/music/city_of_sky.wav"/>
<action application="hungup" data=""/>
</condition>
</extension>
2> For the blacklist restriction, add the following rules to the top of public.xml
<extension name="blacklist_check">
<condition field="${blacklist(check example ${caller_id_number})}" expression="^true$">
<action application="answer" data=""/>
<action application="playback" data="$${base_dir}/sounds/music/Speak.wav"/>
<action application="hangup" data=""/>
</condition>
</extension>
Note: The inbound and outbound blacklists above are all placed on the blacklist list name= example. You can also split the inbound and outbound calls into separate files. You only need to modify the corresponding listname value in the re-dial rules.
5, Blacklist API:
>blacklist help