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

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
en:products:comfortel-d-series:developer:luaapi:interactiveluaviahttp:skript [09.09.2020 16:09]
en:products:comfortel-d-series:developer:luaapi:interactiveluaviahttp:skript [22.03.2022 13:25]
hoehne ↷ Page moved from en:wiki.auerswald.de:products:comfortel-d-series:d-100-200:developer:luaapi:interactiveluaviahttp:skript to en:wiki.auerswald.de:products:comfortel-d-series:developer:luaapi:interactiveluaviahttp:skript
Line 1: Line 1:
 +You can provision this file and you'll be able to [[.|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: 03.12.2022 04:00
  • by