schema.stats.redis 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. Additionally peer traffic is available with the key "turn/user/<username>/allocation/<id>/traffic/peer".
  15. The application that is interested in the peer traffic information must subscribe to the events as:
  16. psubscribe turn/realm/*/user/*/allocation/*/traffic/peer
  17. Total traffic information is also reported when the allocation is deleted. The keys are
  18. "turn/user/<username>/allocation/<id>/total_traffic" or "turn/user/<username>/allocation/<id>/total_traffic/peer".
  19. Applications interested in the total amount of traffic per allocation can subscribe to these events as:
  20. psubscribe turn/realm/*/user/*/allocation/*/total_traffic
  21. psubscribe turn/realm/*/user/*/allocation/*/total_traffic/peer
  22. Or, to receive all allocation events:
  23. psubscribe turn/realm/*/user/*/allocation/*
  24. 4) Redis database configuration parameters
  25. TURN Server connects to the Redis and keeps the same connection during the
  26. TURN server lifetime. That means that we have to take care about that
  27. connection - it must NOT expire.
  28. You have to take care about Redis connection parameters, the timeout and the
  29. keepalive. The following settings must be in your Redis config file
  30. (/etc/redis.conf or /usr/local/etc/redis.conf):
  31. ..........
  32. timeout 0
  33. ..........
  34. tcp-keepalive 60
  35. ..........