38 #ifndef _SWITCH_LIMIT_H 39 #define _SWITCH_LIMIT_H 113 #define SWITCH_LIMIT_INCR(name) static switch_status_t name (switch_core_session_t *session, const char *realm, const char *resource, const int max, const int interval) 114 #define SWITCH_LIMIT_RELEASE(name) static switch_status_t name (switch_core_session_t *session, const char *realm, const char *resource) 115 #define SWITCH_LIMIT_USAGE(name) static int name (const char *realm, const char *resource, uint32_t *rcount) 116 #define SWITCH_LIMIT_RESET(name) static switch_status_t name (void) 117 #define SWITCH_LIMIT_INTERVAL_RESET(name) static switch_status_t name (const char *realm, const char *resource) 118 #define SWITCH_LIMIT_STATUS(name) static char * name (void) 120 #define LIMIT_IGNORE_TRANSFER_VARIABLE "limit_ignore_transfer" 121 #define LIMIT_BACKEND_VARIABLE "limit_backend" 122 #define LIMIT_EVENT_USAGE "limit::usage" 123 #define LIMIT_DEF_XFER_EXTEN "limit_exceeded" #define SWITCH_END_EXTERN_C
switch_status_t switch_limit_interval_reset(const char *backend, const char *realm, const char *resource)
reset interval usage counter for a given resource
switch_memory_pool_t * pool
char * switch_limit_status(const char *backend)
retrieve arbitrary status information
switch_status_t switch_limit_release(const char *backend, switch_core_session_t *session, const char *realm, const char *resource)
Release resource.
switch_status_t switch_limit_reset(const char *backend)
reset all usage counters
switch_status_t switch_limit_incr(const char *backend, switch_core_session_t *session, const char *realm, const char *resource, const int max, const int interval)
Increment resource.
static const char usage[]
void switch_limit_fire_event(const char *backend, const char *realm, const char *resource, uint32_t usage, uint32_t rate, uint32_t max, uint32_t ratemax)
fire event for limit usage
SWITCH_BEGIN_EXTERN_C void switch_limit_init(switch_memory_pool_t *pool)
Initilize the LIMIT Core System.
int switch_limit_usage(const char *backend, const char *realm, const char *resource, uint32_t *rcount)
get usage count for resource
switch_status_t
Common return values.
struct fspr_pool_t switch_memory_pool_t
#define SWITCH_BEGIN_EXTERN_C