From 19cae040036f3e1e6b468b854efd6d4ca9228604 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Thu, 4 Nov 2010 11:38:07 +0000 Subject: [PATCH] adds a very simple application for configuring the tapi support on ifxmips based units --- applications/luci-lqtapifoss/Makefile | 4 +++ .../luasrc/controller/lqtapifoss.lua | 27 +++++++++++++++++ .../luasrc/model/cbi/luci_lqvoip/account.lua | 30 +++++++++++++++++++ .../luasrc/model/cbi/luci_lqvoip/config.lua | 29 ++++++++++++++++++ .../luasrc/model/cbi/luci_lqvoip/contact.lua | 25 ++++++++++++++++ .../luasrc/view/luci_lqvoip/index.htm | 17 +++++++++++ contrib/package/luci/Makefile | 1 + 7 files changed, 133 insertions(+) create mode 100644 applications/luci-lqtapifoss/Makefile create mode 100644 applications/luci-lqtapifoss/luasrc/controller/lqtapifoss.lua create mode 100644 applications/luci-lqtapifoss/luasrc/model/cbi/luci_lqvoip/account.lua create mode 100644 applications/luci-lqtapifoss/luasrc/model/cbi/luci_lqvoip/config.lua create mode 100644 applications/luci-lqtapifoss/luasrc/model/cbi/luci_lqvoip/contact.lua create mode 100644 applications/luci-lqtapifoss/luasrc/view/luci_lqvoip/index.htm diff --git a/applications/luci-lqtapifoss/Makefile b/applications/luci-lqtapifoss/Makefile new file mode 100644 index 000000000..77925c4e3 --- /dev/null +++ b/applications/luci-lqtapifoss/Makefile @@ -0,0 +1,4 @@ +PO = telephony + +include ../../build/config.mk +include ../../build/module.mk diff --git a/applications/luci-lqtapifoss/luasrc/controller/lqtapifoss.lua b/applications/luci-lqtapifoss/luasrc/controller/lqtapifoss.lua new file mode 100644 index 000000000..08941874a --- /dev/null +++ b/applications/luci-lqtapifoss/luasrc/controller/lqtapifoss.lua @@ -0,0 +1,27 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2019 John Crispin + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +]]-- +module("luci.controller.lqtapifoss", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/telephony") then + return + end + + local e = entry({"admin", "telephony"}, template("luci_lqvoip/index") , luci.i18n.translate("VoIP"), 90) + e.index = true + e.i18n = "telephony" + + --local e = entry({"admin", "telephony", "config"}, cbi("luci_lqvoip/config") , luci.i18n.translate("Config"), 10) + local e = entry({"admin", "telephony", "account"}, cbi("luci_lqvoip/account") , luci.i18n.translate("Account"), 20) + local e = entry({"admin", "telephony", "contact"}, cbi("luci_lqvoip/contact") , luci.i18n.translate("Contacts"), 30) +end diff --git a/applications/luci-lqtapifoss/luasrc/model/cbi/luci_lqvoip/account.lua b/applications/luci-lqtapifoss/luasrc/model/cbi/luci_lqvoip/account.lua new file mode 100644 index 000000000..e1cccebfd --- /dev/null +++ b/applications/luci-lqtapifoss/luasrc/model/cbi/luci_lqvoip/account.lua @@ -0,0 +1,30 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2010 John Crispin + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +]]-- + +m = Map("telephony", translate("VoIP")) +m.on_after_commit = function() luci.sys.call("/etc/init.d/telephony restart") end + +s = m:section(NamedSection, "account", "account", translate("Account"), + translate("Here You can specify the SIP account that you want to use.")) +s.anonymous = false + +s:option(Value, "realm", translate("Realm")) +s:option(Value, "username", translate("Username")) +s:option(Value, "password", translate("Password")) +s:option(Value, "stun", translate("STUN Server")) +stun_port = s:option(Value, "stun_port", translate("STUN Port")) +stun_port.default = "3478" +sip_port = s:option(Value, "sip_port", translate("SIP Port")) +sip_port.default = "5060" + +return m diff --git a/applications/luci-lqtapifoss/luasrc/model/cbi/luci_lqvoip/config.lua b/applications/luci-lqtapifoss/luasrc/model/cbi/luci_lqvoip/config.lua new file mode 100644 index 000000000..614bf4524 --- /dev/null +++ b/applications/luci-lqtapifoss/luasrc/model/cbi/luci_lqvoip/config.lua @@ -0,0 +1,29 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2010 John Crispin + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +]]-- + +m = Map("telephony", translate("VoIP")) + +s = m:section(NamedSection, "config", "config", "Config", "Here You can specify the generic Configuration.") +m.on_after_commit = function() luci.sys.call("/etc/init.d/telephony restart") end + +s:option(Value, "netdev", translate("Network")) + +e = s:option(ListValue, "fw_dl", translate("Download firmware")) +e:value("0", translate("No")) +e:value("1", translate("Yes")) +e.default = "0" + +e = s:option(Value, "fw_url", translate("Firmware path")) +e:depends("fw_dl", 1) + +return m diff --git a/applications/luci-lqtapifoss/luasrc/model/cbi/luci_lqvoip/contact.lua b/applications/luci-lqtapifoss/luasrc/model/cbi/luci_lqvoip/contact.lua new file mode 100644 index 000000000..09ee84c0e --- /dev/null +++ b/applications/luci-lqtapifoss/luasrc/model/cbi/luci_lqvoip/contact.lua @@ -0,0 +1,25 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2010 John Crispin + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +]]-- + +m = Map("telephony", translate("VoIP")) +m.on_after_commit = function() luci.sys.call("/etc/init.d/telephony reload") end + +s = m:section(TypedSection, "contact", translate("Contact"), translate("Here You can specify the SIP contacts that you want to use.")) +s.anonymous = true +s.addremove = true +s.template = "cbi/tblsection" + +s:option(Value, "number", translate("Number")) +s:option(Value, "identifier", translate("Identifier")) + +return m diff --git a/applications/luci-lqtapifoss/luasrc/view/luci_lqvoip/index.htm b/applications/luci-lqtapifoss/luasrc/view/luci_lqvoip/index.htm new file mode 100644 index 000000000..17b73cca0 --- /dev/null +++ b/applications/luci-lqtapifoss/luasrc/view/luci_lqvoip/index.htm @@ -0,0 +1,17 @@ +<%# +LuCI - Lua Configuration Interface +(c) 2009 Daniel Dickinson + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id: index.htm 5097 2009-07-17 20:27:05Z jow $ + +-%> +<%+header%> +

VoIP

+

Here you can control Lantiq voice-related settings

+<%+footer%> diff --git a/contrib/package/luci/Makefile b/contrib/package/luci/Makefile index 3420fdebc..d4fee2c25 100644 --- a/contrib/package/luci/Makefile +++ b/contrib/package/luci/Makefile @@ -422,6 +422,7 @@ $(eval $(call application,vnstat,LuCI Support for VnStat,\ +PACKAGE_luci-app-vnstat:vnstat \ +PACKAGE_luci-app-vnstat:vnstati)) +$(eval $(call application,lqtapifoss,Lantiq voip)) ### Server Gateway Interfaces ### define sgi -- 2.25.1