提交 721c391a authored 作者: Brian West's avatar Brian West

Let there be PHONE CALLS!



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16142 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 074afad5
# #####################################
# version check qt
# #####################################
contains(QT_VERSION, ^4\.[0-5]\..*) {
message("Cannot build FsGui with Qt version $$QT_VERSION.")
error("Use at least Qt 4.6.")
}
QT += xml
TARGET = fsphone
macx:TARGET = FSPhone
TEMPLATE = app
INCLUDEPATH = ../../../src/include \
../../../libs/apr/include \
../../../libs/libteletone/src
LIBS = -L../../../.libs \
-lfreeswitch \
-lm
!win32:!macx {
# This is here to comply with the default freeswitch installation
QMAKE_LFLAGS += -Wl,-rpath,/usr/local/freeswitch/lib
LIBS += -lcrypt \
-lrt
}
SOURCES += main.cpp \
mainwindow.cpp \
fshost.cpp \
call.cpp \
mod_qsettings/mod_qsettings.cpp \
prefdialog.cpp
HEADERS += mainwindow.h \
fshost.h \
call.h \
mod_qsettings/mod_qsettings.h \
prefdialog.h
FORMS += mainwindow.ui \
prefdialog.ui
RESOURCES += resources.qrc
OTHER_FILES += conf/portaudio.conf.xml \
conf/event_socket.conf.xml \
conf/freeswitch.xml
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2009, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Anthony Minessale II <anthm@freeswitch.org>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Joao Mesquita <jmesquita@freeswitch.org>
*
*/
#include "call.h"
Call::Call()
{
}
Call::Call(int call_id, QString cid_name, QString cid_number, fsphone_call_direction_t direction, QString uuid) :
_call_id(call_id),
_cid_name(cid_name),
_cid_number(cid_number),
_direction(direction),
_uuid (uuid)
{
}
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2009, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Anthony Minessale II <anthm@freeswitch.org>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Joao Mesquita <jmesquita@freeswitch.org>
*
*/
#ifndef CALL_H
#define CALL_H
#include <QtCore>
#include <QString>
#include <fshost.h>
typedef enum {
FSPHONE_CALL_STATE_RINGING = 0,
FSPHONE_CALL_STATE_TRYING = 1,
FSPHONE_CALL_STATE_ANSWERED = 2
} fsphone_call_state_t;
typedef enum {
FSPHONE_CALL_DIRECTION_INBOUND = 0,
FSPHONE_CALL_DIRECTION_OUTBOUND = 1
} fsphone_call_direction_t;
class Call
{
public:
Call(void);
Call(int call_id, QString cid_name, QString cid_number, fsphone_call_direction_t direction, QString uuid);
QString getCidName(void) { return _cid_name; }
QString getCidNumber(void) { return _cid_number; }
int getCallID(void) { return _call_id; }
QString getUUID(void) { return _uuid; }
void setbUUID(QString uuid) { _buuid = uuid; }
fsphone_call_direction_t getDirection() { return _direction; }
fsphone_call_state_t getState() { return _state; }
void setState(fsphone_call_state_t state) { _state = state; }
private:
int _call_id;
QString _cid_name;
QString _cid_number;
fsphone_call_direction_t _direction;
QString _uuid;
QString _buuid;
fsphone_call_state_t _state;
};
Q_DECLARE_METATYPE(Call)
#endif // CALL_H
<include>
<!--<gateway name="default">-->
<!--/// account username *required* ///-->
<!--<param name="username" value="cluecon"/>-->
<!--/// auth realm: *optional* same as gateway name, if blank ///-->
<!--<param name="realm" value="asterlink.com"/>-->
<!--/// username to use in from: *optional* same as username, if blank ///-->
<!--<param name="from-user" value="cluecon"/>-->
<!--/// domain to use in from: *optional* same as realm, if blank ///-->
<!--<param name="from-domain" value="asterlink.com"/>-->
<!--/// account password *required* ///-->
<!--<param name="password" value="cluecon"/>-->
<!--/// extension for inbound calls: *optional* same as username, if blank ///-->
<!--<param name="extension" value="cluecon"/>-->
<!--/// proxy host: *optional* same as realm, if blank ///-->
<!--<param name="proxy" value="asterlink.com"/>-->
<!--/// send register to this proxy: *optional* same as proxy, if blank ///-->
<!--<param name="register-proxy" value="mysbc.com"/>-->
<!--/// expire in seconds: *optional* 3600, if blank ///-->
<!--<param name="expire-seconds" value="60"/>-->
<!--/// do not register ///-->
<!--<param name="register" value="false"/>-->
<!-- which transport to use for register -->
<!--<param name="register-transport" value="udp"/>-->
<!--How many seconds before a retry when a failure or timeout occurs -->
<!--<param name="retry-seconds" value="30"/>-->
<!--Use the callerid of an inbound call in the from field on outbound calls via this gateway -->
<!--<param name="caller-id-in-from" value="false"/>-->
<!--extra sip params to send in the contact-->
<!--<param name="contact-params" value="tport=tcp"/>-->
<!--send an options ping every x seconds, failure will unregister and/or mark it down-->
<!--<param name="ping" value="25"/>-->
<!--</gateway>-->
</include>
<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="8021"/>
<param name="password" value="ClueCon"/>
</settings>
</configuration>
差异被折叠。
<configuration name="portaudio.conf" description="Soundcard Endpoint">
<settings>
<param name="indev" value="${indev}"/>
<!-- device to use for output -->
<param name="outdev" value="${outdev}"/>
<!--<param name="ringdev" value="${ringdev}"/>-->
<param name="ring-file" value="${ring-file}"/>
<param name="ring-interval" value="${ring-interval}"/>
<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>
差异被折叠。
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2009, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Anthony Minessale II <anthm@freeswitch.org>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Joao Mesquita <jmesquita@freeswitch.org>
*
*/
#ifndef FSHOST_H
#define FSHOST_H
#include <QThread>
#include <QHash>
#include <switch.h>
class Call;
#define FSPHONE_GW_STATE_TRYING 0
#define FSPHONE_GW_STATE_REGISTER 1
#define FSPHONE_GW_STATE_REGED 2
#define FSPHONE_GW_STATE_UNREGED 3
#define FSPHONE_GW_STATE_UNREGISTER 4
#define FSPHONE_GW_STATE_FAILED 5
#define FSPHONE_GW_STATE_FAIL_WAIT 6
#define FSPHONE_GW_STATE_EXPIRED 7
#define FSPHONE_GW_STATE_NOREG 8
static const char *fsphone_gw_state_names[] = {
"TRYING",
"REGISTER",
"REGED",
"UNREGED",
"UNREGISTER",
"FAILED",
"FAIL_WAIT",
"EXPIRED",
"NOREG"
};
class FSHost : public QThread
{
Q_OBJECT
public:
explicit FSHost(QObject *parent = 0);
switch_status_t sendCmd(const char *cmd, const char *args, QString *res);
void generalEventHandler(switch_event_t *event);
Call * getCallByUUID(QString uuid) { return _active_calls.value(uuid, NULL); }
QString getGwStateName(int id) { return fsphone_gw_state_names[id]; }
protected:
void run(void);
signals:
void coreLoadingError(QString);
void ready(void);
void ringing(QString);
void answered(QString);
void newOutgoingCall(QString);
void callFailed(QString);
void hungup(Call*);
void gwStateChange(QString, int);
private:
switch_status_t processBlegEvent(switch_event_t *, QString);
switch_status_t processAlegEvent(switch_event_t *, QString);
void printEventHeaders(switch_event_t *event);
QHash<QString, Call*> _active_calls;
QHash<QString, QString> _bleg_uuids;
};
extern FSHost g_FSHost;
/*
Used to match callback from fs core. We dup the event and call the class
method callback to make use of the signal/slot infrastructure.
*/
static void eventHandlerCallback(switch_event_t *event)
{
switch_event_t *clone = NULL;
if (switch_event_dup(&clone, event) == SWITCH_STATUS_SUCCESS) {
g_FSHost.generalEventHandler(clone);
}
switch_safe_free(clone);
}
#endif // FSHOST_H
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2009, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Anthony Minessale II <anthm@freeswitch.org>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Joao Mesquita <jmesquita@freeswitch.org>
*
*/
#include <QtGui/QApplication>
#include <QSplashScreen>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QCoreApplication::setOrganizationName("FreeSWITCH");
QCoreApplication::setOrganizationDomain("freeswitch.org");
QCoreApplication::setApplicationName("FSPhone");
QPixmap image(":/images/splash.png");
QSplashScreen *splash = new QSplashScreen(image);
splash->show();
splash->showMessage("Loading, please wait...", Qt::AlignRight|Qt::AlignBottom, Qt::blue);
QObject::connect(&g_FSHost, SIGNAL(ready()), splash, SLOT(close()));
MainWindow w;
QObject::connect(&g_FSHost, SIGNAL(ready()), &w, SLOT(show()));
g_FSHost.start();
return a.exec();
}
差异被折叠。
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2009, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Anthony Minessale II <anthm@freeswitch.org>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Joao Mesquita <jmesquita@freeswitch.org>
*
*/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QListWidgetItem>
#include <QSignalMapper>
#include <switch.h>
#include <fshost.h>
#include <call.h>
#include <prefdialog.h>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow {
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
protected:
void changeEvent(QEvent *e);
signals:
void dtmfDialed(QString);
private slots:
void prefTriggered();
void coreLoadingError(QString);
void gwStateChanged(QString, int);
void dialDTMF(QString);
void callListDoubleClick(QListWidgetItem *);
void makeCall();
void fshostReady();
void paAnswer();
void paCall(QString);
void paHangup();
void newOutgoingCall(QString);
void ringing(QString);
void answered(QString);
void hungup(Call*);
private:
Ui::MainWindow *ui;
QSignalMapper *dialpadMapper;
PrefDialog *preferences;
};
#endif // MAINWINDOW_H
差异被折叠。
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2009, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Anthony Minessale II <anthm@freeswitch.org>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Joao Mesquita <jmesquita@freeswitch.org>
*
*
* Description:
* Module to load configurations from Qt preference system QSettings
*
*/
#include <QString>
#include <QtGui>
#include <QDir>
#include "mod_qsettings/mod_qsettings.h"
static struct {
switch_memory_pool_t* pool;
} globals;
switch_xml_t XMLBinding::getConfigXML(QString tmpl)
{
switch_event_t *e;
switch_event_create_plain(&e, SWITCH_EVENT_REQUEST_PARAMS);
switch_assert(e);
QFile tmplFile(QString("%1/templates/%2.xml").arg(QApplication::applicationDirPath(),tmpl));
if (!tmplFile.exists()) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
"Template %s.xml, doesn't exist on directory, falling back to embedded template.\n",
tmpl.toAscii().constData());
tmplFile.setFileName(QString(":/confs/%1.xml").arg(tmpl));
return NULL;
}
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());
return NULL;
}
/* Open template file and expand all strings based on QSettings */
QString tmplContents(tmplFile.readAll());
tmplFile.close();
_settings->beginGroup("FreeSIWTCH/conf");
_settings->beginGroup(tmpl);
foreach(QString k, _settings->childKeys())
{
switch_event_add_header_string(e, SWITCH_STACK_BOTTOM, k.toAscii().constData(), _settings->value(k).toByteArray().constData());
}
char *res = switch_event_expand_headers(e, tmplContents.toAscii().constData());
switch_safe_free(e);
return switch_xml_parse_str(res, strlen(res));
}
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,
void *user_data)
{
XMLBinding *binding = (XMLBinding *) user_data;
if (!binding) {
return NULL;
}
return binding->getConfigXML(key_value);
}
static switch_status_t do_config(void)
{
char *cf = "qsettings.conf";
switch_xml_t cfg, xml, bindings_tag;
XMLBinding *binding = NULL;
if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
return SWITCH_STATUS_TERM;
}
if (!(bindings_tag = switch_xml_child(cfg, "bindings"))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing <bindings> tag!\n");
switch_xml_free(xml);
return SWITCH_STATUS_FALSE;
}
QString bind_mask = switch_xml_attr_soft(bindings_tag, "value");
if (!bind_mask.isEmpty())
{
binding = new XMLBinding(bind_mask);
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Binding XML Fetch Function [%s]\n",
binding->getBinding().isEmpty() ? "all" : binding->getBinding().toAscii().constData());
switch_xml_bind_search_function(xml_url_fetch, switch_xml_parse_section_string(binding->getBinding().toAscii().constData()), binding);
binding = NULL;
switch_xml_free(xml);
return SWITCH_STATUS_SUCCESS;
}
SWITCH_MODULE_LOAD_FUNCTION(mod_qsettings_load)
{
/*switch_api_interface_t *qsettings_api_interface;*/
/* connect my internal structure to the blank pointer passed to me */
*module_interface = switch_loadable_module_create_module_interface(pool, "mod_qsettings");
memset(&globals,0,sizeof(globals));
globals.pool = pool;
if (do_config() == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Sucessfully configured.\n");
} else {
return SWITCH_STATUS_FALSE;
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "We loaded mod_qsettings.\n");
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
}
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_qsettings_shutdown)
{
switch_xml_unbind_search_function_ptr(xml_url_fetch);
return SWITCH_STATUS_SUCCESS;
}
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2009, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Anthony Minessale II <anthm@freeswitch.org>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Joao Mesquita <jmesquita@freeswitch.org>
*
*/
#ifndef MOD_QSETTINGS_H
#define MOD_QSETTINGS_H
#include <QString>
#include <QSettings>
#include <switch.h>
SWITCH_MODULE_LOAD_FUNCTION(mod_qsettings_load);
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_qsettings_shutdown);
class XMLBinding
{
public:
XMLBinding(QString binding) : _binding(binding), _settings(new QSettings) {}
QString getBinding(void) { return _binding; }
switch_xml_t getConfigXML(QString);
private:
QString _binding;
QSettings* _settings;
};
#endif // MOD_QSETTINGS_H
#include <QtGui>
#include "prefdialog.h"
#include "ui_prefdialog.h"
PrefDialog::PrefDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::PrefDialog)
{
ui->setupUi(this);
getPaDevlist();
}
PrefDialog::~PrefDialog()
{
delete ui;
}
void PrefDialog::getPaDevlist()
{
QString result;
int errorLine, errorColumn;
QString errorMsg;
if (g_FSHost.sendCmd("pa", "devlist xml", &result) != SWITCH_STATUS_SUCCESS)
{
QMessageBox::critical(this, tr("PortAudio error" ),
tr("Error querying audio devices."),
QMessageBox::Ok);
return;
}
if (!_xmlPaDevList.setContent(result, &errorMsg, &errorLine, &errorColumn))
{
QMessageBox::critical(this, tr("PortAudio error" ),
tr("Error parsing output xml from pa devlist.\n%1 (Line:%2, Col:%3).").arg(errorMsg,
errorLine,
errorColumn),
QMessageBox::Ok);
return;
}
QDomElement root = _xmlPaDevList.documentElement();
if (root.tagName() != "xml")
{
QMessageBox::critical(this, tr("PortAudio error" ),
tr("Error parsing output xml from pa devlist. Root tag is not <xml>."),
QMessageBox::Ok);
return;
}
QDomElement devices = root.firstChildElement("devices");
if (devices.isNull())
{
QMessageBox::critical(this, tr("PortAudio error" ),
tr("Error parsing output xml from pa devlist. There is no <devices> tag."),
QMessageBox::Ok);
return;
}
QDomElement child = devices.firstChildElement();
if (child.isNull())
{
QMessageBox::critical(this, tr("PortAudio error" ),
tr("Error parsing output xml from pa devlist. There is no <device> tag."),
QMessageBox::Ok);
return;
}
while (!child.isNull())
{
if (child.tagName() == "device")
{
QString id, name, inputs, outputs;
id = child.attribute("id","-1");
name = child.attribute("name","Null");
inputs = child.attribute("inputs","0");
outputs = child.attribute("outputs","0");
if (inputs.toInt() != 0)
ui->PaIndevCombo->addItem(name,inputs.toInt());
if (outputs.toInt() != 0)
{
ui->PaOutdevCombo->addItem(name,inputs.toInt());
ui->PaRingdevCombo->addItem(name,inputs.toInt());
}
}
child = child.nextSiblingElement();
}
QDomElement bindings = root.firstChildElement("bindings");
if (bindings.isNull())
{
QMessageBox::critical(this, tr("PortAudio error" ),
tr("Error parsing output xml from pa devlist. There is no <bindings> tag."),
QMessageBox::Ok);
return;
}
child = devices.firstChildElement();
if (child.isNull())
{
QMessageBox::critical(this, tr("PortAudio error" ),
tr("Error parsing output xml from pa devlist. There are no bindings."),
QMessageBox::Ok);
return;
}
while (!child.isNull())
{
QString id;
id = child.attribute("device","-1");
if (child.tagName() == "ring")
ui->PaRingdevCombo->setCurrentIndex(id.toInt());
else if (child.tagName() == "input")
ui->PaIndevCombo->setCurrentIndex(id.toInt());
else if (child.tagName() == "ring")
ui->PaOutdevCombo->setCurrentIndex(id.toInt());
child = child.nextSiblingElement();
}
}
void PrefDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
#ifndef PREFDIALOG_H
#define PREFDIALOG_H
#include <QDialog>
#include <QDomDocument>
#include <fshost.h>
namespace Ui {
class PrefDialog;
}
class PrefDialog : public QDialog {
Q_OBJECT
public:
PrefDialog(QWidget *parent = 0);
~PrefDialog();
protected:
void changeEvent(QEvent *e);
private:
void getPaDevlist(void);
Ui::PrefDialog *ui;
QDomDocument _xmlPaDevList;
};
#endif // PREFDIALOG_H
差异被折叠。
<RCC>
<qresource prefix="/images">
<file alias="splash.png">resources/splash.png</file>
<file alias="pref_sip.png">resources/pref_sip.png</file>
<file alias="pref_audio.gif">resources/pref_audio.gif</file>
</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>
</qresource>
</RCC>
This diff was suppressed by a .gitattributes entry.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论