- Add a player when receiving a DTMF

- Show keypad on outgoing call to allow sending DTMF before 200
- Update SDK
This commit is contained in:
Julien Wadel 2020-08-14 14:53:41 +02:00
parent 7cb4368a1d
commit 1773e86ca7
7 changed files with 39 additions and 2 deletions

View file

@ -43,7 +43,6 @@ using namespace std;
namespace {
constexpr char AutoAnswerObjectName[] = "auto-answer-timer";
constexpr int DtmfSoundDelay = 200;
}
CallModel::CallModel (shared_ptr<linphone::Call> call) {

View file

@ -133,6 +133,8 @@ public:
Q_INVOKABLE void toggleSpeakerMute();
static constexpr int DtmfSoundDelay = 200;
signals:
void callErrorChanged (const QString &callError);
void isInConferenceChanged (bool status);

View file

@ -132,6 +132,12 @@ void CoreHandlers::onCallCreated(const shared_ptr<linphone::Core> &,
emit callCreated(call);
}
void CoreHandlers::onDtmfReceived(
const std::shared_ptr<linphone::Core> & lc,
const std::shared_ptr<linphone::Call> & call,
int dtmf) {
CoreManager::getInstance()->getCore()->playDtmf((char)dtmf, CallModel::DtmfSoundDelay);
}
void CoreHandlers::onGlobalStateChanged (
const shared_ptr<linphone::Core> &,
linphone::GlobalState gstate,

View file

@ -92,6 +92,11 @@ private:
const std::shared_ptr<linphone::Call> & call
) override;
void onDtmfReceived(
const std::shared_ptr<linphone::Core> & lc,
const std::shared_ptr<linphone::Call> & call,
int dtmf)override;
void onGlobalStateChanged (
const std::shared_ptr<linphone::Core> &core,
linphone::GlobalState gstate,

View file

@ -14,6 +14,7 @@ Rectangle {
default property alias _actionArea: actionArea.data
property var _sipAddressObserver: SipAddressesModel.getSipAddressObserver(call.fullPeerAddress, call.fullLocalAddress)
property alias showKeypad :telKeypadButton.visible
// ---------------------------------------------------------------------------
@ -100,4 +101,27 @@ Rectangle {
Layout.preferredHeight: CallStyle.actionArea.height
}
}
ActionButton {
id:telKeypadButton
icon: 'tel_keypad'
visible:false
onClicked: telKeypad.visible = !telKeypad.visible
anchors.left:parent.left
anchors.top:parent.top
iconSize: CallStyle.header.iconSize
anchors.leftMargin: CallStyle.header.leftMargin
anchors.topMargin: CallStyle.header.topMargin
}
// ---------------------------------------------------------------------------
// TelKeypad.
// ---------------------------------------------------------------------------
TelKeypad {
id: telKeypad
call: parent.call
visible: SettingsModel.showTelKeypadAutomatically
}
}

View file

@ -9,6 +9,7 @@ import App.Styles 1.0
// =============================================================================
AbstractStartingCall {
showKeypad:true
GridLayout {
columns: parent.width < CallStyle.actionArea.lowWidth && call.videoEnabled ? 1 : 2
rowSpacing: ActionBarStyle.spacing

@ -1 +1 @@
Subproject commit c4dc4ab8dada2103c3b0c464ddfaa35cff7f4786
Subproject commit 4fde8b4bd6a839bd8a2ea9aeb99cd4e8a85fda65