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:
parent
c3c5036944
commit
073f33a3fb
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue