Browse Source

Merge branch 'master' into outbound

* master:
  uid_gflags: default table for global attrs prefixed with uid_
  libsrdb1/kamctl: added uid_global_attrs table
  libsrdb1/kamctl: added uid_domain and uid_domain_attrs tables
  srdb1/kamctl: added uid_uri and uid_uri_attrs tables
  uid_avp_db: default table name prefixed with uid_
  srdb1/kamctl: added definition of table uid_user_attrs
  libsrdb1/kamctl: added definition of uid_credentials table
Peter Dunkley 12 năm trước cách đây
mục cha
commit
724847a226
63 tập tin đã thay đổi với 2289 bổ sung6 xóa
  1. 12 0
      lib/srdb1/schema/kamailio-uid_auth_db.xml
  2. 12 0
      lib/srdb1/schema/kamailio-uid_avp_db.xml
  3. 13 0
      lib/srdb1/schema/kamailio-uid_domain.xml
  4. 12 0
      lib/srdb1/schema/kamailio-uid_gflags.xml
  5. 13 0
      lib/srdb1/schema/kamailio-uid_uri_db.xml
  6. 271 0
      lib/srdb1/schema/uid_credentials.xml
  7. 253 0
      lib/srdb1/schema/uid_domain.xml
  8. 222 0
      lib/srdb1/schema/uid_domain_attrs.xml
  9. 294 0
      lib/srdb1/schema/uid_global_attrs.xml
  10. 139 0
      lib/srdb1/schema/uid_uri.xml
  11. 89 0
      lib/srdb1/schema/uid_uri_attrs.xml
  12. 71 0
      lib/srdb1/schema/uid_user_attrs.xml
  13. 2 2
      modules/uid_avp_db/uid_avp_db.c
  14. 1 1
      modules/uid_gflags/uid_gflags.c
  15. 0 2
      utils/kamctl/db_berkeley/kamailio/location_attrs
  16. 10 0
      utils/kamctl/db_berkeley/kamailio/uid_credentials
  17. 10 0
      utils/kamctl/db_berkeley/kamailio/uid_domain
  18. 10 0
      utils/kamctl/db_berkeley/kamailio/uid_domain_attrs
  19. 12 0
      utils/kamctl/db_berkeley/kamailio/uid_global_attrs
  20. 10 0
      utils/kamctl/db_berkeley/kamailio/uid_uri
  21. 10 0
      utils/kamctl/db_berkeley/kamailio/uid_uri_attrs
  22. 10 0
      utils/kamctl/db_berkeley/kamailio/uid_user_attrs
  23. 14 0
      utils/kamctl/db_berkeley/kamailio/version
  24. 18 0
      utils/kamctl/db_sqlite/uid_auth_db-create.sql
  25. 11 0
      utils/kamctl/db_sqlite/uid_avp_db-create.sql
  26. 24 0
      utils/kamctl/db_sqlite/uid_domain-create.sql
  27. 10 0
      utils/kamctl/db_sqlite/uid_gflags-create.sql
  28. 26 0
      utils/kamctl/db_sqlite/uid_uri_db-create.sql
  29. 0 1
      utils/kamctl/dbtext/kamailio/location_attrs
  30. 1 0
      utils/kamctl/dbtext/kamailio/uid_credentials
  31. 1 0
      utils/kamctl/dbtext/kamailio/uid_domain
  32. 1 0
      utils/kamctl/dbtext/kamailio/uid_domain_attrs
  33. 2 0
      utils/kamctl/dbtext/kamailio/uid_global_attrs
  34. 1 0
      utils/kamctl/dbtext/kamailio/uid_uri
  35. 1 0
      utils/kamctl/dbtext/kamailio/uid_uri_attrs
  36. 1 0
      utils/kamctl/dbtext/kamailio/uid_user_attrs
  37. 7 0
      utils/kamctl/dbtext/kamailio/version
  38. 18 0
      utils/kamctl/mysql/uid_auth_db-create.sql
  39. 11 0
      utils/kamctl/mysql/uid_avp_db-create.sql
  40. 24 0
      utils/kamctl/mysql/uid_domain-create.sql
  41. 10 0
      utils/kamctl/mysql/uid_gflags-create.sql
  42. 26 0
      utils/kamctl/mysql/uid_uri_db-create.sql
  43. 26 0
      utils/kamctl/oracle/uid_auth_db-create.sql
  44. 19 0
      utils/kamctl/oracle/uid_avp_db-create.sql
  45. 40 0
      utils/kamctl/oracle/uid_domain-create.sql
  46. 18 0
      utils/kamctl/oracle/uid_gflags-create.sql
  47. 42 0
      utils/kamctl/oracle/uid_uri_db-create.sql
  48. 18 0
      utils/kamctl/postgres/uid_auth_db-create.sql
  49. 11 0
      utils/kamctl/postgres/uid_avp_db-create.sql
  50. 24 0
      utils/kamctl/postgres/uid_domain-create.sql
  51. 10 0
      utils/kamctl/postgres/uid_gflags-create.sql
  52. 26 0
      utils/kamctl/postgres/uid_uri_db-create.sql
  53. 186 0
      utils/kamctl/xhttp_pi/pi_framework.xml
  54. 18 0
      utils/kamctl/xhttp_pi/uid_auth_db-mod
  55. 14 0
      utils/kamctl/xhttp_pi/uid_auth_db-table
  56. 15 0
      utils/kamctl/xhttp_pi/uid_avp_db-mod
  57. 11 0
      utils/kamctl/xhttp_pi/uid_avp_db-table
  58. 28 0
      utils/kamctl/xhttp_pi/uid_domain-mod
  59. 20 0
      utils/kamctl/xhttp_pi/uid_domain-table
  60. 14 0
      utils/kamctl/xhttp_pi/uid_gflags-mod
  61. 10 0
      utils/kamctl/xhttp_pi/uid_gflags-table
  62. 32 0
      utils/kamctl/xhttp_pi/uid_uri_db-mod
  63. 24 0
      utils/kamctl/xhttp_pi/uid_uri_db-table

+ 12 - 0
lib/srdb1/schema/kamailio-uid_auth_db.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE database PUBLIC "-//kamailio.org//DTD DBSchema V1.1//EN"
+  "http://kamailio.org/pub/kamailio/dbschema/dtd/1.1/dbschema.dtd" [
+
+  <!ENTITY % entities SYSTEM "entities.xml">
+  %entities;
+]>
+
+<database xmlns:xi="http://www.w3.org/2001/XInclude">
+    <name>uid_credentials</name>
+    <xi:include href="uid_credentials.xml"/>
+</database>

+ 12 - 0
lib/srdb1/schema/kamailio-uid_avp_db.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE database PUBLIC "-//kamailio.org//DTD DBSchema V1.1//EN"
+  "http://kamailio.org/pub/kamailio/dbschema/dtd/1.1/dbschema.dtd" [
+
+  <!ENTITY % entities SYSTEM "entities.xml">
+  %entities;
+]>
+
+<database xmlns:xi="http://www.w3.org/2001/XInclude">
+    <name>uid_user_attrs</name>
+    <xi:include href="uid_user_attrs.xml"/>
+</database>

+ 13 - 0
lib/srdb1/schema/kamailio-uid_domain.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE database PUBLIC "-//kamailio.org//DTD DBSchema V1.1//EN"
+  "http://kamailio.org/pub/kamailio/dbschema/dtd/1.1/dbschema.dtd" [
+
+  <!ENTITY % entities SYSTEM "entities.xml">
+  %entities;
+]>
+
+<database xmlns:xi="http://www.w3.org/2001/XInclude">
+    <name>uid_domain</name>
+    <xi:include href="uid_domain.xml"/>
+    <xi:include href="uid_domain_attrs.xml"/>
+</database>

+ 12 - 0
lib/srdb1/schema/kamailio-uid_gflags.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE database PUBLIC "-//kamailio.org//DTD DBSchema V1.1//EN"
+  "http://kamailio.org/pub/kamailio/dbschema/dtd/1.1/dbschema.dtd" [
+
+  <!ENTITY % entities SYSTEM "entities.xml">
+  %entities;
+]>
+
+<database xmlns:xi="http://www.w3.org/2001/XInclude">
+    <name>uid_gflags</name>
+    <xi:include href="uid_global_attrs.xml"/>
+</database>

+ 13 - 0
lib/srdb1/schema/kamailio-uid_uri_db.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE database PUBLIC "-//kamailio.org//DTD DBSchema V1.1//EN"
+  "http://kamailio.org/pub/kamailio/dbschema/dtd/1.1/dbschema.dtd" [
+
+  <!ENTITY % entities SYSTEM "entities.xml">
+  %entities;
+]>
+
+<database xmlns:xi="http://www.w3.org/2001/XInclude">
+    <name>uid_uri</name>
+    <xi:include href="uid_uri.xml"/>
+    <xi:include href="uid_uri_attrs.xml"/>
+</database>

+ 271 - 0
lib/srdb1/schema/uid_credentials.xml

