Script intended to be able to filter calls

<syntaxhighlight lang="lua"> require("Core")

-- Third-party libraries -- https://github.com/silentbicycle/lua-memcached local client = require("memcached") local cache = client.connect()

function filterCallSession(kind, name, number, slot, flavor, source, destination)

  1. -- Simple rule to drop D-STAR loop sessions
  2. if name == "D-Extra Link"
  3. then
  4. local key = "Filter-" .. source
  5. local count = tonumber(cache:get(key) or 0)
  6. cache:set(key, count + 1, 2)
  7. if count >= 3
  8. then
  9. return true
  10. end
  11. end
  1. -- Put filter rules here
  1. -- Accept all calls by default
  2. return false

</syntaxhighlight>

Script intended to be able to filter calls

<syntaxhighlight lang="lua"> require("Core")

-- Third-party libraries -- https://github.com/silentbicycle/lua-memcached local client = require("memcached") local cache = client.connect()

function filterCallSession(kind, name, number, slot, flavor, source, destination)

  1. -- Simple rule to drop D-STAR loop sessions
  2. if name == "D-Extra Link"
  3. then
  4. local key = "Filter-" .. source
  5. local count = tonumber(cache:get(key) or 0)
  6. cache:set(key, count + 1, 2)
  7. if count >= 3
  8. then
  9. return true
  10. end
  11. end
  1. -- Put filter rules here
  1. -- Accept all calls by default
  2. return false

</syntaxhighlight>