diff --git a/fscomm/conf/freeswitch.xml b/fscomm/conf/freeswitch.xml
index 0d1d5c0d63..18e514546d 100644
--- a/fscomm/conf/freeswitch.xml
+++ b/fscomm/conf/freeswitch.xml
@@ -1,102 +1,102 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
- "${caller_id_name}","${caller_id_number}","${destination_number}","${context}","${start_stamp}","${answer_stamp}","${end_stamp}","${duration}","${billsec}","${hangup_cause}","${uuid}","${bleg_uuid}","${accountcode}","${read_codec}","${write_codec}"
-
-
+
+
+
+
+
+
+
+
+ "${caller_id_name}","${caller_id_number}","${destination_number}","${context}","${start_stamp}","${answer_stamp}","${end_stamp}","${duration}","${billsec}","${hangup_cause}","${uuid}","${bleg_uuid}","${accountcode}","${read_codec}","${write_codec}"
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -125,166 +125,185 @@
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
diff --git a/fscomm/fshost.cpp b/fscomm/fshost.cpp
index 641d46e086..564fa843bd 100644
--- a/fscomm/fshost.cpp
+++ b/fscomm/fshost.cpp
@@ -485,3 +485,22 @@ void FSHost::printEventHeaders(switch_event_t *event)
}
qDebug() << "\n\n";
}
+
+QSharedPointer FSHost::getAccountByName(QString accStr)
+{
+ foreach(QSharedPointer acc, _accounts.values())
+ {
+ if (acc.data()->getName() == accStr)
+ return acc;
+ }
+ return QSharedPointer();
+}
+
+QSharedPointer FSHost::getCurrentDefaultAccount()
+{
+ QSettings settings;
+ settings.beginGroup("FreeSWITCH/conf/globals");
+ QString accString = settings.value("default_gateway").toString();
+ settings.endGroup();
+ return getAccountByName(accString);
+}
diff --git a/fscomm/fshost.h b/fscomm/fshost.h
index f86cedab97..e6b9a41bb6 100644
--- a/fscomm/fshost.h
+++ b/fscomm/fshost.h
@@ -47,6 +47,8 @@ public:
QSharedPointer getCurrentActiveCall();
QList > getAccounts() { return _accounts.values(); }
QSharedPointer getAccountByUUID(QString uuid);
+ QSharedPointer getCurrentDefaultAccount();
+ QSharedPointer getAccountByName(QString accStr);
void accountReloadCmd(QSharedPointer acc);
protected:
diff --git a/fscomm/mainwindow.cpp b/fscomm/mainwindow.cpp
index b44570bf0c..95f8e3343d 100644
--- a/fscomm/mainwindow.cpp
+++ b/fscomm/mainwindow.cpp
@@ -239,6 +239,36 @@ void MainWindow::makeCall()
QString dialstring = QInputDialog::getText(this, tr("Make new call"),
tr("Number to dial:"), QLineEdit::Normal, NULL,&ok);
+ QSharedPointer acc = g_FSHost.getCurrentDefaultAccount();
+ if (!acc.isNull()) {
+ QSettings settings;
+ settings.beginGroup("FreeSWITCH/conf/sofia.conf/profiles/profile/gateways/");
+ settings.beginGroup(acc.data()->getUUID());
+ settings.beginGroup("gateway/global_vars");
+ QString cidName = settings.value("caller_id_name").toString();
+ QString cidNum = settings.value("caller_id_num").toString();
+ settings.endGroup();
+ settings.endGroup();
+ settings.endGroup();
+
+ if (cidName.isEmpty()) {
+ settings.beginGroup("FreeSWITCH/conf/portaudio.conf/settings/params");
+ cidName = settings.value("cid-name").toString();
+ settings.endGroup();
+ }
+ if (cidNum.isEmpty()) {
+ settings.beginGroup("FreeSWITCH/conf/portaudio.conf/settings/params");
+ cidNum = settings.value("cid-num").toString();
+ settings.endGroup();
+ }
+
+ /* Set the vars for this call */
+ switch_core_set_variable("fscomm_caller_id_name", cidName.toAscii().data());
+ switch_core_set_variable("fscomm_caller_id_num", cidNum.toAscii().data());
+
+ qDebug() << "Name:" << cidName << "Num:" << cidNum;
+ }
+
if (ok && !dialstring.isEmpty())
{
paCall(dialstring);
diff --git a/fscomm/preferences/accountdialog.cpp b/fscomm/preferences/accountdialog.cpp
index 7470c5e324..098977d8fe 100644
--- a/fscomm/preferences/accountdialog.cpp
+++ b/fscomm/preferences/accountdialog.cpp
@@ -137,6 +137,17 @@ void AccountDialog::writeConfig()
_settings->beginGroup("FreeSWITCH/conf/sofia.conf/profiles/profile/gateways");
_settings->beginGroup(_accId);
+
+ _settings->beginGroup("gateway/global_vars");
+ if (ui->clidSettingsCombo->currentIndex() == 0)
+ {
+ _settings->remove("caller_id_name");
+ _settings->remove("caller_id_num");
+ } else {
+ _settings->setValue("caller_id_name", ui->sofiaCallerIDName->text());
+ _settings->setValue("caller_id_num", ui->sofiaCallerIDNum->text());
+ }
+ _settings->endGroup();
_settings->beginGroup("gateway/attrs");
_settings->setValue("name", ui->sofiaGwNameEdit->text());
diff --git a/fscomm/preferences/accountdialog.ui b/fscomm/preferences/accountdialog.ui
index 309102a821..53d9100aaa 100644
--- a/fscomm/preferences/accountdialog.ui
+++ b/fscomm/preferences/accountdialog.ui
@@ -193,7 +193,7 @@
-
- false
+ true
-