@@ -0,0 +1,271 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE table PUBLIC "-//kamailio.org//DTD DBSchema V1.1//EN" 
+  "http://kamailio.org/pub/kamailio/dbschema/dtd/1.1/dbschema.dtd" [
+
+<!ENTITY % entities SYSTEM "entities.xml">
+%entities;
+
+]>
+
+<table id="uid_credentials" xmlns:db="http://docbook.org/ns/docbook">
+  <name>uid_credentials</name>
+  <version>7</version>
+  <type db="mysql">&MYSQL_TABLE_TYPE;</type>
+  <description>
+	Credentials table maps credentials, identified by username and realm to
+	users identified by uid. Credentials can be used in digest authentication
+	in SIP and/or authentication in SERWeb. In most situations credentials for
+	digest authentication and SERWeb authentication are same. There are cases,
+	however, where seperate credentials for SERWeb and separate credentials
+	for digest authentication may be needed. One such example are setups where
+	subscribers get HW user agents with locked configuration and thay do not
+	know the password and are not allowed to change it. If they should be able
+	to authenticate in SERWeb then they need different credentials with
+	different password.
+  </description>
+
+  <column id="id">
+    <name>id</name>
+    <type>unsigned int</type>
+    <size>&table_id_len;</size>
+    <autoincrement/>
+    <primary/>
+    <type db="dbtext">int,auto</type>
+    <description>Unique ID</description>
+  </column>
+
+  <column id="uid_credentials.auth_username">
+	<name>auth_username</name>
+	<type>string</type>
+	<size>&user_len;</size>
+	<description>
+	  Credentials username. In digest authentication this is the username
+	  configured in user agents, in SERWeb this is the login username.
+	</description>
+  </column>
+
+  <column id="uid_credentials.did">
+	<name>did</name>
+	<type>string</type>
+	<size>&id_len;</size>
+    <default>_default</default>
+	<description>
+	  DID of the virtual domain the username belongs to.
+	</description>
+  </column>
+
+  <column id="uid_credentials.realm">
+	<name>realm</name>
+	<type>string</type>
+	<size>&realm_len;</size>
+	<description>
+	  Credentials realm. In digest authentication this is the value of digest
+	  realm attribute, in SERWeb this is the part after @ in login username.
+	</description>
+  </column>
+
+  <column>
+	<name>password</name>
+	<type>string</type>
+	<default></default>
+	<size>28</size>
+	<description>
+	  Plain text password of the subscriber, can be used for both digest (SER)
+	  and SERWeb authentication.
+	</description>
+  </column>
+
+  <column id="uid_credentials.flags">
+	<name>flags</name>
+	<type>int</type>
+	<default>0</default>
+	<description>
+	  Flags that identify where this particular instance of credentials can be
+	  used. If FOR_SER flag is set then the credentials can be used in digest
+	  authentication in SIP. If FOR_SERWEB is set then the credentials can be
+	  used for authentication in SERWeb. Meaning of flags is summarized in the
+	  table below.
+	  <db:note>
+		<db:simpara>
+		  Note that several flags below have no meaning in this table and are
+		  only presented for completeness, because the flags column has
+		  identical meaning of flags across most tables in the database.
+		</db:simpara>
+	  </db:note>
+	  <db:table><db:title>possible credentials flags</db:title>
+		<db:tgroup cols="4">
+		  <db:thead>
+			<db:row>
+			  <db:entry>Bit</db:entry>
+			  <db:entry>Hex value</db:entry>
+			  <db:entry>Flag</db:entry>
+			  <db:entry>Description</db:entry>
+			</db:row>
+		  </db:thead>
+		  <db:tbody>
+			<db:row>
+			  <db:entry>0</db:entry>
+			  <db:entry>0x00000001</db:entry>
+			  <db:entry>FOR_SER</db:entry>
+			  <db:entry>
+				If set then SER will load the row (not applicable in this
+				table).
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>1</db:entry>
+			  <db:entry>0x00000002</db:entry>
+			  <db:entry>DISABLED</db:entry>
+			  <db:entry>
+				The data represented by the row is temporarily disabled, which
+				means it stays in the database but no applications use it.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>2</db:entry>
+			  <db:entry>0x00000004</db:entry>
+			  <db:entry>CANONICAL</db:entry>
+			  <db:entry>
+				The URI or domain name is canonical. When displaying the URI
+				of the user or name of a domain then this entry should be
+				used.  Not applicable in this table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>3</db:entry>
+			  <db:entry>0x00000008</db:entry>
+			  <db:entry>ALLOWED_TO</db:entry>
+			  <db:entry>
+				The URI represented by this row can be used in The Request-URI
+				or To header field. In other words the user will be reachable
+				under this URI and can use it as an alias. Not applicable in
+				this table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>4</db:entry>
+			  <db:entry>0x00000010</db:entry>
+			  <db:entry>ALLOWED_FROM</db:entry>
+			  <db:entry>
+				The user identified by uid can use this URI in From header
+				field. Not applicable in this table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>5</db:entry>
+			  <db:entry>0x00000020</db:entry>
+			  <db:entry>FOR_SERWEB</db:entry>
+			  <db:entry>
+				The data represented by the row is for SERWeb. This is
+				currently used in credentials table only where the flags
+				allows to keep different credentials for digest authentication
+				in SIP and for SERWeb authentication. Not applicable in this
+				table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>6</db:entry>
+			  <db:entry>0x00000040</db:entry>
+			  <db:entry>PENDING</db:entry>
+			  <db:entry>
+				The account owning the piece of data has not been activated
+				yet. Not applicable in this table, this is mainly used in
+				credentials table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>7</db:entry>
+			  <db:entry>0x00000100</db:entry>
+			  <db:entry>DELETED</db:entry>
+			  <db:entry>
+				The row has been scheduled for deletion.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>8</db:entry>
+			  <db:entry>0x00000200</db:entry>
+			  <db:entry>CALLER_DELETED</db:entry>
+			  <db:entry>
+				The accounting record has been scheduled for deletion by the
+				caller. The row can be deleted once both the caller and callee
+				schedule the record for deletion. A single record can be
+				shared by two users and thus both of them must schedule it for
+				deletion before it can be physically deleted.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>9</db:entry>
+			  <db:entry>0x00000400</db:entry>
+			  <db:entry>CALLEE_DELETED</db:entry>
+			  <db:entry>
+				The accounting record has been scheduled for deletion by the
+				callee. The row can be deleted once both the caller and callee
+				schedule the record for deletion. A single record can be
+				shared by two users and thus both of them must schedule it for
+				deletion before it can be physically deleted.
+			  </db:entry>
+			</db:row>
+		  </db:tbody>
+		</db:tgroup>
+	  </db:table>
+	</description>
+  </column>
+
+  <column>
+	<name>ha1</name>
+	<type>string</type>
+	<size>32</size>
+	<description>
+	  For digest authentication only. This is the H(A1) value calculated as
+	  per RFC2617. The value contains an MD5 hash of string concatenated from
+	  username,realm, and password: MD5(username:realm:password).
+	</description>
+  </column>
+
+  <column>
+	<name>ha1b</name>
+	<type>string</type>
+	<default></default>
+	<size>32</size>
+	<description>
+	  Similar to ha1, but username@domain is used as username. This is
+	  necessary for user agents that put username@domain into digest username
+	  attribute. This is often useful in multi-domain setups because it allows
+	  users to explicitly specify the domain they wish to sign in.
+	</description>
+  </column>
+
+  <column id="uid_credentials.uid">
+	<name>uid</name>
+	<name db="oracle">uuid</name>
+	<type>string</type>
+	<size>&id_len;</size>
+	<description>
+	  This is the UID (User ID) identifier of the user the credentials are
+	  assigned to. Each uid can have multiple credentials assigned. UIDs of
+	  subscribers with no credentials assigned do not appear in this table.
+	</description>
+  </column>
+
+  <index>
+	<name>cred_idx</name>
+	<colref linkend="uid_credentials.auth_username"/>
+	<colref linkend="uid_credentials.did"/>
+  </index>
+
+  <index>
+	<name>uid</name>
+	<name db="oracle">uuid</name>
+	<colref linkend="uid_credentials.uid"/>
+  </index>
+
+  <index>
+	<name>did_idx</name>
+	<colref linkend="uid_credentials.did"/>
+  </index>
+
+  <index>
+	<name>realm_idx</name>
+	<colref linkend="uid_credentials.realm"/>
+  </index>
+</table>

+ 253 - 0
lib/srdb1/schema/uid_domain.xml

@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE database PUBLIC "-//kamailio.org//DTD DBSchema V1.1//EN"
+  "http://kamailio.org/pub/kamailio/dbschema/dtd/1.1/dbschema.dtd" [
+
+  <!ENTITY % entities SYSTEM "entities.xml">
+  %entities;
+]>
+
+<table xmlns:db="http://docbook.org/ns/docbook">
+  <name>uid_domain</name>
+  <version>2</version>
+  <type db="mysql">&MYSQL_TABLE_TYPE;</type>
+
+  <description>
+	<db:para>
+	  Domain table is used in multi-domain setups where single SER instance is
+	  responsible for multiple domains at the same time. Each virtual domain
+	  has a unique identifier called DID. This is a string that uniquely
+	  identifies the domain. In smaller setups DID will be same as the domain
+	  part used in SIP URIs, that is for virtual domain iptel.org will have
+	  DID "iptel.org".
+	</db:para>
+	<db:para>
+	  DIDs are not limited to domain names that can appear in SIP URIs. Domain
+	  names are subject to change over time and, especially in setups with
+	  large number of domains hosted on a single SIP proxy server, a different
+	  format for DIDs (not based on the domain name) might be more convenient.
+	</db:para>
+	<db:para>
+	  Each virtual domain has one or more domain names assigned. Typically all
+	  domain names and IP addresses that resolve to the SIP proxy responsible
+	  for the domain should be listed in this table. Virtual domain iptel.org,
+	  for example, would contain domain names: "iptel.org", "sip.iptel.org",
+	  "proxy.iptel.org", "195.37.77.101".
+	</db:para>
+  </description>
+
+  <column id="id">
+    <name>id</name>
+    <type>unsigned int</type>
+    <size>&table_id_len;</size>
+    <autoincrement/>
+    <primary/>
+    <type db="dbtext">int,auto</type>
+    <description>Unique ID</description>
+  </column>
+
+  <column id="domain.did">
+	<name>did</name>
+	<type>string</type>
+	<size>&id_len;</size>
+	<description>
+	  Unique identifier of the domain.
+	</description>
+  </column>
+
+  <column id="domain.domain">
+	<name>domain</name>
+	<type>string</type>
+	<size>&domain_len;</size>
+	<description>
+	  Domain name.
+	</description>
+  </column>
+
+  <column>
+	<name>flags</name>
+	<type>unsigned int</type>
+	<default>0</default>
+	<description>
+	  Various flags. The meaning of bits in the flags field is described
+	  in the table below. 
+	  <db:note>
+		<db:simpara>
+		  Note that several flags below have no meaning in this table and are
+		  only presented for completeness, because the flags column has
+		  identical meaning of flags across most tables in the database.
+		</db:simpara>
+	  </db:note>
+	  <db:table><db:title>possible domain flags</db:title>
+		<db:tgroup cols="4">
+		  <db:thead>
+			<db:row>
+			  <db:entry>Bit</db:entry>
+			  <db:entry>Hex value</db:entry>
+			  <db:entry>Flag</db:entry>
+			  <db:entry>Description</db:entry>
+			</db:row>
+		  </db:thead>
+		  <db:tbody>
+			<db:row>
+			  <db:entry>0</db:entry>
+			  <db:entry>0x00000001</db:entry>
+			  <db:entry>FOR_SER</db:entry>
+			  <db:entry>
+				If set then SER will load the row (not applicable in this
+				table).
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>1</db:entry>
+			  <db:entry>0x00000002</db:entry>
+			  <db:entry>DISABLED</db:entry>
+			  <db:entry>
+				The data represented by the row is temporarily disabled, which
+				means it stays in the database but no applications use it.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>2</db:entry>
+			  <db:entry>0x00000004</db:entry>
+			  <db:entry>CANONICAL</db:entry>
+			  <db:entry>
+				The URI or domain name is canonical. When displaying the URI
+				of the user or name of a domain then this entry should be
+				used.  Not applicable in this table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>3</db:entry>
+			  <db:entry>0x00000008</db:entry>
+			  <db:entry>ALLOWED_TO</db:entry>
+			  <db:entry>
+				The URI represented by this row can be used in The Request-URI
+				or To header field. In other words the user will be reachable
+				under this URI and can use it as an alias. Not applicable in
+				this table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>4</db:entry>
+			  <db:entry>0x00000010</db:entry>
+			  <db:entry>ALLOWED_FROM</db:entry>
+			  <db:entry>
+				The user identified by uid can use this URI in From header
+				field. Not applicable in this table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>5</db:entry>
+			  <db:entry>0x00000020</db:entry>
+			  <db:entry>FOR_SERWEB</db:entry>
+			  <db:entry>
+				The data represented by the row is for SERWeb. This is
+				currently used in credentials table only where the flags
+				allows to keep different credentials for digest authentication
+				in SIP and for SERWeb authentication. Not applicable in this
+				table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>6</db:entry>
+			  <db:entry>0x00000040</db:entry>
+			  <db:entry>PENDING</db:entry>
+			  <db:entry>
+				The account owning the piece of data has not been activated
+				yet. Not applicable in this table, this is mainly used in
+				credentials table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>7</db:entry>
+			  <db:entry>0x00000100</db:entry>
+			  <db:entry>DELETED</db:entry>
+			  <db:entry>
+				The row has been scheduled for deletion.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>8</db:entry>
+			  <db:entry>0x00000200</db:entry>
+			  <db:entry>CALLER_DELETED</db:entry>
+			  <db:entry>
+				The accounting record has been scheduled for deletion by the
+				caller. The row can be deleted once both the caller and callee
+				schedule the record for deletion. A single record can be
+				shared by two users and thus both of them must schedule it for
+				deletion before it can be physically deleted.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>9</db:entry>
+			  <db:entry>0x00000400</db:entry>
+			  <db:entry>CALLEE_DELETED</db:entry>
+			  <db:entry>
+				The accounting record has been scheduled for deletion by the
+				callee. The row can be deleted once both the caller and callee
+				schedule the record for deletion. A single record can be
+				shared by two users and thus both of them must schedule it for
+				deletion before it can be physically deleted.
+			  </db:entry>
+			</db:row>
+		  </db:tbody>
+		</db:tgroup>
+	  </db:table>
+	</description>
+  </column>
+
+  <index>
+	<name>domain_idx</name>
+	<unique/>
+	<colref linkend="domain.domain"/>
+  </index>
+
+  <index>
+	<name>did_idx</name>
+	<colref linkend="domain.did"/>
+  </index>
+
+  <verbatim db="mysql" id="func.todomain">
+	<create>
+	  <![CDATA[
+drop function if exists todomain;
+delimiter //
+create function todomain (pdid varchar(64)) returns varchar(128) 
+READS SQL DATA
+begin
+    declare tdomain varchar(128) default NULL;
+	select domain into tdomain from domain where did=pdid and 
+        canonical(flags) limit 1;
+	return tdomain;
+end
+//
+delimiter ;
+]]>
+	</create>
+	<destroy>
+	  drop function if exists todomain;
+	</destroy>
+  </verbatim>
+
+  <verbatim db="mysql" id="func.todid">
+	<create>
+	  <![CDATA[
+drop function if exists todid;
+delimiter //
+create function todid (pdomain varchar(128)) returns varchar(64) 
+READS SQL DATA
+begin
+    declare tdid varchar(64) default NULL;
+    select did into tdid from domain where domain=pdomain and 
+        active(flags) limit 1;
+	return tdid;
+end
+//
+delimiter ;
+]]>
+	</create>
+	<destroy>
+	  drop function if exists todid;
+	</destroy>
+  </verbatim>
+</table>

