TT#97750 add kamailio.v_subscriber_devices

* this new view accumulates possible auth data
      containing both subscrber usernames and devices
      (aliases with is_devid=1)
    * this view is used in subscriber auth and the proxy
      code to fetch registered devices not only by
      subscriber username but also by the device

Change-Id: Ic4e2596ad461c70acf34cf75a2590640813ec2ca
mr9.1.1
Kirill Solomko 5 years ago
parent d33a266bd2
commit fe3e51e268

@ -0,0 +1,6 @@
USE kamailio;
SET autocommit=0;
DROP VIEW v_subscriber_devices;
COMMIT;

@ -0,0 +1,12 @@
USE kamailio;
SET autocommit=0;
CREATE VIEW v_subscriber_devices as
SELECT s.username, s.domain, s.uuid, s.password, 0 as is_devid, NULL as devid_alias
FROM subscriber s
UNION DISTINCT
SELECT d.alias_username as username, d.alias_domain as domain, s.uuid, s.password, d.is_devid, d.devid_alias
FROM subscriber s
JOIN dbaliases d on d.username = s.username and d.domain = s.domain and is_devid = 1;
COMMIT;
Loading…
Cancel
Save