mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-25 19:44:30 +08:00
Compare commits
9 Commits
ledBlinkin
...
cr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd5aed0538 | ||
|
|
92faca44b9 | ||
|
|
a0c2a6615e | ||
|
|
97d08f94fb | ||
|
|
5310bbc945 | ||
|
|
86af5bdd28 | ||
|
|
9f5b4710eb | ||
|
|
29f0657c99 | ||
|
|
ed9e36addc |
@@ -11,7 +11,7 @@ PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.3.0
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=5a5c94b289c79bc3a635b8d742dd9b73dcc0615f
|
||||
PKG_SOURCE_VERSION:=637aa9ef231f81d195f7a1b67c70af445ade7fee
|
||||
PKG_NAME:=dectmngr2
|
||||
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easy-soc-libs
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=4c204761a38a27ff9ff7021c3c34b92d7e3fdb84
|
||||
PKG_SOURCE_VERSION:=9b7accf0ac4f7c8010fb06ba83df9e53264b429a
|
||||
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
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <linux/types.h>
|
||||
|
||||
#define SK9822_DEFAULT_NUM_LEDS 32 // U16, used if DT param fails
|
||||
#define SK9822_DEFAULT_BRIGHTNESS 15 // 5-bit brightness, 0-31
|
||||
#define SK9822_DEFAULT_BRIGHTNESS 1 // 5-bit brightness, 0-31
|
||||
|
||||
typedef struct {
|
||||
uint8_t b;
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=4.0-2019-08-17
|
||||
PKG_VERSION:=4.0-2019-05-21
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=17b9e07a38753eab3964dffd0b0cc7da3118840a
|
||||
PKG_SOURCE_VERSION:=3ae6954f55e90a339561719a0328c0cf3a4b018c
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -215,7 +215,6 @@ 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
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/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 &
|
||||
|
||||
@@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=netmode
|
||||
PKG_VERSION:=0.2.0
|
||||
|
||||
PKG_SOURCE_VERSION:=6406325e72d7ddd0ff7aaa3a87669519021bdb11
|
||||
PKG_SOURCE_VERSION:=9fa23664b3bdd963e4556f5921c9f9be1c9c578f
|
||||
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 -i macaddr
|
||||
procd_append_param command --verbose warning
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
config wifi-status 'status'
|
||||
option wlan '1'
|
||||
option wps '1'
|
||||
option sched_status '0'
|
||||
option schedule '0'
|
||||
|
||||
@@ -7,6 +8,9 @@ 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'
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
uci -q set owsd.ubusproxy.enable="0"
|
||||
uci -q commit owsd
|
||||
@@ -1,5 +1,6 @@
|
||||
config wifi-status 'status'
|
||||
option wlan '1'
|
||||
option wps '1'
|
||||
option sched_status '0'
|
||||
option schedule '0'
|
||||
|
||||
@@ -7,6 +8,9 @@ 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
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
config wifi-status 'status'
|
||||
option wlan '1'
|
||||
option wps '1'
|
||||
option sched_status '0'
|
||||
option schedule '0'
|
||||
|
||||
@@ -7,6 +8,9 @@ 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'
|
||||
|
||||
10
netmode/files/etc/netmodes/routed_mtk/omcproxy
Normal file
10
netmode/files/etc/netmodes/routed_mtk/omcproxy
Normal file
@@ -0,0 +1,10 @@
|
||||
config proxy
|
||||
option scope global
|
||||
option uplink wan
|
||||
list downlink lan
|
||||
|
||||
config proxy
|
||||
option scope global
|
||||
option uplink wan6
|
||||
list downlink lan
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
config wifi-status 'status'
|
||||
option wlan '1'
|
||||
option wps '1'
|
||||
option sched_status '0'
|
||||
option schedule '0'
|
||||
|
||||
@@ -7,6 +8,9 @@ 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
|
||||
|
||||
@@ -121,13 +121,8 @@ 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 "netmode" "Executing $when netmode scripts" >/dev/console
|
||||
logger -s -p user.info -t $0 "[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
|
||||
@@ -190,7 +185,7 @@ switch_netmode() {
|
||||
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
|
||||
logger -s -p user.info -t $0 "[netmode] Copying /etc/netmodes/$curmode in /etc/config" >/dev/console
|
||||
|
||||
for file in $(ls /etc/netmodes/$curmode/); do
|
||||
case "$file" in
|
||||
@@ -215,10 +210,11 @@ switch_netmode() {
|
||||
case "$curmode" in
|
||||
repeater*)
|
||||
touch $SWITCHMODELOCK
|
||||
logger -s -p user.info -t "netmode" "Switching to $curmode mode" > /dev/console
|
||||
logger -s -p user.info -t $0 "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
|
||||
@@ -229,7 +225,6 @@ 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
|
||||
@@ -243,7 +238,7 @@ revert_netmode() {
|
||||
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
|
||||
echo "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
|
||||
@@ -252,7 +247,7 @@ revert_netmode() {
|
||||
rm -rf $CONF_BACKUP_DIR
|
||||
rm -rf $OLD_MODE_FILE
|
||||
|
||||
logger -s -p user.info -t "netmode" "Restarting network services" > /dev/console
|
||||
echo "Restarting network services" > /dev/console
|
||||
ubus call network reload
|
||||
wifi reload
|
||||
ubus call router.network reload
|
||||
@@ -293,10 +288,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 $0 "netmode_get_ip_type: ip $1 is private"
|
||||
logger -t "[netmode]" "netmode_get_ip_type: ip $1 is private"
|
||||
echo "private"
|
||||
} || {
|
||||
logger -t $0 "netmode_get_ip_type: ip $1 is public"
|
||||
logger -t "[netmode]" "netmode_get_ip_type: ip $1 is public"
|
||||
echo "public"
|
||||
}
|
||||
}
|
||||
@@ -384,7 +379,7 @@ populate_netmodes() {
|
||||
done
|
||||
|
||||
local hardware=$(db get hw.board.hardware)
|
||||
local keys lang desc exp exclude support
|
||||
local keys lang desc exp exclude
|
||||
for mode in $(ls $MODEDIR); do
|
||||
|
||||
case "$mode" in
|
||||
@@ -414,23 +409,6 @@ 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
|
||||
|
||||
@@ -100,7 +100,7 @@ get_wifi_iface_cfgstr() {
|
||||
case "$1" in
|
||||
list)
|
||||
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": {} }'
|
||||
echo '{ "get_creds": { "network": "str", "file": "str" }, "set_creds": { "file": "str", "from_gui": "str" }, "connect": { "ssid": "str", "key": "str" }, "forget_network": {} }'
|
||||
else
|
||||
echo '{ "get_creds": { "network": "str", "file": "str" }, "set_creds": { "file": "str", "from_gui": "str" } }'
|
||||
fi
|
||||
@@ -211,30 +211,6 @@ case "$1" in
|
||||
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
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
#
|
||||
# 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))
|
||||
@@ -1,14 +0,0 @@
|
||||
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'
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
#!/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
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/owsd.git
|
||||
PKG_SOURCE_VERSION:=f1d6bff1971640006b3137b342fafa1c40cfb835
|
||||
PKG_SOURCE_VERSION:=930db7f4af821e91f46107c8a76b60f943ec7c3b
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
|
||||
PKG_INSTALL:=1
|
||||
@@ -61,9 +61,8 @@ define Package/owsd/install
|
||||
$(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
|
||||
ifeq ($(CONFIG_OWSD_UPROXYD),y)
|
||||
$(CP) ./uproxy-files/* $(1)/
|
||||
endif
|
||||
# $(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
# $(INSTALL_BIN) ./files/owsd.uci_default $(1)/etc/uci-defaults/55-owsd-interfaces
|
||||
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,34 +269,32 @@ 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 && {
|
||||
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
|
||||
validate_owsd_ubusproxy || {
|
||||
echo "Ubusproxy validation failed"
|
||||
return 1
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
87
owsd/files/owsd.uci_default
Normal file
87
owsd/files/owsd.uci_default
Normal file
@@ -0,0 +1,87 @@
|
||||
#!/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
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
-----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-----
|
||||
@@ -1,27 +0,0 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpAIBAAKCAQEAzuLRGrJW+mVZWbiKhdXsf/mggjqeaUZv55AzinRAG6OHK/C1
|
||||
PrPQvQpfDBZEYV1gE0KEF+yL3OYACGBBpHkP9A9EYMiIHr07eIF3YkWrPGjWuQ3+
|
||||
dQxtnY6mVdGxyY6zfjJPryFXSi+e/SICvTpvPKhrazE583brYhza0pgblRi1FWdt
|
||||
pfjRTzQNibW2+h4l9mBOJmZ66TLu3o+taEn618p3Mr4gYOwhDeTiT7cB9Lx3AMQF
|
||||
sahwWHH6w4b/K/k6EaVnd0f22jMar7GuRrChrSGQopU4WE0g10dw8bRQfuIRPvv2
|
||||
eyDKVP/w4aRAbe8tIGRUnysBoCGP28oFZ3EgbQIDAQABA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f1lB
|
||||
7Y+3Q3FndrVF/Gd7kTbgIlwI6sk7l0+CN1jjN1WEHgFenz6O4nlwIcdbQRovw/4S
|
||||
okAV3yLGjubMCjyKdBP8bpocBcstYdr2PEmrt37XFNhQVL3C8HjdPmU=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/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
|
||||
|
||||
@@ -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 $name
|
||||
set_port_speed $ifname $speed
|
||||
set_port_pause $ifname $pause
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=questd
|
||||
PKG_VERSION:=4.1.1
|
||||
PKG_VERSION:=4.1.0
|
||||
|
||||
PKG_SOURCE_VERSION:=c1d8ba92f6a8538f7a48960592cfe91c0c057c2b
|
||||
PKG_SOURCE_VERSION:=fdd80766b50fce51f68ff675b0e5398e0d31d3bb
|
||||
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 +easy-soc-libs
|
||||
DEPENDS:=+libuci +libubox +ubus +libpthread +TARGET_iopsys_ramips:swconfig +TARGET_iopsys_ramips:libnl-tiny +libopenssl
|
||||
TITLE:=router info daemon
|
||||
endef
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/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
|
||||
|
||||
@@ -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:=819227ec4cf4f2f8f7e8d46a3bee58e329089de6
|
||||
PKG_SOURCE_VERSION:=c77089efc41ea3292125330221bd5016796631b9
|
||||
else
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/uboot.git
|
||||
PKG_SOURCE_VERSION:=670ad7a30f3c6871b6c8a972e19ca2dd78ea8c9b
|
||||
PKG_SOURCE_VERSION:=3ef2ba866a99205496e0ce01935c89a1778d9b85
|
||||
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:=7
|
||||
PKG_RELEASE:=6
|
||||
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:=15
|
||||
PKG_RELEASE:=14
|
||||
endef
|
||||
|
||||
UBOOTS := \
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uspd
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=f033acb40afd9b087587d3cfba292e1d884600d6
|
||||
PKG_SOURCE_VERSION:=e8ee6a35751e661dd621b8b5c4cb788fe2081f58
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/uspd.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
@@ -38,9 +38,7 @@ 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
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
config uspd 'usp'
|
||||
option granularitylevel '0'
|
||||
@@ -17,9 +17,3 @@ reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "cwmp"
|
||||
procd_add_config_trigger "config.change" "uspd" /etc/init.d/uspd restart
|
||||
}
|
||||
|
||||
@@ -57,7 +57,6 @@ 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 \
|
||||
|
||||
@@ -1,138 +1,138 @@
|
||||
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' '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 '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' '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 '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,37 +146,31 @@ 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 cdr_log 'CDR_LOG'
|
||||
option cdr_syslog '0'
|
||||
|
||||
config sip_service_provider 'sip0'
|
||||
option name 'Account 1'
|
||||
option enabled '0'
|
||||
option codec0 'alaw'
|
||||
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 tone_setting 'toneringbk'
|
||||
|
||||
config tone_setting 'tonering'
|
||||
|
||||
config tone_setting 'tonebusy'
|
||||
config cdr_log 'CDR_LOG'
|
||||
option cdr_syslog '0'
|
||||
|
||||
@@ -1,6 +1 @@
|
||||
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
|
||||
iptables -I zone_wan_input 4 -m udp -p udp --dport 10000:20000 -m comment --comment "!fw3: Allow-RTP" -j ACCEPT
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# The purpose of this file is to (re)create asterisk
|
||||
# configuration files from voice_client UCI config file.
|
||||
# This file is part of luci-app-voice,
|
||||
# its purpose is to (re)create asterisk configuration files
|
||||
# from luci config file(s).
|
||||
#
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/network.sh
|
||||
@@ -16,13 +17,10 @@ START=60
|
||||
USE_PROCD=1
|
||||
|
||||
# Some global variables
|
||||
SERIAL="$(getSerial)"
|
||||
BASEMAC="$(getBaseMAC)"
|
||||
BASEMAC="${BASEMAC//:}"
|
||||
LINENAME="$(getLineName)"
|
||||
CHANNELNAME="$(getChannelName)"
|
||||
SERIAL=$(getSerial)
|
||||
BASEMAC=$(getBaseMAC)
|
||||
MODULENAME=voice
|
||||
USERAGENT="iopsys_${SERIAL}_${BASEMAC}"
|
||||
USERAGENT="Inteno_${SERIAL}_${BASEMAC}"
|
||||
|
||||
ASTUSER=nobody
|
||||
ASTGROUP=nogroup
|
||||
@@ -34,7 +32,7 @@ ASTERISKDIR=/etc/asterisk
|
||||
WORKDIR=/tmp/$MODULENAME.$$
|
||||
MD5SUMSFILE=/tmp/$MODULENAME-sums.$$
|
||||
|
||||
# Whitespace separated list of $CHANNELNAME feature access codes
|
||||
# Whitespace separated list of $(getChannelName) feature access codes
|
||||
CHANNEL_FAC=
|
||||
|
||||
#TODO: go through templates, check usage
|
||||
@@ -84,9 +82,8 @@ TMPL_ACL=$TEMPLATEDIR/acl.conf.TEMPLATE
|
||||
TMPL_CONFBRIDGE=$TEMPLATEDIR/confbridge.conf.TEMPLATE
|
||||
TMPL_UDPTL=$TEMPLATEDIR/udptl.conf.TEMPLATE
|
||||
|
||||
TMPL_CHANNEL=$TEMPLATEDIR/$LINENAME.conf.TEMPLATE
|
||||
TMPL_CHANNEL=$TEMPLATEDIR/$(getLineName).conf.TEMPLATE
|
||||
TMPL_CHANNEL_LINE=$TEMPLATEDIR/tel_line.TEMPLATE
|
||||
TMPL_TONE_LINE=$TEMPLATEDIR/tone.conf.TEMPLATE
|
||||
|
||||
TMPL_MEETME=$TEMPLATEDIR/meetme.conf.TEMPLATE
|
||||
|
||||
@@ -185,7 +182,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/$LINENAME.tmp $WORKDIR/$LINENAME.conf
|
||||
mv $WORKDIR/$(getLineName).tmp $WORKDIR/$(getLineName).conf
|
||||
mv $WORKDIR/extensions.tmp $WORKDIR/extensions.conf
|
||||
mv $WORKDIR/codecs.tmp $WORKDIR/codecs.conf
|
||||
mv $WORKDIR/rtp.tmp $WORKDIR/rtp.conf
|
||||
@@ -208,7 +205,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
|
||||
@@ -255,43 +252,95 @@ 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 line call_lines lineid ldx lines llength clength
|
||||
local loffset=$(ubus -t 1 call voice.asterisk platform | jsonfilter -e @.lineoffset)
|
||||
loffset=${loffset:-0}
|
||||
local lines=""
|
||||
local call_lines
|
||||
local fxsIdx fxsEpt dectIdx dectEpt
|
||||
|
||||
# Are lines already set by user conf?
|
||||
config_get call_lines $1 call_lines
|
||||
|
||||
for line in $call_lines ; do
|
||||
# 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
|
||||
|
||||
# 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}"
|
||||
;;
|
||||
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&" ;;
|
||||
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%??}"
|
||||
}
|
||||
@@ -983,9 +1032,9 @@ configure_queue()
|
||||
do
|
||||
local out=""
|
||||
re='^[0-9]+$'
|
||||
num=${member#$LINENAME}
|
||||
num=${member#$(getLineName)}
|
||||
if [ -z "${num##[0-9]*}" ] ; then
|
||||
out="$CHANNELNAME/$num"
|
||||
out="$(getChannelName)/$num"
|
||||
else
|
||||
local sip_user
|
||||
config_get sip_user $member user
|
||||
@@ -1639,7 +1688,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
|
||||
@@ -1688,7 +1737,7 @@ configure_tel_line_extension()
|
||||
local cbbs_retrytime
|
||||
local cbbs_waittime
|
||||
local mailbox
|
||||
local line_name=$LINENAME
|
||||
local line_name=$(getLineName)
|
||||
|
||||
line=${1:${#line_name}}
|
||||
config_get extension $1 extension
|
||||
@@ -1793,11 +1842,11 @@ configure_codecs()
|
||||
}
|
||||
|
||||
#
|
||||
# Configure default settings for $LINENAME.conf
|
||||
# Configure default settings for $(getLineName).conf
|
||||
#
|
||||
configure_tel()
|
||||
{
|
||||
echo "Configuring $CHANNELNAME"
|
||||
echo "Configuring $(getChannelName)"
|
||||
local jbenable
|
||||
local jbforce
|
||||
local jbmaxsize
|
||||
@@ -1824,64 +1873,29 @@ configure_tel()
|
||||
dialoutmsec=4000
|
||||
fi
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
if [ "$dtmfmode" == "compatibility" ] ; then
|
||||
dtmfcompatibility="1"
|
||||
else
|
||||
dtmfcompatibility="0"
|
||||
fi
|
||||
sed -i "s/|DTMFCOMPATIBILITY|/$dtmfcompatibility/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|DTMFCOMPATIBILITY|/$dtmfcompatibility/" $WORKDIR/$(getLineName).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 $LINENAME.conf
|
||||
# Configure settings for individual line in $(getLineName).conf
|
||||
#
|
||||
configure_tel_line()
|
||||
{
|
||||
echo "Configuring $(getChannelName) line $1"
|
||||
local extension
|
||||
local sip_provider
|
||||
local codecs
|
||||
@@ -1903,9 +1917,11 @@ configure_tel_line()
|
||||
config_get clir $1 clir
|
||||
|
||||
#If line is configured with no sip_provider, or sip_provider is disabled, use local_extensions context
|
||||
config_get sip_provider_user $sip_provider user
|
||||
config_get sip_provider_enabled $sip_provider enabled
|
||||
if [ "$sip_provider" == "-" -o -z "$sip_provider_enabled" -o "$sip_provider_enabled" == "0" -o -z "$sip_provider_user" ] ; then
|
||||
[ -n "$sip_provider" ] && {
|
||||
config_get sip_provider_user $sip_provider user
|
||||
config_get sip_provider_enabled $sip_provider enabled
|
||||
}
|
||||
if [ -z "$sip_provider" -o "$sip_provider" == "-" -o -z "$sip_provider_enabled" -o "$sip_provider_enabled" == "0" -o -z "$sip_provider_user" ] ; then
|
||||
sip_provider="local_extensions"
|
||||
fi
|
||||
|
||||
@@ -1928,7 +1944,6 @@ 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
|
||||
@@ -1939,9 +1954,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|/$LINENAME/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|LINE_NAME|/$(getLineName)/" $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
|
||||
@@ -1950,7 +1965,7 @@ configure_tel_line()
|
||||
# sed -i "s/|ALLOW|/$(read_codecs $sip_provider)/" $WORKDIR/tel_line.tmp
|
||||
# fi
|
||||
|
||||
cat $WORKDIR/tel_line.tmp >> $WORKDIR/$LINENAME.tmp
|
||||
cat $WORKDIR/tel_line.tmp >> $WORKDIR/$(getLineName).tmp
|
||||
rm -f $WORKDIR/tel_line.tmp
|
||||
}
|
||||
|
||||
@@ -2049,15 +2064,57 @@ pbx_fix_ownership()
|
||||
chown $ASTUSER:$ASTGROUP -R $ASTDIRSRECURSIVE
|
||||
}
|
||||
|
||||
# Set voice_client.LINE_x.sip_account correctly as per "voice_client.sipX.call_lines"
|
||||
set_line_sip_account()
|
||||
{
|
||||
local tel_line=$1
|
||||
local old_sip_account=
|
||||
local new_sip_account=
|
||||
local line_name=$(getLineName)
|
||||
local line_name_len=${#line_name}
|
||||
local lnum=${tel_line:${line_name_len}}
|
||||
local chan_name=$(getChannelName)
|
||||
local ___type="sip_service_provider"
|
||||
local section cfgtype call_lines chan_num
|
||||
|
||||
config_get old_sip_account $tel_line sip_account
|
||||
|
||||
# Note: On Intel platform, tel_line's section name starts with 0, e.g. tapi0.
|
||||
# But channel index in voice_client.sipX.call_lines starts with 1, e.g. TAPI/1
|
||||
if [ "$line_name" == "tapi" ]; then
|
||||
chan_num=$((lnum+1))
|
||||
else
|
||||
chan_num=$lnum
|
||||
fi
|
||||
|
||||
for section in ${CONFIG_SECTIONS}; do
|
||||
config_get cfgtype "$section" TYPE
|
||||
[ -n "$___type" -a "x$cfgtype" != "x$___type" ] && continue
|
||||
config_get call_lines "$section" call_lines
|
||||
# Note: tel_line's section name starts with 0, e.g. tapi0 or brcm0.
|
||||
# But channel index in voice_client.sipX.call_lines starts with 1, e.g. TAPI/1
|
||||
[ -n "$call_lines" ] && echo "$call_lines" | grep -q "$chan_name/$chan_num" && {
|
||||
# Append this sip_acount to the tel line
|
||||
if [ -z "$new_sip_account" ]; then
|
||||
new_sip_account="$section"
|
||||
else
|
||||
new_sip_account="$new_sip_account $section"
|
||||
fi
|
||||
}
|
||||
done
|
||||
|
||||
[ "$old_sip_account" != "$new_sip_account" ] && uci_set voice_client $tel_line sip_account "$new_sip_account"
|
||||
}
|
||||
|
||||
#
|
||||
# Calculate a name for each $LINENAME line, depending on port type
|
||||
# Calculate a name for each $(getLineName) 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=$LINENAME
|
||||
local line_name=$(getLineName)
|
||||
local line_name_len=${#line_name}
|
||||
local tel_line=$1
|
||||
|
||||
@@ -2145,6 +2202,12 @@ start_service() {
|
||||
# Load config file
|
||||
config_load voice_client
|
||||
|
||||
########################################################
|
||||
# Set line sip_account according to sip accounts'
|
||||
# settings
|
||||
########################################################
|
||||
config_foreach set_line_sip_account tel_line
|
||||
|
||||
########################################################
|
||||
# Set line names according to board parameters
|
||||
# and delete non-existing lines from voice_client config
|
||||
@@ -2153,6 +2216,9 @@ start_service() {
|
||||
config_foreach set_line_name tel_line $maxlinenum
|
||||
uci_commit voice_client
|
||||
|
||||
# Reload the config since it has changed
|
||||
config_load voice_client
|
||||
|
||||
#######################################
|
||||
# Create temporary files from templates
|
||||
#######################################
|
||||
@@ -2163,7 +2229,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/$LINENAME.tmp
|
||||
cp $TMPL_CHANNEL $WORKDIR/$(getLineName).tmp
|
||||
cp $TMPL_CODECS $WORKDIR/codecs.tmp
|
||||
cp $TMPL_VOICEMAIL $WORKDIR/voicemail.tmp
|
||||
cp $TMPL_DNSMGR $WORKDIR/dnsmgr.tmp
|
||||
@@ -2214,7 +2280,6 @@ 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
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
# 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
|
||||
|
||||
@@ -43,32 +43,3 @@ 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 $sernum
|
||||
else
|
||||
echo 0
|
||||
else
|
||||
echo $sernum
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -50,7 +50,3 @@ 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,20 +57,11 @@ 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.
|
||||
;;
|
||||
@@ -78,5 +69,4 @@ 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" : {}, "supported_countries" : {} }'
|
||||
echo '{ "status" : {}, "lines" : {}, "codecs" : {}, "call_log" : {}, "platform" : {} }'
|
||||
|
||||
;;
|
||||
call)
|
||||
@@ -104,13 +104,11 @@ 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\|$to" && callok=1
|
||||
uci show voice_client | grep user | grep -wq "$from" && callok=1
|
||||
uci show voice_client | grep user | grep -wq "$to" && callok=1
|
||||
[ $callok -eq 0 ] && continue
|
||||
account="$(echo $line | cut -d',' -f4)"
|
||||
actok=0
|
||||
uci show voice_client | grep sip_service_provider | grep -wq "$account" && actok=1
|
||||
[ "$account" == "call_line" ] && actok=1
|
||||
[ $actok -eq 0 ] && continue
|
||||
uci show voice_client | grep sip_service_provider | grep -wq "$account" || continue
|
||||
timestart="$(echo $line | awk -F',' '{print $(NF-8)}')"
|
||||
timend="$(echo $line | awk -F',' '{print $(NF-6)}')"
|
||||
startdate=$(date -u -d "$timestart" +"%s")
|
||||
@@ -148,22 +146,6 @@ 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,11 +49,6 @@ 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
|
||||
@@ -61,8 +56,6 @@ 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"
|
||||
|
||||
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=wifilife
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=37d199b928f444710ab1ad0538f9f40650f5608c
|
||||
PKG_SOURCE_VERSION:=fe0e8fd3832ef3a70ac3938f9b458d05a349b0be
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
|
||||
ifeq ($(CONFIG_WIFILIFE_OPEN),y)
|
||||
|
||||
@@ -3,13 +3,11 @@
|
||||
. /lib/functions.sh
|
||||
|
||||
add_owsd_object_wifi() {
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
add_dnsmasq_lease_hwmask() {
|
||||
|
||||
@@ -8,7 +8,7 @@ PKG_NAME:=wifimngr
|
||||
PKG_VERSION:=1.0.2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=9cd787def3934610ed790d75cfba3208a84fcd81
|
||||
PKG_SOURCE_VERSION:=8fe360e39fa71dbf5f7618afaba4b05da804981e
|
||||
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