+ 222 - 0
lib/srdb1/schema/uid_domain_attrs.xml

@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE table PUBLIC "-//kamailio.org//DTD DBSchema V1.1//EN" 
+  "http://kamailio.org/pub/kamailio/dbschema/dtd/1.1/dbschema.dtd" [
+
+<!ENTITY % entities SYSTEM "entities.xml">
+%entities;
+
+]>
+
+<table xmlns:db="http://docbook.org/ns/docbook">
+  <name>uid_domain_attrs</name>
+  <version>1</version>
+  <type db="mysql">&MYSQL_TABLE_TYPE;</type>
+  <description>
+	Each domain can have several attribute-value pairs assigned. They are used
+	to store additional information about the domain, such as digest realm to
+	be used when challenging users, language settings for the domain, time
+	zone, and so on. The AVPs (attribute-value pairs) are stored in this
+	table. Domain attributes have lower priority then user attributes, thus
+	the values from this table will only be used if no user-specific attribute
+	with the same name does not exist. Lists of domain attributes are managed
+	by domain module of SER.
+  </description>
+
+ <column id="id">
+    <name>id</name>
+    <type>unsigned int</type>
+    <size>&table_id_len;</size>
+    <autoincrement/>
+    <primary/>
+    <type db="dbtext">int,auto</type>
+    <description>Unique ID</description>
+  </column>
+
+  <column id="domain_attrs.did">
+	<name>did</name>
+	<type>string</type>
+	<size>&id_len;</size>
+	<null/>
+	<description>
+	  DID (Domain ID) of the virtual domain that owns the attribute.
+	</description>
+  </column>
+
+  <column id="domain_attrs.name">
+	<name>name</name>
+	<type>string</type>
+	<size>&avp_name_len;</size>
+	<description>
+	  Attribute name. This should be one of the names listed in attr_types
+	  table.
+	</description>
+  </column>
+
+  <column>
+	<name>type</name>
+	<type>int</type>
+	<default>0</default>
+	<description>
+	  Attribute type. This should be the value of type column from attr_types
+	  table with same name.
+	</description>
+  </column>
+
+  <column id="domain_attrs.value">
+	<name>value</name>
+	<type>string</type>
+	<null/>
+	<size>&avp_val_len;</size>
+	<description>
+	  Value of the attribute.
+	</description>
+  </column>
+
+  <column id="domain_attrs.flags">
+	<name>flags</name>
+	<type>unsigned int</type>
+	<default>0</default>
+	<description>
+	  Various flags. The meaning of bits in the flags field is described in
+	  the table below.
+	  <db:note>
+		<db:simpara>
+		  Note that several flags below have no meaning in this table and are
+		  only presented for completeness, because the flags column has
+		  identical meaning of flags across most tables in the database.
+		</db:simpara>
+	  </db:note>
+	  <db:table><db:title>possible domain_attrs flags</db:title>
+		<db:tgroup cols="4">
+		  <db:thead>
+			<db:row>
+			  <db:entry>Bit</db:entry>
+			  <db:entry>Hex value</db:entry>
+			  <db:entry>Flag</db:entry>
+			  <db:entry>Description</db:entry>
+			</db:row>
+		  </db:thead>
+		  <db:tbody>
+			<db:row>
+			  <db:entry>0</db:entry>
+			  <db:entry>0x00000001</db:entry>
+			  <db:entry>FOR_SER</db:entry>
+			  <db:entry>
+				If set then SER will load the row (not applicable in this
+				table).
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>1</db:entry>
+			  <db:entry>0x00000002</db:entry>
+			  <db:entry>DISABLED</db:entry>
+			  <db:entry>
+				The data represented by the row is temporarily disabled, which
+				means it stays in the database but no applications use it.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>2</db:entry>
+			  <db:entry>0x00000004</db:entry>
+			  <db:entry>CANONICAL</db:entry>
+			  <db:entry>
+				The URI or domain name is canonical. When displaying the URI
+				of the user or name of a domain then this entry should be
+				used.  Not applicable in this table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>3</db:entry>
+			  <db:entry>0x00000008</db:entry>
+			  <db:entry>ALLOWED_TO</db:entry>
+			  <db:entry>
+				The URI represented by this row can be used in The Request-URI
+				or To header field. In other words the user will be reachable
+				under this URI and can use it as an alias. Not applicable in
+				this table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>4</db:entry>
+			  <db:entry>0x00000010</db:entry>
+			  <db:entry>ALLOWED_FROM</db:entry>
+			  <db:entry>
+				The user identified by uid can use this URI in From header
+				field. Not applicable in this table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>5</db:entry>
+			  <db:entry>0x00000020</db:entry>
+			  <db:entry>FOR_SERWEB</db:entry>
+			  <db:entry>
+				The data represented by the row is for SERWeb. This is
+				currently used in credentials table only where the flags
+				allows to keep different credentials for digest authentication
+				in SIP and for SERWeb authentication. Not applicable in this
+				table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>6</db:entry>
+			  <db:entry>0x00000040</db:entry>
+			  <db:entry>PENDING</db:entry>
+			  <db:entry>
+				The account owning the piece of data has not been activated
+				yet. Not applicable in this table, this is mainly used in
+				credentials table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>7</db:entry>
+			  <db:entry>0x00000100</db:entry>
+			  <db:entry>DELETED</db:entry>
+			  <db:entry>
+				The row has been scheduled for deletion.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>8</db:entry>
+			  <db:entry>0x00000200</db:entry>
+			  <db:entry>CALLER_DELETED</db:entry>
+			  <db:entry>
+				The accounting record has been scheduled for deletion by the
+				caller. The row can be deleted once both the caller and callee
+				schedule the record for deletion. A single record can be
+				shared by two users and thus both of them must schedule it for
+				deletion before it can be physically deleted.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>9</db:entry>
+			  <db:entry>0x00000400</db:entry>
+			  <db:entry>CALLEE_DELETED</db:entry>
+			  <db:entry>
+				The accounting record has been scheduled for deletion by the
+				callee. The row can be deleted once both the caller and callee
+				schedule the record for deletion. A single record can be
+				shared by two users and thus both of them must schedule it for
+				deletion before it can be physically deleted.
+			  </db:entry>
+			</db:row>
+		  </db:tbody>
+		</db:tgroup>
+	  </db:table>	    
+	</description>
+  </column>
+
+  <index>
+	<name>domain_attr_idx</name>
+	<unique/>
+	<colref linkend="domain_attrs.did"/>
+	<colref linkend="domain_attrs.name"/>
+	<colref linkend="domain_attrs.value"/>
+  </index>
+
+  <index>
+	<name>domain_did</name>
+	<colref linkend="domain_attrs.did"/>
+	<colref linkend="domain_attrs.flags"/>
+  </index>
+
+</table>

+ 294 - 0
lib/srdb1/schema/uid_global_attrs.xml

