schema.stats.redis 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. Redis database for allocation statuses and for event notifications
  2. has the following schema:
  3. 1) The allocation status is stored as keys "turn/user/<username>/allocation/<id>/status",
  4. and the values may be "new lifetime=..." or "refreshed lifetime=...". There may be multiple
  5. allocations under the same user name.
  6. 2) Additionally, the same information is reported through the "publish" mechanism.
  7. The same keys are used and the same status is reported, with the addition of status "deleted".
  8. The user session that is interested in those statuses, must subscribe to the events as:
  9. psubscribe turn/realm/*/user/*/allocation/*/status
  10. 3) Allocation traffic information is reported through the "publish" mechanism.
  11. The keys are "turn/user/<username>/allocation/<id>/traffic". The application that is interested
  12. in the traffic information must subscribe to the events as:
  13. psubscribe turn/realm/*/user/*/allocation/*/traffic
  14. Or, to receive all allocation events:
  15. psubscribe turn/realm/*/user/*/allocation/*
  16. 4) Redis database configuration parameters
  17. TURN Server connects to the Redis and keeps the same connection during the
  18. TURN server lifetime. That means that we have to take care about that
  19. connection - it must NOT expire.
  20. You have to take care about Redis connection parameters, the timeout and the
  21. keepalive. The following settings must be in your Redis config file
  22. (/etc/redis.conf or /usr/local/etc/redis.conf):
  23. ..........
  24. timeout 0
  25. ..........
  26. tcp-keepalive 60
  27. ..........