<!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][16235] </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=16235">16235</a></dd>
<dt>Author</dt> <dd>jmesquita</dd>
<dt>Date</dt> <dd>2010-01-10 22:40:39 -0600 (Sun, 10 Jan 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add all the new stuff to persist accounts and sofia configs. Still not working, but a lot work as been done and panes not working are disabled.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunkfscommFSCommpro">freeswitch/trunk/fscomm/FSComm.pro</a></li>
<li><a href="#freeswitchtrunkfscommconfsofiaconfxml">freeswitch/trunk/fscomm/conf/sofia.conf.xml</a></li>
<li><a href="#freeswitchtrunkfscommfshostcpp">freeswitch/trunk/fscomm/fshost.cpp</a></li>
<li><a href="#freeswitchtrunkfscommfshosth">freeswitch/trunk/fscomm/fshost.h</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="#freeswitchtrunkfscommpreferencesaccountdialogui">freeswitch/trunk/fscomm/preferences/accountdialog.ui</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>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#freeswitchtrunkfscommpreferencesprefaccountscpp">freeswitch/trunk/fscomm/preferences/prefaccounts.cpp</a></li>
<li><a href="#freeswitchtrunkfscommpreferencesprefaccountsh">freeswitch/trunk/fscomm/preferences/prefaccounts.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkfscommFSCommpro"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/FSComm.pro (16234 => 16235)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/FSComm.pro        2010-01-11 03:47:19 UTC (rev 16234)
+++ freeswitch/trunk/fscomm/FSComm.pro        2010-01-11 04:40:39 UTC (rev 16235)
</span><span class="lines">@@ -29,7 +29,8 @@
</span><span class="cx"> preferences/prefdialog.cpp \
</span><span class="cx"> preferences/prefportaudio.cpp \
</span><span class="cx"> preferences/prefsofia.cpp \
</span><del>- preferences/accountdialog.cpp
</del><ins>+ preferences/accountdialog.cpp \
+ preferences/prefaccounts.cpp
</ins><span class="cx"> HEADERS += mainwindow.h \
</span><span class="cx"> fshost.h \
</span><span class="cx"> call.h \
</span></span></pre></div>
<a id="freeswitchtrunkfscommconfsofiaconfxml"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/conf/sofia.conf.xml (16234 => 16235)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/conf/sofia.conf.xml        2010-01-11 03:47:19 UTC (rev 16234)
+++ freeswitch/trunk/fscomm/conf/sofia.conf.xml        2010-01-11 04:40:39 UTC (rev 16235)
</span><span class="lines">@@ -9,6 +9,8 @@
</span><span class="cx">                         </global_settings>
</span><span class="cx">                         <profiles>
</span><span class="cx">                                 <profile name="softphone">
</span><ins>+ <gateways>
+ </gateways>
</ins><span class="cx">                                         <settings>
</span><span class="cx"> <param name="user-agent-string" value="${user-agent-string)"/>
</span><span class="cx"> <param name="debug" value="${debug}"/>
</span></span></pre></div>
<a id="freeswitchtrunkfscommfshostcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/fshost.cpp (16234 => 16235)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/fshost.cpp        2010-01-11 03:47:19 UTC (rev 16234)
+++ freeswitch/trunk/fscomm/fshost.cpp        2010-01-11 04:40:39 UTC (rev 16235)
</span><span class="lines">@@ -47,15 +47,10 @@
</span><span class="cx">
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void FSHost::run(void)
</del><ins>+void FSHost::createFolders()
</ins><span class="cx"> {
</span><del>- switch_core_flag_t flags = SCF_USE_SQL | SCF_USE_AUTO_NAT;
- const char *err = NULL;
- switch_bool_t console = SWITCH_FALSE;
- switch_status_t destroy_status;
-
</del><span class="cx"> /* Create directory structure for softphone with default configs */
</span><del>- QDir conf_dir = QDir(QDir::home());
</del><ins>+ QDir conf_dir = QDir::home();
</ins><span class="cx"> if (!conf_dir.exists(".fscomm"))
</span><span class="cx"> {
</span><span class="cx"> conf_dir.mkpath(".fscomm/conf/accounts");
</span><span class="lines">@@ -66,8 +61,8 @@
</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 class="cx">
</span><del>- QFile defaultAccount(":/confs/example.xml");
- dest = QString("%1/.fscomm/conf/accounts/example.xml").arg(conf_dir.absolutePath());
</del><ins>+ QFile defaultAccount(":/confs/template.xml");
+ dest = QString("%1/.fscomm/conf/accounts/template.xml").arg(conf_dir.absolutePath());
</ins><span class="cx"> defaultAccount.copy(dest);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -110,7 +105,17 @@
</span><span class="cx"> }
</span><span class="cx"> strcpy(SWITCH_GLOBAL_dirs.htdocs_dir, QString("%1/htdocs").arg(conf_dir.absolutePath()).toAscii().constData());
</span><span class="cx"> }
</span><ins>+}
</ins><span class="cx">
</span><ins>+void FSHost::run(void)
+{
+ switch_core_flag_t flags = SCF_USE_SQL | SCF_USE_AUTO_NAT;
+ const char *err = NULL;
+ switch_bool_t console = SWITCH_FALSE;
+ switch_status_t destroy_status;
+
+ createFolders();
+
</ins><span class="cx"> /* If you need to override configuration directories, you need to change them in the SWITCH_GLOBAL_dirs global structure */
</span><span class="cx"> printf("Initializing core...\n");
</span><span class="cx"> /* Initialize the core and load modules, that will startup FS completely */
</span></span></pre></div>
<a id="freeswitchtrunkfscommfshosth"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/fshost.h (16234 => 16235)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/fshost.h        2010-01-11 03:47:19 UTC (rev 16234)
+++ freeswitch/trunk/fscomm/fshost.h        2010-01-11 04:40:39 UTC (rev 16235)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> #define FSCOMM_GW_STATE_EXPIRED 7
</span><span class="cx"> #define FSCOMM_GW_STATE_NOREG 8
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> static const char *fscomm_gw_state_names[] = {
</span><span class="cx"> "TRYING",
</span><span class="cx"> "REGISTER",
</span><span class="lines">@@ -83,6 +84,7 @@
</span><span class="cx"> private:
</span><span class="cx"> switch_status_t processBlegEvent(switch_event_t *, QString);
</span><span class="cx"> switch_status_t processAlegEvent(switch_event_t *, QString);
</span><ins>+ void createFolders();
</ins><span class="cx"> void printEventHeaders(switch_event_t *event);
</span><span class="cx"> QHash<QString, Call*> _active_calls;
</span><span class="cx"> QHash<QString, QString> _bleg_uuids;
</span></span></pre></div>
<a id="freeswitchtrunkfscommmod_qsettingsmod_qsettingscpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.cpp (16234 => 16235)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.cpp        2010-01-11 03:47:19 UTC (rev 16234)
+++ freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.cpp        2010-01-11 04:40:39 UTC (rev 16235)
</span><span class="lines">@@ -33,6 +33,8 @@
</span><span class="cx"> #include <QString>
</span><span class="cx"> #include <QtGui>
</span><span class="cx"> #include <QDir>
</span><ins>+#include <QDomDocument>
+#include <QDomNodeList>
</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="lines">@@ -79,9 +81,82 @@
</span><span class="cx"> char *res = switch_event_expand_headers(e, tmplContents.data());
</span><span class="cx"> switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Template %s as follows:\n%s", tmpl.toAscii().constData(), res);
</span><span class="cx"> switch_safe_free(e);
</span><ins>+ if (tmpl == "sofia.conf")
+ {
+ return proccessAccounts(tmpl, res);
+ }
</ins><span class="cx"> return switch_xml_parse_str(res, strlen(res));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+switch_xml_t XMLBinding::proccessAccounts(QString tmpl, QByteArray xml)
+{
+ char *res = NULL;
+
+ QDomDocument xmlDom;
+
+ /* Process sofia accounts */
+ if (tmpl == "sofia.conf")
+ {
+ int errorLine, errorColumn;
+ QString errorMsg;
+
+ if (!xmlDom.setContent(xml, &errorMsg, &errorLine, &errorColumn))
+ {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not parse the xml template from sofia.conf.xml to add the accounts!\n");
+ }
+ QDomNodeList gatewaysNodeList = xmlDom.elementsByTagName("gateways");
+ if (gatewaysNodeList.isEmpty() || gatewaysNodeList.count() > 1)
+ {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Where is my gateways tag? Or do we have more then one match?\n");
+ }
+
+ QDomNode gatewaysNode = gatewaysNodeList.at(0);
+
+ _settings->beginGroup("FreeSWITCH/conf/accounts");
+ foreach (QString account, _settings->childGroups())
+ {
+ 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())
+ {
+ switch_event_add_header_string(e, SWITCH_STACK_BOTTOM, k.toAscii().constData(), _settings->value(k).toByteArray().constData());
+ }
+ _settings->endGroup();
+
+ /* 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);
+ }
+ _settings->endGroup();
+ }
+
+ return switch_xml_parse_str(xmlDom.toByteArray().data(), strlen(xmlDom.toByteArray().data()));
+}
+
</ins><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 class="cx"> void *user_data)
</span><span class="cx"> {
</span></span></pre></div>
<a id="freeswitchtrunkfscommmod_qsettingsmod_qsettingsh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.h (16234 => 16235)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.h        2010-01-11 03:47:19 UTC (rev 16234)
+++ freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.h        2010-01-11 04:40:39 UTC (rev 16235)
</span><span class="lines">@@ -43,6 +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><ins>+ switch_xml_t proccessAccounts(QString, QByteArray);
</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 (16234 => 16235)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/accountdialog.cpp        2010-01-11 03:47:19 UTC (rev 16234)
+++ freeswitch/trunk/fscomm/preferences/accountdialog.cpp        2010-01-11 04:40:39 UTC (rev 16235)
</span><span class="lines">@@ -1,4 +1,5 @@
</span><span class="cx"> #include <QSettings>
</span><ins>+#include <QtGui>
</ins><span class="cx"> #include "accountdialog.h"
</span><span class="cx"> #include "ui_accountdialog.h"
</span><span class="cx">
</span><span class="lines">@@ -9,6 +10,8 @@
</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><ins>+ connect(ui->sofiaExtraParamAddBtn, SIGNAL(clicked()), this, SLOT(addExtraParam()));
+ connect(ui->sofiaExtraParamRemBtn, SIGNAL(clicked()), this, SLOT(remExtraParam()));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> AccountDialog::~AccountDialog()
</span><span class="lines">@@ -16,6 +19,42 @@
</span><span class="cx"> delete ui;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void AccountDialog::remExtraParam()
+{
+ QList<QTableWidgetSelectionRange> sel = ui->sofiaExtraParamTable->selectedRanges();
+
+ foreach(QTableWidgetSelectionRange range, sel)
+ {
+ int offset =0;
+ for(int row = range.topRow(); row<=range.bottomRow(); row++)
+ {
+ ui->sofiaExtraParamTable->removeRow(row-offset);
+ offset++;
+ }
+ }
+}
+
+void AccountDialog::addExtraParam()
+{
+ bool ok;
+ QString paramName = QInputDialog::getText(this, tr("Add parameter."),
+ tr("New parameter name:"), QLineEdit::Normal,
+ NULL, &ok);
+ if (!ok)
+ return;
+ QString paramVal = QInputDialog::getText(this, tr("Add parameter."),
+ tr("New parameter value:"), QLineEdit::Normal,
+ NULL, &ok);
+ if (!ok)
+ return;
+
+ QTableWidgetItem* paramNameItem = new QTableWidgetItem(paramName);
+ QTableWidgetItem* paramValItem = new QTableWidgetItem(paramVal);
+ ui->sofiaExtraParamTable->setRowCount(ui->sofiaExtraParamTable->rowCount()+1);
+ ui->sofiaExtraParamTable->setItem(ui->sofiaExtraParamTable->rowCount()-1,0,paramNameItem);
+ ui->sofiaExtraParamTable->setItem(ui->sofiaExtraParamTable->rowCount()-1,1,paramValItem);
+}
+
</ins><span class="cx"> void AccountDialog::writeConfig()
</span><span class="cx"> {
</span><span class="cx"> _settings->beginGroup("FreeSWITCH/conf/accounts");
</span><span class="lines">@@ -23,22 +62,24 @@
</span><span class="cx"> _settings->beginGroup(ui->sofiaGwNameEdit->text());
</span><span class="cx"> _settings->setValue("username", ui->sofiaGwUsernameEdit->text());
</span><span class="cx"> _settings->setValue("realm", ui->sofiaGwRealmEdit->text());
</span><del>- _settings->setValue("from-user", ui->sofiaGwFromUserEdit->text());
- _settings->setValue("from-domain", ui->sofiaGwFromDomainEdit->text());
</del><span class="cx"> _settings->setValue("password", ui->sofiaGwPasswordEdit->text());
</span><span class="cx"> _settings->setValue("extension", ui->sofiaGwExtensionEdit->text());
</span><del>- _settings->setValue("proxy", ui->sofiaGwProxyEdit->text());
- _settings->setValue("register-proxy", ui->sofiaGwRegisterProxyEdit->text());
</del><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><span class="cx"> _settings->setValue("retry-seconds", ui->sofiaGwRetrySecondsSpin->value());
</span><del>- _settings->setValue("caller-id-in-from", ui->sofiaGwCallerIdInFromCombo->currentText());
- _settings->setValue("contact-params", ui->sofiaGwContactParamsEdit->text());
- _settings->setValue("ping", ui->sofiaGwPingSpin->value());
</del><ins>+
+ _settings->beginGroup("customParams");
+ for (int i = 0; i< ui->sofiaExtraParamTable->rowCount(); i++)
+ {
+ _settings->setValue(ui->sofiaExtraParamTable->item(i, 0)->text(),
+ ui->sofiaExtraParamTable->item(i, 1)->text());
+ }
</ins><span class="cx"> _settings->endGroup();
</span><span class="cx">
</span><span class="cx"> _settings->endGroup();
</span><ins>+
+ _settings->endGroup();
</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 (16234 => 16235)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/accountdialog.h        2010-01-11 03:47:19 UTC (rev 16234)
+++ freeswitch/trunk/fscomm/preferences/accountdialog.h        2010-01-11 04:40:39 UTC (rev 16235)
</span><span class="lines">@@ -17,6 +17,8 @@
</span><span class="cx">
</span><span class="cx"> private slots:
</span><span class="cx"> void writeConfig();
</span><ins>+ void addExtraParam();
+ void remExtraParam();
</ins><span class="cx">
</span><span class="cx"> protected:
</span><span class="cx"> void changeEvent(QEvent *e);
</span></span></pre></div>
<a id="freeswitchtrunkfscommpreferencesaccountdialogui"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/preferences/accountdialog.ui (16234 => 16235)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/accountdialog.ui        2010-01-11 03:47:19 UTC (rev 16234)
+++ freeswitch/trunk/fscomm/preferences/accountdialog.ui        2010-01-11 04:40:39 UTC (rev 16235)
</span><span class="lines">@@ -9,206 +9,204 @@
</span><span class="cx"> <rect>
</span><span class="cx"> <x>0</x>
</span><span class="cx"> <y>0</y>
</span><del>- <width>495</width>
- <height>573</height>
</del><ins>+ <width>389</width>
+ <height>394</height>
</ins><span class="cx"> </rect>
</span><span class="cx"> </property>
</span><span class="cx"> <property name="windowTitle">
</span><span class="cx"> <string>Account</string>
</span><span class="cx"> </property>
</span><del>- <layout class="QFormLayout" name="formLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>name</string>
</del><ins>+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>1</number>
</ins><span class="cx"> </property>
</span><ins>+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>Basic</string>
+ </attribute>
+ <layout class="QFormLayout" name="formLayout">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>name</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="sofiaGwNameEdit"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>username</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="sofiaGwUsernameEdit"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>realm</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLineEdit" name="sofiaGwRealmEdit"/>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>password</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLineEdit" name="sofiaGwPasswordEdit"/>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_7">
+ <property name="text">
+ <string>extension</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QLineEdit" name="sofiaGwExtensionEdit"/>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="label_10">
+ <property name="text">
+ <string>expire-seconds</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <widget class="QSpinBox" name="sofiaGwExpireSecondsSpin">
+ <property name="value">
+ <number>60</number>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0">
+ <widget class="QLabel" name="label_11">
+ <property name="text">
+ <string>register</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1">
+ <widget class="QComboBox" name="sofiaGwRegisterCombo">
+ <item>
+ <property name="text">
+ <string>true</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>false</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="7" column="0">
+ <widget class="QLabel" name="label_12">
+ <property name="text">
+ <string>register-transport</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="1">
+ <widget class="QComboBox" name="sofiaGwRegisterTransportCombo">
+ <item>
+ <property name="text">
+ <string>udp</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>tcp</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="8" column="0">
+ <widget class="QLabel" name="label_13">
+ <property name="text">
+ <string>retry-seconds</string>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="1">
+ <widget class="QSpinBox" name="sofiaGwRetrySecondsSpin">
+ <property name="value">
+ <number>30</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2">
+ <attribute name="title">
+ <string>Advanced</string>
+ </attribute>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QTableWidget" name="sofiaExtraParamTable">
+ <column>
+ <property name="text">
+ <string>Param Name</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Param Value</string>
+ </property>
+ </column>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QPushButton" name="sofiaExtraParamAddBtn">
+ <property name="text">
+ <string>+</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="sofiaExtraParamRemBtn">
+ <property name="text">
+ <string>-</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
</ins><span class="cx"> </widget>
</span><span class="cx"> </item>
</span><del>- <item row="0" column="1">
- <widget class="QLineEdit" name="sofiaGwNameEdit"/>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>username</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="sofiaGwUsernameEdit"/>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>realm</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QLineEdit" name="sofiaGwRealmEdit"/>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="label_4">
- <property name="text">
- <string>from-user</string>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QLineEdit" name="sofiaGwFromUserEdit"/>
- </item>
- <item row="4" column="0">
- <widget class="QLabel" name="label_5">
- <property name="text">
- <string>from-domain</string>
- </property>
- </widget>
- </item>
- <item row="4" column="1">
- <widget class="QLineEdit" name="sofiaGwFromDomainEdit"/>
- </item>
- <item row="5" column="0">
- <widget class="QLabel" name="label_6">
- <property name="text">
- <string>password</string>
- </property>
- </widget>
- </item>
- <item row="5" column="1">
- <widget class="QLineEdit" name="sofiaGwPasswordEdit"/>
- </item>
- <item row="6" column="0">
- <widget class="QLabel" name="label_7">
- <property name="text">
- <string>extension</string>
- </property>
- </widget>
- </item>
- <item row="6" column="1">
- <widget class="QLineEdit" name="sofiaGwExtensionEdit"/>
- </item>
- <item row="7" column="0">
- <widget class="QLabel" name="label_8">
- <property name="text">
- <string>proxy</string>
- </property>
- </widget>
- </item>
- <item row="7" column="1">
- <widget class="QLineEdit" name="sofiaGwProxyEdit"/>
- </item>
- <item row="8" column="0">
- <widget class="QLabel" name="label_9">
- <property name="text">
- <string>register-proxy</string>
- </property>
- </widget>
- </item>
- <item row="8" column="1">
- <widget class="QLineEdit" name="sofiaGwRegisterProxyEdit"/>
- </item>
- <item row="9" column="0">
- <widget class="QLabel" name="label_10">
- <property name="text">
- <string>expire-seconds</string>
- </property>
- </widget>
- </item>
- <item row="9" column="1">
- <widget class="QSpinBox" name="sofiaGwExpireSecondsSpin">
- <property name="value">
- <number>60</number>
- </property>
- </widget>
- </item>
- <item row="10" column="0">
- <widget class="QLabel" name="label_11">
- <property name="text">
- <string>register</string>
- </property>
- </widget>
- </item>
- <item row="10" column="1">
- <widget class="QComboBox" name="sofiaGwRegisterCombo">
- <item>
- <property name="text">
- <string>true</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>false</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="11" column="0">
- <widget class="QLabel" name="label_12">
- <property name="text">
- <string>register-transport</string>
- </property>
- </widget>
- </item>
- <item row="11" column="1">
- <widget class="QComboBox" name="sofiaGwRegisterTransportCombo">
- <item>
- <property name="text">
- <string>udp</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>tcp</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="12" column="0">
- <widget class="QLabel" name="label_13">
- <property name="text">
- <string>retry-seconds</string>
- </property>
- </widget>
- </item>
- <item row="12" column="1">
- <widget class="QSpinBox" name="sofiaGwRetrySecondsSpin">
- <property name="value">
- <number>30</number>
- </property>
- </widget>
- </item>
- <item row="13" column="0">
- <widget class="QLabel" name="label_15">
- <property name="text">
- <string>contact-params</string>
- </property>
- </widget>
- </item>
- <item row="13" column="1">
- <widget class="QLineEdit" name="sofiaGwContactParamsEdit"/>
- </item>
- <item row="14" column="0">
- <widget class="QLabel" name="label_14">
- <property name="text">
- <string>caller-id-in-from</string>
- </property>
- </widget>
- </item>
- <item row="15" column="0">
- <widget class="QLabel" name="label_16">
- <property name="text">
- <string>ping</string>
- </property>
- </widget>
- </item>
- <item row="15" column="1">
- <widget class="QSpinBox" name="sofiaGwPingSpin">
- <property name="value">
- <number>25</number>
- </property>
- </widget>
- </item>
- <item row="16" column="1">
</del><ins>+ <item>
</ins><span class="cx"> <widget class="QDialogButtonBox" name="buttonBox">
</span><span class="cx"> <property name="orientation">
</span><span class="cx"> <enum>Qt::Horizontal</enum>
</span><span class="lines">@@ -218,20 +216,6 @@
</span><span class="cx"> </property>
</span><span class="cx"> </widget>
</span><span class="cx"> </item>
</span><del>- <item row="14" column="1">
- <widget class="QComboBox" name="sofiaGwCallerIdInFromCombo">
- <item>
- <property name="text">
- <string>false</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>true</string>
- </property>
- </item>
- </widget>
- </item>
</del><span class="cx"> </layout>
</span><span class="cx"> </widget>
</span><span class="cx"> <resources/>
</span><span class="lines">@@ -243,8 +227,8 @@
</span><span class="cx"> <slot>accept()</slot>
</span><span class="cx"> <hints>
</span><span class="cx"> <hint type="sourcelabel">
</span><del>- <x>248</x>
- <y>254</y>
</del><ins>+ <x>257</x>
+ <y>563</y>
</ins><span class="cx"> </hint>
</span><span class="cx"> <hint type="destinationlabel">
</span><span class="cx"> <x>157</x>
</span><span class="lines">@@ -259,8 +243,8 @@
</span><span class="cx"> <slot>reject()</slot>
</span><span class="cx"> <hints>
</span><span class="cx"> <hint type="sourcelabel">
</span><del>- <x>316</x>
- <y>260</y>
</del><ins>+ <x>325</x>
+ <y>563</y>
</ins><span class="cx"> </hint>
</span><span class="cx"> <hint type="destinationlabel">
</span><span class="cx"> <x>286</x>
</span></span></pre></div>
<a id="freeswitchtrunkfscommpreferencesprefaccountscpp"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/fscomm/preferences/prefaccounts.cpp (0 => 16235)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/prefaccounts.cpp         (rev 0)
+++ freeswitch/trunk/fscomm/preferences/prefaccounts.cpp        2010-01-11 04:40:39 UTC (rev 16235)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+#include <QtGui>
+#include "prefaccounts.h"
+
+PrefAccounts::PrefAccounts(Ui::PrefDialog *ui) :
+ _ui(ui)
+{
+ _settings = new QSettings();
+}
+
+void PrefAccounts::writeConfig()
+{
+ return;
+}
+
+void PrefAccounts::readConfig()
+{
+ _settings->beginGroup("FreeSWITCH/conf/accounts");
+ foreach(QString accountName, _settings->childGroups())
+ {
+ _settings->beginGroup(accountName);
+ QTableWidgetItem *item0 = new QTableWidgetItem(accountName);
+ QTableWidgetItem *item1 = new QTableWidgetItem(_settings->value("username").toString());
+ _settings->endGroup();
+ _ui->accountsTable->setRowCount(_ui->accountsTable->rowCount()+1);
+ _ui->accountsTable->setItem(_ui->accountsTable->rowCount()-1, 0, item0);
+ _ui->accountsTable->setItem(_ui->accountsTable->rowCount()-1, 1, item1);
+ }
+
+ _settings->endGroup();
+}
</ins></span></pre></div>
<a id="freeswitchtrunkfscommpreferencesprefaccountsh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/fscomm/preferences/prefaccounts.h (0 => 16235)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/prefaccounts.h         (rev 0)
+++ freeswitch/trunk/fscomm/preferences/prefaccounts.h        2010-01-11 04:40:39 UTC (rev 16235)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+#ifndef PREFACCOUNTS_H
+#define PREFACCOUNTS_H
+
+#include <QObject>
+#include "ui_prefdialog.h"
+
+class QSettings;
+
+class PrefAccounts
+{
+public:
+ explicit PrefAccounts(Ui::PrefDialog *ui);
+ void readConfig();
+ void writeConfig();
+
+private:
+ Ui::PrefDialog *_ui;
+ QSettings *_settings;
+};
+
+#endif // PREFACCOUNTS_H
</ins></span></pre></div>
<a id="freeswitchtrunkfscommpreferencesprefdialogcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/preferences/prefdialog.cpp (16234 => 16235)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/prefdialog.cpp        2010-01-11 03:47:19 UTC (rev 16234)
+++ freeswitch/trunk/fscomm/preferences/prefdialog.cpp        2010-01-11 04:40:39 UTC (rev 16235)
</span><span class="lines">@@ -4,6 +4,7 @@
</span><span class="cx"> #include "prefportaudio.h"
</span><span class="cx"> #include "prefsofia.h"
</span><span class="cx"> #include "accountdialog.h"
</span><ins>+#include "prefaccounts.h"
</ins><span class="cx">
</span><span class="cx"> PrefDialog::PrefDialog(QWidget *parent) :
</span><span class="cx"> QDialog(parent),
</span><span class="lines">@@ -15,8 +16,9 @@
</span><span class="cx"> connect(ui->sofiaGwAddBtn, SIGNAL(clicked()), this, SLOT(addAccountBtnClicked()));
</span><span class="cx">
</span><span class="cx"> _accDlg = NULL;
</span><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">@@ -55,6 +57,7 @@
</span><span class="cx">
</span><span class="cx"> void PrefDialog::readConfig()
</span><span class="cx"> {
</span><ins>+ /*_pref_accounts->readConfig();*/
</ins><span class="cx"> _mod_portaudio->readConfig();
</span><span class="cx"> /*_mod_sofia->readConfig();*/
</span><span class="cx"> }
</span></span></pre></div>
<a id="freeswitchtrunkfscommpreferencesprefdialogh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/preferences/prefdialog.h (16234 => 16235)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/prefdialog.h        2010-01-11 03:47:19 UTC (rev 16234)
+++ freeswitch/trunk/fscomm/preferences/prefdialog.h        2010-01-11 04:40:39 UTC (rev 16235)
</span><span class="lines">@@ -8,6 +8,7 @@
</span><span class="cx">
</span><span class="cx"> class PrefPortaudio;
</span><span class="cx"> class PrefSofia;
</span><ins>+class PrefAccounts;
</ins><span class="cx"> class AccountDialog;
</span><span class="cx">
</span><span class="cx"> namespace Ui {
</span><span class="lines">@@ -31,9 +32,10 @@
</span><span class="cx"> void readConfig();
</span><span class="cx"> QSettings *_settings;
</span><span class="cx"> AccountDialog *_accDlg;
</span><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 (16234 => 16235)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/prefdialog.ui        2010-01-11 03:47:19 UTC (rev 16234)
+++ freeswitch/trunk/fscomm/preferences/prefdialog.ui        2010-01-11 04:40:39 UTC (rev 16235)
</span><span class="lines">@@ -72,6 +72,9 @@
</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><ins>+ <property name="flags">
+ <set>ItemIsSelectable|ItemIsDragEnabled|ItemIsUserCheckable</set>
+ </property>
</ins><span class="cx"> </item>
</span><span class="cx"> <item>
</span><span class="cx"> <property name="text">
</span><span class="lines">@@ -81,6 +84,9 @@
</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><ins>+ <property name="flags">
+ <set>ItemIsSelectable|ItemIsDragEnabled|ItemIsUserCheckable</set>
+ </property>
</ins><span class="cx"> </item>
</span><span class="cx"> <item>
</span><span class="cx"> <property name="text">
</span><span class="lines">@@ -134,17 +140,12 @@
</span><span class="cx"> <widget class="QWidget" name="accountsPage">
</span><span class="cx"> <layout class="QHBoxLayout" name="horizontalLayout_5">
</span><span class="cx"> <item>
</span><del>- <widget class="QTableWidget" name="sofiaGwListWidget">
</del><ins>+ <widget class="QTableWidget" name="accountsTable">
</ins><span class="cx"> <property name="editTriggers">
</span><span class="cx"> <set>QAbstractItemView::NoEditTriggers</set>
</span><span class="cx"> </property>
</span><span class="cx"> <column>
</span><span class="cx"> <property name="text">
</span><del>- <string>Enabled</string>
- </property>
- </column>
- <column>
- <property name="text">
</del><span class="cx"> <string>Name</string>
</span><span class="cx"> </property>
</span><span class="cx"> </column>
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>