@@ -0,0 +1,294 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE database PUBLIC "-//kamailio.org//DTD DBSchema V1.1//EN"
+  "http://kamailio.org/pub/kamailio/dbschema/dtd/1.1/dbschema.dtd" [
+
+  <!ENTITY % entities SYSTEM "entities.xml">
+  %entities;
+]>
+
+<table xmlns:db="http://docbook.org/ns/docbook">
+  <name>uid_global_attrs</name>
+  <version>1</version>
+  <type db="mysql">&MYSQL_TABLE_TYPE;</type>
+  <description>
+	The table contains value for global attributes. Global attributes are
+	often used to implement default value for attributes that are not present
+	in domain or user attributes.
+  </description>
+
+  <column id="id">
+    <name>id</name>
+    <type>unsigned int</type>
+    <size>&table_id_len;</size>
+    <autoincrement/>
+    <primary/>
+    <type db="dbtext">int,auto</type>
+    <description>Unique ID</description>
+  </column>
+
+  <column id="global_attrs.name">
+	<name>name</name>
+	<type>string</type>
+	<size>&avp_name_len;</size>
+	<description>
+	  Attribute name. This should be one of the names listed in attr_types
+	  table.
+	</description>
+  </column>
+
+  <column id="global_attrs.type">
+	<name>type</name>
+	<type>int</type>
+	<default>0</default>
+	<description>
+	  Attribute type. This should be the value of type column from attr_types
+	  table with same name.
+	</description>
+  </column>
+
+  <column id="global_attrs.value">
+	<name>value</name>
+	<type>string</type>
+	<null/>
+	<size>&avp_val_len;</size>
+	<description>
+	  Value of the attribute.
+	</description>
+  </column>
+
+  <column id="global_attrs.flags">
+	<name>flags</name>
+	<type>unsigned int</type>
+	<default>0</default>
+	<description>
+	  Various flags. The meaning of bits in the flags field is described in
+	  the table below.
+	  <db:note>
+		<db:simpara>
+		  Note that several flags below have no meaning in this table and are
+		  only presented for completeness, because the flags column has
+		  identical meaning of flags across most tables in the database.
+		</db:simpara>
+	  </db:note>
+	  <db:table><db:title>possible global_attrs flags</db:title>
+		<db:tgroup cols="4">
+		  <db:thead>
+			<db:row>
+			  <db:entry>Bit</db:entry>
+			  <db:entry>Hex value</db:entry>
+			  <db:entry>Flag</db:entry>
+			  <db:entry>Description</db:entry>
+			</db:row>
+		  </db:thead>
+		  <db:tbody>
+			<db:row>
+			  <db:entry>0</db:entry>
+			  <db:entry>0x00000001</db:entry>
+			  <db:entry>FOR_SER</db:entry>
+			  <db:entry>
+				If set then SER will load the row (not
+				applicable in this table).
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>1</db:entry>
+			  <db:entry>0x00000002</db:entry>
+			  <db:entry>DISABLED</db:entry>
+			  <db:entry>
+				The data represented by the row is temporarily disabled, which
+				means it stays in the database but no applications use it.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>2</db:entry>
+			  <db:entry>0x00000004</db:entry>
+			  <db:entry>CANONICAL</db:entry>
+			  <db:entry>
+				The URI or domain name is canonical. When displaying the URI
+				of the user or name of a domain then this entry should be
+				used.  Not applicable in this table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>3</db:entry>
+			  <db:entry>0x00000008</db:entry>
+			  <db:entry>ALLOWED_TO</db:entry>
+			  <db:entry>
+				The URI represented by this row can be used in The Request-URI
+				or To header field. In other words the user will be reachable
+				under this URI and can use it as an alias. Not applicable in
+				this table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>4</db:entry>
+			  <db:entry>0x00000010</db:entry>
+			  <db:entry>ALLOWED_FROM</db:entry>
+			  <db:entry>
+				The user identified by uid can use this URI in From header
+				field. Not applicable in this table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>5</db:entry>
+			  <db:entry>0x00000020</db:entry>
+			  <db:entry>FOR_SERWEB</db:entry>
+			  <db:entry>
+				The data represented by the row is for SERWeb. This is
+				currently used in credentials table only where the flags
+				allows to keep different credentials for digest authentication
+				in SIP and for SERWeb authentication. Not applicable in this
+				table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>6</db:entry>
+			  <db:entry>0x00000040</db:entry>
+			  <db:entry>PENDING</db:entry>
+			  <db:entry>
+				The account owning the piece of data has not been activated
+				yet. Not applicable in this table, this is mainly used in
+				credentials table.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>7</db:entry>
+			  <db:entry>0x00000100</db:entry>
+			  <db:entry>DELETED</db:entry>
+			  <db:entry>
+				The row has been scheduled for deletion.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>8</db:entry>
+			  <db:entry>0x00000200</db:entry>
+			  <db:entry>CALLER_DELETED</db:entry>
+			  <db:entry>
+				The accounting record has been scheduled for deletion by the
+				caller. The row can be deleted once both the caller and callee
+				schedule the record for deletion. A single record can be
+				shared by two users and thus both of them must schedule it for
+				deletion before it can be physically deleted.
+			  </db:entry>
+			</db:row>
+			<db:row>
+			  <db:entry>9</db:entry>
+			  <db:entry>0x00000400</db:entry>
+			  <db:entry>CALLEE_DELETED</db:entry>
+			  <db:entry>
+				The accounting record has been scheduled for deletion by the
+				callee. The row can be deleted once both the caller and callee
+				schedule the record for deletion. A single record can be
+				shared by two users and thus both of them must schedule it for
+				deletion before it can be physically deleted.
+			  </db:entry>
+			</db:row>
+		  </db:tbody>
+		</db:tgroup>
+	  </db:table>	    
+	</description>
+  </column>
+
+  <index>
+	<name>global_attrs_idx</name>
+	<unique/>
+	<colref linkend="global_attrs.name"/>
+	<colref linkend="global_attrs.value"/>
+  </index>
+
+  <row-identificator>
+	<colref linkend="global_attrs.name"/>
+  </row-identificator>
+
+  <row vendor-controlled="1">
+	<value col="global_attrs.name">sw_domain_default_flags</value>
+	<value col="global_attrs.type">0</value>
+	<value col="global_attrs.value">33</value>
+	<value col="global_attrs.flags">32</value>
+  </row>
+  
+  <row vendor-controlled="1">
+	<value col="global_attrs.name">sw_credential_default_flags</value>
+	<value col="global_attrs.type">0</value>
+	<value col="global_attrs.value">33</value>
+	<value col="global_attrs.flags">32</value>
+  </row>
+  
+  <row vendor-controlled="1">
+	<value col="global_attrs.name">sw_uri_default_flags</value>
+	<value col="global_attrs.type">0</value>
+	<value col="global_attrs.value">57</value>
+	<value col="global_attrs.flags">32</value>
+  </row>
+
+  <row vendor-controlled="1">
+	<value col="global_attrs.name">sw_uname_assign_mode</value>
+	<value col="global_attrs.type">2</value>
+	<value col="global_attrs.value">fcfs</value>
+	<value col="global_attrs.flags">32</value>
+  </row>
+  
+  <row vendor-controlled="1">
+    <value col="global_attrs.name">domain_data_version</value>
+    <value col="global_attrs.type">0</value>
+    <value col="global_attrs.value">0</value>
+    <value col="global_attrs.flags">33</value>
+  </row>
+
+  <row vendor-controlled="1">
+    <value col="global_attrs.name">gattr_timestamp</value>
+    <value col="global_attrs.type">0</value>
+    <value col="global_attrs.value">0</value>
+    <value col="global_attrs.flags">33</value>
+  </row>
+  
+  <row>
+	<value col="global_attrs.name">sw_show_status</value>
+	<value col="global_attrs.type">0</value>
+	<value col="global_attrs.value">1</value>
+	<value col="global_attrs.flags">32</value>
+  </row>
+  
+  <row>
+	<value col="global_attrs.name">sw_require_conf</value>
+	<value col="global_attrs.type">0</value>
+	<value col="global_attrs.value">1</value>
+	<value col="global_attrs.flags">32</value>
+  </row>
+  
+  <row>
+	<value col="global_attrs.name">lang</value>
+	<value col="global_attrs.type">2</value>
+	<value col="global_attrs.value">en</value>
+	<value col="global_attrs.flags">33</value>
+  </row>
+  
+  <row>
+	<value col="global_attrs.name">sw_timezone</value>
+	<value col="global_attrs.type">2</value>
+	<value col="global_attrs.value">Europe/Prague</value>
+	<value col="global_attrs.flags">32</value>
+  </row>
+  
+  <row>
+	<value col="global_attrs.name">uid_format</value>
+	<value col="global_attrs.type">2</value>
+	<value col="global_attrs.value">0</value>
+	<value col="global_attrs.flags">32</value>
+  </row>
+  
+  <row>
+	<value col="global_attrs.name">did_format</value>
+	<value col="global_attrs.type">2</value>
+	<value col="global_attrs.value">0</value>
+	<value col="global_attrs.flags">32</value>
+  </row>
+  
+  <row>
+	<value col="global_attrs.name">sw_max_uri_user</value>
+	<value col="global_attrs.type">0</value>
+	<value col="global_attrs.value">5</value>
+	<value col="global_attrs.flags">32</value>
+  </row>
+  
+</table>

+ 139 - 0
lib/srdb1/schema/uid_uri.xml

@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE table PUBLIC "-//kamailio.org//DTD DBSchema V1.1//EN" 
+  "http://kamailio.org/pub/kamailio/dbschema/dtd/1.1/dbschema.dtd" [
+
+<!ENTITY % entities SYSTEM "entities.xml">
+%entities;
+
+]>
+
+<table>
+  <name>uid_uri</name>
+  <version>3</version>
+  <type db="mysql">&MYSQL_TABLE_TYPE;</type>
+
+  <column id="id">
+    <name>id</name>
+    <type>unsigned int</type>
+    <size>&table_id_len;</size>
+    <autoincrement/>
+    <primary/>
+    <type db="dbtext">int,auto</type>
+    <description>Unique ID</description>
+  </column>
+
+  <column id="uri.uid">
+	<name>uid</name>
+	<name db="oracle">uuid</name>
+	<type>string</type>
+	<size>&id_len;</size>
+  </column>
+
+  <column id="uri.did">
+	<name>did</name>
+	<type>string</type>
+	<size>&id_len;</size>
+  </column>
+
+  <column id="uri.username">
+	<name>username</name>
+	<type>string</type>
+	<size>&user_len;</size>
+  </column>
+
+  <column id="uri.flags">
+	<name>flags</name>
+	<type>unsigned int</type>
+	<default>0</default>
+	<description>
+	  Various flags (is_from, is_to, is_disabled, is_canon).
+	</description>
+  </column>
+
+  <column id="uri.scheme">
+    <name>scheme</name>
+	<type>string</type>
+	<size>8</size>
+	<default>sip</default>
+	<description>
+	  URI scheme:
+	  - SIP  
+	  - SIPS 
+	  - TEL  
+	  - TELS 
+	</description>
+  </column>
+  
+
+  <index>
+	<name>uri_idx1</name>
+	<colref linkend="uri.username"/>
+	<colref linkend="uri.did"/>
+	<colref linkend="uri.scheme"/>
+  </index>
+
+  <index>
+	<name>uri_uid</name>
+	<colref linkend="uri.uid"/>
+  </index>
+
+  <verbatim db="mysql" id="func.touri">
+	<create>
+	  <![CDATA[
+drop function if exists touri;
+delimiter //
+create function touri (puid varchar(64)) returns varchar(128) 
+READS SQL DATA
+begin
+    declare tscheme varchar(8) default NULL;
+	declare tuser varchar(64) default NULL;
+	declare tdid varchar(64) default NULL;
+	select scheme, username, did into tscheme, tuser, tdid 
+        from uri where uid=puid and canonical(flags) limit 1;
+	return concat(tscheme, ':', tuser, '@', todomain(tdid));
+end
+//
+delimiter ;
+]]>
+	</create>
+	<destroy>
+	  drop function if exists touri;
+	</destroy>
+  </verbatim>
+
+  <verbatim db="mysql" id="func.touid">
+	<create>
+	  <![CDATA[
+drop function if exists touid;
+delimiter //
+create function touid (puri varchar(128)) returns varchar(128) 
+READS SQL DATA
+begin
+    declare tscheme varchar(8) default "sip";
+	declare tuid varchar(128) default NULL;
+	declare i int default 0;
+	declare tdid varchar(128) default NULL;
+	set puri = lower(trim(puri));
+	set i = locate(':', puri);
+	if (i > 0) then
+   	    set tscheme = left(puri, i - 1);
+	    set puri = substr(puri FROM i + 1);
+	end if;
+	set i = locate('@', puri);
+	if (i > 0) then
+        set tdid = todid(substr(puri FROM i + 1));
+	    set puri = left(puri, i - 1);
+	end if;
+	select uid into tuid from uri where scheme=tscheme and
+        username=puri and did=tdid and active(flags);
+	return tuid;
+end
+//
+delimiter ;
+]]>
+	</create>
+	<destroy>
+	</destroy>
+  </verbatim>
+
+</table>

+ 89 - 0
lib/srdb1/schema/uid_uri_attrs.xml

@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE table PUBLIC "-//kamailio.org//DTD DBSchema V1.1//EN" 
+  "http://kamailio.org/pub/kamailio/dbschema/dtd/1.1/dbschema.dtd" [
+
+<!ENTITY % entities SYSTEM "entities.xml">
+%entities;
+
+]>
+
+<table>
+  <name>uid_uri_attrs</name>
+  <version>2</version>
+  <type db="mysql">&MYSQL_TABLE_TYPE;</type>
+
+  <column id="id">
+    <name>id</name>
+    <type>unsigned int</type>
+    <size>&table_id_len;</size>
+    <autoincrement/>
+    <primary/>
+    <type db="dbtext">int,auto</type>
+    <description>Unique ID</description>
+  </column>
+
+  <column id="uriattrs.username">
+	<name>username</name>
+	<type>string</type>
+	<size>&user_len;</size>
+  </column>
+
+  <column id="uriattrs.did">
+    <name>did</name>
+    <type>string</type>
+    <size>&id_len;</size>
+  </column>
+  
+  <column id="uriattrs.name">
+	<name>name</name>
+	<type>string</type>
+	<size>&avp_name_len;</size>
+  </column>
+
+  <column id="uriattrs.value">
+	<name>value</name>
+	<type>string</type>
+	<null/>
+	<size>&avp_val_len;</size>
+  </column>
+
+  <column>
+	<name>type</name>
+	<type>int</type>
+	<default>0</default>
+  </column>
+
+  <column id="uriattrs.flags">
+	<name>flags</name>
+	<type>unsigned int</type>
+	<default>0</default>
+	<description>
+	  Various flags (SER_LOAD and such).
+	</description>
+  </column>
+
+  <column id="uriattrs.scheme">
+    <name>scheme</name>
+    <type>string</type>
+	<size>8</size>
+    <default>sip</default>
+    <description>
+      URI scheme:
+      - SIP  
+      - SIPS 
+      - TEL  
+      - TELS 
+    </description>
+  </column>
+
+  <index>
+	<unique/>
+	<name>uriattrs_idx</name>
+    <colref linkend="uriattrs.username"/>
+	<colref linkend="uriattrs.did"/>
+	<colref linkend="uriattrs.name"/>
+	<colref linkend="uriattrs.value"/>
+	<colref linkend="uriattrs.scheme"/>
+  </index>
+
+</table>

+ 71 - 0
lib/srdb1/schema/uid_user_attrs.xml

