Revision
16297
Author
jmesquita
Date
2010-01-13 20:32:20 -0600 (Wed, 13 Jan 2010)

Log Message

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.

Modified Paths

Removed Paths

Diff

Modified: freeswitch/trunk/fscomm/FSComm.pro (16296 => 16297)


--- 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)
@@ -1,7 +1,7 @@
 # #####################################
 # version check qt
 # #####################################
-contains(QT_VERSION, ^4\.[0-4]\..*) {
+contains(QT_VERSION, ^4\.[0-4]\..*) { 
     message("Cannot build FsGui with Qt version $$QT_VERSION.")
     error("Use at least Qt 4.5.")
 }
@@ -38,13 +38,10 @@
     preferences/prefdialog.h \
     preferences/prefportaudio.h \
     preferences/prefsofia.h \
-    preferences/accountdialog.h
+    preferences/accountdialog.h \
+    preferences/prefaccounts.h
 FORMS += mainwindow.ui \
     preferences/prefdialog.ui \
     preferences/accountdialog.ui
 RESOURCES += resources.qrc
-OTHER_FILES += conf/portaudio.conf.xml \
-    conf/event_socket.conf.xml \
-    conf/freeswitch.xml \
-    conf/sofia.conf.xml \
-    conf/account.conf.xml
+OTHER_FILES += conf/freeswitch.xml

Deleted: freeswitch/trunk/fscomm/conf/account.conf.xml

Deleted: freeswitch/trunk/fscomm/conf/event_socket.conf.xml

Modified: freeswitch/trunk/fscomm/conf/freeswitch.xml (16296 => 16297)


--- 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)
@@ -99,6 +99,33 @@
 			</modules>
 		</configuration>
 
+                <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>
+
 		<configuration name="post_load_modules.conf" description="Modules">
 			<modules>
 			</modules>

Deleted: freeswitch/trunk/fscomm/conf/portaudio.conf.xml

Deleted: freeswitch/trunk/fscomm/conf/sofia.conf.xml

Modified: freeswitch/trunk/fscomm/fshost.cpp (16296 => 16297)


--- 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)
@@ -56,7 +56,6 @@
         conf_dir.mkpath(".fscomm/conf/accounts");
         conf_dir.mkpath(".fscomm/sounds");
         QFile::copy(":/sounds/test.wav", QString("%1/.fscomm/sounds/test.wav").arg(QDir::homePath()));
-        conf_dir.mkpath(".fscomm/templates");
         QFile rootXML(":/confs/freeswitch.xml");
         QString dest = QString("%1/.fscomm/conf/freeswitch.xml").arg(conf_dir.absolutePath());
         rootXML.copy(dest);

Modified: freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.cpp (16296 => 16297)


--- 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)
@@ -33,128 +33,106 @@
 #include <QString>
 #include <QtGui>
 #include <QDir>
-#include <QDomDocument>
-#include <QDomNodeList>
+#include <QXmlStreamWriter>
 #include "mod_qsettings/mod_qsettings.h"
 
 switch_xml_t XMLBinding::getConfigXML(QString tmpl)
 {
-    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)))
+    _settings->beginGroup("FreeSWITCH/conf");
+    if (!_settings->childGroups().contains(tmpl))
     {
-        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());
+        _settings->endGroup();
         return NULL;
     }
+    _settings->beginGroup(tmpl);
 
-    /* Open template file and expand all strings based on QSettings */
-    QByteArray tmplContents(tmplFile.readAll());
-    tmplFile.close();
+    QByteArray *finalXML = new QByteArray();
+    QXmlStreamWriter streamWriter(finalXML);
 
-    _settings->beginGroup("FreeSWITCH/conf");
-    _settings->beginGroup(tmpl);
-    foreach(QString k, _settings->childKeys())
+    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())
     {
-        switch_event_add_header_string(e, SWITCH_STACK_BOTTOM, k.toAscii().constData(), _settings->value(k).toByteArray().constData());
+        parseGroup(&streamWriter, group);
     }
