Skip to content
Snippets Groups Projects
Commit b8478025 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Add the SIP registration expire value in the user file

The default value for SIP registration is 180. But, to connect to the freebox, it seems we need a longer time
You can set the value tou want by editing the user configuration file
parent 1a65f6f0
No related branches found
No related tags found
No related merge requests found
......@@ -981,6 +981,7 @@ ManagerImpl::initConfigFile (void)
fill_config_int(CONFIG_MAIL_NOTIFY , NO_STR);
fill_config_int(CONFIG_VOLUME , YES_STR);
fill_config_int(CONFIG_HISTORY , DFT_MAX_CALLS);
fill_config_int(REGISTRATION_EXPIRE , DFT_EXPIRE_VALUE);
// Loads config from ~/.sflphone/sflphonedrc or so..
if (createSettingsPath() == 1) {
......@@ -1393,6 +1394,12 @@ ManagerImpl::getMailNotify( void )
return getConfigInt( PREFERENCES , CONFIG_MAIL_NOTIFY );
}
int
ManagerImpl::getRegistrationExpireValue( void)
{
return getConfigInt( PREFERENCES , REGISTRATION_EXPIRE );
}
void
ManagerImpl::setMailNotify( void )
{
......
......@@ -541,6 +541,11 @@ class ManagerImpl {
*/
::DBus::Int32 getMailNotify( void );
/**
* Get the expire value for SIP registration, set in the user configuration file
*/
int getRegistrationExpireValue( void );
/**
* Retrieve the formatted list of codecs payload in the user config file and
* load in the active list of codecs
......
......@@ -39,7 +39,7 @@
#define EXOSIP_ERROR_BUILDING -2
// for registration
#define EXPIRES_VALUE 180
//#define EXPIRES_VALUE 180
// 1XX responses
#define DIALOG_ESTABLISHED 101
......@@ -443,6 +443,8 @@ SIPVoIPLink::getEvent()
bool
SIPVoIPLink::sendRegister()
{
int expire_value = Manager::instance().getRegistrationExpireValue();
_debug("SIP Registration Expire Value = %i\n" , expire_value);
if (_eXosipRegID != EXOSIP_ERROR_STD) {
return false;
......@@ -466,11 +468,11 @@ SIPVoIPLink::sendRegister()
if (!_proxy.empty()) {
_debug("* SIP Info: Register from: %s to %s\n", from.data(), proxy.data());
_eXosipRegID = eXosip_register_build_initial_register(from.data(),
proxy.data(), NULL, EXPIRES_VALUE, &reg);
proxy.data(), NULL, expire_value, &reg);
} else {
_debug("* SIP Info: Register from: %s to %s\n", from.data(), hostname.data());
_eXosipRegID = eXosip_register_build_initial_register(from.data(),
hostname.data(), NULL, EXPIRES_VALUE, &reg);
hostname.data(), NULL, expire_value, &reg);
}
eXosip_unlock();
if (_eXosipRegID < EXOSIP_ERROR_NO ) {
......
......@@ -57,6 +57,7 @@
#define CONFIG_POPUP "Window.popup" /** SFLphone pops up on incoming calls or not */
#define CONFIG_VOLUME "Volume.display" /** Display the mic and speaker volume controls */
#define CONFIG_ZEROCONF "Zeroconf.enable" /** Zero configuration networking module */
#define REGISTRATION_EXPIRE "Registration.expire" /** Registration expire value */
#define SIGNALISATION "VoIPLink" /** Section Signalisation */
#define PLAY_DTMF "DTMF.playDtmf" /** Whether or not should play dtmf */
......@@ -81,6 +82,7 @@
#define DFT_SAMPLE_RATE "44100" /** Default sample rate in HZ */
#define DFT_NOTIF_LEVEL "2" /** Default desktop notification level : maximum */
#define DFT_MAX_CALLS "20" /** Default maximum calls in history */
#define DFT_EXPIRE_VALUE "180" /** Default expire value for registration */
#ifdef USE_ZEROCONF
#define CONFIG_ZEROCONF_DEFAULT_STR "1" /** Default Zero configuration networking module value */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment