Commit 453d14fa authored by alexandresavard's avatar alexandresavard
Browse files

Add isRecording() function

parent 936bc398
......@@ -172,3 +172,10 @@ Call::setRecording()
{
recAudio.setRecording();
}
bool
Call::isRecording()
{
return recAudio.isRecording();
}
......@@ -224,7 +224,11 @@ class Call{
* SetRecording
*/
void setRecording();
/**
* Return Recording state
*/
bool isRecording();
protected:
/** Protect every attribute that can be changed by two threads */
......
......@@ -501,6 +501,7 @@ IAXVoIPLink::refuse(const CallID& id)
_mutexIAX.enterMutex();
iax_reject(call->getSession(), (char*) reason.c_str());
_mutexIAX.leaveMutex();
removeCall(id);
return true;
......@@ -510,10 +511,18 @@ IAXVoIPLink::refuse(const CallID& id)
void
IAXVoIPLink::setRecording(const CallID& id)
{
_debug("SIPVoIPLink::setRecording!");
_debug("IAXVoIPLink::setRecording!");
}
bool
IAXVoIPLink::isRecording(const CallID& id)
{
_debug("IAXVoIPLink::setRecording!");
}
bool
IAXVoIPLink::carryingDTMFdigits(const CallID& id, char code)
{
......
......@@ -157,6 +157,12 @@ class IAXVoIPLink : public VoIPLink
* @param id The call identifier
*/
void setRecording(const CallID& id);
/**
* Return recording state
* @param id The call identifier
*/
bool isRecording(const CallID& id);
/**
* Send DTMF
......
......@@ -342,8 +342,23 @@ ManagerImpl::offHoldCall(const CallID& id)
_debug("Setting OFFHOLD, Account %s, callid %s\n", accountid.c_str(), id.c_str());
bool rec = getAccountLink(accountid)->isRecording(id);
/*
if(rec)
_debug("ManagerImpl::offHoldCall(): Record state is true \n");
else
_debug("ManagerImpl::offHoldCall(): Record state is false \n");
*/
bool returnValue = getAccountLink(accountid)->offhold(id);
if (_dbus) _dbus->getCallManager()->callStateChanged(id, "UNHOLD");
if (_dbus){
if (rec)
_dbus->getCallManager()->callStateChanged(id, "UNHOLD_RECORD");
else
_dbus->getCallManager()->callStateChanged(id, "UNHOLD_CURRENT");
}
switchCall(id);
return returnValue;
......@@ -1429,13 +1444,22 @@ ManagerImpl::setVolumeControls( void )
void
ManagerImpl::setRecordingCall(const CallID& id)
{
_debug("ManagerImpl::setRecording!.\n");
_debug("ManagerImpl::setRecording()! \n");
AccountID accountid = getAccountFromCall( id );
// printf("ManagerImpl::CallID: %s", id);
getAccountLink(accountid)->setRecording(id);
}
bool
ManagerImpl::isRecording(const CallID& id)
{
_debug("ManagerImpl::isRecording()! \n");
AccountID accountid = getAccountFromCall( id );
return getAccountLink(accountid)->isRecording(id);
}
void
ManagerImpl::startHidden( void )
{
......
......@@ -458,12 +458,17 @@ class ManagerImpl {
void setVolumeControls( void );
/**
* Functions which occur with a user's action
* Set recording on / off
* Start recording
* @param id The call identifier
*/
void setRecordingCall(const CallID& id);
/**
* Return true if the call is currently recorded
*/
bool isRecording(const CallID& id);
/**
* Set the maximum number of calls to keep in the history
* @param calls The number of calls
......
......@@ -723,9 +723,23 @@ SIPVoIPLink::refuse (const CallID& id)
void
SIPVoIPLink::setRecording(const CallID& id)
{
//SIPCall *call;
//call = getSIPCall(id);
//call->setRecording();
_audiortp->setRecording();
}
bool
SIPVoIPLink::isRecording(const CallID& id)
{
SIPCall *call;
call = getSIPCall(id);
return call->isRecording();
}
bool
SIPVoIPLink::carryingDTMFdigits(const CallID& id, char code)
{
......
......@@ -279,6 +279,12 @@ class SIPVoIPLink : public VoIPLink
* @param id The call identifier
*/
void setRecording(const CallID& id);
/**
* Returning state (true recording)
* @param id The call identifier
*/
bool isRecording(const CallID& id);
private:
/**
......
......@@ -160,6 +160,12 @@ class VoIPLink {
*/
virtual void setRecording(const CallID& id) = 0;
/**
* Return recording state
* @param id The call identifier
*/
virtual bool isRecording(const CallID& id) = 0;
bool initDone (void) { return _initDone; }
void initDone (bool state) { _initDone = state; }
......
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