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

<h2>branch: master updated</h2>
<pre>
       via: 500e9acd254e1e2b50d07aec2fe1241fe3e18aba (commit)
      from: 2e399b0baf871b82e8b1bd553fce16b54abe6d7b (commit)


</pre>= COMMIT LOG ===========================================================
<div class="highlight"><pre>committer: Marc Olivier Chouinard
comments: 
switch_core: Add capability to specify core-db-name in switch.conf.xml to have sqlite in a different location.  This is important for everyone with relatively &#39;high&#39; sip registration since the addition of sip registration to the core require sqlite db to be moved to a faster location (Ramdisk for example). Useful for everyone who moved their sqlite db for sofia to ramdisk because of performance issue.

<span style="color: #000080; font-weight: bold">diff --git a/conf/autoload_configs/switch.conf.xml b/conf/autoload_configs/switch.conf.xml</span>
<span style="color: #000080; font-weight: bold">index 44893b9..95c4333 100644</span>
<span style="color: #A00000">--- a/conf/autoload_configs/switch.conf.xml</span>
<span style="color: #00A000">+++ b/conf/autoload_configs/switch.conf.xml</span>
<span style="color: #800080; font-weight: bold">@@ -94,6 +94,8 @@</span>
     &lt;!--&lt;param name=&quot;rtp-end-port&quot; value=&quot;32768&quot;/&gt;--&gt;
     &lt;param name=&quot;rtp-enable-zrtp&quot; value=&quot;true&quot;/&gt;
     &lt;!-- &lt;param name=&quot;core-db-dsn&quot; value=&quot;dsn:username:password&quot; /&gt; --&gt;
<span style="color: #00A000">+    &lt;!-- Allow to specify the sqlite db at a different location (In this example, move it to ramdrive for better performance on most linux distro (note, you loose the data if you reboot)) --&gt;</span>
<span style="color: #00A000">+    &lt;!-- &lt;param name=&quot;core-db-name&quot; value=&quot;/dev/shm/core.db&quot; /&gt; --&gt;</span>
     &lt;!-- The system will create all the db schemas automatically, set this to false to avoid this behaviour--&gt;
     &lt;!--&lt;param name=&quot;auto-create-schemas&quot; value=&quot;true&quot;/&gt;--&gt;
          &lt;!-- &lt;param name=&quot;core-dbtype&quot; value=&quot;MSSQL&quot;/&gt; --&gt;
<span style="color: #000080; font-weight: bold">diff --git a/src/include/private/switch_core_pvt.h b/src/include/private/switch_core_pvt.h</span>
<span style="color: #000080; font-weight: bold">index 05cd24d..f8c6a79 100644</span>
<span style="color: #A00000">--- a/src/include/private/switch_core_pvt.h</span>
<span style="color: #00A000">+++ b/src/include/private/switch_core_pvt.h</span>
<span style="color: #800080; font-weight: bold">@@ -236,6 +236,7 @@ struct switch_runtime {</span>
         char *odbc_dsn;
         char *odbc_user;
         char *odbc_pass;
<span style="color: #00A000">+        char *dbname;</span>
         uint32_t debug_level;
         uint32_t runlevel;
         uint32_t tipping_point;
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_core.c b/src/switch_core.c</span>
<span style="color: #000080; font-weight: bold">index 0eb51cc..66731b6 100644</span>
<span style="color: #A00000">--- a/src/switch_core.c</span>
<span style="color: #00A000">+++ b/src/switch_core.c</span>
<span style="color: #800080; font-weight: bold">@@ -1298,6 +1298,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc</span>
         runtime.default_dtmf_duration = SWITCH_DEFAULT_DTMF_DURATION;
         runtime.min_dtmf_duration = SWITCH_MIN_DTMF_DURATION;
         runtime.odbc_dbtype = DBTYPE_DEFAULT;
<span style="color: #00A000">+        runtime.dbname = NULL;</span>
 
         /* INIT APR and Create the pool context */
         if (apr_initialize() != SWITCH_STATUS_SUCCESS) {
<span style="color: #800080; font-weight: bold">@@ -1641,6 +1642,8 @@ static void switch_load_core_config(const char *file)</span>
                                         switch_rtp_set_start_port((switch_port_t) atoi(val));
                                 } else if (!strcasecmp(var, &quot;rtp-end-port&quot;) &amp;&amp; !zstr(val)) {
                                         switch_rtp_set_end_port((switch_port_t) atoi(val));
<span style="color: #00A000">+                                } else if (!strcasecmp(var, &quot;core-db-name&quot;) &amp;&amp; !zstr(val)) {</span>
<span style="color: #00A000">+                                        runtime.dbname = switch_core_strdup(runtime.memory_pool, val);</span>
                                 } else if (!strcasecmp(var, &quot;core-db-dsn&quot;) &amp;&amp; !zstr(val)) {
                                         if (switch_odbc_available()) {
                                                 runtime.odbc_dsn = switch_core_strdup(runtime.memory_pool, val);
<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 f54bd65..120b256 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">@@ -74,7 +74,11 @@ SWITCH_DECLARE(switch_status_t) _switch_core_db_handle(switch_cache_db_handle_t</span>
 
                 r = _switch_cache_db_get_db_handle(dbh, SCDB_TYPE_ODBC, &amp;options, file, func, line);
         } else {
<span style="color: #A00000">-                options.core_db_options.db_path = SWITCH_CORE_DB;</span>
<span style="color: #00A000">+                if (runtime.dbname) {</span>
<span style="color: #00A000">+                        options.core_db_options.db_path = runtime.dbname;</span>
<span style="color: #00A000">+                } else {</span>
<span style="color: #00A000">+                        options.core_db_options.db_path = SWITCH_CORE_DB;</span>
<span style="color: #00A000">+                }</span>
                 r = _switch_cache_db_get_db_handle(dbh, SCDB_TYPE_CORE_DB, &amp;options, file, func, line);
         }
 
</pre></div>
========================================================================<pre>

Summary of changes:
 conf/autoload_configs/switch.conf.xml |    2 ++
 src/include/private/switch_core_pvt.h |    1 +
 src/switch_core.c                     |    3 +++
 src/switch_core_sqldb.c               |    6 +++++-
 4 files changed, 11 insertions(+), 1 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>