From 7dfe65b7465e42b343788006b549edd58ee888ae Mon Sep 17 00:00:00 2001 From: Jeff Lenk Date: Fri, 4 Jun 2010 15:15:18 -0500 Subject: [PATCH] change implicit construction of FSHost - now occurs after QApplication - for some reason Windows QT didnt like this. --- fscomm/call.cpp | 6 +-- fscomm/debugtools/consolewindow.cpp | 4 +- fscomm/debugtools/statedebugdialog.cpp | 2 +- fscomm/fshost.cpp | 6 +-- fscomm/fshost.h | 6 +-- fscomm/main.cpp | 10 +++-- fscomm/mainwindow.cpp | 56 +++++++++++++------------- fscomm/preferences/accountdialog.cpp | 4 +- fscomm/preferences/prefaccounts.cpp | 10 ++--- fscomm/preferences/prefportaudio.cpp | 18 ++++----- 10 files changed, 62 insertions(+), 60 deletions(-) diff --git a/fscomm/call.cpp b/fscomm/call.cpp index 0dce6a83cd..3b91d7ee90 100644 --- a/fscomm/call.cpp +++ b/fscomm/call.cpp @@ -69,13 +69,13 @@ switch_status_t Call::toggleRecord(bool startRecord) conf_dir.absolutePath(), QDateTime::currentDateTime().toString("yyyyMMddhhmmss"), getCidNumber()); - status = g_FSHost.sendCmd("uuid_record", QString("%1 start %2").arg(getUuid(), _recording_filename).toAscii().data(),&result); + status = g_FSHost->sendCmd("uuid_record", QString("%1 start %2").arg(getUuid(), _recording_filename).toAscii().data(),&result); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Stopping call recording on call [%s]\n", getUuid().toAscii().data()); - status = g_FSHost.sendCmd("uuid_record", QString("%1 stop %2").arg(getUuid(), _recording_filename).toAscii().data(),&result); + status = g_FSHost->sendCmd("uuid_record", QString("%1 stop %2").arg(getUuid(), _recording_filename).toAscii().data(),&result); } return status; @@ -85,7 +85,7 @@ void Call::sendDTMF(QString digit) { QString result; QString dtmf_string = QString("dtmf %1").arg(digit); - if (g_FSHost.sendCmd("pa", dtmf_string.toAscii(), &result) == SWITCH_STATUS_FALSE) { + if (g_FSHost->sendCmd("pa", dtmf_string.toAscii(), &result) == SWITCH_STATUS_FALSE) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not send DTMF digit %s on call[%s]", digit.toAscii().data(), getUuid().toAscii().data()); QMessageBox::critical(0, QWidget::tr("DTMF Error"), QWidget::tr("There was an error sending DTMF, please report this bug."), QMessageBox::Ok); } diff --git a/fscomm/debugtools/consolewindow.cpp b/fscomm/debugtools/consolewindow.cpp index 25fab26df9..7c68d96f11 100644 --- a/fscomm/debugtools/consolewindow.cpp +++ b/fscomm/debugtools/consolewindow.cpp @@ -54,7 +54,7 @@ ConsoleWindow::ConsoleWindow(QWidget *parent) : connect(ui->filterReverseCheckBox, SIGNAL(toggled(bool)), this, SLOT(reverseFilterChecked())); - connect(&g_FSHost, SIGNAL(eventLog(QSharedPointer,switch_log_level_t)), this, SLOT(loggerHandler(QSharedPointer,switch_log_level_t))); + connect(g_FSHost, SIGNAL(eventLog(QSharedPointer,switch_log_level_t)), this, SLOT(loggerHandler(QSharedPointer,switch_log_level_t))); } @@ -104,7 +104,7 @@ void ConsoleWindow::cmdSendClicked() } QString res; - g_FSHost.sendCmd(cmd.toAscii().data(), args.toAscii().data(), &res); + g_FSHost->sendCmd(cmd.toAscii().data(), args.toAscii().data(), &res); if (!res.isEmpty()) { /* Remove \r\n */ diff --git a/fscomm/debugtools/statedebugdialog.cpp b/fscomm/debugtools/statedebugdialog.cpp index 72a24eae52..cdf72f44c4 100644 --- a/fscomm/debugtools/statedebugdialog.cpp +++ b/fscomm/debugtools/statedebugdialog.cpp @@ -6,7 +6,7 @@ StateDebugDialog::StateDebugDialog(QWidget *parent) : ui(new Ui::StateDebugDialog) { ui->setupUi(this); - connect(&g_FSHost, SIGNAL(newEvent(QSharedPointer)), this, SLOT(newEvent(QSharedPointer))); + connect(g_FSHost, SIGNAL(newEvent(QSharedPointer)), this, SLOT(newEvent(QSharedPointer))); connect(ui->listUUID, SIGNAL(itemSelectionChanged()), this, SLOT(currentUuidChanged())); connect(ui->listEvents, SIGNAL(itemSelectionChanged()), this, SLOT(currentEventsChanged())); } diff --git a/fscomm/fshost.cpp b/fscomm/fshost.cpp index b37452d01d..5bc214c343 100644 --- a/fscomm/fshost.cpp +++ b/fscomm/fshost.cpp @@ -32,7 +32,7 @@ #include "mod_qsettings/mod_qsettings.h" /* Declare it globally */ -FSHost g_FSHost; +FSHost *g_FSHost; FSHost::FSHost(QObject *parent) : QThread(parent) @@ -472,7 +472,7 @@ void FSHost::accountReloadCmd(QSharedPointer acc) connect(this, SIGNAL(delAccount(QSharedPointer)), this, SLOT(accountReloadSlot(QSharedPointer))); - if (g_FSHost.sendCmd("sofia", arg.toAscii().data() , &res) != SWITCH_STATUS_SUCCESS) + if (g_FSHost->sendCmd("sofia", arg.toAscii().data() , &res) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not killgw %s from profile softphone.\n", acc.data()->getName().toAscii().data()); @@ -486,7 +486,7 @@ void FSHost::accountReloadSlot(QSharedPointer acc) { _reloading_Accounts.takeAt(_reloading_Accounts.indexOf(acc.data()->getName(), 0)); QString res; - if (g_FSHost.sendCmd("sofia", "profile softphone rescan", &res) != SWITCH_STATUS_SUCCESS) + 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; diff --git a/fscomm/fshost.h b/fscomm/fshost.h index 888dad3f30..77404eac79 100644 --- a/fscomm/fshost.h +++ b/fscomm/fshost.h @@ -122,7 +122,7 @@ private: QList _loadedModules; }; -extern FSHost g_FSHost; +extern FSHost *g_FSHost; /* Used to match callback from fs core. We dup the event and call the class @@ -133,7 +133,7 @@ static void eventHandlerCallback(switch_event_t *event) switch_event_t *clone = NULL; if (switch_event_dup(&clone, event) == SWITCH_STATUS_SUCCESS) { QSharedPointer e(clone); - g_FSHost.generalEventHandler(e); + g_FSHost->generalEventHandler(e); } } @@ -144,7 +144,7 @@ static switch_status_t loggerHandler(const switch_log_node_t *node, switch_log_l { switch_log_node_t *clone = switch_log_node_dup(node); QSharedPointer l(clone); - g_FSHost.generalLoggerHandler(l, level); + g_FSHost->generalLoggerHandler(l, level); return SWITCH_STATUS_SUCCESS; } diff --git a/fscomm/main.cpp b/fscomm/main.cpp index 147314b66f..7a91762d01 100644 --- a/fscomm/main.cpp +++ b/fscomm/main.cpp @@ -43,11 +43,13 @@ int main(int argc, char *argv[]) splash->show(); splash->showMessage("Loading core, please wait...", Qt::AlignRight|Qt::AlignBottom, Qt::blue); - QObject::connect(&g_FSHost, SIGNAL(loadingModules(QString,int,QColor)), splash, SLOT(showMessage(QString,int,QColor))); + g_FSHost = new FSHost(); - QObject::connect(&g_FSHost, SIGNAL(ready()), splash, SLOT(close())); + QObject::connect(g_FSHost, SIGNAL(loadingModules(QString,int,QColor)), splash, SLOT(showMessage(QString,int,QColor))); + + QObject::connect(g_FSHost, SIGNAL(ready()), splash, SLOT(close())); MainWindow w; - QObject::connect(&g_FSHost, SIGNAL(ready()), &w, SLOT(show())); - g_FSHost.start(); + QObject::connect(g_FSHost, SIGNAL(ready()), &w, SLOT(show())); + g_FSHost->start(); return a.exec(); } diff --git a/fscomm/mainwindow.cpp b/fscomm/mainwindow.cpp index 50dca81bee..d2f36626a7 100644 --- a/fscomm/mainwindow.cpp +++ b/fscomm/mainwindow.cpp @@ -84,16 +84,16 @@ MainWindow::MainWindow(QWidget *parent) : connect(dialpadMapper, SIGNAL(mapped(QString)), this, SLOT(sendDTMF(QString))); /* Connect events related to FreeSWITCH */ - connect(&g_FSHost, SIGNAL(ready()),this, SLOT(fshostReady())); - connect(&g_FSHost, SIGNAL(ringing(QSharedPointer)), this, SLOT(ringing(QSharedPointer))); - connect(&g_FSHost, SIGNAL(answered(QSharedPointer)), this, SLOT(answered(QSharedPointer))); - connect(&g_FSHost, SIGNAL(hungup(QSharedPointer)), this, SLOT(hungup(QSharedPointer))); - connect(&g_FSHost, SIGNAL(newOutgoingCall(QSharedPointer)), this, SLOT(newOutgoingCall(QSharedPointer))); - connect(&g_FSHost, SIGNAL(callFailed(QSharedPointer)), this, SLOT(callFailed(QSharedPointer))); - connect(&g_FSHost, SIGNAL(accountStateChange(QSharedPointer)), this, SLOT(accountStateChanged(QSharedPointer))); - connect(&g_FSHost, SIGNAL(newAccount(QSharedPointer)), this, SLOT(accountAdd(QSharedPointer))); - connect(&g_FSHost, SIGNAL(delAccount(QSharedPointer)), this, SLOT(accountDel(QSharedPointer))); - connect(&g_FSHost, SIGNAL(coreLoadingError(QString)), this, SLOT(coreLoadingError(QString))); + connect(g_FSHost, SIGNAL(ready()),this, SLOT(fshostReady())); + connect(g_FSHost, SIGNAL(ringing(QSharedPointer)), this, SLOT(ringing(QSharedPointer))); + connect(g_FSHost, SIGNAL(answered(QSharedPointer)), this, SLOT(answered(QSharedPointer))); + connect(g_FSHost, SIGNAL(hungup(QSharedPointer)), this, SLOT(hungup(QSharedPointer))); + connect(g_FSHost, SIGNAL(newOutgoingCall(QSharedPointer)), this, SLOT(newOutgoingCall(QSharedPointer))); + connect(g_FSHost, SIGNAL(callFailed(QSharedPointer)), this, SLOT(callFailed(QSharedPointer))); + connect(g_FSHost, SIGNAL(accountStateChange(QSharedPointer)), this, SLOT(accountStateChanged(QSharedPointer))); + connect(g_FSHost, SIGNAL(newAccount(QSharedPointer)), this, SLOT(accountAdd(QSharedPointer))); + connect(g_FSHost, SIGNAL(delAccount(QSharedPointer)), this, SLOT(accountDel(QSharedPointer))); + connect(g_FSHost, SIGNAL(coreLoadingError(QString)), this, SLOT(coreLoadingError(QString))); /* Connect call commands */ connect(ui->newCallBtn, SIGNAL(clicked()), this, SLOT(makeCall())); @@ -128,8 +128,8 @@ MainWindow::~MainWindow() { delete ui; QString res; - g_FSHost.sendCmd("fsctl", "shutdown", &res); - g_FSHost.wait(); + g_FSHost->sendCmd("fsctl", "shutdown", &res); + g_FSHost->wait(); } void MainWindow::updateCallTimers() @@ -137,7 +137,7 @@ void MainWindow::updateCallTimers() for(int row=0; rowtableCalls->rowCount(); row++) { QTableWidgetItem* item = ui->tableCalls->item(row, 2); - QSharedPointer call = g_FSHost.getCallByUUID(item->data(Qt::UserRole).toString()); + QSharedPointer call = g_FSHost->getCallByUUID(item->data(Qt::UserRole).toString()); QTime time = call.data()->getCurrentStateTime(); item->setText(time.toString("hh:mm:ss")); item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); @@ -182,8 +182,8 @@ void MainWindow::debugConsoleTriggered() void MainWindow::applyPreprocessors(QStringList cmds) { - if (g_FSHost.getCurrentActiveCall().isNull()) return; - QString uuid = g_FSHost.getCurrentActiveCall().data()->getUuid(); + if (g_FSHost->getCurrentActiveCall().isNull()) return; + QString uuid = g_FSHost->getCurrentActiveCall().data()->getUuid(); foreach(QString cmd, cmds) { switch_stream_handle_t stream = { 0 }; @@ -259,16 +259,16 @@ void MainWindow::accountStateChanged(QSharedPointer acc) void MainWindow::sendDTMF(QString dtmf) { - g_FSHost.getCurrentActiveCall().data()->sendDTMF(dtmf); + g_FSHost->getCurrentActiveCall().data()->sendDTMF(dtmf); } void MainWindow::callTableDoubleClick(QTableWidgetItem *item) { - QSharedPointer lastCall = g_FSHost.getCurrentActiveCall(); - QSharedPointer call = g_FSHost.getCallByUUID(item->data(Qt::UserRole).toString()); + QSharedPointer lastCall = g_FSHost->getCurrentActiveCall(); + QSharedPointer call = g_FSHost->getCallByUUID(item->data(Qt::UserRole).toString()); QString switch_str = QString("switch %1").arg(call.data()->getCallID()); QString result; - if (g_FSHost.sendCmd("pa", switch_str.toAscii(), &result) == SWITCH_STATUS_FALSE) { + if (g_FSHost->sendCmd("pa", switch_str.toAscii(), &result) == SWITCH_STATUS_FALSE) { ui->textEdit->setText(QString("Error switching to call %1").arg(call.data()->getCallID())); return; } @@ -285,7 +285,7 @@ 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(); + QSharedPointer acc = g_FSHost->getCurrentDefaultAccount(); if (!acc.isNull()) { QSettings settings; settings.beginGroup("FreeSWITCH/conf/sofia.conf/profiles/profile/gateways/"); @@ -329,13 +329,13 @@ void MainWindow::fshostReady() sysTray->show(); sysTray->showMessage(tr("Status"), tr("FSComm has initialized!"), QSystemTrayIcon::Information, 5000); - if (!g_FSHost.isModuleLoaded("mod_sofia")) + if (!g_FSHost->isModuleLoaded("mod_sofia")) { QMessageBox::warning(this, tr("SIP not available"), tr("Sofia could not be loaded, therefore, SIP will not be available."), QMessageBox::Ok); } - if (!g_FSHost.isModuleLoaded("mod_portaudio")) + if (!g_FSHost->isModuleLoaded("mod_portaudio")) { QMessageBox::warning(this, tr("Audio not available"), tr("Portaudio could not be loaded. Please check if mod_portaudio is properly compiled."), @@ -347,7 +347,7 @@ void MainWindow::fshostReady() void MainWindow::paAnswer() { QString result; - if (g_FSHost.sendCmd("pa", "answer", &result) == SWITCH_STATUS_FALSE) { + if (g_FSHost->sendCmd("pa", "answer", &result) == SWITCH_STATUS_FALSE) { ui->textEdit->setText("Error sending that command"); } @@ -362,7 +362,7 @@ void MainWindow::paCall(QString dialstring) QString callstring = QString("call %1").arg(dialstring); - if (g_FSHost.sendCmd("pa", callstring.toAscii(), &result) == SWITCH_STATUS_FALSE) { + if (g_FSHost->sendCmd("pa", callstring.toAscii(), &result) == SWITCH_STATUS_FALSE) { ui->textEdit->setText("Error sending that command"); } @@ -372,7 +372,7 @@ void MainWindow::paCall(QString dialstring) void MainWindow::paHangup() { QString result; - if (g_FSHost.sendCmd("pa", "hangup", &result) == SWITCH_STATUS_FALSE) { + if (g_FSHost->sendCmd("pa", "hangup", &result) == SWITCH_STATUS_FALSE) { ui->textEdit->setText("Error sending that command"); } @@ -384,7 +384,7 @@ void MainWindow::paHangup() void MainWindow::holdCall(bool pressed) { - QSharedPointer call = g_FSHost.getCurrentActiveCall(); + QSharedPointer call = g_FSHost->getCurrentActiveCall(); if (call.isNull()) { @@ -406,7 +406,7 @@ void MainWindow::holdCall(bool pressed) void MainWindow::recordCall(bool pressed) { - QSharedPointer call = g_FSHost.getCurrentActiveCall(); + QSharedPointer call = g_FSHost->getCurrentActiveCall(); if (call.isNull()) { @@ -649,7 +649,7 @@ void MainWindow::changeEvent(QEvent *e) void MainWindow::showAbout() { QString result; - g_FSHost.sendCmd("version", "", &result); + g_FSHost->sendCmd("version", "", &result); QMessageBox::about(this, tr("About FSComm"), tr("

FSComm

" diff --git a/fscomm/preferences/accountdialog.cpp b/fscomm/preferences/accountdialog.cpp index 098977d8fe..0fca4c547f 100644 --- a/fscomm/preferences/accountdialog.cpp +++ b/fscomm/preferences/accountdialog.cpp @@ -128,10 +128,10 @@ void AccountDialog::readConfig() void AccountDialog::writeConfig() { - QSharedPointer acc = g_FSHost.getAccountByUUID(_accId); + QSharedPointer acc = g_FSHost->getAccountByUUID(_accId); if (!acc.isNull()) { - g_FSHost.accountReloadCmd(acc); + g_FSHost->accountReloadCmd(acc); } _settings->beginGroup("FreeSWITCH/conf/sofia.conf/profiles/profile/gateways"); diff --git a/fscomm/preferences/prefaccounts.cpp b/fscomm/preferences/prefaccounts.cpp index 7374715a62..fd8c88f22c 100644 --- a/fscomm/preferences/prefaccounts.cpp +++ b/fscomm/preferences/prefaccounts.cpp @@ -20,7 +20,7 @@ void PrefAccounts::addAccountBtnClicked() if (!_accDlg) { QString uuid; - if (g_FSHost.sendCmd("create_uuid", "", &uuid) != SWITCH_STATUS_SUCCESS) + if (g_FSHost->sendCmd("create_uuid", "", &uuid) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not create UUID for account. Reason: %s\n", uuid.toAscii().constData()); return; @@ -31,7 +31,7 @@ void PrefAccounts::addAccountBtnClicked() else { QString uuid; - if (g_FSHost.sendCmd("create_uuid", "", &uuid) != SWITCH_STATUS_SUCCESS) + if (g_FSHost->sendCmd("create_uuid", "", &uuid) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not create UUID for account. Reason: %s\n", uuid.toAscii().constData()); return; @@ -89,13 +89,13 @@ void PrefAccounts::remAccountBtnClicked() /* Fire event to remove account */ switch_event_t *event; if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FSCOMM_EVENT_ACC_REMOVED) == SWITCH_STATUS_SUCCESS) { - QSharedPointer acc = g_FSHost.getAccountByUUID(item->data(Qt::UserRole).toString()); + QSharedPointer acc = g_FSHost->getAccountByUUID(item->data(Qt::UserRole).toString()); if (!acc.isNull()) { QString res; QString arg = QString("profile softphone killgw %1").arg(acc.data()->getName()); - if (g_FSHost.sendCmd("sofia", arg.toAscii().data() , &res) != SWITCH_STATUS_SUCCESS) + if (g_FSHost->sendCmd("sofia", arg.toAscii().data() , &res) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not killgw %s from profile softphone.\n", acc.data()->getName().toAscii().data()); @@ -149,7 +149,7 @@ void PrefAccounts::readConfig(bool reload) if (reload) { QString res; - if (g_FSHost.sendCmd("sofia", "profile softphone rescan", &res) != SWITCH_STATUS_SUCCESS) + 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; diff --git a/fscomm/preferences/prefportaudio.cpp b/fscomm/preferences/prefportaudio.cpp index 8328c500b0..0a28174c27 100644 --- a/fscomm/preferences/prefportaudio.cpp +++ b/fscomm/preferences/prefportaudio.cpp @@ -42,7 +42,7 @@ void PrefPortaudio::applyPreprocessors(bool state) void PrefPortaudio::ringdevTest() { QString result; - if (g_FSHost.sendCmd("pa", QString("play %1/.fscomm/sounds/test.wav 0").arg(QDir::homePath()).toAscii().constData(), &result) != SWITCH_STATUS_SUCCESS) + if (g_FSHost->sendCmd("pa", QString("play %1/.fscomm/sounds/test.wav 0").arg(QDir::homePath()).toAscii().constData(), &result) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error testing ringdev on mod_portaudio! %s\n", result.toAscii().constData()); @@ -53,7 +53,7 @@ void PrefPortaudio::loopTest() { QString result; _ui->PaLoopTestBtn->setEnabled(false); - if (g_FSHost.sendCmd("pa", "looptest", &result) != SWITCH_STATUS_SUCCESS) + if (g_FSHost->sendCmd("pa", "looptest", &result) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error running looptest on mod_portaudio! %s\n", result.toAscii().constData()); @@ -64,7 +64,7 @@ void PrefPortaudio::loopTest() void PrefPortaudio::refreshDevList() { QString result; - if (g_FSHost.sendCmd("pa", "rescan", &result) != SWITCH_STATUS_SUCCESS) + if (g_FSHost->sendCmd("pa", "rescan", &result) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error rescaning sound device on mod_portaudio! %s\n", result.toAscii().constData()); @@ -80,7 +80,7 @@ void PrefPortaudio::indevChangeDev(int index) { QString result; int dev = _ui->PaIndevCombo->itemData(index, Qt::UserRole).toInt(); - if (g_FSHost.sendCmd("pa", QString("indev #%1").arg(dev).toAscii().constData(), &result) != SWITCH_STATUS_SUCCESS) + if (g_FSHost->sendCmd("pa", QString("indev #%1").arg(dev).toAscii().constData(), &result) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error setting ringdev to #%d on mod_portaudio!\n", dev); QMessageBox::critical(0, tr("Unable to change device."), @@ -94,7 +94,7 @@ void PrefPortaudio::ringdevChangeDev(int index) { QString result; int dev = _ui->PaRingdevCombo->itemData(index, Qt::UserRole).toInt(); - if (g_FSHost.sendCmd("pa", QString("ringdev #%1").arg(dev).toAscii().constData(), &result) != SWITCH_STATUS_SUCCESS) + if (g_FSHost->sendCmd("pa", QString("ringdev #%1").arg(dev).toAscii().constData(), &result) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error setting ringdev to #%d on mod_portaudio!\n", dev); QMessageBox::critical(0, tr("Unable to change device."), @@ -108,7 +108,7 @@ void PrefPortaudio::outdevChangeDev(int index) { QString result; int dev = _ui->PaRingdevCombo->itemData(index, Qt::UserRole).toInt(); - if (g_FSHost.sendCmd("pa", QString("outdev #%1").arg(dev).toAscii().constData(), &result) != SWITCH_STATUS_SUCCESS) + if (g_FSHost->sendCmd("pa", QString("outdev #%1").arg(dev).toAscii().constData(), &result) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error setting outdev to #%d on mod_portaudio!\n", dev); QMessageBox::critical(0, tr("Unable to change device."), @@ -173,7 +173,7 @@ void PrefPortaudio::writeConfig() sample_rate != nsample_rate|| codec_ms != ncodec_ms) { - if (g_FSHost.sendCmd("reload", "mod_portaudio", &result) == SWITCH_STATUS_SUCCESS) + if (g_FSHost->sendCmd("reload", "mod_portaudio", &result) == SWITCH_STATUS_SUCCESS) { _settings->setValue("cid-name", ncid_name); _settings->setValue("cid-num", ncid_num); @@ -201,7 +201,7 @@ void PrefPortaudio::writeConfig() if (nindev != indev) { - if (g_FSHost.sendCmd("pa", QString("indev #%1").arg(nindev).toAscii().constData(), &result) == SWITCH_STATUS_SUCCESS) + if (g_FSHost->sendCmd("pa", QString("indev #%1").arg(nindev).toAscii().constData(), &result) == SWITCH_STATUS_SUCCESS) { _settings->setValue("indev", nindev); } @@ -252,7 +252,7 @@ void PrefPortaudio::getPaDevlist() int errorLine, errorColumn; QString errorMsg; - if (g_FSHost.sendCmd("pa", "devlist xml", &result) != SWITCH_STATUS_SUCCESS) + if (g_FSHost->sendCmd("pa", "devlist xml", &result) != SWITCH_STATUS_SUCCESS) { QMessageBox::critical(0, tr("PortAudio error" ), tr("Error querying audio devices."),