Diff
Modified: freeswitch/trunk/fscomm/conf/freeswitch.xml (16300 => 16301)
--- freeswitch/trunk/fscomm/conf/freeswitch.xml 2010-01-14 04:01:32 UTC (rev 16300)
+++ freeswitch/trunk/fscomm/conf/freeswitch.xml 2010-01-14 04:54:03 UTC (rev 16301)
@@ -139,9 +139,6 @@
</global_settings>
<profiles>
<profile name="softphone">
- <gateways>
- <X-PRE-PROCESS cmd="include" data="accounts/*.xml"/>
- </gateways>
<settings>
<!--<param name="media-option" value="bypass-media-after-att-xfer"/>-->
<param name="user-agent-string" value="FreeSWITCH/FSComm"/>
Modified: freeswitch/trunk/fscomm/preferences/accountdialog.cpp (16300 => 16301)
--- freeswitch/trunk/fscomm/preferences/accountdialog.cpp 2010-01-14 04:01:32 UTC (rev 16300)
+++ freeswitch/trunk/fscomm/preferences/accountdialog.cpp 2010-01-14 04:54:03 UTC (rev 16301)
@@ -57,6 +57,45 @@
ui->sofiaExtraParamTable->setItem(ui->sofiaExtraParamTable->rowCount()-1,1,paramValItem);
}
+void AccountDialog::readConfig()
+{
+ _settings->beginGroup("FreeSWITCH/conf/sofia.conf/profiles/profile/gateways");
+ _settings->beginGroup(_accId);
+
+ _settings->beginGroup("gateway/attrs");
+ ui->sofiaGwNameEdit->setText(_settings->value("name").toString());
+ _settings->endGroup();
+
+ _settings->beginGroup("gateway/params");
+ ui->sofiaGwUsernameEdit->setText(_settings->value("username").toString());
+ ui->sofiaGwRealmEdit->setText(_settings->value("realm").toString());
+ ui->sofiaGwPasswordEdit->setText(_settings->value("password").toString());
+ ui->sofiaGwExtensionEdit->setText(_settings->value("extension").toString());
+ ui->sofiaGwExpireSecondsSpin->setValue(_settings->value("expire-seconds").toInt());
+ ui->sofiaGwRegisterCombo->setCurrentIndex(ui->sofiaGwRegisterCombo->findText(_settings->value("register").toString(),
+ Qt::MatchExactly));
+ ui->sofiaGwRegisterTransportCombo->setCurrentIndex(ui->sofiaGwRegisterTransportCombo->findText(_settings->value("register-transport").toString(),
+ Qt::MatchExactly));
+ ui->sofiaGwRetrySecondsSpin->setValue(_settings->value("retry-seconds").toInt());
+ _settings->endGroup();
+
+ _settings->beginGroup("gateway/customParams");
+ int row = 0;
+ foreach(QString k, _settings->childKeys())
+ {
+ row++;
+ ui->sofiaExtraParamTable->setRowCount(row);
+ QTableWidgetItem *varName = new QTableWidgetItem(k);
+ QTableWidgetItem *varVal = new QTableWidgetItem(_settings->value(k).toString());
+ ui->sofiaExtraParamTable->setItem(row-1, 0,varName);
+ ui->sofiaExtraParamTable->setItem(row-1, 1,varVal);
+ }
+ _settings->endGroup();
+
+ _settings->endGroup();
+ _settings->endGroup();
+}
+
void AccountDialog::writeConfig()
{
_settings->beginGroup("FreeSWITCH/conf/sofia.conf/profiles/profile/gateways");
@@ -91,8 +130,6 @@
_settings->endGroup();
- _settings->endGroup();
-
QString res;
if (g_FSHost.sendCmd("sofia", "profile softphone rescan", &res) != SWITCH_STATUS_SUCCESS)
{
Modified: freeswitch/trunk/fscomm/preferences/accountdialog.h (16300 => 16301)
--- freeswitch/trunk/fscomm/preferences/accountdialog.h 2010-01-14 04:01:32 UTC (rev 16300)
+++ freeswitch/trunk/fscomm/preferences/accountdialog.h 2010-01-14 04:54:03 UTC (rev 16301)
@@ -16,6 +16,7 @@
~AccountDialog();
void clear();
void setAccId(QString);
+ void readConfig();
signals:
void gwAdded();
Modified: freeswitch/trunk/fscomm/preferences/prefaccounts.cpp (16300 => 16301)
--- freeswitch/trunk/fscomm/preferences/prefaccounts.cpp 2010-01-14 04:01:32 UTC (rev 16300)
+++ freeswitch/trunk/fscomm/preferences/prefaccounts.cpp 2010-01-14 04:54:03 UTC (rev 16301)
@@ -10,6 +10,7 @@
_accDlg = NULL;
connect(_ui->sofiaGwAddBtn, SIGNAL(clicked()), this, SLOT(addAccountBtnClicked()));
connect(_ui->sofiaGwRemBtn, SIGNAL(clicked()), this, SLOT(remAccountBtnClicked()));
+ connect(_ui->sofiaGwEditBtn, SIGNAL(clicked()), this, SLOT(editAccountBtnClicked()));
}
void PrefAccounts::addAccountBtnClicked()
@@ -42,6 +43,33 @@
_accDlg->activateWindow();
}
+void PrefAccounts::editAccountBtnClicked()
+{
+ QList<QTableWidgetSelectionRange> selList = _ui->accountsTable->selectedRanges();
+
+ if (selList.isEmpty())
+ return;
+ QTableWidgetSelectionRange range = selList[0];
+
+ QString uuid = _ui->accountsTable->item(range.topRow(),0)->data(Qt::UserRole).toString();
+
+ if (!_accDlg)
+ {
+ _accDlg = new AccountDialog(uuid);
+ connect(_accDlg, SIGNAL(gwAdded()), this, SLOT(readConfig()));
+ }
+ else
+ {
+ _accDlg->setAccId(uuid);
+ }
+
+ _accDlg->readConfig();
+
+ _accDlg->show();
+ _accDlg->raise();
+ _accDlg->activateWindow();
+}
+
void PrefAccounts::remAccountBtnClicked()
{
QList<QTableWidgetSelectionRange> sel = _ui->accountsTable->selectedRanges();
Modified: freeswitch/trunk/fscomm/preferences/prefdialog.ui (16300 => 16301)
--- freeswitch/trunk/fscomm/preferences/prefdialog.ui 2010-01-14 04:01:32 UTC (rev 16300)
+++ freeswitch/trunk/fscomm/preferences/prefdialog.ui 2010-01-14 04:54:03 UTC (rev 16301)
@@ -169,7 +169,7 @@
<item>
<widget class="QPushButton" name="sofiaGwEditBtn">
<property name="enabled">
- <bool>false</bool>
+ <bool>true</bool>
</property>
<property name="text">
<string>Edit</string>