diff --git a/src/global.h b/src/global.h index d6d485943e13ace918df69d4ee16eaf9c42828ed..e78ed7e1f16f9172de5a004a62d866a7e698d5ab 100644 --- a/src/global.h +++ b/src/global.h @@ -102,6 +102,6 @@ typedef short int16; #define GSM_STRING_DESCRIPTION "gsm" #define SPEEX_STRING_DESCRIPTION "speex" -#define RINGTONE_ENABLED "1" +#define RINGTONE_ENABLED 1 #endif // __GLOBAL_H__ diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp index 1697d142938c7f10022c10fec9c26282f8c284eb..31d80a390aae4f77f2af841aa0efd6ea66e33706 100644 --- a/src/managerimpl.cpp +++ b/src/managerimpl.cpp @@ -894,9 +894,9 @@ ManagerImpl::ringback () { void ManagerImpl::ringtone() { - int hasToPlayTone = getConfigInt(SIGNALISATION, PLAY_TONES); - if (!hasToPlayTone) { return; } - + // int hasToPlayTone = getConfigInt(SIGNALISATION, PLAY_TONES); + if( isRingtoneEnabled() ) + { std::string ringchoice = getConfigString(AUDIO, RING_CHOICE); //if there is no / inside the path if ( ringchoice.find(DIR_SEPARATOR_CH) == std::string::npos ) { @@ -923,6 +923,11 @@ ManagerImpl::ringtone() } else { ringback(); } +} +else +{ + ringback(); +} } AudioLoop* @@ -1364,13 +1369,13 @@ ManagerImpl::isIax2Enabled( void ) int ManagerImpl::isRingtoneEnabled( void ) { - return std::atoi( getConfigString( PREFERENCES , CONFIG_RINGTONE ).c_str()); + return getConfigInt( PREFERENCES , CONFIG_RINGTONE ); } void ManagerImpl::ringtoneEnabled( void ) { - ( getConfigString( PREFERENCES , CONFIG_RINGTONE ) == RINGTONE_ENABLED )? setConfig(PREFERENCES , CONFIG_RINGTONE , "0") : setConfig( PREFERENCES , CONFIG_RINGTONE , "1"); + ( getConfigInt( PREFERENCES , CONFIG_RINGTONE ) == RINGTONE_ENABLED )? setConfig(PREFERENCES , CONFIG_RINGTONE , 0) : setConfig( PREFERENCES , CONFIG_RINGTONE , 1); } int