diff --git a/src/call.cpp b/src/call.cpp index 964951ed9878f7c8ce8737721df1eb88d03fdeaf..08d64d88351f032fab655f4c91589a7fd8efcdaa 100644 --- a/src/call.cpp +++ b/src/call.cpp @@ -172,3 +172,10 @@ Call::setRecording() { recAudio.setRecording(); } + +bool +Call::isRecording() +{ + return recAudio.isRecording(); +} + diff --git a/src/call.h b/src/call.h index 4fa6744383b5ae85440c95eeda1e05e4627ab1a4..b549e360f292675f90a3a6a53158172a657baad6 100644 --- a/src/call.h +++ b/src/call.h @@ -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 */ diff --git a/src/iaxvoiplink.cpp b/src/iaxvoiplink.cpp index edfd7013196143b70a871679e6d2685135b65f4f..74e6f9431dbbb2596065043680f83631e4429244 100644 --- a/src/iaxvoiplink.cpp +++ b/src/iaxvoiplink.cpp @@ -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) { diff --git a/src/iaxvoiplink.h b/src/iaxvoiplink.h index 95f984512c3bc1939561acac3c3b4b85f2beff56..c66112d1b2fe63027d04a0436fa46c35cf6a2788 100644 --- a/src/iaxvoiplink.h +++ b/src/iaxvoiplink.h @@ -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 diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp index 26324a44444059f3aaedfa3906e7aeb23354d4a3..c612aa954ed9a0aff451cea624af6904cb8cbced 100644 --- a/src/managerimpl.cpp +++ b/src/managerimpl.cpp @@ -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 ) { diff --git a/src/managerimpl.h b/src/managerimpl.h index d4a8add21c8b9e559664d5cc33d40d786013903a..ea77d4d9cf2e8119573740cefe2c375606a7db8a 100644 --- a/src/managerimpl.h +++ b/src/managerimpl.h @@ -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 diff --git a/src/sipvoiplink.cpp b/src/sipvoiplink.cpp index 416f77e60b6c55e348148fed994c303db5014a39..1e8783950f144c9b86ebc8d370627b87fb897b30 100644 --- a/src/sipvoiplink.cpp +++ b/src/sipvoiplink.cpp @@ -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) { diff --git a/src/sipvoiplink.h b/src/sipvoiplink.h index 0e40fa27b1b164aeb58beb138ae002a5f26fbc2a..dde5e71ebbb1e8b3f7109a96284d8e1bf45e6336 100644 --- a/src/sipvoiplink.h +++ b/src/sipvoiplink.h @@ -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: /** diff --git a/src/voiplink.h b/src/voiplink.h index 71d0355cb86feb2d625bffd69ba8e7fb3bca0a1c..fa216a39acb914c797ecbca7fa8a3970570a9958 100644 --- a/src/voiplink.h +++ b/src/voiplink.h @@ -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; }