Commit 135cfe7d authored by Adrien Béraud's avatar Adrien Béraud Committed by Guillaume Roguez
Browse files

call: emit signal on removal

The "OVER" event is the point in time from which the daemon won't know
about this call ID anymore.
There is always exactly one OVER event when a call is removed.

Tuleap: #102
Change-Id: Id11b9047b27c33258b731f7843fd7241e4c7c07f
parent 70c84b35
......@@ -56,8 +56,10 @@ Call::~Call()
void
Call::removeCall()
{
auto this_ = shared_from_this();
Manager::instance().callFactory.removeCall(*this);
iceTransport_.reset();
setState(CallState::OVER);
}
const std::string&
......@@ -86,6 +88,11 @@ Call::validStateTransition(CallState newState)
// Notice to developper:
// - list only permitted transition (return true)
// - let non permitted ones as default case (return false)
// always permited
if (newState == CallState::OVER)
return true;
switch (callState_) {
case CallState::INACTIVE:
switch (newState) {
......@@ -219,6 +226,9 @@ Call::getStateStr() const
return StateEvent::INACTIVE;
}
case CallState::OVER:
return StateEvent::OVER;
case CallState::MERROR:
default:
return StateEvent::FAILURE;
......
......@@ -84,7 +84,7 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> {
* \note modify validStateTransition/getStateStr if this enum changes
*/
enum class CallState : unsigned {
INACTIVE, ACTIVE, HOLD, BUSY, MERROR, COUNT__
INACTIVE, ACTIVE, HOLD, BUSY, MERROR, OVER, COUNT__
};
virtual ~Call();
......
......@@ -36,6 +36,7 @@ constexpr static char FAILURE [] = "FAILURE" ;
constexpr static char HOLD [] = "HOLD" ;
constexpr static char UNHOLD [] = "UNHOLD" ;
constexpr static char INACTIVE [] = "INACTIVE" ;
constexpr static char OVER [] = "OVER" ;
}
......
Supports Markdown
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