<!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][16297] </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=16297">16297</a></dd>
<dt>Author</dt> <dd>jmesquita</dd>
<dt>Date</dt> <dd>2010-01-13 20:32:20 -0600 (Wed, 13 Jan 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Quite a big commit that might break a lot of things. Will fix tomorrow if it does. There is now the possibility of adding accounts. Make sure to remove your configs before trying this.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunkfscommFSCommpro">freeswitch/trunk/fscomm/FSComm.pro</a></li>
<li><a href="#freeswitchtrunkfscommconffreeswitchxml">freeswitch/trunk/fscomm/conf/freeswitch.xml</a></li>
<li><a href="#freeswitchtrunkfscommfshostcpp">freeswitch/trunk/fscomm/fshost.cpp</a></li>
<li><a href="#freeswitchtrunkfscommmod_qsettingsmod_qsettingscpp">freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.cpp</a></li>
<li><a href="#freeswitchtrunkfscommmod_qsettingsmod_qsettingsh">freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.h</a></li>
<li><a href="#freeswitchtrunkfscommpreferencesaccountdialogcpp">freeswitch/trunk/fscomm/preferences/accountdialog.cpp</a></li>
<li><a href="#freeswitchtrunkfscommpreferencesaccountdialogh">freeswitch/trunk/fscomm/preferences/accountdialog.h</a></li>
<li><a href="#freeswitchtrunkfscommpreferencesprefaccountscpp">freeswitch/trunk/fscomm/preferences/prefaccounts.cpp</a></li>
<li><a href="#freeswitchtrunkfscommpreferencesprefaccountsh">freeswitch/trunk/fscomm/preferences/prefaccounts.h</a></li>
<li><a href="#freeswitchtrunkfscommpreferencesprefdialogcpp">freeswitch/trunk/fscomm/preferences/prefdialog.cpp</a></li>
<li><a href="#freeswitchtrunkfscommpreferencesprefdialogh">freeswitch/trunk/fscomm/preferences/prefdialog.h</a></li>
<li><a href="#freeswitchtrunkfscommpreferencesprefdialogui">freeswitch/trunk/fscomm/preferences/prefdialog.ui</a></li>
<li><a href="#freeswitchtrunkfscommpreferencesprefportaudiocpp">freeswitch/trunk/fscomm/preferences/prefportaudio.cpp</a></li>
<li><a href="#freeswitchtrunkfscommpreferencesprefsofiacpp">freeswitch/trunk/fscomm/preferences/prefsofia.cpp</a></li>
<li><a href="#freeswitchtrunkfscommresourcesqrc">freeswitch/trunk/fscomm/resources.qrc</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#freeswitchtrunkfscommconfaccountconfxml">freeswitch/trunk/fscomm/conf/account.conf.xml</a></li>
<li><a href="#freeswitchtrunkfscommconfevent_socketconfxml">freeswitch/trunk/fscomm/conf/event_socket.conf.xml</a></li>
<li><a href="#freeswitchtrunkfscommconfportaudioconfxml">freeswitch/trunk/fscomm/conf/portaudio.conf.xml</a></li>
<li><a href="#freeswitchtrunkfscommconfsofiaconfxml">freeswitch/trunk/fscomm/conf/sofia.conf.xml</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkfscommFSCommpro"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/FSComm.pro (16296 => 16297)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/FSComm.pro        2010-01-14 00:39:32 UTC (rev 16296)
+++ freeswitch/trunk/fscomm/FSComm.pro        2010-01-14 02:32:20 UTC (rev 16297)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> # #####################################
</span><span class="cx"> # version check qt
</span><span class="cx"> # #####################################
</span><del>-contains(QT_VERSION, ^4\.[0-4]\..*) {
</del><ins>+contains(QT_VERSION, ^4\.[0-4]\..*) {
</ins><span class="cx"> message("Cannot build FsGui with Qt version $$QT_VERSION.")
</span><span class="cx"> error("Use at least Qt 4.5.")
</span><span class="cx"> }
</span><span class="lines">@@ -38,13 +38,10 @@
</span><span class="cx"> preferences/prefdialog.h \
</span><span class="cx"> preferences/prefportaudio.h \
</span><span class="cx"> preferences/prefsofia.h \
</span><del>- preferences/accountdialog.h
</del><ins>+ preferences/accountdialog.h \
+ preferences/prefaccounts.h
</ins><span class="cx"> FORMS += mainwindow.ui \
</span><span class="cx"> preferences/prefdialog.ui \
</span><span class="cx"> preferences/accountdialog.ui
</span><span class="cx"> RESOURCES += resources.qrc
</span><del>-OTHER_FILES += conf/portaudio.conf.xml \
- conf/event_socket.conf.xml \
- conf/freeswitch.xml \
- conf/sofia.conf.xml \
- conf/account.conf.xml
</del><ins>+OTHER_FILES += conf/freeswitch.xml
</ins></span></pre></div>
<a id="freeswitchtrunkfscommconfaccountconfxml"></a>
<div class="delfile"><h4>Deleted: freeswitch/trunk/fscomm/conf/account.conf.xml</h4></div>
<a id="freeswitchtrunkfscommconfevent_socketconfxml"></a>
<div class="delfile"><h4>Deleted: freeswitch/trunk/fscomm/conf/event_socket.conf.xml</h4></div>
<a id="freeswitchtrunkfscommconffreeswitchxml"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/conf/freeswitch.xml (16296 => 16297)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/conf/freeswitch.xml        2010-01-14 00:39:32 UTC (rev 16296)
+++ freeswitch/trunk/fscomm/conf/freeswitch.xml        2010-01-14 02:32:20 UTC (rev 16297)
</span><span class="lines">@@ -99,6 +99,33 @@
</span><span class="cx">                         </modules>
</span><span class="cx">                 </configuration>
</span><span class="cx">
</span><ins>+ <configuration name="portaudio.conf" description="Soundcard Endpoint">
+ <settings>
+ <param name="indev" value=""/>
+ <!-- device to use for output -->
+ <param name="outdev" value=""/>
+ <!--<param name="ringdev" value=""/>-->
+ <param name="ring-file" value="tone_stream://%(2000,4000,440.0,480.0);loops=20"/>
+ <param name="ring-interval" value="5"/>
+ <param name="hold-file" value="$${hold_music}"/>
+ <!--<param name="timer-name" value="soft"/>-->
+ <param name="dialplan" value="XML"/>
+ <param name="cid-name" value="$${outbound_caller_name}"/>
+ <param name="cid-num" value="$${outbound_caller_number}"/>
+ <param name="sample-rate" value="48000"/>
+ <param name="codec-ms" value="10"/>
+ </settings>
+ </configuration>
+
+ <configuration name="event_socket.conf" description="Socket Client">
+ <settings>
+ <param name="nat-map" value="false"/>
+ <param name="listen-ip" value="127.0.0.1"/>
+ <param name="listen-port" value="8022"/>
+ <param name="password" value="ClueCon"/>
+ </settings>
+ </configuration>
+
</ins><span class="cx">                 <configuration name="post_load_modules.conf" description="Modules">
</span><span class="cx">                         <modules>
</span><span class="cx">                         </modules>
</span></span></pre></div>
<a id="freeswitchtrunkfscommconfportaudioconfxml"></a>
<div class="delfile"><h4>Deleted: freeswitch/trunk/fscomm/conf/portaudio.conf.xml</h4></div>
<a id="freeswitchtrunkfscommconfsofiaconfxml"></a>
<div class="delfile"><h4>Deleted: freeswitch/trunk/fscomm/conf/sofia.conf.xml</h4></div>
<a id="freeswitchtrunkfscommfshostcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/fshost.cpp (16296 => 16297)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/fshost.cpp        2010-01-14 00:39:32 UTC (rev 16296)
+++ freeswitch/trunk/fscomm/fshost.cpp        2010-01-14 02:32:20 UTC (rev 16297)
</span><span class="lines">@@ -56,7 +56,6 @@
</span><span class="cx"> conf_dir.mkpath(".fscomm/conf/accounts");
</span><span class="cx"> conf_dir.mkpath(".fscomm/sounds");
</span><span class="cx"> QFile::copy(":/sounds/test.wav", QString("%1/.fscomm/sounds/test.wav").arg(QDir::homePath()));
</span><del>- conf_dir.mkpath(".fscomm/templates");
</del><span class="cx"> QFile rootXML(":/confs/freeswitch.xml");
</span><span class="cx"> QString dest = QString("%1/.fscomm/conf/freeswitch.xml").arg(conf_dir.absolutePath());
</span><span class="cx"> rootXML.copy(dest);
</span></span></pre></div>
<a id="freeswitchtrunkfscommmod_qsettingsmod_qsettingscpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.cpp (16296 => 16297)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.cpp        2010-01-14 00:39:32 UTC (rev 16296)
+++ freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.cpp        2010-01-14 02:32:20 UTC (rev 16297)
</span><span class="lines">@@ -33,128 +33,106 @@
</span><span class="cx"> #include <QString>
</span><span class="cx"> #include <QtGui>
</span><span class="cx"> #include <QDir>
</span><del>-#include <QDomDocument>
-#include <QDomNodeList>
</del><ins>+#include <QXmlStreamWriter>
</ins><span class="cx"> #include "mod_qsettings/mod_qsettings.h"
</span><span class="cx">
</span><span class="cx"> switch_xml_t XMLBinding::getConfigXML(QString tmpl)
</span><span class="cx"> {
</span><del>- switch_event_t *e;
- switch_event_create_plain(&e, SWITCH_EVENT_REQUEST_PARAMS);
- switch_assert(e);
-
- if (QFile::exists(QString("%1/.fscomm/templates/%2.xml").arg(QDir::homePath(),tmpl))) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
- "Using template %s.xml on .fscomm/.\n",
- tmpl.toAscii().constData());
- }
- else if(QFile::exists(QString(":/confs/%1.xml").arg(tmpl)))
</del><ins>+ _settings->beginGroup("FreeSWITCH/conf");
+ if (!_settings->childGroups().contains(tmpl))
</ins><span class="cx"> {
</span><del>- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
- "Template %s.xml, doesn't exist on directory, copying embedded template.\n",
- tmpl.toAscii().constData());
- QString dest = QString("%1/.fscomm/templates/%2.xml").arg(QDir::homePath(),tmpl);
- QString orig = QString(":/confs/%1.xml").arg(tmpl);
- QFile::copy(orig, dest);
- }
-
- QFile tmplFile(QString("%1/.fscomm/templates/%2.xml").arg(QDir::homePath(),tmpl));
- if (!tmplFile.open(QIODevice::ReadOnly | QIODevice::Text))
- {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Template %s could not be read!\n", tmpl.toAscii().constData());
</del><ins>+ _settings->endGroup();
</ins><span class="cx"> return NULL;
</span><span class="cx"> }
</span><ins>+ _settings->beginGroup(tmpl);
</ins><span class="cx">
</span><del>- /* Open template file and expand all strings based on QSettings */
- QByteArray tmplContents(tmplFile.readAll());
- tmplFile.close();
</del><ins>+ QByteArray *finalXML = new QByteArray();
+ QXmlStreamWriter streamWriter(finalXML);
</ins><span class="cx">
</span><del>- _settings->beginGroup("FreeSWITCH/conf");
- _settings->beginGroup(tmpl);
- foreach(QString k, _settings->childKeys())
</del><ins>+ streamWriter.setAutoFormatting(true);
+ streamWriter.writeStartElement("document");
+ streamWriter.writeAttribute("type", "freeswitch/xml");
+
+ streamWriter.writeStartElement("section");
+ streamWriter.writeAttribute("name", "configuration");
+
+ streamWriter.writeStartElement("configuration");
+ streamWriter.writeAttribute("name", tmpl);
+ streamWriter.writeAttribute("description", "Configuration generated by QSettings");
+
+ foreach (QString group, _settings->childGroups())
</ins><span class="cx"> {
</span><del>- switch_event_add_header_string(e, SWITCH_STACK_BOTTOM, k.toAscii().constData(), _settings->value(k).toByteArray().constData());
</del><ins>+ parseGroup(&streamWriter, group);
</ins><span class="cx"> }
</span><ins>+
+ streamWriter.writeEndElement();
+ streamWriter.writeEndElement();
+ streamWriter.writeEndElement();
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Config for %s requested. Providing the following XML:\n%s\n",
+ tmpl.toAscii().constData(), finalXML->data());
+
</ins><span class="cx"> _settings->endGroup();
</span><span class="cx"> _settings->endGroup();
</span><span class="cx">
</span><del>- char *res = switch_event_expand_headers(e, tmplContents.data());
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Template %s as follows:\n%s", tmpl.toAscii().constData(), res);
- switch_safe_free(e);
- if (tmpl == "sofia.conf")
- {
- return proccessAccounts(tmpl, res);
- }
- return switch_xml_parse_str(res, strlen(res));
</del><ins>+ return switch_xml_parse_str(finalXML->data(), strlen(finalXML->data()));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-switch_xml_t XMLBinding::proccessAccounts(QString tmpl, QByteArray xml)
</del><ins>+void XMLBinding::parseGroup(QXmlStreamWriter *streamWriter, QString group)
</ins><span class="cx"> {
</span><del>- char *res = NULL;
-
- QDomDocument xmlDom;
-
- /* Process sofia accounts */
- if (tmpl == "sofia.conf")
</del><ins>+ if (group == "attrs")
</ins><span class="cx"> {
</span><del>- int errorLine, errorColumn;
- QString errorMsg;
-
- if (!xmlDom.setContent(xml, &errorMsg, &errorLine, &errorColumn))
</del><ins>+ _settings->beginGroup(group);
+ foreach (QString k, _settings->childKeys())
</ins><span class="cx"> {
</span><del>- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not parse the xml template from sofia.conf.xml to add the accounts!\n");
</del><ins>+ streamWriter->writeAttribute(k, _settings->value(k).toString());
</ins><span class="cx"> }
</span><del>- QDomNodeList gatewaysNodeList = xmlDom.elementsByTagName("gateways");
- if (gatewaysNodeList.isEmpty() || gatewaysNodeList.count() > 1)
</del><ins>+ _settings->endGroup();
+ return;
+ }
+
+ if (group == "params")
+ {
+ _settings->beginGroup(group);
+ foreach(QString param, _settings->childKeys())
</ins><span class="cx"> {
</span><del>- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Where is my gateways tag? Or do we have more then one match?\n");
</del><ins>+ streamWriter->writeStartElement("param");
+ streamWriter->writeAttribute("name", param);
+ streamWriter->writeAttribute("value", _settings->value(param).toString());
+ streamWriter->writeEndElement();
</ins><span class="cx"> }
</span><ins>+ _settings->endGroup();
+ return;
+ }
</ins><span class="cx">
</span><del>- QDomNode gatewaysNode = gatewaysNodeList.at(0);
-
- _settings->beginGroup("FreeSWITCH/conf/accounts");
- foreach (QString account, _settings->childGroups())
</del><ins>+ if (group == "gateways")
+ {
+ streamWriter->writeStartElement(group);
+ _settings->beginGroup(group);
+ foreach (QString gw, _settings->childGroups())
</ins><span class="cx"> {
</span><del>- switch_event_t *e;
- switch_event_create_plain(&e, SWITCH_EVENT_REQUEST_PARAMS);
- switch_assert(e);
-
- _settings->beginGroup(account);
- switch_event_add_header_string(e, SWITCH_STACK_BOTTOM, "name", account.toAscii().data());
- foreach (QString k, _settings->childKeys())
</del><ins>+ _settings->beginGroup(gw);
+ foreach(QString g, _settings->childGroups())
</ins><span class="cx"> {
</span><del>- switch_event_add_header_string(e, SWITCH_STACK_BOTTOM, k.toAscii().constData(), _settings->value(k).toByteArray().constData());
</del><ins>+ parseGroup(streamWriter, g);
</ins><span class="cx"> }
</span><span class="cx"> _settings->endGroup();
</span><del>-
- /* Open template file and expand all strings based on QSettings */
- QFile tmplFile(QString("%1/.fscomm/templates/account.conf.xml").arg(QDir::homePath()));
- if (!tmplFile.open(QIODevice::ReadOnly | QIODevice::Text))
- {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Template for accounts could not be read!\n");
- return NULL;
- }
-
- QByteArray tmplContents(tmplFile.readAll());
- tmplFile.close();
-
- res = switch_event_expand_headers(e, tmplContents.data());
-
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Template of account %s as follows:\n%s", account.toAscii().data(), res);
-
- QDomDocument gatewayXML;
- if (!gatewayXML.setContent(QByteArray(res), &errorMsg, &errorLine, &errorColumn))
- {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "We could not parse the XML for the account!\n");
- }
-
- gatewaysNode.appendChild(gatewayXML);
- switch_safe_free(e);
</del><span class="cx"> }
</span><span class="cx"> _settings->endGroup();
</span><ins>+ streamWriter->writeEndElement();
+ return;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- return switch_xml_parse_str(xmlDom.toByteArray().data(), strlen(xmlDom.toByteArray().data()));
</del><ins>+ _settings->beginGroup(group);
+ streamWriter->writeStartElement(group);
+
+ foreach (QString group2, _settings->childGroups())
+ {
+ parseGroup(streamWriter, group2);
+ }
+
+ streamWriter->writeEndElement();
+ _settings->endGroup();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, const char *key_name, const char *key_value, switch_event_t *params,
</span></span></pre></div>
<a id="freeswitchtrunkfscommmod_qsettingsmod_qsettingsh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.h (16296 => 16297)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.h        2010-01-14 00:39:32 UTC (rev 16296)
+++ freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.h        2010-01-14 02:32:20 UTC (rev 16297)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> QString getBinding(void) { return _binding; }
</span><span class="cx"> switch_xml_t getConfigXML(QString);
</span><span class="cx"> private:
</span><del>- switch_xml_t proccessAccounts(QString, QByteArray);
</del><ins>+ void parseGroup(QXmlStreamWriter *,QString);
</ins><span class="cx"> QString _binding;
</span><span class="cx"> QSettings* _settings;
</span><span class="cx"> };
</span></span></pre></div>
<a id="freeswitchtrunkfscommpreferencesaccountdialogcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/preferences/accountdialog.cpp (16296 => 16297)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/accountdialog.cpp        2010-01-14 00:39:32 UTC (rev 16296)
+++ freeswitch/trunk/fscomm/preferences/accountdialog.cpp        2010-01-14 02:32:20 UTC (rev 16297)
</span><span class="lines">@@ -2,9 +2,11 @@
</span><span class="cx"> #include <QtGui>
</span><span class="cx"> #include "accountdialog.h"
</span><span class="cx"> #include "ui_accountdialog.h"
</span><ins>+#include "fshost.h"
</ins><span class="cx">
</span><del>-AccountDialog::AccountDialog(QWidget *parent) :
</del><ins>+AccountDialog::AccountDialog(int accId, QWidget *parent) :
</ins><span class="cx"> QDialog(parent),
</span><ins>+ _accId(accId),
</ins><span class="cx"> ui(new Ui::AccountDialog)
</span><span class="cx"> {
</span><span class="cx"> ui->setupUi(this);
</span><span class="lines">@@ -57,9 +59,16 @@
</span><span class="cx">
</span><span class="cx"> void AccountDialog::writeConfig()
</span><span class="cx"> {
</span><del>- _settings->beginGroup("FreeSWITCH/conf/accounts");
</del><ins>+ _settings->beginGroup("FreeSWITCH/conf/sofia.conf/profiles/profile/gateways");
</ins><span class="cx">
</span><del>- _settings->beginGroup(ui->sofiaGwNameEdit->text());
</del><ins>+ _settings->beginGroup(QString::number(_accId));
+
+ _settings->beginGroup("gateway/attrs");
+ _settings->setValue("name", ui->sofiaGwNameEdit->text());
+ _settings->endGroup();
+
+
+ _settings->beginGroup("gateway/params");
</ins><span class="cx"> _settings->setValue("username", ui->sofiaGwUsernameEdit->text());
</span><span class="cx"> _settings->setValue("realm", ui->sofiaGwRealmEdit->text());
</span><span class="cx"> _settings->setValue("password", ui->sofiaGwPasswordEdit->text());
</span><span class="lines">@@ -67,9 +76,7 @@
</span><span class="cx"> _settings->setValue("expire-seconds", ui->sofiaGwExpireSecondsSpin->value());
</span><span class="cx"> _settings->setValue("register", ui->sofiaGwRegisterCombo->currentText());
</span><span class="cx"> _settings->setValue("register-transport", ui->sofiaGwRegisterTransportCombo->currentText());
</span><del>- _settings->setValue("retry-seconds", ui->sofiaGwRetrySecondsSpin->value());
-
- _settings->beginGroup("customParams");
</del><ins>+ _settings->setValue("retry-seconds", ui->sofiaGwRetrySecondsSpin->value());
</ins><span class="cx"> for (int i = 0; i< ui->sofiaExtraParamTable->rowCount(); i++)
</span><span class="cx"> {
</span><span class="cx"> _settings->setValue(ui->sofiaExtraParamTable->item(i, 0)->text(),
</span><span class="lines">@@ -80,6 +87,14 @@
</span><span class="cx"> _settings->endGroup();
</span><span class="cx">
</span><span class="cx"> _settings->endGroup();
</span><ins>+
+ QString res;
+ if (g_FSHost.sendCmd("sofia", "profile softphone rescan", &res) != SWITCH_STATUS_SUCCESS)
+ {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not rescan the softphone profile.\n");
+ return;
+ }
+ emit gwAdded();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void AccountDialog::changeEvent(QEvent *e)
</span></span></pre></div>
<a id="freeswitchtrunkfscommpreferencesaccountdialogh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/preferences/accountdialog.h (16296 => 16297)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/accountdialog.h        2010-01-14 00:39:32 UTC (rev 16296)
+++ freeswitch/trunk/fscomm/preferences/accountdialog.h        2010-01-14 02:32:20 UTC (rev 16297)
</span><span class="lines">@@ -12,9 +12,12 @@
</span><span class="cx"> class AccountDialog : public QDialog {
</span><span class="cx"> Q_OBJECT
</span><span class="cx"> public:
</span><del>- AccountDialog(QWidget *parent = 0);
</del><ins>+ AccountDialog(int accId, QWidget *parent = 0);
</ins><span class="cx"> ~AccountDialog();
</span><span class="cx">
</span><ins>+signals:
+ void gwAdded();
+
</ins><span class="cx"> private slots:
</span><span class="cx"> void writeConfig();
</span><span class="cx"> void addExtraParam();
</span><span class="lines">@@ -24,6 +27,7 @@
</span><span class="cx"> void changeEvent(QEvent *e);
</span><span class="cx">
</span><span class="cx"> private:
</span><ins>+ int _accId;
</ins><span class="cx"> Ui::AccountDialog *ui;
</span><span class="cx"> QSettings *_settings;
</span><span class="cx"> };
</span></span></pre></div>
<a id="freeswitchtrunkfscommpreferencesprefaccountscpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/preferences/prefaccounts.cpp (16296 => 16297)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/prefaccounts.cpp        2010-01-14 00:39:32 UTC (rev 16296)
+++ freeswitch/trunk/fscomm/preferences/prefaccounts.cpp        2010-01-14 02:32:20 UTC (rev 16297)
</span><span class="lines">@@ -1,12 +1,28 @@
</span><span class="cx"> #include <QtGui>
</span><span class="cx"> #include "prefaccounts.h"
</span><ins>+#include "accountdialog.h"
</ins><span class="cx">
</span><span class="cx"> PrefAccounts::PrefAccounts(Ui::PrefDialog *ui) :
</span><span class="cx"> _ui(ui)
</span><span class="cx"> {
</span><span class="cx"> _settings = new QSettings();
</span><ins>+ _accDlg = NULL;
+ connect(_ui->sofiaGwAddBtn, SIGNAL(clicked()), this, SLOT(addAccountBtnClicked()));
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+void PrefAccounts::addAccountBtnClicked()
+{
+ if (!_accDlg)
+ {
+ _accDlg = new AccountDialog(_ui->accountsTable->rowCount());
+ connect(_accDlg, SIGNAL(gwAdded()), this, SLOT(readConfig()));
+ }
+
+ _accDlg->show();
+ _accDlg->raise();
+ _accDlg->activateWindow();
+}
+
</ins><span class="cx"> void PrefAccounts::writeConfig()
</span><span class="cx"> {
</span><span class="cx"> return;
</span><span class="lines">@@ -14,13 +30,22 @@
</span><span class="cx">
</span><span class="cx"> void PrefAccounts::readConfig()
</span><span class="cx"> {
</span><del>- _settings->beginGroup("FreeSWITCH/conf/accounts");
- foreach(QString accountName, _settings->childGroups())
</del><ins>+
+ _ui->accountsTable->clearContents();
+ _ui->accountsTable->setRowCount(0);
+
+ _settings->beginGroup("FreeSWITCH/conf/sofia.conf/profiles/profile/gateways");
+
+ foreach(QString accId, _settings->childGroups())
</ins><span class="cx"> {
</span><del>- _settings->beginGroup(accountName);
- QTableWidgetItem *item0 = new QTableWidgetItem(accountName);
</del><ins>+ _settings->beginGroup(accId);
+ _settings->beginGroup("gateway/attrs");
+ QTableWidgetItem *item0 = new QTableWidgetItem(_settings->value("name").toString());
+ _settings->endGroup();
+ _settings->beginGroup("gateway/params");
</ins><span class="cx"> QTableWidgetItem *item1 = new QTableWidgetItem(_settings->value("username").toString());
</span><span class="cx"> _settings->endGroup();
</span><ins>+ _settings->endGroup();
</ins><span class="cx"> _ui->accountsTable->setRowCount(_ui->accountsTable->rowCount()+1);
</span><span class="cx"> _ui->accountsTable->setItem(_ui->accountsTable->rowCount()-1, 0, item0);
</span><span class="cx"> _ui->accountsTable->setItem(_ui->accountsTable->rowCount()-1, 1, item1);
</span></span></pre></div>
<a id="freeswitchtrunkfscommpreferencesprefaccountsh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/preferences/prefaccounts.h (16296 => 16297)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/prefaccounts.h        2010-01-14 00:39:32 UTC (rev 16296)
+++ freeswitch/trunk/fscomm/preferences/prefaccounts.h        2010-01-14 02:32:20 UTC (rev 16297)
</span><span class="lines">@@ -5,16 +5,23 @@
</span><span class="cx"> #include "ui_prefdialog.h"
</span><span class="cx">
</span><span class="cx"> class QSettings;
</span><ins>+class AccountDialog;
</ins><span class="cx">
</span><del>-class PrefAccounts
-{
</del><ins>+class PrefAccounts : public QObject {
+ Q_OBJECT
</ins><span class="cx"> public:
</span><span class="cx"> explicit PrefAccounts(Ui::PrefDialog *ui);
</span><del>- void readConfig();
</del><span class="cx"> void writeConfig();
</span><span class="cx">
</span><ins>+public slots:
+ void readConfig();
+
+private slots:
+ void addAccountBtnClicked();
+
</ins><span class="cx"> private:
</span><span class="cx"> Ui::PrefDialog *_ui;
</span><ins>+ AccountDialog *_accDlg;
</ins><span class="cx"> QSettings *_settings;
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchtrunkfscommpreferencesprefdialogcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/preferences/prefdialog.cpp (16296 => 16297)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/prefdialog.cpp        2010-01-14 00:39:32 UTC (rev 16296)
+++ freeswitch/trunk/fscomm/preferences/prefdialog.cpp        2010-01-14 02:32:20 UTC (rev 16297)
</span><span class="lines">@@ -3,7 +3,6 @@
</span><span class="cx"> #include "ui_prefdialog.h"
</span><span class="cx"> #include "prefportaudio.h"
</span><span class="cx"> #include "prefsofia.h"
</span><del>-#include "accountdialog.h"
</del><span class="cx"> #include "prefaccounts.h"
</span><span class="cx">
</span><span class="cx"> PrefDialog::PrefDialog(QWidget *parent) :
</span><span class="lines">@@ -13,12 +12,10 @@
</span><span class="cx"> ui->setupUi(this);
</span><span class="cx"> _settings = new QSettings();
</span><span class="cx"> connect(this, SIGNAL(accepted()), this, SLOT(writeConfig()));
</span><del>- connect(ui->sofiaGwAddBtn, SIGNAL(clicked()), this, SLOT(addAccountBtnClicked()));
</del><span class="cx">
</span><del>- _accDlg = NULL;
- /*_pref_accounts = new PrefAccounts(ui);*/
</del><ins>+ _pref_accounts = new PrefAccounts(ui);
</ins><span class="cx"> _mod_portaudio = new PrefPortaudio(ui, this);
</span><del>- /*_mod_sofia = new PrefSofia(ui, this);*/
</del><ins>+ _mod_sofia = new PrefSofia(ui, this);
</ins><span class="cx"> readConfig();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -27,20 +24,10 @@
</span><span class="cx"> delete ui;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void PrefDialog::addAccountBtnClicked()
-{
- if (!_accDlg)
- _accDlg = new AccountDialog();
-
- _accDlg->show();
- _accDlg->raise();
- _accDlg->activateWindow();
-}
-
</del><span class="cx"> void PrefDialog::writeConfig()
</span><span class="cx"> {
</span><span class="cx"> _mod_portaudio->writeConfig();
</span><del>- /*_mod_sofia->writeConfig();*/
</del><ins>+ _mod_sofia->writeConfig();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void PrefDialog::changeEvent(QEvent *e)
</span><span class="lines">@@ -57,7 +44,7 @@
</span><span class="cx">
</span><span class="cx"> void PrefDialog::readConfig()
</span><span class="cx"> {
</span><del>- /*_pref_accounts->readConfig();*/
</del><ins>+ _pref_accounts->readConfig();
</ins><span class="cx"> _mod_portaudio->readConfig();
</span><del>- /*_mod_sofia->readConfig();*/
</del><ins>+ _mod_sofia->readConfig();
</ins><span class="cx"> }
</span></span></pre></div>
<a id="freeswitchtrunkfscommpreferencesprefdialogh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/preferences/prefdialog.h (16296 => 16297)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/prefdialog.h        2010-01-14 00:39:32 UTC (rev 16296)
+++ freeswitch/trunk/fscomm/preferences/prefdialog.h        2010-01-14 02:32:20 UTC (rev 16297)
</span><span class="lines">@@ -9,7 +9,6 @@
</span><span class="cx"> class PrefPortaudio;
</span><span class="cx"> class PrefSofia;
</span><span class="cx"> class PrefAccounts;
</span><del>-class AccountDialog;
</del><span class="cx">
</span><span class="cx"> namespace Ui {
</span><span class="cx"> class PrefDialog;
</span><span class="lines">@@ -25,17 +24,15 @@
</span><span class="cx"> void changeEvent(QEvent *e);
</span><span class="cx">
</span><span class="cx"> private slots:
</span><del>- void addAccountBtnClicked();
</del><span class="cx"> void writeConfig();
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> void readConfig();
</span><span class="cx"> QSettings *_settings;
</span><del>- AccountDialog *_accDlg;
-/* PrefAccounts *_pref_accounts;*/
</del><ins>+ PrefAccounts *_pref_accounts;
</ins><span class="cx"> Ui::PrefDialog *ui;
</span><span class="cx"> PrefPortaudio *_mod_portaudio;
</span><del>-/* PrefSofia *_mod_sofia;*/
</del><ins>+ PrefSofia *_mod_sofia;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchtrunkfscommpreferencesprefdialogui"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/preferences/prefdialog.ui (16296 => 16297)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/prefdialog.ui        2010-01-14 00:39:32 UTC (rev 16296)
+++ freeswitch/trunk/fscomm/preferences/prefdialog.ui        2010-01-14 02:32:20 UTC (rev 16297)
</span><span class="lines">@@ -72,9 +72,6 @@
</span><span class="cx"> <iconset resource="../resources.qrc">
</span><span class="cx"> <normaloff>:/images/pref_accounts.jpg</normaloff>:/images/pref_accounts.jpg</iconset>
</span><span class="cx"> </property>
</span><del>- <property name="flags">
- <set>ItemIsSelectable|ItemIsDragEnabled|ItemIsUserCheckable</set>
- </property>
</del><span class="cx"> </item>
</span><span class="cx"> <item>
</span><span class="cx"> <property name="text">
</span><span class="lines">@@ -84,9 +81,6 @@
</span><span class="cx"> <iconset resource="../resources.qrc">
</span><span class="cx"> <normaloff>:/images/pref_sip.png</normaloff>:/images/pref_sip.png</iconset>
</span><span class="cx"> </property>
</span><del>- <property name="flags">
- <set>ItemIsSelectable|ItemIsDragEnabled|ItemIsUserCheckable</set>
- </property>
</del><span class="cx"> </item>
</span><span class="cx"> <item>
</span><span class="cx"> <property name="text">
</span></span></pre></div>
<a id="freeswitchtrunkfscommpreferencesprefportaudiocpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/preferences/prefportaudio.cpp (16296 => 16297)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/prefportaudio.cpp        2010-01-14 00:39:32 UTC (rev 16296)
+++ freeswitch/trunk/fscomm/preferences/prefportaudio.cpp        2010-01-14 02:32:20 UTC (rev 16297)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx"> void PrefPortaudio::writeConfig()
</span><span class="cx"> {
</span><span class="cx"> _settings->beginGroup("FreeSWITCH/conf");
</span><del>- _settings->beginGroup("portaudio.conf");
</del><ins>+ _settings->beginGroup("portaudio.conf/settings/params");
</ins><span class="cx">
</span><span class="cx"> QString cid_name = _settings->value("cid-name").toString();
</span><span class="cx"> QString ncid_name = _ui->PaCallerIdNameEdit->text();
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx"> getPaDevlist();
</span><span class="cx"> _settings->beginGroup("FreeSWITCH/conf");
</span><span class="cx">
</span><del>- _settings->beginGroup("portaudio.conf");
</del><ins>+ _settings->beginGroup("portaudio.conf/settings/params");
</ins><span class="cx"> _ui->PaCallerIdNameEdit->setText(_settings->value("cid-name").toString());
</span><span class="cx"> _ui->PaCallerIdNumEdit->setText(_settings->value("cid-num").toString());
</span><span class="cx"> _ui->PaHoldFileEdit->setText(_settings->value("hold-file").toString());
</span></span></pre></div>
<a id="freeswitchtrunkfscommpreferencesprefsofiacpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/preferences/prefsofia.cpp (16296 => 16297)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/prefsofia.cpp        2010-01-14 00:39:32 UTC (rev 16296)
+++ freeswitch/trunk/fscomm/preferences/prefsofia.cpp        2010-01-14 02:32:20 UTC (rev 16297)
</span><span class="lines">@@ -24,12 +24,22 @@
</span><span class="cx"> _settings->beginGroup("sofia.conf");
</span><span class="cx">
</span><span class="cx"> /* General Settings */
</span><ins>+ _settings->beginGroup("global_settings/params");
</ins><span class="cx"> _settings->setValue("log-level", _ui->sofiaLogLevelSpin->value());
</span><span class="cx"> _settings->setValue("auto-restart", _ui->sofiaAutoRestartCombo->currentText());
</span><span class="cx"> _settings->setValue("debug-presence", _ui->sofiaDebugPresenceSpin->value());
</span><span class="cx"> _settings->setValue("rewrite-multicasted-fs-path", _ui->sofiaRewriteMulticastedFsPathCombo->currentText());
</span><ins>+ _settings->endGroup();
</ins><span class="cx">
</span><span class="cx"> /* Profile settings */
</span><ins>+ _settings->beginGroup("profiles");
+ _settings->beginGroup("profile");
+
+ _settings->beginGroup("attrs");
+ _settings->setValue("name", "softphone");
+ _settings->endGroup();
+
+ _settings->beginGroup("settings/params");
</ins><span class="cx"> _settings->setValue("user-agent-string", _ui->sofiaUserAgentStringEdit->text());
</span><span class="cx"> _settings->setValue("debug", _ui->sofiaDebugSpin->value());
</span><span class="cx"> _settings->setValue("sip-trace", _ui->sofiaSipTraceCombo->currentText());
</span><span class="lines">@@ -57,8 +67,8 @@
</span><span class="cx"> _settings->setValue("rtp-hold-timeout-sec", _ui->sofiaRtpHoldTimeoutSecSpin->value());
</span><span class="cx"> _settings->setValue("disable-register", _ui->sofiaDisableRegisterCombo->currentText());
</span><span class="cx"> _settings->setValue("challenge-realm", _ui->sofiaChallengeRealmCombo->currentText());
</span><ins>+ _settings->endGroup();
</ins><span class="cx">
</span><del>-
</del><span class="cx"> _settings->endGroup();
</span><span class="cx"> _settings->endGroup();
</span><span class="cx"> }
</span></span></pre></div>
<a id="freeswitchtrunkfscommresourcesqrc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/resources.qrc (16296 => 16297)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/resources.qrc        2010-01-14 00:39:32 UTC (rev 16296)
+++ freeswitch/trunk/fscomm/resources.qrc        2010-01-14 02:32:20 UTC (rev 16297)
</span><span class="lines">@@ -8,11 +8,6 @@
</span><span class="cx"> </qresource>
</span><span class="cx"> <qresource prefix="/confs">
</span><span class="cx"> <file alias="freeswitch.xml">conf/freeswitch.xml</file>
</span><del>- <file alias="example.xml">conf/accounts/example.xml</file>
- <file alias="event_socket.conf.xml">conf/event_socket.conf.xml</file>
- <file alias="portaudio.conf.xml">conf/portaudio.conf.xml</file>
- <file alias="sofia.conf.xml">conf/sofia.conf.xml</file>
- <file alias="account.conf.xml">conf/account.conf.xml</file>
</del><span class="cx"> </qresource>
</span><span class="cx"> <qresource prefix="/sounds">
</span><span class="cx"> <file alias="test.wav">resources/test.wav</file>
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>