Commit a3f51710 authored by alexandresavard's avatar alexandresavard

Fix SIPCallClose() function, recorded file now close properly

parent 9c395522
......@@ -75,8 +75,12 @@ Call::Call(const CallID& id, Call::CallType type)
Call::~Call()
{
_debug("CALL::Destructor for this clss is called \n");
recAudio.closeFile();
_debug("CALL::~Call(): Destructor for this clss is called \n");
if(recAudio.isOpenFile()) {
_debug("CALL::~Call(): A recording file is open, close it \n");
recAudio.closeFile();
}
}
void
......
......@@ -636,7 +636,6 @@ 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) {
......@@ -652,8 +651,6 @@ ManagerImpl::peerHungupCall(const CallID& id)
switchCall("");
}
returnValue = getAccountLink(accountid)->hangup(id);
removeWaitingCall(id);
removeCallAccount(id);
......
......@@ -123,6 +123,15 @@ bool AudioRecord::isFileExist() {
return false;
}
bool AudioRecord::isRecording() {
_debug("AudioRecording::setRecording() \n");
if(recordingEnabled_)
return true;
else
return false;
}
bool AudioRecord::setRecording() {
_debug("AudioRecord::setRecording()\n");
......
......@@ -80,6 +80,11 @@ public:
*/
bool isFileExist();
/**
* Check recording state
*/
bool isRecording();
/**
* Set recording flag
*/
......
......@@ -937,7 +937,7 @@ void
SIPVoIPLink::SIPCallClosed(SIPCall *call)
{
_debug("SIPVoIPLink::SIPCallClosed():: function called when peer hangup");
_debug("SIPVoIPLink::SIPCallClosed():: function called when peer hangup");
// it was without did before
//SIPCall* call = findSIPCallWithCid(event->cid);
if (!call) { return; }
......@@ -951,6 +951,7 @@ SIPVoIPLink::SIPCallClosed(SIPCall *call)
}
_debug("After close RTP\n");
Manager::instance().peerHungupCall(id);
terminateSIPCall();
removeCall(id);
_debug("After remove call ID\n");
}
......
Markdown is supported
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