When is the right time to implement Least Cost Routing?
Election time is upon us, and lots of our customers are getting hit with unwanted dialer traffic (some people refer to this as robocalls). To combat this, here is a simple albeit far from fool-proof way to limit the amount of calls being sent from particular users.
The advantages of using Redis for this are as follows:
- It is a very light-weight solution
- It's configured with a time to live (TTL) so that blocks will fall off over time
- This solution is highly configurable
- It's very easy to troubleshoot
The following is the base configuration that belongs in your opensips.cfg. It rejects all calls from a unique From URI after that From URI exceeds 50 calls per minute. Simple modifications will allow you to adjust based upon your business rules. For example, limiting by Request URI would easy with a few simple changes this.
First we load the redis module and connect to the Redis server.
Create the rate limiter route. $fu, ttl and max values can easily be changed to something more appropriate for your setup.
Finally call the route, check the return value, then take action. In this case, send a 480 reply.
It's easy to add a maximum duration to calls with openSIPS.
openSIPS is powerful tool...if you know how to use it.
Download multiple Slinger files at once using a handy Firefox add-on.