Skip to content
Snippets Groups Projects
Commit 453d14fa authored by alexandresavard's avatar alexandresavard
Browse files

Add isRecording() function

parent 936bc398
Branches
Tags
No related merge requests found
...@@ -172,3 +172,10 @@ Call::setRecording() ...@@ -172,3 +172,10 @@ Call::setRecording()
{ {
recAudio.setRecording(); recAudio.setRecording();
} }
bool
Call::isRecording()
{
return recAudio.isRecording();
}
...@@ -225,6 +225,10 @@ class Call{ ...@@ -225,6 +225,10 @@ class Call{
*/ */
void setRecording(); void setRecording();
/**
* Return Recording state
*/
bool isRecording();
protected: protected:
/** Protect every attribute that can be changed by two threads */ /** Protect every attribute that can be changed by two threads */
......
...@@ -501,6 +501,7 @@ IAXVoIPLink::refuse(const CallID& id) ...@@ -501,6 +501,7 @@ IAXVoIPLink::refuse(const CallID& id)
_mutexIAX.enterMutex(); _mutexIAX.enterMutex();
iax_reject(call->getSession(), (char*) reason.c_str()); iax_reject(call->getSession(), (char*) reason.c_str());
_mutexIAX.leaveMutex(); _mutexIAX.leaveMutex();
removeCall(id); removeCall(id);
return true; return true;
...@@ -510,9 +511,17 @@ IAXVoIPLink::refuse(const CallID& id) ...@@ -510,9 +511,17 @@ IAXVoIPLink::refuse(const CallID& id)
void void
IAXVoIPLink::setRecording(const CallID& id) IAXVoIPLink::setRecording(const CallID& id)
{ {
_debug("SIPVoIPLink::setRecording!"); _debug("IAXVoIPLink::setRecording!");
} }
bool
IAXVoIPLink::isRecording(const CallID& id)
{
_debug("IAXVoIPLink::setRecording!");
}
bool bool
IAXVoIPLink::carryingDTMFdigits(const CallID& id, char code) IAXVoIPLink::carryingDTMFdigits(const CallID& id, char code)
......
...@@ -158,6 +158,12 @@ class IAXVoIPLink : public VoIPLink ...@@ -158,6 +158,12 @@ class IAXVoIPLink : public VoIPLink
*/ */
void setRecording(const CallID& id); void setRecording(const CallID& id);
/**
* Return recording state
* @param id The call identifier
*/
bool isRecording(const CallID& id);
/** /**
* Send DTMF * Send DTMF
* @param id The ID of the call * @param id The ID of the call
......
...@@ -342,8 +342,23 @@ ManagerImpl::offHoldCall(const CallID& id) ...@@ -342,8 +342,23 @@ ManagerImpl::offHoldCall(const CallID& id)
_debug("Setting OFFHOLD, Account %s, callid %s\n", accountid.c_str(), id.c_str()); _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); 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); switchCall(id);
return returnValue; return returnValue;
...@@ -1429,13 +1444,22 @@ ManagerImpl::setVolumeControls( void ) ...@@ -1429,13 +1444,22 @@ ManagerImpl::setVolumeControls( void )
void void
ManagerImpl::setRecordingCall(const CallID& id) ManagerImpl::setRecordingCall(const CallID& id)
{ {
_debug("ManagerImpl::setRecording!.\n"); _debug("ManagerImpl::setRecording()! \n");
AccountID accountid = getAccountFromCall( id ); AccountID accountid = getAccountFromCall( id );
// printf("ManagerImpl::CallID: %s", id); // printf("ManagerImpl::CallID: %s", id);
getAccountLink(accountid)->setRecording(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 void
ManagerImpl::startHidden( void ) ManagerImpl::startHidden( void )
{ {
......
...@@ -458,12 +458,17 @@ class ManagerImpl { ...@@ -458,12 +458,17 @@ class ManagerImpl {
void setVolumeControls( void ); void setVolumeControls( void );
/** /**
* Functions which occur with a user's action * Set recording on / off
* Start recording * Start recording
* @param id The call identifier * @param id The call identifier
*/ */
void setRecordingCall(const CallID& id); 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 * Set the maximum number of calls to keep in the history
* @param calls The number of calls * @param calls The number of calls
......
...@@ -723,9 +723,23 @@ SIPVoIPLink::refuse (const CallID& id) ...@@ -723,9 +723,23 @@ SIPVoIPLink::refuse (const CallID& id)
void void
SIPVoIPLink::setRecording(const CallID& id) SIPVoIPLink::setRecording(const CallID& id)
{ {
//SIPCall *call;
//call = getSIPCall(id);
//call->setRecording();
_audiortp->setRecording(); _audiortp->setRecording();
} }
bool
SIPVoIPLink::isRecording(const CallID& id)
{
SIPCall *call;
call = getSIPCall(id);
return call->isRecording();
}
bool bool
SIPVoIPLink::carryingDTMFdigits(const CallID& id, char code) SIPVoIPLink::carryingDTMFdigits(const CallID& id, char code)
{ {
......
...@@ -280,6 +280,12 @@ class SIPVoIPLink : public VoIPLink ...@@ -280,6 +280,12 @@ class SIPVoIPLink : public VoIPLink
*/ */
void setRecording(const CallID& id); void setRecording(const CallID& id);
/**
* Returning state (true recording)
* @param id The call identifier
*/
bool isRecording(const CallID& id);
private: private:
/** /**
* Constructor * Constructor
......
...@@ -160,6 +160,12 @@ class VoIPLink { ...@@ -160,6 +160,12 @@ class VoIPLink {
*/ */
virtual void setRecording(const CallID& id) = 0; 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; } bool initDone (void) { return _initDone; }
void initDone (bool state) { _initDone = state; } void initDone (bool state) { _initDone = state; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment