<h1>Project "FreeSWITCH Source" received a push.</h1>

<h2>branch: master updated</h2>
<pre>
       via: ea29a1dfcc53729af1e7798050a62566700d99fa (commit)
      from: f202328effa33588b3766a63ca0a7f6ab835ef76 (commit)


</pre>= COMMIT LOG ===========================================================
<div class="highlight"><pre>committer: Mathieu Parent
comments: 
centralized registration:
<span style="color: #A00000">- allow infinite registrations (expire=0)</span>
<span style="color: #A00000">- when removing a registration, keep the other with same user if multiple reg is allowed</span>

<span style="color: #000080; font-weight: bold">diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c</span>
<span style="color: #000080; font-weight: bold">index 1274213..2a6f9e3 100644</span>
<span style="color: #A00000">--- a/src/switch_core_sqldb.c</span>
<span style="color: #00A000">+++ b/src/switch_core_sqldb.c</span>
<span style="color: #800080; font-weight: bold">@@ -1696,7 +1696,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_del_registration(const char *user, c</span>
                 return SWITCH_STATUS_FALSE;
         }
 
<span style="color: #A00000">-        sql = switch_mprintf(&quot;delete from registrations where reg_user=&#39;%q&#39; and realm=&#39;%q&#39; and hostname=&#39;%q&#39;&quot;, user, realm, switch_core_get_hostname());</span>
<span style="color: #00A000">+        if (!zstr(token) &amp;&amp; runtime.multiple_registrations) {</span>
<span style="color: #00A000">+                sql = switch_mprintf(&quot;delete from registrations where reg_user=&#39;%q&#39; and realm=&#39;%q&#39; and hostname=&#39;%q&#39; and token=&#39;%q&#39;&quot;, user, realm, switch_core_get_hostname(), token);</span>
<span style="color: #00A000">+        } else {</span>
<span style="color: #00A000">+                sql = switch_mprintf(&quot;delete from registrations where reg_user=&#39;%q&#39; and realm=&#39;%q&#39; and hostname=&#39;%q&#39;&quot;, user, realm, switch_core_get_hostname());</span>
<span style="color: #00A000">+        }</span>
 
         switch_cache_db_execute_sql(dbh, sql, NULL);
         switch_cache_db_release_db_handle(&amp;dbh);
<span style="color: #800080; font-weight: bold">@@ -1723,7 +1727,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_expire_registration(int force)</span>
         if (force) {
                 sql = switch_mprintf(&quot;delete from registrations where hostname=&#39;%q&#39;&quot;, switch_core_get_hostname());
         } else {
<span style="color: #A00000">-                sql = switch_mprintf(&quot;delete from registrations where expires &lt;= %ld and hostname=&#39;%q&#39;&quot;, now, switch_core_get_hostname());</span>
<span style="color: #00A000">+                sql = switch_mprintf(&quot;delete from registrations where expires &gt; 0 and expires &lt;= %ld and hostname=&#39;%q&#39;&quot;, now, switch_core_get_hostname());</span>
         }
 
         switch_cache_db_execute_sql(dbh, sql, NULL);
</pre></div>
========================================================================<pre>

Summary of changes:
 src/switch_core_sqldb.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
</pre>
<p>this email was generated because of /git/your-repo.git/hooks/post-receive by the file /git-core/contrib/hooks/post-receive-email<br />
For more info, see <a href="http://blog.chomperstomp.com/?p=630">http://blog.chomperstomp.com/?p=630</a>
-- <br />
FreeSWITCH Source</p>