Commit 825d09a5 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#2392] Fix ringtone during call in IAX

parent 47d78bbc
......@@ -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();
}
......
......@@ -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);
......
......@@ -298,6 +298,9 @@ class IAXVoIPLink : public VoIPLink
/* URL hook */
UrlHook *urlhook;
/** Counter for IncomingCallNotification */
int countTime;
};
#endif
......@@ -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;
......
......@@ -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
......
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