Allow javascript to retrieve engine congestion level.
git-svn-id: http://voip.null.ro/svn/yate@6489 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
4f6c89c694
commit
eb65a68dc7
|
@ -434,6 +434,7 @@ public:
|
|||
params().addParam(new ExpFunction("started"));
|
||||
params().addParam(new ExpFunction("exiting"));
|
||||
params().addParam(new ExpFunction("accepting"));
|
||||
params().addParam(new ExpFunction("getCongestion"));
|
||||
if (name)
|
||||
params().addParam(new ExpOperation(name,"name"));
|
||||
params().addParam(new ExpWrapper(new JsShared(mtx),"shared"));
|
||||
|
@ -1967,6 +1968,11 @@ bool JsEngine::runNative(ObjList& stack, const ExpOperation& oper, GenObject* co
|
|||
return false;
|
||||
}
|
||||
}
|
||||
else if (oper.name() == YSTRING("getCongestion")) {
|
||||
if (oper.number() != 0)
|
||||
return false;
|
||||
ExpEvaluator::pushOne(stack,new ExpOperation((int64_t)Engine::getCongestion()));
|
||||
}
|
||||
else if (oper.name() == YSTRING("atob")) {
|
||||
// str = Engine.atob(b64_str)
|
||||
ObjList args;
|
||||
|
|
Loading…
Reference in New Issue