@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE table PUBLIC "-//kamailio.org//DTD DBSchema V1.1//EN" 
+  "http://kamailio.org/pub/kamailio/dbschema/dtd/1.1/dbschema.dtd" [
+
+<!ENTITY % entities SYSTEM "entities.xml">
+%entities;
+
+]>
+
+<table>
+  <name>uid_user_attrs</name>
+  <version>3</version>
+  <type db="mysql">&MYSQL_TABLE_TYPE;</type>
+  <description>
+	Per user attributes loaded with uid_avp_db module.
+  </description>
+
+  <column id="id">
+    <name>id</name>
+    <type>unsigned int</type>
+    <size>&table_id_len;</size>
+    <autoincrement/>
+    <primary/>
+    <type db="dbtext">int,auto</type>
+    <description>Unique ID</description>
+  </column>
+
+  <column id="userattrs.uid">
+	<name>uid</name>
+	<name db="oracle">uuid</name>
+	<type>string</type>
+	<size>&id_len;</size>
+  </column>
+
+  <column id="userattrs.name">
+	<name>name</name>
+	<type>string</type>
+	<size>&avp_name_len;</size>
+  </column>
+
+  <column id="userattrs.value">
+	<name>value</name>
+	<type>string</type>
+	<null/>
+	<size>&avp_val_len;</size>
+  </column>
+
+  <column>
+	<name>type</name>
+	<type>int</type>
+	<default>0</default>
+  </column>
+
+  <column id="userattrs.flags">
+	<name>flags</name>
+	<type>unsigned int</type>
+	<default>0</default>
+	<description>
+	  Various flags (SER_LOAD and such).
+	</description>
+  </column>
+
+  <index>
+	<unique/>
+	<name>userattrs_idx</name>
+	<colref linkend="userattrs.uid"/>
+	<colref linkend="userattrs.name"/>
+	<colref linkend="userattrs.value"/>
+  </index>
+
+</table>

+ 2 - 2
modules/uid_avp_db/uid_avp_db.c

@@ -52,8 +52,8 @@
 MODULE_VERSION
 
 static char* db_url           = DEFAULT_RODB_URL;    /* Database URL */
-static char* user_attrs_table = "user_attrs";
-static char* uri_attrs_table  = "uri_attrs";
+static char* user_attrs_table = "uid_user_attrs";
+static char* uri_attrs_table  = "uid_uri_attrs";
 static char* uid_column       = "uid";
 static char* username_column  = "username";
 static char* did_column       = "did";

+ 1 - 1
modules/uid_gflags/uid_gflags.c

@@ -75,7 +75,7 @@ static unsigned int *gflags;
 
 static char* db_url = DEFAULT_DB_URL;
 static int   load_global_attrs = 0;
-static char* attr_table = "global_attrs";
+static char* attr_table = "uid_global_attrs";
 static char* attr_name = "name";
 static char* attr_type = "type";
 static char* attr_value = "value";

+ 0 - 2
utils/kamctl/db_berkeley/kamailio/location_attrs

@@ -8,5 +8,3 @@ METADATA_LOGFLAGS
 0
 METADATA_DEFAULTS
 NIL|''|''|NULL|''|0|''|'1900-01-01 00:00:01'
-location_attrs|
-location_attrs|1

+ 10 - 0
utils/kamctl/db_berkeley/kamailio/uid_credentials

@@ -0,0 +1,10 @@
+METADATA_COLUMNS
+id(int) auth_username(str) did(str) realm(str) password(str) flags(int) ha1(str) ha1b(str) uid(str)
+METADATA_KEY
+
+METADATA_READONLY
+0
+METADATA_LOGFLAGS
+0
+METADATA_DEFAULTS
+NIL|NIL|'_default'|NIL|''|0|NIL|''|NIL

+ 10 - 0
utils/kamctl/db_berkeley/kamailio/uid_domain

@@ -0,0 +1,10 @@
+METADATA_COLUMNS
+id(int) did(str) domain(str) flags(int)
+METADATA_KEY
+
+METADATA_READONLY
+0
+METADATA_LOGFLAGS
+0
+METADATA_DEFAULTS
+NIL|NIL|NIL|0

+ 10 - 0
utils/kamctl/db_berkeley/kamailio/uid_domain_attrs

@@ -0,0 +1,10 @@
+METADATA_COLUMNS
+id(int) did(str) name(str) type(int) value(str) flags(int)
+METADATA_KEY
+
+METADATA_READONLY
+0
+METADATA_LOGFLAGS
+0
+METADATA_DEFAULTS
+NIL|NIL|NIL|0|NIL|0

+ 12 - 0
utils/kamctl/db_berkeley/kamailio/uid_global_attrs

@@ -0,0 +1,12 @@
+METADATA_COLUMNS
+id(int) name(str) type(int) value(str) flags(int)
+METADATA_KEY
+
+METADATA_READONLY
+0
+METADATA_LOGFLAGS
+0
+METADATA_DEFAULTS
+NIL|NIL|0|NIL|0
+uid_global_attrs|
+uid_global_attrs|1

+ 10 - 0
utils/kamctl/db_berkeley/kamailio/uid_uri

@@ -0,0 +1,10 @@
+METADATA_COLUMNS
+id(int) uid(str) did(str) username(str) flags(int) scheme(str)
+METADATA_KEY
+
+METADATA_READONLY
+0
+METADATA_LOGFLAGS
+0
+METADATA_DEFAULTS
+NIL|NIL|NIL|NIL|0|'sip'

+ 10 - 0
utils/kamctl/db_berkeley/kamailio/uid_uri_attrs

@@ -0,0 +1,10 @@
+METADATA_COLUMNS
+id(int) username(str) did(str) name(str) value(str) type(int) flags(int) scheme(str)
+METADATA_KEY
+
+METADATA_READONLY
+0
+METADATA_LOGFLAGS
+0
+METADATA_DEFAULTS
+NIL|NIL|NIL|NIL|NIL|0|0|'sip'

+ 10 - 0
utils/kamctl/db_berkeley/kamailio/uid_user_attrs

@@ -0,0 +1,10 @@
+METADATA_COLUMNS
+id(int) uid(str) name(str) value(str) type(int) flags(int)
+METADATA_KEY
+
+METADATA_READONLY
+0
+METADATA_LOGFLAGS
+0
+METADATA_DEFAULTS
+NIL|NIL|NIL|NIL|0|0

+ 14 - 0
utils/kamctl/db_berkeley/kamailio/version

@@ -68,6 +68,8 @@ lcr_rule_target|
 lcr_rule_target|1
 location|
 location|6
+location_attrs|
+location_attrs|1
 matrix|
 matrix|1
 missed_calls|
@@ -106,6 +108,18 @@ trusted|
 trusted|5
 uacreg|
 uacreg|1
+uid_credentials|
+uid_credentials|7
+uid_domain|
+uid_domain|2
+uid_domain_attrs|
+uid_domain_attrs|1
+uid_uri|
+uid_uri|3
+uid_uri_attrs|
+uid_uri_attrs|2
+uid_user_attrs|
+uid_user_attrs|3
 uri|
 uri|1
 userblacklist|

+ 18 - 0
utils/kamctl/db_sqlite/uid_auth_db-create.sql

@@ -0,0 +1,18 @@
+INSERT INTO version (table_name, table_version) values ('uid_credentials','7');
+CREATE TABLE uid_credentials (
+    id INTEGER PRIMARY KEY NOT NULL,
+    auth_username VARCHAR(64) NOT NULL,
+    did VARCHAR(64) DEFAULT '_default' NOT NULL,
+    realm VARCHAR(64) NOT NULL,
+    password VARCHAR(28) DEFAULT '' NOT NULL,
+    flags INTEGER DEFAULT 0 NOT NULL,
+    ha1 VARCHAR(32) NOT NULL,
+    ha1b VARCHAR(32) DEFAULT '' NOT NULL,
+    uid VARCHAR(64) NOT NULL
+);
+
+CREATE INDEX uid_credentials_cred_idx ON uid_credentials (auth_username, did);
+CREATE INDEX uid_credentials_uid ON uid_credentials (uid);
+CREATE INDEX uid_credentials_did_idx ON uid_credentials (did);
+CREATE INDEX uid_credentials_realm_idx ON uid_credentials (realm);
+

+ 11 - 0
utils/kamctl/db_sqlite/uid_avp_db-create.sql

@@ -0,0 +1,11 @@
+INSERT INTO version (table_name, table_version) values ('uid_user_attrs','3');
+CREATE TABLE uid_user_attrs (
+    id INTEGER PRIMARY KEY NOT NULL,
+    uid VARCHAR(64) NOT NULL,
+    name VARCHAR(32) NOT NULL,
+    value VARCHAR(128),
+    type INTEGER DEFAULT 0 NOT NULL,
+    flags INTEGER DEFAULT 0 NOT NULL,
+    CONSTRAINT uid_user_attrs_userattrs_idx UNIQUE (uid, name, value)
+);
+

+ 24 - 0
utils/kamctl/db_sqlite/uid_domain-create.sql

@@ -0,0 +1,24 @@
+INSERT INTO version (table_name, table_version) values ('uid_domain','2');
+CREATE TABLE uid_domain (
+    id INTEGER PRIMARY KEY NOT NULL,
+    did VARCHAR(64) NOT NULL,
+    domain VARCHAR(64) NOT NULL,
+    flags INTEGER DEFAULT 0 NOT NULL,
+    CONSTRAINT uid_domain_domain_idx UNIQUE (domain)
+);
+
+CREATE INDEX uid_domain_did_idx ON uid_domain (did);
+
+INSERT INTO version (table_name, table_version) values ('uid_domain_attrs','1');
+CREATE TABLE uid_domain_attrs (
+    id INTEGER PRIMARY KEY NOT NULL,
+    did VARCHAR(64),
+    name VARCHAR(32) NOT NULL,
+    type INTEGER DEFAULT 0 NOT NULL,
+    value VARCHAR(128),
+    flags INTEGER DEFAULT 0 NOT NULL,
+    CONSTRAINT uid_domain_attrs_domain_attr_idx UNIQUE (did, name, value)
+);
+
+CREATE INDEX uid_domain_attrs_domain_did ON uid_domain_attrs (did, flags);
+

+ 10 - 0
utils/kamctl/db_sqlite/uid_gflags-create.sql

@@ -0,0 +1,10 @@
+INSERT INTO version (table_name, table_version) values ('uid_global_attrs','1');
+CREATE TABLE uid_global_attrs (
+    id INTEGER PRIMARY KEY NOT NULL,
+    name VARCHAR(32) NOT NULL,
+    type INTEGER DEFAULT 0 NOT NULL,
+    value VARCHAR(128),
+    flags INTEGER DEFAULT 0 NOT NULL,
+    CONSTRAINT uid_global_attrs_global_attrs_idx UNIQUE (name, value)
+);
+

+ 26 - 0
utils/kamctl/db_sqlite/uid_uri_db-create.sql

@@ -0,0 +1,26 @@
+INSERT INTO version (table_name, table_version) values ('uid_uri','3');
+CREATE TABLE uid_uri (
+    id INTEGER PRIMARY KEY NOT NULL,
+    uid VARCHAR(64) NOT NULL,
+    did VARCHAR(64) NOT NULL,
+    username VARCHAR(64) NOT NULL,
+    flags INTEGER DEFAULT 0 NOT NULL,
+    scheme VARCHAR(8) DEFAULT 'sip' NOT NULL
+);
+
+CREATE INDEX uid_uri_uri_idx1 ON uid_uri (username, did, scheme);
+CREATE INDEX uid_uri_uri_uid ON uid_uri (uid);
+
+INSERT INTO version (table_name, table_version) values ('uid_uri_attrs','2');
+CREATE TABLE uid_uri_attrs (
+    id INTEGER PRIMARY KEY NOT NULL,
+    username VARCHAR(64) NOT NULL,
+    did VARCHAR(64) NOT NULL,
+    name VARCHAR(32) NOT NULL,
+    value VARCHAR(128),
+    type INTEGER DEFAULT 0 NOT NULL,
+    flags INTEGER DEFAULT 0 NOT NULL,
+    scheme VARCHAR(8) DEFAULT 'sip' NOT NULL,
+    CONSTRAINT uid_uri_attrs_uriattrs_idx UNIQUE (username, did, name, value, scheme)
+);
+

+ 0 - 1
utils/kamctl/dbtext/kamailio/location_attrs

@@ -1,2 +1 @@
 id(int,auto) ruid(string) username(string) domain(string,null) aname(string) atype(int) avalue(string) last_modified(int) 
-location_attrs:1

+ 1 - 0
utils/kamctl/dbtext/kamailio/uid_credentials

