mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 09:36:46 +00:00
Make caller id per account option available. Needs to wipe out the ~/.fscomm/conf/freeswitch.xml file, sorry.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16529 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -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<Account> 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);
|
||||
|
Reference in New Issue
Block a user