Show pagesourceOld revisionsBacklinksAdd to bookExport to PDFODT exportBack to top Share via Share via... Twitter LinkedIn Facebook Pinterest Telegram WhatsApp Yammer Reddit TeamsRecent ChangesSend via e-MailPrintPermalink × Book Creator Add this page to your book Book Creator Remove this page from your book Manage book(0 page(s)) Help Relay (lua) Example: Relay relay.xml <?xml version="1.0" encoding="utf-8"?><templates version="1.3.5"> <!-- triggers a relay in the PBX --> <template prio="10" name="@string/relay_title" icon="@drawable/relay"> <keyConfiguration> <lua> <code> local valid = false local active = false local on = "##8*26" local function updateLed() if valid then if active then key:setLed( "green", true ) time.sleep("2") key:setLed( "off") end else key:setLed( "red", true ) end end local function check_valid() if identity == "" or relid == "" then valid = false else valid = true end end function onKeyUp() if valid then sip.invite(on..relid.."#",false,identity,true) active = true updateLed() end end check_valid() updateLed() </code> <params> <!-- These parameters are available by name within the lua-script (code-section). Their value is passed from the parameters-section (see below) --> <param name="identity"/> <param name="relid"/> </params> </lua> </keyConfiguration> <parameters> <!-- entered by user in phone-UI or on website when configuring this key-function. Will then be passed as value to the lua-scripts params-section. --> <parameter name="@string/identity"> <path>//param[@name="identity"]/value</path> </parameter> <parameter name="Relay Id"> <path>//param[@name="relid"]/value</path> </parameter> </parameters> </template> </templates> en/products/comfortel-d-series/developer/keys/templates/examples/relais.txt Last modified: 22.03.2022 13:17by hoehne