Commit 97c84363 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Function terminateSIPCall added in sipvoiplink and managerimpl

Conflicts:

	src/audio/audiortp.cpp
	src/sipvoiplink.cpp
parent 48e1e942
......@@ -126,7 +126,6 @@ AudioRtpRTX::~AudioRtpRTX () {
_debugException("! ARTP: Thread destructor didn't terminate correctly");
throw;
}
//_debug("terminate audiortprtx ended...\n");
_ca = 0;
if (!_sym) {
delete _sessionRecv; _sessionRecv = NULL;
......@@ -145,6 +144,7 @@ AudioRtpRTX::~AudioRtpRTX () {
delete time; time = NULL;
delete converter; converter = NULL;
}
void
......
......@@ -249,6 +249,7 @@ ManagerImpl::answerCall(const CallID& id)
bool
ManagerImpl::hangupCall(const CallID& id)
{
_debug("ManagerImpl::hangupCall(): This function is called when user hangup \n");
PulseLayer *pulselayer;
AccountID accountid;
bool returnValue;
......@@ -370,6 +371,7 @@ ManagerImpl::transferCall(const CallID& id, const std::string& to)
bool
ManagerImpl::refuseCall (const CallID& id)
{
_debug("ManagerImpl::refuseCall(): method called");
stopTone(true);
AccountID accountid = getAccountFromCall( id );
if (accountid == AccountNULL) {
......@@ -632,8 +634,10 @@ ManagerImpl::peerRingingCall(const CallID& id)
void
ManagerImpl::peerHungupCall(const CallID& id)
{
_debug("ManagerImpl::peerHungupCall():this function is called when peer hangup \n");
PulseLayer *pulselayer;
AccountID accountid;
bool returnValue;
accountid = getAccountFromCall( id );
if (accountid == AccountNULL) {
......@@ -649,6 +653,8 @@ ManagerImpl::peerHungupCall(const CallID& id)
switchCall("");
}
returnValue = getAccountLink(accountid)->hangup(id);
removeWaitingCall(id);
removeCallAccount(id);
......
......@@ -149,6 +149,8 @@ SIPVoIPLink* SIPVoIPLink::_instance = NULL;
, _useStun(false)
, _clients(0)
{
_debug("SIPVoIPLink::~SIPVoIPLink(): sipvoiplink constructor called \n");
// to get random number for RANDOM_PORT
srand (time(NULL));
......@@ -158,6 +160,7 @@ SIPVoIPLink* SIPVoIPLink::_instance = NULL;
SIPVoIPLink::~SIPVoIPLink()
{
_debug("SIPVoIPLink::~SIPVoIPLink(): sipvoiplink destructor called \n");
terminate();
}
......@@ -213,7 +216,6 @@ SIPVoIPLink::terminate()
void
SIPVoIPLink::terminateSIPCall()
{
ost::MutexLock m(_callMapMutex);
CallMap::iterator iter = _callMap.begin();
SIPCall *call;
......@@ -488,6 +490,8 @@ SIPVoIPLink::hangup(const CallID& id)
_debug("* SIP Info: Stopping AudioRTP for hangup\n");
_audiortp->closeRtpSession();
}
terminateSIPCall();
removeCall(id);
......@@ -689,7 +693,7 @@ SIPVoIPLink::refuse (const CallID& id)
pj_status_t status;
pjsip_tx_data *tdata;
_debug("SIPVoIPLink::refuse() : teh call is refused \n");
call = getSIPCall(id);
if (call==0) {
......@@ -713,6 +717,8 @@ SIPVoIPLink::refuse (const CallID& id)
return false;
call->getInvSession()->mod_data[getModId()] = NULL;
terminateSIPCall();
return true;
}
......
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