<!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][16123] </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=16123">16123</a></dd>
<dt>Author</dt> <dd>jmesquita</dd>
<dt>Date</dt> <dd>2010-01-02 22:22:30 -0600 (Sat, 02 Jan 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Change the directories to the home user directory and copy templates if not there.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunkcontribjmesquitaFSPhoneconfaccountsexamplexml">freeswitch/trunk/contrib/jmesquita/FSPhone/conf/accounts/example.xml</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitaFSPhoneconffreeswitchxml">freeswitch/trunk/contrib/jmesquita/FSPhone/conf/freeswitch.xml</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitaFSPhonefshostcpp">freeswitch/trunk/contrib/jmesquita/FSPhone/fshost.cpp</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitaFSPhoneresourcesqrc">freeswitch/trunk/contrib/jmesquita/FSPhone/resources.qrc</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkcontribjmesquitaFSPhoneconfaccountsexamplexml"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/conf/accounts/example.xml (16122 => 16123)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/FSPhone/conf/accounts/example.xml        2010-01-02 22:06:42 UTC (rev 16122)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/conf/accounts/example.xml        2010-01-03 04:22:30 UTC (rev 16123)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> &lt;include&gt;
</span><del>-  &lt;gateway name=&quot;voicetechnology.com.ar&quot;&gt;
</del><ins>+  &lt;!--&lt;gateway name=&quot;default&quot;&gt;--&gt;
</ins><span class="cx">   &lt;!--/// account username *required* ///--&gt;
</span><del>-  &lt;param name=&quot;username&quot; value=&quot;1001&quot;/&gt;
</del><ins>+  &lt;!--&lt;param name=&quot;username&quot; value=&quot;cluecon&quot;/&gt;--&gt;
</ins><span class="cx">   &lt;!--/// auth realm: *optional* same as gateway name, if blank ///--&gt;
</span><span class="cx">   &lt;!--&lt;param name=&quot;realm&quot; value=&quot;asterlink.com&quot;/&gt;--&gt;
</span><span class="cx">   &lt;!--/// username to use in from: *optional* same as  username, if blank ///--&gt;
</span><span class="lines">@@ -9,7 +9,7 @@
</span><span class="cx">   &lt;!--/// domain to use in from: *optional* same as  realm, if blank ///--&gt;
</span><span class="cx">   &lt;!--&lt;param name=&quot;from-domain&quot; value=&quot;asterlink.com&quot;/&gt;--&gt;
</span><span class="cx">   &lt;!--/// account password *required* ///--&gt;
</span><del>-  &lt;param name=&quot;password&quot; value=&quot;cerrito2p&quot;/&gt;
</del><ins>+  &lt;!--&lt;param name=&quot;password&quot; value=&quot;cluecon&quot;/&gt;--&gt;
</ins><span class="cx">   &lt;!--/// extension for inbound calls: *optional* same as username, if blank ///--&gt;
</span><span class="cx">   &lt;!--&lt;param name=&quot;extension&quot; value=&quot;cluecon&quot;/&gt;--&gt;
</span><span class="cx">   &lt;!--/// proxy host: *optional* same as realm, if blank ///--&gt;
</span><span class="lines">@@ -30,5 +30,5 @@
</span><span class="cx">   &lt;!--&lt;param name=&quot;contact-params&quot; value=&quot;tport=tcp&quot;/&gt;--&gt;
</span><span class="cx">   &lt;!--send an options ping every x seconds, failure will unregister and/or mark it down--&gt;
</span><span class="cx">   &lt;!--&lt;param name=&quot;ping&quot; value=&quot;25&quot;/&gt;--&gt;
</span><del>-  &lt;/gateway&gt;
</del><ins>+  &lt;!--&lt;/gateway&gt;--&gt;
</ins><span class="cx"> &lt;/include&gt;
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitaFSPhoneconffreeswitchxml"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/conf/freeswitch.xml (16122 => 16123)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/FSPhone/conf/freeswitch.xml        2010-01-02 22:06:42 UTC (rev 16122)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/conf/freeswitch.xml        2010-01-03 04:22:30 UTC (rev 16123)
</span><span class="lines">@@ -9,7 +9,7 @@
</span><span class="cx">   &lt;X-PRE-PROCESS cmd=&quot;set&quot; data=&quot;outbound_caller_name=FreeSWITCH&quot;/&gt;
</span><span class="cx">   &lt;X-PRE-PROCESS cmd=&quot;set&quot; data=&quot;outbound_caller_id=0000000000&quot;/&gt;
</span><span class="cx">   &lt;X-PRE-PROCESS cmd=&quot;set&quot; data=&quot;console_loglevel=info&quot;/&gt;
</span><del>-  &lt;X-PRE-PROCESS cmd=&quot;set&quot; data=&quot;default_gateway=voicetechnology.com.ar&quot;/&gt;
</del><ins>+  &lt;X-PRE-PROCESS cmd=&quot;set&quot; data=&quot;default_gateway=default&quot;/&gt;
</ins><span class="cx">   &lt;X-PRE-PROCESS cmd=&quot;set&quot; data=&quot;us-ring=%(2000, 4000, 440.0, 480.0)&quot;/&gt;
</span><span class="cx">   &lt;X-PRE-PROCESS cmd=&quot;set&quot; data=&quot;bong-ring=v=-7;%(100,0,941.0,1477.0);v=-7;&gt;=2;+=.1;%(1400,0,350,440)&quot;/&gt;
</span><span class="cx">   &lt;X-PRE-PROCESS cmd=&quot;set&quot; data=&quot;sit=%(274,0,913.8);%(274,0,1370.6);%(380,0,1776.7)&quot;/&gt;
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitaFSPhonefshostcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/fshost.cpp (16122 => 16123)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/FSPhone/fshost.cpp        2010-01-02 22:06:42 UTC (rev 16122)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/fshost.cpp        2010-01-03 04:22:30 UTC (rev 16123)
</span><span class="lines">@@ -20,20 +20,61 @@
</span><span class="cx"> 
</span><span class="cx"> void FSHost::run(void)
</span><span class="cx"> {
</span><del>-    switch_core_flag_t flags = SCF_USE_SQL; //| SCF_USE_AUTO_NAT;
</del><ins>+    switch_core_flag_t flags = SCF_USE_SQL | SCF_USE_AUTO_NAT;
</ins><span class="cx">     const char *err = NULL;
</span><span class="cx">     switch_bool_t console = SWITCH_FALSE;
</span><span class="cx">     switch_status_t destroy_status;
</span><span class="cx"> 
</span><del>-    QDir conf_dir = QDir(QCoreApplication::applicationDirPath());
-    if (conf_dir.cd(&quot;conf&quot;))
</del><ins>+    /* Create directory structure for softphone with default configs */
+    QDir conf_dir = QDir(QDir::home());
+    if (!conf_dir.exists(&quot;.fsphone&quot;))
</ins><span class="cx">     {
</span><del>-        SWITCH_GLOBAL_dirs.conf_dir = (char *) malloc(strlen(conf_dir.absolutePath().toAscii().constData()) + 1);
</del><ins>+        conf_dir.mkpath(&quot;.fsphone/conf/accounts&quot;);
+        QFile rootXML(&quot;:/confs/freeswitch.xml&quot;);
+        QString dest = QString(&quot;%1/.fsphone/conf/freeswitch.xml&quot;).arg(conf_dir.absolutePath());
+        rootXML.copy(dest);
+
+        QFile defaultAccount(&quot;:/confs/example.xml&quot;);
+        dest = QString(&quot;%1/.fsphone/conf/accounts/example.xml&quot;).arg(conf_dir.absolutePath());
+        defaultAccount.copy(dest);
+    }
+    if (conf_dir.cd(&quot;.fsphone&quot;))
+    {
+        SWITCH_GLOBAL_dirs.conf_dir = (char *) malloc(strlen(QString(&quot;%1/conf&quot;).arg(conf_dir.absolutePath()).toAscii().constData()) + 1);
</ins><span class="cx">         if (!SWITCH_GLOBAL_dirs.conf_dir) {
</span><del>-            fprintf(stderr, &quot;Allocation error\n&quot;);
-            emit coreLoadingError(err);
</del><ins>+            emit coreLoadingError(&quot;Cannot allocate memory for conf_dir.&quot;);
</ins><span class="cx">         }
</span><del>-        strcpy(SWITCH_GLOBAL_dirs.conf_dir, conf_dir.absolutePath().toAscii().constData());
</del><ins>+        strcpy(SWITCH_GLOBAL_dirs.conf_dir, QString(&quot;%1/conf&quot;).arg(conf_dir.absolutePath()).toAscii().constData());
+
+        SWITCH_GLOBAL_dirs.log_dir = (char *) malloc(strlen(QString(&quot;%1/log&quot;).arg(conf_dir.absolutePath()).toAscii().constData()) + 1);
+        if (!SWITCH_GLOBAL_dirs.log_dir) {
+            emit coreLoadingError(&quot;Cannot allocate memory for log_dir.&quot;);
+        }
+        strcpy(SWITCH_GLOBAL_dirs.log_dir, QString(&quot;%1/log&quot;).arg(conf_dir.absolutePath()).toAscii().constData());
+
+        SWITCH_GLOBAL_dirs.run_dir = (char *) malloc(strlen(QString(&quot;%1/run&quot;).arg(conf_dir.absolutePath()).toAscii().constData()) + 1);
+        if (!SWITCH_GLOBAL_dirs.run_dir) {
+            emit coreLoadingError(&quot;Cannot allocate memory for run_dir.&quot;);
+        }
+        strcpy(SWITCH_GLOBAL_dirs.run_dir, QString(&quot;%1/run&quot;).arg(conf_dir.absolutePath()).toAscii().constData());
+
+        SWITCH_GLOBAL_dirs.db_dir = (char *) malloc(strlen(QString(&quot;%1/db&quot;).arg(conf_dir.absolutePath()).toAscii().constData()) + 1);
+        if (!SWITCH_GLOBAL_dirs.db_dir) {
+            emit coreLoadingError(&quot;Cannot allocate memory for db_dir.&quot;);
+        }
+        strcpy(SWITCH_GLOBAL_dirs.db_dir, QString(&quot;%1/db&quot;).arg(conf_dir.absolutePath()).toAscii().constData());
+
+        SWITCH_GLOBAL_dirs.script_dir = (char *) malloc(strlen(QString(&quot;%1/script&quot;).arg(conf_dir.absolutePath()).toAscii().constData()) + 1);
+        if (!SWITCH_GLOBAL_dirs.script_dir) {
+            emit coreLoadingError(&quot;Cannot allocate memory for script_dir.&quot;);
+        }
+        strcpy(SWITCH_GLOBAL_dirs.script_dir, QString(&quot;%1/script&quot;).arg(conf_dir.absolutePath()).toAscii().constData());
+
+        SWITCH_GLOBAL_dirs.htdocs_dir = (char *) malloc(strlen(QString(&quot;%1/htdocs&quot;).arg(conf_dir.absolutePath()).toAscii().constData()) + 1);
+        if (!SWITCH_GLOBAL_dirs.htdocs_dir) {
+            emit coreLoadingError(&quot;Cannot allocate memory for htdocs_dir.&quot;);
+        }
+        strcpy(SWITCH_GLOBAL_dirs.htdocs_dir, QString(&quot;%1/htdocs&quot;).arg(conf_dir.absolutePath()).toAscii().constData());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     /* If you need to override configuration directories, you need to change them in the SWITCH_GLOBAL_dirs global structure */
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitaFSPhoneresourcesqrc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/resources.qrc (16122 => 16123)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/FSPhone/resources.qrc        2010-01-02 22:06:42 UTC (rev 16122)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/resources.qrc        2010-01-03 04:22:30 UTC (rev 16123)
</span><span class="lines">@@ -2,4 +2,8 @@
</span><span class="cx">     &lt;qresource prefix=&quot;/images&quot;&gt;
</span><span class="cx">         &lt;file alias=&quot;splash.png&quot;&gt;resources/splash.png&lt;/file&gt;
</span><span class="cx">     &lt;/qresource&gt;
</span><ins>+    &lt;qresource prefix=&quot;/confs&quot;&gt;
+        &lt;file alias=&quot;freeswitch.xml&quot;&gt;conf/freeswitch.xml&lt;/file&gt;
+        &lt;file alias=&quot;example.xml&quot;&gt;conf/accounts/example.xml&lt;/file&gt;
+    &lt;/qresource&gt;
</ins><span class="cx"> &lt;/RCC&gt;
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>