@@ -0,0 +1 @@
+id(int,auto) auth_username(string) did(string) realm(string) password(string) flags(int) ha1(string) ha1b(string) uid(string) 

+ 1 - 0
utils/kamctl/dbtext/kamailio/uid_domain

@@ -0,0 +1 @@
+id(int,auto) did(string) domain(string) flags(int) 

+ 1 - 0
utils/kamctl/dbtext/kamailio/uid_domain_attrs

@@ -0,0 +1 @@
+id(int,auto) did(string,null) name(string) type(int) value(string,null) flags(int) 

+ 2 - 0
utils/kamctl/dbtext/kamailio/uid_global_attrs

@@ -0,0 +1,2 @@
+id(int,auto) name(string) type(int) value(string,null) flags(int) 
+uid_global_attrs:1

+ 1 - 0
utils/kamctl/dbtext/kamailio/uid_uri

@@ -0,0 +1 @@
+id(int,auto) uid(string) did(string) username(string) flags(int) scheme(string) 

+ 1 - 0
utils/kamctl/dbtext/kamailio/uid_uri_attrs

@@ -0,0 +1 @@
+id(int,auto) username(string) did(string) name(string) value(string,null) type(int) flags(int) scheme(string) 

+ 1 - 0
utils/kamctl/dbtext/kamailio/uid_user_attrs

@@ -0,0 +1 @@
+id(int,auto) uid(string) name(string) value(string,null) type(int) flags(int) 

+ 7 - 0
utils/kamctl/dbtext/kamailio/version

@@ -29,6 +29,7 @@ lcr_gw:3
 lcr_rule:2
 lcr_rule_target:1
 location:6
+location_attrs:1
 matrix:1
 missed_calls:3
 mtree:1
@@ -48,6 +49,12 @@ speed_dial:2
 subscriber:6
 trusted:5
 uacreg:1
+uid_credentials:7
+uid_domain:2
+uid_domain_attrs:1
+uid_uri:3
+uid_uri_attrs:2
+uid_user_attrs:3
 uri:1
 userblacklist:1
 usr_preferences:2

+ 18 - 0
utils/kamctl/mysql/uid_auth_db-create.sql

@@ -0,0 +1,18 @@
+INSERT INTO version (table_name, table_version) values ('uid_credentials','7');
+CREATE TABLE uid_credentials (
+    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+    auth_username VARCHAR(64) NOT NULL,
+    did VARCHAR(64) DEFAULT '_default' NOT NULL,
+    realm VARCHAR(64) NOT NULL,
+    password VARCHAR(28) DEFAULT '' NOT NULL,
+    flags INT DEFAULT 0 NOT NULL,
+    ha1 VARCHAR(32) NOT NULL,
+    ha1b VARCHAR(32) DEFAULT '' NOT NULL,
+    uid VARCHAR(64) NOT NULL
+) ENGINE=MyISAM;
+
+CREATE INDEX cred_idx ON uid_credentials (auth_username, did);
+CREATE INDEX uid ON uid_credentials (uid);
+CREATE INDEX did_idx ON uid_credentials (did);
+CREATE INDEX realm_idx ON uid_credentials (realm);
+

+ 11 - 0
utils/kamctl/mysql/uid_avp_db-create.sql

@@ -0,0 +1,11 @@
+INSERT INTO version (table_name, table_version) values ('uid_user_attrs','3');
+CREATE TABLE uid_user_attrs (
+    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+    uid VARCHAR(64) NOT NULL,
+    name VARCHAR(32) NOT NULL,
+    value VARCHAR(128),
+    type INT DEFAULT 0 NOT NULL,
+    flags INT UNSIGNED DEFAULT 0 NOT NULL,
+    CONSTRAINT userattrs_idx UNIQUE (uid, name, value)
+) ENGINE=MyISAM;
+

+ 24 - 0
utils/kamctl/mysql/uid_domain-create.sql

@@ -0,0 +1,24 @@
+INSERT INTO version (table_name, table_version) values ('uid_domain','2');
+CREATE TABLE uid_domain (
+    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+    did VARCHAR(64) NOT NULL,
+    domain VARCHAR(64) NOT NULL,
+    flags INT UNSIGNED DEFAULT 0 NOT NULL,
+    CONSTRAINT domain_idx UNIQUE (domain)
+) ENGINE=MyISAM;
+
+CREATE INDEX did_idx ON uid_domain (did);
+
+INSERT INTO version (table_name, table_version) values ('uid_domain_attrs','1');
+CREATE TABLE uid_domain_attrs (
+    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+    did VARCHAR(64),
+    name VARCHAR(32) NOT NULL,
+    type INT DEFAULT 0 NOT NULL,
+    value VARCHAR(128),
+    flags INT UNSIGNED DEFAULT 0 NOT NULL,
+    CONSTRAINT domain_attr_idx UNIQUE (did, name, value)
+) ENGINE=MyISAM;
+
+CREATE INDEX domain_did ON uid_domain_attrs (did, flags);
+

+ 10 - 0
utils/kamctl/mysql/uid_gflags-create.sql

@@ -0,0 +1,10 @@
+INSERT INTO version (table_name, table_version) values ('uid_global_attrs','1');
+CREATE TABLE uid_global_attrs (
+    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+    name VARCHAR(32) NOT NULL,
+    type INT DEFAULT 0 NOT NULL,
+    value VARCHAR(128),
+    flags INT UNSIGNED DEFAULT 0 NOT NULL,
+    CONSTRAINT global_attrs_idx UNIQUE (name, value)
+) ENGINE=MyISAM;
+

+ 26 - 0
utils/kamctl/mysql/uid_uri_db-create.sql

@@ -0,0 +1,26 @@
+INSERT INTO version (table_name, table_version) values ('uid_uri','3');
+CREATE TABLE uid_uri (
+    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+    uid VARCHAR(64) NOT NULL,
+    did VARCHAR(64) NOT NULL,
+    username VARCHAR(64) NOT NULL,
+    flags INT UNSIGNED DEFAULT 0 NOT NULL,
+    scheme VARCHAR(8) DEFAULT 'sip' NOT NULL
+) ENGINE=MyISAM;
+
+CREATE INDEX uri_idx1 ON uid_uri (username, did, scheme);
+CREATE INDEX uri_uid ON uid_uri (uid);
+
+INSERT INTO version (table_name, table_version) values ('uid_uri_attrs','2');
+CREATE TABLE uid_uri_attrs (
+    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
+    username VARCHAR(64) NOT NULL,
+    did VARCHAR(64) NOT NULL,
+    name VARCHAR(32) NOT NULL,
+    value VARCHAR(128),
+    type INT DEFAULT 0 NOT NULL,
+    flags INT UNSIGNED DEFAULT 0 NOT NULL,
+    scheme VARCHAR(8) DEFAULT 'sip' NOT NULL,
+    CONSTRAINT uriattrs_idx UNIQUE (username, did, name, value, scheme)
+) ENGINE=MyISAM;
+

+ 26 - 0
utils/kamctl/oracle/uid_auth_db-create.sql

@@ -0,0 +1,26 @@
+INSERT INTO version (table_name, table_version) values ('uid_credentials','7');
+CREATE TABLE uid_credentials (
+    id NUMBER(10) PRIMARY KEY,
+    auth_username VARCHAR2(64),
+    did VARCHAR2(64) DEFAULT '_default',
+    realm VARCHAR2(64),
+    password VARCHAR2(28) DEFAULT '',
+    flags NUMBER(10) DEFAULT 0 NOT NULL,
+    ha1 VARCHAR2(32),
+    ha1b VARCHAR2(32) DEFAULT '',
+    uuid VARCHAR2(64)
+);
+
+CREATE OR REPLACE TRIGGER uid_credentials_tr
+before insert on uid_credentials FOR EACH ROW
+BEGIN
+  auto_id(:NEW.id);
+END uid_credentials_tr;
+/
+BEGIN map2users('uid_credentials'); END;
+/
+CREATE INDEX uid_credentials_cred_idx  ON uid_credentials (auth_username, did);
+CREATE INDEX uid_credentials_uuid  ON uid_credentials (uuid);
+CREATE INDEX uid_credentials_did_idx  ON uid_credentials (did);
+CREATE INDEX uid_credentials_realm_idx  ON uid_credentials (realm);
+

+ 19 - 0
utils/kamctl/oracle/uid_avp_db-create.sql

@@ -0,0 +1,19 @@
+INSERT INTO version (table_name, table_version) values ('uid_user_attrs','3');
+CREATE TABLE uid_user_attrs (
+    id NUMBER(10) PRIMARY KEY,
+    uuid VARCHAR2(64),
+    name VARCHAR2(32),
+    value VARCHAR2(128),
+    type NUMBER(10) DEFAULT 0 NOT NULL,
+    flags NUMBER(10) DEFAULT 0 NOT NULL,
+    CONSTRAINT uid_user_attrs_userattrs_idx  UNIQUE (uuid, name, value)
+);
+
+CREATE OR REPLACE TRIGGER uid_user_attrs_tr
+before insert on uid_user_attrs FOR EACH ROW
+BEGIN
+  auto_id(:NEW.id);
+END uid_user_attrs_tr;
+/
+BEGIN map2users('uid_user_attrs'); END;
+/

+ 40 - 0
utils/kamctl/oracle/uid_domain-create.sql

@@ -0,0 +1,40 @@
+INSERT INTO version (table_name, table_version) values ('uid_domain','2');
+CREATE TABLE uid_domain (
+    id NUMBER(10) PRIMARY KEY,
+    did VARCHAR2(64),
+    domain VARCHAR2(64),
+    flags NUMBER(10) DEFAULT 0 NOT NULL,
+    CONSTRAINT uid_domain_domain_idx  UNIQUE (domain)
+);
+
+CREATE OR REPLACE TRIGGER uid_domain_tr
+before insert on uid_domain FOR EACH ROW
+BEGIN
+  auto_id(:NEW.id);
+END uid_domain_tr;
+/
+BEGIN map2users('uid_domain'); END;
+/
+CREATE INDEX uid_domain_did_idx  ON uid_domain (did);
+
+INSERT INTO version (table_name, table_version) values ('uid_domain_attrs','1');
+CREATE TABLE uid_domain_attrs (
+    id NUMBER(10) PRIMARY KEY,
+    did VARCHAR2(64),
+    name VARCHAR2(32),
+    type NUMBER(10) DEFAULT 0 NOT NULL,
+    value VARCHAR2(128),
+    flags NUMBER(10) DEFAULT 0 NOT NULL,
+    CONSTRAINT ORA_domain_attr_idx  UNIQUE (did, name, value)
+);
+
+CREATE OR REPLACE TRIGGER uid_domain_attrs_tr
+before insert on uid_domain_attrs FOR EACH ROW
+BEGIN
+  auto_id(:NEW.id);
+END uid_domain_attrs_tr;
+/
+BEGIN map2users('uid_domain_attrs'); END;
+/
+CREATE INDEX uid_domain_attrs_domain_did  ON uid_domain_attrs (did, flags);
+

+ 18 - 0
utils/kamctl/oracle/uid_gflags-create.sql

@@ -0,0 +1,18 @@
+INSERT INTO version (table_name, table_version) values ('uid_global_attrs','1');
+CREATE TABLE uid_global_attrs (
+    id NUMBER(10) PRIMARY KEY,
+    name VARCHAR2(32),
+    type NUMBER(10) DEFAULT 0 NOT NULL,
+    value VARCHAR2(128),
+    flags NUMBER(10) DEFAULT 0 NOT NULL,
+    CONSTRAINT ORA_global_attrs_idx  UNIQUE (name, value)
+);
+
+CREATE OR REPLACE TRIGGER uid_global_attrs_tr
+before insert on uid_global_attrs FOR EACH ROW
+BEGIN
+  auto_id(:NEW.id);
+END uid_global_attrs_tr;
+/
+BEGIN map2users('uid_global_attrs'); END;
+/

+ 42 - 0
utils/kamctl/oracle/uid_uri_db-create.sql

