Commit 179ee222 authored by Ming Rui Zhang's avatar Ming Rui Zhang Committed by Andreas Traczyk

advancedSISettings: add SDP session negotiation sector to control SDP port range

Change-Id: Iaa9c70e9d71aa6de2eb6fe849e5fac59db3fa8e1
parent ffae0a80
...@@ -221,6 +221,18 @@ void AdvancedSIPSettingsWidget::updateAdvancedSIPSettings() ...@@ -221,6 +221,18 @@ void AdvancedSIPSettingsWidget::updateAdvancedSIPSettings()
ui->btnRingtoneSIP->setEnabled(config.Ringtone.ringtoneEnabled); ui->btnRingtoneSIP->setEnabled(config.Ringtone.ringtoneEnabled);
ui->btnRingtoneSIP->setText(QFileInfo(QString::fromStdString(config.Ringtone.ringtonePath)).fileName()); ui->btnRingtoneSIP->setText(QFileInfo(QString::fromStdString(config.Ringtone.ringtonePath)).fileName());
ui->lineEditSTUNAddressSIP->setEnabled(config.STUN.enable); ui->lineEditSTUNAddressSIP->setEnabled(config.STUN.enable);
// SDP session negotiation ports
ui->audioRTPMinPortSpinBox->setValue(config.Audio.audioPortMin);
ui->audioRTPMaxPortSpinBox->setValue(config.Audio.audioPortMax);
ui->videoRTPMinPortSpinBox->setValue(config.Video.videoPortMin);
ui->videoRTPMaxPortSpinBox->setValue(config.Video.videoPortMax);
connect(ui->audioRTPMinPortSpinBox, &QSpinBox::editingFinished, this, &AdvancedSIPSettingsWidget::audioRTPMinPortSpinBoxEditFinished);
connect(ui->audioRTPMaxPortSpinBox, &QSpinBox::editingFinished, this, &AdvancedSIPSettingsWidget::audioRTPMaxPortSpinBoxEditFinished);
connect(ui->videoRTPMinPortSpinBox, &QSpinBox::editingFinished, this, &AdvancedSIPSettingsWidget::videoRTPMinPortSpinBoxEditFinished);
connect(ui->videoRTPMaxPortSpinBox, &QSpinBox::editingFinished, this, &AdvancedSIPSettingsWidget::videoRTPMaxPortSpinBoxEditFinished);
} }
// call settings // call settings
...@@ -617,3 +629,51 @@ AdvancedSIPSettingsWidget::customPortSIPSpinBoxValueChanged(const int& value) ...@@ -617,3 +629,51 @@ AdvancedSIPSettingsWidget::customPortSIPSpinBoxValueChanged(const int& value)
confProps.publishedPort = value; confProps.publishedPort = value;
LRCInstance::accountModel().setAccountConfig(LRCInstance::getCurrAccId(), confProps); LRCInstance::accountModel().setAccountConfig(LRCInstance::getCurrAccId(), confProps);
} }
void
AdvancedSIPSettingsWidget::audioRTPMinPortSpinBoxEditFinished()
{
auto confProps = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId());
if (confProps.Audio.audioPortMax < ui->audioRTPMinPortSpinBox->value()) {
ui->audioRTPMinPortSpinBox->setValue(confProps.Audio.audioPortMin);
return;
}
confProps.Audio.audioPortMin = ui->audioRTPMinPortSpinBox->value();
LRCInstance::accountModel().setAccountConfig(LRCInstance::getCurrAccId(), confProps);
}
void
AdvancedSIPSettingsWidget::audioRTPMaxPortSpinBoxEditFinished()
{
auto confProps = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId());
if (ui->audioRTPMaxPortSpinBox->value() < confProps.Audio.audioPortMin) {
ui->audioRTPMaxPortSpinBox->setValue(confProps.Audio.audioPortMax);
return;
}
confProps.Audio.audioPortMax = ui->audioRTPMaxPortSpinBox->value();
LRCInstance::accountModel().setAccountConfig(LRCInstance::getCurrAccId(), confProps);
}
void
AdvancedSIPSettingsWidget::videoRTPMinPortSpinBoxEditFinished()
{
auto confProps = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId());
if (confProps.Video.videoPortMax < ui->videoRTPMinPortSpinBox->value()) {
ui->videoRTPMinPortSpinBox->setValue(confProps.Video.videoPortMin);
return;
}
confProps.Video.videoPortMin = ui->videoRTPMinPortSpinBox->value();
LRCInstance::accountModel().setAccountConfig(LRCInstance::getCurrAccId(), confProps);
}
void
AdvancedSIPSettingsWidget::videoRTPMaxPortSpinBoxEditFinished()
{
auto confProps = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId());
if (ui->videoRTPMaxPortSpinBox->value() < confProps.Video.videoPortMin) {
ui->videoRTPMaxPortSpinBox->setValue(confProps.Video.videoPortMax);
return;
}
confProps.Video.videoPortMax = ui->videoRTPMaxPortSpinBox->value();
LRCInstance::accountModel().setAccountConfig(LRCInstance::getCurrAccId(), confProps);
}
...@@ -105,4 +105,10 @@ private slots: ...@@ -105,4 +105,10 @@ private slots:
void increaseVideoCodecPriority(); void increaseVideoCodecPriority();
void setVideoState(int state); void setVideoState(int state);
// SDP session negotiation ports
void audioRTPMinPortSpinBoxEditFinished();
void audioRTPMaxPortSpinBoxEditFinished();
void videoRTPMinPortSpinBoxEditFinished();
void videoRTPMaxPortSpinBoxEditFinished();
}; };
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>731</width> <width>731</width>
<height>1532</height> <height>1775</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
...@@ -1231,7 +1231,7 @@ ...@@ -1231,7 +1231,7 @@
</font> </font>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>65536</number> <number>65535</number>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -1704,6 +1704,232 @@ ...@@ -1704,6 +1704,232 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<spacer name="verticalSpacer_12">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_8">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<pointsize>13</pointsize>
</font>
</property>
<property name="text">
<string>SDP Session Negotiation (ICE Fallback)</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_16">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Only used during SDP negotiation in case ICE is not supported</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_11">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_18">
<property name="leftMargin">
<number>20</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<item>
<layout class="QGridLayout" name="gridLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_30">
<item>
<widget class="QLabel" name="label_26">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Audio RTP Max Port</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_21">
<item>
<widget class="QLabel" name="label_15">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Video RTP Max Port</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="audioRTPMaxPortSpinBox">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="maximum">
<number>65535</number>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QSpinBox" name="audioRTPMinPortSpinBox">
<property name="minimumSize">
<size>
<width>300</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="maximum">
<number>65535</number>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QSpinBox" name="videoRTPMinPortSpinBox">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="maximum">
<number>65535</number>
</property>
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_19">
<item>
<widget class="QLabel" name="label_13">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Video RTP Min Port</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_32">
<item>
<widget class="QLabel" name="label_29">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Audio RTP Min Port</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="2">
<widget class="QSpinBox" name="videoRTPMaxPortSpinBox">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="maximum">
<number>65535</number>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
<item> <item>
<spacer name="verticalSpacer_3"> <spacer name="verticalSpacer_3">
<property name="orientation"> <property name="orientation">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment