Engine::init() is now available in javascript.
git-svn-id: http://voip.null.ro/svn/yate@6300 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
871aeae4c5
commit
b3ee072711
|
@ -324,6 +324,7 @@ public:
|
||||||
params().addParam(new ExpFunction("yield"));
|
params().addParam(new ExpFunction("yield"));
|
||||||
params().addParam(new ExpFunction("idle"));
|
params().addParam(new ExpFunction("idle"));
|
||||||
params().addParam(new ExpFunction("restart"));
|
params().addParam(new ExpFunction("restart"));
|
||||||
|
params().addParam(new ExpFunction("init"));
|
||||||
params().addParam(new ExpFunction("dump_r"));
|
params().addParam(new ExpFunction("dump_r"));
|
||||||
params().addParam(new ExpFunction("print_r"));
|
params().addParam(new ExpFunction("print_r"));
|
||||||
params().addParam(new ExpFunction("dump_t"));
|
params().addParam(new ExpFunction("dump_t"));
|
||||||
|
@ -1534,6 +1535,21 @@ bool JsEngine::runNative(ObjList& stack, const ExpOperation& oper, GenObject* co
|
||||||
Debug(&__plugin,DebugNote,"Engine restart is disabled by allow_abort configuration");
|
Debug(&__plugin,DebugNote,"Engine restart is disabled by allow_abort configuration");
|
||||||
ExpEvaluator::pushOne(stack,new ExpOperation(ok));
|
ExpEvaluator::pushOne(stack,new ExpOperation(ok));
|
||||||
}
|
}
|
||||||
|
else if (oper.name() == YSTRING("init")) {
|
||||||
|
bool ok = true;
|
||||||
|
if (!oper.number())
|
||||||
|
Engine::init();
|
||||||
|
else if (oper.number() == 1) {
|
||||||
|
ExpOperation* module = popValue(stack,context);
|
||||||
|
if (!module)
|
||||||
|
return false;
|
||||||
|
ok = Engine::init(*module);
|
||||||
|
TelEngine::destruct(module);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
ExpEvaluator::pushOne(stack,new ExpOperation(ok));
|
||||||
|
}
|
||||||
else if (oper.name() == YSTRING("uptime")) {
|
else if (oper.name() == YSTRING("uptime")) {
|
||||||
SysUsage::Type typ = SysUsage::WallTime;
|
SysUsage::Type typ = SysUsage::WallTime;
|
||||||
bool msec = false;
|
bool msec = false;
|
||||||
|
|
Loading…
Reference in New Issue