@@ -0,0 +1,42 @@
+INSERT INTO version (table_name, table_version) values ('uid_uri','3');
+CREATE TABLE uid_uri (
+    id NUMBER(10) PRIMARY KEY,
+    uuid VARCHAR2(64),
+    did VARCHAR2(64),
+    username VARCHAR2(64),
+    flags NUMBER(10) DEFAULT 0 NOT NULL,
+    scheme VARCHAR2(8) DEFAULT 'sip'
+);
+
+CREATE OR REPLACE TRIGGER uid_uri_tr
+before insert on uid_uri FOR EACH ROW
+BEGIN
+  auto_id(:NEW.id);
+END uid_uri_tr;
+/
+BEGIN map2users('uid_uri'); END;
+/
+CREATE INDEX uid_uri_uri_idx1  ON uid_uri (username, did, scheme);
+CREATE INDEX uid_uri_uri_uid  ON uid_uri (uuid);
+
+INSERT INTO version (table_name, table_version) values ('uid_uri_attrs','2');
+CREATE TABLE uid_uri_attrs (
+    id NUMBER(10) PRIMARY KEY,
+    username VARCHAR2(64),
+    did VARCHAR2(64),
+    name VARCHAR2(32),
+    value VARCHAR2(128),
+    type NUMBER(10) DEFAULT 0 NOT NULL,
+    flags NUMBER(10) DEFAULT 0 NOT NULL,
+    scheme VARCHAR2(8) DEFAULT 'sip',
+    CONSTRAINT uid_uri_attrs_uriattrs_idx  UNIQUE (username, did, name, value, scheme)
+);
+
+CREATE OR REPLACE TRIGGER uid_uri_attrs_tr
+before insert on uid_uri_attrs FOR EACH ROW
+BEGIN
+  auto_id(:NEW.id);
+END uid_uri_attrs_tr;
+/
+BEGIN map2users('uid_uri_attrs'); END;
+/

+ 18 - 0
utils/kamctl/postgres/uid_auth_db-create.sql

@@ -0,0 +1,18 @@
+INSERT INTO version (table_name, table_version) values ('uid_credentials','7');
+CREATE TABLE uid_credentials (
+    id SERIAL PRIMARY KEY NOT NULL,
+    auth_username VARCHAR(64) NOT NULL,
+    did VARCHAR(64) DEFAULT '_default' NOT NULL,
+    realm VARCHAR(64) NOT NULL,
+    password VARCHAR(28) DEFAULT '' NOT NULL,
+    flags INTEGER DEFAULT 0 NOT NULL,
+    ha1 VARCHAR(32) NOT NULL,
+    ha1b VARCHAR(32) DEFAULT '' NOT NULL,
+    uid VARCHAR(64) NOT NULL
+);
+
+CREATE INDEX uid_credentials_cred_idx ON uid_credentials (auth_username, did);
+CREATE INDEX uid_credentials_uid ON uid_credentials (uid);
+CREATE INDEX uid_credentials_did_idx ON uid_credentials (did);
+CREATE INDEX uid_credentials_realm_idx ON uid_credentials (realm);
+

+ 11 - 0
utils/kamctl/postgres/uid_avp_db-create.sql

@@ -0,0 +1,11 @@
+INSERT INTO version (table_name, table_version) values ('uid_user_attrs','3');
+CREATE TABLE uid_user_attrs (
+    id SERIAL PRIMARY KEY NOT NULL,
+    uid VARCHAR(64) NOT NULL,
+    name VARCHAR(32) NOT NULL,
+    value VARCHAR(128),
+    type INTEGER DEFAULT 0 NOT NULL,
+    flags INTEGER DEFAULT 0 NOT NULL,
+    CONSTRAINT uid_user_attrs_userattrs_idx UNIQUE (uid, name, value)
+);
+

+ 24 - 0
utils/kamctl/postgres/uid_domain-create.sql

@@ -0,0 +1,24 @@
+INSERT INTO version (table_name, table_version) values ('uid_domain','2');
+CREATE TABLE uid_domain (
+    id SERIAL PRIMARY KEY NOT NULL,
+    did VARCHAR(64) NOT NULL,
+    domain VARCHAR(64) NOT NULL,
+    flags INTEGER DEFAULT 0 NOT NULL,
+    CONSTRAINT uid_domain_domain_idx UNIQUE (domain)
+);
+
+CREATE INDEX uid_domain_did_idx ON uid_domain (did);
+
+INSERT INTO version (table_name, table_version) values ('uid_domain_attrs','1');
+CREATE TABLE uid_domain_attrs (
+    id SERIAL PRIMARY KEY NOT NULL,
+    did VARCHAR(64),
+    name VARCHAR(32) NOT NULL,
+    type INTEGER DEFAULT 0 NOT NULL,
+    value VARCHAR(128),
+    flags INTEGER DEFAULT 0 NOT NULL,
+    CONSTRAINT uid_domain_attrs_domain_attr_idx UNIQUE (did, name, value)
+);
+
+CREATE INDEX uid_domain_attrs_domain_did ON uid_domain_attrs (did, flags);
+

+ 10 - 0
utils/kamctl/postgres/uid_gflags-create.sql

@@ -0,0 +1,10 @@
+INSERT INTO version (table_name, table_version) values ('uid_global_attrs','1');
+CREATE TABLE uid_global_attrs (
+    id SERIAL PRIMARY KEY NOT NULL,
+    name VARCHAR(32) NOT NULL,
+    type INTEGER DEFAULT 0 NOT NULL,
+    value VARCHAR(128),
+    flags INTEGER DEFAULT 0 NOT NULL,
+    CONSTRAINT uid_global_attrs_global_attrs_idx UNIQUE (name, value)
+);
+

+ 26 - 0
utils/kamctl/postgres/uid_uri_db-create.sql

@@ -0,0 +1,26 @@
+INSERT INTO version (table_name, table_version) values ('uid_uri','3');
+CREATE TABLE uid_uri (
+    id SERIAL PRIMARY KEY NOT NULL,
+    uid VARCHAR(64) NOT NULL,
+    did VARCHAR(64) NOT NULL,
+    username VARCHAR(64) NOT NULL,
+    flags INTEGER DEFAULT 0 NOT NULL,
+    scheme VARCHAR(8) DEFAULT 'sip' NOT NULL
+);
+
+CREATE INDEX uid_uri_uri_idx1 ON uid_uri (username, did, scheme);
+CREATE INDEX uid_uri_uri_uid ON uid_uri (uid);
+
+INSERT INTO version (table_name, table_version) values ('uid_uri_attrs','2');
+CREATE TABLE uid_uri_attrs (
+    id SERIAL PRIMARY KEY NOT NULL,
+    username VARCHAR(64) NOT NULL,
+    did VARCHAR(64) NOT NULL,
+    name VARCHAR(32) NOT NULL,
+    value VARCHAR(128),
+    type INTEGER DEFAULT 0 NOT NULL,
+    flags INTEGER DEFAULT 0 NOT NULL,
+    scheme VARCHAR(8) DEFAULT 'sip' NOT NULL,
+    CONSTRAINT uid_uri_attrs_uriattrs_idx UNIQUE (username, did, name, value, scheme)
+);
+

+ 186 - 0
utils/kamctl/xhttp_pi/pi_framework.xml

@@ -702,6 +702,85 @@
 		<column><field>auth_proxy</field><type>DB1_STR</type></column>
 		<column><field>expires</field><type>DB1_INT</type></column>
 	</db_table>
+	<!-- Declaration of uid_credentials table-->
+	<db_table id="uid_credentials">
+		<table_name>uid_credentials</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>auth_username</field><type>DB1_STR</type></column>
+		<column><field>did</field><type>DB1_STR</type></column>
+		<column><field>realm</field><type>DB1_STR</type></column>
+		<column><field>password</field><type>DB1_STR</type></column>
+		<column><field>flags</field><type>DB1_INT</type></column>
+		<column><field>ha1</field><type>DB1_STR</type></column>
+		<column><field>ha1b</field><type>DB1_STR</type></column>
+		<column><field>uid</field><type>DB1_STR</type></column>
+	</db_table>
+	<!-- Declaration of uid_user_attrs table-->
+	<db_table id="uid_user_attrs">
+		<table_name>uid_user_attrs</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>uid</field><type>DB1_STR</type></column>
+		<column><field>name</field><type>DB1_STR</type></column>
+		<column><field>value</field><type>DB1_STR</type></column>
+		<column><field>type</field><type>DB1_INT</type></column>
+		<column><field>flags</field><type>DB1_INT</type></column>
+	</db_table>
+	<!-- Declaration of uid_domain table-->
+	<db_table id="uid_domain">
+		<table_name>uid_domain</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>did</field><type>DB1_STR</type></column>
+		<column><field>domain</field><type>DB1_STR</type></column>
+		<column><field>flags</field><type>DB1_INT</type></column>
+	</db_table>
+	<!-- Declaration of uid_domain_attrs table-->
+	<db_table id="uid_domain_attrs">
+		<table_name>uid_domain_attrs</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>did</field><type>DB1_STR</type></column>
+		<column><field>name</field><type>DB1_STR</type></column>
+		<column><field>type</field><type>DB1_INT</type></column>
+		<column><field>value</field><type>DB1_STR</type></column>
+		<column><field>flags</field><type>DB1_INT</type></column>
+	</db_table>
+	<!-- Declaration of uid_global_attrs table-->
+	<db_table id="uid_global_attrs">
+		<table_name>uid_global_attrs</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>name</field><type>DB1_STR</type></column>
+		<column><field>type</field><type>DB1_INT</type></column>
+		<column><field>value</field><type>DB1_STR</type></column>
+		<column><field>flags</field><type>DB1_INT</type></column>
+	</db_table>
+	<!-- Declaration of uid_uri table-->
+	<db_table id="uid_uri">
+		<table_name>uid_uri</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>uid</field><type>DB1_STR</type></column>
+		<column><field>did</field><type>DB1_STR</type></column>
+		<column><field>username</field><type>DB1_STR</type></column>
+		<column><field>flags</field><type>DB1_INT</type></column>
+		<column><field>scheme</field><type>DB1_STR</type></column>
+	</db_table>
+	<!-- Declaration of uid_uri_attrs table-->
+	<db_table id="uid_uri_attrs">
+		<table_name>uid_uri_attrs</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>username</field><type>DB1_STR</type></column>
+		<column><field>did</field><type>DB1_STR</type></column>
+		<column><field>name</field><type>DB1_STR</type></column>
+		<column><field>value</field><type>DB1_STR</type></column>
+		<column><field>type</field><type>DB1_INT</type></column>
+		<column><field>flags</field><type>DB1_INT</type></column>
+		<column><field>scheme</field><type>DB1_STR</type></column>
+	</db_table>
 	<!-- Declaration of uri table-->
 	<db_table id="uri">
 		<table_name>uri</table_name>
@@ -1683,6 +1762,113 @@
 			</query_cols>
 		</cmd>
 	</mod>
