FreeSWITCH中文网,电话机器人开发网 ,微信订阅号:

FreeSWITCH及VOIP,Openser,电话机器人等产品中文技术资讯、交流、沟通、培训、咨询、服务一体化网络。QQ群:293697898

如何限制FreeSWITCH单位时间内的通话次数


tags:FreeSWITCH 限制通话 创建时间:2015-09-04 22:10:07

有没有对用户拨打的电话次数做限制的,一个分钟只能拨打多少次什么的

FreeSWITCH Limit中可以查到:

Dialplan Apps

The limit dialplan apps are implemented by mod_dptools.
limit
limit <backend> <realm> <resource> <max[/interval]> [<transfer_destination_number> [<dialplan> [<context>]]
backend
The backend to use.
realm
Arbitrary name
resource
The resource on which to limit the number of calls.
max
The maximum number of concurrent calls allowed to pass or a call rate in calls/sec. If not set or set to a negative value the limit application only acts as a counter.
The interval argument is ONLY supported by the hash backend.
transfer_destination_number
Transfer to this extension in the dialplan. It's optional. If you don't give it, limit transfers to 'limit_exceeded' extension in the current dialplan and context.

limit_execute
Execute requested APP only if resource has not reached its limit
limit_execute <backend> <realm> <resource> <max[/interval]> <application> [application arguments]
backend
The backend to use.
realm
Arbitrary name to group together different resources.
resource
The resource on which to limit application execution
max
The maximum number of concurrent executions or an interval in executions/sec. If set to a negative value then there is no limit; the limit system simply acts as a counter. Setting the value to zero will set a limit of zero, meaning no concurrent executions.
application
The application to execute
application arguments
The optional application arguments
API

The limit APIs are implemented by mod_commands. You can also use them via the dialplan like so:
<action application="set" data="api_result=${limit_usage(<backend> <realm> <id></pre>)}"/>
limit_reset
Resets a given limit backend.
DB: deletes ALL entries for that hostname.
Redis: finds all used keys and sets them to 0.
Hash: not implemented.
API: limit_reset <backend>
limit_status
Retrieve current status of a given backend. Only supported in DB, not hash or redis.
API: limit_status <backend>
limit_usage
Retrieve current usage for a given resource, all backends.
limit_usage <backend> <realm> <id>
uuid_limit_release
Manually decrease the usage by one by removing the "usage" entry for that UUID.
If realm/resource is specified, it removes only that limit. Otherwise, it removes all limits held by the given UUID.
API: uuid_limit_release <uuid> <backend> [realm] [resource]
limit_interval_reset
Manually reset the interval counter to zero prior to the next interval starting: Only implemented in Hash, not DB or redis.
API: limit_interval_reset <backend> <realm> <resource>
hash_remote
You can access data from other FreeSWITCH systems with the hash_remote API. The hash_remote API uses the event socket. Configure your server names and credentials in conf/autoload_configs/hash.conf.xml.
It seems it queries each remote hash endpoint every 5 seconds for the entire hash list. It hen adds that to normal hash usage on the current server.
hash_remote <list>|<kill> [name]|<rescan>

象以上要限制呼叫次数的,则按以下配置:

Limit calls to 5 calls every 10 minutes:

xml <action application="limit" data="hash ${sip_received_ip} ${destination_number} 5/600" ></action>



上海老李,QQ:1354608370,FreeSWITCH QQ群: