About
mod_hiredis implements an interface for running basic redis commands on configured servers and also deprecated old mod_redis implementing the limit backend.
Loading
Once you have installed FreeSWITCH from packages, configure FreeSWITCH to load mod_hiredis in autoload_configs/modules.conf.xml by uncommenting the line:
<load module="mod_hiredis"/>
Configuration
Edit the redis server connection configuration in autoload_configs/hiredis.conf.xml
and set the hostname, password, and port as applicable.
Configuration example:
<configuration name="hiredis.conf" description="mod_hiredis"> <profiles> <profile name="default"> <connections> <connection name="primary"> <param name="hostname" value="172.18.101.101"/> <param name="password" value="redis"/> <param name="port" value="6379"/> <param name="timeout_ms" value="500"/> </connection> <connection name="secondary"> <param name="hostname" value="localhost"/> <param name="password" value="redis"/> <param name="port" value="6380"/> <param name="timeout_ms" value="500"/> </connection> </connections> <params> <param name="ignore-connect-fail" value="true"/> </params> </profile> </profiles> </configuration>
Connection parameters:
hostname
: DNS hostname or IP address of the server (default:localhost
)port
: TCP port where Redis server is listening (default:6379
)password
: if set, the AUTH command is sent to the server (default: no authentication)timeout_ms
: timeout waiting for the server connection, in milliseconds (default:500
)
From fs_cli, apply the changes:
reloadxml reload mod_hiredis