+
+    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());
+
     _settings->endGroup();
     _settings->endGroup();
 
-    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));
+    return switch_xml_parse_str(finalXML->data(), strlen(finalXML->data()));
 }
 
-switch_xml_t XMLBinding::proccessAccounts(QString tmpl, QByteArray xml)
+void XMLBinding::parseGroup(QXmlStreamWriter *streamWriter, QString group)
 {
-    char *res = NULL;
-
-    QDomDocument xmlDom;
-
-    /* Process sofia accounts */
-    if (tmpl == "sofia.conf")
+    if (group == "attrs")
     {
-        int errorLine, errorColumn;
-        QString errorMsg;
-
-        if (!xmlDom.setContent(xml, &errorMsg, &errorLine, &errorColumn))
+        _settings->beginGroup(group);
+        foreach (QString k, _settings->childKeys())
         {
-            switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not parse the xml template from sofia.conf.xml to add the accounts!\n");
+            streamWriter->writeAttribute(k, _settings->value(k).toString());
         }
-        QDomNodeList gatewaysNodeList = xmlDom.elementsByTagName("gateways");
-        if (gatewaysNodeList.isEmpty() || gatewaysNodeList.count() > 1)
+        _settings->endGroup();
+        return;
+    }
+
+    if (group == "params")
+    {
+        _settings->beginGroup(group);
+        foreach(QString param, _settings->childKeys())
         {
-            switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Where is my gateways tag? Or do we have more then one match?\n");
+            streamWriter->writeStartElement("param");
+            streamWriter->writeAttribute("name", param);
+            streamWriter->writeAttribute("value", _settings->value(param).toString());
+            streamWriter->writeEndElement();
         }
+        _settings->endGroup();
+        return;
+    }
 
-        QDomNode gatewaysNode = gatewaysNodeList.at(0);
-
-        _settings->beginGroup("FreeSWITCH/conf/accounts");
-        foreach (QString account, _settings->childGroups())
+    if (group == "gateways")
+    {
+        streamWriter->writeStartElement(group);
+        _settings->beginGroup(group);
+        foreach (QString gw, _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())
+            _settings->beginGroup(gw);
+            foreach(QString g, _settings->childGroups())
             {
-                switch_event_add_header_string(e, SWITCH_STACK_BOTTOM, k.toAscii().constData(), _settings->value(k).toByteArray().constData());
+                parseGroup(streamWriter, g);
             }
             _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();
+        streamWriter->writeEndElement();
+        return;
     }
 
-    return switch_xml_parse_str(xmlDom.toByteArray().data(), strlen(xmlDom.toByteArray().data()));
+    _settings->beginGroup(group);
+    streamWriter->writeStartElement(group);
+
+    foreach (QString group2, _settings->childGroups())
+    {
+        parseGroup(streamWriter, group2);
+    }
+
+    streamWriter->writeEndElement();
+    _settings->endGroup();
 }
 
 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,

Modified: freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.h (16296 => 16297)


--- 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)
@@ -43,7 +43,7 @@
     QString getBinding(void) { return _binding; }
     switch_xml_t getConfigXML(QString);
 private:
-    switch_xml_t proccessAccounts(QString, QByteArray);
+    void parseGroup(QXmlStreamWriter *,QString);
     QString _binding;
     QSettings* _settings;
 };

Modified: freeswitch/trunk/fscomm/preferences/accountdialog.cpp (16296 => 16297)


--- 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)
@@ -2,9 +2,11 @@
 #include <QtGui>
 #include "accountdialog.h"
 #include "ui_accountdialog.h"
+#include "fshost.h"
 
-AccountDialog::AccountDialog(QWidget *parent) :
+AccountDialog::AccountDialog(int accId, QWidget *parent) :
     QDialog(parent),
