applications/luci-asterisk:
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 11 Jan 2009 04:23:43 +0000 (04:23 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 11 Jan 2009 04:23:43 +0000 (04:23 +0000)
- make nat handling configurable for sip trunks
- display actual reason when trunk is offline

applications/luci-asterisk/luasrc/model/cbi/asterisk/trunk_sip.lua
applications/luci-asterisk/luasrc/model/cbi/asterisk/trunks.lua

index ca29471384c5e2866f3b4aeb66b9909122f54cea..1337602e4289f03b325f397ad8b705a1801c21cc 100644 (file)
@@ -34,6 +34,10 @@ if arg[1] then
        sipport   = peer:option(Value, "port", "SIP Port")
        sipport.default = 5060
 
+       sipnat    = peer:option(Flag, "nat", "NAT between this device and provider")
+       sipnat.enabled  = "yes"
+       sipnat.disabled = "no"
+
        username  = peer:option(Value, "username", "Authorization ID")
        password  = peer:option(Value, "secret", "Authorization Password")
        password.password = true
@@ -96,7 +100,8 @@ else
                if sip_peers[s].info.online == nil then
                        return "n/a"
                else
-                       return sip_peers[s].info.online and "yes" or "no"
+                       return sip_peers[s].info.online
+                               and "yes" or "no (%s)" % sip_peers[s].info.Status:lower()
                end
        end
 
index b9dd1dfd8d1892db40d4248f6fe57ef0df06bf94..af992989c49ff34fbc27c063f7a27c96672eb479 100644 (file)
@@ -57,7 +57,8 @@ function online.cfgvalue(self, s)
        if sip_peers[s].info.online == nil then
                return "n/a"
        else
-               return sip_peers[s].info.online and "yes" or "no"
+               return sip_peers[s].info.online
+                       and "yes" or "no (%s)" % sip_peers[s].info.Status:lower()
        end
 end