+	<!-- uid_credentials provisionning -->
+	<mod><mod_name>uid_credentials</mod_name>
+		<cmd><cmd_name>show</cmd_name>
+			<db_table_id>uid_credentials</db_table_id>
+			<cmd_type>DB1_QUERY</cmd_type>
+			<query_cols>
+				<col><field>id</field></col>
+				<col><field>auth_username</field></col>
+				<col><field>did</field></col>
+				<col><field>realm</field></col>
+				<col><field>password</field></col>
+				<col><field>flags</field></col>
+				<col><field>ha1</field></col>
+				<col><field>ha1b</field></col>
+				<col><field>uid</field></col>
+			</query_cols>
+		</cmd>
+	</mod>
+	<!-- uid_user_attrs provisionning -->
+	<mod><mod_name>uid_user_attrs</mod_name>
+		<cmd><cmd_name>show</cmd_name>
+			<db_table_id>uid_user_attrs</db_table_id>
+			<cmd_type>DB1_QUERY</cmd_type>
+			<query_cols>
+				<col><field>id</field></col>
+				<col><field>uid</field></col>
+				<col><field>name</field></col>
+				<col><field>value</field></col>
+				<col><field>type</field></col>
+				<col><field>flags</field></col>
+			</query_cols>
+		</cmd>
+	</mod>
+	<!-- uid_domain provisionning -->
+	<mod><mod_name>uid_domain</mod_name>
+		<cmd><cmd_name>show</cmd_name>
+			<db_table_id>uid_domain</db_table_id>
+			<cmd_type>DB1_QUERY</cmd_type>
+			<query_cols>
+				<col><field>id</field></col>
+				<col><field>did</field></col>
+				<col><field>domain</field></col>
+				<col><field>flags</field></col>
+			</query_cols>
+		</cmd>
+	</mod>
+	<!-- uid_domain_attrs provisionning -->
+	<mod><mod_name>uid_domain_attrs</mod_name>
+		<cmd><cmd_name>show</cmd_name>
+			<db_table_id>uid_domain_attrs</db_table_id>
+			<cmd_type>DB1_QUERY</cmd_type>
+			<query_cols>
+				<col><field>id</field></col>
+				<col><field>did</field></col>
+				<col><field>name</field></col>
+				<col><field>type</field></col>
+				<col><field>value</field></col>
+				<col><field>flags</field></col>
+			</query_cols>
+		</cmd>
+	</mod>
+	<!-- uid_global_attrs provisionning -->
+	<mod><mod_name>uid_global_attrs</mod_name>
+		<cmd><cmd_name>show</cmd_name>
+			<db_table_id>uid_global_attrs</db_table_id>
+			<cmd_type>DB1_QUERY</cmd_type>
+			<query_cols>
+				<col><field>id</field></col>
+				<col><field>name</field></col>
+				<col><field>type</field></col>
+				<col><field>value</field></col>
+				<col><field>flags</field></col>
+			</query_cols>
+		</cmd>
+	</mod>
+	<!-- uid_uri provisionning -->
+	<mod><mod_name>uid_uri</mod_name>
+		<cmd><cmd_name>show</cmd_name>
+			<db_table_id>uid_uri</db_table_id>
+			<cmd_type>DB1_QUERY</cmd_type>
+			<query_cols>
+				<col><field>id</field></col>
+				<col><field>uid</field></col>
+				<col><field>did</field></col>
+				<col><field>username</field></col>
+				<col><field>flags</field></col>
+				<col><field>scheme</field></col>
+			</query_cols>
+		</cmd>
+	</mod>
+	<!-- uid_uri_attrs provisionning -->
+	<mod><mod_name>uid_uri_attrs</mod_name>
+		<cmd><cmd_name>show</cmd_name>
+			<db_table_id>uid_uri_attrs</db_table_id>
+			<cmd_type>DB1_QUERY</cmd_type>
+			<query_cols>
+				<col><field>id</field></col>
+				<col><field>username</field></col>
+				<col><field>did</field></col>
+				<col><field>name</field></col>
+				<col><field>value</field></col>
+				<col><field>type</field></col>
+				<col><field>flags</field></col>
+				<col><field>scheme</field></col>
+			</query_cols>
+		</cmd>
+	</mod>
 	<!-- uri provisionning -->
 	<mod><mod_name>uri</mod_name>
 		<cmd><cmd_name>show</cmd_name>

+ 18 - 0
utils/kamctl/xhttp_pi/uid_auth_db-mod

@@ -0,0 +1,18 @@
+	<!-- uid_credentials provisionning -->
+	<mod><mod_name>uid_credentials</mod_name>
+		<cmd><cmd_name>show</cmd_name>
+			<db_table_id>uid_credentials</db_table_id>
+			<cmd_type>DB1_QUERY</cmd_type>
+			<query_cols>
+				<col><field>id</field></col>
+				<col><field>auth_username</field></col>
+				<col><field>did</field></col>
+				<col><field>realm</field></col>
+				<col><field>password</field></col>
+				<col><field>flags</field></col>
+				<col><field>ha1</field></col>
+				<col><field>ha1b</field></col>
+				<col><field>uid</field></col>
+			</query_cols>
+		</cmd>
+	</mod>

+ 14 - 0
utils/kamctl/xhttp_pi/uid_auth_db-table

@@ -0,0 +1,14 @@
+	<!-- Declaration of uid_credentials table-->
+	<db_table id="uid_credentials">
+		<table_name>uid_credentials</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>auth_username</field><type>DB1_STR</type></column>
+		<column><field>did</field><type>DB1_STR</type></column>
+		<column><field>realm</field><type>DB1_STR</type></column>
+		<column><field>password</field><type>DB1_STR</type></column>
+		<column><field>flags</field><type>DB1_INT</type></column>
+		<column><field>ha1</field><type>DB1_STR</type></column>
+		<column><field>ha1b</field><type>DB1_STR</type></column>
+		<column><field>uid</field><type>DB1_STR</type></column>
+	</db_table>

+ 15 - 0
utils/kamctl/xhttp_pi/uid_avp_db-mod

@@ -0,0 +1,15 @@
+	<!-- uid_user_attrs provisionning -->
+	<mod><mod_name>uid_user_attrs</mod_name>
+		<cmd><cmd_name>show</cmd_name>
+			<db_table_id>uid_user_attrs</db_table_id>
+			<cmd_type>DB1_QUERY</cmd_type>
+			<query_cols>
+				<col><field>id</field></col>
+				<col><field>uid</field></col>
+				<col><field>name</field></col>
+				<col><field>value</field></col>
+				<col><field>type</field></col>
+				<col><field>flags</field></col>
+			</query_cols>
+		</cmd>
+	</mod>

+ 11 - 0
utils/kamctl/xhttp_pi/uid_avp_db-table

@@ -0,0 +1,11 @@
+	<!-- Declaration of uid_user_attrs table-->
+	<db_table id="uid_user_attrs">
+		<table_name>uid_user_attrs</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>uid</field><type>DB1_STR</type></column>
+		<column><field>name</field><type>DB1_STR</type></column>
+		<column><field>value</field><type>DB1_STR</type></column>
+		<column><field>type</field><type>DB1_INT</type></column>
+		<column><field>flags</field><type>DB1_INT</type></column>
+	</db_table>

+ 28 - 0
utils/kamctl/xhttp_pi/uid_domain-mod

@@ -0,0 +1,28 @@
+	<!-- uid_domain provisionning -->
+	<mod><mod_name>uid_domain</mod_name>
+		<cmd><cmd_name>show</cmd_name>
+			<db_table_id>uid_domain</db_table_id>
+			<cmd_type>DB1_QUERY</cmd_type>
+			<query_cols>
+				<col><field>id</field></col>
+				<col><field>did</field></col>
+				<col><field>domain</field></col>
+				<col><field>flags</field></col>
+			</query_cols>
+		</cmd>
+	</mod>
+	<!-- uid_domain_attrs provisionning -->
+	<mod><mod_name>uid_domain_attrs</mod_name>
+		<cmd><cmd_name>show</cmd_name>
+			<db_table_id>uid_domain_attrs</db_table_id>
+			<cmd_type>DB1_QUERY</cmd_type>
+			<query_cols>
+				<col><field>id</field></col>
+				<col><field>did</field></col>
+				<col><field>name</field></col>
+				<col><field>type</field></col>
+				<col><field>value</field></col>
+				<col><field>flags</field></col>
+			</query_cols>
+		</cmd>
+	</mod>

+ 20 - 0
utils/kamctl/xhttp_pi/uid_domain-table

@@ -0,0 +1,20 @@
+	<!-- Declaration of uid_domain table-->
+	<db_table id="uid_domain">
+		<table_name>uid_domain</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>did</field><type>DB1_STR</type></column>
+		<column><field>domain</field><type>DB1_STR</type></column>
+		<column><field>flags</field><type>DB1_INT</type></column>
+	</db_table>
+	<!-- Declaration of uid_domain_attrs table-->
+	<db_table id="uid_domain_attrs">
+		<table_name>uid_domain_attrs</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>did</field><type>DB1_STR</type></column>
+		<column><field>name</field><type>DB1_STR</type></column>
+		<column><field>type</field><type>DB1_INT</type></column>
+		<column><field>value</field><type>DB1_STR</type></column>
+		<column><field>flags</field><type>DB1_INT</type></column>
+	</db_table>

+ 14 - 0
utils/kamctl/xhttp_pi/uid_gflags-mod

@@ -0,0 +1,14 @@
+	<!-- uid_global_attrs provisionning -->
+	<mod><mod_name>uid_global_attrs</mod_name>
+		<cmd><cmd_name>show</cmd_name>
+			<db_table_id>uid_global_attrs</db_table_id>
+			<cmd_type>DB1_QUERY</cmd_type>
+			<query_cols>
+				<col><field>id</field></col>
+				<col><field>name</field></col>
+				<col><field>type</field></col>
+				<col><field>value</field></col>
+				<col><field>flags</field></col>
+			</query_cols>
+		</cmd>
+	</mod>

+ 10 - 0
utils/kamctl/xhttp_pi/uid_gflags-table

@@ -0,0 +1,10 @@
+	<!-- Declaration of uid_global_attrs table-->
+	<db_table id="uid_global_attrs">
+		<table_name>uid_global_attrs</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>name</field><type>DB1_STR</type></column>
+		<column><field>type</field><type>DB1_INT</type></column>
+		<column><field>value</field><type>DB1_STR</type></column>
+		<column><field>flags</field><type>DB1_INT</type></column>
+	</db_table>

+ 32 - 0
utils/kamctl/xhttp_pi/uid_uri_db-mod

@@ -0,0 +1,32 @@
+	<!-- uid_uri provisionning -->
+	<mod><mod_name>uid_uri</mod_name>
+		<cmd><cmd_name>show</cmd_name>
+			<db_table_id>uid_uri</db_table_id>
+			<cmd_type>DB1_QUERY</cmd_type>
+			<query_cols>
+				<col><field>id</field></col>
+				<col><field>uid</field></col>
+				<col><field>did</field></col>
+				<col><field>username</field></col>
+				<col><field>flags</field></col>
+				<col><field>scheme</field></col>
+			</query_cols>
+		</cmd>
+	</mod>
+	<!-- uid_uri_attrs provisionning -->
+	<mod><mod_name>uid_uri_attrs</mod_name>
+		<cmd><cmd_name>show</cmd_name>
+			<db_table_id>uid_uri_attrs</db_table_id>
+			<cmd_type>DB1_QUERY</cmd_type>
+			<query_cols>
+				<col><field>id</field></col>
+				<col><field>username</field></col>
+				<col><field>did</field></col>
+				<col><field>name</field></col>
+				<col><field>value</field></col>
+				<col><field>type</field></col>
+				<col><field>flags</field></col>
+				<col><field>scheme</field></col>
+			</query_cols>
+		</cmd>
+	</mod>

+ 24 - 0
utils/kamctl/xhttp_pi/uid_uri_db-table

@@ -0,0 +1,24 @@
+	<!-- Declaration of uid_uri table-->
+	<db_table id="uid_uri">
+		<table_name>uid_uri</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>uid</field><type>DB1_STR</type></column>
+		<column><field>did</field><type>DB1_STR</type></column>
+		<column><field>username</field><type>DB1_STR</type></column>
+		<column><field>flags</field><type>DB1_INT</type></column>
+		<column><field>scheme</field><type>DB1_STR</type></column>
+	</db_table>
+	<!-- Declaration of uid_uri_attrs table-->
+	<db_table id="uid_uri_attrs">
+		<table_name>uid_uri_attrs</table_name>
+		<db_url_id>mysql</db_url_id>
+		<column><field>id</field><type>DB1_INT</type></column>
+		<column><field>username</field><type>DB1_STR</type></column>
+		<column><field>did</field><type>DB1_STR</type></column>
+		<column><field>name</field><type>DB1_STR</type></column>
+		<column><field>value</field><type>DB1_STR</type></column>
+		<column><field>type</field><type>DB1_INT</type></column>
+		<column><field>flags</field><type>DB1_INT</type></column>
+		<column><field>scheme</field><type>DB1_STR</type></column>
+	</db_table>