diff --git a/sflphone-common/src/audio/audiortp/AudioRtpSession.h b/sflphone-common/src/audio/audiortp/AudioRtpSession.h index dca95127030490676d8564520c4e5fbcb36118bc..870926c0ae2569c70ccca6f851b6c47a4faa40cd 100644 --- a/sflphone-common/src/audio/audiortp/AudioRtpSession.h +++ b/sflphone-common/src/audio/audiortp/AudioRtpSession.h @@ -398,8 +398,8 @@ namespace sfl { if (_manager->incomingCallWaiting() > 0) { int countTime_modulo = countTime % 4000; - _debug("countTime: %i\n", countTime); - _debug("countTime_modulo: %i\n", countTime_modulo); + // _debug("countTime: %i\n", countTime); + // _debug("countTime_modulo: %i\n", countTime_modulo); if ((countTime_modulo - countTime) < 0) { _manager->notificationIncomingCall(); } diff --git a/sflphone-common/src/iax/iaxvoiplink.cpp b/sflphone-common/src/iax/iaxvoiplink.cpp index 8c634a692d5c6435d7ee73ef885bfe3541a3bb87..920eb6a87338bdbdfaa46c9544e61338d8f6b6df 100644 --- a/sflphone-common/src/iax/iaxvoiplink.cpp +++ b/sflphone-common/src/iax/iaxvoiplink.cpp @@ -47,6 +47,7 @@ _evThread = new EventThread (this); _regSession = NULL; _nextRefreshStamp = 0; + countTime = 0; // to get random number for RANDOM_PORT srand (time (NULL)); @@ -256,6 +257,20 @@ IAXVoIPLink::getEvent() sendRegister (""); } + // Notify (with a beep) an incoming call when there is already a call + countTime += 3; + + if((Manager::instance().incomingCallWaiting() > 0) && Manager::instance().hasCurrentCall()) { + + int countTime_modulo = countTime % 4000; + // _debug("countTime: %i\n", countTime); + // _debug("countTime_modulo: %i\n", countTime_modulo); + if ((countTime_modulo - countTime) < 0) { + Manager::instance().notificationIncomingCall(); + } + + countTime = countTime_modulo; + } // thread wait 3 millisecond _evThread->sleep (3); diff --git a/sflphone-common/src/iax/iaxvoiplink.h b/sflphone-common/src/iax/iaxvoiplink.h index a7771c782d901bdf52664fd4b2d2836caee08734..d67ef72b3e3302a6801127f5bafd8f69607ca28a 100644 --- a/sflphone-common/src/iax/iaxvoiplink.h +++ b/sflphone-common/src/iax/iaxvoiplink.h @@ -298,6 +298,9 @@ class IAXVoIPLink : public VoIPLink /* URL hook */ UrlHook *urlhook; + + /** Counter for IncomingCallNotification */ + int countTime; }; #endif diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index d232daa3fc3f471408a5b0188f0256a994e89841..ad9c5b4fda9f83ca149e60643a34c0c69d64563b 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -189,7 +189,7 @@ ManagerImpl::isCurrentCall (const CallID& callId) bool ManagerImpl::hasCurrentCall() { - _debug ("ManagerImpl::hasCurrentCall current call ID = %s\n", _currentCallId2.c_str()); + // _debug ("ManagerImpl::hasCurrentCall current call ID = %s\n", _currentCallId2.c_str()); if (_currentCallId2 != "") { return true; diff --git a/sflphone-common/src/managerimpl.h b/sflphone-common/src/managerimpl.h index 8c4406ae79b1a90662f31db25d16b98bbaf23889..40ed90c089274127008245428af036a545b4b586 100644 --- a/sflphone-common/src/managerimpl.h +++ b/sflphone-common/src/managerimpl.h @@ -1097,12 +1097,6 @@ class ManagerImpl { */ void initVolume(); - /** - * Tell if there is a current call processed - * @return bool True if there is a current call - */ - bool hasCurrentCall(); - /** * Switch of current call id * @param id The new callid @@ -1264,6 +1258,12 @@ class ManagerImpl { public: + + /** + * Tell if there is a current call processed + * @return bool True if there is a current call + */ + bool hasCurrentCall(); /** * Return the current DBusManagerImpl