From: Jo-Philipp Wich Date: Mon, 30 Mar 2009 00:24:20 +0000 (+0000) Subject: applications/luci-asterisk: fix link to voicemail boxes, remove dialplanvoice and... X-Git-Tag: 0.9.0~551 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=5f72f9d547e50ee4cde12efa53ce047c7ee30518 applications/luci-asterisk: fix link to voicemail boxes, remove dialplanvoice and dialplanmeetme too when removing dialplan sections --- diff --git a/applications/luci-asterisk/luasrc/controller/asterisk.lua b/applications/luci-asterisk/luasrc/controller/asterisk.lua index b321b5adb..c258f2db3 100644 --- a/applications/luci-asterisk/luasrc/controller/asterisk.lua +++ b/applications/luci-asterisk/luasrc/controller/asterisk.lua @@ -81,8 +81,6 @@ function handle_dialplan() if #newinc > 0 then uci:set("asterisk", plan.name, "include", newinc) end - - uci:save("asterisk") end end @@ -101,8 +99,6 @@ function handle_dialplan() if #newinc > 0 then uci:set("asterisk", plan.name, "include", newinc) end - - uci:save("asterisk") end end @@ -111,7 +107,6 @@ function handle_dialplan() if #v > 0 and plan then uci:delete_all("asterisk", "dialplanvoice", { extension=v, dialplan=plan.name }) - uci:save("asterisk") end end @@ -127,7 +122,6 @@ function handle_dialplan() voicebox = vbox.number, voicecontext = vbox.context }) - uci:save("asterisk") end end @@ -135,7 +129,6 @@ function handle_dialplan() if aname and #aname > 0 then if aname:match("^[a-zA-Z0-9_]+$") then uci:section("asterisk", "dialplan", aname, { }) - uci:save("asterisk") else err = true end @@ -145,11 +138,14 @@ function handle_dialplan() if dname and #dname > 0 then if uci:get("asterisk", dname) == "dialplan" then uci:delete("asterisk", dname) - uci:save("asterisk") + uci:delete_all("asterisk", "dialplanvoice", { dialplan=dname }) + uci:delete_all("asterisk", "dialplanmeetme", { dialplan=dname }) end end + uci:save("asterisk") ast.uci_resync() + luci.template.render("asterisk/dialplans", { create_error = err }) end diff --git a/applications/luci-asterisk/luasrc/view/asterisk/dialplans.htm b/applications/luci-asterisk/luasrc/view/asterisk/dialplans.htm index 47e610507..79b81bd9d 100644 --- a/applications/luci-asterisk/luasrc/view/asterisk/dialplans.htm +++ b/applications/luci-asterisk/luasrc/view/asterisk/dialplans.htm @@ -78,7 +78,7 @@ $Id$ Here you can manage your dial plans which are used to route outgoing calls from your local extensions.

Related tasks:
Manage dialzones | - Manage voicemailboxes + Manage voicemail boxes