+    _accId(accId),
     ui(new Ui::AccountDialog)
 {
     ui->setupUi(this);
@@ -57,9 +59,16 @@
 
 void AccountDialog::writeConfig()
 {
-    _settings->beginGroup("FreeSWITCH/conf/accounts");
+    _settings->beginGroup("FreeSWITCH/conf/sofia.conf/profiles/profile/gateways");
 
-    _settings->beginGroup(ui->sofiaGwNameEdit->text());
+    _settings->beginGroup(QString::number(_accId));
+    
+    _settings->beginGroup("gateway/attrs");
+    _settings->setValue("name", ui->sofiaGwNameEdit->text());
+    _settings->endGroup();
+
+
+    _settings->beginGroup("gateway/params");
     _settings->setValue("username", ui->sofiaGwUsernameEdit->text());
     _settings->setValue("realm", ui->sofiaGwRealmEdit->text());
     _settings->setValue("password", ui->sofiaGwPasswordEdit->text());
@@ -67,9 +76,7 @@
     _settings->setValue("expire-seconds", ui->sofiaGwExpireSecondsSpin->value());
     _settings->setValue("register", ui->sofiaGwRegisterCombo->currentText());
     _settings->setValue("register-transport", ui->sofiaGwRegisterTransportCombo->currentText());
-    _settings->setValue("retry-seconds", ui->sofiaGwRetrySecondsSpin->value());
-
-    _settings->beginGroup("customParams");
+    _settings->setValue("retry-seconds", ui->sofiaGwRetrySecondsSpin->value());    
     for (int i = 0; i< ui->sofiaExtraParamTable->rowCount(); i++)
     {
         _settings->setValue(ui->sofiaExtraParamTable->item(i, 0)->text(),
@@ -80,6 +87,14 @@
     _settings->endGroup();
 
     _settings->endGroup();
+
+    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();
 }
 
 void AccountDialog::changeEvent(QEvent *e)

Modified: freeswitch/trunk/fscomm/preferences/accountdialog.h (16296 => 16297)


--- 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)
@@ -12,9 +12,12 @@
 class AccountDialog : public QDialog {
     Q_OBJECT
 public:
-    AccountDialog(QWidget *parent = 0);
+    AccountDialog(int accId, QWidget *parent = 0);
     ~AccountDialog();
 
+signals:
+    void gwAdded();
+
 private slots:
     void writeConfig();
     void addExtraParam();
@@ -24,6 +27,7 @@
     void changeEvent(QEvent *e);
 
 private:
+    int _accId;
     Ui::AccountDialog *ui;
     QSettings *_settings;
 };

Modified: freeswitch/trunk/fscomm/preferences/prefaccounts.cpp (16296 => 16297)


--- 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)
@@ -1,12 +1,28 @@
 #include <QtGui>
 #include "prefaccounts.h"
+#include "accountdialog.h"
 
 PrefAccounts::PrefAccounts(Ui::PrefDialog *ui) :
         _ui(ui)
 {
     _settings = new QSettings();
+    _accDlg = NULL;
+    connect(_ui->sofiaGwAddBtn, SIGNAL(clicked()), this, SLOT(addAccountBtnClicked()));
 }
 
+void PrefAccounts::addAccountBtnClicked()
+{
+    if (!_accDlg)
+    {
+        _accDlg = new AccountDialog(_ui->accountsTable->rowCount());
+        connect(_accDlg, SIGNAL(gwAdded()), this, SLOT(readConfig()));
+    }
+
+    _accDlg->show();
+    _accDlg->raise();
+    _accDlg->activateWindow();
+}
+
 void PrefAccounts::writeConfig()
 {
     return;
@@ -14,13 +30,22 @@
 
 void PrefAccounts::readConfig()
 {
-    _settings->beginGroup("FreeSWITCH/conf/accounts");
-    foreach(QString accountName, _settings->childGroups())
+
+    _ui->accountsTable->clearContents();
+    _ui->accountsTable->setRowCount(0);
+
+    _settings->beginGroup("FreeSWITCH/conf/sofia.conf/profiles/profile/gateways");
+    
+    foreach(QString accId, _settings->childGroups())
     {
-        _settings->beginGroup(accountName);
-        QTableWidgetItem *item0 = new QTableWidgetItem(accountName);
+        _settings->beginGroup(accId);
+        _settings->beginGroup("gateway/attrs");
+        QTableWidgetItem *item0 = new QTableWidgetItem(_settings->value("name").toString());
+        _settings->endGroup();
+        _settings->beginGroup("gateway/params");
         QTableWidgetItem *item1 = new QTableWidgetItem(_settings->value("username").toString());
         _settings->endGroup();
+        _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);

Modified: freeswitch/trunk/fscomm/preferences/prefaccounts.h (16296 => 16297)


--- 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)
@@ -5,16 +5,23 @@
 #include "ui_prefdialog.h"
 
 class QSettings;
+class AccountDialog;
 
-class PrefAccounts
-{
+class PrefAccounts : public QObject {
+    Q_OBJECT
 public:
     explicit PrefAccounts(Ui::PrefDialog *ui);
-    void readConfig();
     void writeConfig();
 
+public slots:
+    void readConfig();
+
+private slots:
+    void addAccountBtnClicked();
+
 private:
     Ui::PrefDialog *_ui;
+    AccountDialog *_accDlg;
     QSettings *_settings;
 };
 

Modified: freeswitch/trunk/fscomm/preferences/prefdialog.cpp (16296 => 16297)


--- 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)
@@ -3,7 +3,6 @@
 #include "ui_prefdialog.h"
 #include "prefportaudio.h"
 #include "prefsofia.h"
-#include "accountdialog.h"
 #include "prefaccounts.h"
 
 PrefDialog::PrefDialog(QWidget *parent) :
@@ -13,12 +12,10 @@
     ui->setupUi(this);
     _settings = new QSettings();
     connect(this, SIGNAL(accepted()), this, SLOT(writeConfig()));
-    connect(ui->sofiaGwAddBtn, SIGNAL(clicked()), this, SLOT(addAccountBtnClicked()));
 
-    _accDlg = NULL;
-    /*_pref_accounts = new PrefAccounts(ui);*/
+    _pref_accounts = new PrefAccounts(ui);
     _mod_portaudio = new PrefPortaudio(ui, this);
-    /*_mod_sofia = new PrefSofia(ui, this);*/
+    _mod_sofia = new PrefSofia(ui, this);
     readConfig();
 }
 
@@ -27,20 +24,10 @@
     delete ui;
 }
 
