Commit 054f3907 authored by Sylvain Berfini's avatar Sylvain Berfini

Added declined call reason in ended call window

parent 28ae7fe7
...@@ -252,6 +252,22 @@ ...@@ -252,6 +252,22 @@
<source>iceStateInvalid</source> <source>iceStateInvalid</source>
<translation>Invalid</translation> <translation>Invalid</translation>
</message> </message>
<message>
<source>User declined the call</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>User not found</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>User is busy</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Incompatible media params</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>CallStatistics</name> <name>CallStatistics</name>
......
...@@ -252,6 +252,22 @@ ...@@ -252,6 +252,22 @@
<source>iceStateInvalid</source> <source>iceStateInvalid</source>
<translation>Invalide</translation> <translation>Invalide</translation>
</message> </message>
<message>
<source>User declined the call</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>User not found</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>User is busy</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Incompatible media params</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>CallStatistics</name> <name>CallStatistics</name>
......
...@@ -40,6 +40,7 @@ CallModel::CallModel (shared_ptr<linphone::Call> call) { ...@@ -40,6 +40,7 @@ CallModel::CallModel (shared_ptr<linphone::Call> call) {
Q_ASSERT(call != nullptr); Q_ASSERT(call != nullptr);
mCall = call; mCall = call;
mCall->setData("call-model", *this); mCall->setData("call-model", *this);
mReason = "";
// Deal with auto-answer. // Deal with auto-answer.
{ {
...@@ -63,8 +64,9 @@ CallModel::CallModel (shared_ptr<linphone::Call> call) { ...@@ -63,8 +64,9 @@ CallModel::CallModel (shared_ptr<linphone::Call> call) {
return; return;
switch (state) { switch (state) {
case linphone::CallStateEnd:
case linphone::CallStateError: case linphone::CallStateError:
setReason(call->getReason());
case linphone::CallStateEnd:
stopAutoAnswerTimer(); stopAutoAnswerTimer();
mPausedByRemote = false; mPausedByRemote = false;
break; break;
...@@ -284,6 +286,31 @@ CallModel::CallStatus CallModel::getStatus () const { ...@@ -284,6 +286,31 @@ CallModel::CallStatus CallModel::getStatus () const {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void CallModel::setReason (linphone::Reason reason) {
switch (reason) {
case linphone::ReasonDeclined:
mReason = tr("User declined the call");
break;
case linphone::ReasonNotFound:
mReason = tr("User not found");
break;
case linphone::ReasonBusy:
mReason = tr("User is busy");
break;
case linphone::ReasonNotAcceptable:
mReason = tr("Incompatible media params");
break;
default:
break;
}
}
QString CallModel::getReason () const {
return mReason;
}
// -----------------------------------------------------------------------------
int CallModel::getDuration () const { int CallModel::getDuration () const {
return mCall->getDuration(); return mCall->getDuration();
} }
......
...@@ -33,6 +33,7 @@ class CallModel : public QObject { ...@@ -33,6 +33,7 @@ class CallModel : public QObject {
Q_PROPERTY(QString sipAddress READ getSipAddress CONSTANT); Q_PROPERTY(QString sipAddress READ getSipAddress CONSTANT);
Q_PROPERTY(CallStatus status READ getStatus NOTIFY statusChanged); Q_PROPERTY(CallStatus status READ getStatus NOTIFY statusChanged);
Q_PROPERTY(QString reason READ getReason NOTIFY statusChanged);
Q_PROPERTY(bool isOutgoing READ isOutgoing CONSTANT); Q_PROPERTY(bool isOutgoing READ isOutgoing CONSTANT);
...@@ -106,6 +107,10 @@ private: ...@@ -106,6 +107,10 @@ private:
return mCall->getDir() == linphone::CallDirOutgoing; return mCall->getDir() == linphone::CallDirOutgoing;
} }
QString mReason;
void setReason (linphone::Reason reason);
QString getReason () const;
int getDuration () const; int getDuration () const;
float getQuality () const; float getQuality () const;
float getMicroVu () const; float getMicroVu () const;
......
...@@ -75,6 +75,19 @@ Rectangle { ...@@ -75,6 +75,19 @@ Rectangle {
Item { Item {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: CallStyle.actionArea.height Layout.preferredHeight: CallStyle.actionArea.height
Text {
width: parent.width
color: CallStyle.header.reason.color
font.pointSize: CallStyle.header.reason.fontSize
horizontalAlignment: Text.AlignHCenter
text: {
var call = endedCall.call
return call.reason
}
}
} }
} }
} }
...@@ -70,5 +70,10 @@ QtObject { ...@@ -70,5 +70,10 @@ QtObject {
property QtObject stats: QtObject { property QtObject stats: QtObject {
property int relativeY: 90 property int relativeY: 90
} }
property QtObject reason: QtObject {
property color color: Colors.i
property int fontSize: 12
}
} }
} }
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