I try to do 2 subsequent httpGetRequests without success.
//this request initiates a phone call from my pbx to my mobile phone:
var result = actions.HTTP.sendHttpGetRequest("http://192.168.178.69/control/rcontrol?action=voipphone&name=OliverMobile");
//this request is supposed to hangup the call after 4 seconds
var resultHangUp = actions.HTTP.sendHttpGetRequest("http://192.168.178.69/control/rcontrol?action=voiphangup");
This results in the following error:
[ERROR] [enhab.core.model.script.actions.HTTP] - Fatal transport error: java.util.concurrent.TimeoutException: Total timeout 5000 ms elapsed
This error appears even if I set the delay value to 4000.
If I try to create a timer which hangs up before the timeout happens like this:
setTimeout(() => {
var resultHangUp = actions.HTTP.sendHttpGetRequest("http://192.168.178.69/control/rcontrol?action=voiphangup");
console.log(rule, "Hang up:",resultHangUp);
}, 4000);
var result = actions.HTTP.sendHttpGetRequest("http://192.168.178.69/control/rcontrol?action=voipphone&name=OliverMobile");
I get an error message that multi threaded access is not allowed for JS
[ERROR] [e.automation.internal.RuleEngineImpl] - Failed to execute rule 'Alarme': Failed to execute action: 2(Multi threaded access requested by thread Thread[OH-rule-Alarme-1,5,Configuration Admin Service] but is not allowed for language(s) js.)
Any idea how do I need to change my script?