--- /dev/null
+#
+# Copyright (C) 2018 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=asterisk-opus
+PKG_VERSION:=20171009
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/traud/asterisk-opus.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=83e1b458c77e0e287adeca494eeb79edb077b0ff
+PKG_MIRROR_HASH:=89265ee63bc3cb02ef9e75087f782147db1dec53433f9d6cfc08c7229cd61881
+PKG_SOURCE_PROTO:=git
+
+PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+TARGET_CFLAGS += \
+ -DAST_MODULE_SELF_SYM=__internal_codec_opus_open_source_self \
+ $(FPIC)
+
+define Package/$(PKG_NAME)/Default
+ SUBMENU:=Telephony
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=Opus codec support
+ URL:=https://github.com/traud/asterisk-opus
+ DEPENDS:=+libopus
+endef
+
+define Package/asterisk13-codec-opus
+$(call Package/$(PKG_NAME)/Default)
+ DEPENDS+=asterisk13
+ VARIANT:=asterisk13
+endef
+
+define Package/asterisk15-codec-opus
+$(call Package/$(PKG_NAME)/Default)
+ DEPENDS+=asterisk15
+ VARIANT:=asterisk15
+endef
+
+define Package/description/Default
+ Opus is the default audio codec in WebRTC. WebRTC is available in
+ Asterisk via SIP over WebSockets (WSS). Nevertheless, Opus can be used
+ for other transports (UDP, TCP, TLS) as well. Opus supersedes previous
+ codecs like CELT and SiLK. Furthermore, in favor of Opus, other
+ open-source audio codecs are no longer developed, like Speex, iSAC,
+ iLBC, and Siren. If you use your Asterisk as a back-to-back user agent
+ (B2BUA) and you transcode between various audio codecs, one should
+ enable Opus for future compatibility.
+
+ Opus is not only supported for pass-through but can be transcoded as
+ well.
+endef
+
+Package/asterisk13-codec-opus/description = $(Package/description/Default)
+Package/asterisk15-codec-opus/description = $(Package/description/Default)
+
+ifeq ($(BUILD_VARIANT),asterisk13)
+TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/include/asterisk-13/include
+endif
+
+ifeq ($(BUILD_VARIANT),asterisk15)
+TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/include/asterisk-15/include
+endif
+
+define Package/Install/Default
+ $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/codecs/codec_opus_open_source.so \
+ $(1)/usr/lib/asterisk/modules
+endef
+
+Package/asterisk13-codec-opus/install = $(Package/Install/Default)
+Package/asterisk15-codec-opus/install = $(Package/Install/Default)
+
+define Build/Configure
+endef
+
+$(eval $(call BuildPackage,asterisk13-codec-opus))
+$(eval $(call BuildPackage,asterisk15-codec-opus))
--- /dev/null
+--- a/Makefile
++++ b/Makefile
+@@ -3,17 +3,17 @@ exec_prefix=$(prefix)
+ libdir=$(exec_prefix)/lib
+
+ CC=gcc
+-CFLAGS=-pthread -g3 -O3 -D_FORTIFY_SOURCE=2 -fPIC
++CFLAGS+=-pthread
+ CPPFLAGS=
+ DEFS=
+ INSTALL=/usr/bin/install -c
+-LDFLAGS=-shared -pthread -Wl,--warn-common
++LDFLAGS+=-shared -pthread -Wl,--warn-common
+ LIBS=
+ MKDIR_P=/bin/mkdir -p
+ SHELL=/bin/sh
+
+ ASTMODDIR=$(libdir)/asterisk/modules
+-MODULES=codec_opus_open_source format_ogg_opus_open_source format_vp8 res_format_attr_opus
++MODULES=codec_opus_open_source
+
+ .SUFFIXES: .c .so
+
PKG_NAME:=kamailio5
PKG_VERSION:=5.1.3
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_SOURCE_URL:=https://www.kamailio.org/pub/kamailio/$(PKG_VERSION)/src
PKG_SOURCE:=kamailio-$(PKG_VERSION)$(PKG_VARIANT)_src.tar.gz
PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
+PKG_BUILD_PARALLEL:=1
+
MODULES_AVAILABLE:= \
acc \
acc_diameter \
$(if $(CONFIG_PACKAGE_kamailio5-mod-ims-diameter-server),,ims_diameter_server) \
$(if $(CONFIG_PACKAGE_kamailio5-mod-uid-gflags),,uid_gflags)
+# MIPS tweak:
+#
+# Kamailio enables use of fast inline assembly locks when ARCH is set to
+# "mips2". When ARCH is set to "mips" instead, Kamailio assumes it is dealing
+# with an old 32-bit MIPS CPU without hardware locking support (like R3000).
+#
+# When CONFIG_CPU_TYPE matches one of the identifiers in the list below, set
+# ARCH to "mips2" to get FAST_LOCK support.
+CPU_MIPS2:=mips32 24kc 34kc 74kc
+
PKG_MAKE_ARGS:= \
prefix=/ \
cfg_dir=/etc/kamailio/ \
SYSBASE="$(STAGING_DIR)/usr" \
CROSS_COMPILE=$(TARGET_CROSS) \
CC="$(TARGET_CC)" \
- ARCH="$(ARCH)" \
+ $(if $(findstring $(call qstrip,$(CONFIG_CPU_TYPE)),$(CPU_MIPS2)),ARCH="mips2",ARCH="$(ARCH)") \
DESTDIR=$(PKG_INSTALL_DIR) \
quiet=verbose
--- /dev/null
+commit 59d287586f502a8df71c2e91899fde49594e072e
+Author: Sebastian Kemper <sebastian_ml@gmx.net>
+Date: Sun Oct 7 18:54:39 2018 +0200
+
+ kamctl: make jsonrpc filter portable
+
+ The filter has a regex looking for a literal '{' in the beginning of a
+ line. Some awk implementations interpret this as a meta character, so
+ the regex is deemed broken. Example with busybox awk (POSIX):
+
+ root@hank2:~# kamctl ps
+ awk: bad regex '^{.+"id"[ ]*:[ ]*[0-9]+[ ]*}$': Invalid contents of {}
+ root@hank2:~#
+
+ To fix this enclose the character in square brackets. This always
+ matches for a literal '{' and is portable.
+
+ Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
+
+diff --git a/utils/kamctl/kamctl.base b/utils/kamctl/kamctl.base
+index adeceb77f..a776e10d8 100644
+--- a/utils/kamctl/kamctl.base
++++ b/utils/kamctl/kamctl.base
+@@ -715,7 +715,7 @@ filter_json()
+ $AWK 'function ltrim(s) { sub(/^[ \t\r\n]+/, "", s); return s }
+ BEGIN { line=0; IGNORECASE=1; }
+ { line++; }
+- NR == 1 && /^{.+"id"[ \t]*:[ \t]*[0-9]+[ \t]*}$/ { print; next; }
++ NR == 1 && /^[{].+"id"[ \t]*:[ \t]*[0-9]+[ \t]*}$/ { print; next; }
+ NR == 1 && /^200 OK/ { next; }
+ /^[ \t]*"jsonrpc":[ \t]*"2.0"/ { print; next; }
+ /^[ \t]*"result":[ \t]*\[.+/ {
PKG_NAME:=yate
PKG_VERSION:=6.1.0-1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://yate.null.ro/tarballs/yate6/
--without-doxygen \
--without-kdoc
+# The regexp implementation of musl 1.1.19 is not fully compatible with yate
+CONFIGURE_ARGS+= \
+ --enable-internalregex
+
ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-isaccodec),)
CONFIGURE_ARGS+=$(if $(CONFIG_SOFT_FLOAT),--disable-isac-float --enable-isac-fixed,--disable-isac-fixed --enable-isac-float)
else