summaryrefslogtreecommitdiffstats
path: root/src/sys_settings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys_settings.cpp')
-rw-r--r--src/sys_settings.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/sys_settings.cpp b/src/sys_settings.cpp
index bb07539..1966d0b 100644
--- a/src/sys_settings.cpp
+++ b/src/sys_settings.cpp
@@ -77,6 +77,9 @@ using namespace utils;
#define FLD_GUI_BROWSER_CMD "gui_browser_cmd"
#define FLD_GUI_SHOW_CALL_OSD "gui_show_call_osd"
+// Inhibit idle session
+#define FLD_INHIBIT_IDLE_SESSION "inhibit_idle_session"
+
// Address book settings
#define FLD_AB_SHOW_SIP_ONLY "ab_show_sip_only"
#define FLD_AB_LOOKUP_NAME "ab_lookup_name"
@@ -255,6 +258,8 @@ t_sys_settings::t_sys_settings() {
gui_auto_show_incoming = false;
gui_auto_show_timeout = 10;
gui_show_call_osd = true;
+
+ inhibit_idle_session = false;
ab_show_sip_only = false;
ab_lookup_name = true;
@@ -421,6 +426,11 @@ string t_sys_settings::get_gui_browser_cmd(void) const {
return gui_browser_cmd;
}
+bool t_sys_settings::get_inhibit_idle_session(void) const {
+ t_mutex_guard guard(mtx_sys);
+ return inhibit_idle_session;
+}
+
bool t_sys_settings::get_ab_show_sip_only(void) const {
bool result;
mtx_sys.lock();
@@ -770,6 +780,11 @@ void t_sys_settings::set_gui_browser_cmd(const string &s) {
gui_browser_cmd = s;
}
+void t_sys_settings::set_inhibit_idle_session(bool b) {
+ t_mutex_guard guard(mtx_sys);
+ inhibit_idle_session = b;
+}
+
void t_sys_settings::set_ab_show_sip_only(bool b) {
mtx_sys.lock();
ab_show_sip_only = b;
@@ -1587,6 +1602,8 @@ bool t_sys_settings::read_config(string &error_msg) {
gui_browser_cmd = value;
} else if (parameter == FLD_GUI_SHOW_CALL_OSD) {
gui_show_call_osd = yesno2bool(value);
+ } else if (parameter == FLD_INHIBIT_IDLE_SESSION) {
+ inhibit_idle_session = yesno2bool(value);
} else if (parameter == FLD_AB_SHOW_SIP_ONLY) {
ab_show_sip_only = yesno2bool(value);
} else if (parameter == FLD_AB_LOOKUP_NAME) {
@@ -1728,6 +1745,10 @@ bool t_sys_settings::write_config(string &error_msg) {
config << FLD_GUI_BROWSER_CMD << '=' << gui_browser_cmd << endl;
config << FLD_GUI_SHOW_CALL_OSD << '=' << bool2yesno(gui_show_call_osd) << endl;
config << endl;
+
+ // Write inhibit idle session settings
+ config << FLD_INHIBIT_IDLE_SESSION << '=' << bool2yesno(inhibit_idle_session) << endl;
+ config << endl;
// Write address book settings
config << "# Address book\n";