-void PrefDialog::addAccountBtnClicked()
-{
-    if (!_accDlg)
-        _accDlg = new AccountDialog();
-
-    _accDlg->show();
-    _accDlg->raise();
-    _accDlg->activateWindow();
-}
-
 void PrefDialog::writeConfig()
 {    
     _mod_portaudio->writeConfig();
-    /*_mod_sofia->writeConfig();*/
+    _mod_sofia->writeConfig();
 }
 
 void PrefDialog::changeEvent(QEvent *e)
@@ -57,7 +44,7 @@
 
 void PrefDialog::readConfig()
 {
-    /*_pref_accounts->readConfig();*/
+    _pref_accounts->readConfig();
     _mod_portaudio->readConfig();
-    /*_mod_sofia->readConfig();*/
+    _mod_sofia->readConfig();
 }

Modified: freeswitch/trunk/fscomm/preferences/prefdialog.h (16296 => 16297)


--- 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)
@@ -9,7 +9,6 @@
 class PrefPortaudio;
 class PrefSofia;
 class PrefAccounts;
-class AccountDialog;
 
 namespace Ui {
     class PrefDialog;
@@ -25,17 +24,15 @@
     void changeEvent(QEvent *e);
 
 private slots:
-    void addAccountBtnClicked();
     void writeConfig();
 
 private:
     void readConfig();
     QSettings *_settings;
-    AccountDialog *_accDlg;
-/*    PrefAccounts *_pref_accounts;*/
+    PrefAccounts *_pref_accounts;
     Ui::PrefDialog *ui;
     PrefPortaudio *_mod_portaudio;
-/*    PrefSofia *_mod_sofia;*/
+    PrefSofia *_mod_sofia;
 };
 
 

Modified: freeswitch/trunk/fscomm/preferences/prefdialog.ui (16296 => 16297)


