Added setting to execute account operations on reload.

git-svn-id: http://yate.null.ro/svn/yate/trunk@6414 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2020-07-13 14:27:52 +00:00
parent c3c5036944
commit 073f33a3fb
2 changed files with 19 additions and 0 deletions

View File

@ -84,6 +84,10 @@
; addr: Local address for H323 listener (leave it empty to listen on all interfaces)
; port: Local port for H323 listener
;[general]
; Only in [general] if auto_oper is not empty on initialize the file is reloaded and each operation executed
;auto_oper=logout,login
[test_sip]
enabled=no
protocol=sip

View File

@ -270,6 +270,21 @@ void AccFilePlugin::initialize()
Engine::install(new CmdHandler);
Engine::install(new HelpHandler);
}
else {
String oper = s_cfg.getValue("general","auto_oper");
if (oper) {
s_mutex.lock();
s_cfg.load();
oper = s_cfg.getValue("general","auto_oper");
s_mutex.unlock();
ObjList* list = oper.split(',',false);
for (ObjList* l = list->skipNull(); l; l = l->skipNext()) {
oper = *static_cast <const String*>(l->get());
if (oper.trimSpaces())
emitAccounts(oper);
}
}
}
}
}; // anonymous namespace