sip: handle sip messages during multi-device ringing

Change-Id: I5bb43cf1506adc1a11f0af899b07b540bae52bf9
Tuleap: #938
This commit is contained in:
Adrien Béraud
2016-10-18 16:59:53 -04:00
parent e999636120
commit b384ccebae
4 changed files with 16 additions and 10 deletions

View File

@ -361,6 +361,15 @@ Call::newIceSocket(unsigned compId)
return std::unique_ptr<IceSocket> {new IceSocket(iceTransport_, compId)};
}
void
Call::onTextMessage(std::map<std::string, std::string>&& messages)
{
if (quiet)
pendingMessages_.emplace_back(std::move(messages), "");
else
Manager::instance().incomingMessage(getCallId(), getPeerNumber(), messages);
}
void
Call::peerHungup()
{

View File

@ -310,9 +310,9 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> {
const std::string &from) = 0;
virtual void onTextMessage(const std::map<std::string, std::string>& messages) = 0;
void onTextMessage(std::map<std::string, std::string>&& messages);
void removeCall();
virtual void removeCall();
virtual bool initIceTransport(bool master, unsigned channel_num=4);

View File

@ -678,12 +678,11 @@ SIPCall::sendTextMessage(const std::map<std::string, std::string>& messages,
}
void
SIPCall::onTextMessage(const std::map<std::string, std::string>& messages)
SIPCall::removeCall()
{
if (quiet)
pendingMessages_.emplace_back(messages, "");
else
Manager::instance().incomingMessage(getCallId(), getPeerNumber(), messages);
Call::removeCall();
inv.reset();
setTransport({});
}
void
@ -692,7 +691,6 @@ SIPCall::onFailure(signed cause)
setState(CallState::MERROR, ConnectionState::DISCONNECTED, cause);
Manager::instance().callFailure(*this);
removeCall();
setTransport({});
}
void
@ -701,7 +699,6 @@ SIPCall::onClosed()
Manager::instance().peerHungupCall(*this);
removeCall();
Manager::instance().checkAudio();
setTransport({});
}
void

View File

@ -159,7 +159,7 @@ class SIPCall : public Call
void sendTextMessage(const std::map<std::string, std::string>& messages,
const std::string& from) override;
void onTextMessage(const std::map<std::string, std::string>& messages) override;
void removeCall() override;
SIPAccountBase& getSIPAccount() const;