This patch backports asterisk18 package from trunk to AA. It updates asterisk to version 1.8.27.0 and it fixes broken call data records subpackage.
Signed-off-by: Jiri Slachta <slac...@cesnet.cz> --- net/asterisk-1.8.x/Makefile | 126 +++++++++++++++++---- net/asterisk-1.8.x/files/asterisk.init | 37 ++++-- net/asterisk-1.8.x/patches/500-nres.patch | 2 +- net/asterisk-1.8.x/patches/600-CVE-2012-2186.patch | 10 -- 4 files changed, 130 insertions(+), 45 deletions(-) delete mode 100644 net/asterisk-1.8.x/patches/600-CVE-2012-2186.patch diff --git a/net/asterisk-1.8.x/Makefile b/net/asterisk-1.8.x/Makefile index 6c769cc..4707cc9 100644 --- a/net/asterisk-1.8.x/Makefile +++ b/net/asterisk-1.8.x/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2008-2012 OpenWrt.org +# Copyright (C) 2014 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=asterisk18 -PKG_VERSION:=1.8.10.1 -PKG_RELEASE:=2 +PKG_VERSION:=1.8.27.0 +PKG_RELEASE:=1 PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/asterisk/releases/ -PKG_MD5SUM:=415738d347b9037cbe5f8bfbe66843de +PKG_MD5SUM:=8861a5ff91cf4252f485b2a049d1c317 PKG_BUILD_DIR=$(BUILD_DIR)/asterisk-$(PKG_VERSION) @@ -34,7 +34,6 @@ define Package/asterisk18/Default/description equipment using relatively inexpensive hardware. endef - define Package/asterisk18 $(call Package/asterisk18/Default) TITLE:=Complete open source PBX, v1.8x @@ -95,7 +94,7 @@ endef define Package/asterisk18-cdr $(call Package/asterisk18/Default) TITLE:=CDR support - DEPENDS:= asterisk18 @BROKEN + DEPENDS:= asterisk18 endef define Package/asterisk18-cdr/description @@ -104,6 +103,18 @@ $(call Package/asterisk18/Default/description) Asterisk. endef +define Package/asterisk18-pgsql +$(call Package/asterisk18/Default) + TITLE:=PostgreSQL support + DEPENDS:= asterisk18 +libpq +endef + +define Package/asterisk18-pgsql/description +$(call Package/asterisk18/Default/description) + This package provides PostgreSQL support to + Asterisk. +endef + define Package/asterisk18-res-musiconhold $(call Package/asterisk18/Default) TITLE:=MOH support @@ -234,6 +245,28 @@ $(call Package/asterisk18/Default/description) This package provides the channel chan_lantiq support to Asterisk. endef +define Package/asterisk18-odbc +$(call Package/asterisk18/Default) + TITLE:=ODBC support + DEPENDS:= asterisk18 +libpthread +libc +unixodbc +endef + +define Package/asterisk18-odbc/description +$(call Package/asterisk18/Default/description) + This package provides ODBC support for Asterisk. +endef + +define Package/asterisk18-pbx-lua +$(call Package/asterisk18/Default) + TITLE:=Lua support + DEPENDS:= asterisk18 +libpthread +libc +liblua +endef + +define Package/asterisk18-pbx-lua/description +$(call Package/asterisk18/Default/description) + This package provides Lua resources for Asterisk. +endef + ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-app-meetme),) CONFIGURE_ARGS+= \ --with-dahdi="$(STAGING_DIR)/usr" @@ -244,23 +277,28 @@ endif ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-chan-gtalk),) CONFIGURE_ARGS+= \ - --with-gnutls="$(STAGING_DIR)/usr" \ --with-iksemel="$(STAGING_DIR)/usr" SITE_VARS+= \ - ac_cv_lib_iksemel_iks_start_sasl=yes \ - ac_cv_lib_gnutls_gnutls_bye=yes + ac_cv_lib_iksemel_iks_start_sasl=yes else CONFIGURE_ARGS+= \ - --without-gnutls \ --without-iksemel endif ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-curl),) CONFIGURE_ARGS+= \ - --with-curl="$(STAGING_DIR)/usr" + --with-libcurl="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= \ + --without-libcurl +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-pgsql),) + CONFIGURE_ARGS+= \ + --with-postgres="$(STAGING_DIR)/usr" else CONFIGURE_ARGS+= \ - --without-curl + --without-postgres endif ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-mysql),) @@ -295,25 +333,30 @@ else --without-srtp endif +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-pbx-lua),) + CONFIGURE_ARGS+= \ + --with-lua="$(STAGING_DIR)/usr" + TARGET_LDFLAGS+=-ldl -lcrypt +else + CONFIGURE_ARGS+= \ + --without-lua +endif + CONFIGURE_ARGS+= \ --without-curses \ --with-gsm=internal \ --without-cap \ - --without-gtk \ --without-gtk2 \ --without-isdnnet \ - --without-kde \ --without-misdn \ --without-nbs \ --with-ncurses="$(STAGING_DIR)/usr" \ --without-netsnmp \ --without-newt \ - --without-odbc \ --without-ogg \ --without-osptk \ --with-popt="$(STAGING_DIR)/usr" \ --without-pri \ - --without-qt \ --without-radius \ --without-sdl \ --without-suppserv \ @@ -450,9 +493,7 @@ define Package/asterisk18-cdr/conffiles /etc/asterisk/cdr.conf /etc/asterisk/cdr_custom.conf /etc/asterisk/cdr_manager.conf -/etc/asterisk/cdr_odbc.conf -/etc/asterisk/cdr_pgsql.conf -/etc/asterisk/cdr_tds.conf +/etc/asterisk/cdr_syslog.conf endef define Package/asterisk18-res-musiconhold/conffiles @@ -469,9 +510,23 @@ endef define Package/asterisk18-cdr/install $(INSTALL_DIR) $(1)/etc/asterisk - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/cdr*.conf $(1)/etc/asterisk/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/{cdr,cdr_custom,cdr_manager,cdr_syslog}.conf $(1)/etc/asterisk/ $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*cdr*.so $(1)/usr/lib/asterisk/modules/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/{app_,app_fork,func_}cdr.so $(1)/usr/lib/asterisk/modules/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/cdr_csv.so $(1)/usr/lib/asterisk/modules/ +endef + +define Package/asterisk18-pgsql/conffiles +/etc/asterisk/cel_pgsql.conf +/etc/asterisk/cdr_pgsql.conf +/etc/asterisk/res_pgsql.conf +endef + +define Package/asterisk18-pgsql/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/{cel,cdr,res}_pgsql.conf $(1)/etc/asterisk/ + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/{cel,cdr,res_config}_pgsql.so $(1)/usr/lib/asterisk/modules/ endef define Package/asterisk18-res-musiconhold/install @@ -594,12 +649,34 @@ define Package/asterisk18-res-srtp/install $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_srtp.so $(1)/usr/lib/asterisk/modules/ endef +define Package/asterisk18-odbc/conffiles +/etc/asterisk/cdr_adaptive_odbc.conf +/etc/asterisk/cdr_odbc.conf +/etc/asterisk/cel_odbc.conf +/etc/asterisk/func_odbc.conf +/etc/asterisk/res_odbc.conf +endef + +define Package/asterisk18-odbc/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(CP) $(PKG_INSTALL_DIR)/etc/asterisk/{cdr_adaptive,cdr,cel,func,res}_odbc.conf $(1)/etc/asterisk/ + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/{cdr_adaptive,cdr,cel,func,res_config,res}_odbc.so $(1)/usr/lib/asterisk/modules/ +endef + +define Package/asterisk18-pbx-lua/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/extensions.lua $(1)/etc/asterisk/ + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/pbx_lua.so $(1)/usr/lib/asterisk/modules/ +endef + define Buildasterisk18ModuleTemplate define Package/asterisk18-$(subst _,-,$(1)) $$(call Package/asterisk18/Default) TITLE:=$(2) support - DEPENDS:= asterisk18 $(4) + DEPENDS:= asterisk18 $(patsubst +%,+PACKAGE_asterisk18-$(subst _,-,$(1)):%,$(4)) endef define Package/asterisk18-$(subst _,-,$(1))/description @@ -624,6 +701,9 @@ $(eval $(call BuildPackage,asterisk18-cdr)) $(eval $(call BuildPackage,asterisk18-res-musiconhold)) $(eval $(call BuildPackage,asterisk18-chan-gtalk)) $(eval $(call BuildPackage,asterisk18-chan-mobile)) +$(eval $(call BuildPackage,asterisk18-odbc)) +$(eval $(call BuildPackage,asterisk18-pgsql)) +$(eval $(call BuildPackage,asterisk18-pbx-lua)) $(eval $(call BuildPackage,asterisk18-res-fax)) $(eval $(call BuildPackage,asterisk18-res-fax-spandsp)) $(eval $(call BuildPackage,asterisk18-res-timing-timerfd)) @@ -639,6 +719,7 @@ $(eval $(call Buildasterisk18ModuleTemplate,app_chanisavail,Channel availability $(eval $(call Buildasterisk18ModuleTemplate,app_chanspy,Channel listen in,support for listening in on any channel)) $(eval $(call Buildasterisk18ModuleTemplate,app_directed_pickup,Directed call pickup,support for directed call pickup)) $(eval $(call Buildasterisk18ModuleTemplate,app_exec,Exec application,support for application execution)) +$(eval $(call Buildasterisk18ModuleTemplate,app_followme,FollowMe application,support for FollowMe functionality,+asterisk18-chan-local)) $(eval $(call Buildasterisk18ModuleTemplate,app_minivm,Minimal voicemail system,a voicemail system in small building blocks working together based on the Comedian Mail voicemail system)) $(eval $(call Buildasterisk18ModuleTemplate,app_readexten,Extension to variable,a trivial application to read an extension into a variable)) $(eval $(call Buildasterisk18ModuleTemplate,app_read,Variable read,a trivial application to read a variable)) @@ -664,6 +745,7 @@ $(eval $(call Buildasterisk18ModuleTemplate,func_devstate,Blinky lights control, $(eval $(call Buildasterisk18ModuleTemplate,func_vmcount,vmcount dialplan,a vmcount dialplan function)) $(eval $(call Buildasterisk18ModuleTemplate,func_extstate,Hinted extension state,retrieving the state of a hinted extension for dialplan control)) $(eval $(call Buildasterisk18ModuleTemplate,func_global,Global variable,global variable dialplan functions)) +$(eval $(call Buildasterisk18ModuleTemplate,func_groupcount,Group count,Counts the number of channels in the specified group)) $(eval $(call Buildasterisk18ModuleTemplate,func_shell,Shell,support for shell execution)) $(eval $(call Buildasterisk18ModuleTemplate,pbx_ael,Asterisk Extension Logic,support for symbolic Asterisk Extension Logic)) $(eval $(call Buildasterisk18ModuleTemplate,res_ael_share,Shareable AEL code,support for shareable AEL code mainly between internal and external modules)) diff --git a/net/asterisk-1.8.x/files/asterisk.init b/net/asterisk-1.8.x/files/asterisk.init index 53bf4af..ec3b60b 100644 --- a/net/asterisk-1.8.x/files/asterisk.init +++ b/net/asterisk-1.8.x/files/asterisk.init @@ -1,21 +1,34 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2008 OpenWrt.org -START=50 +# Copyright (C) 2014 OpenWrt.org +START=99 +APP=asterisk +OPTIONS= DEST= -DEFAULT=$DEST/etc/default/asterisk -OPTIONS="" +DEFAULT=$DEST/etc/default/$APP +BIN_FILE=$DEST/usr/sbin/$APP +PID_FILE=$DEST/var/run/$APP/$APP.pid start() { - [ -f $DEFAULT ] && . $DEFAULT - [ -d $DEST/var/run/asterisk ] || mkdir -p $DEST/var/run/asterisk - [ -d $DEST/var/log/asterisk ] || mkdir -p $DEST/var/log/asterisk - [ -d $DEST/var/spool/asterisk ] || mkdir -p $DEST/var/spool/asterisk - [ -d /var/spool/asterisk ] || mkdir -p /var/spool/asterisk - [ -h $DEST/usr/lib/asterisk/astdb ] || ln -sf /var/spool/asterisk/astdb $DEST/usr/lib/asterisk/astdb - $DEST/usr/sbin/asterisk $OPTIONS + [ -f $DEFAULT ] && . $DEFAULT + [ -d $DEST/var/run/asterisk ] || mkdir -p $DEST/var/run/asterisk + [ -d $DEST/var/log/asterisk ] || mkdir -p $DEST/var/log/asterisk + [ -d $DEST/var/spool/asterisk ] || mkdir -p $DEST/var/spool/asterisk + [ -d $DEST/var/lib ] || mkdir -p $DEST/var/lib + [ -h $DEST/var/lib/asterisk ] || ln -s /usr/lib/asterisk /var/lib/asterisk + [ -d $DEST/var/lib/asterisk/keys ] || mkdir -p $DEST/var/lib/asterisk/keys + [ -d $DEST/var/log/asterisk/cdr-csv/ ] || mkdir -p $DEST/var/log/asterisk/cdr-csv + + SERVICE_PID_FILE="/var/run/asterisk/asterisk.pid" \ + service_start $BIN_FILE $OPTIONS } stop() { - [ -f $DEST/var/run/asterisk/asterisk.pid ] && kill $(cat $DEST/var/run/asterisk/asterisk.pid) >/dev/null 2>&1 + SERVICE_PID_FILE="/var/run/asterisk/asterisk.pid" \ + service_stop $BIN_FILE +} + +reload() { + SERVICE_PID_FILE="/var/run/asterisk/asterisk.pid" \ + service_reload $BIN_FILE } diff --git a/net/asterisk-1.8.x/patches/500-nres.patch b/net/asterisk-1.8.x/patches/500-nres.patch index 1d030b5..6abff86 100644 --- a/net/asterisk-1.8.x/patches/500-nres.patch +++ b/net/asterisk-1.8.x/patches/500-nres.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -16784,7 +16784,7 @@ if ac_fn_c_try_link "$LINENO"; then : +@@ -16911,7 +16911,7 @@ if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } diff --git a/net/asterisk-1.8.x/patches/600-CVE-2012-2186.patch b/net/asterisk-1.8.x/patches/600-CVE-2012-2186.patch deleted file mode 100644 index dbe790b..0000000 --- a/net/asterisk-1.8.x/patches/600-CVE-2012-2186.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/main/manager.c -+++ b/main/manager.c -@@ -4020,6 +4020,7 @@ static int action_originate(struct manse - TryExec(System(rm -rf /)) */ - strcasestr(app, "agi") || /* AGI(/bin/rm,-rf /) - EAGI(/bin/rm,-rf /) */ -+ strcasestr(app, "externalivr") || /* ExternalIVR(rm -rf) */ - strstr(appdata, "SHELL") || /* NoOp(${SHELL(rm -rf /)}) */ - strstr(appdata, "EVAL") /* NoOp(${EVAL(${some_var_containing_SHELL})}) */ - )) { -- 1.9.1 _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel