<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[Freeswitch-trunk][16971] </title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<div id="header">FreeSWITCH Subversion</div>
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://fisheye.freeswitch.org/changelog/FreeSWITCH?cs=16971">16971</a></dd>
<dt>Author</dt> <dd>ledr</dd>
<dt>Date</dt> <dd>2010-03-12 03:03:47 -0600 (Fri, 12 Mar 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Changed sql- and template files to support both mysql and postgresql</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunkcontribmodxml_intmod_xml_odbcxml_odbcconfxml">freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc.conf.xml</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#freeswitchtrunkcontribmodxml_intmod_xml_odbcstructurepgsqlsql">freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/structure.pgsql.sql</a></li>
<li><a href="#freeswitchtrunkcontribmodxml_intmod_xml_odbctestdatapgsqlsql">freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/testdata.pgsql.sql</a></li>
<li><a href="#freeswitchtrunkcontribmodxml_intmod_xml_odbcxml_odbc_templatesdirectorygatewaysmysqlxml">freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-gateways.mysql.xml</a></li>
<li><a href="#freeswitchtrunkcontribmodxml_intmod_xml_odbcxml_odbc_templatesdirectorygatewayspgsqlxml">freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-gateways.pgsql.xml</a></li>
<li><a href="#freeswitchtrunkcontribmodxml_intmod_xml_odbcxml_odbc_templatesdirectoryusermysqlxml">freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-user.mysql.xml</a></li>
<li><a href="#freeswitchtrunkcontribmodxml_intmod_xml_odbcxml_odbc_templatesdirectoryuserpgsqlxml">freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-user.pgsql.xml</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#freeswitchtrunkcontribmodxml_intmod_xml_odbcxml_odbc_templatesdialplanxml">freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/dialplan.xml</a></li>
<li><a href="#freeswitchtrunkcontribmodxml_intmod_xml_odbcxml_odbc_templatesdirectorygatewaysxml">freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-gateways.xml</a></li>
<li><a href="#freeswitchtrunkcontribmodxml_intmod_xml_odbcxml_odbc_templatesdirectoryuserxml">freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-user.xml</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkcontribmodxml_intmod_xml_odbcstructurepgsqlsql"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/structure.pgsql.sql (0 => 16971)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/structure.pgsql.sql                                (rev 0)
+++ freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/structure.pgsql.sql        2010-03-12 09:03:47 UTC (rev 16971)
</span><span class="lines">@@ -0,0 +1,99 @@
</span><ins>+-- directory domains
+
+CREATE TABLE dir_domains (
+  id SERIAL NOT NULL,
+  name VARCHAR(255) NOT NULL,
+  CONSTRAINT dir_domains_id PRIMARY KEY (id)
+);
+
+CREATE UNIQUE INDEX dir_domains_name_index
+  ON dir_domains (name);
+
+
+CREATE TABLE dir_domain_params (
+  id SERIAL NOT NULL,
+  dir_domain_id INTEGER NOT NULL REFERENCES dir_domains(id),
+  name VARCHAR(255) NOT NULL,
+  value VARCHAR(255) NOT NULL,
+  CONSTRAINT dir_domain_params_id PRIMARY KEY (id)
+);
+
+CREATE UNIQUE INDEX dir_domain_params_dir_domain_id_name_index
+  ON dir_domain_params (dir_domain_id, name);
+
+
+CREATE TABLE dir_domain_variables (
+  id SERIAL NOT NULL,
+  dir_domain_id INTEGER NOT NULL REFERENCES dir_domains(id),
+  name VARCHAR(255) NOT NULL,
+  value VARCHAR(255) NOT NULL,
+  CONSTRAINT dir_domain_variables_id PRIMARY KEY (id)
+);
+
+CREATE UNIQUE INDEX dir_domain_variables_dir_domain_id_name_index
+  ON dir_domain_variables (dir_domain_id, name);
+
+
+
+-- directory users
+
+CREATE TABLE dir_users (
+  id SERIAL NOT NULL,
+  dir_domain_id INTEGER NOT NULL REFERENCES dir_domains(id),
+  username VARCHAR(255) NOT NULL,
+  enabled BOOLEAN NOT NULL DEFAULT 'true',
+  cidr VARCHAR(255),
+  mailbox VARCHAR(255),
+  &quot;number-alias&quot; VARCHAR(255),
+  CONSTRAINT dir_users_id PRIMARY KEY (id)
+);
+
+CREATE UNIQUE INDEX dir_users_dir_domain_id_username_index
+  ON dir_users (dir_domain_id, username);
+
+
+CREATE TABLE dir_user_params (
+  id SERIAL NOT NULL,
+  dir_user_id INTEGER NOT NULL REFERENCES dir_users(id),
+  name VARCHAR(255) NOT NULL,
+  value VARCHAR(255) NOT NULL,
+  CONSTRAINT dir_user_params_id PRIMARY KEY (id)
+);
+
+CREATE UNIQUE INDEX dir_user_params_dir_user_id_name_index
+  ON dir_user_params (dir_user_id, name);
+
+
+CREATE TABLE dir_user_variables (
+  id SERIAL NOT NULL,
+  dir_user_id INTEGER NOT NULL,
+  name VARCHAR(255) NOT NULL,
+  value VARCHAR(255) NOT NULL,
+  CONSTRAINT dir_user_variables_id PRIMARY KEY (id)
+);
+
+CREATE UNIQUE INDEX dir_user_variables_dir_user_id_name_index
+  ON dir_user_variables (dir_user_id, name);
+
+
+
+-- directory groups
+
+CREATE TABLE dir_groups (
+  id SERIAL NOT NULL,
+  name VARCHAR(255) NOT NULL,
+  CONSTRAINT dir_groups_id PRIMARY KEY (id)
+);
+
+CREATE UNIQUE INDEX dir_groups_name_index
+  ON dir_groups (name);
+
+
+CREATE TABLE dir_groups_users (
+  dir_group_id INTEGER NOT NULL REFERENCES dir_groups(id),
+  dir_user_id INTEGER NOT NULL REFERENCES dir_users(id)
+);
+
+CREATE UNIQUE INDEX dir_groups_users_index
+  ON dir_groups_users (dir_group_id, dir_user_id);
+
</ins></span></pre></div>
<a id="freeswitchtrunkcontribmodxml_intmod_xml_odbctestdatapgsqlsql"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/testdata.pgsql.sql (0 => 16971)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/testdata.pgsql.sql                                (rev 0)
+++ freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/testdata.pgsql.sql        2010-03-12 09:03:47 UTC (rev 16971)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+INSERT INTO dir_domains (id, name) VALUES (1, 'freeswitch-rocks.org');
+INSERT INTO dir_domain_params (id, dir_domain_id, name, value) VALUES (1, 1, 'dom_param_name', 'dom_param_value');
+INSERT INTO dir_domain_variables (id, dir_domain_id, name, value) VALUES (1, 1, 'dom_variable_name', 'dom_variable_value');
+INSERT INTO dir_groups (id, name) VALUES (1, 'prepay'), (2, 'annoying_customers');
+INSERT INTO dir_groups_users (dir_group_id, dir_user_id) VALUES (1, 1), (2, 1);
+INSERT INTO dir_users (id, dir_domain_id, username, enabled, cidr, mailbox, number-alias) VALUES (1, 1, 'someuser', 'true', NULL, 'test@test.com', '1234');
+INSERT INTO dir_user_params (id, dir_user_id, name, value) VALUES (1, 1, 'password', 'topsecret'), (2, 1, 'vm-password', '0000');
+INSERT INTO dir_user_variables (id, dir_user_id, name, value) VALUES (1, 1, 'accountcode', '1234'), (2, 1, 'user_context', 'default'), (3, 1, 'vm_extension', '1234');
</ins></span></pre></div>
<a id="freeswitchtrunkcontribmodxml_intmod_xml_odbcxml_odbcconfxml"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc.conf.xml (16970 => 16971)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc.conf.xml        2010-03-11 20:41:46 UTC (rev 16970)
+++ freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc.conf.xml        2010-03-12 09:03:47 UTC (rev 16971)
</span><span class="lines">@@ -56,7 +56,11 @@
</span><span class="cx">       &lt;/document&gt;
</span><span class="cx">     &lt;/template&gt;
</span><span class="cx"> 
</span><del>-    &lt;X-PRE-PROCESS cmd=&quot;include&quot; data=&quot;xml_odbc_templates/*.xml&quot;/&gt;
</del><ins>+    &lt;!-- There is some difference in queries to mysql or postgresql, for example:
+         mysql: tablename.`columnname-contains-hyphens`
+         postgresql: tablename.&quot;columnname-contains-hyphens&quot;
+         Choose the database you're using in the include data (pgsql or mysql) --&gt;
+    &lt;X-PRE-PROCESS cmd=&quot;include&quot; data=&quot;xml_odbc_templates/*.pgsql.xml&quot;/&gt;
</ins><span class="cx"> 
</span><span class="cx">   &lt;/templates&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="freeswitchtrunkcontribmodxml_intmod_xml_odbcxml_odbc_templatesdialplanxml"></a>
<div class="delfile"><h4>Deleted: freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/dialplan.xml</h4></div>
<a id="freeswitchtrunkcontribmodxml_intmod_xml_odbcxml_odbc_templatesdirectorygatewaysmysqlxmlfromrev16957freeswitchtrunkcontribmodxml_intmod_xml_odbcxml_odbc_templatesdirectorygatewaysxml"></a>
<div class="copfile"><h4>Copied: freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-gateways.mysql.xml (from rev 16957, freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-gateways.xml) (0 => 16971)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-gateways.mysql.xml                                (rev 0)
+++ freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-gateways.mysql.xml        2010-03-12 09:03:47 UTC (rev 16971)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;include&gt;
+  &lt;!-- purpose=gateways is not only called for getting gateways, but also for getting a list
+       of domains that will be aliased to a profile if &lt;domain .. alias=&quot;true&quot;/&gt; is set --&gt;
+  &lt;template name=&quot;directory-gateways&quot;&gt;
+    &lt;document type=&quot;freeswitch/xml&quot;&gt;
+      &lt;section name=&quot;directory&quot;&gt;
+        &lt;xml-odbc-do name=&quot;set-event-header&quot; to-name=&quot;where-clause&quot; to-value=&quot;`${key_name}`='${key_value}'&quot;/&gt;
+        &lt;xml-odbc-do name=&quot;set-event-header&quot; if-name=&quot;where-clause&quot; if-value=&quot;``=''&quot; to-value=&quot;1&quot;/&gt;
+        &lt;xml-odbc-do name=&quot;query&quot; on-empty-result-break-to=&quot;not-found&quot;
+                     value=&quot;SELECT name AS domain_name FROM dir_domains WHERE ${where-clause};&quot;&gt;
+          &lt;domain name=&quot;${domain_name}&quot;/&gt;
+          &lt;!-- select all gateways of users within this domain_name here, to make parse=true working --&gt;
+        &lt;/xml-odbc-do&gt;
+      &lt;/section&gt;
+    &lt;/document&gt;
+  &lt;/template&gt;
+&lt;/include&gt;
</ins></span></pre></div>
<a id="freeswitchtrunkcontribmodxml_intmod_xml_odbcxml_odbc_templatesdirectorygatewayspgsqlxml"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-gateways.pgsql.xml (0 => 16971)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-gateways.pgsql.xml                                (rev 0)
+++ freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-gateways.pgsql.xml        2010-03-12 09:03:47 UTC (rev 16971)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;include&gt;
+  &lt;!-- purpose=gateways is not only called for getting gateways, but also for getting a list
+       of domains that will be aliased to a profile if &lt;domain .. alias=&quot;true&quot;/&gt; is set --&gt;
+  &lt;template name=&quot;directory-gateways&quot;&gt;
+    &lt;document type=&quot;freeswitch/xml&quot;&gt;
+      &lt;section name=&quot;directory&quot;&gt; &lt;!-- not the most efficient way, but gets executed seldom, so let it slide... --&gt;
+        &lt;xml-odbc-do name=&quot;set-event-header&quot; to-name=&quot;where-clause&quot; to-value=&quot;&amp;quot;${key_name}&amp;quot;='${key_value}'&quot;/&gt;
+        &lt;xml-odbc-do name=&quot;set-event-header&quot; if-name=&quot;where-clause&quot; if-value=&quot;&amp;quot;&amp;quot;=''&quot; to-value=&quot;true&quot;/&gt;
+        &lt;xml-odbc-do name=&quot;query&quot; on-empty-result-break-to=&quot;not-found&quot;
+                     value=&quot;SELECT name AS domain_name FROM dir_domains WHERE ${where-clause};&quot;&gt;
+          &lt;domain name=&quot;${domain_name}&quot;/&gt;
+          &lt;!-- select all gateways of users within this domain_name here, to make parse=true working --&gt;
+        &lt;/xml-odbc-do&gt;
+      &lt;/section&gt;
+    &lt;/document&gt;
+  &lt;/template&gt;
+&lt;/include&gt;
</ins></span></pre></div>
<a id="freeswitchtrunkcontribmodxml_intmod_xml_odbcxml_odbc_templatesdirectorygatewaysxml"></a>
<div class="delfile"><h4>Deleted: freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-gateways.xml</h4></div>
<a id="freeswitchtrunkcontribmodxml_intmod_xml_odbcxml_odbc_templatesdirectoryusermysqlxmlfromrev16957freeswitchtrunkcontribmodxml_intmod_xml_odbcxml_odbc_templatesdirectoryuserxml"></a>
<div class="copfile"><h4>Copied: freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-user.mysql.xml (from rev 16957, freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-user.xml) (0 => 16971)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-user.mysql.xml                                (rev 0)
+++ freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-user.mysql.xml        2010-03-12 09:03:47 UTC (rev 16971)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+&lt;include&gt;
+  &lt;template name=&quot;directory-user&quot;&gt;
+    &lt;document type=&quot;freeswitch/xml&quot;&gt;
+      &lt;xml-odbc-do name=&quot;set-event-header&quot; if-name=&quot;key&quot; if-value=&quot;id&quot; to-value=&quot;username&quot;/&gt;
+      &lt;xml-odbc-do name=&quot;query&quot; on-empty-result-break-to=&quot;not-found&quot; value=&quot;
+        SELECT
+          dir_domains.id AS domain_id,
+          dir_users.id AS user_id,
+          dir_users.username,
+          dir_users.cidr,
+          dir_users.mailbox,
+          dir_users.`number-alias`
+        FROM
+          dir_domains,
+          dir_users
+        WHERE
+          dir_users.`${key}` = '${user}' AND
+          dir_domains.name = '${domain}' AND
+          dir_users.dir_domain_id = dir_domains.id AND
+          dir_users.enabled = '1';&quot;/&gt;
+      &lt;section name=&quot;directory&quot;&gt;
+        &lt;domain name=&quot;${domain}&quot;&gt;
+          &lt;params&gt;
+            &lt;xml-odbc-do name=&quot;query&quot; value=&quot;
+              SELECT
+                name, value
+              FROM
+                dir_domain_params
+              WHERE
+                dir_domain_id = '${domain_id}';&quot;&gt;
+              &lt;param name=&quot;${name}&quot; value=&quot;${value}&quot;/&gt;
+            &lt;/xml-odbc-do&gt;
+          &lt;/params&gt;
+          &lt;variables&gt;
+            &lt;xml-odbc-do name=&quot;query&quot; value=&quot;
+              SELECT
+                name, value
+              FROM
+                dir_domain_variables
+              WHERE
+                dir_domain_id = '${domain_id}';&quot;&gt;
+              &lt;variable name=&quot;${name}&quot; value=&quot;${value}&quot;/&gt;
+            &lt;/xml-odbc-do&gt;
+          &lt;/variables&gt;
+          &lt;groups&gt;
+            &lt;group name=&quot;default&quot;&gt;
+              &lt;users&gt;
+                &lt;user id=&quot;${username}&quot; mailbox=&quot;${mailbox}&quot; cidr=&quot;${cidr}&quot; number-alias=&quot;${number-alias}&quot;&gt;
+                  &lt;params&gt;
+                    &lt;xml-odbc-do name=&quot;query&quot; on-empty-result-break-to=&quot;not-found&quot; value=&quot;
+                      SELECT
+                        name, value
+                      FROM
+                        dir_user_params
+                      WHERE
+                        dir_user_id = '${user_id}';&quot;&gt;
+                      &lt;param name=&quot;${name}&quot; value=&quot;${value}&quot;/&gt;
+                    &lt;/xml-odbc-do&gt;
+                  &lt;/params&gt;
+                  &lt;variables&gt;
+                    &lt;xml-odbc-do name=&quot;query&quot; value=&quot;
+                      SELECT
+                        name, value
+                      FROM
+                        dir_user_variables
+                      WHERE
+                        dir_user_id = '${user_id}';&quot;&gt;
+                      &lt;variable name=&quot;${name}&quot; value=&quot;${value}&quot;/&gt;
+                    &lt;/xml-odbc-do&gt;
+                  &lt;/variables&gt;
+                &lt;/user&gt;
+              &lt;/users&gt;
+            &lt;/group&gt;
+            &lt;xml-odbc-do name=&quot;query&quot; value=&quot;
+              SELECT
+                name AS group_name
+              FROM
+                dir_groups,
+                dir_groups_users
+              WHERE
+                dir_groups_users.dir_group_id = dir_groups.id AND
+                dir_user_id = '${user_id}';&quot;&gt;
+              &lt;group name=&quot;${group_name}&quot;&gt;
+                &lt;user id=&quot;${username}&quot; type=&quot;pointer&quot;/&gt;
+              &lt;/group&gt;
+            &lt;/xml-odbc-do&gt;
+          &lt;/groups&gt;
+        &lt;/domain&gt;
+      &lt;/section&gt;
+    &lt;/document&gt;
+  &lt;/template&gt;
+&lt;/include&gt;
</ins></span></pre></div>
<a id="freeswitchtrunkcontribmodxml_intmod_xml_odbcxml_odbc_templatesdirectoryuserpgsqlxml"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-user.pgsql.xml (0 => 16971)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-user.pgsql.xml                                (rev 0)
+++ freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-user.pgsql.xml        2010-03-12 09:03:47 UTC (rev 16971)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+&lt;include&gt;
+  &lt;template name=&quot;directory-user&quot;&gt;
+    &lt;document type=&quot;freeswitch/xml&quot;&gt;
+      &lt;xml-odbc-do name=&quot;set-event-header&quot; if-name=&quot;key&quot; if-value=&quot;id&quot; to-value=&quot;username&quot;/&gt;
+      &lt;xml-odbc-do name=&quot;query&quot; on-empty-result-break-to=&quot;not-found&quot; value=&quot;
+        SELECT
+          dir_domains.id AS domain_id,
+          dir_users.id AS user_id,
+          dir_users.username,
+          dir_users.cidr,
+          dir_users.mailbox,
+          dir_users.&amp;quot;number-alias&amp;quot;
+        FROM
+          dir_domains,
+          dir_users
+        WHERE
+          dir_users.&amp;quot;${key}&amp;quot; = '${user}' AND
+          dir_domains.name = '${domain}' AND
+          dir_users.dir_domain_id = dir_domains.id AND
+          dir_users.enabled = '1';&quot;/&gt;
+      &lt;section name=&quot;directory&quot;&gt;
+        &lt;domain name=&quot;${domain}&quot;&gt;
+          &lt;params&gt;
+            &lt;xml-odbc-do name=&quot;query&quot; value=&quot;
+              SELECT
+                name, value
+              FROM
+                dir_domain_params
+              WHERE
+                dir_domain_id = '${domain_id}';&quot;&gt;
+              &lt;param name=&quot;${name}&quot; value=&quot;${value}&quot;/&gt;
+            &lt;/xml-odbc-do&gt;
+          &lt;/params&gt;
+          &lt;variables&gt;
+            &lt;xml-odbc-do name=&quot;query&quot; value=&quot;
+              SELECT
+                name, value
+              FROM
+                dir_domain_variables
+              WHERE
+                dir_domain_id = '${domain_id}';&quot;&gt;
+              &lt;variable name=&quot;${name}&quot; value=&quot;${value}&quot;/&gt;
+            &lt;/xml-odbc-do&gt;
+          &lt;/variables&gt;
+          &lt;groups&gt;
+            &lt;group name=&quot;default&quot;&gt;
+              &lt;users&gt;
+                &lt;user id=&quot;${username}&quot; mailbox=&quot;${mailbox}&quot; cidr=&quot;${cidr}&quot; number-alias=&quot;${number-alias}&quot;&gt;
+                  &lt;params&gt;
+                    &lt;xml-odbc-do name=&quot;query&quot; on-empty-result-break-to=&quot;not-found&quot; value=&quot;
+                      SELECT
+                        name, value
+                      FROM
+                        dir_user_params
+                      WHERE
+                        dir_user_id = '${user_id}';&quot;&gt;
+                      &lt;param name=&quot;${name}&quot; value=&quot;${value}&quot;/&gt;
+                    &lt;/xml-odbc-do&gt;
+                  &lt;/params&gt;
+                  &lt;variables&gt;
+                    &lt;xml-odbc-do name=&quot;query&quot; value=&quot;
+                      SELECT
+                        name, value
+                      FROM
+                        dir_user_variables
+                      WHERE
+                        dir_user_id = '${user_id}';&quot;&gt;
+                      &lt;variable name=&quot;${name}&quot; value=&quot;${value}&quot;/&gt;
+                    &lt;/xml-odbc-do&gt;
+                  &lt;/variables&gt;
+                &lt;/user&gt;
+              &lt;/users&gt;
+            &lt;/group&gt;
+            &lt;xml-odbc-do name=&quot;query&quot; value=&quot;
+              SELECT
+                name AS group_name
+              FROM
+                dir_groups,
+                dir_groups_users
+              WHERE
+                dir_groups_users.dir_group_id = dir_groups.id AND
+                dir_user_id = '${user_id}';&quot;&gt;
+              &lt;group name=&quot;${group_name}&quot;&gt;
+                &lt;user id=&quot;${username}&quot; type=&quot;pointer&quot;/&gt;
+              &lt;/group&gt;
+            &lt;/xml-odbc-do&gt;
+          &lt;/groups&gt;
+        &lt;/domain&gt;
+      &lt;/section&gt;
+    &lt;/document&gt;
+  &lt;/template&gt;
+&lt;/include&gt;
</ins></span></pre></div>
<a id="freeswitchtrunkcontribmodxml_intmod_xml_odbcxml_odbc_templatesdirectoryuserxml"></a>
<div class="delfile"><h4>Deleted: freeswitch/trunk/contrib/mod/xml_int/mod_xml_odbc/xml_odbc_templates/directory-user.xml</h4></div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>