Skip to content
Snippets Groups Projects
Commit 25aa4a38 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Terminate only one call

Conflicts:

	src/sipvoiplink.cpp
parent 4b6b752c
No related branches found
No related tags found
No related merge requests found
......@@ -230,6 +230,23 @@ SIPVoIPLink::terminateSIPCall()
_callMap.clear();
}
void
SIPVoIPLink::terminateOneCall(const CallID& id)
{
_debug("SIPVoIPLink::terminateOneCall(): function called \n");
SIPCall *call;
call = getSIPCall(id);
if (call) {
// terminate the sip call
_debug("SIPVoIPLink::terminateOneCall()::the call is deleted, should close recording file \n");
delete call; call = 0;
}
}
void
SIPVoIPLink::getEvent()
{
......@@ -455,6 +472,7 @@ SIPVoIPLink::answer(const CallID& id)
_debug("! SIP Failure: Unable to start sound when answering %s/%d\n", __FILE__, __LINE__);
}
}
terminateOneCall(call->getCallId());
removeCall(call->getCallId());
return false;
}
......@@ -490,8 +508,7 @@ SIPVoIPLink::hangup(const CallID& id)
_audiortp->closeRtpSession();
}
terminateSIPCall();
terminateOneCall(id);
removeCall(id);
return true;
......@@ -505,6 +522,7 @@ SIPVoIPLink::cancel(const CallID& id)
_debug("- SIP Action: Cancel call %s [cid: %3d]\n", id.data(), call->getCid());
terminateOneCall(id);
removeCall(id);
return true;
......@@ -717,7 +735,7 @@ SIPVoIPLink::refuse (const CallID& id)
call->getInvSession()->mod_data[getModId()] = NULL;
terminateSIPCall();
terminateOneCall(id);
return true;
}
......@@ -922,12 +940,17 @@ std::string SIPVoIPLink::getSipTo(const std::string& to_url, std::string hostnam
_debug("Server error!\n");
CallID id = call->getCallId();
Manager::instance().callFailure(id);
terminateOneCall(id);
removeCall(id);
}
//break;
//}
}
void
SIPVoIPLink::SIPCallClosed(SIPCall *call)
{
void
SIPVoIPLink::SIPCallClosed(SIPCall *call)
{
......@@ -944,6 +967,7 @@ std::string SIPVoIPLink::getSipTo(const std::string& to_url, std::string hostnam
}
_debug("After close RTP\n");
Manager::instance().peerHungupCall(id);
terminateOneCall(id);
removeCall(id);
_debug("After remove call ID\n");
}
......@@ -960,6 +984,7 @@ std::string SIPVoIPLink::getSipTo(const std::string& to_url, std::string hostnam
_debug("SIP call release\n");
CallID id = call->getCallId();
Manager::instance().callFailure(id);
terminateOneCall(id);
removeCall(id);
}
......
......@@ -192,6 +192,11 @@ class SIPVoIPLink : public VoIPLink
*/
void terminateSIPCall();
/**
* Terminate only one call
*/
void terminateOneCall(const CallID& id);
/**
* Build a sip address with the number that you want to call
* Example: sip:124@domain.com
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment