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

<h3>Log Message</h3>
<pre>Initial adaptation of mod_qsettings to the Qt way.</pre>

<h3>Modified Paths</h3>
<ul>
<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="#freeswitchtrunkcontribjmesquitaFSPhonemod_qsettingsmod_qsettingscpp">freeswitch/trunk/contrib/jmesquita/FSPhone/mod_qsettings/mod_qsettings.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkcontribjmesquitaFSPhoneconffreeswitchxml"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/conf/freeswitch.xml (16123 => 16124)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/FSPhone/conf/freeswitch.xml        2010-01-03 04:22:30 UTC (rev 16123)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/conf/freeswitch.xml        2010-01-03 05:12:39 UTC (rev 16124)
</span><span class="lines">@@ -48,6 +48,10 @@
</span><span class="cx">       &lt;/routes&gt;
</span><span class="cx">     &lt;/configuration&gt;
</span><span class="cx"> 
</span><ins>+    &lt;configuration name=&quot;qsettings.conf&quot; description=&quot;configures our mod_qsettings&quot;&gt;
+                &lt;bindings value=&quot;dialplan&quot; /&gt;
+    &lt;/configuration&gt;
+
</ins><span class="cx">     &lt;configuration name=&quot;local_stream.conf&quot; description=&quot;stream files from local dir&quot;&gt;
</span><span class="cx">       &lt;directory name=&quot;moh/48000&quot; path=&quot;$${base_dir}/sounds/music/48000&quot;&gt;
</span><span class="cx">         &lt;param name=&quot;rate&quot; value=&quot;48000&quot;/&gt;
</span><span class="lines">@@ -143,7 +147,7 @@
</span><span class="cx">           &lt;/gateways&gt;
</span><span class="cx">           &lt;settings&gt;
</span><span class="cx">             &lt;!--&lt;param name=&quot;media-option&quot; value=&quot;bypass-media-after-att-xfer&quot;/&gt;--&gt;
</span><del>-            &lt;param name=&quot;user-agent-string&quot; value=&quot;FreeSWITCH/SoftPhone&quot;/&gt;
</del><ins>+            &lt;param name=&quot;user-agent-string&quot; value=&quot;FreeSWITCH/FSPhone&quot;/&gt;
</ins><span class="cx">             &lt;!-- &lt;param name=&quot;user-agent-string&quot; value=&quot;FreeSWITCH Rocks!&quot;/&gt; --&gt;
</span><span class="cx">             &lt;param name=&quot;debug&quot; value=&quot;0&quot;/&gt;
</span><span class="cx">             &lt;param name=&quot;sip-trace&quot; value=&quot;no&quot;/&gt;
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitaFSPhonefshostcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/fshost.cpp (16123 => 16124)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/FSPhone/fshost.cpp        2010-01-03 04:22:30 UTC (rev 16123)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/fshost.cpp        2010-01-03 05:12:39 UTC (rev 16124)
</span><span class="lines">@@ -38,6 +38,8 @@
</span><span class="cx">         dest = QString(&quot;%1/.fsphone/conf/accounts/example.xml&quot;).arg(conf_dir.absolutePath());
</span><span class="cx">         defaultAccount.copy(dest);
</span><span class="cx">     }
</span><ins>+
+    /* Set all directories to the home user directory */
</ins><span class="cx">     if (conf_dir.cd(&quot;.fsphone&quot;))
</span><span class="cx">     {
</span><span class="cx">         SWITCH_GLOBAL_dirs.conf_dir = (char *) malloc(strlen(QString(&quot;%1/conf&quot;).arg(conf_dir.absolutePath()).toAscii().constData()) + 1);
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitaFSPhonemod_qsettingsmod_qsettingscpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/mod_qsettings/mod_qsettings.cpp (16123 => 16124)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/FSPhone/mod_qsettings/mod_qsettings.cpp        2010-01-03 04:22:30 UTC (rev 16123)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/mod_qsettings/mod_qsettings.cpp        2010-01-03 05:12:39 UTC (rev 16124)
</span><span class="lines">@@ -30,11 +30,11 @@
</span><span class="cx">  * Module to load configurations from Qt preference system QSettings
</span><span class="cx">  *
</span><span class="cx">  */
</span><del>-
</del><ins>+#include &lt;QString&gt;
</ins><span class="cx"> #include &quot;mod_qsettings/mod_qsettings.h&quot;
</span><span class="cx"> 
</span><span class="cx"> struct xml_binding {
</span><del>-        char *bindings;
</del><ins>+        QString *bindings;
</ins><span class="cx"> };
</span><span class="cx"> typedef struct xml_binding xml_binding_t;
</span><span class="cx"> 
</span><span class="lines">@@ -59,12 +59,11 @@
</span><span class="cx">         return NULL;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-/*static switch_status_t do_config(void)
</del><ins>+static switch_status_t do_config(void)
</ins><span class="cx"> {
</span><span class="cx">         char *cf = &quot;qsettings.conf&quot;;
</span><del>-        switch_xml_t cfg, xml, bindings_tag, binding_tag, param;
</del><ins>+        switch_xml_t cfg, xml, bindings_tag;
</ins><span class="cx">         xml_binding_t *binding = NULL;
</span><del>-        int x = 0;
</del><span class="cx"> 
</span><span class="cx">         if (!(xml = switch_xml_open_cfg(cf, &amp;cfg, NULL))) {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;open of %s failed\n&quot;, cf);
</span><span class="lines">@@ -73,37 +72,28 @@
</span><span class="cx"> 
</span><span class="cx">         if (!(bindings_tag = switch_xml_child(cfg, &quot;bindings&quot;))) {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Missing &lt;bindings&gt; tag!\n&quot;);
</span><del>-                goto done;
</del><ins>+                switch_xml_free(xml);
+                return SWITCH_STATUS_FALSE;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        for (binding_tag = switch_xml_child(bindings_tag, &quot;binding&quot;); binding_tag; binding_tag = binding_tag-&gt;next) {
-                char *bname = (char *) switch_xml_attr_soft(binding_tag, &quot;name&quot;);
-                char *bind_mask = NULL;
</del><ins>+        QString *bind_mask = new QString(switch_xml_attr_soft(bindings_tag, &quot;value&quot;));
</ins><span class="cx"> 
</span><del>-                for (param = switch_xml_child(binding_tag, &quot;param&quot;); param; param = param-&gt;next) {
-                        bind_mask = (char *) switch_xml_attr_soft(param, &quot;value&quot;);
-                }
</del><ins>+        binding = new xml_binding_t();
</ins><span class="cx"> 
</span><del>-                binding = new xml_binding_t();
</del><ins>+        if (!bind_mask-&gt;isEmpty()) {
+                binding-&gt;bindings = bind_mask;
+        }
</ins><span class="cx"> 
</span><del>-                if (bind_mask) {
-                        binding-&gt;bindings = strdup(bind_mask);
-                }
</del><span class="cx"> 
</span><ins>+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, &quot;Binding XML Fetch Function [%s]\n&quot;,
+                          binding-&gt;bindings-&gt;isEmpty() ? &quot;all&quot; : binding-&gt;bindings-&gt;toAscii().constData());
+        switch_xml_bind_search_function(xml_url_fetch, switch_xml_parse_section_string(binding-&gt;bindings-&gt;toAscii().constData()), binding);
+        binding = NULL;
</ins><span class="cx"> 
</span><del>-                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, &quot;Binding [%s] XML Fetch Function [%s]\n&quot;,
-                                                  zstr(bname) ? &quot;N/A&quot; : bname, binding-&gt;bindings ? binding-&gt;bindings : &quot;all&quot;);
-                switch_xml_bind_search_function(xml_url_fetch, switch_xml_parse_section_string(binding-&gt;bindings), binding);
-                x++;
-                binding = NULL;
-        }
</del><ins>+        switch_xml_free(xml);
+        return SWITCH_STATUS_SUCCESS;
+}
</ins><span class="cx"> 
</span><del>-  done:
-        switch_xml_free(xml);
-
-        return x ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
-}*/
-
</del><span class="cx"> SWITCH_MODULE_LOAD_FUNCTION(mod_qsettings_load)
</span><span class="cx"> {
</span><span class="cx">         /*switch_api_interface_t *qsettings_api_interface;*/
</span><span class="lines">@@ -114,13 +104,13 @@
</span><span class="cx">         memset(&amp;globals,0,sizeof(globals));
</span><span class="cx">         globals.pool = pool;
</span><span class="cx"> 
</span><del>-/*        if (do_config() == SWITCH_STATUS_SUCCESS) {
-                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, &quot;Binding worked!&quot;);
</del><ins>+        if (do_config() == SWITCH_STATUS_SUCCESS) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, &quot;Sucessfully configured.\n&quot;);
</ins><span class="cx">         } else {
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><del>-*/
</del><span class="cx"> 
</span><ins>+
</ins><span class="cx">         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, &quot;We loaded mod_qsettings.\n&quot;);
</span><span class="cx">         /* indicate that the module should continue to be loaded */
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>