mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Cancel sent CallInvite if no response within expiry
This commit is contained in:
parent
a4301048e3
commit
d51e34e66a
1 changed files with 8 additions and 1 deletions
|
@ -41,6 +41,14 @@ CallManager::CallManager(QSharedPointer<UserSettings> userSettings)
|
||||||
nhlog::ui()->debug("Offer created with callid_ and roomid_: {} {}", callid_, roomid_.toStdString());
|
nhlog::ui()->debug("Offer created with callid_ and roomid_: {} {}", callid_, roomid_.toStdString());
|
||||||
emit newMessage(roomid_, CallInvite{callid_, sdp, 0, timeoutms_});
|
emit newMessage(roomid_, CallInvite{callid_, sdp, 0, timeoutms_});
|
||||||
emit newMessage(roomid_, CallCandidates{callid_, candidates, 0});
|
emit newMessage(roomid_, CallCandidates{callid_, candidates, 0});
|
||||||
|
|
||||||
|
QTimer::singleShot(timeoutms_, this, [this](){
|
||||||
|
if (session_.state() == WebRTCSession::State::OFFERSENT) {
|
||||||
|
emit newMessage(roomid_, CallHangUp{callid_, 0, CallHangUp::Reason::InviteTimeOut});
|
||||||
|
endCall();
|
||||||
|
emit ChatPage::instance()->showNotification("The remote side failed to pick up.");
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(&session_, &WebRTCSession::answerCreated, this,
|
connect(&session_, &WebRTCSession::answerCreated, this,
|
||||||
|
@ -112,7 +120,6 @@ CallManager::sendInvite(const QString &roomid)
|
||||||
setTurnServers();
|
setTurnServers();
|
||||||
session_.setStunServer(settings_->useStunServer() ? STUN_SERVER : "");
|
session_.setStunServer(settings_->useStunServer() ? STUN_SERVER : "");
|
||||||
|
|
||||||
// TODO Add invite timeout
|
|
||||||
generateCallID();
|
generateCallID();
|
||||||
std::vector<RoomMember> members(cache::getMembers(roomid.toStdString()));
|
std::vector<RoomMember> members(cache::getMembers(roomid.toStdString()));
|
||||||
const RoomMember &callee = members.front().user_id == utils::localUser() ? members.back() : members.front();
|
const RoomMember &callee = members.front().user_id == utils::localUser() ? members.back() : members.front();
|
||||||
|
|
Loading…
Reference in a new issue