mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-26 03:53:58 +08:00
Compare commits
175 Commits
testusp
...
ledBlinkin
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
939fae5860 | ||
|
|
19b1345f98 | ||
|
|
2aed9a5525 | ||
|
|
2f3551e643 | ||
|
|
29e635516d | ||
|
|
d4c6078f24 | ||
|
|
8ad83b1252 | ||
|
|
0e2154bb0d | ||
|
|
dbc9aa37c7 | ||
|
|
e0687449cc | ||
|
|
fc9a912cb5 | ||
|
|
54d5855ad9 | ||
|
|
b0054ba9c7 | ||
|
|
a5a3f56ee7 | ||
|
|
2fc025e8c5 | ||
|
|
44cf5757fc | ||
|
|
0cf9177ea3 | ||
|
|
ba6a36b6f1 | ||
|
|
ea4992c8b9 | ||
|
|
e882dd0320 | ||
|
|
0822323784 | ||
|
|
5776cee5f6 | ||
|
|
b4c01123db | ||
|
|
bcf34ec28a | ||
|
|
320a49da86 | ||
|
|
9c92e02f70 | ||
|
|
5f99b07a08 | ||
|
|
b5878cbe60 | ||
|
|
a3f87cbc04 | ||
|
|
92a770ee3e | ||
|
|
2dcb3a6360 | ||
|
|
abd919b06e | ||
|
|
08f2370477 | ||
|
|
a9415b745c | ||
|
|
01ddeaf4d7 | ||
|
|
7271ea30d6 | ||
|
|
43e6374c89 | ||
|
|
80dafc80ea | ||
|
|
85d12dec82 | ||
|
|
f3cf9cd7e1 | ||
|
|
11c81b7cc0 | ||
|
|
3a5af746ef | ||
|
|
261e890771 | ||
|
|
b6fabaaec4 | ||
|
|
c3363f01ab | ||
|
|
6051f2bed9 | ||
|
|
75fa4cd2c9 | ||
|
|
1254fec036 | ||
|
|
21f4faebee | ||
|
|
04cacf422e | ||
|
|
b051d4f1b3 | ||
|
|
668175520c | ||
|
|
947da034bb | ||
|
|
a9b3b78a13 | ||
|
|
9af1d10122 | ||
|
|
e6cd75747f | ||
|
|
13def2aa05 | ||
|
|
cb72509bae | ||
|
|
f501a209f5 | ||
|
|
685ee1e939 | ||
|
|
a90191a6ef | ||
|
|
63c53a497f | ||
|
|
1930d8bb89 | ||
|
|
94ad6902f7 | ||
|
|
829275bc4a | ||
|
|
a7a16746f5 | ||
|
|
dbfc56ac98 | ||
|
|
244f439694 | ||
|
|
a76446c04b | ||
|
|
8f7fa57b11 | ||
|
|
0c738b9916 | ||
|
|
c43bbe523d | ||
|
|
3fb53303e0 | ||
|
|
5b2a92cf14 | ||
|
|
165faa23dc | ||
|
|
6aec80f56c | ||
|
|
b175340397 | ||
|
|
7e3387355f | ||
|
|
608dfd532a | ||
|
|
1302bbc4c6 | ||
|
|
ecaff0dded | ||
|
|
2b5df064c6 | ||
|
|
1f63f66552 | ||
|
|
6f0834b9d6 | ||
|
|
b3f42cb5de | ||
|
|
019f9b00af | ||
|
|
ecb736ed74 | ||
|
|
197ff5f72c | ||
|
|
12d3af63f3 | ||
|
|
c3e1ef09ca | ||
|
|
9c39cdd505 | ||
|
|
16e1cab74f | ||
|
|
c6ea75f608 | ||
|
|
a0c216ea89 | ||
|
|
4340b515af | ||
|
|
ef0f38499a | ||
|
|
47d2fb3113 | ||
|
|
b73e7c4a44 | ||
|
|
3642db5f04 | ||
|
|
fd9f43bcd0 | ||
|
|
c0637c052f | ||
|
|
72a3a64383 | ||
|
|
4787082fa2 | ||
|
|
bbcb34cae5 | ||
|
|
44164d950b | ||
|
|
5a4c07278c | ||
|
|
6aa6d01cd2 | ||
|
|
ec395b1bbb | ||
|
|
5a3b12f451 | ||
|
|
950365bd83 | ||
|
|
e80d88905f | ||
|
|
6840306713 | ||
|
|
8947f5f18e | ||
|
|
a41b0855ad | ||
|
|
d81a56b25e | ||
|
|
f26517974c | ||
|
|
9bad2df974 | ||
|
|
d2fd76637b | ||
|
|
8b7376900b | ||
|
|
9986b920ae | ||
|
|
dad0ba6ba2 | ||
|
|
d4269143f6 | ||
|
|
69c9ae7ca1 | ||
|
|
da9efb447d | ||
|
|
5219a70614 | ||
|
|
ca1854f058 | ||
|
|
79a038f283 | ||
|
|
d6890613f4 | ||
|
|
c6c5364e5c | ||
|
|
bf4985ce65 | ||
|
|
5c857e41a8 | ||
|
|
85c92f04f3 | ||
|
|
b36f5ef953 | ||
|
|
c789b4707f | ||
|
|
4e09f48505 | ||
|
|
87e70ef5d2 | ||
|
|
89c54abec6 | ||
|
|
bca0c5779b | ||
|
|
81245bc471 | ||
|
|
74259b0f9b | ||
|
|
3f7e6e8112 | ||
|
|
0e2e9bd7e0 | ||
|
|
71afb05602 | ||
|
|
fb6ffdb483 | ||
|
|
05c3d1131e | ||
|
|
93c3e1beab | ||
|
|
7cfe3d36f2 | ||
|
|
d1cf6136e1 | ||
|
|
b9e537afdf | ||
|
|
62cb3bac48 | ||
|
|
492ec4ba0b | ||
|
|
e5c8ff6b69 | ||
|
|
62aa40ceea | ||
|
|
2e01bf6bb6 | ||
|
|
000f56e96d | ||
|
|
6dc5b1361b | ||
|
|
9cfe56a4dd | ||
|
|
b9057e4503 | ||
|
|
517b5beb7f | ||
|
|
e970f337e6 | ||
|
|
6e7f5acd4e | ||
|
|
bcb6a76472 | ||
|
|
061bbbeb2a | ||
|
|
501fbb83c9 | ||
|
|
6ca5a756fd | ||
|
|
c4649c0435 | ||
|
|
7d7dddbded | ||
|
|
f6ab509b13 | ||
|
|
33400e8177 | ||
|
|
f6e0245c40 | ||
|
|
21460d7c51 | ||
|
|
31675b540f | ||
|
|
1706a785da | ||
|
|
bf621a4371 | ||
|
|
a0ae93e039 |
@@ -8,10 +8,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.2.0
|
||||
PKG_VERSION:=1.3.0
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=0c029ed2486342e7e7687631b702d5c743f3c41a
|
||||
PKG_SOURCE_VERSION:=5a5c94b289c79bc3a635b8d742dd9b73dcc0615f
|
||||
PKG_NAME:=dectmngr2
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ PKG_VERSION:=1.0.0
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=be5b0d0c0a1c2abd335aaf19f01f63284d8cc285
|
||||
PKG_SOURCE_VERSION:=7522faab4142fe2c0ac8cbf71bb0cc5bd49f0750
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dslmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
endif
|
||||
|
||||
@@ -85,7 +85,7 @@ get_ipaddress() {
|
||||
json_get_keys keys
|
||||
|
||||
# jshn seems a bit iffy on having : in key, replace by _
|
||||
json_select "${1//:/_}"
|
||||
json_select "${1//:/_}" 2 > /dev/null
|
||||
json_get_var ip ip
|
||||
|
||||
echo "$ip"
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easy-soc-libs
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=6bd703870262eca9ccbd8c4937c41fe842828ae3
|
||||
PKG_SOURCE_VERSION:=4c204761a38a27ff9ff7021c3c34b92d7e3fdb84
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/easy-soc-libs.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@inteno.se>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
|
||||
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=0.2
|
||||
PKG_SOURCE_VERSION:=44e2472e8c08bef01fab27e8e908d5672f7af136
|
||||
PKG_SOURCE_VERSION:=631e61b7ab5d86f2f4c86756a117badff9fb0f2c
|
||||
|
||||
|
||||
ifeq ($(CONFIG_ENDPT_OPEN),y)
|
||||
|
||||
@@ -192,9 +192,9 @@ static int canyon_led_probe(struct platform_device *pdev)
|
||||
sk9822_set_color_str(leds, "00FF00");
|
||||
sk9822_update(leds);
|
||||
msleep(200);
|
||||
#endif
|
||||
sk9822_set_color_str(leds, "000000");
|
||||
sk9822_update(leds);
|
||||
#endif
|
||||
|
||||
printk(KERN_INFO "canyon led successfully probed\n");
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=4.0-2019-04-05
|
||||
PKG_VERSION:=4.0-2019-08-17
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=f7e8cee5bcc578cc9bb9307e31d0c057676a377c
|
||||
PKG_SOURCE_VERSION:=17b9e07a38753eab3964dffd0b0cc7da3118840a
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -51,6 +51,13 @@ define Package/icwmp_xmpp
|
||||
DEPENDS:=+libuci +libubox +libexpat +libstrophe
|
||||
endef
|
||||
|
||||
define Package/icwmp_twamp
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 twamp feature
|
||||
DEPENDS:=+libuci
|
||||
endef
|
||||
|
||||
define Package/icwmp_udpechoserver
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
@@ -208,6 +215,7 @@ define Package/icwmp_xmpp/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmp_xmppd $(1)/etc/init.d/icwmp_xmppd
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp_xmpp $(1)/etc/config
|
||||
$(CP) ./xmpp-files/* $(1)/
|
||||
endef
|
||||
|
||||
define Package/icwmp_udpechoserver/install
|
||||
@@ -219,6 +227,15 @@ define Package/icwmp_udpechoserver/install
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp_udpechoserver $(1)/etc/config
|
||||
endef
|
||||
|
||||
define Package/icwmp_twamp/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmp_twampd $(1)/usr/sbin/icwmp_twampd
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmp_twampd $(1)/etc/init.d/icwmp_twampd
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp_twamp $(1)/etc/config
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/include/libdatamodel
|
||||
@@ -255,4 +272,5 @@ $(eval $(call BuildPackage,libdatamodel))
|
||||
$(eval $(call BuildPackage,icwmp_stun))
|
||||
$(eval $(call BuildPackage,icwmp_xmpp))
|
||||
$(eval $(call BuildPackage,icwmp_udpechoserver))
|
||||
$(eval $(call BuildPackage,icwmp_twamp))
|
||||
$(eval $(call BuildPackage,icwmp-zstream))
|
||||
|
||||
21
icwmp/xmpp-files/etc/hotplug.d/iface/91-icwmp_xmpp
Normal file
21
icwmp/xmpp-files/etc/hotplug.d/iface/91-icwmp_xmpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -f /etc/config/cwmp_xmpp ] || exit 0
|
||||
|
||||
[ "$ACTION" == "ifup" ] || exit 0
|
||||
[ "$INTERFACE" == "loopback" ] && exit 0
|
||||
|
||||
local defwan=$(uci -q get cwmp.cpe.default_wan_interface)
|
||||
[ -n "$defwan" -a "$(uci -q get network.$defwan)" == "interface" -a "$defwan" != "$INTERFACE" ] && exit 0
|
||||
|
||||
local islan="$(uci -q get network.$INTERFACE.is_lan)"
|
||||
[ "$islan" == "1" ] && exit 0
|
||||
|
||||
local proto="$(uci -q get network.$INTERFACE.proto)"
|
||||
[ "$proto" == "none" ] && exit 0
|
||||
|
||||
local ifname="$(uci -q get network.$INTERFACE.ifname)"
|
||||
[ "${ifname:0:1}" == "@" ] && exit 0
|
||||
|
||||
/etc/init.d/icwmp_xmppd reload &
|
||||
|
||||
@@ -44,7 +44,6 @@ CONFIG_PACKAGE_juci-minidlna=y
|
||||
CONFIG_PACKAGE_juci-mod-status=y
|
||||
CONFIG_PACKAGE_juci-mod-system=y
|
||||
CONFIG_PACKAGE_juci-mwan3=y
|
||||
CONFIG_PACKAGE_juci-natalie-dect=y
|
||||
CONFIG_PACKAGE_juci-netmode=y
|
||||
CONFIG_PACKAGE_juci-network-device=y
|
||||
CONFIG_PACKAGE_juci-network-dsl=y
|
||||
|
||||
@@ -171,8 +171,8 @@ function genconfig {
|
||||
echo -e " -a|--list-all\t\tList all Customers and their board types"
|
||||
echo -e " -b|--boards\t\tList all board types"
|
||||
echo
|
||||
echo "Example ./iop genconfig vg50 TELIA"
|
||||
echo "(if no customerconfig is chosen the Inteno Config will be used)"
|
||||
echo "Example ./iop genconfig dg200 TELIA"
|
||||
echo "(if no customerconfig is chosen, iopsys config will be used)"
|
||||
echo
|
||||
exit 0
|
||||
}
|
||||
@@ -439,7 +439,7 @@ function genconfig {
|
||||
shift;
|
||||
done
|
||||
|
||||
CUSTREPO="${CUSTREPO:-git@private.inteno.se:customerconfigs}"
|
||||
CUSTREPO="${CUSTREPO:-git@dev.iopsys.eu:consumer/iopsys.git}"
|
||||
|
||||
setup_dirs
|
||||
create_and_copy_files "$@"
|
||||
|
||||
@@ -21,7 +21,6 @@ upd_ubi_id="" # num, UBI volume number for the volume name
|
||||
run_cleanup=0 # if set the cleanup should be run otherwise we skip it.
|
||||
run_mount_cleanup=0 # set if we should run umount in cleanup
|
||||
upd_kernel=0 # set to 1 if system has the kernel in own mtd partition
|
||||
upd_cfe=0 # set to 1 if system is using cfe as bootloader.
|
||||
log_stdout=1 # set to 0 to prevent the log to also print to stdout
|
||||
upd_noreboot=0 # set to 1 if we should not reboot after programming
|
||||
upd_forceimage=0 # set this to force upgrade even if image is for wrong board.
|
||||
|
||||
@@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=netmode
|
||||
PKG_VERSION:=0.2.0
|
||||
|
||||
PKG_SOURCE_VERSION:=9fa23664b3bdd963e4556f5921c9f9be1c9c578f
|
||||
PKG_SOURCE_VERSION:=6406325e72d7ddd0ff7aaa3a87669519021bdb11
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/netmoded
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ start_netmoded() {
|
||||
procd_open_instance
|
||||
procd_set_param command $NETMODED
|
||||
|
||||
procd_append_param command --verbose warning
|
||||
procd_append_param command --verbose warning -i macaddr
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
"CG300",
|
||||
"CG301",
|
||||
"EX400",
|
||||
"SDX810-AP"
|
||||
"SDX810-AP",
|
||||
"NORRLAND"
|
||||
],
|
||||
"acl" : [
|
||||
"admin",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
config wifi-status 'status'
|
||||
option wlan '1'
|
||||
option wps '1'
|
||||
option sched_status '0'
|
||||
option schedule '0'
|
||||
|
||||
@@ -8,9 +7,6 @@ config bandsteering 'bandsteering'
|
||||
option enabled '0'
|
||||
option policy '0'
|
||||
|
||||
config apsteering 'apsteering'
|
||||
option enabled '0'
|
||||
|
||||
config wifi-device 'wl0'
|
||||
option type 'broadcom'
|
||||
option country 'EU/13'
|
||||
@@ -47,10 +43,10 @@ config wifi-iface
|
||||
option cipher 'auto'
|
||||
option key '$WPAKEY'
|
||||
option gtk_rekey '3600'
|
||||
option macfilter '0'
|
||||
option wps_pbc '1'
|
||||
option macfilter 'disable'
|
||||
option wps '1'
|
||||
option wmf_bss_enable '1'
|
||||
option bss_max '32'
|
||||
option maxassoc '32'
|
||||
option ifname 'wl0'
|
||||
|
||||
config wifi-device 'wl1'
|
||||
@@ -87,9 +83,9 @@ config wifi-iface
|
||||
option cipher 'auto'
|
||||
option key '$WPAKEY'
|
||||
option gtk_rekey '3600'
|
||||
option macfilter '0'
|
||||
option wps_pbc '1'
|
||||
option macfilter 'disable'
|
||||
option wps '1'
|
||||
option wmf_bss_enable '1'
|
||||
option bss_max '32'
|
||||
option maxassoc '32'
|
||||
option ifname 'wl1'
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
],
|
||||
"excluded_boards" : [
|
||||
"*G*",
|
||||
"F*"
|
||||
"F*",
|
||||
"NORRLAND"
|
||||
],
|
||||
"uplink_band" : 'a',
|
||||
"downlink_band" : 'a b',
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
uci -q set owsd.ubusproxy.enable="0"
|
||||
uci -q commit owsd
|
||||
@@ -1,6 +1,5 @@
|
||||
config wifi-status 'status'
|
||||
option wlan '1'
|
||||
option wps '1'
|
||||
option sched_status '0'
|
||||
option schedule '0'
|
||||
|
||||
@@ -8,9 +7,6 @@ config bandsteering 'bandsteering'
|
||||
option enabled '0'
|
||||
option policy '0'
|
||||
|
||||
config apsteering 'apsteering'
|
||||
option enabled '0'
|
||||
|
||||
config wifi-device ra0
|
||||
option band b
|
||||
option channel auto
|
||||
@@ -27,7 +23,7 @@ config wifi-iface
|
||||
option encryption psk2
|
||||
option key $WPAKEY
|
||||
option ifname ra0
|
||||
option wps_pbc 1
|
||||
option wps 1
|
||||
|
||||
config wifi-device rai0
|
||||
option band a
|
||||
@@ -46,7 +42,7 @@ config wifi-iface
|
||||
option encryption psk2
|
||||
option key $WPAKEY
|
||||
option ifname rai0
|
||||
option wps_pbc 1
|
||||
option wps 1
|
||||
|
||||
config wifi-iface
|
||||
option device rai0
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
],
|
||||
"excluded_boards" : [
|
||||
"EX4*",
|
||||
"SDX810-AP"
|
||||
"SDX810-AP",
|
||||
"NORRLAND"
|
||||
],
|
||||
"credentials" : 0
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
config wifi-status 'status'
|
||||
option wlan '1'
|
||||
option wps '1'
|
||||
option sched_status '0'
|
||||
option schedule '0'
|
||||
|
||||
@@ -8,9 +7,6 @@ config bandsteering 'bandsteering'
|
||||
option enabled '0'
|
||||
option policy '0'
|
||||
|
||||
config apsteering 'apsteering'
|
||||
option enabled '0'
|
||||
|
||||
config wifi-device 'wl0'
|
||||
option type 'broadcom'
|
||||
option country 'EU/13'
|
||||
@@ -47,10 +43,10 @@ config wifi-iface
|
||||
option cipher 'auto'
|
||||
option key '$WPAKEY'
|
||||
option gtk_rekey '3600'
|
||||
option macfilter '0'
|
||||
option wps_pbc '1'
|
||||
option macfilter 'disable'
|
||||
option wps '1'
|
||||
option wmf_bss_enable '1'
|
||||
option bss_max '32'
|
||||
option maxassoc '32'
|
||||
option ifname 'wl0'
|
||||
|
||||
config wifi-device 'wl1'
|
||||
@@ -87,9 +83,9 @@ config wifi-iface
|
||||
option cipher 'auto'
|
||||
option key '$WPAKEY'
|
||||
option gtk_rekey '3600'
|
||||
option macfilter '0'
|
||||
option wps_pbc '1'
|
||||
option macfilter 'disable'
|
||||
option wps '1'
|
||||
option wmf_bss_enable '1'
|
||||
option bss_max '32'
|
||||
option maxassoc '32'
|
||||
option ifname 'wl1'
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
],
|
||||
"excluded_boards" : [
|
||||
"*G*",
|
||||
"F*"
|
||||
"F*",
|
||||
"NORRLAND"
|
||||
],
|
||||
"reboot" : 0,
|
||||
"credentials" : 0
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
config proxy
|
||||
option scope global
|
||||
option uplink wan
|
||||
list downlink lan
|
||||
|
||||
config proxy
|
||||
option scope global
|
||||
option uplink wan6
|
||||
list downlink lan
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
config wifi-status 'status'
|
||||
option wlan '1'
|
||||
option wps '1'
|
||||
option sched_status '0'
|
||||
option schedule '0'
|
||||
|
||||
@@ -8,9 +7,6 @@ config bandsteering 'bandsteering'
|
||||
option enabled '0'
|
||||
option policy '0'
|
||||
|
||||
config apsteering 'apsteering'
|
||||
option enabled '0'
|
||||
|
||||
config wifi-device ra0
|
||||
option band b
|
||||
option channel auto
|
||||
@@ -27,7 +23,7 @@ config wifi-iface
|
||||
option ssid iopsys-$BSSID4
|
||||
option encryption psk2
|
||||
option key $WPAKEY
|
||||
option wps_pbc 1
|
||||
option wps 1
|
||||
option ifname ra0
|
||||
|
||||
config wifi-device rai0
|
||||
@@ -47,6 +43,6 @@ config wifi-iface
|
||||
option ssid iopsys-$BSSID4
|
||||
option encryption psk2
|
||||
option key $WPAKEY
|
||||
option wps_pbc 1
|
||||
option wps 1
|
||||
option ifname rai0
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
NMTMPDIR=/var/netmodes
|
||||
OLD_MODE_FILE=/var/netmodes/old_mode
|
||||
CONF_BACKUP_DIR=/var/netmodes/backup/
|
||||
SWITCHMODELOCK="/tmp/switching_mode"
|
||||
MODEDIR=$(uci -q get netmode.setup.dir)
|
||||
MTK=0
|
||||
@@ -120,8 +121,13 @@ run_netmode_scripts() {
|
||||
local mode=$1
|
||||
local when=$2
|
||||
local script
|
||||
local path
|
||||
|
||||
path=$(readlink -f /etc/netmodes/$mode/)
|
||||
[ "${path:0:14}" == "/etc/netmodes/" ] || exit
|
||||
|
||||
if [ -d /etc/netmodes/$mode/scripts/$when ]; then
|
||||
logger -s -p user.info -t $0 "[netmode] Executing $when netmode scripts" >/dev/console
|
||||
logger -s -p user.info -t "netmode" "Executing $when netmode scripts" >/dev/console
|
||||
for script in $(ls /etc/netmodes/$mode/scripts/$when/); do
|
||||
sh /etc/netmodes/$mode/scripts/$when/$script
|
||||
done
|
||||
@@ -179,7 +185,12 @@ switch_netmode() {
|
||||
|
||||
run_netmode_scripts $curmode "pre"
|
||||
|
||||
logger -s -p user.info -t $0 "[netmode] Copying /etc/netmodes/$curmode in /etc/config" >/dev/console
|
||||
# make backup of current config before switching
|
||||
rm -rf $CONF_BACKUP_DIR
|
||||
mkdir -p $CONF_BACKUP_DIR
|
||||
cp -af /etc/config/* $CONF_BACKUP_DIR
|
||||
|
||||
logger -s -p user.info -t "netmode" "Copying /etc/netmodes/$curmode in /etc/config" >/dev/console
|
||||
|
||||
for file in $(ls /etc/netmodes/$curmode/); do
|
||||
case "$file" in
|
||||
@@ -204,11 +215,10 @@ switch_netmode() {
|
||||
case "$curmode" in
|
||||
repeater*)
|
||||
touch $SWITCHMODELOCK
|
||||
logger -s -p user.info -t $0 "Switching to $curmode mode" > /dev/console
|
||||
logger -s -p user.info -t "netmode" "Switching to $curmode mode" > /dev/console
|
||||
ubus call leds set '{"state" : "allflash"}'
|
||||
[ -f /etc/init.d/omcproxy ] && /etc/init.d/omcproxy stop
|
||||
[ -f /etc/init.d/igmpproxy ] && /etc/init.d/igmpproxy stop
|
||||
[ -f /etc/init.d/layer2 ] && /etc/init.d/layer2 reload
|
||||
[ -f /etc/init.d/macoffset ] && /etc/init.d/macoffset reload
|
||||
ubus call network reload
|
||||
wifi reload nodat
|
||||
ubus call router.network reload
|
||||
@@ -219,6 +229,7 @@ switch_netmode() {
|
||||
;;
|
||||
*)
|
||||
[ -f /etc/init.d/layer2 ] && /etc/init.d/layer2 reload
|
||||
[ -f /etc/init.d/macoffset ] && /etc/init.d/macoffset reload
|
||||
ubus call uci commit '{"config":"network"}'
|
||||
;;
|
||||
esac
|
||||
@@ -226,6 +237,28 @@ switch_netmode() {
|
||||
run_netmode_scripts $curmode "post"
|
||||
}
|
||||
|
||||
revert_netmode() {
|
||||
local from="$1"
|
||||
local to="$2"
|
||||
local rready="$3"
|
||||
|
||||
ubus call leds set '{"state" : "allflash"}'
|
||||
logger -s -p user.info -t "netmode" "Could not switch to '$from' mode; going back to '$to' mode" > /dev/console
|
||||
uci -q set netmode.setup.curmode="$to"
|
||||
uci -q set netmode.setup.repeaterready="$rready"
|
||||
uci commit netmode
|
||||
cp -af $CONF_BACKUP_DIR/* /etc/config/
|
||||
sync
|
||||
rm -rf $CONF_BACKUP_DIR
|
||||
rm -rf $OLD_MODE_FILE
|
||||
|
||||
logger -s -p user.info -t "netmode" "Restarting network services" > /dev/console
|
||||
ubus call network reload
|
||||
wifi reload
|
||||
ubus call router.network reload
|
||||
ubus call leds set '{"state" : "normal"}'
|
||||
}
|
||||
|
||||
wificontrol_takes_over() {
|
||||
local ret
|
||||
[ -f /sbin/wificontrol ] || return
|
||||
@@ -260,10 +293,10 @@ wait_for_netmode_handler() {
|
||||
|
||||
netmode_get_ip_type() {
|
||||
[ -n "$(echo $1 | grep -E '^(192\.168|10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.)')" ] && {
|
||||
logger -t "[netmode]" "netmode_get_ip_type: ip $1 is private"
|
||||
logger -t $0 "netmode_get_ip_type: ip $1 is private"
|
||||
echo "private"
|
||||
} || {
|
||||
logger -t "[netmode]" "netmode_get_ip_type: ip $1 is public"
|
||||
logger -t $0 "netmode_get_ip_type: ip $1 is public"
|
||||
echo "public"
|
||||
}
|
||||
}
|
||||
@@ -351,7 +384,7 @@ populate_netmodes() {
|
||||
done
|
||||
|
||||
local hardware=$(db get hw.board.hardware)
|
||||
local keys lang desc exp exclude
|
||||
local keys lang desc exp exclude support
|
||||
for mode in $(ls $MODEDIR); do
|
||||
|
||||
case "$mode" in
|
||||
@@ -381,6 +414,23 @@ populate_netmodes() {
|
||||
done
|
||||
json_select ..
|
||||
[ $exclude -eq 1 ] && continue
|
||||
elif json_select supported_boards; then
|
||||
support=0
|
||||
_i=1
|
||||
while json_get_var board $_i; do
|
||||
case "$hardware" in
|
||||
$board)
|
||||
support=1
|
||||
break
|
||||
;;
|
||||
esac
|
||||
_i=$((_i+1))
|
||||
done
|
||||
json_select ..
|
||||
[ $support -eq 1 ] || {
|
||||
uci -q delete netmode.$mode
|
||||
continue
|
||||
}
|
||||
fi
|
||||
|
||||
if json_select acl; then
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
WIFISTA=0
|
||||
STACONF="/etc/Wireless/iNIC/iNIC_ap.dat"
|
||||
[ -f $STACONF ] && WIFISTA=1
|
||||
|
||||
get_if_creds() {
|
||||
local section=$1
|
||||
local network=$2
|
||||
@@ -84,9 +88,22 @@ duplicate_if_single_radio() {
|
||||
done
|
||||
}
|
||||
|
||||
get_wifi_iface_cfgstr() {
|
||||
get_cfgno() {
|
||||
config_get ifname "$1" ifname
|
||||
[ "$ifname" == "$2" ] && echo "wireless.$1"
|
||||
}
|
||||
config_load wireless
|
||||
config_foreach get_cfgno wifi-iface $1
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
list)
|
||||
echo '{ "get_creds": { "network": "str", "file": "str" }, "set_creds": { "file": "str", "from_gui": "str" } }'
|
||||
if [ $WIFISTA -eq 1 ]; then
|
||||
echo '{ "get_creds": { "network": "str", "file": "str" }, "set_creds": { "file": "str", "from_gui": "str" }, "connect": { "ssid": "str", "key": "str" }, "forget_network": {}, "wps_enroll": {}, "wps_stop": {} }'
|
||||
else
|
||||
echo '{ "get_creds": { "network": "str", "file": "str" }, "set_creds": { "file": "str", "from_gui": "str" } }'
|
||||
fi
|
||||
;;
|
||||
call)
|
||||
case "$2" in
|
||||
@@ -136,6 +153,88 @@ case "$1" in
|
||||
json_dump
|
||||
|
||||
;;
|
||||
connect)
|
||||
local ssid key enc auth wetif wetcfg wetssid wetkey code
|
||||
read input
|
||||
json_load "$input"
|
||||
json_get_var ssid ssid
|
||||
json_get_var key key
|
||||
code=1
|
||||
[ $WIFISTA -eq 1 ] && wetif="$(uci -q get wireless.$(uci show wireless | grep 'mode=.*wet.*' | cut -d'.' -f2 | head -1).ifname)"
|
||||
if [ -s /sys/class/net/$wetif/operstate ]; then
|
||||
wetcfg="$(get_wifi_iface_cfgstr $wetif)"
|
||||
wetssid="$(uci -q get $wetcfg.ssid)"
|
||||
wetkey="$(uci -q get $wetcfg.key)"
|
||||
ssid="${ssid:-$wetssid}"
|
||||
key="${key:-$wetkey}"
|
||||
if [ -n "$key" ]; then
|
||||
auth="WPA2PSK"
|
||||
enc="AES"
|
||||
else
|
||||
auth="OPEN"
|
||||
enc="NONE"
|
||||
fi
|
||||
iwpriv $wetif set ApCliEnable=0
|
||||
iwpriv $wetif set ApCliSsid="$ssid"
|
||||
iwpriv $wetif set ApCliAuthMode="$auth"
|
||||
iwpriv $wetif set ApCliEncrypType="$enc"
|
||||
iwpriv $wetif set ApCliWPAPSK="$key"
|
||||
iwpriv $wetif set ApCliEnable=1
|
||||
iwpriv $wetif set ApCliAutoConnect=1
|
||||
code=0
|
||||
fi
|
||||
json_init
|
||||
json_add_int "code" $code
|
||||
json_dump
|
||||
;;
|
||||
forget_network)
|
||||
local wetif wetcfg code
|
||||
code=1
|
||||
[ $WIFISTA -eq 1 ] && wetif="$(uci -q get wireless.$(uci show wireless | grep 'mode=.*wet.*' | cut -d'.' -f2 | head -1).ifname)"
|
||||
if [ -s /sys/class/net/$wetif/operstate ]; then
|
||||
wetcfg="$(get_wifi_iface_cfgstr $wetif)"
|
||||
uci -q set $wetcfg.ssid=""
|
||||
uci -q set $wetcfg.key=""
|
||||
uci -q commit wireless
|
||||
|
||||
sed -i "s/ApCliSsid=.*/ApCliSsid=/g" $STACONF
|
||||
sed -i "s/ApCliAuthMode=.*/ApCliAuthMode=/g" $STACONF
|
||||
sed -i "s/ApCliEncrypType=.*/ApCliEncrypType=/g" $STACONF
|
||||
sed -i "s/ApCliWPAPSK=.*/ApCliWPAPSK=/g" $STACONF
|
||||
|
||||
ifconfig $wetif down
|
||||
ifconfig $wetif up
|
||||
|
||||
code=0
|
||||
fi
|
||||
json_init
|
||||
json_add_int "code" $code
|
||||
json_dump
|
||||
;;
|
||||
wps_enroll)
|
||||
local wetif
|
||||
[ $WIFISTA -eq 1 ] && wetif="$(uci -q get wireless.$(uci show wireless | grep 'mode=.*wet.*' | cut -d'.' -f2 | head -1).ifname)"
|
||||
if [ -n "$wetif" ]; then
|
||||
iwpriv $wetif set ApCliEnable=0
|
||||
iwpriv $wetif set WscConfMode=1
|
||||
iwpriv $wetif set WscMode=2
|
||||
iwpriv $wetif set ApCliEnable=1
|
||||
iwpriv $wetif set WscGetConf=1
|
||||
fi
|
||||
json_init
|
||||
json_add_string "ifname" $wetif
|
||||
json_dump
|
||||
;;
|
||||
wps_stop)
|
||||
local wetif
|
||||
[ $WIFISTA -eq 1 ] && wetif="$(uci -q get wireless.$(uci show wireless | grep 'mode=.*wet.*' | cut -d'.' -f2 | head -1).ifname)"
|
||||
if [ -n "$wetif" ]; then
|
||||
iwpriv $wetif set WscStop=1
|
||||
fi
|
||||
json_init
|
||||
json_add_string "ifname" $wetif
|
||||
json_dump
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
52
obuspa/Makefile
Normal file
52
obuspa/Makefile
Normal file
@@ -0,0 +1,52 @@
|
||||
#
|
||||
# Copyright (C) 2019 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=014d7ec63331b3b745e8af53a4be1b52693e2a6f
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/obuspa.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/obuspa
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=USP agent
|
||||
DEPENDS:=+libcoap +libopenssl +libcurl +libsqlite3 +libcares +libubox +libubus +libblobmsg-json +uspd
|
||||
endef
|
||||
|
||||
define Package/obuspa/description
|
||||
OB-USP-AGENT is a system daemon providing a User Services Platform (USP) Agent.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
ifneq ($(CONFIG_USE_MUSL),)
|
||||
TARGET_CFLAGS += -DUSE_MUSL
|
||||
endif
|
||||
|
||||
#define Build/Prepare
|
||||
# $(CP) -rf ./obuspa/* $(PKG_BUILD_DIR)/
|
||||
#endef
|
||||
|
||||
define Package/obuspa/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspa $(1)/usr/sbin/
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,obuspa))
|
||||
14
obuspa/files/etc/config/obuspa
Normal file
14
obuspa/files/etc/config/obuspa
Normal file
@@ -0,0 +1,14 @@
|
||||
config controller
|
||||
option endpointid 'self::usp-controller.com'
|
||||
|
||||
config mtp
|
||||
option enable 'true'
|
||||
option protocol 'STOMP'
|
||||
option destination 'uspq'
|
||||
|
||||
config connection
|
||||
option host 'usp-controller.com'
|
||||
option username 'username'
|
||||
option password 'password'
|
||||
option encryption 'false'
|
||||
|
||||
105
obuspa/files/etc/init.d/obuspa
Executable file
105
obuspa/files/etc/init.d/obuspa
Executable file
@@ -0,0 +1,105 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
PROG=/usr/sbin/obuspa
|
||||
|
||||
CTRL_PATH="Device.LocalAgent.Controller.1."
|
||||
MTP_PATH="Device.LocalAgent.MTP.1."
|
||||
CONN_PATH="Device.STOMP.Connection.1."
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t obuspa -p debug
|
||||
}
|
||||
|
||||
db_set() {
|
||||
log "DBSET param|${1}| value|${2}|"
|
||||
${PROG} -c dbset ${1} ${2}
|
||||
}
|
||||
|
||||
validate_controller_section()
|
||||
{
|
||||
uci_validate_section obuspa controller "${1}" \
|
||||
'endpointid:string:"self:usp-controller.com"'
|
||||
}
|
||||
|
||||
validate_mtp_section()
|
||||
{
|
||||
uci_validate_section obuspa mtp "${1}" \
|
||||
'enable:bool:true' \
|
||||
'protocol:string:"STOMP"' \
|
||||
'destination:string:'
|
||||
}
|
||||
|
||||
validate_connection_section()
|
||||
{
|
||||
uci_validate_section obuspa connection "${1}" \
|
||||
'host:string:"usp-controller.com"' \
|
||||
'username:string:username' \
|
||||
'password:string:password' \
|
||||
'encryption:bool:true'
|
||||
}
|
||||
|
||||
configure_controller() {
|
||||
local endpointid
|
||||
|
||||
validate_controller_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
db_set "${CTRL_PATH}EndpointID" ${endpointid}
|
||||
}
|
||||
|
||||
configure_mtp() {
|
||||
local protocol enable destination
|
||||
|
||||
validate_mtp_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
db_set "${MTP_PATH}Enable" ${enable}
|
||||
db_set "${MTP_PATH}Protocol" ${protocol}
|
||||
db_set "${MTP_PATH}STOMP.Destination" ${destination}
|
||||
}
|
||||
|
||||
configure_connection() {
|
||||
local host username password encryption
|
||||
|
||||
validate_connection_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
db_set "${CONN_PATH}Host" ${host}
|
||||
db_set "${CONN_PATH}Username" ${username}
|
||||
db_set "${CONN_PATH}Password" ${password}
|
||||
db_set "${CONN_PATH}X_ARRIS-COM_EnableEncryption" ${encryption}
|
||||
}
|
||||
|
||||
db_init() {
|
||||
[ -f /tmp/usp.db ] && rm -f /tmp/usp.db
|
||||
|
||||
config_load obuspa
|
||||
config_foreach configure_controller controller
|
||||
config_foreach configure_mtp mtp
|
||||
config_foreach configure_connection connection
|
||||
}
|
||||
start_service() {
|
||||
db_init
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG}
|
||||
procd_append_param command -p -v 4
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_config_trigger "config.change" "obuspa" /etc/init.d/obuspa restart
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
choice
|
||||
prompt "Select Bus"
|
||||
prompt "Select IPC Bus"
|
||||
default OWSD_USE_UBUS
|
||||
depends on PACKAGE_owsd
|
||||
help
|
||||
Select which bus to compile owsd for
|
||||
Select which IPC bus to compile owsd for
|
||||
|
||||
config OWSD_USE_DBUS
|
||||
bool "Use DBUS"
|
||||
@@ -15,3 +15,11 @@ config OWSD_USE_DBUS_UBUS
|
||||
bool "Use UBUS and DBUS"
|
||||
|
||||
endchoice
|
||||
|
||||
config OWSD_UPROXYD
|
||||
bool "Enable UBUS Proxy Daemon"
|
||||
default y if OWSD_USE_UBUS || OWSD_USE_DBUS_UBUS
|
||||
help
|
||||
Enabling uproxyd automates detection of other
|
||||
UBUS-X enabled devices in the network
|
||||
|
||||
|
||||
@@ -5,25 +5,27 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=owsd
|
||||
PKG_VERSION:=1.1.1
|
||||
PKG_VERSION:=1.1.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/owsd.git
|
||||
PKG_SOURCE_VERSION:=f0eedeb6fd061edf3784d6bf86fa60b176bf3fe7
|
||||
PKG_SOURCE_VERSION:=f1d6bff1971640006b3137b342fafa1c40cfb835
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_CONFIG_DEPENDS:=CONFIG_OWSD_USE_DBUS CONFIG_OWSD_USE_UBUS CONFIG_OWSD_USE_DBUS_UBUS
|
||||
PKG_CONFIG_DEPENDS:=CONFIG_OWSD_USE_DBUS CONFIG_OWSD_USE_UBUS CONFIG_OWSD_USE_DBUS_UBUS CONFIG_OWSD_UPROXYD
|
||||
|
||||
USE_UBUS-y:=-DWSD_HAVE_UBUS=ON
|
||||
USE_DBUS-y:=-DWSD_HAVE_DBUS=ON
|
||||
USE_BOTH-y:=${USE_UBUS-y} ${USE_DBUS-y}
|
||||
USE_UPROXYD-y:=-DOWSD_UPROXYD=ON
|
||||
|
||||
CMAKE_OPTIONS:=${USE_UBUS-${CONFIG_OWSD_USE_UBUS}} \
|
||||
${USE_DBUS-${CONFIG_OWSD_USE_DBUS}} \
|
||||
${USE_BOTH-${CONFIG_OWSD_USE_DBUS_UBUS}}
|
||||
${USE_BOTH-${CONFIG_OWSD_USE_DBUS_UBUS}} \
|
||||
${USE_UPROXYD-${CONFIG_OWSD_UPROXYD}}
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
@@ -51,14 +53,17 @@ endef
|
||||
define Package/owsd/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owsd $(1)/usr/bin/owsd
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uproxyd $(1)/sbin/uproxyd
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/owsd.init $(1)/etc/init.d/owsd
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) ./files/owsd.config $(1)/etc/config/owsd
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_BIN) ./files/owsd.hotplug $(1)/etc/hotplug.d/iface/55-owsd
|
||||
# $(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
# $(INSTALL_BIN) ./files/owsd.uci_default $(1)/etc/uci-defaults/55-owsd-interfaces
|
||||
ifeq ($(CONFIG_OWSD_UPROXYD),y)
|
||||
$(CP) ./uproxy-files/* $(1)/
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/owsd-testdata
|
||||
|
||||
@@ -5,8 +5,8 @@ config owsd 'global'
|
||||
# option www_maxage '3600'
|
||||
|
||||
# ubusproxy is enbaled if: enable = 1 or peer exists or path exists
|
||||
config ubusproxy 'ubusproxy'
|
||||
option enable '0'
|
||||
#config ubusproxy 'ubusproxy'
|
||||
# option enable '0'
|
||||
# list peer 'wss://repeater_hostname/'
|
||||
# list peer 'wss://192.168.1.101/'
|
||||
# list object 'router.*'
|
||||
@@ -30,12 +30,12 @@ config owsd-listen 'lan'
|
||||
option whitelist_interface_as_origin '1'
|
||||
option whitelist_dhcp_domains '1'
|
||||
|
||||
config owsd-listen 'lan_8080'
|
||||
option port '8080'
|
||||
option interface 'lan'
|
||||
option ipv6 'on'
|
||||
option whitelist_interface_as_origin '1'
|
||||
option whitelist_dhcp_domains '1'
|
||||
#config owsd-listen 'lan_8080'
|
||||
# option port '8080'
|
||||
# option interface 'lan'
|
||||
# option ipv6 'on'
|
||||
# option whitelist_interface_as_origin '1'
|
||||
# option whitelist_dhcp_domains '1'
|
||||
|
||||
#config owsd-listen 'lan_https'
|
||||
# option port '443'
|
||||
|
||||
@@ -269,43 +269,49 @@ start_service() {
|
||||
[ -n "${redirect}" ] && procd_append_param command -r"${redirect}"
|
||||
[ -n "${www_maxage}" ] && procd_append_param command -t"${www_maxage}"
|
||||
|
||||
validate_owsd_ubusproxy || {
|
||||
echo "Ubusproxy validation failed"
|
||||
return 1
|
||||
#validate_owsd_ubusproxy || {
|
||||
# echo "Ubusproxy validation failed"
|
||||
# return 1
|
||||
#}
|
||||
|
||||
validate_owsd_ubusproxy && {
|
||||
if [ "${enable}" -eq 1 ]; then
|
||||
procd_append_param command -U
|
||||
|
||||
[ -n "${peer_cert}" ] && procd_append_param command -C"${peer_cert}"
|
||||
[ -n "${peer_key}" ] && procd_append_param command -K"${peer_key}"
|
||||
[ -n "${peer_ca}" ] && procd_append_param command -A"${peer_ca}"
|
||||
|
||||
append_peer () {
|
||||
[ -n "$1" ] && procd_append_param command -P"$1"
|
||||
}
|
||||
|
||||
append_object () {
|
||||
[ -n "$1" ] && procd_append_param command -U"$1"
|
||||
}
|
||||
|
||||
config_list_foreach "ubusproxy" "peer" append_peer
|
||||
config_list_foreach "ubusproxy" "object" append_object
|
||||
|
||||
[ "${prefix}" == "mac" ] && procd_append_param command -F"mac"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "${enable}" -eq 1 ]; then
|
||||
procd_append_param command -U
|
||||
|
||||
[ -n "${peer_cert}" ] && procd_append_param command -C"${peer_cert}"
|
||||
[ -n "${peer_key}" ] && procd_append_param command -K"${peer_key}"
|
||||
[ -n "${peer_ca}" ] && procd_append_param command -A"${peer_ca}"
|
||||
|
||||
append_peer () {
|
||||
[ -n "$1" ] && procd_append_param command -P"$1"
|
||||
}
|
||||
|
||||
append_object () {
|
||||
[ -n "$1" ] && procd_append_param command -U"$1"
|
||||
}
|
||||
|
||||
config_list_foreach "ubusproxy" "peer" append_peer
|
||||
config_list_foreach "ubusproxy" "object" append_object
|
||||
|
||||
[ "${prefix}" == "mac" ] && procd_append_param command -F"mac"
|
||||
fi
|
||||
|
||||
config_foreach parse_owsd_iface "owsd-listen"
|
||||
|
||||
# procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
|
||||
procd_close_instance
|
||||
# Start uproxyd
|
||||
procd_open_instance
|
||||
procd_set_param command $UPROXYD
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
|
||||
if [ "${enable}" -eq 1 ]; then
|
||||
# Start uproxyd
|
||||
procd_open_instance
|
||||
procd_set_param command $UPROXYD
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
#stop_service()
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
MGMT_INTERFACES=""
|
||||
OWSD_INTERFACES=""
|
||||
NOT_DEFAULT=0
|
||||
|
||||
mgmt_interfaces() {
|
||||
local interface=$1
|
||||
[ "$interface" == "loopback" ] && return
|
||||
[ "$interface" == "lan" ] && return
|
||||
[ "$interface" == "wan" ] && return
|
||||
[ "$interface" == "wan6" ] && return
|
||||
|
||||
local type proto
|
||||
config_get type $interface type
|
||||
config_get proto $interface proto "none"
|
||||
[ "$type" == "bridge" -a "$proto" == "none" ] && return
|
||||
|
||||
local is_lan
|
||||
config_get is_lan $interface is_lan
|
||||
[ "$is_lan" == "1" ] && return
|
||||
|
||||
local ifname
|
||||
config_get ifname $interface ifname
|
||||
[ "${ifname:0:1}" == "@" ] && return
|
||||
|
||||
MGMT_INTERFACES="$MGMT_INTERFACES $interface"
|
||||
}
|
||||
|
||||
owsd_interfaces() {
|
||||
local config=$1
|
||||
local interface
|
||||
config_get interface $config interface
|
||||
[ "$interface" == "loopback" ] && return
|
||||
[ "$interface" == "lan" ] && return
|
||||
[ "$interface" == "wan" ] && return
|
||||
[ "$interface" == "wan6" ] && return
|
||||
|
||||
OWSD_INTERFACES="$OWSD_INTERFACES $interface"
|
||||
|
||||
NOT_DEFAULT=1
|
||||
}
|
||||
|
||||
not_owsd() {
|
||||
local interface=$1
|
||||
local there=0
|
||||
for owsd in $OWSD_INTERFACES; do
|
||||
if [ "$interface" == "$owsd" ]; then
|
||||
there=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
return $there
|
||||
}
|
||||
|
||||
config_load network
|
||||
config_foreach mgmt_interfaces interface
|
||||
|
||||
config_load owsd
|
||||
config_foreach owsd_interfaces owsd-listen
|
||||
|
||||
if [ $NOT_DEFAULT -eq 0 ]; then
|
||||
for mgmt in $MGMT_INTERFACES; do
|
||||
if $(not_owsd $mgmt); then
|
||||
uci -q set owsd.$mgmt=owsd-listen
|
||||
uci -q set owsd.$mgmt.port=80
|
||||
uci -q set owsd.$mgmt.interface="$mgmt"
|
||||
uci -q set owsd.$mgmt.ipv6="on"
|
||||
uci -q set owsd.$mgmt.whitelist_interface_as_origin="1"
|
||||
uci -q set owsd.$mgmt.origin="*"
|
||||
|
||||
uci -q set owsd.$mgmt"_8080"=owsd-listen
|
||||
uci -q set owsd.$mgmt"_8080".port=8080
|
||||
uci -q set owsd.$mgmt"_8080".interface="$mgmt"
|
||||
uci -q set owsd.$mgmt"_8080".ipv6="on"
|
||||
uci -q set owsd.$mgmt"_8080".whitelist_interface_as_origin="1"
|
||||
uci -q set owsd.$mgmt"_8080".origin="*"
|
||||
|
||||
uci commit owsd
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
19
owsd/uproxy-files/etc/ubusx/ubusxDemoCA.crt
Normal file
19
owsd/uproxy-files/etc/ubusx/ubusxDemoCA.crt
Normal file
@@ -0,0 +1,19 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDHzCCAgegAwIBAgIJAKmrHnhgM9CZMA0GCSqGSIb3DQEBCwUAMCYxJDAiBgNV
|
||||
BAMMG3Jvb3QgQ0EgZm9yIGlvcHN5cyBnYXRld2F5czAeFw0xOTA0MjcxMDQ4MTJa
|
||||
Fw0yNzA3MTQxMDQ4MTJaMCYxJDAiBgNVBAMMG3Jvb3QgQ0EgZm9yIGlvcHN5cyBn
|
||||
YXRld2F5czCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM7i0RqyVvpl
|
||||
WVm4ioXV7H/5oII6nmlGb+eQM4p0QBujhyvwtT6z0L0KXwwWRGFdYBNChBfsi9zm
|
||||
AAhgQaR5D/QPRGDIiB69O3iBd2JFqzxo1rkN/nUMbZ2OplXRscmOs34yT68hV0ov
|
||||
nv0iAr06bzyoa2sxOfN262Ic2tKYG5UYtRVnbaX40U80DYm1tvoeJfZgTiZmeuky
|
||||
7t6PrWhJ+tfKdzK+IGDsIQ3k4k+3AfS8dwDEBbGocFhx+sOG/yv5OhGlZ3dH9toz
|
||||
Gq+xrkawoa0hkKKVOFhNINdHcPG0UH7iET779nsgylT/8OGkQG3vLSBkVJ8rAaAh
|
||||
j9vKBWdxIG0CAwEAAaNQME4wHQYDVR0OBBYEFMsfty2iwKt5U+WLdsYpgYVX1ZX2
|
||||
MB8GA1UdIwQYMBaAFMsfty2iwKt5U+WLdsYpgYVX1ZX2MAwGA1UdEwQFMAMBAf8w
|
||||
DQYJKoZIhvcNAQELBQADggEBALv1l6C94e6Xos4DkiIDToLQasO0nQLcq3eZhsa6
|
||||
XJgWnBcoe7p4iLXzHzutacwTj/mx+ptbLkyqPzvIsufKeQf3hat5ICtCLZOpOW55
|
||||
fPc4GY4TMixEJDzt3L5U89BXVFTSh7aY5KbphD9zQgYcy1IpkEEPtSOL8B8KWdHb
|
||||
lrW1AE9p7YLHb4YgtS6NjEN04a1wHug/flcfes4u9DOnmJzSih9p8UtQP86hjiPK
|
||||
C9znwLrbbrJANz4D6QSTtTT+qi8iQo68sKXYLyUC10Kp19pq1FMnfY1IkCcBDSip
|
||||
hbGdxwd4txkrl52YZyuo14mXRGP/c2lvEO0a1P6IpR2kMj4=
|
||||
-----END CERTIFICATE-----
|
||||
27
owsd/uproxy-files/etc/ubusx/ubusxDemoCA.key
Normal file
27
owsd/uproxy-files/etc/ubusx/ubusxDemoCA.key
Normal file
@@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpAIBAAKCAQEAzuLRGrJW+mVZWbiKhdXsf/mggjqeaUZv55AzinRAG6OHK/C1
|
||||
PrPQvQpfDBZEYV1gE0KEF+yL3OYACGBBpHkP9A9EYMiIHr07eIF3YkWrPGjWuQ3+
|
||||
dQxtnY6mVdGxyY6zfjJPryFXSi+e/SICvTpvPKhrazE583brYhza0pgblRi1FWdt
|
||||
pfjRTzQNibW2+h4l9mBOJmZ66TLu3o+taEn618p3Mr4gYOwhDeTiT7cB9Lx3AMQF
|
||||
sahwWHH6w4b/K/k6EaVnd0f22jMar7GuRrChrSGQopU4WE0g10dw8bRQfuIRPvv2
|
||||
eyDKVP/w4aRAbe8tIGRUnysBoCGP28oFZ3EgbQIDAQABAoIBACYwBcr4ukdT589A
|
||||
2gjkONhSeocvTMg/4S4MFwdqd97iK3Q35SyiwlfyjyLLBWo3cyF6+Kj118c5iS4C
|
||||
nns+gWxaWRPIUB/kbBLNSv0PwRDQhTn5VEvEtIMNrrROlZOPzJ/xp3W7IMKn0aAF
|
||||
5B2LqLa4m8NYfcrr23zruJSA0S6O4O9+E2ilI0bLwMPmSEbrRhDYvOUUTP5bqWAy
|
||||
DUcOZQp26LIbx9B1gBA9XcQADjSR59ZY0vUCh6Rhd9qmJ2ZVAj78hv7yLkGOUOwS
|
||||
O9LnvBQjb7AZ9YNntTx/YlNLtbEMLfhv1/tpBZ8jVa9ZvCNBWNmrzpSCIEzhcQUY
|
||||
jv+WGyECgYEA718+bHissVTet0kcuC18XCbdg7LelOws9aSo0ZgQaRCr7BjTXNMi
|
||||
NrQPira0QmGyWtQ5eoxLw0s44b8ol0I+zwqA9q5bRMvdNUaZxE01ObC0aaZx0Sex
|
||||
51exHN7knVyWS94kMGBYQRQW5ElrmOTUUFN9WOVwsIuhx22hUd8XZ4UCgYEA3UHf
|
||||
jWzbdWlOw8ZB7hOu6MS46IFuKdztblHu3n+qw65x9i6VHy5yL8+dDOiFa8earpyP
|
||||
bPNuDr0URTj6Xu4OzQ04gLXE3SXghSKZPSOq9UoJ56fw6wXq2Dtz5rFGD4Mt+WHR
|
||||
/NiWccKSkA+x0bu8ab2hYBIAeURfqSQfAcmiRckCgYEAmTElLBpWuu6L0lTyElTZ
|
||||
38fnwB87H6e+Zj7I48ojxnmq7WA99IwSu1ulDqs61bjcghCL8IfU/NkpQCAshBEb
|
||||
TTl1q2mOc4rcuPnD8sNOqusRqwOgl7CFxH50lPt459SXQ1qZYnRmRs/qjpMGT0Uz
|
||||
M20bLUc5RWM3WAArW9AglFkCgYAdk+XHqSq5SmeeIk3D/tueAFZbtpm8fO08lzVg
|
||||
hx6T5CkV6OpEbdgT7iQnipnza46RExrVTMGEtOAV1OUbdaWC4eaQxjvX+G1IPvTP
|
||||
SIpdGhWy4y+Aq5zWZTQ8PayI/FdUBDCnJWkPMhyXp5F04Szx0cjV5/IqQ+qp2MtQ
|
||||
WN0ZiQKBgQDT7UFw5svbtjzE6pcjImRSDI4BwmA8F6C7bkK3M5mu10k+/kr5jDGG
|
||||
xgByyY61TY3TpHKLOmuxqKb3nOy8umPlFt3P7xpYTuV5+dZRrbIFKtDy2uKkYi9E
|
||||
N5xyVfanlXhlU7JoJtc2Xtkdjr5SwESHjNSjR8jDG/sd7opjeltOZg==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
1
owsd/uproxy-files/etc/ubusx/ubusxDemoCA.srl
Normal file
1
owsd/uproxy-files/etc/ubusx/ubusxDemoCA.srl
Normal file
@@ -0,0 +1 @@
|
||||
514CD4028F0A688DAD8236D20F352623455A4D74
|
||||
18
owsd/uproxy-files/etc/ubusx/ubusx_demo_only.crt
Normal file
18
owsd/uproxy-files/etc/ubusx/ubusx_demo_only.crt
Normal file
@@ -0,0 +1,18 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIC+zCCAeMCFFFM1AKPCmiNrYI20g81JiNFWk10MA0GCSqGSIb3DQEBCwUAMCYx
|
||||
JDAiBgNVBAMMG3Jvb3QgQ0EgZm9yIGlvcHN5cyBnYXRld2F5czAeFw0xOTA2MjQx
|
||||
NzEwMjhaFw0yOTA2MjExNzEwMjhaME4xCzAJBgNVBAYTAlNFMRIwEAYDVQQIDAlT
|
||||
dG9ja2hvbG0xFTATBgNVBAoMDGlvcHN5cywgSW5jLjEUMBIGA1UEAwwLVUJVUy1Y
|
||||
IERlbW8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDosnAz7cNKUCWZ
|
||||
9+qFs8PpV1J1o+Eq6Hv3Bc5ceNrPxcEsE2vDWQdl7QXU9Je++xILSxfvljHIUO7D
|
||||
8AOcH03NO3N0F1H4KhmYIRjTKogQL8y/YIGFkzL4bZXwXRtvzXxMYNtdX4Lbdiyc
|
||||
AtGTiSWJ3zBtShPGPFqgR4JpYmf3VaVy/f74tRdUL86rnVNaU5OIBMHGLLxwMf2Z
|
||||
w3MPKSNj1ATcNoegKvMvHpd7FE2o5lDgFkUV3b8QqcAFTrmLXx6mYYpo9Fo1KHrA
|
||||
6SiUP0KQ/lkQ28yfkvzmN4JpJtLpomzscn9nmJfbI5g3GezSGGFHDAyW/Y2c+VPN
|
||||
N9C9n/NhAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAFEBujnBMhFVqLUPnDM41Cd0
|
||||
ZzbY5n/haBN885xQP0tNdCJ9qN0L8dr8bDe1IR02WHZ4UIXzvOj20Nu2+AFP1OCG
|
||||
CEEPLTQwlaJhaBzhnfLaxb7XCHqVodKBiYDYLQLFNdY9wYOKvyNI5xXMtPbH5fUK
|
||||
GJA4bZTbL5c4iaqtdXwLE/6a9FCtfGsv9k70tPw+KYR4tcA2t3SS2Oe/bGRrj5yQ
|
||||
Tjy0P7R033S4GlrsCRa7sRGg8yd7TgNpGsgyncsFRLHDG4V71I9NhOkoHR64oUfT
|
||||
YVPt/16TIi31vF5FJO4TJtbA2wEpUWPk7x2VjIOvvauMoYE6Hf3YLatzdaIQNHo=
|
||||
-----END CERTIFICATE-----
|
||||
16
owsd/uproxy-files/etc/ubusx/ubusx_demo_only.csr
Normal file
16
owsd/uproxy-files/etc/ubusx/ubusx_demo_only.csr
Normal file
@@ -0,0 +1,16 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIICkzCCAXsCAQAwTjELMAkGA1UEBhMCU0UxEjAQBgNVBAgMCVN0b2NraG9sbTEV
|
||||
MBMGA1UECgwMaW9wc3lzLCBJbmMuMRQwEgYDVQQDDAtVQlVTLVggRGVtbzCCASIw
|
||||
DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOiycDPtw0pQJZn36oWzw+lXUnWj
|
||||
4Sroe/cFzlx42s/FwSwTa8NZB2XtBdT0l777EgtLF++WMchQ7sPwA5wfTc07c3QX
|
||||
UfgqGZghGNMqiBAvzL9ggYWTMvhtlfBdG2/NfExg211fgtt2LJwC0ZOJJYnfMG1K
|
||||
E8Y8WqBHgmliZ/dVpXL9/vi1F1QvzqudU1pTk4gEwcYsvHAx/ZnDcw8pI2PUBNw2
|
||||
h6Aq8y8el3sUTajmUOAWRRXdvxCpwAVOuYtfHqZhimj0WjUoesDpKJQ/QpD+WRDb
|
||||
zJ+S/OY3gmkm0umibOxyf2eYl9sjmDcZ7NIYYUcMDJb9jZz5U8030L2f82ECAwEA
|
||||
AaAAMA0GCSqGSIb3DQEBCwUAA4IBAQDWLgiuSq41EX4J5v5RH2gE3Ywr1FdzPMMe
|
||||
SCJxYL3JOcIvDl0aNyx2bAd9Gc6Zj8uRXT8gDsB3cEgAoHdGjiZB0uoNV/Auz6kS
|
||||
mYNnmpcZfAw775cBQpYBZvg2CRFqsv8mD4/OhBmoRjMpoosLkAYPuRmE58U/Ah+6
|
||||
9MJIzVca6dn7iLMLVWndkCoD9OUwBZNHU+SGTkn0IKUGyMUTmduADPBGbB7mYg6j
|
||||
DQsHiR1v7/ngb3uaQoVS8QA+XYmTUa1UZ+/83cmzjvf17rG10KwrJZh0lQNVUt5d
|
||||
gvH8aUvQq92xcXYQlhLfVFkqxmrLZNR0rIEeUVwYvVawPK8ZR+UK
|
||||
-----END CERTIFICATE REQUEST-----
|
||||
27
owsd/uproxy-files/etc/ubusx/ubusx_demo_only.key
Normal file
27
owsd/uproxy-files/etc/ubusx/ubusx_demo_only.key
Normal file
@@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpQIBAAKCAQEA6LJwM+3DSlAlmffqhbPD6VdSdaPhKuh79wXOXHjaz8XBLBNr
|
||||
w1kHZe0F1PSXvvsSC0sX75YxyFDuw/ADnB9NzTtzdBdR+CoZmCEY0yqIEC/Mv2CB
|
||||
hZMy+G2V8F0bb818TGDbXV+C23YsnALRk4klid8wbUoTxjxaoEeCaWJn91Wlcv3+
|
||||
+LUXVC/Oq51TWlOTiATBxiy8cDH9mcNzDykjY9QE3DaHoCrzLx6XexRNqOZQ4BZF
|
||||
Fd2/EKnABU65i18epmGKaPRaNSh6wOkolD9CkP5ZENvMn5L85jeCaSbS6aJs7HJ/
|
||||
Z5iX2yOYNxns0hhhRwwMlv2NnPlTzTfQvZ/zYQIDAQABAoIBAQC+o9IA+T4R1++2
|
||||
YMImn8xVk1DfSE/lE2rcSklywSCjMGS+c3rKJFpHSxSID4tyz8dMsUz+4JIQhx3W
|
||||
MQEEGzFmftprtd9V7UfittrbxfCLMl4QPERg5uPPXBiHQACGbFb1TDTsHp/apMqP
|
||||
Vk/VC3tRpSTLpPDma/PjdDKHnDOJEXXvIiI6lWzDjkFS8cmb+ZChAVJSAVDpM3v5
|
||||
OjtH6Cfn7QnlQh5v6OEcScmdHjGKaVstoQnulr9fK632KsWd4DVrPjcs6IYz+AmI
|
||||
w6iMVWwfXM4HmtBZKmFZDB+QedvkKj3GoIGW7rbUWWWW5Nvk549SbrV4dFLmGjFe
|
||||
Vg2X59yxAoGBAPfOj/f7aJcltV6Guf4jmt0r9fB+wHAl9Vx1Dg0Etg10LJnjbgEI
|
||||
2jkvVr4qp71GUg0vTdbAwcX5ha1gjvvLEfH2ikSut7je1L26Lcm7tcyCGnlIIOU5
|
||||
gwyLwTFArdmK8yn2gC56I+MOdiqsw3xgvGeLaM39BTdAcDYtnJ2E0ysLAoGBAPBj
|
||||
/G30UVQ3bXcPuP2vZHNUSVBRr3Rsi4YO4Ue+pF4y1tcxaEDHYR+WuD03l/Vnu9mK
|
||||
xZxHLwQuVjAeogwrzNgbN3CMN9jytGfnwPPG8YOw0umpS7wk4ZBA6wh97R6H8hlI
|
||||
6rSZYt2i92rBKEDU0i5ciUnR0pjyy/IUhM9o/L7DAoGBAJqKWKCXSl/QpW5g6QdD
|
||||
3yWFb+hes9Z85aqWWX/m6z4ysEn8WrMMeUNmcVtBMMDKZQtR7+I47d9wQFyitijz
|
||||
OKrETPCOYYdKeDQmMr33cWYr0STHxbQOjNq7IW18366miAUodEIH6++DKlBs07Dy
|
||||
hyyv9VlZLPKLHi+7fEuD9UmHAoGBAL/2OCfdx+xGbsV66rC6FK78Cad383I3E5uz
|
||||
2jYeiMcoNeOV8rh3/pjpFKrd8Bzp/1oStQa82VCvZ+f5LlIlz+hqo3Teo+I8vc+T
|
||||
g8OnhEkzNNmedXoCwZUeIhGf7XBKAwwp7DLXodl3P7giEvDiggy/nGo0gcXdbPsd
|
||||
Y4j1P49dAoGAPlVSKQx+s7zfcUwJMG9AqOXvXUEg9+AJZBn/xqVVwbd0jb/yf1lB
|
||||
7Y+3Q3FndrVF/Gd7kTbgIlwI6sk7l0+CN1jjN1WEHgFenz6O4nlwIcdbQRovw/4S
|
||||
okAV3yLGjubMCjyKdBP8bpocBcstYdr2PEmrt37XFNhQVL3C8HjdPmU=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
29
owsd/uproxy-files/etc/uci-defaults/60-owsd-ubusproxy
Normal file
29
owsd/uproxy-files/etc/uci-defaults/60-owsd-ubusproxy
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
# do not create ubusproxy section if it exists already
|
||||
[ "$(uci -q get owsd.ubusproxy)" == "ubusproxy" ] && exit 0
|
||||
|
||||
uci set owsd.ubusproxy="ubusproxy"
|
||||
uci set owsd.ubusproxy.enable="1"
|
||||
uci set owsd.ubusproxy.peer_key="/etc/ubusx/ubusx_demo_only.key"
|
||||
uci set owsd.ubusproxy.peer_cert="/etc/ubusx/ubusx_demo_only.crt"
|
||||
uci set owsd.ubusproxy.peer_ca="/etc/ubusx/ubusxDemoCA.crt"
|
||||
uci commit owsd
|
||||
|
||||
# do not create wan_https section if it exists already
|
||||
[ "$(uci -q get owsd.wan_https)" == "owsd-listen" ] && exit 0
|
||||
|
||||
# do not create wan_https section if wan interface doesn't exist
|
||||
[ "$(uci -q get network.wan)" == "interface" ] || exit 0
|
||||
|
||||
uci set owsd.wan_https="owsd-listen"
|
||||
uci set owsd.wan_https.port="443"
|
||||
uci set owsd.wan_https.interface="wan"
|
||||
uci set owsd.wan_https.key="/etc/ubusx/ubusx_demo_only.key"
|
||||
uci set owsd.wan_https.cert="/etc/ubusx/ubusx_demo_only.crt"
|
||||
uci set owsd.wan_https.ca="/etc/ubusx/ubusxDemoCA.crt"
|
||||
uci set owsd.wan_https.whitelist_interface_as_origin="1"
|
||||
uci del_list owsd.wan_https.origin="*"
|
||||
uci add_list owsd.wan_https.origin="*"
|
||||
uci commit owsd
|
||||
|
||||
@@ -12,7 +12,7 @@ PKG_NAME:=peripheral_manager
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=c1598f9dc8f2d67fbfcfd831052f40b3cde3d19c
|
||||
PKG_SOURCE_VERSION:=769430115b6dd984313574c3fa2a6d99c65cd223
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/peripheral-manager
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ configure_ethports(){
|
||||
config_get speed $name speed
|
||||
config_get ifname $name ifname
|
||||
config_get pause $name pause
|
||||
set_port_speed $ifname $speed
|
||||
set_port_speed $ifname $speed $name
|
||||
set_port_pause $ifname $pause
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=questd
|
||||
PKG_VERSION:=4.0.1
|
||||
PKG_VERSION:=4.1.1
|
||||
|
||||
PKG_SOURCE_VERSION:=d19501b6f80ef649b2ffd2f87132df885ce4581f
|
||||
PKG_SOURCE_VERSION:=c1d8ba92f6a8538f7a48960592cfe91c0c057c2b
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/questd
|
||||
|
||||
@@ -44,7 +44,7 @@ export QUESTD_CFLAGS
|
||||
|
||||
define Package/questd
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libuci +libubox +ubus +libpthread +TARGET_iopsys_ramips:swconfig +TARGET_iopsys_ramips:libnl-tiny +libopenssl
|
||||
DEPENDS:=+libuci +libubox +ubus +libpthread +TARGET_iopsys_ramips:swconfig +TARGET_iopsys_ramips:libnl-tiny +libopenssl +easy-soc-libs
|
||||
TITLE:=router info daemon
|
||||
endef
|
||||
|
||||
@@ -59,7 +59,6 @@ define Package/questd/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/questd $(1)/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/wificontrol $(1)/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/graphd $(1)/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uproxyd $(1)/sbin/
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/netcheck $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
12
questd/files/etc/uci-defaults/996-questd-opreqs
Normal file
12
questd/files/etc/uci-defaults/996-questd-opreqs
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
add_required_ubusproxy_objects() {
|
||||
uci -q del_list owsd.ubusproxy.object="wifix"
|
||||
uci -q add_list owsd.ubusproxy.object="wifix"
|
||||
uci commit owsd
|
||||
}
|
||||
|
||||
add_required_ubusproxy_objects
|
||||
|
||||
@@ -12,7 +12,7 @@ PKG_INSTALL:=1
|
||||
|
||||
PKG_SOURCE_PROTO=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/rulengd.git
|
||||
PKG_SOURCE_VERSION:=63569245b62d90d3106cc826f2d2b18f51c0b885
|
||||
PKG_SOURCE_VERSION:=ad94ccdd82b22527ab32937ca1a2682030319ed3
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
|
||||
PKG_INSTALL:=1
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
config rule
|
||||
option event 'test.event'
|
||||
list event_data "{'test': 1, 'reason': 1}"
|
||||
list event_data "{'tests': [1, 2, 3]}"
|
||||
option method 'file->write'
|
||||
list method_data "{'path': '/tmp/test_event.txt'}"
|
||||
list method_data "{'data': 'test event received!'}"
|
||||
|
||||
@@ -14,10 +14,10 @@ PKG_SOURCE_PROTO:=git
|
||||
|
||||
ifdef CONFIG_TARGET_intel_mips
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:intel/uboot.git
|
||||
PKG_SOURCE_VERSION:=0ef53f269c27f8e736fd30fd1a874159f70c76bf
|
||||
PKG_SOURCE_VERSION:=819227ec4cf4f2f8f7e8d46a3bee58e329089de6
|
||||
else
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/uboot.git
|
||||
PKG_SOURCE_VERSION:=3ef2ba866a99205496e0ce01935c89a1778d9b85
|
||||
PKG_SOURCE_VERSION:=670ad7a30f3c6871b6c8a972e19ca2dd78ea8c9b
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -46,7 +46,7 @@ UBOOT_IMG:=uboot.img
|
||||
define uboot/ex400
|
||||
TITLE:=U-Boot for the ex400
|
||||
DEPENDS:=@TARGET_iopsys_ramips
|
||||
PKG_RELEASE:=6
|
||||
PKG_RELEASE:=7
|
||||
endef
|
||||
|
||||
define uboot/sdx810_ap
|
||||
@@ -74,7 +74,7 @@ define uboot/grx500_norrland
|
||||
TITLE:=U-Boot for Norrland Board
|
||||
UBOOT_IMG:=u-boot-nand.bin
|
||||
DEPENDS:=@TARGET_intel_mips
|
||||
PKG_RELEASE:=10
|
||||
PKG_RELEASE:=15
|
||||
endef
|
||||
|
||||
UBOOTS := \
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uspd
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_VERSION:=1.0.3
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=64f39a5041da3d6c0a45cbc901dea3bd062d96fe
|
||||
PKG_SOURCE_VERSION:=f033acb40afd9b087587d3cfba292e1d884600d6
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/uspd.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
@@ -19,7 +19,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define Package/uspd
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR069 extention for USP
|
||||
TITLE:=USP ubus backend
|
||||
DEPENDS:=+libubox +ubus +icwmp-curl
|
||||
endef
|
||||
|
||||
@@ -38,7 +38,9 @@ TARGET_CFLAGS += \
|
||||
|
||||
define Package/uspd/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_BIN) ./files/uspd.init $(1)/etc/init.d/uspd
|
||||
$(INSTALL_CONF) ./files/uspd.config $(1)/etc/config/uspd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uspd $(1)/usr/sbin/
|
||||
endef
|
||||
2
uspd/files/uspd.config
Normal file
2
uspd/files/uspd.config
Normal file
@@ -0,0 +1,2 @@
|
||||
config uspd 'usp'
|
||||
option granularitylevel '0'
|
||||
@@ -17,3 +17,9 @@ reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "cwmp"
|
||||
procd_add_config_trigger "config.change" "uspd" /etc/init.d/uspd restart
|
||||
}
|
||||
@@ -57,6 +57,7 @@ ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||
-e 's/brcm/tapi/g' \
|
||||
-e 's/BRCM/TAPI/g' \
|
||||
-e 's/broadcom/intel/g' \
|
||||
-e 's/SWE/ETS/g' \
|
||||
$(1)/etc/config/voice_client \
|
||||
$(1)/etc/asterisk_templates/*
|
||||
sed -i \
|
||||
|
||||
@@ -130,7 +130,7 @@ exten => s,1, Goto(s-${DIALSTATUS},1)
|
||||
exten => s,n, Hangup()
|
||||
|
||||
;handle busy (with CBBS support)
|
||||
exten => s-BUSY,1, Read(DIGIT,Busy,1,in,30)
|
||||
exten => s-BUSY,1, Read(DIGIT,Busy,1,i,30)
|
||||
exten => s-BUSY,n, GotoIf($["${DIGIT}" = "${ARG8}"]?ccbs)
|
||||
exten => s-BUSY,n, Hangup()
|
||||
exten => s-BUSY,n(ccbs), Set(result=${SHELL(/usr/lib/asterisk/cbbs.sh ${ARG1} ${ARG2} ${ARG3} ${ARG4} ${ARG5} ${ARG6} ${ARG7})})
|
||||
|
||||
@@ -1,138 +1,138 @@
|
||||
config 'tel_line' 'brcm0'
|
||||
option 'extension' '0000'
|
||||
option 'sip_account' 'sip0'
|
||||
option 'noise' '0'
|
||||
option 'vad' '0'
|
||||
option 'txgain' 4
|
||||
option 'rxgain' 4
|
||||
option 'echo_cancel' 1
|
||||
option 'callwaiting' '0'
|
||||
option 'clir' '0'
|
||||
config tel_line 'brcm0'
|
||||
option extension '0000'
|
||||
option noise '0'
|
||||
option vad '0'
|
||||
option txgain 4
|
||||
option rxgain 4
|
||||
option echo_cancel 1
|
||||
option callwaiting '0'
|
||||
option clir '0'
|
||||
option sip_account 'sip0'
|
||||
|
||||
config 'tel_line' 'brcm1'
|
||||
option 'extension' '1111'
|
||||
option 'sip_account' 'sip0'
|
||||
option 'noise' '0'
|
||||
option 'vad' '0'
|
||||
option 'txgain' 4
|
||||
option 'rxgain' 4
|
||||
option 'echo_cancel' 1
|
||||
option 'callwaiting' '0'
|
||||
option 'clir' '0'
|
||||
config tel_line 'brcm1'
|
||||
option extension '1111'
|
||||
option noise '0'
|
||||
option vad '0'
|
||||
option txgain 4
|
||||
option rxgain 4
|
||||
option echo_cancel 1
|
||||
option callwaiting '0'
|
||||
option clir '0'
|
||||
option sip_account 'sip0'
|
||||
|
||||
config 'tel_line' 'brcm2'
|
||||
option 'extension' '2222'
|
||||
option 'sip_account' 'sip0'
|
||||
option 'noise' '0'
|
||||
option 'vad' '0'
|
||||
option 'txgain' 4
|
||||
option 'rxgain' 4
|
||||
option 'echo_cancel' 1
|
||||
option 'callwaiting' '0'
|
||||
option 'clir' '0'
|
||||
config tel_line 'brcm2'
|
||||
option extension '2222'
|
||||
option sip_account 'sip0'
|
||||
option noise '0'
|
||||
option vad '0'
|
||||
option txgain 4
|
||||
option rxgain 4
|
||||
option echo_cancel 1
|
||||
option callwaiting '0'
|
||||
option clir '0'
|
||||
|
||||
config 'tel_line' 'brcm3'
|
||||
option 'extension' '3333'
|
||||
option 'sip_account' 'sip0'
|
||||
option 'noise' '0'
|
||||
option 'vad' '0'
|
||||
option 'txgain' 4
|
||||
option 'rxgain' 4
|
||||
option 'echo_cancel' 1
|
||||
option 'callwaiting' '0'
|
||||
option 'clir' '0'
|
||||
config tel_line 'brcm3'
|
||||
option extension '3333'
|
||||
option sip_account 'sip0'
|
||||
option noise '0'
|
||||
option vad '0'
|
||||
option txgain 4
|
||||
option rxgain 4
|
||||
option echo_cancel 1
|
||||
option callwaiting '0'
|
||||
option clir '0'
|
||||
|
||||
config 'tel_line' 'brcm4'
|
||||
option 'extension' '4444'
|
||||
option 'sip_account' 'sip0'
|
||||
option 'noise' '0'
|
||||
option 'vad' '0'
|
||||
option 'txgain' 4
|
||||
option 'rxgain' 4
|
||||
option 'echo_cancel' 1
|
||||
option 'callwaiting' '0'
|
||||
option 'clir' '0'
|
||||
config tel_line 'brcm4'
|
||||
option extension '4444'
|
||||
option sip_account 'sip0'
|
||||
option noise '0'
|
||||
option vad '0'
|
||||
option txgain 4
|
||||
option rxgain 4
|
||||
option echo_cancel 1
|
||||
option callwaiting '0'
|
||||
option clir '0'
|
||||
|
||||
config 'tel_line' 'brcm5'
|
||||
option 'extension' '5555'
|
||||
option 'sip_account' 'sip0'
|
||||
option 'noise' '0'
|
||||
option 'vad' '0'
|
||||
option 'txgain' 4
|
||||
option 'rxgain' 4
|
||||
option 'echo_cancel' 1
|
||||
option 'callwaiting' '0'
|
||||
option 'clir' '0'
|
||||
config tel_line 'brcm5'
|
||||
option extension '5555'
|
||||
option sip_account 'sip0'
|
||||
option noise '0'
|
||||
option vad '0'
|
||||
option txgain 4
|
||||
option rxgain 4
|
||||
option echo_cancel 1
|
||||
option callwaiting '0'
|
||||
option clir '0'
|
||||
|
||||
config 'tel_line' 'brcm6'
|
||||
option 'extension' '6666'
|
||||
option 'sip_account' 'sip0'
|
||||
option 'noise' '0'
|
||||
option 'vad' '0'
|
||||
option 'txgain' 4
|
||||
option 'rxgain' 4
|
||||
option 'echo_cancel' 1
|
||||
option 'callwaiting' '0'
|
||||
option 'clir' '0'
|
||||
config tel_line 'brcm6'
|
||||
option extension '6666'
|
||||
option sip_account 'sip0'
|
||||
option noise '0'
|
||||
option vad '0'
|
||||
option txgain 4
|
||||
option rxgain 4
|
||||
option echo_cancel 1
|
||||
option callwaiting '0'
|
||||
option clir '0'
|
||||
|
||||
config 'tel_line' 'brcm7'
|
||||
option 'extension' '7777'
|
||||
option 'sip_account' 'sip0'
|
||||
option 'noise' '0'
|
||||
option 'vad' '0'
|
||||
option 'txgain' 4
|
||||
option 'rxgain' 4
|
||||
option 'echo_cancel' 1
|
||||
option 'callwaiting' '0'
|
||||
option 'clir' '0'
|
||||
config tel_line 'brcm7'
|
||||
option extension '7777'
|
||||
option sip_account 'sip0'
|
||||
option noise '0'
|
||||
option vad '0'
|
||||
option txgain 4
|
||||
option rxgain 4
|
||||
option echo_cancel 1
|
||||
option callwaiting '0'
|
||||
option clir '0'
|
||||
|
||||
config 'dialplan' 'custom_dialplan'
|
||||
option 'custom_outgoing_enabled' '0'
|
||||
option 'custom_incoming_enabled' '0'
|
||||
option 'custom_hangup_enabled' '0'
|
||||
option 'all_ports_extension' '#123456'
|
||||
option 'test_audio_extension' '#123457'
|
||||
option 'test_echo_extension' '#123458'
|
||||
option 'record_message_extension' '#999999'
|
||||
config dialplan 'custom_dialplan'
|
||||
option custom_outgoing_enabled '0'
|
||||
option custom_incoming_enabled '0'
|
||||
option custom_hangup_enabled '0'
|
||||
option all_ports_extension '#123456'
|
||||
option test_audio_extension '#123457'
|
||||
option test_echo_extension '#123458'
|
||||
option record_message_extension '#999999'
|
||||
|
||||
config 'sip_advanced' 'SIP'
|
||||
option 'rtpstart' '10000'
|
||||
option 'rtpend' '20000'
|
||||
option 'dtmfmode' 'rfc2833'
|
||||
option 'remotehold' 'yes'
|
||||
option 'contact_line_suffix' '1'
|
||||
option 'registertimeoutbackoff' '512'
|
||||
option 'registerattemptsbackoff' '0'
|
||||
option 'register403timeout' '0'
|
||||
option 'register503timeout' '0'
|
||||
option 'registertimeoutguardsecs' '15'
|
||||
option 'registertimeoutguardlimit' '30'
|
||||
option 'registertimeoutguardpct' '0.2'
|
||||
config sip_advanced 'SIP'
|
||||
option rtpstart '10000'
|
||||
option rtpend '20000'
|
||||
option dtmfmode 'rfc2833'
|
||||
option remotehold 'yes'
|
||||
option contact_line_suffix '1'
|
||||
option registertimeoutbackoff '512'
|
||||
option registerattemptsbackoff '0'
|
||||
option register403timeout '0'
|
||||
option register503timeout '0'
|
||||
option registertimeoutguardsecs '15'
|
||||
option registertimeoutguardlimit '30'
|
||||
option registertimeoutguardpct '0.2'
|
||||
option defaultexpiry '300'
|
||||
option 'tls_version' 'tlsv1'
|
||||
option 'tls_cipher' 'DES-CBC3-SHA'
|
||||
option 'stun_server' ''
|
||||
option 'dnsmgr' 'no'
|
||||
option 'dnsmgr_refresh_interval' '300'
|
||||
option 'srvlookup' 'yes'
|
||||
option tls_version 'tlsv1'
|
||||
option tls_cipher 'DES-CBC3-SHA'
|
||||
option stun_server ''
|
||||
option dnsmgr 'no'
|
||||
option dnsmgr_refresh_interval '300'
|
||||
option srvlookup 'yes'
|
||||
|
||||
config 'tel_advanced' 'TEL'
|
||||
option 'country' 'SWE'
|
||||
option 'jbenable' 'yes'
|
||||
option 'jbforce' 'no'
|
||||
option 'jbmaxsize' '500'
|
||||
option 'jbimpl' 'adaptive'
|
||||
option 'genericplc' 'yes'
|
||||
option 'dialoutmsec' '4000'
|
||||
option 'cw_enable' 'yes'
|
||||
config tel_advanced 'TEL'
|
||||
option country 'SWE'
|
||||
option jbenable 'yes'
|
||||
option jbforce 'no'
|
||||
option jbmaxsize '500'
|
||||
option jbimpl 'adaptive'
|
||||
option genericplc 'yes'
|
||||
option dialoutmsec '4000'
|
||||
option cw_enable 'yes'
|
||||
|
||||
config 'features' 'features'
|
||||
option 'cbbs_enabled' '1'
|
||||
option 'callforward_enabled' '1'
|
||||
option 'callwaiting_enabled' '1'
|
||||
option 'redial_enabled' '1'
|
||||
option 'callreturn_enabled' '1'
|
||||
option 'advanced_register_settings' '1'
|
||||
config features 'features'
|
||||
option cbbs_enabled '1'
|
||||
option callforward_enabled '1'
|
||||
option callwaiting_enabled '1'
|
||||
option redial_enabled '1'
|
||||
option callreturn_enabled '1'
|
||||
option advanced_register_settings '1'
|
||||
|
||||
config log 'LOG'
|
||||
option console 'notice,warning,error'
|
||||
@@ -146,31 +146,37 @@ config ringing_status 'RINGING_STATUS'
|
||||
option shouldring '1'
|
||||
|
||||
config call_filter 'call_filter0'
|
||||
option block_foreign '0'
|
||||
option block_special_rate '0'
|
||||
option block_outgoing '0'
|
||||
option block_incoming '0'
|
||||
option block_foreign '0'
|
||||
option block_special_rate '0'
|
||||
option block_outgoing '0'
|
||||
option block_incoming '0'
|
||||
|
||||
config 'sip_service_provider' 'sip0'
|
||||
option 'name' 'Account 1'
|
||||
option 'enabled' '0'
|
||||
option 'codec0' 'alaw'
|
||||
config cdr_log 'CDR_LOG'
|
||||
option cdr_syslog '0'
|
||||
|
||||
config sip_service_provider 'sip0'
|
||||
option name 'Account 1'
|
||||
option enabled '0'
|
||||
option codec0 'alaw'
|
||||
option cbbs_key '5'
|
||||
option cbbs_maxretry '5'
|
||||
option cbbs_retrytime '300'
|
||||
option cbbs_waittime '30'
|
||||
option 'autoframing' '1'
|
||||
option 'cfim_on' '*21*'
|
||||
option 'cfim_off' '#21#'
|
||||
option 'cfbs_on' '*61*'
|
||||
option 'cfbs_off' '#61#'
|
||||
option autoframing '1'
|
||||
option cfim_on '*21*'
|
||||
option cfim_off '#21#'
|
||||
option cfbs_on '*61*'
|
||||
option cfbs_off '#61#'
|
||||
option cw_on '*43#'
|
||||
option cw_off '#43#'
|
||||
option cw_status '*#43#'
|
||||
option 'call_return' '*69'
|
||||
option 'redial' '*66'
|
||||
option 'is_fax' '0'
|
||||
option 'transport' 'udp'
|
||||
option call_return '*69'
|
||||
option redial '*66'
|
||||
option is_fax '0'
|
||||
option transport 'udp'
|
||||
|
||||
config cdr_log 'CDR_LOG'
|
||||
option cdr_syslog '0'
|
||||
config tone_setting 'toneringbk'
|
||||
|
||||
config tone_setting 'tonering'
|
||||
|
||||
config tone_setting 'tonebusy'
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
iptables -I zone_wan_input 4 -m udp -p udp --dport 10000:20000 -m comment --comment "!fw3: Allow-RTP" -j ACCEPT
|
||||
rtpstart=$(uci -q get voice_client.SIP.rtpstart)
|
||||
rtpstart=${rtpstart:-10000}
|
||||
rtpend=$(uci -q get voice_client.SIP.rtpend)
|
||||
rtpend=${rtpend:-20000}
|
||||
|
||||
iptables -I zone_wan_input -m udp -p udp --dport $rtpstart:$rtpend -m comment --comment "!fw3: Allow-RTP" -j ACCEPT
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# This file is part of luci-app-voice,
|
||||
# its purpose is to (re)create asterisk configuration files
|
||||
# from luci config file(s).
|
||||
# The purpose of this file is to (re)create asterisk
|
||||
# configuration files from voice_client UCI config file.
|
||||
#
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/network.sh
|
||||
@@ -17,10 +16,13 @@ START=60
|
||||
USE_PROCD=1
|
||||
|
||||
# Some global variables
|
||||
SERIAL=$(getSerial)
|
||||
BASEMAC=$(getBaseMAC)
|
||||
SERIAL="$(getSerial)"
|
||||
BASEMAC="$(getBaseMAC)"
|
||||
BASEMAC="${BASEMAC//:}"
|
||||
LINENAME="$(getLineName)"
|
||||
CHANNELNAME="$(getChannelName)"
|
||||
MODULENAME=voice
|
||||
USERAGENT="Inteno_${SERIAL}_${BASEMAC}"
|
||||
USERAGENT="iopsys_${SERIAL}_${BASEMAC}"
|
||||
|
||||
ASTUSER=nobody
|
||||
ASTGROUP=nogroup
|
||||
@@ -32,7 +34,7 @@ ASTERISKDIR=/etc/asterisk
|
||||
WORKDIR=/tmp/$MODULENAME.$$
|
||||
MD5SUMSFILE=/tmp/$MODULENAME-sums.$$
|
||||
|
||||
# Whitespace separated list of $(getChannelName) feature access codes
|
||||
# Whitespace separated list of $CHANNELNAME feature access codes
|
||||
CHANNEL_FAC=
|
||||
|
||||
#TODO: go through templates, check usage
|
||||
@@ -82,8 +84,9 @@ TMPL_ACL=$TEMPLATEDIR/acl.conf.TEMPLATE
|
||||
TMPL_CONFBRIDGE=$TEMPLATEDIR/confbridge.conf.TEMPLATE
|
||||
TMPL_UDPTL=$TEMPLATEDIR/udptl.conf.TEMPLATE
|
||||
|
||||
TMPL_CHANNEL=$TEMPLATEDIR/$(getLineName).conf.TEMPLATE
|
||||
TMPL_CHANNEL=$TEMPLATEDIR/$LINENAME.conf.TEMPLATE
|
||||
TMPL_CHANNEL_LINE=$TEMPLATEDIR/tel_line.TEMPLATE
|
||||
TMPL_TONE_LINE=$TEMPLATEDIR/tone.conf.TEMPLATE
|
||||
|
||||
TMPL_MEETME=$TEMPLATEDIR/meetme.conf.TEMPLATE
|
||||
|
||||
@@ -182,7 +185,7 @@ assemble_and_copy_config()
|
||||
mv $WORKDIR/sip_registrations.tmp $WORKDIR/sip_registrations.conf
|
||||
mv $WORKDIR/sip_providers.tmp $WORKDIR/sip_providers.conf
|
||||
mv $WORKDIR/sip_users.tmp $WORKDIR/sip_users.conf
|
||||
mv $WORKDIR/$(getLineName).tmp $WORKDIR/$(getLineName).conf
|
||||
mv $WORKDIR/$LINENAME.tmp $WORKDIR/$LINENAME.conf
|
||||
mv $WORKDIR/extensions.tmp $WORKDIR/extensions.conf
|
||||
mv $WORKDIR/codecs.tmp $WORKDIR/codecs.conf
|
||||
mv $WORKDIR/rtp.tmp $WORKDIR/rtp.conf
|
||||
@@ -205,7 +208,7 @@ assemble_and_copy_config()
|
||||
[ ! -d $ASTERISKDIR/manager.d ] && mkdir -p $ASTERISKDIR/manager.d/
|
||||
|
||||
# Get rid of the working directory
|
||||
rm -rf $WORKDIR
|
||||
rm -rf $WORKDIR
|
||||
}
|
||||
|
||||
# read configured codecs for a Line section
|
||||
@@ -252,95 +255,43 @@ read_codecs_ptime()
|
||||
# returns a list of lines, formatted to replace a tag with sed
|
||||
# in a Dial() command
|
||||
#
|
||||
# For backwards compatibility, if i is only a number (not prefixed by
|
||||
# "SIP/" or "CHANNEL/") then add "CHANNEL/"
|
||||
#
|
||||
read_lines()
|
||||
{
|
||||
local lines=""
|
||||
local call_lines
|
||||
local fxsIdx fxsEpt dectIdx dectEpt
|
||||
local line call_lines lineid ldx lines llength clength
|
||||
local loffset=$(ubus -t 1 call voice.asterisk platform | jsonfilter -e @.lineoffset)
|
||||
loffset=${loffset:-0}
|
||||
|
||||
# Are lines already set by user conf?
|
||||
config_get call_lines $1 call_lines
|
||||
|
||||
# Otherwise set default depending on board HW. This
|
||||
# is only done at very first boot or a default reset.
|
||||
if test -z "$call_lines"; then
|
||||
# Get all FSX voice endpoints. Translate to uppercase with awk
|
||||
# due to tr [:upper:] doesn't work in our BusyBox.
|
||||
voicePorts=$(db get hw.board.VoicePortOrder | \
|
||||
awk '{ print toupper($0) }' | \
|
||||
sed -e "s/\([[:alpha:]]*\)\([[:digit:]]\)/\1\/\2/g")
|
||||
voiceNames=$(db get hw.board.VoicePortNames)
|
||||
hasVoice=0
|
||||
for line in $call_lines ; do
|
||||
|
||||
if test $(db get hw.board.hasVoice) = "1"; then
|
||||
# Get the first FSX voice endpoint index by
|
||||
# searching for the name usually used.
|
||||
fxsIdx=$(echo $voiceNames | \
|
||||
awk -e '{
|
||||
i = 1;
|
||||
while(i <= NF && tolower($i) !~ /^tel.*$/) {
|
||||
i++;
|
||||
}
|
||||
print i;
|
||||
}'
|
||||
)
|
||||
|
||||
# Convert index to endpoint ID
|
||||
if test $fxsIdx -gt 0; then
|
||||
fxsEpt=$(echo $voicePorts | awk '{ print $'$fxsIdx' }')
|
||||
fi
|
||||
|
||||
hasVoice=1
|
||||
fi
|
||||
|
||||
if test $(db get hw.board.hasDect) = "1"; then
|
||||
# Get the first Dect voice endpoint index by
|
||||
# searching for the name usually used.
|
||||
dectIdx=$(echo $voiceNames | \
|
||||
awk -e '{
|
||||
i = 1;
|
||||
while(i <= NF && tolower($i) !~ /^dect.*$/) {
|
||||
i++;
|
||||
}
|
||||
print i;
|
||||
}
|
||||
')
|
||||
|
||||
if test $dectIdx -gt 0; then
|
||||
dectEpt=$(echo $voicePorts | awk '{ print $'$dectIdx' }')
|
||||
fi
|
||||
|
||||
hasVoice=1
|
||||
fi
|
||||
|
||||
if test $hasVoice -eq 1; then
|
||||
call_lines="$dectEpt $fxsEpt"
|
||||
# Remove leading/trailing spaces
|
||||
call_lines=$(echo $call_lines | xargs echo -n)
|
||||
|
||||
# If we didn't find any endpoint ID we
|
||||
# fallback to activate them all.
|
||||
if test -z "$call_lines"; then
|
||||
call_lines="$voicePorts"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Save the endpoint IDs we found where the
|
||||
# GUI expects to find them.
|
||||
uci_set voice_client "${1}" "call_lines" "$call_lines"
|
||||
uci_commit voice_client
|
||||
fi
|
||||
|
||||
for i in $call_lines ; do
|
||||
case $i in
|
||||
''|*[!0-9]*) lines=$lines"$i&" ;;
|
||||
*) lines=$lines"$(getChannelName)/$i&" ;;
|
||||
# convert line format to <LINENAME><LINEID>
|
||||
case $line in
|
||||
[0-9])
|
||||
line="$LINENAME$line"
|
||||
;;
|
||||
"$CHANNELNAME"/[0-9])
|
||||
clength=$(echo $CHANNELNAME | wc -c)
|
||||
line="$LINENAME${line:$clength}"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
# get the index from line name
|
||||
# llength=$(echo $LINENAME | wc -c)
|
||||
# lineid="${lineid:$llength}"
|
||||
|
||||
# get the index from uci config order
|
||||
lineid="$(uci show voice_client | grep =tel_line | grep -wn $line | cut -d ':' -f1)"
|
||||
|
||||
[ -n "$lineid" ] || continue
|
||||
|
||||
# -1 to match the line's uci config index number
|
||||
# +loffset to match the correct number in channel driver
|
||||
ldx=$((lineid-1+loffset))
|
||||
|
||||
lines="$lines$CHANNELNAME/$ldx&"
|
||||
done
|
||||
|
||||
lines=$(escape_sed_substitution $lines)
|
||||
echo "${lines%??}"
|
||||
}
|
||||
@@ -1032,9 +983,9 @@ configure_queue()
|
||||
do
|
||||
local out=""
|
||||
re='^[0-9]+$'
|
||||
num=${member#$(getLineName)}
|
||||
num=${member#$LINENAME}
|
||||
if [ -z "${num##[0-9]*}" ] ; then
|
||||
out="$(getChannelName)/$num"
|
||||
out="$CHANNELNAME/$num"
|
||||
else
|
||||
local sip_user
|
||||
config_get sip_user $member user
|
||||
@@ -1688,7 +1639,7 @@ configure_extensions_provider()
|
||||
echo "exten => $user,n(norewrite),NoOp()">> $tmp
|
||||
|
||||
# read a list of lines that should be dialled on incoming calls
|
||||
incoming_lines=$(read_lines $1)
|
||||
incoming_lines="$(read_lines $1)"
|
||||
config_get call_queue $1 call_queue
|
||||
config_get call_ivr $1 call_ivr
|
||||
if [ -n "$incoming_lines" ]; then
|
||||
@@ -1737,7 +1688,7 @@ configure_tel_line_extension()
|
||||
local cbbs_retrytime
|
||||
local cbbs_waittime
|
||||
local mailbox
|
||||
local line_name=$(getLineName)
|
||||
local line_name=$LINENAME
|
||||
|
||||
line=${1:${#line_name}}
|
||||
config_get extension $1 extension
|
||||
@@ -1842,11 +1793,11 @@ configure_codecs()
|
||||
}
|
||||
|
||||
#
|
||||
# Configure default settings for $(getLineName).conf
|
||||
# Configure default settings for $LINENAME.conf
|
||||
#
|
||||
configure_tel()
|
||||
{
|
||||
echo "Configuring $(getChannelName)"
|
||||
echo "Configuring $CHANNELNAME"
|
||||
local jbenable
|
||||
local jbforce
|
||||
local jbmaxsize
|
||||
@@ -1873,29 +1824,64 @@ configure_tel()
|
||||
dialoutmsec=4000
|
||||
fi
|
||||
|
||||
sed -i "s/|JBENABLE|/$jbenable/" $WORKDIR/$(getLineName).tmp
|
||||
sed -i "s/|JBFORCE|/$jbforce/" $WORKDIR/$(getLineName).tmp
|
||||
sed -i "s/|JBMAXSIZE|/$jbmaxsize/" $WORKDIR/$(getLineName).tmp
|
||||
sed -i "s/|JBIMPL|/$jbimpl/" $WORKDIR/$(getLineName).tmp
|
||||
sed -i "s/|DIALOUTMSEC|/$dialoutmsec/" $WORKDIR/$(getLineName).tmp
|
||||
sed -i "s/|FAC|/$CHANNEL_FAC/" $WORKDIR/$(getLineName).tmp
|
||||
sed -i "s/|CHANNELS|/$(db get hw.board.VoicePorts)/" $WORKDIR/$(getLineName).tmp
|
||||
sed -i "s/|ECHOCANCEL|/$(getEchoCancellingValue $echocancel)/" $WORKDIR/$(getLineName).tmp
|
||||
sed -i "s/|JBENABLE|/$jbenable/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|JBFORCE|/$jbforce/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|JBMAXSIZE|/$jbmaxsize/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|JBIMPL|/$jbimpl/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|DIALOUTMSEC|/$dialoutmsec/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|FAC|/$CHANNEL_FAC/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|CHANNELS|/$(db get hw.board.VoicePorts)/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|ECHOCANCEL|/$(getEchoCancellingValue $echocancel)/" $WORKDIR/$LINENAME.tmp
|
||||
|
||||
if [ "$dtmfmode" == "compatibility" ] ; then
|
||||
dtmfcompatibility="1"
|
||||
else
|
||||
dtmfcompatibility="0"
|
||||
fi
|
||||
sed -i "s/|DTMFCOMPATIBILITY|/$dtmfcompatibility/" $WORKDIR/$(getLineName).tmp
|
||||
sed -i "s/|DTMFCOMPATIBILITY|/$dtmfcompatibility/" $WORKDIR/$LINENAME.tmp
|
||||
}
|
||||
configure_tone_setting()
|
||||
{
|
||||
local frequency
|
||||
local frequency_sec
|
||||
local impedance
|
||||
local outputlevel
|
||||
|
||||
config_get frequency $1 frequency
|
||||
config_get frequency_sec $1 frequency_sec
|
||||
config_get impedance $1 impedance
|
||||
config_get outputlevel $1 outputlevel
|
||||
|
||||
if [ -z "$frequency" ]; then
|
||||
frequency=100
|
||||
fi
|
||||
|
||||
if [ -z "$frequency_sec" ]; then
|
||||
frequencyB=200
|
||||
fi
|
||||
|
||||
if [ -z "$impedance" ]; then
|
||||
impedance=100
|
||||
fi
|
||||
|
||||
if [ -z "$outputlevel" ]; then
|
||||
outputlevel=350
|
||||
fi
|
||||
|
||||
cp $TMPL_TONE_LINE $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|SECTION|/$1/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|FREQUENCY|/$frequency/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|FREQUENCY|/$frequency_sec/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|FREQUENCY|/$impedance/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|FREQUENCY|/$outputlevel/" $WORKDIR/tel_line.tmp
|
||||
cat $WORKDIR/tel_line.tmp >> $WORKDIR/$LINENAME.tmp
|
||||
rm -f $WORKDIR/tel_line.tmp
|
||||
}
|
||||
#
|
||||
# Configure settings for individual line in $(getLineName).conf
|
||||
# Configure settings for individual line in $LINENAME.conf
|
||||
#
|
||||
configure_tel_line()
|
||||
{
|
||||
echo "Configuring $(getChannelName) line $1"
|
||||
local extension
|
||||
local sip_provider
|
||||
local codecs
|
||||
@@ -1942,6 +1928,7 @@ configure_tel_line()
|
||||
fi
|
||||
|
||||
cp $TMPL_CHANNEL_LINE $WORKDIR/tel_line.tmp
|
||||
|
||||
sed -i "s/|SECTION|/$1/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|CALLERID|/$extension/g" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|CONTEXT|/$sip_provider/g" $WORKDIR/tel_line.tmp
|
||||
@@ -1952,9 +1939,9 @@ configure_tel_line()
|
||||
sed -i "s/|DTMFRELAY|/$dtmfmode/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|CALLWAITING|/$callwaiting/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|CLIR|/$clir/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|LINE_NAME|/$(getLineName)/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|LINE_NAME|/$LINENAME/" $WORKDIR/tel_line.tmp
|
||||
|
||||
#Configure CHANNEL line with codecs according to the SIP line settings
|
||||
#Configure CHANNEL line with codecs according to the SIP line settings
|
||||
# local is_fax
|
||||
# config_get is_fax $sip_provider is_fax
|
||||
# if [ -z "$is_fax" -o "$is_fax" = "1" ] ; then
|
||||
@@ -1963,7 +1950,7 @@ configure_tel_line()
|
||||
# sed -i "s/|ALLOW|/$(read_codecs $sip_provider)/" $WORKDIR/tel_line.tmp
|
||||
# fi
|
||||
|
||||
cat $WORKDIR/tel_line.tmp >> $WORKDIR/$(getLineName).tmp
|
||||
cat $WORKDIR/tel_line.tmp >> $WORKDIR/$LINENAME.tmp
|
||||
rm -f $WORKDIR/tel_line.tmp
|
||||
}
|
||||
|
||||
@@ -2063,14 +2050,14 @@ pbx_fix_ownership()
|
||||
}
|
||||
|
||||
#
|
||||
# Calculate a name for each $(getLineName) line, depending on port type
|
||||
# Calculate a name for each $LINENAME line, depending on port type
|
||||
# and number. The name is used to make UI look better.
|
||||
#
|
||||
set_line_name()
|
||||
{
|
||||
local maxlinenum=$2
|
||||
local curname name_ix ix item lnum
|
||||
local line_name=$(getLineName)
|
||||
local line_name=$LINENAME
|
||||
local line_name_len=${#line_name}
|
||||
local tel_line=$1
|
||||
|
||||
@@ -2176,7 +2163,7 @@ start_service() {
|
||||
cp $TMPL_SIP $WORKDIR/sip.tmp
|
||||
cp $TMPL_RTP $WORKDIR/rtp.tmp
|
||||
cp $TMPL_STUN $WORKDIR/res_stun_monitor.tmp
|
||||
cp $TMPL_CHANNEL $WORKDIR/$(getLineName).tmp
|
||||
cp $TMPL_CHANNEL $WORKDIR/$LINENAME.tmp
|
||||
cp $TMPL_CODECS $WORKDIR/codecs.tmp
|
||||
cp $TMPL_VOICEMAIL $WORKDIR/voicemail.tmp
|
||||
cp $TMPL_DNSMGR $WORKDIR/dnsmgr.tmp
|
||||
@@ -2227,6 +2214,7 @@ start_service() {
|
||||
config_foreach configure_tel_line_extension tel_line
|
||||
config_foreach create_extensions_dialtone tel_line
|
||||
configure_codecs
|
||||
config_foreach configure_tone_setting tone_setting
|
||||
|
||||
###########################
|
||||
# Voicemail configuration
|
||||
@@ -2291,16 +2279,17 @@ stop_service() {
|
||||
|
||||
reload_service() {
|
||||
start
|
||||
#stop
|
||||
# turn off voice led; asterisk will turn it on
|
||||
# if there is a registered account
|
||||
# turn off voice led; asterisk will turn it on if there is a registered account
|
||||
ubus call led.voice1 set '{"state":"off"}'
|
||||
|
||||
# FXS channel module must be reloaded before sip module. Otherwise some attributes like
|
||||
# line's registration state which is updated by SIP module through callback might be
|
||||
# reset.
|
||||
asterisk -rx "$(getChipVendor) reload"
|
||||
asterisk -rx "config reload $ASTERISKDIR/sip.conf"
|
||||
sleep 1
|
||||
asterisk -rx "core reload"
|
||||
asterisk -rx "dialplan reload"
|
||||
asterisk -rx "$(getChipVendor) reload"
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
# Adapt to config section name changes
|
||||
grep -q brcm_line /etc/config/voice_client && sed -i 's/brcm_line/tel_line/g' /etc/config/voice_client
|
||||
grep -q brcm_advanced /etc/config/voice_client && sed -i 's/brcm_advanced/tel_advanced/g' /etc/config/voice_client
|
||||
grep -q BRCM /etc/config/voice_client && sed -i 's/BRCM\///g' /etc/config/voice_client
|
||||
grep -q BRCM /etc/config/voice_client && sed -i 's/BRCM/TEL/g' /etc/config/voice_client
|
||||
|
||||
# Add call filter section
|
||||
uci -q get voice_client.call_filter0 >/dev/null || {
|
||||
@@ -70,9 +72,9 @@ EOT
|
||||
# If dtmfmode is set to the obsolete compatability change to auto
|
||||
sed -i 's/dtmfmode\s*=\s*compatibility/dtmfmode=auto/' /etc/asterisk/sip.conf
|
||||
|
||||
if [ $(uci get voice_client.SIP.dtmfmode) == 'compatibility' ]; then
|
||||
uci set voice_client.SIP.dtmfmode='auto'
|
||||
uci commit
|
||||
if [ "$(uci get voice_client.SIP.dtmfmode)" == "compatibility" ]; then
|
||||
uci set voice_client.SIP.dtmfmode="auto"
|
||||
uci commit voice_client
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -43,3 +43,32 @@ getEchoCancellingValue() {
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
supportedCountries() {
|
||||
echo "Australia:AUS"
|
||||
echo "Belgium:BEL"
|
||||
echo "Brazil:BRA"
|
||||
echo "Chile:CHL"
|
||||
echo "China:CHN"
|
||||
echo "Czech:CZE"
|
||||
echo "Denmark:DNK"
|
||||
echo "ETSI:ETS"
|
||||
echo "Finland:FIN"
|
||||
echo "France:FRA"
|
||||
echo "Germany:DEU"
|
||||
echo "Hungary:HUN"
|
||||
echo "India:IND"
|
||||
echo "Italy:ITA"
|
||||
echo "Japan:JPN"
|
||||
echo "Netherlands:NLD"
|
||||
echo "New Zealand:NZL"
|
||||
echo "North America:USA"
|
||||
echo "Spain:ESP"
|
||||
echo "Sweden:SWE"
|
||||
echo "Switzerland:CHE"
|
||||
echo "Norway:NOR"
|
||||
echo "Taiwan:TWN"
|
||||
echo "United Kingdoms:GRB"
|
||||
echo "United Arab Emirates:ARE"
|
||||
echo "CFG TR57:T57"
|
||||
}
|
||||
|
||||
@@ -14,12 +14,12 @@ getLineName() {
|
||||
}
|
||||
|
||||
getSerial() {
|
||||
sernum=$(fw_printenv -n serial_number) 2> /dev/null
|
||||
sernum="$(fw_printenv -n serial_number 2> /dev/null)"
|
||||
|
||||
if [ $? ]; then
|
||||
echo 0
|
||||
else
|
||||
echo $sernum
|
||||
else
|
||||
echo 0
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -50,3 +50,7 @@ getEchoCancellingValue() {
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
supportedCountries() {
|
||||
echo "ETSI:ETS"
|
||||
}
|
||||
|
||||
@@ -21,21 +21,21 @@ fi
|
||||
|
||||
OFFHOOK=0
|
||||
REGISTERED=0
|
||||
|
||||
INCOMING=0
|
||||
asterisk -x 'sip show registry' | grep -q "Registered" && REGISTERED=1
|
||||
ubus call endpt status | grep -q "OFFHOOK" && OFFHOOK=1
|
||||
|
||||
if [ $OFFHOOK -eq 1 ]; then
|
||||
ubus call led.voice1 set '{"state":"notice"}'
|
||||
elif [ $REGISTERED -eq 1 ]; then
|
||||
ubus call led.voice1 set '{"state":"ok"}'
|
||||
ubus call led.voice1 set '{"state":"ok"}'
|
||||
else
|
||||
ubus call led.voice1 set '{"state":"error"}'
|
||||
fi
|
||||
|
||||
ubus listen asterisk.registry asterisk.endpoint | \
|
||||
while read event ; do
|
||||
#echo "voice-monitor got event: $event" >/dev/console
|
||||
# echo "voice-monitor got event: $event" >/dev/console
|
||||
json_load "$event"
|
||||
if json_select asterisk.registry >/dev/null; then
|
||||
json_get_var status status
|
||||
@@ -57,11 +57,20 @@ while read event ; do
|
||||
ONHOOK)
|
||||
OFFHOOK=0
|
||||
if [ $REGISTERED -eq 1 ]; then
|
||||
ubus call led.voice1 set '{"state":"ok"}'
|
||||
else
|
||||
ubus call led.voice1 set '{"state":"error"}'
|
||||
ubus call led.voice1 set '{"state":"ok"}'
|
||||
else
|
||||
ubus call led.voice1 set '{"state":"error"}'
|
||||
fi
|
||||
;;
|
||||
RINGING)
|
||||
INCOMING=0
|
||||
asterisk -x 'sip show channels' | grep -q "INVITE" && INCOMING=1
|
||||
if [ $INCOMING -eq 1 ]; then
|
||||
ubus call led.voice1 set '{"state":"notice"}'
|
||||
else
|
||||
ubus call led.voice1 set '{"state":"ok"}'
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
# Do nothing for other events.
|
||||
;;
|
||||
@@ -69,4 +78,5 @@ while read event ; do
|
||||
fi
|
||||
done &
|
||||
|
||||
|
||||
echo $(($!-1)) $! >/tmp/voice-monitor.pid
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
case "$1" in
|
||||
list)
|
||||
echo '{ "status" : {}, "lines" : {}, "codecs" : {}, "call_log" : {}, "platform" : {} }'
|
||||
echo '{ "status" : {}, "lines" : {}, "codecs" : {}, "call_log" : {}, "platform" : {}, "supported_countries" : {} }'
|
||||
|
||||
;;
|
||||
call)
|
||||
@@ -104,11 +104,13 @@ case "$1" in
|
||||
from="$(echo $line | cut -d',' -f2)"
|
||||
to="$(echo $line | cut -d',' -f3)"
|
||||
callok=0
|
||||
uci show voice_client | grep user | grep -wq "$from" && callok=1
|
||||
uci show voice_client | grep user | grep -wq "$to" && callok=1
|
||||
uci show voice_client | grep user | grep -wq "$from\|$to" && callok=1
|
||||
[ $callok -eq 0 ] && continue
|
||||
account="$(echo $line | cut -d',' -f4)"
|
||||
uci show voice_client | grep sip_service_provider | grep -wq "$account" || continue
|
||||
actok=0
|
||||
uci show voice_client | grep sip_service_provider | grep -wq "$account" && actok=1
|
||||
[ "$account" == "call_line" ] && actok=1
|
||||
[ $actok -eq 0 ] && continue
|
||||
timestart="$(echo $line | awk -F',' '{print $(NF-8)}')"
|
||||
timend="$(echo $line | awk -F',' '{print $(NF-6)}')"
|
||||
startdate=$(date -u -d "$timestart" +"%s")
|
||||
@@ -146,6 +148,22 @@ case "$1" in
|
||||
|
||||
json_dump
|
||||
;;
|
||||
supported_countries)
|
||||
vcf="/tmp/voice.supported_countries"
|
||||
supportedCountries > $vcf
|
||||
json_init
|
||||
json_add_array countries
|
||||
while IFS= read -r line
|
||||
do
|
||||
json_add_object ""
|
||||
json_add_string country "$(echo $line | cut -d':' -f1)"
|
||||
json_add_string code "$(echo $line | cut -d':' -f2)"
|
||||
json_select ..
|
||||
done < "$vcf"
|
||||
|
||||
json_dump
|
||||
rm -f $vcf
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -49,6 +49,11 @@ set_ringing_schedule() {
|
||||
stop_hour=$(echo $stop | awk -F ':' '{print$1}')
|
||||
stop_min=$(echo $stop | awk -F ':' '{print$2}')
|
||||
|
||||
[ "${start_min//[0-9]/}" = "" ] || return
|
||||
[ "${start_hour//[0-9]/}" = "" ] || return
|
||||
[ "${stop_min//[0-9]/}" = "" ] || return
|
||||
[ "${stop_hour//[0-9]/}" = "" ] || return
|
||||
|
||||
daymatch=0
|
||||
for day in $days; do
|
||||
[ "${day:0:3}" == "$current_day" ] && daymatch=1
|
||||
@@ -56,6 +61,8 @@ set_ringing_schedule() {
|
||||
[ -n "$dayns" ] && dayns="$dayns,$dayn" || dayns="$dayn"
|
||||
done
|
||||
|
||||
[ "${dayns//[0-6,\-]/}" = "" ] || return
|
||||
|
||||
if [ $daymatch -eq 1 -a $current_time -gt ${start/:/} -a $current_time -lt ${stop/:/} ]; then
|
||||
timematch=1
|
||||
uci -q set voice_client.RINGING_STATUS.shouldring="$status"
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wifilife
|
||||
PKG_VERSION:=1.0.2
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=de6183cda406fbd1a98779bda2ea1b2ffb8f2e04
|
||||
PKG_SOURCE_VERSION:=37d199b928f444710ab1ad0538f9f40650f5608c
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
|
||||
ifeq ($(CONFIG_WIFILIFE_OPEN),y)
|
||||
@@ -52,10 +52,8 @@ TARGET_CFLAGS += \
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/wifilife/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/wifilife.init $(1)/etc/init.d/wifilife
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(CP) -r ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wifiagent $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
67
wifilife/files/etc/firewall.mbid
Normal file
67
wifilife/files/etc/firewall.mbid
Normal file
@@ -0,0 +1,67 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions/mbid.sh
|
||||
|
||||
remove_mbid_rules() {
|
||||
old_rules="$(cat "/tmp/mbid_rules" 2>/dev/null)"
|
||||
IFS=$'\n'
|
||||
for old_rule in $old_rules; do
|
||||
old_rule=${old_rule/-A /-D }
|
||||
eval $old_rule 2>/dev/null
|
||||
done
|
||||
rm /tmp/mbid_rules
|
||||
}
|
||||
|
||||
# read firewall parental rules and add repeated addresses
|
||||
append_mbid_rules() {
|
||||
[ "$(uci -q get owsd.ubusproxy.enable)" == "1" ] || return
|
||||
|
||||
octets=$(get_octets)
|
||||
mobid=$(get_mobid)
|
||||
[ -z "$mobid" -o -z "$octets" ] && return
|
||||
|
||||
rule=""
|
||||
oct2="$(echo $mobid | awk '{print $1}')"
|
||||
oct3="$(echo $mobid | awk '{print $2}')"
|
||||
rules="$(cat /tmp/fw3.rules.ipv4 | grep -i forward | grep -i "\-\-mac\-source")"
|
||||
[ -z "$rules" ] && return
|
||||
|
||||
IFS=$'\n'
|
||||
for rule in $rules; do
|
||||
chain="$(echo $rule | awk '{print tolower($5)}')"
|
||||
[ -z "$chain" -o "$chain" != "forward" ] && continue
|
||||
|
||||
# delete rule, replace --append with --delete
|
||||
del_rule=${rule/-A /-D }
|
||||
while [ -z "$(eval "$del_rule" 2>&1)" ]; do
|
||||
:
|
||||
done
|
||||
|
||||
mac=$(echo $rule | awk '{print $9}')
|
||||
|
||||
# re-append rule
|
||||
eval $rule
|
||||
|
||||
rpt_macs=$(repeated_macs $octets $oct2 $oct3 $mac | awk '{print toupper($0)}')
|
||||
> /tmp/mbid_rules
|
||||
for rpt_mac in $rpt_macs; do
|
||||
[ -z "$rpt_mac" ] && continue
|
||||
rpt_rule=${rule/$mac/$rpt_mac}
|
||||
del_rule=${rpt_rule/-A /-D }
|
||||
while [ -z "$(eval "$del_rule" 2>&1)" ]; do
|
||||
:
|
||||
done
|
||||
|
||||
eval $rpt_rule
|
||||
echo $rpt_rule >> /tmp/mbid_rules
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
while [ -f /tmp/mbid.lock ]; do
|
||||
sleep 2
|
||||
done
|
||||
touch /tmp/mbid.lock
|
||||
remove_mbid_rules
|
||||
append_mbid_rules
|
||||
rm /tmp/mbid.lock
|
||||
2
wifilife/files/wifilife.init → wifilife/files/etc/init.d/wifilife
Normal file → Executable file
2
wifilife/files/wifilife.init → wifilife/files/etc/init.d/wifilife
Normal file → Executable file
@@ -9,6 +9,8 @@ EXTRA_COMMANDS="enable_check"
|
||||
|
||||
|
||||
start_service() {
|
||||
[ "$(uci -q get wifilife.@wifilife[0].enabled)" == "0" ] && return
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG} -d -l -f -o /tmp/wifiagent.log
|
||||
procd_set_param respawn
|
||||
21
wifilife/files/etc/ruleng/mbid.json
Normal file
21
wifilife/files/etc/ruleng/mbid.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"if" : [
|
||||
{
|
||||
"event": "ubus.object.add",
|
||||
"regex": true,
|
||||
"match": {
|
||||
"path":".*\/wifi\\.agent"
|
||||
}
|
||||
}
|
||||
],
|
||||
"then" : [
|
||||
{
|
||||
"object": "file",
|
||||
"method":"exec",
|
||||
"args": {
|
||||
"command": "sh",
|
||||
"params": ["/etc/firewall.mbid"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3,11 +3,13 @@
|
||||
. /lib/functions.sh
|
||||
|
||||
add_owsd_object_wifi() {
|
||||
local wifi=$(uci -q get owsd.ubusproxy.object | grep wifi*)
|
||||
if [ -z "$wifi" ]; then
|
||||
uci -q add_list owsd.ubusproxy.object="wifi*"
|
||||
uci commit owsd
|
||||
fi
|
||||
uci -q del_list owsd.ubusproxy.object="router.system"
|
||||
uci -q del_list owsd.ubusproxy.object="wifix"
|
||||
uci -q del_list owsd.ubusproxy.object="wifi.*"
|
||||
uci -q add_list owsd.ubusproxy.object="router.system"
|
||||
uci -q add_list owsd.ubusproxy.object="wifix"
|
||||
uci -q add_list owsd.ubusproxy.object="wifi.*"
|
||||
uci commit owsd
|
||||
}
|
||||
|
||||
add_dnsmasq_lease_hwmask() {
|
||||
@@ -18,5 +20,27 @@ add_dnsmasq_lease_hwmask() {
|
||||
fi
|
||||
}
|
||||
|
||||
add_firewall_mbid() {
|
||||
local ubusx="$(uci -q get owsd.ubusproxy.enable)"
|
||||
if [ -f /etc/firewall.mbid ]; then
|
||||
uci -q get firewall.mbid || {
|
||||
uci -q set firewall.mbid=include
|
||||
uci -q set firewall.mbid.path="/etc/firewall.mbid"
|
||||
uci -q set firewall.mbid.reload=1
|
||||
uci del_list firewall.mbid._access_w=root
|
||||
uci add_list firewall.mbid._access_w=root
|
||||
uci commit firewall
|
||||
}
|
||||
fi
|
||||
}
|
||||
|
||||
add_ruleng_section() {
|
||||
uci -q add ruleng rule
|
||||
uci -q set ruleng.@rule[-1].recipe='/etc/ruleng/mbid.json'
|
||||
uci commit ruleng
|
||||
}
|
||||
|
||||
add_owsd_object_wifi
|
||||
add_dnsmasq_lease_hwmask
|
||||
add_firewall_mbid
|
||||
add_ruleng_section
|
||||
|
||||
147
wifilife/files/lib/functions/mbid.sh
Normal file
147
wifilife/files/lib/functions/mbid.sh
Normal file
@@ -0,0 +1,147 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
mobid_cb() {
|
||||
local device mobility_domain
|
||||
|
||||
config_get device $1 device
|
||||
[ "$device" != "$2" ] && return;
|
||||
|
||||
config_get mobility_domain $1 mobility_domain
|
||||
echo "$mobility_domain"
|
||||
}
|
||||
|
||||
_get_mobid() {
|
||||
vif=$1
|
||||
config_load wireless
|
||||
mobid="$(config_foreach mobid_cb wifi-iface $vif)"
|
||||
echo $mobid
|
||||
}
|
||||
|
||||
repeated_macs() {
|
||||
octets=$1
|
||||
oct2=$2
|
||||
oct3=$3
|
||||
mac=$4
|
||||
macs=""
|
||||
oct456=${mac:9}
|
||||
|
||||
[ -z "$octets" -o -z "$oct2" -o -z "$oct3" -o -z "$mac" -o -z "$oct456" ] && return
|
||||
|
||||
IFS=$' '
|
||||
for oct1 in $octets; do
|
||||
macs="$oct1:$oct2:$oct3:$oct456 $macs"
|
||||
done
|
||||
|
||||
echo "$macs"
|
||||
}
|
||||
|
||||
# transform a mac address to all possibly repeated - recommended when parsing one or few MACs
|
||||
mac_to_repeated() {
|
||||
mac=$1
|
||||
octets=""
|
||||
oct2=""
|
||||
oct3=""
|
||||
|
||||
octets=$(get_octets)
|
||||
mobid=$(get_mobid)
|
||||
[ -z "$mobid" -o -z "$octets" ] && return
|
||||
|
||||
oct2="$(echo $mobid | awk '{print $1}')"
|
||||
oct3="$(echo $mobid | awk '{print $2}')"
|
||||
|
||||
echo "$(repeated_macs $octets $oct2 $oct3 $mac)"
|
||||
}
|
||||
|
||||
assocl_match_mac() {
|
||||
mac=$1
|
||||
|
||||
res="$(ubus call wifix assoclist 2>/dev/null)"
|
||||
|
||||
json_load "$res"
|
||||
json_select assoclist 2>/dev/null
|
||||
json_get_keys keys
|
||||
|
||||
IFS=$' '
|
||||
for key in $keys; do
|
||||
json_select $key 2>/dev/null
|
||||
json_get_var macaddr macaddr
|
||||
json_select ..
|
||||
|
||||
[ "$macaddr" = "$mac" ] || continue
|
||||
|
||||
octet=$(echo $macaddr | cut -c1-2)
|
||||
echo "$octet"
|
||||
done
|
||||
}
|
||||
|
||||
get_octet() {
|
||||
ip=$1
|
||||
|
||||
res="$(ubus call router.net arp 2>/dev/null)"
|
||||
|
||||
json_load "$res"
|
||||
json_select table 2>/dev/null
|
||||
json_get_keys keys
|
||||
IFS=$' '
|
||||
for key in $keys; do
|
||||
json_select $key 2>/dev/null
|
||||
json_get_var ipaddr ipaddr
|
||||
json_get_var macaddr macaddr
|
||||
json_select ..
|
||||
|
||||
[ "$ipaddr" = "$ip" ] || continue
|
||||
|
||||
echo "$(assocl_match_mac $macaddr)"
|
||||
done
|
||||
}
|
||||
|
||||
# only get all first octets - use when parsing several MACS
|
||||
get_octets() {
|
||||
octets=""
|
||||
assoclist=""
|
||||
neighbors=""
|
||||
|
||||
objects=$(ubus list | grep -E '.*\/wifix$')
|
||||
[ -z "$objects" ] && return
|
||||
|
||||
for obj in $objects; do
|
||||
ip=$(echo $obj | cut -d'/' -f1)
|
||||
octet="$(get_octet $ip)"
|
||||
[ "$octets" != "${octets/$octet/}" ] && continue
|
||||
octets="$octet $octets"
|
||||
done
|
||||
|
||||
echo "$octets"
|
||||
}
|
||||
|
||||
# get only mobid - use when parsing several MACS
|
||||
get_mobid() {
|
||||
mobid="500"
|
||||
|
||||
radios="$(ubus -t1 call wifix radios 2>/dev/null)"
|
||||
[ -z "$radios" ] && return
|
||||
|
||||
json_load "$radios"
|
||||
json_get_keys keys
|
||||
IFS=$' '
|
||||
for key in $keys; do
|
||||
val="$(_get_mobid $key)"
|
||||
[ -n "$val" ] && mobid=$val;
|
||||
done
|
||||
|
||||
mobid=$(printf "%04x" $mobid)
|
||||
|
||||
# if little endian
|
||||
if [ "$(echo -n I | hexdump -o | awk '{ print substr($2,6,1); exit}')" = "1" ]; then
|
||||
oct2=${mobid:2}
|
||||
oct3=${mobid%??}
|
||||
else
|
||||
oct2=${mobid%??}
|
||||
oct3=${mobid:2}
|
||||
fi
|
||||
|
||||
echo "$oct2 $oct3"
|
||||
}
|
||||
@@ -8,7 +8,7 @@ PKG_NAME:=wifimngr
|
||||
PKG_VERSION:=1.0.2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=66a7e957f5e3e83ab60da68f7fb05cdda7f474d5
|
||||
PKG_SOURCE_VERSION:=9cd787def3934610ed790d75cfba3208a84fcd81
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wifimngr.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user