--- 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)
@@ -72,9 +72,6 @@
        <iconset resource="../resources.qrc">
         <normaloff>:/images/pref_accounts.jpg</normaloff>:/images/pref_accounts.jpg</iconset>
       </property>
-      <property name="flags">
-       <set>ItemIsSelectable|ItemIsDragEnabled|ItemIsUserCheckable</set>
-      </property>
      </item>
      <item>
       <property name="text">
@@ -84,9 +81,6 @@
        <iconset resource="../resources.qrc">
         <normaloff>:/images/pref_sip.png</normaloff>:/images/pref_sip.png</iconset>
       </property>
-      <property name="flags">
-       <set>ItemIsSelectable|ItemIsDragEnabled|ItemIsUserCheckable</set>
-      </property>
      </item>
      <item>
       <property name="text">

Modified: freeswitch/trunk/fscomm/preferences/prefportaudio.cpp (16296 => 16297)


--- 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)
@@ -72,7 +72,7 @@
 void PrefPortaudio::writeConfig()
 {
     _settings->beginGroup("FreeSWITCH/conf");
-    _settings->beginGroup("portaudio.conf");
+    _settings->beginGroup("portaudio.conf/settings/params");
 
     QString cid_name = _settings->value("cid-name").toString();
     QString ncid_name = _ui->PaCallerIdNameEdit->text();
@@ -155,7 +155,7 @@
     getPaDevlist();
     _settings->beginGroup("FreeSWITCH/conf");
 
-    _settings->beginGroup("portaudio.conf");
+    _settings->beginGroup("portaudio.conf/settings/params");
     _ui->PaCallerIdNameEdit->setText(_settings->value("cid-name").toString());
     _ui->PaCallerIdNumEdit->setText(_settings->value("cid-num").toString());
     _ui->PaHoldFileEdit->setText(_settings->value("hold-file").toString());

Modified: freeswitch/trunk/fscomm/preferences/prefsofia.cpp (16296 => 16297)


--- 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)
@@ -24,12 +24,22 @@
     _settings->beginGroup("sofia.conf");
 
     /* General Settings */
+    _settings->beginGroup("global_settings/params");
     _settings->setValue("log-level", _ui->sofiaLogLevelSpin->value());
     _settings->setValue("auto-restart", _ui->sofiaAutoRestartCombo->currentText());
     _settings->setValue("debug-presence", _ui->sofiaDebugPresenceSpin->value());
     _settings->setValue("rewrite-multicasted-fs-path", _ui->sofiaRewriteMulticastedFsPathCombo->currentText());
+    _settings->endGroup();
 
     /* Profile settings */
+    _settings->beginGroup("profiles");
+    _settings->beginGroup("profile");
+
+    _settings->beginGroup("attrs");
+    _settings->setValue("name", "softphone");
+    _settings->endGroup();
+
+    _settings->beginGroup("settings/params");
     _settings->setValue("user-agent-string", _ui->sofiaUserAgentStringEdit->text());
     _settings->setValue("debug", _ui->sofiaDebugSpin->value());
     _settings->setValue("sip-trace", _ui->sofiaSipTraceCombo->currentText());
@@ -57,8 +67,8 @@
     _settings->setValue("rtp-hold-timeout-sec", _ui->sofiaRtpHoldTimeoutSecSpin->value());
     _settings->setValue("disable-register", _ui->sofiaDisableRegisterCombo->currentText());
     _settings->setValue("challenge-realm", _ui->sofiaChallengeRealmCombo->currentText());
+    _settings->endGroup();
 
-
     _settings->endGroup();
     _settings->endGroup();
 }

Modified: freeswitch/trunk/fscomm/resources.qrc (16296 => 16297)


--- 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)
@@ -8,11 +8,6 @@
     </qresource>
     <qresource prefix="/confs">
         <file alias="freeswitch.xml">conf/freeswitch.xml</file>
-        <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>
     </qresource>
     <qresource prefix="/sounds">
         <file alias="test.wav">resources/test.wav</file>