This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:products:comfortel-d-series:developer:luaapi:interactiveluaviahttp:skript [09.09.2020 16:09]
en:products:comfortel-d-series:developer:luaapi:interactiveluaviahttp:skript [13.08.2022 04:00]
Line 1: Line 1:
 +You can provision this file and you'll be able to [[en:wiki.auerswald.de:products:comfortel-d-series:developer:luaapi:interactiveluaviahttp|chat lua]] with your phone using http/curl.
 +<note warning>The Lua-api is very powerful and can be used to read/change passwords or start calls and much more. You should not install this script in the field or at least be **very very** deligant about save-guarding your AccessTokens.</note>
 +<file xml provisionInteractiveLua.xml>
 +<?xml version="1.0" encoding="utf-8"?>
 +<luaAutoStarters patch="true">
 +    <luaScript name="InteractiveLuaViaHttp">
 +        <code><![CDATA[
 +            function onScript(url, body, headers, vars)
 +                local fct, error = load(body, "httpScript")
 +                if (fct) then
 +                  local worked, result = pcall(fct)
 +                  if (worked) then
 +                    return 200, result
 +                  else -- code crashed, inform why:
 +                    return 400, result
 +                  end
 +                else -- code didn't compile, inform why:
 +                  return 500, error
 +                end
 +            end
 +            http.listen("interactive.lua", onScript, true)
 +            debug.log("listening for lua-cmds on https://[phoneIp]/api/v1/exec/interactive.lua")
 +            ]]></code>
 +    </luaScript>
  • en/products/comfortel-d-series/developer/luaapi/interactiveluaviahttp/skript.txt
  • Last modified: 28.09.2022 04:00
  • by