<!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"> <include>
</span><del>- <gateway name="voicetechnology.com.ar">
</del><ins>+ <!--<gateway name="default">-->
</ins><span class="cx"> <!--/// account username *required* ///-->
</span><del>- <param name="username" value="1001"/>
</del><ins>+ <!--<param name="username" value="cluecon"/>-->
</ins><span class="cx"> <!--/// auth realm: *optional* same as gateway name, if blank ///-->
</span><span class="cx"> <!--<param name="realm" value="asterlink.com"/>-->
</span><span class="cx"> <!--/// username to use in from: *optional* same as username, if blank ///-->
</span><span class="lines">@@ -9,7 +9,7 @@
</span><span class="cx"> <!--/// domain to use in from: *optional* same as realm, if blank ///-->
</span><span class="cx"> <!--<param name="from-domain" value="asterlink.com"/>-->
</span><span class="cx"> <!--/// account password *required* ///-->
</span><del>- <param name="password" value="cerrito2p"/>
</del><ins>+ <!--<param name="password" value="cluecon"/>-->
</ins><span class="cx"> <!--/// extension for inbound calls: *optional* same as username, if blank ///-->
</span><span class="cx"> <!--<param name="extension" value="cluecon"/>-->
</span><span class="cx"> <!--/// proxy host: *optional* same as realm, if blank ///-->
</span><span class="lines">@@ -30,5 +30,5 @@
</span><span class="cx"> <!--<param name="contact-params" value="tport=tcp"/>-->
</span><span class="cx"> <!--send an options ping every x seconds, failure will unregister and/or mark it down-->
</span><span class="cx"> <!--<param name="ping" value="25"/>-->
</span><del>- </gateway>
</del><ins>+ <!--</gateway>-->
</ins><span class="cx"> </include>
</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"> <X-PRE-PROCESS cmd="set" data="outbound_caller_name=FreeSWITCH"/>
</span><span class="cx"> <X-PRE-PROCESS cmd="set" data="outbound_caller_id=0000000000"/>
</span><span class="cx"> <X-PRE-PROCESS cmd="set" data="console_loglevel=info"/>
</span><del>- <X-PRE-PROCESS cmd="set" data="default_gateway=voicetechnology.com.ar"/>
</del><ins>+ <X-PRE-PROCESS cmd="set" data="default_gateway=default"/>
</ins><span class="cx"> <X-PRE-PROCESS cmd="set" data="us-ring=%(2000, 4000, 440.0, 480.0)"/>
</span><span class="cx"> <X-PRE-PROCESS cmd="set" data="bong-ring=v=-7;%(100,0,941.0,1477.0);v=-7;>=2;+=.1;%(1400,0,350,440)"/>
</span><span class="cx"> <X-PRE-PROCESS cmd="set" data="sit=%(274,0,913.8);%(274,0,1370.6);%(380,0,1776.7)"/>
</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("conf"))
</del><ins>+ /* Create directory structure for softphone with default configs */
+ QDir conf_dir = QDir(QDir::home());
+ if (!conf_dir.exists(".fsphone"))
</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(".fsphone/conf/accounts");
+ QFile rootXML(":/confs/freeswitch.xml");
+ QString dest = QString("%1/.fsphone/conf/freeswitch.xml").arg(conf_dir.absolutePath());
+ rootXML.copy(dest);
+
+ QFile defaultAccount(":/confs/example.xml");
+ dest = QString("%1/.fsphone/conf/accounts/example.xml").arg(conf_dir.absolutePath());
+ defaultAccount.copy(dest);
+ }
+ if (conf_dir.cd(".fsphone"))
+ {
+ SWITCH_GLOBAL_dirs.conf_dir = (char *) malloc(strlen(QString("%1/conf").arg(conf_dir.absolutePath()).toAscii().constData()) + 1);
</ins><span class="cx"> if (!SWITCH_GLOBAL_dirs.conf_dir) {
</span><del>- fprintf(stderr, "Allocation error\n");
- emit coreLoadingError(err);
</del><ins>+ emit coreLoadingError("Cannot allocate memory for conf_dir.");
</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("%1/conf").arg(conf_dir.absolutePath()).toAscii().constData());
+
+ SWITCH_GLOBAL_dirs.log_dir = (char *) malloc(strlen(QString("%1/log").arg(conf_dir.absolutePath()).toAscii().constData()) + 1);
+ if (!SWITCH_GLOBAL_dirs.log_dir) {
+ emit coreLoadingError("Cannot allocate memory for log_dir.");
+ }
+ strcpy(SWITCH_GLOBAL_dirs.log_dir, QString("%1/log").arg(conf_dir.absolutePath()).toAscii().constData());
+
+ SWITCH_GLOBAL_dirs.run_dir = (char *) malloc(strlen(QString("%1/run").arg(conf_dir.absolutePath()).toAscii().constData()) + 1);
+ if (!SWITCH_GLOBAL_dirs.run_dir) {
+ emit coreLoadingError("Cannot allocate memory for run_dir.");
+ }
+ strcpy(SWITCH_GLOBAL_dirs.run_dir, QString("%1/run").arg(conf_dir.absolutePath()).toAscii().constData());
+
+ SWITCH_GLOBAL_dirs.db_dir = (char *) malloc(strlen(QString("%1/db").arg(conf_dir.absolutePath()).toAscii().constData()) + 1);
+ if (!SWITCH_GLOBAL_dirs.db_dir) {
+ emit coreLoadingError("Cannot allocate memory for db_dir.");
+ }
+ strcpy(SWITCH_GLOBAL_dirs.db_dir, QString("%1/db").arg(conf_dir.absolutePath()).toAscii().constData());
+
+ SWITCH_GLOBAL_dirs.script_dir = (char *) malloc(strlen(QString("%1/script").arg(conf_dir.absolutePath()).toAscii().constData()) + 1);
+ if (!SWITCH_GLOBAL_dirs.script_dir) {
+ emit coreLoadingError("Cannot allocate memory for script_dir.");
+ }
+ strcpy(SWITCH_GLOBAL_dirs.script_dir, QString("%1/script").arg(conf_dir.absolutePath()).toAscii().constData());
+
+ SWITCH_GLOBAL_dirs.htdocs_dir = (char *) malloc(strlen(QString("%1/htdocs").arg(conf_dir.absolutePath()).toAscii().constData()) + 1);
+ if (!SWITCH_GLOBAL_dirs.htdocs_dir) {
+ emit coreLoadingError("Cannot allocate memory for htdocs_dir.");
+ }
+ strcpy(SWITCH_GLOBAL_dirs.htdocs_dir, QString("%1/htdocs").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"> <qresource prefix="/images">
</span><span class="cx"> <file alias="splash.png">resources/splash.png</file>
</span><span class="cx"> </qresource>
</span><ins>+ <qresource prefix="/confs">
+ <file alias="freeswitch.xml">conf/freeswitch.xml</file>
+ <file alias="example.xml">conf/accounts/example.xml</file>
+ </qresource>
</ins><span class="cx"> </RCC>
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>