2011-05-26 08:20:19 +00:00
; This file configures the cache module
[general]
; This section sets global variables of the implementation
; size: integer: The number of hash lists to use in each cache
; Defaults to 17, can't be less then 3 or greater then 1024
; This parameter can be overridden in cache sections
;size=17
; ttl: integer: Cache item time to live in seconds
; Minimum allowed value is 10
; This parameter is not applied on reload for already created cache objects
;ttl=
; limit: integer: Maximum number of stored cache items
2011-07-15 11:02:46 +00:00
; This value must be at least the power of 2 of cache hash list size, e.g. for
2011-05-26 08:20:19 +00:00
; cache size 5 limit must be at least 25
; This parameter is applied on reload and can be overridden in cache sections
;limit=
2011-06-07 07:45:50 +00:00
; loadchunk: integer: The number of items to load in a database request
2011-07-15 11:02:46 +00:00
; Minimum allowed value is 500, maximum allowed value is 50000
2011-06-07 07:45:50 +00:00
; Set it to 0 to load the whole cache using a single database request
; This parameter is applied on reload and can be overridden in cache sections
; NOTES for non 0 value:
; - The 'query_loadcache' parameter in cache sections should contain an 'ORDER BY'
; clause to make sure the cache table is parsed in the same order
; - The 'query_loadcache' query MUST be a parameterized query containing
; LIMIT ${chunk} OFFSET ${offset}. The module will replace chunk and offset for each
; sent database request
;loadchunk=0
; maxchunks: integer: Maximum number of chunks to load from cache
; Minimum allowed value is 1, maximum allowed value is 10000
; Defaults to 1000
; This parameter is applied on reload
; WARNING:
; - Set a large value only if you are sure the cache load queries are correct
; - Setting a large value for a query without LIMIT or OFFSET will lead to
; useless extra processing
;maxchunks=1000
2011-07-14 14:37:19 +00:00
; loadcache_priority: keyword: The priority of the cache load thread
; This parameter is applied on reload and can be overridden in cache sections
; Can be one of: lowest, low, normal, high, highest
; High priorities need superuser privileges on POSIX operating systems
; Defaults to normal
;loadcache_priority=normal
2011-05-26 08:20:19 +00:00
; expire_check_interval: integer: The interval (in seconds) to check cache expire
; Defaults to 10, minimum allowed value 1, maximum allowed value 300
; This parameter is applied on reload
;expire_check_interval=10
; account: string: Database name
; This parameter is applied on reload and can be overridden in cache sections
;account=
2011-06-07 07:45:50 +00:00
; account_loadcache: string: Optional database account used to load an entire cache
; This parameter is applied on reload and can be overridden in cache sections
;account_loadcache=
2011-05-26 08:20:19 +00:00
2011-07-13 15:20:08 +00:00
; The following parameters can be set in cache sections
; reload_interval: integer: Interval (in seconds) to reload the cache
; This parameter is applied on reload
; This parameter will be ignored if the cache don't have a load account and query
; Minimum allowed value is 10. Set it to 0 to disable cache reload
; Defaults to 0 (no reload)
;reload_interval=0
2011-05-26 08:20:19 +00:00
[lnp]
; This section configures the LNP cache
; Database query examples assume a 'lnp' table with the following fields:
; - id TEXT The called number
; - routing TEXT Routing number (may be empty)
2011-05-27 08:33:33 +00:00
; - timeout TIMESTAMP Expire time
2011-05-26 08:20:19 +00:00
; enable: boolean: Enable LNP cache
; Defaults to no
; This parameter is applied on reload
;enable=no
; store_failed_requests: boolean: Store failed LNP requests in cache
; Defaults to no
; This parameter is applied on reload
;store_failed_requests=no
; store_npdi_before: boolean: Store routing number from incoming calls with LNP
; This parameter can be overidden by a 'cache_lnp_store' parameter when routing
2011-06-07 07:45:50 +00:00
; Defaults to no
2011-05-26 08:20:19 +00:00
; This parameter is applied on reload
2011-06-07 07:45:50 +00:00
;store_npdi_before=no
2011-05-26 08:20:19 +00:00
2011-07-18 11:30:00 +00:00
; id_param: string: Template used to build a cache entry id value when handling messages
; This parameter is applied on reload
; Defaults to called party number parameter (the id is retrieved from the 'called'
; parameter value of handled messages)
;id_param=${called}
2011-05-26 08:20:19 +00:00
; copyparams: string: Parameters to handle (store in cache or copy to handled messages)
; This parameter is applied on reload and can be overridden when routing by
; a 'cache_lnp_parameters' parameter
;copyparams=routing
; routebefore: integer: The priority of the call.route message handler used to
; intercept incoming calls and set the routing number if found in cache or
; update the cache if LNP was already done
; Defaults to 25
;routebefore=25
; routeafter: integer: The priority of the call.route message handler used to
; intercept the message after LNP was done locally and update the cache
; Defaults to 75
;routeafter=75
; query_loadcache: string: Database query used to load the LNP cache when created
; This parameter is applied on reload
2011-05-27 08:33:33 +00:00
;query_loadcache=SELECT FLOOR(EXTRACT('EPOCH' FROM (timeout - CURRENT_TIMESTAMP))) AS expires,* FROM lnp
2011-06-07 07:45:50 +00:00
; For non 0 'loadchunk'
;query_loadcache=SELECT FLOOR(EXTRACT('EPOCH' FROM (timeout - CURRENT_TIMESTAMP))) AS expires,* FROM lnp ORDER BY timeout LIMIT ${chunk} OFFSET ${offset}
2011-05-26 08:20:19 +00:00
2011-07-20 15:12:33 +00:00
; query_loaditem: string: Database query used to load an item when requested and not found
; in cache
2011-05-26 08:20:19 +00:00
; This parameter is applied on reload
2011-05-27 08:33:33 +00:00
;query_loaditem=SELECT FLOOR(EXTRACT('EPOCH' FROM (timeout - CURRENT_TIMESTAMP))) AS expires,* FROM lnp WHERE id='${id}'
2011-05-26 08:20:19 +00:00
2011-07-20 15:12:33 +00:00
; query_loaditem_command: string: Database query used to load an item when handling
; a 'cacheload' command indicating specific items(s)
; This parameter is applied on reload
; Defaults to the value of query_loaditem
;query_loaditem_command=SELECT FLOOR(EXTRACT('EPOCH' FROM (timeout - CURRENT_TIMESTAMP))) AS expires,* FROM lnp WHERE id='${id}'
2011-05-26 08:20:19 +00:00
; query_save: string: Database query used to save an item
; This parameter is applied on reload
2011-05-27 08:33:33 +00:00
;query_save=INSERT INTO lnp(id,routing,timeout) VALUES('${id}','${routing}',CURRENT_TIMESTAMP + INTERVAL '${expires} s')
2011-05-26 08:20:19 +00:00
; query_expire: string: Database query used to expire items
; This parameter is applied on reload
2011-05-27 08:33:33 +00:00
;query_expire=DELETE FROM lnp WHERE CURRENT_TIMESTAMP >= timeout
2011-05-26 08:20:19 +00:00
[cnam]
; This section configures the CNAM cache
; Database query examples assume a 'cnam' table with the following fields:
; - id TEXT The caller number
; - callername TEXT Caller's name (may be empty)
2011-05-27 08:33:33 +00:00
; - timeout TIMESTAMP Expire time
2011-05-26 08:20:19 +00:00
; enable: boolean: Enable CNAM cache
; Defaults to no
; This parameter is applied on reload
;enable=no
; store_empty: boolean: Store empty caller name returned by local CNAM query in cache
; Defaults to no
; This parameter is applied on reload
;store_empty=no
2011-07-18 11:30:00 +00:00
; id_param: string: Template used to build a cache entry id value when handling messages
; This parameter is applied on reload
; Defaults to caller party number parameter (the id is retrieved from the 'caller'
; parameter value of handled messages)
;id_param=${caller}
2011-05-26 08:20:19 +00:00
; copyparams: string: Parameters to handle (store in cache or copy to handled messages)
; This parameter is applied on reload and can be overridden when routing by
; a 'cache_cnam_parameters' parameter
;copyparams=callername
; routebefore: integer: The priority of the call.preroute message handler used to
; intercept incoming calls and set the callername if found in cache or
; update the cache from caller name
; Defaults to 25
;routebefore=25
; routeafter: integer: The priority of the call.preroute message handler used to
; intercept the message after CNAM was done locally and update the cache
; Defaults to 75
;routeafter=75
; query_loadcache: string: Database query used to load the CNAM cache when created
; This parameter is applied on reload
2011-05-27 08:33:33 +00:00
;query_loadcache=SELECT FLOOR(EXTRACT('EPOCH' FROM (timeout - CURRENT_TIMESTAMP))) AS expires,* FROM cnam
2011-06-07 07:45:50 +00:00
; For non 0 'loadchunk'
;query_loadcache=SELECT FLOOR(EXTRACT('EPOCH' FROM (timeout - CURRENT_TIMESTAMP))) AS expires,* FROM cnam ORDER BY timeout LIMIT ${chunk} OFFSET ${offset}
2011-05-26 08:20:19 +00:00
2011-07-20 15:12:33 +00:00
; query_loaditem: string: Database query used to load an item when requested and not found
; in cache
2011-05-26 08:20:19 +00:00
; This parameter is applied on reload
2011-05-27 08:33:33 +00:00
;query_loaditem=SELECT FLOOR(EXTRACT('EPOCH' FROM (timeout - CURRENT_TIMESTAMP))) AS expires,* FROM cnam WHERE id='${id}'
2011-05-26 08:20:19 +00:00
2011-07-20 15:12:33 +00:00
; query_loaditem_command: string: Database query used to load an item when handling
; a 'cacheload' command indicating specific items(s)
; This parameter is applied on reload
; Defaults to the value of query_loaditem
;query_loaditem_command=SELECT FLOOR(EXTRACT('EPOCH' FROM (timeout - CURRENT_TIMESTAMP))) AS expires,* FROM cnam WHERE id='${id}'
2011-05-26 08:20:19 +00:00
; query_save: string: Database query used to save an item
; This parameter is applied on reload
2011-05-27 08:33:33 +00:00
;query_save=INSERT INTO cnam(id,callername,timeout) VALUES('${id}','${callername}',CURRENT_TIMESTAMP + INTERVAL '${expires} s')
2011-05-26 08:20:19 +00:00
; query_expire: string: Database query used to expire items
; This parameter is applied on reload
2011-05-27 08:33:33 +00:00
;query_expire=DELETE FROM cnam WHERE CURRENT_TIMESTAMP >= timeout