Organizing code.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16191 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
João Mesquita 2010-01-07 05:17:52 +00:00
parent 0372de592a
commit a7537a771d
4 changed files with 523 additions and 25 deletions

View File

@ -27,13 +27,15 @@ SOURCES += main.cpp \
call.cpp \
mod_qsettings/mod_qsettings.cpp \
prefdialog.cpp \
prefportaudio.cpp
prefportaudio.cpp \
prefsofia.cpp
HEADERS += mainwindow.h \
fshost.h \
call.h \
mod_qsettings/mod_qsettings.h \
prefdialog.h \
prefportaudio.h
prefportaudio.h \
prefsofia.h
FORMS += mainwindow.ui \
prefdialog.ui
RESOURCES += resources.qrc

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>752</width>
<height>496</height>
<width>839</width>
<height>613</height>
</rect>
</property>
<property name="windowTitle">
@ -87,7 +87,7 @@
<item row="0" column="1">
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="page_3">
<layout class="QVBoxLayout" name="verticalLayout_3">
@ -127,7 +127,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -137,9 +137,12 @@
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Global Settings</string>
<string>Global</string>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
@ -148,7 +151,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="logLevelSpin"/>
<widget class="QSpinBox" name="sofiaLogLevelSpin"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
@ -158,7 +161,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="autoRestartCombo">
<widget class="QComboBox" name="sofiaAutoRestartCombo">
<item>
<property name="text">
<string>true</string>
@ -179,7 +182,7 @@
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="debugPresenceSpin"/>
<widget class="QSpinBox" name="sofiaDebugPresenceSpin"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_15">
@ -189,7 +192,7 @@
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBox">
<widget class="QComboBox" name="sofiaRewriteMulticastedFsPathCombo">
<item>
<property name="text">
<string>false</string>
@ -205,11 +208,82 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_6">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Profile</string>
</property>
<layout class="QFormLayout" name="formLayout_6">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>user-agent-string</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="sofiaUserAgentStringEdit">
<property name="text">
<string>FreeSWITCH/FSComm</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_26">
<property name="text">
<string>hold-music</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="sofiaHoldMusicEdit">
<property name="text">
<string>localstream://moh</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_16">
<property name="text">
<string>context</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="sofiaContextEdit">
<property name="text">
<string>public</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>dialplan</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEdit">
<property name="text">
<string>XML</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Profiles</string>
<string>Network</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
@ -218,15 +292,191 @@
<string>Softphone Profile</string>
</property>
<layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="label_18">
<property name="text">
<string>user-agent-string</string>
<string>sip-port</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="userAgentStringEdit"/>
<widget class="QSpinBox" name="sofiaSipPortSpin">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
<property name="value">
<number>12345</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_22">
<property name="text">
<string>use-rtp-timer</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="sofiaUseRtpTimerCombo">
<item>
<property name="text">
<string>true</string>
</property>
</item>
<item>
<property name="text">
<string>false</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_24">
<property name="text">
<string>rtp-ip</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="sofiaRtpIpEdit">
<property name="text">
<string>$${local_ip_v4}</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_25">
<property name="text">
<string>sip-ip</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="sofiaSipIpEdit">
<property name="text">
<string>$${local_ip_v4}</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>apply-nat-acl</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="sofiaApplyNatAclEdit">
<property name="text">
<string>rfc1918</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_34">
<property name="text">
<string>ext-rtp-ip</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="sofiaExtRtpIpEdit">
<property name="text">
<string>stun:stun.freeswitch.org</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_35">
<property name="text">
<string>ext-sip-ip</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLineEdit" name="sofiaExtSipIpEdit">
<property name="text">
<string>stun:stun.freeswitch.org</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_4">
<attribute name="title">
<string>Codecs</string>
</attribute>
<layout class="QFormLayout" name="formLayout_7">
<item row="0" column="0">
<widget class="QLabel" name="label_21">
<property name="text">
<string>codec-prefs</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="sofiaCodecPrefsEdit">
<property name="text">
<string>CELT@48000h,G7221@32000h,G7221@16000h,G722,PCMU,PCMA,GSM</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_30">
<property name="text">
<string>inbound-codec-negotiation</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="sofiaInboundCodecNegotiationCombo">
<item>
<property name="text">
<string>generous</string>
</property>
</item>
<item>
<property name="text">
<string>greedy</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>Advanced</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QGroupBox" name="groupBox_7">
<property name="title">
<string>Profile</string>
</property>
<layout class="QFormLayout" name="formLayout_8">
<item row="0" column="0">
<widget class="QLabel" name="label_17">
<property name="text">
<string>rfc2833-pt</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="sofiaRfc2833PtEdit">
<property name="text">
<string>101</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
@ -236,7 +486,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="debugSpin"/>
<widget class="QSpinBox" name="sofiaDebugSpin"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_6">
@ -246,7 +496,7 @@
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="sipTraceCombo">
<widget class="QComboBox" name="sofiaSipTraceCombo">
<item>
<property name="text">
<string>false</string>
@ -259,6 +509,204 @@
</item>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_20">
<property name="text">
<string>dtmf-duration</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="spinBox">
<property name="maximum">
<number>1000</number>
</property>
<property name="value">
<number>100</number>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_23">
<property name="text">
<string>rtp-timer-name</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="sofiaRtpTimerNameEdit">
<property name="text">
<string>soft</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_28">
<property name="text">
<string>manage-presence</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="sofiaManagePresenceCombo">
<item>
<property name="text">
<string>false</string>
</property>
</item>
<item>
<property name="text">
<string>true</string>
</property>
</item>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_29">
<property name="text">
<string>max-proceeding</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QSpinBox" name="sofiaMaxProceedingEdit">
<property name="value">
<number>3</number>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_31">
<property name="text">
<string>nonce-ttl</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QSpinBox" name="sofiaNonceTtlSpin">
<property name="value">
<number>60</number>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_36">
<property name="text">
<string>rtp-timeout-sec</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QSpinBox" name="sofiaRtpTimeoutSecSpin">
<property name="maximum">
<number>1000</number>
</property>
<property name="value">
<number>300</number>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_37">
<property name="text">
<string>rtp-hold-timeout-sec</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QSpinBox" name="sofiaRtpHoldTimeoutSecSpin">
<property name="maximum">
<number>5000</number>
</property>
<property name="value">
<number>1800</number>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_32">
<property name="text">
<string>auth-calls</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QComboBox" name="sofiaAuthCallsCombo">
<item>
<property name="text">
<string>false</string>
</property>
</item>
<item>
<property name="text">
<string>true</string>
</property>
</item>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_33">
<property name="text">
<string>auth-all-packets</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QComboBox" name="sofiaAuthAllPacketsCombo">
<item>
<property name="text">
<string>false</string>
</property>
</item>
<item>
<property name="text">
<string>true</string>
</property>
</item>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="label_38">
<property name="text">
<string>disable-register</string>
</property>
</widget>
</item>
<item row="12" column="1">
<widget class="QComboBox" name="sofiaDisableRegisterCombo">
<item>
<property name="text">
<string>true</string>
</property>
</item>
<item>
<property name="text">
<string>false</string>
</property>
</item>
</widget>
</item>
<item row="13" column="0">
<widget class="QLabel" name="label_39">
<property name="text">
<string>challenge-realm</string>
</property>
</widget>
</item>
<item row="13" column="1">
<widget class="QComboBox" name="sofiaChallengeRealmCombo">
<item>
<property name="text">
<string>auto_from</string>
</property>
</item>
<item>
<property name="text">
<string>auto_to</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>

View File

@ -0,0 +1,25 @@
#include <QtGui>
#include <fshost.h>
#include "prefsofia.h"
PrefSofia::PrefSofia(Ui::PrefDialog *ui, QObject *parent) :
QObject(parent),
_ui(ui)
{
_settings = new QSettings();
}
void PrefSofia::readConfig()
{
}
void PrefSofia::writeConfig()
{
_settings->beginGroup("FreeSWITCH/conf");
_settings->beginGroup("sofia.conf");
_settings->endGroup();
_settings->endGroup();
}

View File

@ -0,0 +1,23 @@
#ifndef PREFSOFIA_H
#define PREFSOFIA_H
#include <QObject>
#include "ui_prefdialog.h"
class QSettings;
class PrefSofia : public QObject
{
Q_OBJECT
public:
explicit PrefSofia(Ui::PrefDialog *ui, QObject *parent = 0);
void writeConfig();
void readConfig();
private:
QSettings *_settings;
Ui::PrefDialog *_ui;
};
#endif // PREFSOFIA_H