From 534031c0bbe39d47020fba1c2cf77895ed74b99b Mon Sep 17 00:00:00 2001 From: Kambiz Darabi Date: Tue, 25 Nov 2014 18:23:46 +0100 Subject: [PATCH] Squashed 'feeds/telephony/' content from commit 75a04e3 git-subtree-dir: feeds/telephony git-subtree-split: 75a04e31e2f13c1baca5c77245754c5f7a3a7160 --- MAINTAINERS | 12 + admin/asterisk11-gui/Makefile | 76 + admin/asterisk11-gui/files/gui_http.conf | 41 + admin/asterisk11-gui/files/gui_manager.conf | 21 + admin/asterisk11-gui/files/gui_users.conf | 0 admin/asterisk18-gui/Makefile | 78 + admin/asterisk18-gui/files/asterisk-gui.init | 20 + admin/asterisk18-gui/files/gui_http.conf | 41 + admin/asterisk18-gui/files/gui_manager.conf | 21 + admin/asterisk18-gui/files/gui_users.conf | 0 libs/bcg729/Makefile | 62 + libs/iksemel/Makefile | 75 + libs/iksemel/patches/001-missing-macros.patch | 163 ++ libs/libosip2/Makefile | 73 + .../patches/001-automake-compat.patch | 8 + libs/libsrtp/Makefile | 58 + .../1003_fix_mips_namespace_collision.patch | 59 + .../patches/1005_fix_data_alignment.patch | 33 + .../patches/1007_update_Doxyfile.patch | 94 + libs/libsrtp/patches/1008_shared-lib.patch | 55 + libs/re/Makefile | 69 + libs/rem/Makefile | 67 + libs/spandsp/Makefile | 60 + libs/spandsp/patches/100-compile-fixes.patch | 23 + net/asterisk-1.8.x-chan-sccp-b/Makefile | 65 + .../files/sccp.openwrt.conf | 89 + net/asterisk-1.8.x-codec-g729/Makefile | 67 + net/asterisk-1.8.x/Makefile | 371 ++++ net/asterisk-1.8.x/files/asterisk.default | 4 + net/asterisk-1.8.x/files/asterisk.init | 34 + .../patches/100-build_tools-iconv.patch | 11 + .../patches/200-addons-defaultenable.patch | 77 + .../patches/201-utils-defaultenable.patch | 11 + net/asterisk-1.8.x/patches/500-nres.patch | 11 + .../src-lantiq/channels/chan_lantiq.c | 1679 +++++++++++++++++ .../src-lantiq/configs/lantiq.conf.sample | 138 ++ net/asterisk-11.x-chan-dongle/Makefile | 78 + .../patches/001-add-send-ussd.patch | 64 + net/asterisk-11.x-chan-sccp-b/Makefile | 65 + .../files/sccp.openwrt.conf | 89 + net/asterisk-11.x-codec-g729/Makefile | 67 + net/asterisk-11.x/Makefile | 407 ++++ net/asterisk-11.x/files/asterisk.default | 4 + net/asterisk-11.x/files/asterisk.init | 34 + .../001-pjproject-change-configure-args.patch | 11 + ...0-asterisk-configure-undef-res-ninit.patch | 10 + .../020-asterisk-enable-default-modules.patch | 44 + ...sterisk-utils-enable-default-modules.patch | 11 + net/baresip/Makefile | 150 ++ net/baresip/files/baresip.init | 14 + net/freeswitch/Config.in | 238 +++ net/freeswitch/Makefile | 1106 +++++++++++ net/freeswitch/files/freeswitch.config | 11 + net/freeswitch/files/freeswitch.default | 11 + net/freeswitch/files/freeswitch.hotplug | 65 + net/freeswitch/files/freeswitch.init | 40 + .../0000000-build-openwrt_rules.mk.patch | 10 + .../0000001-build-modules_conf_in.patch | 10 + .../0000002-build-config-erlang_m4.patch | 97 + .../patches/0000010-configure_ac.patch | 160 ++ .../patches/0000011-Makefile.am.patch | 57 + ...14000-libs-libcodec2-src-Makefile_am.patch | 15 + ...000-libs-libzrtp-include-zrtp_config.patch | 20 + ...1128080-libs-sofia-sip-configure_gnu.patch | 8 + ...s-spandsp-src-spandsp-fast_convert_h.patch | 11 + .../1129100-libs-spandsp-src-t4_rx_c.patch | 11 + .../1129200-libs-spandsp-src-t4_tx_c.patch | 11 + .../1130800-libs-srtp-configure-ac.patch | 18 + .../1137000-libs-xmlrpc-c-config_mk_in.patch | 13 + ...xmlrpc-c-lib-expat-gennmtab-Makefile.patch | 16 + .../1301010-src-include-timerfd_wrap_h.patch | 27 + ...-src-mod-codecs-mod_celt-Makefile_am.patch | 11 + ...0-src-mod-codecs-mod_isac-typedefs_h.patch | 11 + ...-src-mod-codecs-mod_opus-Makefile_am.patch | 11 + ...mod-directories-mod_ldap-Makefile_am.patch | 11 + ...od-endpoints-mod_gsmopen-Makefile_am.patch | 11 + ...b-1.10-patched-13ubuntu-configure_in.patch | 24 + ...-mod-endpoints-mod_verto-Makefile_am.patch | 28 + ...c-mod-languages-mod_perl-Makefile_am.patch | 32 + net/kamailio-3.x/Makefile | 243 +++ net/kamailio-3.x/files/kamailio.default | 14 + net/kamailio-3.x/files/kamailio.init | 30 + .../patches/050-fix-kamailio-utils.patch | 68 + .../patches/100-cross_compile.patch | 11 + net/kamailio-4.x/Makefile | 249 +++ net/kamailio-4.x/files/kamailio.default | 14 + net/kamailio-4.x/files/kamailio.init | 30 + .../patches/050-fix-kamailio-utils.patch | 78 + net/miax/Makefile | 55 + net/miax/patches/001-cross.patch | 24 + .../002-remove-bluetooth-support.patch | 465 +++++ net/pcapsipdump/Makefile | 53 + net/restund/Makefile | 117 ++ net/restund/files/restund.init | 15 + net/rtpproxy/Makefile | 41 + net/sipp/Makefile | 71 + net/siproxd/Makefile | 89 + net/siproxd/files/siproxd.config | 3 + net/siproxd/files/siproxd.init | 235 +++ .../010-fix-bogus-libltdl-dependency.patch | 26 + .../patches/011-include-sys-time.patch | 10 + net/sipsak/Makefile | 46 + net/sipsak/patches/001-ssp.patch | 22 + net/sipsak/patches/002-no_cares_ruli.patch | 276 +++ net/yate/Makefile | 275 +++ net/yate/files/yate.init | 25 + net/yate/patches/001-ppc-fix.patch | 31 + 107 files changed, 9524 insertions(+) create mode 100644 MAINTAINERS create mode 100644 admin/asterisk11-gui/Makefile create mode 100644 admin/asterisk11-gui/files/gui_http.conf create mode 100644 admin/asterisk11-gui/files/gui_manager.conf create mode 100644 admin/asterisk11-gui/files/gui_users.conf create mode 100644 admin/asterisk18-gui/Makefile create mode 100644 admin/asterisk18-gui/files/asterisk-gui.init create mode 100644 admin/asterisk18-gui/files/gui_http.conf create mode 100644 admin/asterisk18-gui/files/gui_manager.conf create mode 100644 admin/asterisk18-gui/files/gui_users.conf create mode 100644 libs/bcg729/Makefile create mode 100644 libs/iksemel/Makefile create mode 100644 libs/iksemel/patches/001-missing-macros.patch create mode 100644 libs/libosip2/Makefile create mode 100644 libs/libosip2/patches/001-automake-compat.patch create mode 100644 libs/libsrtp/Makefile create mode 100644 libs/libsrtp/patches/1003_fix_mips_namespace_collision.patch create mode 100644 libs/libsrtp/patches/1005_fix_data_alignment.patch create mode 100644 libs/libsrtp/patches/1007_update_Doxyfile.patch create mode 100644 libs/libsrtp/patches/1008_shared-lib.patch create mode 100644 libs/re/Makefile create mode 100644 libs/rem/Makefile create mode 100644 libs/spandsp/Makefile create mode 100644 libs/spandsp/patches/100-compile-fixes.patch create mode 100644 net/asterisk-1.8.x-chan-sccp-b/Makefile create mode 100644 net/asterisk-1.8.x-chan-sccp-b/files/sccp.openwrt.conf create mode 100644 net/asterisk-1.8.x-codec-g729/Makefile create mode 100644 net/asterisk-1.8.x/Makefile create mode 100644 net/asterisk-1.8.x/files/asterisk.default create mode 100644 net/asterisk-1.8.x/files/asterisk.init create mode 100644 net/asterisk-1.8.x/patches/100-build_tools-iconv.patch create mode 100644 net/asterisk-1.8.x/patches/200-addons-defaultenable.patch create mode 100644 net/asterisk-1.8.x/patches/201-utils-defaultenable.patch create mode 100644 net/asterisk-1.8.x/patches/500-nres.patch create mode 100644 net/asterisk-1.8.x/src-lantiq/channels/chan_lantiq.c create mode 100644 net/asterisk-1.8.x/src-lantiq/configs/lantiq.conf.sample create mode 100644 net/asterisk-11.x-chan-dongle/Makefile create mode 100644 net/asterisk-11.x-chan-dongle/patches/001-add-send-ussd.patch create mode 100644 net/asterisk-11.x-chan-sccp-b/Makefile create mode 100644 net/asterisk-11.x-chan-sccp-b/files/sccp.openwrt.conf create mode 100644 net/asterisk-11.x-codec-g729/Makefile create mode 100644 net/asterisk-11.x/Makefile create mode 100644 net/asterisk-11.x/files/asterisk.default create mode 100644 net/asterisk-11.x/files/asterisk.init create mode 100644 net/asterisk-11.x/patches/001-pjproject-change-configure-args.patch create mode 100644 net/asterisk-11.x/patches/010-asterisk-configure-undef-res-ninit.patch create mode 100644 net/asterisk-11.x/patches/020-asterisk-enable-default-modules.patch create mode 100644 net/asterisk-11.x/patches/021-asterisk-utils-enable-default-modules.patch create mode 100644 net/baresip/Makefile create mode 100644 net/baresip/files/baresip.init create mode 100644 net/freeswitch/Config.in create mode 100644 net/freeswitch/Makefile create mode 100644 net/freeswitch/files/freeswitch.config create mode 100644 net/freeswitch/files/freeswitch.default create mode 100644 net/freeswitch/files/freeswitch.hotplug create mode 100644 net/freeswitch/files/freeswitch.init create mode 100644 net/freeswitch/patches/0000000-build-openwrt_rules.mk.patch create mode 100644 net/freeswitch/patches/0000001-build-modules_conf_in.patch create mode 100644 net/freeswitch/patches/0000002-build-config-erlang_m4.patch create mode 100644 net/freeswitch/patches/0000010-configure_ac.patch create mode 100644 net/freeswitch/patches/0000011-Makefile.am.patch create mode 100644 net/freeswitch/patches/1114000-libs-libcodec2-src-Makefile_am.patch create mode 100644 net/freeswitch/patches/1122000-libs-libzrtp-include-zrtp_config.patch create mode 100644 net/freeswitch/patches/1128080-libs-sofia-sip-configure_gnu.patch create mode 100644 net/freeswitch/patches/1129000-libs-spandsp-src-spandsp-fast_convert_h.patch create mode 100644 net/freeswitch/patches/1129100-libs-spandsp-src-t4_rx_c.patch create mode 100644 net/freeswitch/patches/1129200-libs-spandsp-src-t4_tx_c.patch create mode 100644 net/freeswitch/patches/1130800-libs-srtp-configure-ac.patch create mode 100644 net/freeswitch/patches/1137000-libs-xmlrpc-c-config_mk_in.patch create mode 100644 net/freeswitch/patches/1137200-libs-xmlrpc-c-lib-expat-gennmtab-Makefile.patch create mode 100644 net/freeswitch/patches/1301010-src-include-timerfd_wrap_h.patch create mode 100644 net/freeswitch/patches/1304050-src-mod-codecs-mod_celt-Makefile_am.patch create mode 100644 net/freeswitch/patches/1304130-src-mod-codecs-mod_isac-typedefs_h.patch create mode 100644 net/freeswitch/patches/1304150-src-mod-codecs-mod_opus-Makefile_am.patch create mode 100644 net/freeswitch/patches/1306000-src-mod-directories-mod_ldap-Makefile_am.patch create mode 100644 net/freeswitch/patches/1307000-src-mod-endpoints-mod_gsmopen-Makefile_am.patch create mode 100644 net/freeswitch/patches/1307010-src-mod-endpoints-mod_gsmopen-gsmlib-gsmlib-1.10-patched-13ubuntu-configure_in.patch create mode 100644 net/freeswitch/patches/1307161-src-mod-endpoints-mod_verto-Makefile_am.patch create mode 100644 net/freeswitch/patches/1310040-src-mod-languages-mod_perl-Makefile_am.patch create mode 100644 net/kamailio-3.x/Makefile create mode 100644 net/kamailio-3.x/files/kamailio.default create mode 100644 net/kamailio-3.x/files/kamailio.init create mode 100644 net/kamailio-3.x/patches/050-fix-kamailio-utils.patch create mode 100644 net/kamailio-3.x/patches/100-cross_compile.patch create mode 100644 net/kamailio-4.x/Makefile create mode 100644 net/kamailio-4.x/files/kamailio.default create mode 100644 net/kamailio-4.x/files/kamailio.init create mode 100644 net/kamailio-4.x/patches/050-fix-kamailio-utils.patch create mode 100644 net/miax/Makefile create mode 100644 net/miax/patches/001-cross.patch create mode 100644 net/miax/patches/002-remove-bluetooth-support.patch create mode 100644 net/pcapsipdump/Makefile create mode 100644 net/restund/Makefile create mode 100644 net/restund/files/restund.init create mode 100644 net/rtpproxy/Makefile create mode 100644 net/sipp/Makefile create mode 100644 net/siproxd/Makefile create mode 100644 net/siproxd/files/siproxd.config create mode 100644 net/siproxd/files/siproxd.init create mode 100644 net/siproxd/patches/010-fix-bogus-libltdl-dependency.patch create mode 100644 net/siproxd/patches/011-include-sys-time.patch create mode 100644 net/sipsak/Makefile create mode 100644 net/sipsak/patches/001-ssp.patch create mode 100644 net/sipsak/patches/002-no_cares_ruli.patch create mode 100644 net/yate/Makefile create mode 100644 net/yate/files/yate.init create mode 100644 net/yate/patches/001-ppc-fix.patch diff --git a/MAINTAINERS b/MAINTAINERS new file mode 100644 index 00000000000..72bc91572d9 --- /dev/null +++ b/MAINTAINERS @@ -0,0 +1,12 @@ +# _______ ________ __ +# | |.-----.-----.-----.| | | |.----.| |_ +# | - || _ | -__| || | | || _|| _| +# |_______|| __|_____|__|__||________||__| |____| +# |__| W I R E L E S S F R E E D O M +# +# People listed here are managing the OpenWrt telephony feed. Use +# alphabetical order when updating the list. + +Jiri Slachta +Luka Perkov +Mazi Lo diff --git a/admin/asterisk11-gui/Makefile b/admin/asterisk11-gui/Makefile new file mode 100644 index 00000000000..c21e43b20b6 --- /dev/null +++ b/admin/asterisk11-gui/Makefile @@ -0,0 +1,76 @@ +# +# Copyright (C) 2014 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:=asterisk11-gui +PKG_VERSION:=2.1.0-rc1 +PKG_RELEASE:=4 + +PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/asterisk-gui/releases/ +PKG_SOURCE:=asterisk-gui-$(PKG_VERSION).tar.gz +PKG_MD5SUM:=055bf2aaba365e696198925d039ac3cb +PKG_BUILD_DIR:=$(BUILD_DIR)/asterisk11-gui-$(PKG_VERSION) + +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=COPYING LICENSE + +include $(INCLUDE_DIR)/package.mk + +define Package/asterisk11-gui + SECTION:=admin + CATEGORY:=Administration + TITLE:=Asterisk GUI for Asterisk 11.x + DEPENDS:=+@PACKAGE_asterisk11 +asterisk11-app-exec +asterisk11-app-system + VERSION:=$(PKG_VERSION) +endef + +define Package/asterisk11-gui/description + Asterisk11 GUI is a framework for the creation of graphical interfaces + for configuring Asterisk-11.x package. +endef + +EXTRA_CFLAGS:=$(TARGET_CPPFLAGS) +EXTRA_LDFLAGS:=$(TARGET_LDFLAGS) + +define Build/Prepare + rm -rf $(PKG_BUILD_DIR)/ + mkdir -p $(PKG_BUILD_DIR)/ + $(TAR) -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1 + $(Build/Patch) +endef + +define Build/Configure + ( cd $(PKG_BUILD_DIR); ./bootstrap.sh ) + $(call Build/Configure/Default, \ + --build=$(GNU_HOST_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --target=$(GNU_TARGET_NAME) \ + --prefix=/usr \ + --disable-nls \ + --disable-static \ + --localstatedir="/usr" \ + --sysconfdir="/etc" \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" + $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install +endef + +define Package/asterisk11-gui/install + $(INSTALL_DIR) $(1)/etc/asterisk/ + $(CP) ./files/gui_* $(1)/etc/asterisk/ + $(INSTALL_DIR) $(1)/usr/lib/asterisk/static-http + $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/static-http/* $(1)/usr/lib/asterisk/static-http + $(INSTALL_DIR) $(1)/usr/lib/asterisk/scripts + $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/scripts/* $(1)/usr/lib/asterisk/scripts + $(INSTALL_DIR) $(1)/usr/lib/asterisk/gui_backups +endef + +$(eval $(call BuildPackage,asterisk11-gui)) diff --git a/admin/asterisk11-gui/files/gui_http.conf b/admin/asterisk11-gui/files/gui_http.conf new file mode 100644 index 00000000000..8679e3691ee --- /dev/null +++ b/admin/asterisk11-gui/files/gui_http.conf @@ -0,0 +1,41 @@ +; +; Asterisk Builtin mini-HTTP server +; +; +[general] +; +; Whether HTTP interface is enabled or not. Default is no. +; +enabled=yes +; +; Whether Asterisk should serve static content from http-static +; Default is no. +; +enablestatic=yes +; +; Address to bind to. Default is 0.0.0.0 +; +bindaddr=0.0.0.0 +; +; Port to bind to (default is 8088) +; +bindport=8088 +; +; Prefix allows you to specify a prefix for all requests +; to the server. The default is "asterisk" so that all +; requests must begin with /asterisk +; +;prefix=asterisk + +; The post_mappings section maps URLs to real paths on the filesystem. If a +; POST is done from within an authenticated manager session to one of the +; configured POST mappings, then any files in the POST will be placed in the +; configured directory. +; +;[post_mappings] +; +; In this example, if the prefix option is set to "asterisk", then using the +; POST URL: /asterisk/uploads will put files in /var/lib/asterisk/uploads/. +;uploads = /var/lib/asterisk/uploads/ +; + diff --git a/admin/asterisk11-gui/files/gui_manager.conf b/admin/asterisk11-gui/files/gui_manager.conf new file mode 100644 index 00000000000..14fd58a6f18 --- /dev/null +++ b/admin/asterisk11-gui/files/gui_manager.conf @@ -0,0 +1,21 @@ +; +; Asterisk Call Management support +; + +; By default asterisk will listen on localhost only. +[general] +enabled = yes +webenabled=yes +port = 5038 +bindaddr = 0.0.0.0 + +; No access is allowed by default. +; To set a password, create a file in /etc/asterisk/manager.d +; use creative permission games to allow other serivces to create their own +; files + +#[admin] +# secret = securePassword +# read = system,call,log,verbose,command,agent,config +# write = system,call,log,verbose,command,agent,config + diff --git a/admin/asterisk11-gui/files/gui_users.conf b/admin/asterisk11-gui/files/gui_users.conf new file mode 100644 index 00000000000..e69de29bb2d diff --git a/admin/asterisk18-gui/Makefile b/admin/asterisk18-gui/Makefile new file mode 100644 index 00000000000..31dd22109d8 --- /dev/null +++ b/admin/asterisk18-gui/Makefile @@ -0,0 +1,78 @@ +# +# Copyright (C) 2014 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:=asterisk18-gui +PKG_VERSION:=2.1.0-rc1 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/asterisk-gui/releases/ +PKG_SOURCE:=asterisk-gui-$(PKG_VERSION).tar.gz +PKG_MD5SUM:=055bf2aaba365e696198925d039ac3cb +PKG_BUILD_DIR:=$(BUILD_DIR)/asterisk18-gui-$(PKG_VERSION) + +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=COPYING LICENSE + +include $(INCLUDE_DIR)/package.mk + +define Package/asterisk18-gui + SECTION:=admin + CATEGORY:=Administration + TITLE:=Asterisk GUI for Asterisk 1.8.x + DEPENDS:=+@PACKAGE_asterisk18 +asterisk18-chan-local +asterisk18-app-exec +asterisk18-app-system + VERSION:=$(PKG_VERSION) +endef + +define Package/asterisk18-gui/description + Asterisk18 GUI is a framework for the creation of graphical interfaces + for configuring Asterisk-1.8.x package. +endef + +EXTRA_CFLAGS:=$(TARGET_CPPFLAGS) +EXTRA_LDFLAGS:=$(TARGET_LDFLAGS) + +define Build/Prepare + rm -rf $(PKG_BUILD_DIR)/ + mkdir -p $(PKG_BUILD_DIR)/ + $(TAR) -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1 + $(Build/Patch) +endef + +define Build/Configure + ( cd $(PKG_BUILD_DIR); ./bootstrap.sh ) + $(call Build/Configure/Default, \ + --build=$(GNU_HOST_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --target=$(GNU_TARGET_NAME) \ + --prefix=/usr \ + --disable-nls \ + --disable-static \ + --localstatedir="/usr" \ + --sysconfdir="/etc" \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" + $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install +endef + +define Package/asterisk18-gui/install + $(INSTALL_DIR) $(1)/etc/asterisk/ + $(CP) ./files/gui_* $(1)/etc/asterisk/ + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) ./files/asterisk-gui.init $(1)/etc/init.d/asterisk-gui + $(INSTALL_DIR) $(1)/usr/lib/asterisk/static-http + $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/static-http/* $(1)/usr/lib/asterisk/static-http + $(INSTALL_DIR) $(1)/usr/lib/asterisk/scripts + $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/scripts/* $(1)/usr/lib/asterisk/scripts + $(INSTALL_DIR) $(1)/usr/lib/asterisk/gui_backups +endef + +$(eval $(call BuildPackage,asterisk18-gui)) diff --git a/admin/asterisk18-gui/files/asterisk-gui.init b/admin/asterisk18-gui/files/asterisk-gui.init new file mode 100644 index 00000000000..b3e24d4c129 --- /dev/null +++ b/admin/asterisk18-gui/files/asterisk-gui.init @@ -0,0 +1,20 @@ +#!/bin/sh /etc/rc.common +START=99 +start() { + [ ! -L /var/lib/asterisk ] && { + mkdir /var/lib -p + ln -sf /usr/lib/asterisk /var/lib/asterisk + } + } + +stop() { + [ -L /var/lib/asterisk ] && { + rm /var/lib/asterisk + } + } + +restart() { + stop + start + } + diff --git a/admin/asterisk18-gui/files/gui_http.conf b/admin/asterisk18-gui/files/gui_http.conf new file mode 100644 index 00000000000..8679e3691ee --- /dev/null +++ b/admin/asterisk18-gui/files/gui_http.conf @@ -0,0 +1,41 @@ +; +; Asterisk Builtin mini-HTTP server +; +; +[general] +; +; Whether HTTP interface is enabled or not. Default is no. +; +enabled=yes +; +; Whether Asterisk should serve static content from http-static +; Default is no. +; +enablestatic=yes +; +; Address to bind to. Default is 0.0.0.0 +; +bindaddr=0.0.0.0 +; +; Port to bind to (default is 8088) +; +bindport=8088 +; +; Prefix allows you to specify a prefix for all requests +; to the server. The default is "asterisk" so that all +; requests must begin with /asterisk +; +;prefix=asterisk + +; The post_mappings section maps URLs to real paths on the filesystem. If a +; POST is done from within an authenticated manager session to one of the +; configured POST mappings, then any files in the POST will be placed in the +; configured directory. +; +;[post_mappings] +; +; In this example, if the prefix option is set to "asterisk", then using the +; POST URL: /asterisk/uploads will put files in /var/lib/asterisk/uploads/. +;uploads = /var/lib/asterisk/uploads/ +; + diff --git a/admin/asterisk18-gui/files/gui_manager.conf b/admin/asterisk18-gui/files/gui_manager.conf new file mode 100644 index 00000000000..14fd58a6f18 --- /dev/null +++ b/admin/asterisk18-gui/files/gui_manager.conf @@ -0,0 +1,21 @@ +; +; Asterisk Call Management support +; + +; By default asterisk will listen on localhost only. +[general] +enabled = yes +webenabled=yes +port = 5038 +bindaddr = 0.0.0.0 + +; No access is allowed by default. +; To set a password, create a file in /etc/asterisk/manager.d +; use creative permission games to allow other serivces to create their own +; files + +#[admin] +# secret = securePassword +# read = system,call,log,verbose,command,agent,config +# write = system,call,log,verbose,command,agent,config + diff --git a/admin/asterisk18-gui/files/gui_users.conf b/admin/asterisk18-gui/files/gui_users.conf new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libs/bcg729/Makefile b/libs/bcg729/Makefile new file mode 100644 index 00000000000..7104a006f18 --- /dev/null +++ b/libs/bcg729/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2006-2014 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:=bcg729 +PKG_VERSION:=1.0.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://download-mirror.savannah.gnu.org/releases/linphone/plugins/sources/ +PKG_MD5SUM:=45e127a9a309aff94d3262d97b5aeab0 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL:=1 + +PKG_LICENSE:=GPL-2.0+ +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=Alex Samorukov + +include $(INCLUDE_DIR)/package.mk + +define Package/bcg729 + SUBMENU:=Telephony + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Software G729A encoder and decoder library written in C + URL:=http://www.linphone.org/technical-corner/bcg729.html + DEPENDS:=@BUILD_PATENTED +endef + +define Package/bcg729/description + Bcg729 is a software G729A encoder and decoder library written in C, developed + by Belledonne Communications, the company supporting the Linphone project. + It was written from scratch and is NOT a derivative work of ITU reference + source code in any kind. +endef + +TARGET_CFLAGS += $(FPIC) +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) -R $(PKG_INSTALL_DIR)/usr/include/bcg729 $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbcg729.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libbcg729.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/bcg729/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbcg729.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,bcg729)) diff --git a/libs/iksemel/Makefile b/libs/iksemel/Makefile new file mode 100644 index 00000000000..8a33e3ec3c5 --- /dev/null +++ b/libs/iksemel/Makefile @@ -0,0 +1,75 @@ +# +# Copyright (C) 2014 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:=iksemel +PKG_VERSION:=1.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://iksemel.googlecode.com/files/ +PKG_MD5SUM:=532e77181694f87ad5eb59435d11c1ca + +PKG_FIXUP:=autoreconf + +PKG_INSTALL:=1 + +PKG_LICENSE:=LGPL-2.1 +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=Jiri Slachta + +include $(INCLUDE_DIR)/package.mk + +define Package/libiksemel + SUBMENU:=Telephony + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Iksemel Jabber Library + URL:=http://code.google.com/p/iksemel/ + DEPENDS:= +libgnutls +libtasn1 +libgcrypt +libgpg-error +endef + +define Package/libiksemel/description +Iksemel is an XML parser library mainly designed for Jabber applications. +It provides SAX, DOM, and special Jabber stream APIs. Library is coded +in ANSI C except the network code (which is POSIX compatible), thus +highly portable. +endef + +TARGET_CFLAGS += $(FPIC) +TARGET_LDFLAGS += \ + -Wl,-rpath-link,$(STAGING_DIR)/usr/lib \ + -lgnutls -lgcrypt -lgpg-error + +define Build/Configure + $(call Build/Configure/Default, \ + --enable-shared \ + --enable-static \ + --with-libgnutls-prefix="$(STAGING_DIR)/usr" \ + , \ + LIBS="$(TARGET_LDFLAGS)" \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/iksemel.h $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libiksemel.{a,so*} $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/iksemel.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libiksemel/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libiksemel.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libiksemel)) diff --git a/libs/iksemel/patches/001-missing-macros.patch b/libs/iksemel/patches/001-missing-macros.patch new file mode 100644 index 00000000000..4563ac52bc9 --- /dev/null +++ b/libs/iksemel/patches/001-missing-macros.patch @@ -0,0 +1,163 @@ +--- /dev/null ++++ b/gnutls.m4 +@@ -0,0 +1,160 @@ ++dnl Autoconf macros for libgnutls ++dnl $id$ ++ ++# Modified for LIBGNUTLS -- nmav ++# Configure paths for LIBGCRYPT ++# Shamelessly stolen from the one of XDELTA by Owen Taylor ++# Werner Koch 99-12-09 ++ ++dnl AM_PATH_LIBGNUTLS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) ++dnl Test for libgnutls, and define LIBGNUTLS_CFLAGS and LIBGNUTLS_LIBS ++dnl ++AC_DEFUN([AM_PATH_LIBGNUTLS], ++[dnl ++dnl Get the cflags and libraries from the libgnutls-config script ++dnl ++AC_ARG_WITH(libgnutls-prefix, ++ [ --with-libgnutls-prefix=PFX Prefix where libgnutls is installed (optional)], ++ libgnutls_config_prefix="$withval", libgnutls_config_prefix="") ++ ++ if test x$libgnutls_config_prefix != x ; then ++ if test x${LIBGNUTLS_CONFIG+set} != xset ; then ++ LIBGNUTLS_CONFIG=$libgnutls_config_prefix/bin/libgnutls-config ++ fi ++ fi ++ ++ AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, no) ++ min_libgnutls_version=ifelse([$1], ,0.1.0,$1) ++ AC_MSG_CHECKING(for libgnutls - version >= $min_libgnutls_version) ++ no_libgnutls="" ++ if test "$LIBGNUTLS_CONFIG" = "no" ; then ++ no_libgnutls=yes ++ else ++ LIBGNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --cflags` ++ LIBGNUTLS_LIBS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --libs` ++ libgnutls_config_version=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version` ++ ++ ++ ac_save_CFLAGS="$CFLAGS" ++ ac_save_LIBS="$LIBS" ++ CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS" ++ LIBS="$LIBS $LIBGNUTLS_LIBS" ++dnl ++dnl Now check if the installed libgnutls is sufficiently new. Also sanity ++dnl checks the results of libgnutls-config to some extent ++dnl ++ rm -f conf.libgnutlstest ++ AC_TRY_RUN([ ++#include ++#include ++#include ++#include ++ ++int ++main () ++{ ++ system ("touch conf.libgnutlstest"); ++ ++ if( strcmp( gnutls_check_version(NULL), "$libgnutls_config_version" ) ) ++ { ++ printf("\n*** 'libgnutls-config --version' returned %s, but LIBGNUTLS (%s)\n", ++ "$libgnutls_config_version", gnutls_check_version(NULL) ); ++ printf("*** was found! If libgnutls-config was correct, then it is best\n"); ++ printf("*** to remove the old version of LIBGNUTLS. You may also be able to fix the error\n"); ++ printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); ++ printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); ++ printf("*** required on your system.\n"); ++ printf("*** If libgnutls-config was wrong, set the environment variable LIBGNUTLS_CONFIG\n"); ++ printf("*** to point to the correct copy of libgnutls-config, and remove the file config.cache\n"); ++ printf("*** before re-running configure\n"); ++ } ++ else if ( strcmp(gnutls_check_version(NULL), LIBGNUTLS_VERSION ) ) ++ { ++ printf("\n*** LIBGNUTLS header file (version %s) does not match\n", LIBGNUTLS_VERSION); ++ printf("*** library (version %s)\n", gnutls_check_version(NULL) ); ++ } ++ else ++ { ++ if ( gnutls_check_version( "$min_libgnutls_version" ) ) ++ { ++ return 0; ++ } ++ else ++ { ++ printf("no\n*** An old version of LIBGNUTLS (%s) was found.\n", ++ gnutls_check_version(NULL) ); ++ printf("*** You need a version of LIBGNUTLS newer than %s. The latest version of\n", ++ "$min_libgnutls_version" ); ++ printf("*** LIBGNUTLS is always available from ftp://gnutls.hellug.gr/pub/gnutls.\n"); ++ printf("*** \n"); ++ printf("*** If you have already installed a sufficiently new version, this error\n"); ++ printf("*** probably means that the wrong copy of the libgnutls-config shell script is\n"); ++ printf("*** being found. The easiest way to fix this is to remove the old version\n"); ++ printf("*** of LIBGNUTLS, but you can also set the LIBGNUTLS_CONFIG environment to point to the\n"); ++ printf("*** correct copy of libgnutls-config. (In this case, you will have to\n"); ++ printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); ++ printf("*** so that the correct libraries are found at run-time))\n"); ++ } ++ } ++ return 1; ++} ++],, no_libgnutls=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) ++ CFLAGS="$ac_save_CFLAGS" ++ LIBS="$ac_save_LIBS" ++ fi ++ ++ if test "x$no_libgnutls" = x ; then ++ AC_MSG_RESULT(yes) ++ ifelse([$2], , :, [$2]) ++ else ++ if test -f conf.libgnutlstest ; then ++ : ++ else ++ AC_MSG_RESULT(no) ++ fi ++ if test "$LIBGNUTLS_CONFIG" = "no" ; then ++ echo "*** The libgnutls-config script installed by LIBGNUTLS could not be found" ++ echo "*** If LIBGNUTLS was installed in PREFIX, make sure PREFIX/bin is in" ++ echo "*** your path, or set the LIBGNUTLS_CONFIG environment variable to the" ++ echo "*** full path to libgnutls-config." ++ else ++ if test -f conf.libgnutlstest ; then ++ : ++ else ++ echo "*** Could not run libgnutls test program, checking why..." ++ CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS" ++ LIBS="$LIBS $LIBGNUTLS_LIBS" ++ AC_TRY_LINK([ ++#include ++#include ++#include ++#include ++], [ return !!gnutls_check_version(NULL); ], ++ [ echo "*** The test program compiled, but did not run. This usually means" ++ echo "*** that the run-time linker is not finding LIBGNUTLS or finding the wrong" ++ echo "*** version of LIBGNUTLS. If it is not finding LIBGNUTLS, you'll need to set your" ++ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" ++ echo "*** to the installed location Also, make sure you have run ldconfig if that" ++ echo "*** is required on your system" ++ echo "***" ++ echo "*** If you have an old version installed, it is best to remove it, although" ++ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ++ echo "***" ], ++ [ echo "*** The test program failed to compile or link. See the file config.log for the" ++ echo "*** exact error that occured. This usually means LIBGNUTLS was incorrectly installed" ++ echo "*** or that you have moved LIBGNUTLS since it was installed. In the latter case, you" ++ echo "*** may want to edit the libgnutls-config script: $LIBGNUTLS_CONFIG" ]) ++ CFLAGS="$ac_save_CFLAGS" ++ LIBS="$ac_save_LIBS" ++ fi ++ fi ++ LIBGNUTLS_CFLAGS="" ++ LIBGNUTLS_LIBS="" ++ ifelse([$3], , :, [$3]) ++ fi ++ rm -f conf.libgnutlstest ++ AC_SUBST(LIBGNUTLS_CFLAGS) ++ AC_SUBST(LIBGNUTLS_LIBS) ++]) ++ ++dnl *-*wedit:notab*-* Please keep this as the last line. diff --git a/libs/libosip2/Makefile b/libs/libosip2/Makefile new file mode 100644 index 00000000000..fe4066b26ee --- /dev/null +++ b/libs/libosip2/Makefile @@ -0,0 +1,73 @@ +# +# Copyright (C) 2014 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:=libosip2 +PKG_VERSION:=4.1.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@GNU/osip +PKG_MD5SUM:=756423628683c07f817432f046a26516 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +PKG_LICENSE:=LGPL-2.1+ +PKG_LICENSE_FILES:=COPYING + +include $(INCLUDE_DIR)/package.mk + +define Package/libosip2 + SUBMENU:=Telephony + SECTION:=libs + CATEGORY:=Libraries + TITLE:=GNU oSIP library + URL:=http://www.gnu.org/software/osip/ + DEPENDS:=+librt +endef + +define Package/libosip2/description + GNU oSIP library, a Session Initiation Protocol (SIP) implementation. +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --disable-debug \ + --disable-trace \ + --disable-mpatrol \ + --disable-gprof \ + --disable-mt \ + --enable-pthread \ + --enable-semaphore \ + --disable-sysv \ + --disable-gperf \ + --disable-test \ + --disable-minisize + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/osip{,parser}2 $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libosip{,parser}2.{a,so*} $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libosip2.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libosip2/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libosip{,parser}2.so $(PKG_INSTALL_DIR)/usr/lib/libosip{,parser}2.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libosip2)) diff --git a/libs/libosip2/patches/001-automake-compat.patch b/libs/libosip2/patches/001-automake-compat.patch new file mode 100644 index 00000000000..9c0bc11cd6b --- /dev/null +++ b/libs/libosip2/patches/001-automake-compat.patch @@ -0,0 +1,8 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,3 +1,5 @@ ++ACLOCAL_AMFLAGS = -I scripts ++ + EXTRA_DIST = README BUGS FEATURES HISTORY autogen.sh libosip2.pc.in + + SUBDIRS = include src scripts help platform diff --git a/libs/libsrtp/Makefile b/libs/libsrtp/Makefile new file mode 100644 index 00000000000..ac09f557f86 --- /dev/null +++ b/libs/libsrtp/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2014 OpenWrt.org +# Copyright (C) 2011 Victor Seva +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=libsrtp +PKG_VERSION:=1.4.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=srtp-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=@SF/srtp +PKG_MD5SUM:=9b449edb011c934ca97009e7e0566d22 + +PKG_BUILD_DIR:=$(BUILD_DIR)/srtp +PKG_INSTALL:=1 + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jiri Slachta + +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS += $(FPIC) +CONFIGURE_ARGS += --disable-stdout --enable-syslog + +define Package/libsrtp + SUBMENU:=Telephony + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Secure Real-time Transport Protocol (SRTP) library + URL:=http://sourceforge.net/projects/srtp +endef + +define Package/libsrtp/description +Open-source implementation of the Secure Real-time Transport +Protocol (SRTP) originally authored by Cisco Systems, Inc. +It is available under a BSD-style license. +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/srtp $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsrtp.{a,so*} $(1)/usr/lib/ +endef + + +define Package/libsrtp/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsrtp.so.* \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libsrtp)) diff --git a/libs/libsrtp/patches/1003_fix_mips_namespace_collision.patch b/libs/libsrtp/patches/1003_fix_mips_namespace_collision.patch new file mode 100644 index 00000000000..534ea4bc30e --- /dev/null +++ b/libs/libsrtp/patches/1003_fix_mips_namespace_collision.patch @@ -0,0 +1,59 @@ +Description: Fix MIPS namespace collision +Author: Thiemo Seufer +Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=24;bug=439976 +Bug-Debian: http://bugs.debian.org/439976 +Last-Update: 2010-02-28 +--- a/test/srtp_driver.c ++++ b/test/srtp_driver.c +@@ -314,7 +314,7 @@ main (int argc, char *argv[]) { + if (do_codec_timing) { + srtp_policy_t policy; + int ignore; +- double mips = mips_estimate(1000000000, &ignore); ++ double mips_est = mips_estimate(1000000000, &ignore); + + crypto_policy_set_rtp_default(&policy.rtp); + crypto_policy_set_rtcp_default(&policy.rtcp); +@@ -323,33 +323,33 @@ main (int argc, char *argv[]) { + policy.key = test_key; + policy.next = NULL; + +- printf("mips estimate: %e\n", mips); ++ printf("mips estimate: %e\n", mips_est); + + printf("testing srtp processing time for voice codecs:\n"); + printf("codec\t\tlength (octets)\t\tsrtp instructions/second\n"); + printf("G.711\t\t%d\t\t\t%e\n", 80, +- (double) mips * (80 * 8) / ++ (double) mips_est * (80 * 8) / + srtp_bits_per_second(80, &policy) / .01 ); + printf("G.711\t\t%d\t\t\t%e\n", 160, +- (double) mips * (160 * 8) / ++ (double) mips_est * (160 * 8) / + srtp_bits_per_second(160, &policy) / .02); + printf("G.726-32\t%d\t\t\t%e\n", 40, +- (double) mips * (40 * 8) / ++ (double) mips_est * (40 * 8) / + srtp_bits_per_second(40, &policy) / .01 ); + printf("G.726-32\t%d\t\t\t%e\n", 80, +- (double) mips * (80 * 8) / ++ (double) mips_est * (80 * 8) / + srtp_bits_per_second(80, &policy) / .02); + printf("G.729\t\t%d\t\t\t%e\n", 10, +- (double) mips * (10 * 8) / ++ (double) mips_est * (10 * 8) / + srtp_bits_per_second(10, &policy) / .01 ); + printf("G.729\t\t%d\t\t\t%e\n", 20, +- (double) mips * (20 * 8) / ++ (double) mips_est * (20 * 8) / + srtp_bits_per_second(20, &policy) / .02 ); + printf("Wideband\t%d\t\t\t%e\n", 320, +- (double) mips * (320 * 8) / ++ (double) mips_est * (320 * 8) / + srtp_bits_per_second(320, &policy) / .01 ); + printf("Wideband\t%d\t\t\t%e\n", 640, +- (double) mips * (640 * 8) / ++ (double) mips_est * (640 * 8) / + srtp_bits_per_second(640, &policy) / .02 ); + } + diff --git a/libs/libsrtp/patches/1005_fix_data_alignment.patch b/libs/libsrtp/patches/1005_fix_data_alignment.patch new file mode 100644 index 00000000000..4cb888983c9 --- /dev/null +++ b/libs/libsrtp/patches/1005_fix_data_alignment.patch @@ -0,0 +1,33 @@ +Description: Fix data alignment +Author: "Martin Guy" +Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;bug=470505 +Bug: http://sourceforge.net/tracker/index.php?func=detail&aid=1912057&group_id=38894&atid=423799 +Bug-Debian: http://bugs.debian.org/470505 +Last-Update: 2011-05-30 +--- a/test/srtp_driver.c ++++ b/test/srtp_driver.c +@@ -1129,7 +1129,6 @@ mips_estimate(int num_trials, int *ignor + * These packets were made with the default SRTP policy. + */ + +- + err_status_t + srtp_validate() { + unsigned char test_key[30] = { +@@ -1144,14 +1143,14 @@ srtp_validate() { + 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, + 0xab, 0xab, 0xab, 0xab + }; +- uint8_t srtp_plaintext[38] = { ++ uint8_t srtp_plaintext[38] __attribute__((aligned(4))) = { + 0x80, 0x0f, 0x12, 0x34, 0xde, 0xca, 0xfb, 0xad, + 0xca, 0xfe, 0xba, 0xbe, 0xab, 0xab, 0xab, 0xab, + 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, + 0xab, 0xab, 0xab, 0xab, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; +- uint8_t srtp_ciphertext[38] = { ++ uint8_t srtp_ciphertext[38] __attribute__((aligned(4))) = { + 0x80, 0x0f, 0x12, 0x34, 0xde, 0xca, 0xfb, 0xad, + 0xca, 0xfe, 0xba, 0xbe, 0x4e, 0x55, 0xdc, 0x4c, + 0xe7, 0x99, 0x78, 0xd8, 0x8c, 0xa4, 0xd2, 0x15, diff --git a/libs/libsrtp/patches/1007_update_Doxyfile.patch b/libs/libsrtp/patches/1007_update_Doxyfile.patch new file mode 100644 index 00000000000..8108d7d8474 --- /dev/null +++ b/libs/libsrtp/patches/1007_update_Doxyfile.patch @@ -0,0 +1,94 @@ +Description: Update Doxyfile and header template +Author: Jonas Smedegaard +Last-Update: 2010-02-28 +--- a/doc/Makefile.in ++++ b/doc/Makefile.in +@@ -25,6 +25,7 @@ libsrtpdoc: + echo "*** Sorry, can't build doc outside source dir"; exit 1; \ + fi + sed 's/LIBSRTPVERSION/$(version)/' header.template > header.tex ++ doxygen -u + doxygen + sed 's/\subsection/\section/' latex/index.tex > latex/index.tmp + mv latex/index.tmp latex/index.tex +@@ -38,7 +39,7 @@ cryptodoc: clean + cp latex/refman.pdf crypto.pdf + + clean: +- rm -rf latex/ header.tex ++ rm -rf latex/ header.tex Doxyfile.bak + for a in * ; do \ + if [ -f "$$a~" ] ; then rm -f $$a~; fi; \ + done; +--- a/doc/header.template ++++ b/doc/header.template +@@ -6,28 +6,40 @@ + % + \documentclass[letterpaper]{book} + \usepackage{makeidx} +-\usepackage{fancyhdr} + \usepackage{graphicx} + \usepackage{multicol} + \usepackage{float} ++\usepackage{listings} ++\usepackage{color} ++\usepackage{ifthen} ++\usepackage[table]{xcolor} + \usepackage{textcomp} + \usepackage{alltt} +-\usepackage{times} +-\usepackage{graphicx} +-\ifx\pdfoutput\undefined +-\usepackage[ps2pdf, ++\usepackage{ifpdf} ++\ifpdf ++\usepackage[pdftex, + pagebackref=true, + colorlinks=true, +- linkcolor=blue ++ linkcolor=blue, ++ unicode + ]{hyperref} + \else +-\usepackage[pdftex, ++\usepackage[ps2pdf, + pagebackref=true, + colorlinks=true, +- linkcolor=blue ++ linkcolor=blue, ++ unicode + ]{hyperref} ++\usepackage{pspicture} + \fi ++\usepackage[utf8]{inputenc} ++\usepackage{mathptmx} ++\usepackage[scaled=.90]{helvet} ++\usepackage{courier} ++\usepackage{sectsty} ++\usepackage[titles]{tocloft} + \usepackage{doxygen} ++\lstset{language=C++,inputencoding=utf8,basicstyle=\footnotesize,breaklines=true,breakatwhitespace=true,tabsize=3,numbers=left } + \makeindex + \setcounter{tocdepth}{1} + \renewcommand{\footrulewidth}{0.4pt} +@@ -59,7 +71,9 @@ + \selectfont + + ++\renewcommand{\familydefault}{\sfdefault} + \begin{document} ++\hypersetup{pageanchor=false} + \begin{titlepage} + \vspace*{4cm} + %\begin{center} +@@ -107,9 +121,6 @@ This reference material in this documena + \clearemptydoublepage + \pagenumbering{roman} + \tableofcontents +-%\clearemptydoublepage +- + \clearemptydoublepage + \pagenumbering{arabic} +- +- ++\hypersetup{pageanchor=true} diff --git a/libs/libsrtp/patches/1008_shared-lib.patch b/libs/libsrtp/patches/1008_shared-lib.patch new file mode 100644 index 00000000000..96a13ca6ab5 --- /dev/null +++ b/libs/libsrtp/patches/1008_shared-lib.patch @@ -0,0 +1,55 @@ +Description: Hack build routines to compile shared library +Author: loki_val and solar +Origin: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-libs/libsrtp/files/libsrtp-1.4.4-shared.patch +Last-Update: 2010-03-19 +--- a/Makefile.in ++++ b/Makefile.in +@@ -15,7 +15,7 @@ + + .PHONY: all test build_table_apps + +-all: test ++all: libsrtp.so test + + runtest: build_table_apps test + @echo "running libsrtp test applications..." +@@ -67,7 +67,7 @@ libdir = @libdir@ + # implicit rules for object files and test apps + + %.o: %.c +- $(COMPILE) -c $< -o $@ ++ $(COMPILE) -fPIC -c $< -o $@ + + %$(EXE): %.c + $(COMPILE) $(LDFLAGS) $< -o $@ $(SRTPLIB) $(LIBS) +@@ -105,6 +105,9 @@ libsrtp.a: $(srtpobj) $(cryptobj) $(gdoi + ar cr libsrtp.a $^ + $(RANLIB) libsrtp.a + ++libsrtp.so: $(srtpobj) $(cryptobj) $(gdoi) ++ $(CC) $(LDFLAGS) -shared -Wl,-soname,libsrtp.so.0 -o libsrtp.so.0.0 $^ ++ + # libcryptomath.a contains general-purpose routines that are used to + # generate tables and verify cryptoalgorithm implementations - this + # library is not meant to be included in production code +@@ -197,6 +200,11 @@ install: + cp include/*.h $(DESTDIR)$(includedir)/srtp + cp crypto/include/*.h $(DESTDIR)$(includedir)/srtp + if [ -f libsrtp.a ]; then cp libsrtp.a $(DESTDIR)$(libdir)/; fi ++ if [ -f libsrtp.so.0.0 ]; then \ ++ cp libsrtp.so.0.0 $(DESTDIR)$(libdir)/; \ ++ ln -s libsrtp.so.0.0 $(DESTDIR)$(libdir)/libsrtp.so.0; \ ++ ln -s libsrtp.so.0.0 $(DESTDIR)$(libdir)/libsrtp.so; \ ++ fi + + uninstall: + rm -rf $(DESTDIR)$(includedir)/srtp +@@ -204,7 +212,7 @@ uninstall: + + clean: + rm -rf $(cryptobj) $(srtpobj) $(cryptomath) TAGS \ +- libcryptomath.a libsrtp.a core *.core test/core ++ libcryptomath.a libsrtp.a libsrtp.so.0.0 core *.core test/core + for a in * */* */*/*; do \ + if [ -f "$$a~" ] ; then rm -f $$a~; fi; \ + done; diff --git a/libs/re/Makefile b/libs/re/Makefile new file mode 100644 index 00000000000..07c133d04af --- /dev/null +++ b/libs/re/Makefile @@ -0,0 +1,69 @@ +# +# Copyright (C) 2010-2014 OpenWrt.org +# Copyright (C) 2010 Alfred E. Heggestad +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=re +PKG_VERSION:=0.4.10 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.creytiv.com/pub +PKG_MD5SUM:=2966ad3db2ca34ea865825533e7b7d55 + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=docs/COPYING +PKG_MAINTAINER:=Jiri Slachta + +include $(INCLUDE_DIR)/package.mk + +define Package/libre + SUBMENU:=Telephony + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libopenssl +libpthread + TITLE:=Generic library for real-time communications with async IO support + URL:=http://www.creytiv.com/ +endef + +TARGET_CFLAGS += $(FPIC) + +ifneq ($(CONFIG_USE_EGLIBC),) +TARGET_CFLAGS += -D_GNU_SOURCE +endif + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + HAVE_LIBRESOLV= \ + CC="$(TARGET_CC)" \ + EXTRA_CFLAGS="$(TARGET_CFLAGS) -DOPENWRT" \ + EXTRA_LFLAGS="-lm" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + SYSROOT="$$$$($(FIND) $(TOOLCHAIN_DIR) -path '*/include/pthread.h' | sed -ne '1s#/include/pthread.h##p')" \ + SYSROOT_ALT="$(STAGING_DIR)/usr" \ + RELEASE=1 \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + OS=linux \ + all install +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/share/re + $(CP) $(PKG_BUILD_DIR)/mk/re.mk $(1)/usr/share/re/ + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/re $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libre.{a,so} $(1)/usr/lib/ +endef + +define Package/libre/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libre.so $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libre)) diff --git a/libs/rem/Makefile b/libs/rem/Makefile new file mode 100644 index 00000000000..5e013b86d34 --- /dev/null +++ b/libs/rem/Makefile @@ -0,0 +1,67 @@ +# +# Copyright (C) 2010-2014 OpenWrt.org +# Copyright (C) 2010 Alfred E. Heggestad +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=rem +PKG_VERSION:=0.4.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.creytiv.com/pub +PKG_MD5SUM:=888c3000aa002790cc7129fa72d39a58 + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=docs/COPYING +PKG_MAINTAINER:=Jiri Slachta + +include $(INCLUDE_DIR)/package.mk + +define Package/librem + SUBMENU:=Telephony + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libre +libpthread + TITLE:=Audio and video processing media library + URL:=http://www.creytiv.com/ +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + LIBRE_MK=$(STAGING_DIR)/usr/share/re/re.mk \ + LIBRE_INC=$(STAGING_DIR)/usr/include/re \ + LIBRE_SO=$(STAGING_DIR)/usr/lib \ + CC="$(TARGET_CC)" \ + EXTRA_CFLAGS="$(TARGET_CFLAGS) -DOPENWRT" \ + EXTRA_LFLAGS="-lm" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + SYSROOT="$$$$($(FIND) $(TOOLCHAIN_DIR) -path '*/include/pthread.h' | sed -ne '1s#/include/pthread.h##p')" \ + SYSROOT_ALT="$(STAGING_DIR)/usr" \ + RELEASE=1 \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + OS=linux \ + all install +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/rem $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/librem.{a,so} $(1)/usr/lib/ +endef + +define Package/librem/install + rm -f $(BUILD_DIR)/$(PKG_NAME) + ln -sf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR)/$(PKG_NAME) + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/librem.so $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,librem)) diff --git a/libs/spandsp/Makefile b/libs/spandsp/Makefile new file mode 100644 index 00000000000..9971774d764 --- /dev/null +++ b/libs/spandsp/Makefile @@ -0,0 +1,60 @@ +# +# Copyright (C) 2014 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:=spandsp +PKG_VERSION:=0.0.6 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.soft-switch.org/downloads/spandsp/ +PKG_MD5SUM:=897d839516a6d4edb20397d4757a7ca3 + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 +PKG_FIXUP:=autoreconf + +PKG_LICENSE:=LGPL-2.1 GPL-2.0 +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=Jiri Slachta + +include $(INCLUDE_DIR)/package.mk + +define Package/libspandsp + SUBMENU:=Telephony + SECTION:=libs + CATEGORY:=Libraries + TITLE:=spandsp library + DEPENDS:=+libtiff +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspandsp* $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/spandsp.h $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/include/spandsp + $(CP) $(PKG_INSTALL_DIR)/usr/include/spandsp/*.h $(1)/usr/include/spandsp/ + + $(INSTALL_DIR) $(1)/usr/include/spandsp/private + $(CP) $(PKG_INSTALL_DIR)/usr/include/spandsp/private/*.h $(1)/usr/include/spandsp/private/ + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/spandsp.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libspandsp/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspandsp*so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libspandsp)) diff --git a/libs/spandsp/patches/100-compile-fixes.patch b/libs/spandsp/patches/100-compile-fixes.patch new file mode 100644 index 00000000000..59b85e66f2d --- /dev/null +++ b/libs/spandsp/patches/100-compile-fixes.patch @@ -0,0 +1,23 @@ +--- a/src/spandsp/fast_convert.h ++++ b/src/spandsp/fast_convert.h +@@ -195,7 +195,7 @@ extern "C" + { + return (long int) (x); + } +-#elif defined(__ppc__) || defined(__powerpc__) ++#elif defined(THISISNOTDEFINEDYADDAYADDA) + static __inline__ long int lfastrint(register double x) + { + int res[2]; +--- a/configure.ac ++++ b/configure.ac +@@ -152,9 +152,7 @@ AC_ARG_ENABLE(builtin_tiff, + + AC_FUNC_ERROR_AT_LINE + AC_FUNC_VPRINTF +-AC_FUNC_MALLOC + AC_FUNC_MEMCMP +-AC_FUNC_REALLOC + AC_FUNC_SELECT_ARGTYPES + + AX_C99_FUNC_LRINT diff --git a/net/asterisk-1.8.x-chan-sccp-b/Makefile b/net/asterisk-1.8.x-chan-sccp-b/Makefile new file mode 100644 index 00000000000..4e557c7b7f3 --- /dev/null +++ b/net/asterisk-1.8.x-chan-sccp-b/Makefile @@ -0,0 +1,65 @@ +# +# Copyright (C) 2014 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:=asterisk18-chan-sccp-b +PKG_REV:=5738 +PKG_VERSION:=v4.2-r$(PKG_REV) +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://svn.code.sf.net/p/chan-sccp-b/code/tags/openwrt +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_PROTO:=svn + +PKG_FIXUP:=autoreconf -fi + +PKG_LICENSE:=GPL-1.0 +PKG_LICENSE_FILES:=COPYING LICENSE +PKG_MAINTAINER:=Jiri Slachta + +include $(INCLUDE_DIR)/package.mk + +define Package/asterisk18-chan-sccp-b + SUBMENU:=Telephony + SECTION:=net + CATEGORY:=Network + TITLE:=SCCP channel provider support + URL:=http://chan-sccp-b.sourceforge.net/ + DEPENDS:=asterisk18 +libltdl +endef + +define Package/asterisk18-chan-sccp-b/description + SCCP channel provider for asterisk. It delivers extended functionality for SCCP phones over chan_skinny delivered + by asterisk by default. +endef + +define Build/Configure + $(call Build/Configure/Default,--with-asterisk=$(STAGING_DIR)/usr/include/asterisk-1.8) +endef + +define Build/Compile + $(MAKE) -C "$(PKG_BUILD_DIR)" \ + CFLAGS="$(CFLAGS) -I$(PKG_BUILD_DIR)/src -DLOW_MEMORY" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Package/asterisk18-chan-sccp-b/conffiles +/etc/asterisk/sccp.conf +endef + +define Package/asterisk18-chan-sccp-b/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(CP) ./files/sccp.openwrt.conf $(1)/etc/asterisk/sccp.conf + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_sccp.so $(1)/usr/lib/asterisk/modules/ +endef + +$(eval $(call BuildPackage,asterisk18-chan-sccp-b)) diff --git a/net/asterisk-1.8.x-chan-sccp-b/files/sccp.openwrt.conf b/net/asterisk-1.8.x-chan-sccp-b/files/sccp.openwrt.conf new file mode 100644 index 00000000000..c59f4cdb1a4 --- /dev/null +++ b/net/asterisk-1.8.x-chan-sccp-b/files/sccp.openwrt.conf @@ -0,0 +1,89 @@ +[general] +servername = Openwrt +keepalive = 60 +debug = core +context = default +dateformat = D/M/Y +bindaddr = 192.168.1.1 +port = 2000 +disallow=all +allow=ulaw +allow=alaw +allow=gsm +firstdigittimeout = 16 +digittimeout = 6 +autoanswer_ring_time = 1 +musicclass=default +language=en +deny=0.0.0.0/0.0.0.0 +permit=192.168.1.0/255.255.255.0 +protocolversion=17 + +hotline_enabled=yes +hotline_context=default +hotline_extension=111 + +[SEP001122334455] +type = device +description = Phone Number One +devicetype = 7940 +button = line, 111 +button = line, 113@01:shared +button = speeddial,Phone 2 Line 1, 112, 112@hint + +[SEP00a1a2a3a4a5] +type = device +description = Phone Number Two +devicetype = 7960 +button = line, 112 +button = line, 113@01:shared +button = speeddial,Phone 1 Line 1, 111, 111@hint + +[111] +id = 1000 +type = line +pin = 1234 +label = Phone 1 Line 1 +description = Line 111 +mailbox = 10111 +cid_name = Phone 1 CID +cid_num = 111 +accountcode=79111 +callgroup=1 +pickupgroup=1 +context = default +incominglimit = 2 +vmnum = 600 +trnsfvm = 1000 + +[112] +id = 1001 +type = line +pin = 1234 +label = Phone 2 Line 1 +description = Line 112 +mailbox = 10112 +cid_name = Phone 2 CID +cid_num = 112 +accountcode=79112 +callgroup=1 +pickupgroup=1 +context = default +incominglimit = 2 +vmnum = 600 +trnsfvm = 1000 + +[113] +id = 1002 +type = line +pin = 1234 +label = SharedLine 1 +description = Line 113 +mailbox = 10113 +cid_name = Shared +cid_num = 113 +accountcode=79113 +incominglimit = 2 +vmnum = 600 +trnsfvm = 1000 + diff --git a/net/asterisk-1.8.x-codec-g729/Makefile b/net/asterisk-1.8.x-codec-g729/Makefile new file mode 100644 index 00000000000..e789f28cf9e --- /dev/null +++ b/net/asterisk-1.8.x-codec-g729/Makefile @@ -0,0 +1,67 @@ +# +# Copyright (C) 2014 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:=asterisk18-codec-g729 +PKG_VERSION:=1.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=asterisk-g72x-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://asterisk.hosting.lv/src/ +PKG_MD5SUM:=a830aefa27634787f41ff8b209ba585b + +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME) +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +PKG_LICENSE:=GPL-3.0 +PKG_LICENSE_FILES:=README.md +PKG_MAINTAINER:=Alex Samorukov + +include $(INCLUDE_DIR)/package.mk + +define Package/asterisk18-codec-g729 + SUBMENU:=Telephony + SECTION:=net + CATEGORY:=Network + URL:=http://asterisk.hosting.lv + DEPENDS:= asterisk18 +bcg729 + TITLE:=G.729 codec for Asterisk open source PBX +endef + +define Package/asterisk11-codec-g729/description + Asterisk G.729 codec based on bcg729 implementation. +endef + +MAKE_ARGS:= \ + CC="$(TARGET_CC)" \ + LD="$(TARGET_LD)" \ + CFLAGS="$(TARGET_CFLAGS) -DASTERISK_VERSION_NUM=110000 -DLOW_MEMORY -D_XOPEN_SOURCE=600 $(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/asterisk-1.8/include -DHAVE_CONFIG_H -I. -fPIC" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + DESTDIR="$(PKG_INSTALL_DIR)" + +CONFIGURE_ARGS+=\ + --with-asterisk-includes=$(STAGING_DIR)/usr/include/asterisk-11/include \ + --with-asterisk18 \ + --with-bcg729 \ + --enable-shared \ + $(MAKE_ARGS) + +define Build/Prepare + rm -rf $(PKG_BUILD_DIR)/ + mkdir -p $(PKG_BUILD_DIR)/ + $(TAR) -xvjf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1 + $(Build/Patch) +endef + +define Package/asterisk18-codec-g729/install + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/codec_g729.so $(1)/usr/lib/asterisk/modules/ +endef + +$(eval $(call BuildPackage,asterisk18-codec-g729)) diff --git a/net/asterisk-1.8.x/Makefile b/net/asterisk-1.8.x/Makefile new file mode 100644 index 00000000000..60333f0ae69 --- /dev/null +++ b/net/asterisk-1.8.x/Makefile @@ -0,0 +1,371 @@ +# +# Copyright (C) 2014 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:=asterisk18 +PKG_VERSION:=1.8.32.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/asterisk/releases/ +PKG_MD5SUM:=ef5b0b9c49fcb9964e93b45cfe25882d + +PKG_BUILD_DIR=$(BUILD_DIR)/asterisk-$(PKG_VERSION) + +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=COPYING LICENSE +PKG_MAINTAINER:=Jiri Slachta + +include $(INCLUDE_DIR)/package.mk + +define Package/asterisk18/install/module + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*$(2).so* $(1)/usr/lib/asterisk/modules/ +endef + +define Package/asterisk18/install/conffile + $(INSTALL_DIR) $(1)/etc/asterisk + $(CP) $(PKG_INSTALL_DIR)/etc/asterisk/*$(2)* $(1)/etc/asterisk/ +endef + +define Package/asterisk18/install/lib + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/$(2).so* $(1)/usr/lib/ +endef + +define Package/asterisk18/install/sbin + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/$(2) $(1)/usr/sbin/ +endef + +define Package/asterisk18/install/sounds + $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/$(2) $(1)/usr/lib/asterisk/sounds/ +endef + +define BuildAsterisk18Module + define Package/asterisk18-$(1) + $$(call Package/asterisk18/Default) + TITLE:=$(2) support + DEPENDS:= asterisk18 $(patsubst +%,+PACKAGE_asterisk18-$(1):%,$(4)) + endef + + define Package/asterisk18-$(1)/conffiles +$(5) + endef + + define Package/asterisk18-$(1)/description + $$(call Package/asterisk18/Default/description) +This package provides support $(3) in Asterisk. + endef + + define Package/asterisk18-$(1)/install +$(foreach c,$(6),$(call Package/asterisk18/install/conffile,$$(1),$(c));) +$(foreach m,$(7),$(call Package/asterisk18/install/module,$$(1),$(m));) +$(foreach s,$(8),$(call Package/asterisk18/install/sounds,$$(1),$(s));) +$(foreach b,$(9),$(call Package/asterisk18/install/sbin,$$(1),$(b));) + endef + + $$(eval $$(call BuildPackage,asterisk18-$(1))) +endef + +define Package/asterisk18/Default + SUBMENU:=Telephony + SECTION:=net + CATEGORY:=Network + URL:=http://www.asterisk.org/ +endef + +define Package/asterisk18/Default/description + Asterisk is a complete PBX in software. It provides all of the features + you would expect from a PBX and more. Asterisk does voice over IP in three + protocols, and can interoperate with almost all standards-based telephony + equipment using relatively inexpensive hardware. +endef + +define Package/asterisk18 +$(call Package/asterisk18/Default) + TITLE:=Complete open source PBX, v1.8.x + MENU:=1 + DEPENDS:=+libopenssl +libncurses +libpopt +libpthread +zlib @!TARGET_avr32 +endef + +define Package/asterisk18/description +$(call Package/asterisk18/Default/description) +endef + +define Package/asterisk18/conffiles +/etc/asterisk/cel.conf +/etc/asterisk/asterisk.conf +/etc/asterisk/modules.conf +/etc/asterisk/extensions.conf +/etc/asterisk/sip.conf +/etc/asterisk/sip_notify.conf +/etc/asterisk/features.conf +/etc/asterisk/indications.conf +/etc/asterisk/logger.conf +/etc/asterisk/manager.conf +/etc/asterisk/rtp.conf +/etc/default/asterisk +/etc/init.d/asterisk +endef + +AST_CFG_FILES:=\ + asterisk.conf cel.conf ccss.conf extensions.conf features.conf indications.conf logger.conf manager.conf \ + modules.conf sip.conf sip_notify.conf rtp.conf users.conf +AST_EMB_MODULES:=\ + app_dial app_echo app_macro app_playback codec_ulaw codec_gsm format_gsm format_pcm format_wav format_wav_gsm \ + func_strings func_timeout func_callerid func_logic chan_sip pbx_config res_rtp_asterisk res_rtp_multicast + +define Package/asterisk18/install +$(call Package/asterisk18/install/sbin,$(1),asterisk) +$(foreach m,$(AST_CFG_FILES),$(call Package/asterisk18/install/conffile,$(1),$(m));) +$(foreach m,$(AST_EMB_MODULES),$(call Package/asterisk18/install/module,$(1),$(m));) + $(INSTALL_DIR) $(1)/etc/default + $(INSTALL_DATA) ./files/asterisk.default $(1)/etc/default/asterisk + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/asterisk.init $(1)/etc/init.d/asterisk +endef + +define Package/asterisk18-sounds +$(call Package/asterisk18/Default) + TITLE:=Sounds support + DEPENDS:=asterisk18 +endef + +define Package/asterisk18-sounds/description +$(call Package/asterisk18/Default/description) +This package provides sounds for Asterisk. +endef + +define Package/asterisk18-sounds/install + $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/* $(1)/usr/lib/asterisk/sounds/ + rm -f $(1)/usr/lib/asterisk/sounds/vm-* + rm -f $(1)/usr/lib/asterisk/sounds/conf-* +endef + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-chan-gtalk),) + CONFIGURE_ARGS+= \ + --with-iksemel="$(STAGING_DIR)/usr" + SITE_VARS+= \ + ac_cv_lib_iksemel_iks_start_sasl=yes +else + CONFIGURE_ARGS+= \ + --without-iksemel +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-curl),) + CONFIGURE_ARGS+= \ + --with-libcurl="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= \ + --without-libcurl +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-mysql),) + CONFIGURE_ARGS+= \ + --with-mysqlclient +else + CONFIGURE_ARGS+= \ + --without-mysqlclient +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 + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-pgsql),) + CONFIGURE_ARGS+= \ + --with-postgres="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= \ + --without-postgres +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-res-fax-spandsp),) + CONFIGURE_ARGS+= \ + --with-spandsp="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= \ + --without-spandsp +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-res-srtp),) + CONFIGURE_ARGS+= \ + --with-srtp="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= \ + --without-srtp +endif + +EXTRA_CFLAGS+= $(TARGET_CPPFLAGS) +EXTRA_LDFLAGS+= $(TARGET_LDFLAGS) +CONFIGURE_ARGS+= \ + --without-curses \ + --with-gsm=internal \ + --without-bluetooth \ + --without-cap \ + --without-dahdi \ + --without-gtk2 \ + --without-isdnnet \ + --without-misdn \ + --without-nbs \ + --with-ncurses="$(STAGING_DIR)/usr" \ + --without-netsnmp \ + --without-newt \ + --without-ogg \ + --without-osptk \ + --with-popt="$(STAGING_DIR)/usr" \ + --without-pri \ + --without-radius \ + --without-sdl \ + --without-suppserv \ + --without-tds \ + --without-termcap \ + --without-tinfo \ + --without-vorbis \ + --without-vpb \ + --with-z="$(STAGING_DIR)/usr" \ + --with-sounds-cache="$(DL_DIR)" \ + --disable-xmldoc + +define Build/Prepare + $(call Build/Prepare/Default) +ifneq ($(CONFIG_TARGET_lantiq),) + $(CP) ./src-lantiq/* $(PKG_BUILD_DIR)/ +endif +endef + +define Build/Configure + $(call Build/Configure/Default,,$(SITE_VARS)) +endef + +define Build/Compile + $(MAKE) -C "$(PKG_BUILD_DIR)" \ + include/asterisk/version.h \ + include/asterisk/buildopts.h defaults.h \ + makeopts.embed_rules + ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY" \ + ASTLDFLAGS="$(EXTRA_LDFLAGS)" \ + $(MAKE) -C "$(PKG_BUILD_DIR)" \ + ASTVARLIBDIR="/usr/lib/asterisk" \ + ASTDATADIR="/usr/lib/asterisk" \ + ASTKEYDIR="/usr/lib/asterisk" \ + ASTDBDIR="/usr/lib/asterisk" \ + NOISY_BUILD="1" \ + DEBUG="" \ + OPTIMIZE="" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install samples +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/asterisk-1.8/include/asterisk/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk/*.h $(1)/usr/include/asterisk-1.8/include/asterisk/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk.h $(1)/usr/include/asterisk-1.8/include/ +endef + +$(eval $(call BuildPackage,asterisk18)) +$(eval $(call BuildPackage,asterisk18-sounds)) + +################################ +# AST modules +# Params: +# 1 - Package subname +# 2 - Package title +# 3 - Module description +# 4 - Module dependencies +# 5 - Full path to multiple conffiles +# 6 - conf files +# 7 - module files +# 8 - sound files +# 9 - binary files +################################ + +$(eval $(call BuildAsterisk18Module,app-alarmreceiver,Alarm receiver,Central Station Alarm receiver for Ademco Contact ID,,,,app_alarmreceiver,)) +$(eval $(call BuildAsterisk18Module,app-authenticate,Authenticate commands,Execute arbitrary authenticate commands,,,,app_authenticate,)) +$(eval $(call BuildAsterisk18Module,app-directed_pickup,Directed call pickup,support for directed call pickup,,,,app_directed_pickup,)) +$(eval $(call BuildAsterisk18Module,app-disa,Direct Inward System Access,Direct Inward System Access,,,,app_disa,)) +$(eval $(call BuildAsterisk18Module,app-exec,Exec application,support for application execution,,,,app_exec,)) +$(eval $(call BuildAsterisk18Module,app-chanisavail,Channel availability check,support for checking if a channel is available,,,,app_chanisavail,)) +$(eval $(call BuildAsterisk18Module,app-chanspy,Channel listen in,support for listening in on any channel,,,,app_chanspy,)) +$(eval $(call BuildAsterisk18Module,app-minivm,Minimal voicemail system,a voicemail system in small building blocks working together based on the Comedian Mail voicemail,,/etc/asterisk/extensions_minivm.conf /etc/asterisk/minivm.conf,extensions_minivm.conf minivm.conf,app_minivm,)) +$(eval $(call BuildAsterisk18Module,app-mixmonitor,Record a call and mix the audio,record a call and mix the audio during the recording,,,,app_mixmonitor,)) +$(eval $(call BuildAsterisk18Module,app-originate,Originate a call,originating an outbound call and connecting it to a specified extension or application,,,,app_originate,)) +$(eval $(call BuildAsterisk18Module,app-playtones,Playtones application,play a tone list,,,,app_playtones,)) +$(eval $(call BuildAsterisk18Module,app-read,Variable read,a trivial application to read a variable,,,,app_read,)) +$(eval $(call BuildAsterisk18Module,app-readexten,Extension to variable,a trivial application to read an extension into a variable,,,,app_readexten,)) +$(eval $(call BuildAsterisk18Module,app-record,Record sound file,to record a sound file,,,,app_record,)) +$(eval $(call BuildAsterisk18Module,app-sayunixtime,Say Unix time,an application to say Unix time,,,,app_sayunixtime,)) +$(eval $(call BuildAsterisk18Module,app-senddtmf,Send DTMF digits,Sends arbitrary DTMF digits,,,,app_senddtmf,)) +$(eval $(call BuildAsterisk18Module,app-setcallerid,Set callerid,Support for setting callerid,,,,app_setcallerid,)) +$(eval $(call BuildAsterisk18Module,app-sms,SMS,SMS support (ETSI ES 201 912 protocol 1),+libpopt +libstdcpp,,,app_sms,,smsq)) +$(eval $(call BuildAsterisk18Module,app-stack,Stack applications, stack applications Gosub Return etc., +asterisk18-res-agi,,,app_stack,)) +$(eval $(call BuildAsterisk18Module,app-system,System exec,support for executing system commands,,,,app_system,)) +$(eval $(call BuildAsterisk18Module,app-talkdetect,File playback with audio detect,for file playback with audio detect,,,,app_talkdetect,)) +$(eval $(call BuildAsterisk18Module,app-verbose,Verbose logging,Verbose logging application,,,,app_verbose,)) +$(eval $(call BuildAsterisk18Module,app-waituntil,Sleep,support sleeping until the given epoch,,,,app_waituntil,)) +$(eval $(call BuildAsterisk18Module,app-while,While loop,a while loop implementation,,,,app_while,)) +$(eval $(call BuildAsterisk18Module,cdr,Provides CDR,Call Detail Record,,/etc/asterisk/cdr.conf /etc/asterisk/cdr_custom.conf /etc/asterisk/cdr_manager.conf /etc/asterisk/cdr_syslog.conf,cdr cdr_custom cdr_manager cdr_syslog,app_cdr app_forkcdr cdr_custom cdr_manager cdr_syslog func_cdr,)) +$(eval $(call BuildAsterisk18Module,cdr-csv,Provides CDR CSV,Call Detail Record with CSV support,,,,cdr_csv,)) +$(eval $(call BuildAsterisk18Module,codec-a-mu,Alaw to ulaw translation,translation between alaw and ulaw codecs,,,,codec_a_mu,)) +$(eval $(call BuildAsterisk18Module,codec-alaw,Signed linear to alaw translation,translation between signed linear and alaw codecs,,,,codec_alaw,)) +$(eval $(call BuildAsterisk18Module,codec-g722,G.722,a high bit rate 48/56/64Kbps ITU standard codec,,,,codec_g722,)) +$(eval $(call BuildAsterisk18Module,codec-g726,Signed linear to G.726 translation,translation between signed linear and ITU G.726-32kbps codecs,,,,codec_g726,)) +$(eval $(call BuildAsterisk18Module,curl,CURL,CURL support,+libcurl,,,func_curl res_curl,)) +$(eval $(call BuildAsterisk18Module,format-g726,G.726,support for headerless G.726 16/24/32/40kbps data format,,,,format_g726,)) +$(eval $(call BuildAsterisk18Module,format-g729,G.729,support for raw headerless G729 data,,,,format_g729,)) +$(eval $(call BuildAsterisk18Module,format-sln,Raw slinear format,support for raw slinear format,,,,format_sln,)) +$(eval $(call BuildAsterisk18Module,format-sln16,Raw slinear 16 format,support for raw slinear 16 format,,,,format_sln16,)) +$(eval $(call BuildAsterisk18Module,func-blacklist,Blacklist on callerid,looking up the callerid number and see if it is blacklisted,,,,func_blacklist,)) +$(eval $(call BuildAsterisk18Module,func-base64,base64 support,support of base64 function,,,,func_base64,)) +$(eval $(call BuildAsterisk18Module,func-cut,CUT function,CUT function,,,,func_cut,)) +$(eval $(call BuildAsterisk18Module,func-db,Database interaction,functions for interaction with the database,,,,func_db,)) +$(eval $(call BuildAsterisk18Module,func-devstate,Blinky lights control,functions for manually controlled blinky lights,,,,func_devstate,)) +$(eval $(call BuildAsterisk18Module,func-extstate,Hinted extension state,retrieving the state of a hinted extension for dialplan control,,,,func_extstate,)) +$(eval $(call BuildAsterisk18Module,func-global,Global variable,global variable dialplan functions,,,,func_global,)) +$(eval $(call BuildAsterisk18Module,func-groupcount,Group count,for counting number of channels in the specified group,,,,func_groupcount,)) +$(eval $(call BuildAsterisk18Module,func-channel,Channel info,Channel info dialplan function,,,,func_channel,)) +$(eval $(call BuildAsterisk18Module,func-shell,Shell,support for shell execution,,,,func_shell,)) +$(eval $(call BuildAsterisk18Module,func-uri,URI encoding and decoding,Encodes and decodes URI-safe strings,,,,func_uri,)) +$(eval $(call BuildAsterisk18Module,func-vmcount,vmcount dialplan,a vmcount dialplan function,,,,func_vmcount,)) +$(eval $(call BuildAsterisk18Module,chan-agent,Agents proxy channel,An implementation of agents proxy channel,,,,chan_agent,)) +$(eval $(call BuildAsterisk18Module,chan-gtalk,GTalk,An implementation of chan_gtalk and res_jabber for GTalk support,+libiksemel,/etc/asterisk/gtalk.conf /etc/asterisk/jabber.conf,gtalk.conf jabber.conf,chan_gtalk res_jabber,)) +$(eval $(call BuildAsterisk18Module,chan-iax2,IAX2 channel,An implementation of IAX2 channel,+asterisk18-res-timing-timerfd,/etc/asterisk/iax.conf /etc/asterisk/iaxprov.conf,iax.conf iaxprov.conf,chan_iax2,)) +$(eval $(call BuildAsterisk18Module,chan-lantiq,Lantiq TAPI channel,An implementation of Lantiq TAPI channel,+kmod-ltq-vmmc,/etc/asterisk/lantiq.conf,lantiq.conf,chan_lantiq,)) +$(eval $(call BuildAsterisk18Module,chan-local,Local proxy channel,An implementation of local proxy channel,,,,chan_local,)) +$(eval $(call BuildAsterisk18Module,chan-mgcp,MGCP channel,the channel chan_mgcp,,/etc/asterisk/mgcp.conf,mgcp.conf,chan_mgcp,)) +$(eval $(call BuildAsterisk18Module,chan-ooh323,ooH323 channel,the channel chan_ooh323,,/etc/asterisk/ooh323.conf,ooh323.conf,chan_ooh323,)) +$(eval $(call BuildAsterisk18Module,chan-skinny,Skinny channel,the channel chan_skinny,,/etc/asterisk/skinny.conf,skinny.conf,chan_skinny,)) +$(eval $(call BuildAsterisk18Module,mysql,MySQL,MySQL support,+libmysqlclient,/etc/asterisk/res_config_mysql.conf,res_config_mysql.conf,res_config_mysql,)) +$(eval $(call BuildAsterisk18Module,odbc,ODBC,ODBC support,+libpthread +libc +unixodbc,/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,cdr_adaptive_odbc cdr_odbc cel_odbc func_odbc res_odbc,cdr_adaptive_odbc cdr_odbc cel_odbc func_odbc res_config_odbc res_odbc,)) +$(eval $(call BuildAsterisk18Module,pgsql,PostgreSQL,PostgreSQL support,+libpq,/etc/asterisk/cel_pgsql.conf /etc/asterisk/cdr_pgsql.conf /etc/asterisk/res_pgsql.conf,cel_pgsql.conf cdr_pgsql.conf res_pgsql.conf,cel_pgsql cdr_pgsql res_config_pgsql,)) +$(eval $(call BuildAsterisk18Module,pbx-ael,Asterisk Extension Logic,support for symbolic Asterisk Extension Logic,,,extensions.ael,pbx_ael,)) +$(eval $(call BuildAsterisk18Module,pbx-spool,Call Spool,Outgoing call spool support,,,,pbx_spool,)) +$(eval $(call BuildAsterisk18Module,pbx-lua,Lua,provides Lua resources for Asterisk,+libpthread +libc +liblua,/etc/asterisk/extensions.lua,extensions.lua,pbx_lua,)) +$(eval $(call BuildAsterisk18Module,res-ael-share,Shareable AEL code,support for shareable AEL code mainly between internal and external modules,,,,res_ael_share,)) +$(eval $(call BuildAsterisk18Module,res-agi,Asterisk Gateway Interface,support for the Asterisk Gateway Interface extension,,,,res_agi,)) +$(eval $(call BuildAsterisk18Module,res-clioriginate,Calls via CLI,Originate calls via the CLI,,,,res_clioriginate,)) +$(eval $(call BuildAsterisk18Module,res-crypto,Provides Crypto,Cryptographic Signature capability,,,,res_crypto,)) +$(eval $(call BuildAsterisk18Module,res-monitor,Provides Monitor,Cryptographic Signature capability,,,,res_monitor,)) +$(eval $(call BuildAsterisk18Module,res-phoneprov,Phone Provisioning,Phone provisioning application for the asterisk internal http server,,/etc/asterisk/phoneprov.conf,phoneprov.conf,res_phoneprov,)) +$(eval $(call BuildAsterisk18Module,res-pktccops,Provide PacketCable COPS,simple client/server model for supporting policy control over QoS signaling protocols,,/etc/asterisk/res_pktccops.conf,res_pktccops.conf,res_pktccops,)) +$(eval $(call BuildAsterisk18Module,res-smdi,Provide SMDI,Simple Message Desk Interface capability,,/etc/asterisk/smdi.conf,smdi.conf,res_smdi,)) +$(eval $(call BuildAsterisk18Module,res-fax,FAX modules,Generic FAX resource for FAX technology resource modules,+asterisk18-res-timing-pthread,/etc/asterisk/res_fax.conf /etc/asterisk/udptl.conf,udptl.conf res_fax.conf,res_fax,)) +$(eval $(call BuildAsterisk18Module,res-fax-spandsp,Spandsp T.38 and G.711,Spandsp T.38 and G.711 FAX Resource,+asterisk18-res-fax +libspandsp +libtiff,,,res_fax_spandsp,)) +$(eval $(call BuildAsterisk18Module,res-musiconhold,MOH,Music On Hold support,,/etc/asterisk/musiconhold.conf,musiconhold.conf,res_musiconhold,)) +$(eval $(call BuildAsterisk18Module,res-srtp,SRTP,Secure RTP,+libsrtp,,,res_srtp,)) +$(eval $(call BuildAsterisk18Module,res-timing-pthread,pthread Timing Interface,,,,,res_timing_pthread,)) +$(eval $(call BuildAsterisk18Module,res-timing-timerfd,Timerfd Timing Interface,,,,,res_timing_timerfd,)) +$(eval $(call BuildAsterisk18Module,voicemail,Voicemail,voicemail related modules,,/etc/asterisk/voicemail.conf,voicemail.conf,*voicemail res_adsi res_smdi,vm-*)) diff --git a/net/asterisk-1.8.x/files/asterisk.default b/net/asterisk-1.8.x/files/asterisk.default new file mode 100644 index 00000000000..9d046c42da7 --- /dev/null +++ b/net/asterisk-1.8.x/files/asterisk.default @@ -0,0 +1,4 @@ +## startup options for /etc/init.d/asterisk + +ENABLE_ASTERISK="yes" +OPTIONS="" diff --git a/net/asterisk-1.8.x/files/asterisk.init b/net/asterisk-1.8.x/files/asterisk.init new file mode 100644 index 00000000000..ec3b60bf033 --- /dev/null +++ b/net/asterisk-1.8.x/files/asterisk.init @@ -0,0 +1,34 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2014 OpenWrt.org + +START=99 +APP=asterisk +OPTIONS= +DEST= +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 $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() { + 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/100-build_tools-iconv.patch b/net/asterisk-1.8.x/patches/100-build_tools-iconv.patch new file mode 100644 index 00000000000..d3cad8252f4 --- /dev/null +++ b/net/asterisk-1.8.x/patches/100-build_tools-iconv.patch @@ -0,0 +1,11 @@ +--- a/build_tools/menuselect-deps.in ++++ b/build_tools/menuselect-deps.in +@@ -16,7 +16,7 @@ GTK2=@PBX_GTK2@ + H323=@PBX_H323@ + HOARD=@PBX_HOARD@ + ICAL=@PBX_ICAL@ +-ICONV=@PBX_ICONV@ ++ICONV=0 + IKSEMEL=@PBX_IKSEMEL@ + IMAP_TK=@PBX_IMAP_TK@ + IODBC=@PBX_IODBC@ diff --git a/net/asterisk-1.8.x/patches/200-addons-defaultenable.patch b/net/asterisk-1.8.x/patches/200-addons-defaultenable.patch new file mode 100644 index 00000000000..65b9e7994d2 --- /dev/null +++ b/net/asterisk-1.8.x/patches/200-addons-defaultenable.patch @@ -0,0 +1,77 @@ +--- a/addons/app_mysql.c ++++ b/addons/app_mysql.c +@@ -25,7 +25,7 @@ + + /*** MODULEINFO + mysqlclient +- no ++ yes + deprecated + func_odbc + ***/ +--- a/addons/app_saycountpl.c ++++ b/addons/app_saycountpl.c +@@ -21,7 +21,7 @@ + */ + + /*** MODULEINFO +- no ++ yes + deprecated + say.conf + ***/ +--- a/addons/cdr_mysql.c ++++ b/addons/cdr_mysql.c +@@ -35,7 +35,7 @@ + + /*** MODULEINFO + mysqlclient +- no ++ yes + deprecated + cdr_adaptive_odbc + ***/ +--- a/addons/chan_mobile.c ++++ b/addons/chan_mobile.c +@@ -27,7 +27,7 @@ + + /*** MODULEINFO + bluetooth +- no ++ yes + extended + ***/ + +--- a/addons/chan_ooh323.c ++++ b/addons/chan_ooh323.c +@@ -18,7 +18,7 @@ + + + /*** MODULEINFO +- no ++ yes + extended + ***/ + +--- a/addons/res_config_mysql.c ++++ b/addons/res_config_mysql.c +@@ -24,7 +24,7 @@ + + /*** MODULEINFO + mysqlclient +- no ++ yes + extended + ***/ + +--- a/res/res_pktccops.c ++++ b/res/res_pktccops.c +@@ -31,7 +31,7 @@ + */ + + /*** MODULEINFO +- no ++ yes + extended + ***/ + diff --git a/net/asterisk-1.8.x/patches/201-utils-defaultenable.patch b/net/asterisk-1.8.x/patches/201-utils-defaultenable.patch new file mode 100644 index 00000000000..dcc0aa7678d --- /dev/null +++ b/net/asterisk-1.8.x/patches/201-utils-defaultenable.patch @@ -0,0 +1,11 @@ +--- a/utils/utils.xml ++++ b/utils/utils.xml +@@ -33,7 +33,7 @@ + extended + + +- no ++ yes + popt + extended + diff --git a/net/asterisk-1.8.x/patches/500-nres.patch b/net/asterisk-1.8.x/patches/500-nres.patch new file mode 100644 index 00000000000..7f1a9a9387e --- /dev/null +++ b/net/asterisk-1.8.x/patches/500-nres.patch @@ -0,0 +1,11 @@ +--- a/configure ++++ b/configure +@@ -16902,8 +16902,6 @@ if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } + +-$as_echo "#define HAVE_RES_NINIT 1" >>confdefs.h +- + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_9_ndestroy" >&5 + $as_echo_n "checking for library containing res_9_ndestroy... " >&6; } + if ${ac_cv_search_res_9_ndestroy+:} false; then : diff --git a/net/asterisk-1.8.x/src-lantiq/channels/chan_lantiq.c b/net/asterisk-1.8.x/src-lantiq/channels/chan_lantiq.c new file mode 100644 index 00000000000..6e2b5022c03 --- /dev/null +++ b/net/asterisk-1.8.x/src-lantiq/channels/chan_lantiq.c @@ -0,0 +1,1679 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2012, Luka Perkov + * Copyright (C) 2012, John Crispin + * Copyright (C) 2012, Andrej VlaÅ¡ić + * Copyright (C) 2012, Kaspar Schleiser for T-Labs + * (Deutsche Telekom Innovation Laboratories) + * Copyright (C) 2012, Mirko Vogt for T-Labs + * (Deutsche Telekom Innovation Laboratories) + * + * Luka Perkov + * John Crispin + * Andrej VlaÅ¡ić + * Kaspar Schleiser + * Mirko Vogt + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +/*! \file + * + * \brief Asterisk channel line driver for Lantiq based TAPI boards + * + * \author Luka Perkov + * \author John Crispin + * \author Andrej VlaÅ¡ić + * \author Kaspar Schleiser + * \author Mirko Vogt + * + * \ingroup channel_drivers + */ + +#include "asterisk.h" + +ASTERISK_FILE_VERSION(__FILE__, "$Revision: xxx $") + +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_LINUX_COMPILER_H +#include +#endif +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Lantiq TAPI includes */ +#include +#include + +#define RTP_HEADER_LEN 12 + +#define TAPI_AUDIO_PORT_NUM_MAX 2 +#define TAPI_TONE_LOCALE_NONE 0 +#define TAPI_TONE_LOCALE_RINGING_CODE 26 +#define TAPI_TONE_LOCALE_BUSY_CODE 27 +#define TAPI_TONE_LOCALE_CONGESTION_CODE 27 +#define TAPI_TONE_LOCALE_DIAL_CODE 25 +#define TAPI_TONE_LOCALE_WAITING_CODE 37 + +#define LANTIQ_CONTEXT_PREFIX "lantiq" + +static const char config[] = "lantiq.conf"; + +static char firmware_filename[PATH_MAX] = "/lib/firmware/ifx_firmware.bin"; +static char bbd_filename[PATH_MAX] = "/lib/firmware/ifx_bbd_fxs.bin"; +static char base_path[PATH_MAX] = "/dev/vmmc"; +static int per_channel_context = 0; + +/* + * The private structures of the Phone Jack channels are linked for selecting + * outgoing channels. + */ +enum channel_state { + ONHOOK, + OFFHOOK, + DIALING, + INCALL, + CALL_ENDED, + RINGING, + UNKNOWN +}; + +static struct lantiq_pvt { + struct ast_channel *owner; /* Channel we belong to, possibly NULL */ + int port_id; /* Port number of this object, 0..n */ + int channel_state; + char context[AST_MAX_CONTEXT]; /* this port's dialplan context */ + char ext[AST_MAX_EXTENSION+1]; /* the extension this port is connecting */ + int dial_timer; /* timer handle for autodial timeout */ + char dtmfbuf[AST_MAX_EXTENSION+1]; /* buffer holding dialed digits */ + int dtmfbuf_len; /* lenght of dtmfbuf */ + int rtp_timestamp; /* timestamp for RTP packets */ + uint16_t rtp_seqno; /* Sequence nr for RTP packets */ + uint32_t call_setup_start; /* Start of dialling in ms */ + uint32_t call_setup_delay; /* time between ^ and 1st ring in ms */ + uint16_t jb_size; /* Jitter buffer size */ + uint32_t jb_underflow; /* Jitter buffer injected samples */ + uint32_t jb_overflow; /* Jitter buffer dropped samples */ + uint16_t jb_delay; /* Jitter buffer: playout delay */ + uint16_t jb_invalid; /* Jitter buffer: Nr. of invalid packets */ + +} *iflist = NULL; + +static struct lantiq_ctx { + int dev_fd; + int channels; + int ch_fd[TAPI_AUDIO_PORT_NUM_MAX]; +} dev_ctx; + +static int ast_digit_begin(struct ast_channel *ast, char digit); +static int ast_digit_end(struct ast_channel *ast, char digit, unsigned int duration); +static int ast_lantiq_call(struct ast_channel *ast, char *dest, int timeout); +static int ast_lantiq_hangup(struct ast_channel *ast); +static int ast_lantiq_answer(struct ast_channel *ast); +static struct ast_frame *ast_lantiq_read(struct ast_channel *ast); +static int ast_lantiq_write(struct ast_channel *ast, struct ast_frame *frame); +static struct ast_frame *ast_lantiq_exception(struct ast_channel *ast); +static int ast_lantiq_indicate(struct ast_channel *chan, int condition, const void *data, size_t datalen); +static int ast_lantiq_fixup(struct ast_channel *old, struct ast_channel *new); +static struct ast_channel *ast_lantiq_requester(const char *type, format_t format, const struct ast_channel *requestor, void *data, int *cause); +static int acf_channel_read(struct ast_channel *chan, const char *funcname, char *args, char *buf, size_t buflen); +static void lantiq_jb_get_stats(int c); + +static const struct ast_channel_tech lantiq_tech = { + .type = "TAPI", + .description = "Lantiq TAPI Telephony API Driver", + .capabilities = AST_FORMAT_G723_1 | AST_FORMAT_SLINEAR | AST_FORMAT_ULAW | AST_FORMAT_G729A, + .send_digit_begin = ast_digit_begin, + .send_digit_end = ast_digit_end, + .call = ast_lantiq_call, + .hangup = ast_lantiq_hangup, + .answer = ast_lantiq_answer, + .read = ast_lantiq_read, + .write = ast_lantiq_write, + .exception = ast_lantiq_exception, + .indicate = ast_lantiq_indicate, + .fixup = ast_lantiq_fixup, + .requester = ast_lantiq_requester, + .func_channel_read = acf_channel_read +}; + +/* Protect the interface list (of lantiq_pvt's) */ +AST_MUTEX_DEFINE_STATIC(iflock); + +/* + * Protect the monitoring thread, so only one process can kill or start it, and + * not when it's doing something critical. + */ +AST_MUTEX_DEFINE_STATIC(monlock); + +/* Boolean value whether the monitoring thread shall continue. */ +static unsigned int monitor; + +/* The scheduling thread */ +struct ast_sched_thread *sched_thread; + +/* + * This is the thread for the monitor which checks for input on the channels + * which are not currently in use. + */ +static pthread_t monitor_thread = AST_PTHREADT_NULL; + + +#define WORDS_BIGENDIAN +/* struct taken from some GPLed code by Mike Borella */ +typedef struct rtp_header +{ +#if defined(WORDS_BIGENDIAN) + uint8_t version:2, padding:1, extension:1, csrc_count:4; +#else + uint8_t csrc_count:4, extension:1, padding:1, version:2; +#endif +#if defined(WORDS_BIGENDIAN) + uint8_t marker:1, payload_type:7; +#else + uint8_t payload_type:7, marker:1; +#endif + uint16_t seqno; + uint32_t timestamp; + uint32_t ssrc; +} rtp_header_t; + +static uint32_t now(void) { + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + + uint64_t tmp = ts.tv_sec*1000 + (ts.tv_nsec/1000000); + return (uint32_t) tmp; +} + +static int lantiq_dev_open(const char *dev_path, const int32_t ch_num) +{ + char dev_name[PATH_MAX]; + memset(dev_name, 0, sizeof(dev_name)); + snprintf(dev_name, PATH_MAX, "%s%u%u", dev_path, 1, ch_num); + return open((const char*)dev_name, O_RDWR, 0644); +} + +static void lantiq_ring(int c, int r, const char *cid) +{ + uint8_t status; + + if (r) { + if (!cid) { + status = (uint8_t) ioctl(dev_ctx.ch_fd[c], IFX_TAPI_RING_START, 0); + } else { + IFX_TAPI_CID_MSG_t msg; + IFX_TAPI_CID_MSG_STRING_t cid_el; + + memset(&msg, 0, sizeof(msg)); + memset(&cid_el, 0, sizeof(cid_el)); + + cid_el.elementType = IFX_TAPI_CID_ST_CLI; + cid_el.len = strlen(cid); + strncpy((char*)cid_el.element, cid, (size_t)cid_el.len); + + msg.txMode = IFX_TAPI_CID_HM_ONHOOK; + msg.messageType = IFX_TAPI_CID_MT_CSUP; + msg.message = (IFX_TAPI_CID_MSG_ELEMENT_t *)&cid_el; + msg.nMsgElements = 1; + + status = (uint8_t) ioctl(dev_ctx.ch_fd[c], IFX_TAPI_CID_TX_SEQ_START, (IFX_int32_t) &msg); + } + } else { + status = (uint8_t) ioctl(dev_ctx.ch_fd[c], IFX_TAPI_RING_STOP, 0); + } + + if (status) { + ast_log(LOG_ERROR, "%s ioctl failed\n", + (r ? "IFX_TAPI_RING_START" : "IFX_TAPI_RING_STOP")); + } +} + +static int lantiq_play_tone(int c, int t) +{ + /* stop currently playing tone before starting new one */ + if (t != TAPI_TONE_LOCALE_NONE) { + ioctl(dev_ctx.ch_fd[c], IFX_TAPI_TONE_LOCAL_PLAY, TAPI_TONE_LOCALE_NONE); + } + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_TONE_LOCAL_PLAY, t)) { + ast_log(LOG_ERROR, "IFX_TAPI_TONE_LOCAL_PLAY ioctl failed\n"); + return -1; + } + + return 0; +} + +static enum channel_state lantiq_get_hookstatus(int port) +{ + uint8_t status; + + if (ioctl(dev_ctx.ch_fd[port], IFX_TAPI_LINE_HOOK_STATUS_GET, &status)) { + ast_log(LOG_ERROR, "IFX_TAPI_LINE_HOOK_STATUS_GET ioctl failed\n"); + return UNKNOWN; + } + + if (status) { + return OFFHOOK; + } else { + return ONHOOK; + } +} + +static int +lantiq_dev_binary_buffer_create(const char *path, uint8_t **ppBuf, uint32_t *pBufSz) +{ + FILE *fd; + struct stat file_stat; + int32_t status = 0; + + fd = fopen(path, "rb"); + if (fd == NULL) { + ast_log(LOG_ERROR, "binary file %s open failed\n", path); + return -1; + } + + if (stat(path, &file_stat)) { + ast_log(LOG_ERROR, "file %s statistics get failed\n", path); + return -1; + } + + *ppBuf = malloc(file_stat.st_size); + if (*ppBuf == NULL) { + ast_log(LOG_ERROR, "binary file %s memory allocation failed\n", path); + status = -1; + goto on_exit; + } + + if (fread (*ppBuf, sizeof(uint8_t), file_stat.st_size, fd) <= 0) { + ast_log(LOG_ERROR, "file %s read failed\n", path); + status = -1; + goto on_exit; + } + + *pBufSz = file_stat.st_size; + +on_exit: + if (fd != NULL) + fclose(fd); + + if (*ppBuf != NULL && status) + free(*ppBuf); + + return status; +} + +static int32_t lantiq_dev_firmware_download(int32_t fd, const char *path) +{ + uint8_t *firmware = NULL; + uint32_t size = 0; + VMMC_IO_INIT vmmc_io_init; + + ast_log(LOG_DEBUG, "loading firmware: \"%s\".", path); + + if (lantiq_dev_binary_buffer_create(path, &firmware, &size)) + return -1; + + memset(&vmmc_io_init, 0, sizeof(VMMC_IO_INIT)); + vmmc_io_init.pPRAMfw = firmware; + vmmc_io_init.pram_size = size; + + if (ioctl(fd, FIO_FW_DOWNLOAD, &vmmc_io_init)) { + ast_log(LOG_ERROR, "FIO_FW_DOWNLOAD ioctl failed\n"); + return -1; + } + + if (firmware != NULL) + free(firmware); + + return 0; +} + +static const char *state_string(enum channel_state s) +{ + switch (s) { + case ONHOOK: return "ONHOOK"; + case OFFHOOK: return "OFFHOOK"; + case DIALING: return "DIALING"; + case INCALL: return "INCALL"; + case CALL_ENDED: return "CALL_ENDED"; + case RINGING: return "RINGING"; + default: return "UNKNOWN"; + } +} + +static const char *control_string(int c) +{ + switch (c) { + case AST_CONTROL_HANGUP: return "Other end has hungup"; + case AST_CONTROL_RING: return "Local ring"; + case AST_CONTROL_RINGING: return "Remote end is ringing"; + case AST_CONTROL_ANSWER: return "Remote end has answered"; + case AST_CONTROL_BUSY: return "Remote end is busy"; + case AST_CONTROL_TAKEOFFHOOK: return "Make it go off hook"; + case AST_CONTROL_OFFHOOK: return "Line is off hook"; + case AST_CONTROL_CONGESTION: return "Congestion (circuits busy)"; + case AST_CONTROL_FLASH: return "Flash hook"; + case AST_CONTROL_WINK: return "Wink"; + case AST_CONTROL_OPTION: return "Set a low-level option"; + case AST_CONTROL_RADIO_KEY: return "Key Radio"; + case AST_CONTROL_RADIO_UNKEY: return "Un-Key Radio"; + case AST_CONTROL_PROGRESS: return "Remote end is making Progress"; + case AST_CONTROL_PROCEEDING: return "Remote end is proceeding"; + case AST_CONTROL_HOLD: return "Hold"; + case AST_CONTROL_UNHOLD: return "Unhold"; + case AST_CONTROL_SRCUPDATE: return "Media Source Update"; + case AST_CONTROL_CONNECTED_LINE: return "Connected Line"; + case AST_CONTROL_REDIRECTING: return "Redirecting"; + case AST_CONTROL_INCOMPLETE: return "Incomplete"; + case -1: return "Stop tone"; + default: return "Unknown"; + } +} + +static int ast_lantiq_indicate(struct ast_channel *chan, int condition, const void *data, size_t datalen) +{ + ast_verb(3, "phone indication \"%s\"\n", control_string(condition)); + + struct lantiq_pvt *pvt = chan->tech_pvt; + + switch (condition) { + case -1: + { + lantiq_play_tone(pvt->port_id, TAPI_TONE_LOCALE_NONE); + return 0; + } + case AST_CONTROL_CONGESTION: + case AST_CONTROL_BUSY: + { + lantiq_play_tone(pvt->port_id, TAPI_TONE_LOCALE_BUSY_CODE); + return 0; + } + case AST_CONTROL_RINGING: + { + pvt->call_setup_delay = now() - pvt->call_setup_start; + lantiq_play_tone(pvt->port_id, TAPI_TONE_LOCALE_RINGING_CODE); + return 0; + } + default: + { + /* -1 lets asterisk generate the tone */ + return -1; + } + } +} + +static int ast_lantiq_fixup(struct ast_channel *old, struct ast_channel *new) +{ + ast_log(LOG_DEBUG, "entering... no code here...\n"); + return 0; +} + +static int ast_digit_begin(struct ast_channel *chan, char digit) +{ + /* TODO: Modify this callback to let Asterisk support controlling the length of DTMF */ + ast_log(LOG_DEBUG, "entering... no code here...\n"); + return 0; +} + +static int ast_digit_end(struct ast_channel *ast, char digit, unsigned int duration) +{ + ast_log(LOG_DEBUG, "entering... no code here...\n"); + return 0; +} + +static int ast_lantiq_call(struct ast_channel *ast, char *dest, int timeout) +{ + /* lock to prevent simultaneous access with do_monitor thread processing */ + ast_mutex_lock(&iflock); + + struct lantiq_pvt *pvt = ast->tech_pvt; + ast_log(LOG_DEBUG, "state: %s\n", state_string(pvt->channel_state)); + + if (pvt->channel_state == ONHOOK) { + ast_log(LOG_DEBUG, "port %i is ringing\n", pvt->port_id); + + char *cid = ast->connected.id.number.valid ? ast->connected.id.number.str : NULL; + ast_log(LOG_DEBUG, "port %i CID: %s\n", pvt->port_id, cid ? cid : "none"); + + lantiq_ring(pvt->port_id, 1, cid); + pvt->channel_state = RINGING; + + ast_setstate(ast, AST_STATE_RINGING); + ast_queue_control(ast, AST_CONTROL_RINGING); + } else { + ast_log(LOG_DEBUG, "port %i is busy\n", pvt->port_id); + ast_setstate(ast, AST_STATE_BUSY); + ast_queue_control(ast, AST_CONTROL_BUSY); + } + + ast_mutex_unlock(&iflock); + + return 0; +} + +static int ast_lantiq_hangup(struct ast_channel *ast) +{ + /* lock to prevent simultaneous access with do_monitor thread processing */ + ast_mutex_lock(&iflock); + + struct lantiq_pvt *pvt = ast->tech_pvt; + ast_log(LOG_DEBUG, "state: %s\n", state_string(pvt->channel_state)); + + if (ast->_state == AST_STATE_RINGING) { + // FIXME + ast_debug(1, "TAPI: ast_lantiq_hangup(): ast->_state == AST_STATE_RINGING\n"); + } + + switch (pvt->channel_state) { + case RINGING: + case ONHOOK: + lantiq_ring(pvt->port_id, 0, NULL); + pvt->channel_state = ONHOOK; + break; + default: + ast_log(LOG_DEBUG, "we were hung up, play busy tone\n"); + pvt->channel_state = CALL_ENDED; + lantiq_play_tone(pvt->port_id, TAPI_TONE_LOCALE_BUSY_CODE); + } + + lantiq_jb_get_stats(pvt->port_id); + + ast_setstate(ast, AST_STATE_DOWN); + ast_module_unref(ast_module_info->self); + ast->tech_pvt = NULL; + pvt->owner = NULL; + + ast_mutex_unlock(&iflock); + + return 0; +} + +static int ast_lantiq_answer(struct ast_channel *ast) +{ + ast_log(LOG_DEBUG, "entering... no code here...\n"); + return 0; +} + +static struct ast_frame * ast_lantiq_read(struct ast_channel *ast) +{ + ast_log(LOG_DEBUG, "entering... no code here...\n"); + return NULL; +} + +static int ast_lantiq_write(struct ast_channel *ast, struct ast_frame *frame) +{ + char buf[2048]; + struct lantiq_pvt *pvt = ast->tech_pvt; + int ret = -1; + rtp_header_t *rtp_header = (rtp_header_t *) buf; + + if(frame->frametype != AST_FRAME_VOICE) { + ast_log(LOG_DEBUG, "unhandled frame type\n"); + return 0; + } + + if (frame->datalen == 0) { + ast_log(LOG_DEBUG, "we've been prodded\n"); + return 0; + } + + memset(buf, 0, sizeof(rtp_header_t)); + rtp_header->version = 2; + rtp_header->padding = 0; + rtp_header->extension = 0; + rtp_header->csrc_count = 0; + rtp_header->marker = 0; + rtp_header->timestamp = pvt->rtp_timestamp; + rtp_header->seqno = pvt->rtp_seqno++; + rtp_header->ssrc = 0; + rtp_header->payload_type = (uint8_t) frame->subclass.codec; + + pvt->rtp_timestamp += 160; + + memcpy(buf+RTP_HEADER_LEN, frame->data.ptr, frame->datalen); + + ret = write(dev_ctx.ch_fd[pvt->port_id], buf, frame->datalen+RTP_HEADER_LEN); + if (ret <= 0) { + ast_debug(1, "TAPI: ast_lantiq_write(): error writing.\n"); + return -1; + } + +#ifdef TODO_DEVEL_INFO + ast_debug(1, "ast_lantiq_write(): size: %i version: %i padding: %i extension: %i csrc_count: %i\n" + "marker: %i payload_type: %s seqno: %i timestamp: %i ssrc: %i\n", + (int)ret, + (int)rtp_header->version, + (int)rtp_header->padding, + (int)rtp_header->extension, + (int)rtp_header->csrc_count, + (int)rtp_header->marker, + ast_codec2str(rtp_header->payload_type), + (int)rtp_header->seqno, + (int)rtp_header->timestamp, + (int)rtp_header->ssrc); +#endif + + return 0; +} + +static int acf_channel_read(struct ast_channel *chan, const char *funcname, char *args, char *buf, size_t buflen) +{ + struct lantiq_pvt *pvt; + int res = 0; + + if (!chan || chan->tech != &lantiq_tech) { + ast_log(LOG_ERROR, "This function requires a valid Lantiq TAPI channel\n"); + return -1; + } + + ast_mutex_lock(&iflock); + + pvt = (struct lantiq_pvt*) chan->tech_pvt; + + if (!strcasecmp(args, "csd")) { + snprintf(buf, buflen, "%lu", (unsigned long int) pvt->call_setup_delay); + } else if (!strcasecmp(args, "jitter_stats")){ + lantiq_jb_get_stats(pvt->port_id); + snprintf(buf, buflen, "jbBufSize=%u,jbUnderflow=%u,jbOverflow=%u,jbDelay=%u,jbInvalid=%u", + (uint32_t) pvt->jb_size, + (uint32_t) pvt->jb_underflow, + (uint32_t) pvt->jb_overflow, + (uint32_t) pvt->jb_delay, + (uint32_t) pvt->jb_invalid); + } else { + res = -1; + } + + ast_mutex_unlock(&iflock); + + return res; +} + + +static struct ast_frame * ast_lantiq_exception(struct ast_channel *ast) +{ + ast_log(LOG_DEBUG, "entering... no code here...\n"); + return NULL; +} + +static void lantiq_jb_get_stats(int c) { + struct lantiq_pvt *pvt = &iflist[c]; + + IFX_TAPI_JB_STATISTICS_t param; + memset (¶m, 0, sizeof (param)); + if (ioctl (dev_ctx.ch_fd[c], IFX_TAPI_JB_STATISTICS_GET, (IFX_int32_t) ¶m) != IFX_SUCCESS) { + ast_debug(1, "Error getting jitter buffer stats.\n"); + } else { +#if !defined (TAPI_VERSION3) && defined (TAPI_VERSION4) + ast_debug(1, "Jitter buffer stats: dev=%u, ch=%u, nType=%u, nBufSize=%u, nIsUnderflow=%u, nDsOverflow=%u, nPODelay=%u, nInvalid=%u", + (uint32_t) param.dev, + (uint32_t) param.ch, +#else + ast_debug(1, "Jitter buffer stats: nType=%u, nBufSize=%u, nIsUnderflow=%u, nDsOverflow=%u, nPODelay=%u, nInvalid=%u", +#endif + (uint32_t) param.nType, + (uint32_t) param.nBufSize, + (uint32_t) param.nIsUnderflow, + (uint32_t) param.nDsOverflow, + (uint32_t) param.nPODelay, + (uint32_t) param.nInvalid); + + pvt->jb_size = param.nBufSize; + pvt->jb_underflow = param.nIsUnderflow; + pvt->jb_overflow = param.nDsOverflow; + pvt->jb_invalid = param.nInvalid; + pvt->jb_delay = param.nPODelay; + } +} + + +static int lantiq_standby(int c) +{ + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_LINE_FEED_SET, IFX_TAPI_LINE_FEED_STANDBY)) { + ast_log(LOG_ERROR, "IFX_TAPI_LINE_FEED_SET ioctl failed\n"); + return -1; + } + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_ENC_STOP, 0)) { + ast_log(LOG_ERROR, "IFX_TAPI_ENC_STOP ioctl failed\n"); + return -1; + } + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_DEC_STOP, 0)) { + ast_log(LOG_ERROR, "IFX_TAPI_DEC_STOP ioctl failed\n"); + return -1; + } + + return lantiq_play_tone(c, TAPI_TONE_LOCALE_NONE); +} + +static int lantiq_end_dialing(int c) +{ + ast_log(LOG_DEBUG, "TODO - DEBUG MSG\n"); + struct lantiq_pvt *pvt = &iflist[c]; + + if (pvt->dial_timer) { + ast_sched_thread_del(sched_thread, pvt->dial_timer); + pvt->dial_timer = 0; + } + + if(pvt->owner) { + ast_hangup(pvt->owner); + } + + return 0; +} + +static int lantiq_end_call(int c) +{ + ast_log(LOG_DEBUG, "TODO - DEBUG MSG\n"); + + struct lantiq_pvt *pvt = &iflist[c]; + + if(pvt->owner) { + lantiq_jb_get_stats(c); + ast_queue_hangup(pvt->owner); + } + + return 0; +} + +static struct ast_channel * lantiq_channel(int state, int c, char *ext, char *ctx) +{ + ast_log(LOG_DEBUG, "TODO - DEBUG MSG\n"); + + struct ast_channel *chan = NULL; + + struct lantiq_pvt *pvt = &iflist[c]; + + chan = ast_channel_alloc(1, state, NULL, NULL, "", ext, ctx, 0, c, "TAPI/%s", "1"); + + chan->tech = &lantiq_tech; + chan->nativeformats = AST_FORMAT_ULAW; + chan->readformat = AST_FORMAT_ULAW; + chan->writeformat = AST_FORMAT_ULAW; + chan->tech_pvt = pvt; + + pvt->owner = chan; + + return chan; +} + +static struct ast_channel * ast_lantiq_requester(const char *type, format_t format, const struct ast_channel *requestor, void *data, int *cause) +{ + ast_mutex_lock(&iflock); + + char buf[BUFSIZ]; + struct ast_channel *chan = NULL; + int port_id = -1; + + ast_debug(1, "Asked to create a TAPI channel with formats: %s\n", ast_getformatname_multiple(buf, sizeof(buf), format)); + + + /* check for correct data argument */ + if (ast_strlen_zero(data)) { + ast_log(LOG_ERROR, "Unable to create channel with empty destination.\n"); + *cause = AST_CAUSE_CHANNEL_UNACCEPTABLE; + return NULL; + } + + /* get our port number */ + port_id = atoi((char*) data); + if (port_id < 1 || port_id > dev_ctx.channels) { + ast_log(LOG_ERROR, "Unknown channel ID: \"%s\"\n", (char*) data); + *cause = AST_CAUSE_CHANNEL_UNACCEPTABLE; + return NULL; + } + + /* on asterisk user's side, we're using port 1-2. + * Here in non normal human's world, we begin + * counting at 0. + */ + port_id -= 1; + + chan = lantiq_channel(AST_STATE_DOWN, port_id, NULL, NULL); + + ast_mutex_unlock(&iflock); + return chan; +} + +static int lantiq_dev_data_handler(int c) +{ + char buf[BUFSIZ]; + struct ast_frame frame = {0}; + + int res = read(dev_ctx.ch_fd[c], buf, sizeof(buf)); + if (res <= 0) ast_log(LOG_ERROR, "we got read error %i\n", res); + + rtp_header_t *rtp = (rtp_header_t*) buf; + + frame.src = "TAPI"; + frame.frametype = AST_FRAME_VOICE; + frame.subclass.codec = rtp->payload_type; + frame.samples = res - RTP_HEADER_LEN; + frame.datalen = res - RTP_HEADER_LEN; + frame.data.ptr = buf + RTP_HEADER_LEN; + + struct lantiq_pvt *pvt = (struct lantiq_pvt *) &iflist[c]; + if (pvt->owner && (pvt->owner->_state == AST_STATE_UP)) { + if(!ast_channel_trylock(pvt->owner)) { + ast_queue_frame(pvt->owner, &frame); + ast_channel_unlock(pvt->owner); + } + } + +/* ast_debug(1, "lantiq_dev_data_handler(): size: %i version: %i padding: %i extension: %i csrc_count: %i \n" + "marker: %i payload_type: %s seqno: %i timestamp: %i ssrc: %i\n", + (int)res, + (int)rtp->version, + (int)rtp->padding, + (int)rtp->extension, + (int)rtp->csrc_count, + (int)rtp->marker, + ast_codec2str(rtp->payload_type), + (int)rtp->seqno, + (int)rtp->timestamp, + (int)rtp->ssrc); +*/ + return 0; +} + +static int accept_call(int c) +{ + ast_log(LOG_DEBUG, "TODO - DEBUG MSG\n"); + + struct lantiq_pvt *pvt = &iflist[c]; + + if (pvt->owner) { + struct ast_channel *chan = pvt->owner; + + switch (chan->_state) { + case AST_STATE_RINGING: + lantiq_play_tone(c, TAPI_TONE_LOCALE_NONE); + ast_queue_control(pvt->owner, AST_CONTROL_ANSWER); + pvt->channel_state = INCALL; + break; + default: + ast_log(LOG_WARNING, "entered unhandled state %s\n", ast_state2str(chan->_state)); + } + } + + return 0; +} + +static int lantiq_dev_event_hook(int c, int state) +{ + ast_mutex_lock(&iflock); + + ast_log(LOG_DEBUG, "on port %i detected event %s hook\n", c, state ? "on" : "off"); + + int ret = -1; + if (state) { /* going onhook */ + switch (iflist[c].channel_state) { + case OFFHOOK: + ret = lantiq_standby(c); + break; + case DIALING: + ret = lantiq_end_dialing(c); + break; + case INCALL: + ret = lantiq_end_call(c); + break; + case CALL_ENDED: + ret = lantiq_standby(c); // TODO: are we sure for this ? + break; + default: + break; + } + iflist[c].channel_state = ONHOOK; + } else { /* going offhook */ + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_LINE_FEED_SET, IFX_TAPI_LINE_FEED_ACTIVE)) { + ast_log(LOG_ERROR, "IFX_TAPI_LINE_FEED_SET ioctl failed\n"); + goto out; + } + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_ENC_START, 0)) { + ast_log(LOG_ERROR, "IFX_TAPI_ENC_START ioctl failed\n"); + goto out; + } + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_DEC_START, 0)) { + ast_log(LOG_ERROR, "IFX_TAPI_DEC_START ioctl failed\n"); + goto out; + } + + switch (iflist[c].channel_state) { + case RINGING: + ret = accept_call(c); + break; + default: + iflist[c].channel_state = OFFHOOK; + lantiq_play_tone(c, TAPI_TONE_LOCALE_DIAL_CODE); + ret = 0; + break; + } + + } + +out: + ast_mutex_unlock(&iflock); + + return ret; +} + +static void lantiq_reset_dtmfbuf(struct lantiq_pvt *pvt) +{ + pvt->dtmfbuf[0] = '\0'; + pvt->dtmfbuf_len = 0; + pvt->ext[0] = '\0'; +} + +static void lantiq_dial(struct lantiq_pvt *pvt) +{ + struct ast_channel *chan = NULL; + + ast_log(LOG_DEBUG, "user want's to dial %s.\n", pvt->dtmfbuf); + + if (ast_exists_extension(NULL, pvt->context, pvt->dtmfbuf, 1, NULL)) { + ast_debug(1, "found extension %s, dialing\n", pvt->dtmfbuf); + + strcpy(pvt->ext, pvt->dtmfbuf); + + ast_verbose(VERBOSE_PREFIX_3 " extension exists, starting PBX %s\n", pvt->ext); + + chan = lantiq_channel(AST_STATE_UP, pvt->port_id, pvt->ext+1, pvt->context); + chan->tech_pvt = pvt; + pvt->owner = chan; + + strcpy(chan->exten, pvt->ext); + ast_setstate(chan, AST_STATE_RING); + pvt->channel_state = INCALL; + + pvt->call_setup_start = now(); + + if (ast_pbx_start(chan)) { + ast_log(LOG_WARNING, " unable to start PBX on %s\n", chan->name); + ast_hangup(chan); + } + } else { + ast_log(LOG_DEBUG, "no extension found\n"); + lantiq_play_tone(pvt->port_id, TAPI_TONE_LOCALE_BUSY_CODE); + pvt->channel_state = CALL_ENDED; + } + + lantiq_reset_dtmfbuf(pvt); +} + +static int lantiq_event_dial_timeout(const void* data) +{ + ast_debug(1, "TAPI: lantiq_event_dial_timeout()\n"); + + struct lantiq_pvt *pvt = (struct lantiq_pvt *) data; + pvt->dial_timer = 0; + + if (! pvt->channel_state == ONHOOK) { + lantiq_dial(pvt); + } else { + ast_debug(1, "TAPI: lantiq_event_dial_timeout(): dial timeout in state ONHOOK.\n"); + } + + return 0; +} + +static int lantiq_send_digit(int c, char digit) +{ + struct lantiq_pvt *pvt = &iflist[c]; + + struct ast_frame f = { .frametype = AST_FRAME_DTMF, .subclass.integer = digit }; + + if (pvt->owner) { + ast_log(LOG_DEBUG, "Port %i transmitting digit \"%c\"\n", c, digit); + return ast_queue_frame(pvt->owner, &f); + } else { + ast_debug(1, "Warning: lantiq_send_digit() without owner!\n"); + return -1; + } +} + +static void lantiq_dev_event_digit(int c, char digit) +{ + ast_mutex_lock(&iflock); + + ast_log(LOG_DEBUG, "on port %i detected digit \"%c\"\n", c, digit); + + struct lantiq_pvt *pvt = &iflist[c]; + + switch (pvt->channel_state) { + case INCALL: + { + lantiq_send_digit(c, digit); + break; + } + case OFFHOOK: + pvt->channel_state = DIALING; + + lantiq_play_tone(c, TAPI_TONE_LOCALE_NONE); + + /* fall through */ + case DIALING: + if (digit == '#') { + if (pvt->dial_timer) { + ast_sched_thread_del(sched_thread, pvt->dial_timer); + pvt->dial_timer = 0; + } + + lantiq_dial(pvt); + } else { + pvt->dtmfbuf[pvt->dtmfbuf_len] = digit; + pvt->dtmfbuf_len++; + pvt->dtmfbuf[pvt->dtmfbuf_len] = '\0'; + + /* setup autodial timer */ + if (!pvt->dial_timer) { + ast_log(LOG_DEBUG, "setting new timer\n"); + pvt->dial_timer = ast_sched_thread_add(sched_thread, 2000, lantiq_event_dial_timeout, (const void*) pvt); + } else { + ast_log(LOG_DEBUG, "replacing timer\n"); + struct sched_context *sched = ast_sched_thread_get_context(sched_thread); + AST_SCHED_REPLACE(pvt->dial_timer, sched, 2000, lantiq_event_dial_timeout, (const void*) pvt); + } + } + break; + default: + ast_log(LOG_ERROR, "don't know what to do in unhandled state\n"); + break; + } + + ast_mutex_unlock(&iflock); + return; +} + +static void lantiq_dev_event_handler(void) +{ + IFX_TAPI_EVENT_t event; + unsigned int i; + + for (i = 0; i < dev_ctx.channels ; i++) { + ast_mutex_lock(&iflock); + + memset (&event, 0, sizeof(event)); + event.ch = i; + if (ioctl(dev_ctx.dev_fd, IFX_TAPI_EVENT_GET, &event)) { + ast_mutex_unlock(&iflock); + continue; + } + if (event.id == IFX_TAPI_EVENT_NONE) { + ast_mutex_unlock(&iflock); + continue; + } + + ast_mutex_unlock(&iflock); + + switch(event.id) { + case IFX_TAPI_EVENT_FXS_ONHOOK: + lantiq_dev_event_hook(i, 1); + break; + case IFX_TAPI_EVENT_FXS_OFFHOOK: + lantiq_dev_event_hook(i, 0); + break; + case IFX_TAPI_EVENT_DTMF_DIGIT: + lantiq_dev_event_digit(i, (char)event.data.dtmf.ascii); + break; + case IFX_TAPI_EVENT_PULSE_DIGIT: + if (event.data.pulse.digit == 0xB) { + lantiq_dev_event_digit(i, '0'); + } else { + lantiq_dev_event_digit(i, '0' + (char)event.data.pulse.digit); + } + break; + case IFX_TAPI_EVENT_COD_DEC_CHG: + case IFX_TAPI_EVENT_TONE_GEN_END: + case IFX_TAPI_EVENT_CID_TX_SEQ_END: + break; + default: + ast_log(LOG_ERROR, "unknown TAPI event %08X\n", event.id); + break; + } + } +} + +static void * lantiq_events_monitor(void *data) +{ + ast_verbose("TAPI thread started\n"); + + struct pollfd fds[3]; + + fds[0].fd = dev_ctx.dev_fd; + fds[0].events = POLLIN; + fds[1].fd = dev_ctx.ch_fd[0]; + fds[1].events = POLLIN; + fds[2].fd = dev_ctx.ch_fd[1]; + fds[2].events = POLLIN; + + while (monitor) { + ast_mutex_lock(&monlock); + + if (poll(fds, dev_ctx.channels + 1, 2000) <= 0) { + ast_mutex_unlock(&monlock); + continue; + } + + if (fds[0].revents & POLLIN) { + lantiq_dev_event_handler(); + } + + ast_mutex_unlock(&monlock); + + if ((fds[1].revents & POLLIN) && (lantiq_dev_data_handler(0))) { + ast_log(LOG_ERROR, "data handler 0 failed\n"); + break; + } + + if ((fds[2].revents & POLLIN) && (lantiq_dev_data_handler(1))) { + ast_log(LOG_ERROR, "data handler 1 failed\n"); + break; + } + } + + return NULL; +} + +static int restart_monitor(void) +{ + /* If we're supposed to be stopped -- stay stopped */ + if (monitor_thread == AST_PTHREADT_STOP) + return 0; + + ast_mutex_lock(&monlock); + + if (monitor_thread == pthread_self()) { + ast_mutex_unlock(&monlock); + ast_log(LOG_WARNING, "Cannot kill myself\n"); + return -1; + } + + if (monitor_thread != AST_PTHREADT_NULL) { + if (ast_mutex_lock(&iflock)) { + ast_mutex_unlock(&monlock); + ast_log(LOG_WARNING, "Unable to lock the interface list\n"); + return -1; + } + monitor = 0; + while (pthread_kill(monitor_thread, SIGURG) == 0) + sched_yield(); + pthread_join(monitor_thread, NULL); + ast_mutex_unlock(&iflock); + } + + monitor = 1; + /* Start a new monitor */ + if (ast_pthread_create_background(&monitor_thread, NULL, lantiq_events_monitor, NULL) < 0) { + ast_mutex_unlock(&monlock); + ast_log(LOG_ERROR, "Unable to start monitor thread.\n"); + return -1; + } + + ast_mutex_unlock(&monlock); + + return 0; +} + +static void lantiq_cleanup(void) +{ + int c; + + for (c = 0; c < dev_ctx.channels ; c++) { + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_LINE_FEED_SET, IFX_TAPI_LINE_FEED_STANDBY)) { + ast_log(LOG_WARNING, "IFX_TAPI_LINE_FEED_SET ioctl failed\n"); + } + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_ENC_STOP, 0)) { + ast_log(LOG_WARNING, "IFX_TAPI_ENC_STOP ioctl failed\n"); + } + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_DEC_STOP, 0)) { + ast_log(LOG_WARNING, "IFX_TAPI_DEC_STOP ioctl failed\n"); + } + } + + if (ioctl(dev_ctx.dev_fd, IFX_TAPI_DEV_STOP, 0)) { + ast_log(LOG_WARNING, "IFX_TAPI_DEV_STOP ioctl failed\n"); + } + + close(dev_ctx.dev_fd); +} + +static int unload_module(void) +{ + int c; + + ast_channel_unregister(&lantiq_tech); + + if (!ast_mutex_lock(&iflock)) { + for (c = 0; c < dev_ctx.channels ; c++) { + if (iflist[c].owner) + ast_softhangup(iflist[c].owner, AST_SOFTHANGUP_APPUNLOAD); + } + ast_mutex_unlock(&iflock); + } else { + ast_log(LOG_WARNING, "Unable to lock the monitor\n"); + return -1; + } + + if (!ast_mutex_lock(&monlock)) { + if (monitor_thread > AST_PTHREADT_NULL) { + monitor = 0; + while (pthread_kill(monitor_thread, SIGURG) == 0) + sched_yield(); + pthread_join(monitor_thread, NULL); + } + monitor_thread = AST_PTHREADT_STOP; + ast_mutex_unlock(&monlock); + } else { + ast_log(LOG_WARNING, "Unable to lock the monitor\n"); + return -1; + } + + return 0; +} + +static struct lantiq_pvt *lantiq_init_pvt(struct lantiq_pvt *pvt) +{ + if (pvt) { + pvt->owner = NULL; + pvt->port_id = -1; + pvt->channel_state = UNKNOWN; + pvt->context[0] = '\0'; + pvt->ext[0] = '\0'; + pvt->dial_timer = 0; + pvt->dtmfbuf[0] = '\0'; + pvt->dtmfbuf_len = 0; + pvt->call_setup_start = 0; + pvt->call_setup_delay = 0; + pvt->jb_size = 0; + pvt->jb_underflow = 0; + pvt->jb_overflow = 0; + pvt->jb_delay = 0; + pvt->jb_invalid = 0; + } else { + ast_log(LOG_ERROR, "unable to clear pvt structure\n"); + } + + return pvt; +} + +static int lantiq_create_pvts(void) +{ + int i; + + iflist = ast_calloc(1, sizeof(struct lantiq_pvt) * dev_ctx.channels); + + if (iflist) { + for (i=0 ; inext) { + if (!strcasecmp(v->name, "channels")) { + dev_ctx.channels = atoi(v->value); + if (!dev_ctx.channels) { + ast_log(LOG_ERROR, "Invalid value for channels in config %s\n", config); + ast_config_destroy(cfg); + return AST_MODULE_LOAD_DECLINE; + } + } else if (!strcasecmp(v->name, "firmwarefilename")) { + ast_copy_string(firmware_filename, v->value, sizeof(firmware_filename)); + } else if (!strcasecmp(v->name, "bbdfilename")) { + ast_copy_string(bbd_filename, v->value, sizeof(bbd_filename)); + } else if (!strcasecmp(v->name, "basepath")) { + ast_copy_string(base_path, v->value, sizeof(base_path)); + } else if (!strcasecmp(v->name, "per_channel_context")) { + if (!strcasecmp(v->value, "on")) { + per_channel_context = 1; + } else if (!strcasecmp(v->value, "off")) { + per_channel_context = 0; + } else { + ast_log(LOG_ERROR, "Unknown per_channel_context value '%s'. Try 'on' or 'off'.\n", v->value); + ast_config_destroy(cfg); + return AST_MODULE_LOAD_DECLINE; + } + } + } + + for (v = ast_variable_browse(cfg, "general"); v; v = v->next) { + if (!strcasecmp(v->name, "rxgain")) { + rxgain = atoi(v->value); + if (!rxgain) { + rxgain = 0; + ast_log(LOG_WARNING, "Invalid rxgain: %s, using default.\n", v->value); + } + } else if (!strcasecmp(v->name, "txgain")) { + txgain = atoi(v->value); + if (!txgain) { + txgain = 0; + ast_log(LOG_WARNING, "Invalid txgain: %s, using default.\n", v->value); + } + } else if (!strcasecmp(v->name, "echocancel")) { + if (!strcasecmp(v->value, "off")) { + wlec_type = IFX_TAPI_WLEC_TYPE_OFF; + } else if (!strcasecmp(v->value, "nlec")) { + wlec_type = IFX_TAPI_WLEC_TYPE_NE; + if (!strcasecmp(v->name, "echocancelfixedwindowsize")) { + wlec_nbne = atoi(v->value); + } + } else if (!strcasecmp(v->value, "wlec")) { + wlec_type = IFX_TAPI_WLEC_TYPE_NFE; + if (!strcasecmp(v->name, "echocancelnfemovingwindowsize")) { + wlec_nbfe = atoi(v->value); + } else if (!strcasecmp(v->name, "echocancelfixedwindowsize")) { + wlec_nbne = atoi(v->value); + } else if (!strcasecmp(v->name, "echocancelwidefixedwindowsize")) { + wlec_wbne = atoi(v->value); + } + } else if (!strcasecmp(v->value, "nees")) { + wlec_type = IFX_TAPI_WLEC_TYPE_NE_ES; + } else if (!strcasecmp(v->value, "nfees")) { + wlec_type = IFX_TAPI_WLEC_TYPE_NFE_ES; + } else if (!strcasecmp(v->value, "es")) { + wlec_type = IFX_TAPI_WLEC_TYPE_ES; + } else { + wlec_type = IFX_TAPI_WLEC_TYPE_OFF; + ast_log(LOG_ERROR, "Unknown echo cancellation type '%s'\n", v->value); + ast_config_destroy(cfg); + return AST_MODULE_LOAD_DECLINE; + } + } else if (!strcasecmp(v->name, "echocancelnlp")) { + if (!strcasecmp(v->value, "on")) { + wlec_nlp = IFX_TAPI_WLEC_NLP_ON; + } else if (!strcasecmp(v->value, "off")) { + wlec_nlp = IFX_TAPI_WLEC_NLP_OFF; + } else { + ast_log(LOG_ERROR, "Unknown echo cancellation nlp '%s'\n", v->value); + ast_config_destroy(cfg); + return AST_MODULE_LOAD_DECLINE; + } + } else if (!strcasecmp(v->name, "jitterbuffertype")) { + if (!strcasecmp(v->value, "fixed")) { + jb_type = IFX_TAPI_JB_TYPE_FIXED; + } else if (!strcasecmp(v->value, "adaptive")) { + jb_type = IFX_TAPI_JB_TYPE_ADAPTIVE; + jb_localadpt = IFX_TAPI_JB_LOCAL_ADAPT_DEFAULT; + if (!strcasecmp(v->name, "jitterbufferadaptation")) { + if (!strcasecmp(v->value, "on")) { + jb_localadpt = IFX_TAPI_JB_LOCAL_ADAPT_ON; + } else if (!strcasecmp(v->value, "off")) { + jb_localadpt = IFX_TAPI_JB_LOCAL_ADAPT_OFF; + } + } else if (!strcasecmp(v->name, "jitterbufferscalling")) { + jb_scaling = atoi(v->value); + } else if (!strcasecmp(v->name, "jitterbufferinitialsize")) { + jb_initialsize = atoi(v->value); + } else if (!strcasecmp(v->name, "jitterbufferminsize")) { + jb_minsize = atoi(v->value); + } else if (!strcasecmp(v->name, "jitterbuffermaxsize")) { + jb_maxsize = atoi(v->value); + } + } else { + ast_log(LOG_ERROR, "Unknown jitter buffer type '%s'\n", v->value); + ast_config_destroy(cfg); + return AST_MODULE_LOAD_DECLINE; + } + } else if (!strcasecmp(v->name, "jitterbufferpackettype")) { + if (!strcasecmp(v->value, "voice")) { + jb_pckadpt = IFX_TAPI_JB_PKT_ADAPT_VOICE; + } else if (!strcasecmp(v->value, "data")) { + jb_pckadpt = IFX_TAPI_JB_PKT_ADAPT_DATA; + } else if (!strcasecmp(v->value, "datanorep")) { + jb_pckadpt = IFX_TAPI_JB_PKT_ADAPT_DATA_NO_REP; + } else { + ast_log(LOG_ERROR, "Unknown jitter buffer packet adaptation type '%s'\n", v->value); + ast_config_destroy(cfg); + return AST_MODULE_LOAD_DECLINE; + } + } else if (!strcasecmp(v->name, "calleridtype")) { + ast_log(LOG_DEBUG, "Setting CID type to %s.\n", v->value); + if (!strcasecmp(v->value, "telecordia")) { + cid_type = IFX_TAPI_CID_STD_TELCORDIA; + } else if (!strcasecmp(v->value, "etsifsk")) { + cid_type = IFX_TAPI_CID_STD_ETSI_FSK; + } else if (!strcasecmp(v->value, "etsidtmf")) { + cid_type = IFX_TAPI_CID_STD_ETSI_DTMF; + } else if (!strcasecmp(v->value, "sin")) { + cid_type = IFX_TAPI_CID_STD_SIN; + } else if (!strcasecmp(v->value, "ntt")) { + cid_type = IFX_TAPI_CID_STD_NTT; + } else if (!strcasecmp(v->value, "kpndtmf")) { + cid_type = IFX_TAPI_CID_STD_KPN_DTMF; + } else if (!strcasecmp(v->value, "kpndtmffsk")) { + cid_type = IFX_TAPI_CID_STD_KPN_DTMF_FSK; + } else { + ast_log(LOG_ERROR, "Unknown caller id type '%s'\n", v->value); + ast_config_destroy(cfg); + return AST_MODULE_LOAD_DECLINE; + } + } else if (!strcasecmp(v->name, "voiceactivitydetection")) { + if (!strcasecmp(v->value, "on")) { + vad_type = IFX_TAPI_ENC_VAD_ON; + } else if (!strcasecmp(v->value, "g711")) { + vad_type = IFX_TAPI_ENC_VAD_G711; + } else if (!strcasecmp(v->value, "cng")) { + vad_type = IFX_TAPI_ENC_VAD_CNG_ONLY; + } else if (!strcasecmp(v->value, "sc")) { + vad_type = IFX_TAPI_ENC_VAD_SC_ONLY; + } else { + ast_log(LOG_ERROR, "Unknown voice activity detection value '%s'\n", v->value); + ast_config_destroy(cfg); + return AST_MODULE_LOAD_DECLINE; + } + } + } + + lantiq_create_pvts(); + + ast_mutex_unlock(&iflock); + + if (ast_channel_register(&lantiq_tech)) { + ast_log(LOG_ERROR, "Unable to register channel class 'Phone'\n"); + ast_config_destroy(cfg); + unload_module(); + return AST_MODULE_LOAD_FAILURE; + } + ast_config_destroy(cfg); + + /* tapi */ +#ifdef TODO_TONES + IFX_TAPI_TONE_t tone; +#endif + IFX_TAPI_DEV_START_CFG_t dev_start; + IFX_TAPI_MAP_DATA_t map_data; + IFX_TAPI_ENC_CFG_t enc_cfg; + IFX_TAPI_LINE_VOLUME_t line_vol; + IFX_TAPI_WLEC_CFG_t wlec_cfg; + IFX_TAPI_JB_CFG_t jb_cfg; + IFX_TAPI_CID_CFG_t cid_cfg; + uint8_t c; + + /* open device */ + dev_ctx.dev_fd = lantiq_dev_open(base_path, 0); + + if (dev_ctx.dev_fd < 0) { + ast_log(LOG_ERROR, "lantiq tapi device open function failed\n"); + return AST_MODULE_LOAD_FAILURE; + } + + for (c = 0; c < dev_ctx.channels ; c++) { + dev_ctx.ch_fd[c] = lantiq_dev_open(base_path, c + 1); + + if (dev_ctx.ch_fd[c] < 0) { + ast_log(LOG_ERROR, "lantiq tapi channel %d open function failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } + } + + if (lantiq_dev_firmware_download(dev_ctx.dev_fd, firmware_filename)) { + ast_log(LOG_ERROR, "voice firmware download failed\n"); + return AST_MODULE_LOAD_FAILURE; + } + + if (ioctl(dev_ctx.dev_fd, IFX_TAPI_DEV_STOP, 0)) { + ast_log(LOG_ERROR, "IFX_TAPI_DEV_STOP ioctl failed\n"); + return AST_MODULE_LOAD_FAILURE; + } + + memset(&dev_start, 0x0, sizeof(IFX_TAPI_DEV_START_CFG_t)); + dev_start.nMode = IFX_TAPI_INIT_MODE_VOICE_CODER; + + /* Start TAPI */ + if (ioctl(dev_ctx.dev_fd, IFX_TAPI_DEV_START, &dev_start)) { + ast_log(LOG_ERROR, "IFX_TAPI_DEV_START ioctl failed\n"); + return AST_MODULE_LOAD_FAILURE; + } + + for (c = 0; c < dev_ctx.channels ; c++) { + /* tones */ +#ifdef TODO_TONES + memset(&tone, 0, sizeof(IFX_TAPI_TONE_t)); + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_TONE_TABLE_CFG_SET, &tone)) { + ast_log(LOG_ERROR, "IFX_TAPI_TONE_TABLE_CFG_SET %d failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } +#endif + /* ringing type */ + IFX_TAPI_RING_CFG_t ringingType; + memset(&ringingType, 0, sizeof(IFX_TAPI_RING_CFG_t)); + ringingType.nMode = IFX_TAPI_RING_CFG_MODE_INTERNAL_BALANCED; + ringingType.nSubmode = IFX_TAPI_RING_CFG_SUBMODE_DC_RNG_TRIP_FAST; + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_RING_CFG_SET, (IFX_int32_t) &ringingType)) { + ast_log(LOG_ERROR, "IFX_TAPI_RING_CFG_SET failed\n"); + return AST_MODULE_LOAD_FAILURE; + } + + /* ring cadence */ + IFX_char_t data[15] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00 }; + + IFX_TAPI_RING_CADENCE_t ringCadence; + memset(&ringCadence, 0, sizeof(IFX_TAPI_RING_CADENCE_t)); + memcpy(&ringCadence.data, data, sizeof(data)); + ringCadence.nr = sizeof(data) * 8; + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_RING_CADENCE_HR_SET, &ringCadence)) { + ast_log(LOG_ERROR, "IFX_TAPI_RING_CADENCE_HR_SET failed\n"); + return AST_MODULE_LOAD_FAILURE; + } + + /* perform mapping */ + memset(&map_data, 0x0, sizeof(IFX_TAPI_MAP_DATA_t)); + map_data.nDstCh = c; + map_data.nChType = IFX_TAPI_MAP_TYPE_PHONE; + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_MAP_DATA_ADD, &map_data)) { + ast_log(LOG_ERROR, "IFX_TAPI_MAP_DATA_ADD %d failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } + + /* set line feed */ + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_LINE_FEED_SET, IFX_TAPI_LINE_FEED_STANDBY)) { + ast_log(LOG_ERROR, "IFX_TAPI_LINE_FEED_SET %d failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } + + /* Configure encoder */ + memset(&enc_cfg, 0x0, sizeof(IFX_TAPI_ENC_CFG_t)); + enc_cfg.nFrameLen = IFX_TAPI_COD_LENGTH_20; + enc_cfg.nEncType = IFX_TAPI_COD_TYPE_MLAW; + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_ENC_CFG_SET, &enc_cfg)) { + ast_log(LOG_ERROR, "IFX_TAPI_ENC_CFG_SET %d failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } + + /* set volume */ + memset(&line_vol, 0, sizeof(line_vol)); + line_vol.nGainRx = rxgain; + line_vol.nGainTx = txgain; + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_PHONE_VOLUME_SET, &line_vol)) { + ast_log(LOG_ERROR, "IFX_TAPI_PHONE_VOLUME_SET %d failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } + + /* Configure line echo canceller */ + memset(&wlec_cfg, 0, sizeof(wlec_cfg)); + wlec_cfg.nType = wlec_type; + wlec_cfg.bNlp = wlec_nlp; + wlec_cfg.nNBFEwindow = wlec_nbfe; + wlec_cfg.nNBNEwindow = wlec_nbne; + wlec_cfg.nWBNEwindow = wlec_wbne; + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_WLEC_PHONE_CFG_SET, &wlec_cfg)) { + ast_log(LOG_ERROR, "IFX_TAPI_WLEC_PHONE_CFG_SET %d failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } + + /* Configure jitter buffer */ + memset(&jb_cfg, 0, sizeof(jb_cfg)); + jb_cfg.nJbType = jb_type; + jb_cfg.nPckAdpt = jb_pckadpt; + jb_cfg.nLocalAdpt = jb_localadpt; + jb_cfg.nScaling = jb_scaling; + jb_cfg.nInitialSize = jb_initialsize; + jb_cfg.nMinSize = jb_minsize; + jb_cfg.nMaxSize = jb_maxsize; + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_JB_CFG_SET, &jb_cfg)) { + ast_log(LOG_ERROR, "IFX_TAPI_JB_CFG_SET %d failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } + + /* Configure Caller ID type */ + memset(&cid_cfg, 0, sizeof(cid_cfg)); + cid_cfg.nStandard = cid_type; + + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_CID_CFG_SET, &cid_cfg)) { + ast_log(LOG_ERROR, "IIFX_TAPI_CID_CFG_SET %d failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } + + /* Configure voice activity detection */ + if (ioctl(dev_ctx.ch_fd[c], IFX_TAPI_ENC_VAD_CFG_SET, vad_type)) { + ast_log(LOG_ERROR, "IFX_TAPI_ENC_VAD_CFG_SET %d failed\n", c); + return AST_MODULE_LOAD_FAILURE; + } + + /* Setup TAPI <-> Asterisk codec type mapping */ + if (lantiq_setup_rtp(c)) { + return AST_MODULE_LOAD_FAILURE; + } + + /* Set initial hook status */ + iflist[c].channel_state = lantiq_get_hookstatus(c); + + if (iflist[c].channel_state == UNKNOWN) { + return AST_MODULE_LOAD_FAILURE; + } + } + + /* make sure our device will be closed properly */ + ast_register_atexit(lantiq_cleanup); + + restart_monitor(); + return AST_MODULE_LOAD_SUCCESS; +} + +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Lantiq TAPI Telephony API Support"); diff --git a/net/asterisk-1.8.x/src-lantiq/configs/lantiq.conf.sample b/net/asterisk-1.8.x/src-lantiq/configs/lantiq.conf.sample new file mode 100644 index 00000000000..16ba1743df8 --- /dev/null +++ b/net/asterisk-1.8.x/src-lantiq/configs/lantiq.conf.sample @@ -0,0 +1,138 @@ +; +; TAPI Telephony Interface +; +; Configuration file + +[interfaces] +; +; Number of FXS ports (default: 2) +channels = 2 +; +; Set tapi firmware file path +;firmwarefilename = /lib/firmware/danube_firmware.bin +; +; Set tapi bbd file path +;bbdfilename = /lib/firmware/danube_bbd_fxs.bin +; +; Set vmmc device path +;basepath = /dev/vmmc +; +[general] +; +; Gain setting for the receive and transmit path. +; The value is given in dB within the range (-24dB to +12dB), in 1 dB steps. +; +;rxgain = 1 +;txgain = 1 +; +; +; +; Line echo cancller valid types: +; +; off LEC and echo suppressor turned off. +; nlec LEC using fixed window; no echo suppressor. +; wlec LEC using fixed and moving window; no echo suppressor. +; nees LEC using fixed window and echo suppressor. +; nfees LEC using fixed and moving window and echo suppressor. +; es Echo suppressor +; +;echocancel = off +; +; If nlec or wlec is selected than size of the fixed window in narrowband (8 kHz) sampling mode +; can be defined with: +; A value of 0 defaults to: 16 ms if type is nlec or 8 ms if type is wlec: +; +;echocancelfixedwindowsize = 0 +; +; If wlec is selected than size of the moving window in narrowband (8 kHz) sampling mode +; can be defined with: +; A value of 0 defaults to 8 ms. +; +;echocancelnfemovingwindowsize = 0 +; +; If wlec is selected than size of the moving window in wideband (16 kHz) sampling mode +; can be defined with: +; A value of 0 defaults to 8 ms. +; +;echocancelwidefixedwindowsize = 0 +; +; Activate or deactivate line echo cancller NLP (Non Linear Processor) if the LEC is active, +; valid is on or off: +; +;echocancelnlp = off +; +; +; +; Jitter buffer valid types: +; +; fixed Fixed jitter buffer. +; adaptive Adaptive jitter buffer. +; +;jitterbuffertype = fixed +; +; Jitter buffer packet adaptation valid types: +; +; voice Jitter buffer optimized for voice. +; data Jitter buffer optimized for data. +; datanorep Jitter buffer optimized for data but without doing packet repetition. +; +;jitterbufferpackettype = voice +; +; Following jitter buffer values can only be used with jitter buffer adaptive type: +; Turns on or off jitter buffer adaptation: +; +;jitterbufferadaptation = off +; +; Scaling factor multiplied by 16; in adaptive jitter buffer mode, the target average playout delay is +; equal to the estimated jitter multiplied by the scaling factor. The default value for the scaling factor +; is about 1.4 (scaling=22), meaning that the target average playout delay is equal to the estimated +; jitter. If less packets should be dropped because of jitter, the scaling factor has to be increased. An +; increase in the scaling factor will eventually lead to an increased playout delay. +; The supported range is 1 to 16 (16 up to 256). +; +;jitterbufferscalling = 1 +; +; Initial size of the jitter buffer in time stamps of 125 us: +; +;jitterbufferinitialsize = 125 +; +; Minimum size of the jitter buffer in time stamps of 125 us +; +;jitterbufferminsize = 125 +; +; Maximum size of the jitter buffer in time stamps of 125 us +; +;jitterbuffermaxsize = 125 +; +; +; +; Caller id valid standards: +; +; telecordia Bellcore/Telcordia GR-30-CORE; use Bell202 FSK coding of CID information. (default) +; etsifsk ETSI 300-659-1/2/3 V1.3.1; use V.23 FSK coding to transmit CID information. +; etsidtmf ETSI 300-659-1/2/3 V1.3.1; use DTMF transmission of CID information. +; sin SIN 227 Issue 3.4; use V.23 FSK coding of CID information. +; ntt NTT standard: TELEPHONE SERVICE INTERFACES, edition 5; use a modified V.23 FSK coding of +; CID information. +; kpndtmf KPN; use DTMF transmission of CID information. +; kpndtmffsk KPN; use DTMF and FSK transmission of CID information. +; +;calleridtype = telecordia +; +; +; +; Voice activity detection: +; +; on Voice activity detection on; in this case also comfort noise and spectral +; information (nicer noise) is switched on. +; g711 Voice activity detection on with comfort noise generation, +; but without spectral information. +; cng Voice activity detection on with comfort noise generation, but without silence compression +; sc Voice activity detection on with silence compression, +; but without comfort noise generation. +; +;voiceactivitydetection = on +; +; +; +; diff --git a/net/asterisk-11.x-chan-dongle/Makefile b/net/asterisk-11.x-chan-dongle/Makefile new file mode 100644 index 00000000000..49278220a45 --- /dev/null +++ b/net/asterisk-11.x-chan-dongle/Makefile @@ -0,0 +1,78 @@ +# +# Copyright (C) 2013 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:=asterisk11-chan-dongle +PKG_VERSION:=1.1r35 +PKG_REV:=28a46567a88cebdc365db6f294e682246fd2dd7b +PKG_RELEASE:=3 + +PKG_SOURCE_SUBDIR:=asterisk11-chan-dongle-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz +PKG_SOURCE_URL:=https://github.com/jstasiak/asterisk-chan-dongle.git +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=$(PKG_REV) + +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) + +PKG_FIXUP:=autoreconf + +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=COPYRIGHT.txt LICENSE.txt +PKG_MAINTAINER:=Jiri Slachta + +include $(INCLUDE_DIR)/package.mk + +define Package/asterisk11-chan-dongle + SUBMENU:=Telephony + SECTION:=net + CATEGORY:=Network + URL:=https://code.google.com/p/asterisk-chan-dongle/ + DEPENDS:= asterisk11 +libiconv-full +kmod-usb-acm +kmod-usb-serial +kmod-usb-serial-option +libusb-1.0 +usb-modeswitch + TITLE:=Huawei UMTS 3G dongle support +endef + +define Package/asterisk11-chan-dongle/description + Asterisk channel driver for Huawei UMTS 3G dongle. +endef + +MAKE_ARGS:= \ + CC="$(TARGET_CC)" \ + LD="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -DASTERISK_VERSION_NUM=110000 -DLOW_MEMORY -D_XOPEN_SOURCE=600 $(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/lib/libiconv-full/include -I$(STAGING_DIR)/usr/include/asterisk-11/include -DHAVE_CONFIG_H -I. -fPIC" \ + LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib/libiconv-full/lib -liconv" \ + DESTDIR="$(PKG_INSTALL_DIR)/usr/lib/asterisk/modules" + +CONFIGURE_VARS += \ + ac_cv_type_size_t=yes \ + ac_cv_type_ssize_t=yes + +define Build/Configure + $(call Build/Configure/Default, \ + --with-asterisk=$(STAGING_DIR)/usr/include/asterisk-11/include \ + $(MAKE_ARGS) \ + ) +endef + +define Build/Compile + mkdir -p $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules + $(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_ARGS) all install +endef + +define Package/asterisk11-chan-dongle/conffiles +/etc/asterisk/dongle.conf +endef + +define Package/asterisk11-chan-dongle/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/dongle.conf $(1)/etc/asterisk/ + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_dongle.so $(1)/usr/lib/asterisk/modules/ +endef + +$(eval $(call BuildPackage,asterisk11-chan-dongle)) diff --git a/net/asterisk-11.x-chan-dongle/patches/001-add-send-ussd.patch b/net/asterisk-11.x-chan-dongle/patches/001-add-send-ussd.patch new file mode 100644 index 00000000000..4ea41b15fcc --- /dev/null +++ b/net/asterisk-11.x-chan-dongle/patches/001-add-send-ussd.patch @@ -0,0 +1,64 @@ +--- a/app.c ++++ b/app.c +@@ -114,7 +114,44 @@ + return !status; + } + ++static int app_send_ussd_exec (attribute_unused struct ast_channel* channel, const char* data) ++{ ++ char* parse; ++ const char* msg; ++ int status; ++ void * msgid; + ++ AST_DECLARE_APP_ARGS (args, ++ AST_APP_ARG (device); ++ AST_APP_ARG (ussd); ++ ); ++ ++ if (ast_strlen_zero (data)) ++ { ++ return -1; ++ } ++ ++ parse = ast_strdupa (data); ++ ++ AST_STANDARD_APP_ARGS (args, parse); ++ ++ if (ast_strlen_zero (args.device)) ++ { ++ ast_log (LOG_ERROR, "NULL device for ussd -- USSD will not be sent\n"); ++ return -1; ++ } ++ ++ if (ast_strlen_zero (args.ussd)) ++ { ++ ast_log (LOG_ERROR, "NULL ussd command -- USSD will not be sent\n"); ++ return -1; ++ } ++ ++ msg = send_ussd(args.device, args.ussd, &status, &msgid); ++ if(!status) ++ ast_log (LOG_ERROR, "[%s] %s with id %p\n", args.device, msg, msgid); ++ return !status; ++} + + static const struct dongle_application + { +@@ -144,7 +181,15 @@ + " Message - text of the message\n" + " Validity - Validity period in minutes\n" + " Report - Boolean flag for report request\n" +- } ++ }, ++ { ++ "DongleSendUSSD", ++ app_send_ussd_exec, ++ "DongleSendUSSD(Device,USSD)", ++ "DongleSendUSSD(Device,USSD)\n" ++ " Device - Id of device from dongle.conf\n" ++ " USSD - ussd command\n" ++ } + }; + + #if ASTERISK_VERSION_NUM >= 10800 diff --git a/net/asterisk-11.x-chan-sccp-b/Makefile b/net/asterisk-11.x-chan-sccp-b/Makefile new file mode 100644 index 00000000000..8fb660a116d --- /dev/null +++ b/net/asterisk-11.x-chan-sccp-b/Makefile @@ -0,0 +1,65 @@ +# +# Copyright (C) 2014 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:=asterisk11-chan-sccp-b +PKG_REV:=5738 +PKG_VERSION:=v4.2-r$(PKG_REV) +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://svn.code.sf.net/p/chan-sccp-b/code/tags/openwrt +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_PROTO:=svn + +PKG_FIXUP:=autoreconf -fi + +PKG_LICENSE:=GPL-1.0 +PKG_LICENSE_FILES:=COPYRIGHT LICENSE +PKG_MAINTAINER:=Jiri Slachta + +include $(INCLUDE_DIR)/package.mk + +define Package/asterisk11-chan-sccp-b + SUBMENU:=Telephony + SECTION:=net + CATEGORY:=Network + TITLE:=SCCP channel provider support + URL:=http://chan-sccp-b.sourceforge.net/ + DEPENDS:=asterisk11 +libltdl +endef + +define Package/asterisk11-chan-sccp-b/description + SCCP channel provider for asterisk. It delivers extended functionality for SCCP phones over chan_skinny delivered + by asterisk by default. +endef + +define Build/Configure + $(call Build/Configure/Default,--with-asterisk=$(STAGING_DIR)/usr/include/asterisk-11) +endef + +define Build/Compile + $(MAKE) -C "$(PKG_BUILD_DIR)" \ + CFLAGS="$(CFLAGS) -I$(PKG_BUILD_DIR)/src -DLOW_MEMORY" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Package/asterisk11-chan-sccp-b/conffiles +/etc/asterisk/sccp.conf +endef + +define Package/asterisk11-chan-sccp-b/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(CP) ./files/sccp.openwrt.conf $(1)/etc/asterisk/sccp.conf + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_sccp.so $(1)/usr/lib/asterisk/modules/ +endef + +$(eval $(call BuildPackage,asterisk11-chan-sccp-b)) diff --git a/net/asterisk-11.x-chan-sccp-b/files/sccp.openwrt.conf b/net/asterisk-11.x-chan-sccp-b/files/sccp.openwrt.conf new file mode 100644 index 00000000000..c59f4cdb1a4 --- /dev/null +++ b/net/asterisk-11.x-chan-sccp-b/files/sccp.openwrt.conf @@ -0,0 +1,89 @@ +[general] +servername = Openwrt +keepalive = 60 +debug = core +context = default +dateformat = D/M/Y +bindaddr = 192.168.1.1 +port = 2000 +disallow=all +allow=ulaw +allow=alaw +allow=gsm +firstdigittimeout = 16 +digittimeout = 6 +autoanswer_ring_time = 1 +musicclass=default +language=en +deny=0.0.0.0/0.0.0.0 +permit=192.168.1.0/255.255.255.0 +protocolversion=17 + +hotline_enabled=yes +hotline_context=default +hotline_extension=111 + +[SEP001122334455] +type = device +description = Phone Number One +devicetype = 7940 +button = line, 111 +button = line, 113@01:shared +button = speeddial,Phone 2 Line 1, 112, 112@hint + +[SEP00a1a2a3a4a5] +type = device +description = Phone Number Two +devicetype = 7960 +button = line, 112 +button = line, 113@01:shared +button = speeddial,Phone 1 Line 1, 111, 111@hint + +[111] +id = 1000 +type = line +pin = 1234 +label = Phone 1 Line 1 +description = Line 111 +mailbox = 10111 +cid_name = Phone 1 CID +cid_num = 111 +accountcode=79111 +callgroup=1 +pickupgroup=1 +context = default +incominglimit = 2 +vmnum = 600 +trnsfvm = 1000 + +[112] +id = 1001 +type = line +pin = 1234 +label = Phone 2 Line 1 +description = Line 112 +mailbox = 10112 +cid_name = Phone 2 CID +cid_num = 112 +accountcode=79112 +callgroup=1 +pickupgroup=1 +context = default +incominglimit = 2 +vmnum = 600 +trnsfvm = 1000 + +[113] +id = 1002 +type = line +pin = 1234 +label = SharedLine 1 +description = Line 113 +mailbox = 10113 +cid_name = Shared +cid_num = 113 +accountcode=79113 +incominglimit = 2 +vmnum = 600 +trnsfvm = 1000 + diff --git a/net/asterisk-11.x-codec-g729/Makefile b/net/asterisk-11.x-codec-g729/Makefile new file mode 100644 index 00000000000..62359d9a9ce --- /dev/null +++ b/net/asterisk-11.x-codec-g729/Makefile @@ -0,0 +1,67 @@ +# +# Copyright (C) 2014 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:=asterisk11-codec-g729 +PKG_VERSION:=1.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=asterisk-g72x-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://asterisk.hosting.lv/src/ +PKG_MD5SUM:=a830aefa27634787f41ff8b209ba585b + +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME) +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +PKG_LICENSE:=GPL-3.0 +PKG_LICENSE_FILES:=README.md +PKG_MAINTAINER:=Alex Samorukov + +include $(INCLUDE_DIR)/package.mk + +define Package/asterisk11-codec-g729 + SUBMENU:=Telephony + SECTION:=net + CATEGORY:=Network + URL:=http://asterisk.hosting.lv + DEPENDS:= asterisk11 +bcg729 + TITLE:=G.729 codec for Asterisk open source PBX +endef + +define Package/asterisk11-codec-g729/description + Asterisk G.729 codec based on bcg729 implementation. +endef + +MAKE_ARGS:= \ + CC="$(TARGET_CC)" \ + LD="$(TARGET_LD)" \ + CFLAGS="$(TARGET_CFLAGS) -DASTERISK_VERSION_NUM=110000 -DLOW_MEMORY -D_XOPEN_SOURCE=600 $(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/asterisk-11/include -DHAVE_CONFIG_H -I. -fPIC" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + DESTDIR="$(PKG_INSTALL_DIR)" + +CONFIGURE_ARGS+=\ + --with-asterisk-includes=$(STAGING_DIR)/usr/include/asterisk-11/include \ + --with-asterisk100 \ + --with-bcg729 \ + --enable-shared \ + $(MAKE_ARGS) + +define Build/Prepare + rm -rf $(PKG_BUILD_DIR)/ + mkdir -p $(PKG_BUILD_DIR)/ + $(TAR) -xvjf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1 + $(Build/Patch) +endef + +define Package/asterisk11-codec-g729/install + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/codec_g729.so $(1)/usr/lib/asterisk/modules/ +endef + +$(eval $(call BuildPackage,asterisk11-codec-g729)) diff --git a/net/asterisk-11.x/Makefile b/net/asterisk-11.x/Makefile new file mode 100644 index 00000000000..2b9e0ccb474 --- /dev/null +++ b/net/asterisk-11.x/Makefile @@ -0,0 +1,407 @@ +# +# Copyright (C) 2014 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:=asterisk11 +PKG_VERSION:=11.14.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/asterisk/releases/ +PKG_MD5SUM:=7ec6fe5a1ced2e29cc24656df8400e43 + +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=COPYING LICENSE +PKG_MAINTAINER:=Jiri Slachta + +PKG_BUILD_DIR=$(BUILD_DIR)/asterisk-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/asterisk11/install/module + $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*$(2).so* $(1)/usr/lib/asterisk/modules/ +endef + +define Package/asterisk11/install/conffile + $(INSTALL_DIR) $(1)/etc/asterisk + $(CP) $(PKG_INSTALL_DIR)/etc/asterisk/*$(2)* $(1)/etc/asterisk/ +endef + +define Package/asterisk11/install/lib + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/$(2).so* $(1)/usr/lib/ +endef + +define Package/asterisk11/install/sbin + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/$(2) $(1)/usr/sbin/ +endef + +define Package/asterisk11/install/sounds + $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/$(2) $(1)/usr/lib/asterisk/sounds/ +endef + +define BuildAsterisk11Module + define Package/asterisk11-$(1) + $$(call Package/asterisk11/Default) + TITLE:=$(2) support + DEPENDS:= asterisk11 $(patsubst +%,+PACKAGE_asterisk11-$(1):%,$(4)) + endef + + define Package/asterisk11-$(1)/conffiles +$(5) + endef + + define Package/asterisk11-$(1)/description + $$(call Package/asterisk11/Default/description) +This package provides support $(3) in Asterisk. + endef + + define Package/asterisk11-$(1)/install +$(foreach c,$(6),$(call Package/asterisk11/install/conffile,$$(1),$(c));) +$(foreach m,$(7),$(call Package/asterisk11/install/module,$$(1),$(m));) +$(foreach s,$(8),$(call Package/asterisk11/install/sounds,$$(1),$(s));) +$(foreach b,$(9),$(call Package/asterisk11/install/sbin,$$(1),$(b));) + endef + + $$(eval $$(call BuildPackage,asterisk11-$(1))) +endef + +define Package/asterisk11/Default + SUBMENU:=Telephony + SECTION:=net + CATEGORY:=Network + URL:=http://www.asterisk.org/ + MAINTAINER:=Jiri Slachta +endef + +define Package/asterisk11/Default/description + Asterisk is a complete PBX in software. It provides all of the features + you would expect from a PBX and more. Asterisk does voice over IP in three + protocols, and can interoperate with almost all standards-based telephony + equipment using relatively inexpensive hardware. +endef + +define Package/asterisk11 +$(call Package/asterisk11/Default) + TITLE:=Complete open source PBX, v11.x + MENU:=1 + DEPENDS:=+libopenssl +libncurses +libpopt +libpthread +libsqlite3 +librt +libuuid +zlib @!TARGET_avr32 +endef + +define Package/asterisk11/description +$(call Package/asterisk11/Default/description) +endef + +define Package/asterisk11/conffiles +/etc/asterisk/asterisk.conf +/etc/asterisk/acl.conf +/etc/asterisk/ccss.conf +/etc/asterisk/modules.conf +/etc/asterisk/extconfig.conf +/etc/asterisk/extensions.conf +/etc/asterisk/features.conf +/etc/asterisk/indications.conf +/etc/asterisk/logger.conf +/etc/asterisk/manager.conf +/etc/asterisk/modules.conf +/etc/asterisk/rtp.conf +/etc/asterisk/sip.conf +/etc/asterisk/sip_notify.conf +/etc/asterisk/udptl.conf +/etc/asterisk/users.conf +/etc/default/asterisk +/etc/init.d/asterisk +endef + +AST_CFG_FILES:= \ + asterisk.conf acl.conf ccss.conf extconfig.conf extensions.conf features.conf indications.conf logger.conf manager.conf modules.conf \ + rtp.conf sip_notify.conf sip.conf udptl.conf users.conf +AST_EMB_MODULES:=\ + app_dial app_echo app_macro app_playback codec_ulaw format_pcm func_callerid \ + func_logic func_strings func_timeout chan_sip chan_local pbx_config res_crypto res_http_websocket res_rtp_asterisk res_rtp_multicast + +define Package/asterisk11/install +$(call Package/asterisk11/install/lib,$(1),libasteriskssl) +$(call Package/asterisk11/install/sbin,$(1),asterisk) +$(call Package/asterisk11/install/sbin,$(1),safe_asterisk) +$(call Package/asterisk11/install/sbin,$(1),astgenkey) +$(foreach m,$(AST_CFG_FILES),$(call Package/asterisk11/install/conffile,$(1),$(m));) +$(foreach m,$(AST_EMB_MODULES),$(call Package/asterisk11/install/module,$(1),$(m));) + $(INSTALL_DIR) $(1)/etc/default + $(INSTALL_DATA) ./files/asterisk.default $(1)/etc/default/asterisk + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/asterisk.init $(1)/etc/init.d/asterisk +endef + +define Package/asterisk11-sounds +$(call Package/asterisk11/Default) + TITLE:=Sounds support + DEPENDS:=asterisk11 +endef + +define Package/asterisk11-sounds/description +$(call Package/asterisk11/Default/description) +This package provides sounds for Asterisk. +endef + +define Package/asterisk11-sounds/install + $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/* $(1)/usr/lib/asterisk/sounds/ + rm -f $(1)/usr/lib/asterisk/sounds/vm-* + rm -f $(1)/usr/lib/asterisk/sounds/conf-* +endef + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk11-curl),) + CONFIGURE_ARGS+= \ + --with-libcurl="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= \ + --without-libcurl +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk11-mysql),) + CONFIGURE_ARGS+= \ + --with-mysqlclient +else + CONFIGURE_ARGS+= \ + --without-mysqlclient +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk11-pbx-lua),) + CONFIGURE_ARGS+= \ + --with-lua="$(STAGING_DIR)/usr" + TARGET_LDFLAGS+=-ldl -lcrypt +else + CONFIGURE_ARGS+= \ + --without-lua +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk11-pgsql),) + CONFIGURE_ARGS+= \ + --with-postgres="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= \ + --without-postgres +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk11-res-fax-spandsp),) + CONFIGURE_ARGS+= \ + --with-spandsp="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= \ + --without-spandsp +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk11-res-srtp),) + CONFIGURE_ARGS+= \ + --with-srtp="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS+= \ + --without-srtp +endif + +ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk11-res-xmpp),) + CONFIGURE_ARGS+= \ + --with-iksemel="$(STAGING_DIR)/usr" + SITE_VARS+= \ + ac_cv_lib_iksemel_iks_start_sasl=yes +else + CONFIGURE_ARGS+= \ + --without-iksemel +endif + +EXTRA_CFLAGS+= $(TARGET_CPPFLAGS) +EXTRA_LDFLAGS+= $(TARGET_LDFLAGS) -Wl,-rpath-link,$(STAGING_DIR)/usr/lib +CONFIGURE_ARGS+= \ + --build=$(GNU_HOST_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --target=$(GNU_TARGET_NAME) \ + --without-bluetooth \ + --without-cap \ + --without-curses \ + --without-dahdi \ + --with-gsm=internal \ + --without-gtk2 \ + --with-ilbc=internal \ + --without-isdnnet \ + --without-libxml2 \ + --without-misdn \ + --without-nbs \ + --with-ncurses="$(STAGING_DIR)/usr" \ + --without-netsnmp \ + --without-newt \ + --without-ogg \ + --without-osptk \ + --with-popt="$(STAGING_DIR)/usr" \ + --without-pri \ + --without-pwlib \ + --without-radius \ + --without-sdl \ + --without-sqlite \ + --with-sqlite3="$(STAGING_DIR)/usr" \ + --without-suppserv \ + --without-tds \ + --without-termcap \ + --without-tinfo \ + --without-tonezone \ + --with-uuid="$(STAGING_DIR)/usr" \ + --without-vorbis \ + --without-vpb \ + --with-z="$(STAGING_DIR)/usr" \ + --with-sounds-cache="$(DL_DIR)" \ + --disable-xmldoc + +define Build/Prepare + $(call Build/Prepare/Default) +endef + +define Build/Configure + echo "export CFLAGS += $(FPIC) $(TARGET_CFLAGS) $(EXTRA_CFLAGS)"\ + " $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)"\ + > $(PKG_BUILD_DIR)/res/pjproject/user.mak; + echo "export LDLAGS += $(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"\ + " -lc $(LIBGCC_S) -lm"\ + >> $(PKG_BUILD_DIR)/res/pjproject/user.mak; + echo "export CXXFLAGS += $(FPIC) $(TARGET_CFLAGS) $(EXTRA_CFLAGS)"\ + " $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)"\ + >> $(PKG_BUILD_DIR)/res/pjproject/user.mak; + $(call Build/Configure/Default,,$(SITE_VARS)) +endef + +define Build/Compile + $(MAKE) -C "$(PKG_BUILD_DIR)" \ + include/asterisk/version.h \ + include/asterisk/buildopts.h defaults.h \ + makeopts.embed_rules + ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY" + ASTLDFLAGS="$(EXTRA_LDFLAGS)" + $(MAKE) -C "$(PKG_BUILD_DIR)" \ + ASTVARLIBDIR="/usr/lib/asterisk" \ + ASTDATADIR="/usr/lib/asterisk" \ + ASTKEYDIR="/usr/lib/asterisk" \ + ASTDBDIR="/usr/lib/asterisk" \ + NOISY_BUILD="yes" \ + DEBUG="" \ + OPTIMIZE="" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install samples +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/asterisk-11/include/asterisk/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk/*.h $(1)/usr/include/asterisk-11/include/asterisk/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk.h $(1)/usr/include/asterisk-11/include/ +endef + +$(eval $(call BuildPackage,asterisk11)) +$(eval $(call BuildPackage,asterisk11-sounds)) + +################################ +# AST modules +# Params: +# 1 - Package subname +# 2 - Package title +# 3 - Module description +# 4 - Module dependencies +# 5 - Full path to multiple conffiles +# 6 - conf files +# 7 - module files +# 8 - sound files +# 9 - binary files +################################ + +$(eval $(call BuildAsterisk11Module,app-alarmreceiver,Alarm receiver,Central Station Alarm receiver for Ademco Contact ID,,,,app_alarmreceiver,)) +$(eval $(call BuildAsterisk11Module,app-authenticate,Authenticate commands,Execute arbitrary authenticate commands,,,,app_authenticate,)) +$(eval $(call BuildAsterisk11Module,app-confbridge,ConfBridge,Software bridge for multi-party audio conferencing,,/etc/asterisk/confbridge.conf,confbridge.conf,app_confbridge bridge_builtin_features bridge_multiplexed bridge_simple bridge_softmix chan_bridge,)) +$(eval $(call BuildAsterisk11Module,app-directed_pickup,Directed call pickup,support for directed call pickup,,,,app_directed_pickup,)) +$(eval $(call BuildAsterisk11Module,app-disa,Direct Inward System Access,Direct Inward System Access,,,,app_disa,)) +$(eval $(call BuildAsterisk11Module,app-exec,Exec application,support for application execution,,,,app_exec,)) +$(eval $(call BuildAsterisk11Module,app-chanisavail,Channel availability check,support for checking if a channel is available,,,,app_chanisavail,)) +$(eval $(call BuildAsterisk11Module,app-chanspy,Channel listen in,support for listening in on any channel,,,,app_chanspy,)) +$(eval $(call BuildAsterisk11Module,app-minivm,Minimal voicemail system,a voicemail system in small building blocks working together based on the Comedian Mail voicemail,,/etc/asterisk/extensions_minivm.conf /etc/asterisk/minivm.conf,extensions_minivm.conf minivm.conf,app_minivm,)) +$(eval $(call BuildAsterisk11Module,app-mixmonitor,Record a call and mix the audio,record a call and mix the audio during the recording,,,,app_mixmonitor,)) +$(eval $(call BuildAsterisk11Module,app-originate,Originate a call,originating an outbound call and connecting it to a specified extension or application,,,,app_originate,)) +$(eval $(call BuildAsterisk11Module,app-playtones,Playtones application,play a tone list,,,,app_playtones,)) +$(eval $(call BuildAsterisk11Module,app-read,Variable read,a trivial application to read a variable,,,,app_read,)) +$(eval $(call BuildAsterisk11Module,app-readexten,Extension to variable,a trivial application to read an extension into a variable,,,,app_readexten,)) +$(eval $(call BuildAsterisk11Module,app-record,Record sound file,to record a sound file,,,,app_record,)) +$(eval $(call BuildAsterisk11Module,app-sayunixtime,Say Unix time,an application to say Unix time,,,,app_sayunixtime,)) +$(eval $(call BuildAsterisk11Module,app-senddtmf,Send DTMF digits,Sends arbitrary DTMF digits,,,,app_senddtmf,)) +$(eval $(call BuildAsterisk11Module,app-sms,SMS,SMS support (ETSI ES 201 912 protocol 1),+libpopt +libstdcpp,,,app_sms,,smsq)) +$(eval $(call BuildAsterisk11Module,app-stack,Stack applications,Stack applications Gosub Return etc.,+asterisk11-res-agi,,,app_stack,)) +$(eval $(call BuildAsterisk11Module,app-system,System exec,support for executing system commands,,,,app_system,)) +$(eval $(call BuildAsterisk11Module,app-talkdetect,File playback with audio detect,for file playback with audio detect,,,,app_talkdetect,)) +$(eval $(call BuildAsterisk11Module,app-verbose,Verbose logging,Verbose logging application,,,,app_verbose,)) +$(eval $(call BuildAsterisk11Module,app-waituntil,Sleep,support sleeping until the given epoch,,,,app_waituntil,)) +$(eval $(call BuildAsterisk11Module,app-while,While loop,a while loop implementation,,,,app_while,)) +$(eval $(call BuildAsterisk11Module,cdr,Provides CDR,Call Detail Record,,/etc/asterisk/cdr.conf /etc/asterisk/cdr_custom.conf /etc/asterisk/cdr_manager.conf /etc/asterisk/cdr_syslog.conf,cdr cdr_custom cdr_manager cdr_syslog,app_cdr app_forkcdr cdr_custom cdr_manager cdr_syslog func_cdr,)) +$(eval $(call BuildAsterisk11Module,cdr-csv,Provides CDR CSV,Call Detail Record with CSV support,,,,cdr_csv,)) +$(eval $(call BuildAsterisk11Module,cdr-sqlite3,Provides CDR SQLITE3,Call Detail Record with SQLITE3 support,libsqlite3,,,cdr_sqlite3_custom,)) +$(eval $(call BuildAsterisk11Module,codec-a-mu,Alaw to ulaw translation,translation between alaw and ulaw codecs,,,,codec_a_mu,)) +$(eval $(call BuildAsterisk11Module,codec-adpcm,ADPCM text,ADPCM text ,,,,codec_adpcm,)) +$(eval $(call BuildAsterisk11Module,codec-alaw,Signed linear to alaw translation,translation between signed linear and alaw codecs,,,,codec_alaw,)) +$(eval $(call BuildAsterisk11Module,codec-g722,G.722,a high bit rate 48/56/64Kbps ITU standard codec,,,,codec_g722,)) +$(eval $(call BuildAsterisk11Module,codec-g726,Signed linear to G.726 translation,translation between signed linear and ITU G.726-32kbps codecs,,,,codec_g726,)) +$(eval $(call BuildAsterisk11Module,codec-gsm,linear to GSM translation,translate between signed linear and GSM,,,,codec_gsm,)) +$(eval $(call BuildAsterisk11Module,codec-ilbc,linear to ILBC translation,translate between signed linear and ILBC,,,,codec_ilbc,)) +$(eval $(call BuildAsterisk11Module,codec-lpc10,Linear to LPC10 translation,translate between signed linear and LPC10,,,,codec_lpc10,)) +$(eval $(call BuildAsterisk11Module,codec-resample,resample sLinear audio,resample sLinear audio,,,,codec_resample,)) +$(eval $(call BuildAsterisk11Module,curl,CURL,CURL support,+libcurl,,,func_curl res_curl,)) +$(eval $(call BuildAsterisk11Module,format-g726,G.726,support for headerless G.726 16/24/32/40kbps data format,,,,format_g726,)) +$(eval $(call BuildAsterisk11Module,format-g729,G.729,support for raw headerless G729 data,,,,format_g729,)) +$(eval $(call BuildAsterisk11Module,format-gsm,GSM format,support for GSM format,,,,format_gsm,)) +$(eval $(call BuildAsterisk11Module,format-h263,H263 format,support for H264 format,,,,format_h263,)) +$(eval $(call BuildAsterisk11Module,format-h264,H264 format,support for H264 format,,,,format_h264,)) +$(eval $(call BuildAsterisk11Module,format-ilbc,ILBC format,support for ILBC format,,,,format_ilbc,)) +$(eval $(call BuildAsterisk11Module,format-sln,Raw slinear format,support for raw slinear format,,,,format_sln,)) +$(eval $(call BuildAsterisk11Module,format-vox,VOX format,support for ADPCM vox format,,,,format_vox,)) +$(eval $(call BuildAsterisk11Module,format-wav,WAV format (8000hz Signed Linear),support for proprietary Microsoft WAV format (8000hz Signed Linear),,,,format_wav,)) +$(eval $(call BuildAsterisk11Module,format-wav-gsm,WAV format (Proprietary GSM),support for proprietary Microsoft WAV format (Proprietary GSM),,,,format_wav_gsm,)) +$(eval $(call BuildAsterisk11Module,func-base64,base64 support,support of base64 function,,,,func_base64,)) +$(eval $(call BuildAsterisk11Module,func-blacklist,Blacklist on callerid,looking up the callerid number and see if it is blacklisted,,,,func_blacklist,)) +$(eval $(call BuildAsterisk11Module,func-cut,CUT function,CUT function,,,,func_cut,)) +$(eval $(call BuildAsterisk11Module,func-db,Database interaction,functions for interaction with the database,,,,func_db,)) +$(eval $(call BuildAsterisk11Module,func-devstate,Blinky lights control,functions for manually controlled blinky lights,,,,func_devstate,)) +$(eval $(call BuildAsterisk11Module,func-extstate,Hinted extension state,retrieving the state of a hinted extension for dialplan control,,,,func_extstate,)) +$(eval $(call BuildAsterisk11Module,func-global,Global variable,global variable dialplan functions,,,,func_global,)) +$(eval $(call BuildAsterisk11Module,func-groupcount,Group count,for counting number of channels in the specified group,,,,func_groupcount,)) +$(eval $(call BuildAsterisk11Module,func-channel,Channel info,Channel info dialplan function,,,,func_channel,)) +$(eval $(call BuildAsterisk11Module,func-shell,Shell,support for shell execution,,,,func_shell,)) +$(eval $(call BuildAsterisk11Module,func-uri,URI encoding and decoding,Encodes and decodes URI-safe strings,,,,func_uri,)) +$(eval $(call BuildAsterisk11Module,func-vmcount,vmcount dialplan,a vmcount dialplan function,,,,func_vmcount,)) +$(eval $(call BuildAsterisk11Module,chan-agent,Agents proxy channel,an implementation of agents proxy channel,,,,chan_agent,)) +$(eval $(call BuildAsterisk11Module,chan-iax2,IAX2 channel,IAX support,+asterisk11-res-timing-timerfd,/etc/asterisk/iax.conf /etc/asterisk/iaxprov.conf,iax.conf iaxprov.conf,chan_iax2,)) +$(eval $(call BuildAsterisk11Module,chan-motif,Jingle channel,Motif Jingle Channel Driver,+asterisk11-res-xmpp,/etc/asterisk/motif.conf /etc/asterisk/jingle.conf,motif.conf jingle.conf,chan_motif,)) +$(eval $(call BuildAsterisk11Module,chan-mgcp,MGCP channel,the channel chan_mgcp,,/etc/asterisk/mgcp.conf,mgcp.conf,chan_mgcp,)) +$(eval $(call BuildAsterisk11Module,chan-ooh323,ooH323 channel,the channel chan_ooh323,,/etc/asterisk/ooh323.conf,ooh323.conf,chan_ooh323,)) +$(eval $(call BuildAsterisk11Module,chan-skinny,Skinny channel,the channel chan_skinny,,/etc/asterisk/skinny.conf,skinny.conf,chan_skinny,)) +$(eval $(call BuildAsterisk11Module,chan-unistim,Unistim channel,channel driver for the UNISTIM (Unified Networks IP Stimulus) protocol,,/etc/asterisk/unistim.conf,unistim.conf,chan_unistim,)) +$(eval $(call BuildAsterisk11Module,mysql,MySQL,MySQL support,+libmysqlclient,/etc/asterisk/res_config_mysql.conf,res_config_mysql.conf,res_config_mysql,)) +$(eval $(call BuildAsterisk11Module,odbc,ODBC,ODBC support,+libpthread +libc +unixodbc,/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,cdr_adaptive_odbc cdr_odbc cel_odbc func_odbc res_odbc,cdr_adaptive_odbc cdr_odbc cel_odbc func_odbc res_config_odbc res_odbc,)) +$(eval $(call BuildAsterisk11Module,pgsql,PostgreSQL,PostgreSQL support,+libpq,/etc/asterisk/cel_pgsql.conf /etc/asterisk/cdr_pgsql.conf /etc/asterisk/res_pgsql.conf,cel_pgsql.conf cdr_pgsql.conf res_pgsql.conf,cel_pgsql cdr_pgsql res_config_pgsql,)) +$(eval $(call BuildAsterisk11Module,pbx-ael,Asterisk Extension Logic,support for symbolic Asterisk Extension Logic,,,extensions.ael,pbx_ael,)) +$(eval $(call BuildAsterisk11Module,pbx-spool,Call Spool,outgoing call spool support,,,,pbx_spool,)) +$(eval $(call BuildAsterisk11Module,pbx-lua,Lua,provides Lua resources for Asterisk,+libpthread +libc +liblua,/etc/asterisk/extensions.lua,extensions.lua,pbx_lua,)) +$(eval $(call BuildAsterisk11Module,res-ael-share,Shareable AEL code,support for shareable AEL code mainly between internal and external modules,,,,res_ael_share,)) +$(eval $(call BuildAsterisk11Module,res-agi,Asterisk Gateway Interface,Support for the Asterisk Gateway Interface extension,,,,res_agi,)) +$(eval $(call BuildAsterisk11Module,res-clioriginate,Calls via CLI,Originate calls via the CLI,,,,res_clioriginate,)) +$(eval $(call BuildAsterisk11Module,res-monitor,Provide Monitor,Cryptographic Signature capability,,,,res_monitor,)) +$(eval $(call BuildAsterisk11Module,res-phoneprov,Phone Provisioning,Phone provisioning application for the asterisk internal http server,,/etc/asterisk/phoneprov.conf,phoneprov.conf,res_phoneprov,)) +$(eval $(call BuildAsterisk11Module,res-pktccops,Provide PacketCable COPS,simple client/server model for supporting policy control over QoS signaling protocols,,/etc/asterisk/res_pktccops.conf,res_pktccops.conf,res_pktccops,)) +$(eval $(call BuildAsterisk11Module,res-smdi,Provide SMDI,Simple Message Desk Interface capability,,/etc/asterisk/smdi.conf,smdi.conf,res_smdi,)) +$(eval $(call BuildAsterisk11Module,res-fax,FAX modules,Generic FAX resource for FAX technology resource modules,+asterisk11-res-timing-pthread,/etc/asterisk/res_fax.conf /etc/asterisk/udptl.conf,udptl.conf res_fax.conf,res_fax,)) +$(eval $(call BuildAsterisk11Module,res-fax-spandsp,Spandsp T.38 and G.711,Spandsp T.38 and G.711 FAX Resource,+asterisk11-res-fax +libspandsp +libtiff,,,res_fax_spandsp,)) +$(eval $(call BuildAsterisk11Module,res-musiconhold,MOH,Music On Hold support,,/etc/asterisk/musiconhold.conf,musiconhold.conf,res_musiconhold,)) +$(eval $(call BuildAsterisk11Module,res-srtp,SRTP,Secure RTP,+libsrtp,,,res_srtp,)) +$(eval $(call BuildAsterisk11Module,res-timing-pthread,pthread Timing Interface,,,,,res_timing_pthread,)) +$(eval $(call BuildAsterisk11Module,res-timing-timerfd,Timerfd Timing Interface,,,,,res_timing_timerfd,)) +$(eval $(call BuildAsterisk11Module,res-xmpp,XMPP client and component module,reference module for interfacting Asterisk directly as a client or component with XMPP server,+libiksemel +libopenssl,/etc/asterisk/xmpp.conf,xmpp.conf,res_xmpp,)) +$(eval $(call BuildAsterisk11Module,voicemail,Voicemail,voicemail related modules,,/etc/asterisk/voicemail.conf,voicemail.conf,*voicemail res_adsi res_smdi,vm-*)) diff --git a/net/asterisk-11.x/files/asterisk.default b/net/asterisk-11.x/files/asterisk.default new file mode 100644 index 00000000000..9d046c42da7 --- /dev/null +++ b/net/asterisk-11.x/files/asterisk.default @@ -0,0 +1,4 @@ +## startup options for /etc/init.d/asterisk + +ENABLE_ASTERISK="yes" +OPTIONS="" diff --git a/net/asterisk-11.x/files/asterisk.init b/net/asterisk-11.x/files/asterisk.init new file mode 100644 index 00000000000..78e891383c2 --- /dev/null +++ b/net/asterisk-11.x/files/asterisk.init @@ -0,0 +1,34 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2014 OpenWrt.org + +START=99 +APP=asterisk +OPTIONS= +DEST= +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 $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() { + 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-11.x/patches/001-pjproject-change-configure-args.patch b/net/asterisk-11.x/patches/001-pjproject-change-configure-args.patch new file mode 100644 index 00000000000..85dbfa3c194 --- /dev/null +++ b/net/asterisk-11.x/patches/001-pjproject-change-configure-args.patch @@ -0,0 +1,11 @@ +--- asterisk-11.4.0/res/Makefile 2013-02-04 20:50:52.000000000 +0100 ++++ asterisk11-new/res/Makefile 2013-06-02 13:51:22.269684111 +0200 +@@ -75,7 +75,7 @@ dist-clean:: + rm -f pjproject/build.mak + + pjproject/build.mak: pjproject/aconfigure +- (cd pjproject && CFLAGS="-fPIC" ./configure --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --disable-floating-point --disable-sound --disable-oss --disable-speex-aec --disable-l16-codec --disable-gsm-codec --disable-g722-codec --disable-g7221-codec --disable-speex-codec --disable-ilbc-codec --disable-g711-codec) ++ (cd pjproject && CFLAGS="-fPIC" ./configure --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --disable-floating-point --disable-sound --disable-oss --disable-speex-aec --disable-l16-codec --disable-gsm-codec --disable-g722-codec --disable-g7221-codec --disable-speex-codec --disable-ilbc-codec --disable-g711-codec --disable-opencore-amrnb --disable-video --disable-sdl --disable-ffmpeg --disable-v4l2) + + ifneq ($(findstring $(MAKECMDGOALS),all),) + -include pjproject/build.mak diff --git a/net/asterisk-11.x/patches/010-asterisk-configure-undef-res-ninit.patch b/net/asterisk-11.x/patches/010-asterisk-configure-undef-res-ninit.patch new file mode 100644 index 00000000000..49d2604e2a1 --- /dev/null +++ b/net/asterisk-11.x/patches/010-asterisk-configure-undef-res-ninit.patch @@ -0,0 +1,10 @@ +--- a/configure ++++ b/configure +@@ -16464,7 +16464,6 @@ if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } + +-$as_echo "#define HAVE_RES_NINIT 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_9_ndestroy" >&5 + $as_echo_n "checking for library containing res_9_ndestroy... " >&6; } diff --git a/net/asterisk-11.x/patches/020-asterisk-enable-default-modules.patch b/net/asterisk-11.x/patches/020-asterisk-enable-default-modules.patch new file mode 100644 index 00000000000..fe38642e4f1 --- /dev/null +++ b/net/asterisk-11.x/patches/020-asterisk-enable-default-modules.patch @@ -0,0 +1,44 @@ +--- a/addons/chan_mobile.c ++++ b/addons/chan_mobile.c +@@ -27,7 +27,7 @@ + + /*** MODULEINFO + bluetooth +- no ++ yes + extended + ***/ + +--- a/addons/res_config_mysql.c ++++ b/addons/res_config_mysql.c +@@ -24,7 +24,7 @@ + + /*** MODULEINFO + mysqlclient +- no ++ yes + extended + ***/ + +--- a/res/res_pktccops.c ++++ b/res/res_pktccops.c +@@ -31,7 +31,7 @@ + */ + + /*** MODULEINFO +- no ++ yes + extended + ***/ + +--- a/addons/chan_ooh323.c ++++ b/addons/chan_ooh323.c +@@ -18,7 +18,7 @@ + + + /*** MODULEINFO +- no ++ yes + extended + ***/ + diff --git a/net/asterisk-11.x/patches/021-asterisk-utils-enable-default-modules.patch b/net/asterisk-11.x/patches/021-asterisk-utils-enable-default-modules.patch new file mode 100644 index 00000000000..7c11286281c --- /dev/null +++ b/net/asterisk-11.x/patches/021-asterisk-utils-enable-default-modules.patch @@ -0,0 +1,11 @@ +--- a/utils/utils.xml ++++ b/utils/utils.xml +@@ -41,7 +41,7 @@ + extended + + +- no ++ yes + popt + extended + diff --git a/net/baresip/Makefile b/net/baresip/Makefile new file mode 100644 index 00000000000..87bf2367abb --- /dev/null +++ b/net/baresip/Makefile @@ -0,0 +1,150 @@ +# +# Copyright (C) 2010-2014 OpenWrt.org +# Copyright (C) 2010 Alfred E. Heggestad +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=baresip +PKG_VERSION:=0.4.11 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.creytiv.com/pub/ +PKG_MD5SUM:=bf25d14749ca286716c9b23108472c8a + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=docs/COPYING +PKG_MAINTAINER:=Jiri Slachta + +baresip-mods:= \ + alsa \ + avcodec \ + avformat \ + cons \ + evdev \ + g711 \ + g722 \ + oss \ + speex \ + stdio \ + uuid \ + v4l \ + v4l2 \ + +PKG_CONFIG_DEPENDS:= \ + $(patsubst %,CONFIG_PACKAGE_baresip-mod-%,$(baresip-mods)) \ + +include $(INCLUDE_DIR)/package.mk + +define Package/baresip/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + URL:=http://www.creytiv.com/ +endef + +define Package/baresip +$(call Package/baresip/Default) + TITLE:=Portable and modular SIP User-Agent with A/V support + DEPENDS:=+libre +librem +libpthread + MENU:=1 +endef + +baresip-mod-alsa := USE_ALSA +baresip-mod-avcodec := USE_FFMPEG +baresip-mod-avformat := USE_FFMPEG_AVFORMAT +baresip-mod-cons := USE_CONS +baresip-mod-evdev := USE_EVDEV +baresip-mod-g711 := USE_G711 +baresip-mod-g722 := USE_G722 +baresip-mod-oss := USE_OSS +baresip-mod-speex := USE_SPEEX +baresip-mod-stdio := USE_STDIO +baresip-mod-uuid := USE_UUID +baresip-mod-v4l := USE_V4L +baresip-mod-v4l2 := USE_V4L2 + +BARESIP_MOD_OPTIONS:= \ + MOD_AUTODETECT= \ + $(foreach m,$(baresip-mods),$(baresip-mod-$(m))=$(if $(CONFIG_PACKAGE_baresip-mod-$(m)),1)) + +TARGET_CFLAGS += $(FPIC) + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + LIBRE_MK="$(STAGING_DIR)/usr/share/re/re.mk" \ + LIBRE_INC="$(STAGING_DIR)/usr/include/re" \ + LIBRE_SO="$(STAGING_DIR)/usr/lib" \ + LIBREM_PATH="../rem" \ + CC="$(TARGET_CC)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + EXTRA_CFLAGS="$(TARGET_CFLAGS) -DOPENWRT" \ + SYSROOT="$$$$($(FIND) $(TOOLCHAIN_DIR) -path '*/include/pthread.h' | sed -ne '1s#/include/pthread.h##p')" \ + SYSROOT_ALT="$(STAGING_DIR)/usr" \ + RELEASE=1 \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + OS="linux" \ + $(BARESIP_MOD_OPTIONS) \ + all install +endef + +define Package/baresip/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/baresip $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib/baresip/modules + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/baresip/modules/{account,auloop,contact,ice,menu,stun,turn}.so \ + $(1)/usr/lib/baresip/modules/. + $(INSTALL_DIR) $(1)/usr/share/baresip + $(CP) $(PKG_INSTALL_DIR)/usr/share/baresip/* $(1)/usr/share/baresip/. + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/baresip.init $(1)/etc/init.d/baresip +endef + + +# +# 1. Name +# 2. Title +# 3. Files +# 4. Depends +# +define BuildPlugin + + define Package/baresip-mod-$(1) + $$(call Package/baresip/Default) + TITLE:= baresip $(2) module + DEPENDS:= baresip $(4) + endef + + define Package/baresip-mod-$(1)/install + [ -z "$(3)" ] || $(INSTALL_DIR) $$(1)/usr/lib/baresip/modules + for f in $(3); do \ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/baresip/modules/$$$$$$$${f}.so \ + $$(1)/usr/lib/baresip/modules/ ; \ + done + endef + + $$(eval $$(call BuildPackage,baresip-mod-$(1))) +endef + + +$(eval $(call BuildPackage,baresip)) + +$(eval $(call BuildPlugin,alsa,ALSA audio driver,alsa,+PACKAGE_baresip-mod-alsa:alsa-lib)) +$(eval $(call BuildPlugin,avcodec,FFmpeg video codecs,avcodec,+PACKAGE_baresip-mod-avcodec:libffmpeg-full)) +$(eval $(call BuildPlugin,avformat,FFmpeg video source,avformat,+PACKAGE_baresip-mod-avformat:libffmpeg-full)) +$(eval $(call BuildPlugin,cons,console UI,cons,)) +$(eval $(call BuildPlugin,evdev,input event device UI,evdev,)) +$(eval $(call BuildPlugin,g711,G.711 audio codec,g711,)) +$(eval $(call BuildPlugin,g722,G.722 audio codec,g722,+PACKAGE_baresip-mod-g722:libspandsp)) +$(eval $(call BuildPlugin,oss,OSS audio driver,oss,)) +$(eval $(call BuildPlugin,speex,Speex audio codec,speex,+PACKAGE_baresip-mod-speex:libspeex)) +$(eval $(call BuildPlugin,stdio,standard I/O UI,stdio,)) +$(eval $(call BuildPlugin,uuid,UUID,uuid,+libuuid)) +$(eval $(call BuildPlugin,v4l,Video4Linux video source,v4l,+PACKAGE_baresip-mod-v4l:libv4l)) +$(eval $(call BuildPlugin,v4l2,Video4Linux2 video source,v4l2,+PACKAGE_baresip-mod-v4l2:libv4l)) diff --git a/net/baresip/files/baresip.init b/net/baresip/files/baresip.init new file mode 100644 index 00000000000..e3985957101 --- /dev/null +++ b/net/baresip/files/baresip.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2011 OpenWrt.org +# Copyright (C) 2010 Alfred E. Heggestad +# + +START=92 + +start() { + service_start /usr/bin/baresip -d +} + +stop() { + service_stop /usr/bin/baresip +} diff --git a/net/freeswitch/Config.in b/net/freeswitch/Config.in new file mode 100644 index 00000000000..b72f2bf7daa --- /dev/null +++ b/net/freeswitch/Config.in @@ -0,0 +1,238 @@ +menu "Configuration" + depends on PACKAGE_freeswitch + + choice + depends on DEVEL + prompt "Git HEAD version to use" + default FS_WITH_DEFAULT_HEAD + help + The existing git HEAD is probably outdated. This option allows + OpenWRT to pull the latest git HEAD. Please ONLY enable this + option if you know what you are doing. It may and/or may not + be cleanly compiled and may require some intervension to create + new patches. If you take this route and come up with some patches, + please contemplate to contribute + or send in your patches. + + config FS_WITH_DEFAULT_HEAD + bool "Default" + help + Since developers @FreeSWITCH are actively working to improve + FreeSWITCH, there is a chance the default git HEAD has long + been oudated. + + config FS_WITH_LATEST_HEAD + bool "Latest" + help + Please use this option with cautious. It may and/or may not compile + out of the box and may and/or may not require some additional new + patches. + + endchoice + + choice + depends on FS_WITH_LATEST_HEAD + prompt "FS TARRED archive to use" + default FS_WITH_OPENWRT_SOURCE + help + Select which tarred to use: local or OpenWRT + local: FS tarred from local archive + OpenWRT: FS tarred download from source by OpenWRT + + config FS_WITH_LOCAL_SOURCE + bool "local" + help + Use local tarred archive. This approach requires a manually checkout + source from FS git repository using 'git clone', then package the + source using tar with XZ compression. The tarred file should include + $(PKG_VERSION) as follows: + 1. "git clone git://git.freeswitch.org/freeswitch.git " + 2. Change to . + 3. "git checkout $(FS_DEFAULT_HEAD) && git submodule update" + 4. Back to parent . + 5. "tar -Jcf freeswitch_git-$(PKG_VERSION).tar.xz " + 6. Move the tarred file to OpenWRT download directory. + + config FS_WITH_OPENWRT_SOURCE + bool "OpenWRT" + help + Use (download) tarred archive from OpenWRT. + + endchoice + + choice + prompt "Select database" + default FS_WITH_SQLITE3 + help + Select which database library to use for libs/apr-util package. + Default is SQLite. + + config FS_WITH_MYSQL + bool "MySQL" + help + Compile libs/apr-util with MySQL support. + + config FS_WITH_POSTGRESQL + bool "PostgreSQL" + help + Compile libs/apr-util with PostgreSQL support. + + config FS_WITH_SQLITE3 + bool "SQLITE3" + help + Compile libs/apr-util with SQLITE3 support. + + endchoice + + config FS_WITH_ALSA + bool "Enable ALSA for sound support" + default y + help + Compile with ALSA support. + + config FS_WITH_VISIBILITY + bool "Enable API visibility support" + default y + help + Compile with API visibility support. + + config FS_WITH_APR_CONFIG_SWITCHES + bool "Enable APR configuration switches" + default y + help + Enable some configure switches in libs/apr. + + config FS_WITH_APR_IPV6 + depends on FS_WITH_APR_CONFIG_SWITCHES + bool "Enable IPV6 support in APR" + default y + help + Compile libs/apr package with IPV6 support. + + config FS_WITH_APR_SCTP + depends on FS_WITH_APR_CONFIG_SWITCHES + bool "Enable SCTP support in APR" + default y + help + Compile with SCTP (Stream Control Transfer Protocol) + support in lib APR. + + config FS_WITH_APR_THREADS + depends on FS_WITH_APR_CONFIG_SWITCHES + bool "Enable threading support in APR" + default y + help + Compile with threads support in libs/apr. + + config FS_WITH_BUILTIN_ZRTP + bool "Enable built-in ZRTP" + default y + help + Compile with ZRTP support. + + config FS_WITH_OGG + bool "Enable ogg support in mod_celt" + default y + help + Enable this option to allow use of OGG in mod_celt. + + config FS_WITH_CORE_LIBEDIT_SUPPORT + bool "Compile with libedit Support" + default n + help + Compile with libedit Support. ATM, libedit isn't + supported by OpenWRT. + + config FS_WITH_FHS + bool "Follow the FHS when placing files and directories" + default y + help + Build FreeSWITCH to comply with FHS when placing + files and directories. + + config FS_WITH_LZMA + bool "Enable liblzma usage in libtiff" + default y + help + Compile libs/tiff package with liblzma support. This option + requires LZMA2 compression package called liblzma. + + config FS_WITH_ODBC + depends on PACKAGE_sqliteodbc + depends on PACKAGE_unixodbc_svn + bool "Compile with ODBC support (Requires unixodbc NOT YET AVAILABLE)" + default n + help + Enable ODBC support. Since both sqliteodbc and unixodbc + packages are not yet available on OpenWRT, ODBC support + should not be enabled. + + config FS_WITH_OPENSSL + bool "Enable SSL support" + default y + help + Compile with SSL support. + + config FS_WITH_OPT + bool "Enable optimization" + default y + help + Compile with optimization flag enabled. This + will add max optimising compiler flags + + config FS_WITH_SILENT_RULES + bool "Enable with less verbose build output" + default n + help + Enable this option to produce a less verbose build output + (undo: "make V=1") + + config FS_WITH_SRTP + bool "Enable SRTP" + default y + help + Compile with SRTP support. + + config FS_WITH_SRTP_GENERIC_AESICM + depends on FS_WITH_SRTP + bool "Compile in changes for ISMAcryp" + default y + help + Compile in changes for ISMAcryp. + + config FS_WITH_SRTP_KERNEL_LINUX + depends on FS_WITH_SRTP + bool "Build library to run in Linux kernel context" + default n + help + Build library to run in Linux kernel context. + + config FS_WITH_SRTP_OPENSSL + depends on FS_WITH_SRTP + bool "Use OpenSSL crypto primitives to build SRTP" + default y + help + Use OpenSSL crypto primitives. + + config FS_WITH_STUN + bool "Enable stun module" + default n + help + Enable stun module + + config FS_WITH_ERLANG + depends on PACKAGE_freeswitch-mod-erlang-event + string + prompt "path to erlang installed directory" + default "$$(STAGING_DIR_HOST)/lib/erlang" + help + Specify the path to erlang libraries. + +# config FS_WITH_OGG_INCLUDES +# string +# prompt "OGG include HEADER path" +# default "$$(STAGING_DIR)/usr/include" +# help +# Specify the include header path for OGG library. + +endmenu diff --git a/net/freeswitch/Makefile b/net/freeswitch/Makefile new file mode 100644 index 00000000000..1948ebb2203 --- /dev/null +++ b/net/freeswitch/Makefile @@ -0,0 +1,1106 @@ +# +# Copyright (C) 2009-2013 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:=freeswitch +PKG_SOURCE_PROTO:=git +PKG_DISTNAME:=$(PKG_NAME)_$(PKG_SOURCE_PROTO) +PKG_VERSION:=1.5.15b + + +# +# The latest FS git hash in PKG_SOURCE_VERSION can be obtained from +# http://fisheye.freeswitch.org +# +FS_WITH_DEFAULT_HEAD:=12b6940644a68ea444c0e430412d419ae368d4a8 +PKG_SOURCE_URL:=https://stash.$(PKG_NAME).org/scm/fs/$(PKG_NAME).git +PKG_SOURCE_VERSION:=$(if $(CONFIG_FS_WITH_LATEST_HEAD),$(shell git ls-remote $(PKG_SOURCE_URL) HEAD|cut -f1),$(FS_WITH_DEFAULT_HEAD)) +FS_WITH_DEFAULT_HEAD_SHORT:=$(shell echo $(FS_WITH_DEFAULT_HEAD)|cut -b -7) +PKG_SOURCE_VERSION_SHORT:=$(shell echo $(PKG_SOURCE_VERSION)|cut -b -7) +PKG_RELEASE:=$(PKG_SOURCE_VERSION_SHORT) +PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME) +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR)-$(if $(CONFIG_FS_WITH_LOCAL_SOURCE),$(FS_WITH_DEFAULT_HEAD_SHORT).tar.xz,$(PKG_SOURCE_VERSION_SHORT).tar.bz2) +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + + +PKG_FIXUP:=libtool autoreconf +PKG_BUILD_PARALLEL:=0 + +PKG_LICENSE:=MPL-1.1 +PKG_LICENSE_FILES:=COPYING + +ifeq ($(CONFIG_DEVEL),y) + export QUILT=1 +endif + + +PKG_BUILD_DEPENDS:= \ + FS_WITH_CORE_LIBEDIT_SUPPORT:libedit \ + FS_WITH_MYSQL:libmysqlclient \ + FS_WITH_POSTGRESQL:libpq \ + FS_WITH_SQLITE3:libsqlite3 \ + FS_WITH_APR_SCTP:sctp \ + + +TAR_OPTIONS+= --strip-components=1 -C $(PKG_BUILD_DIR) + + +FS_MOD_AVAILABLE:= \ + abstraction \ + alsa \ + amr \ + amrwb \ + avmd \ + basic \ + bert \ + blacklist \ + bv \ + callcenter \ + cdr-csv \ + cdr-mongodb \ + cdr-pg-csv \ + cdr-sqlite \ + celt \ + cepstral \ + cidlookup \ + cluechoo \ + codec2 \ + commands \ + conference \ + console \ + curl \ + dahdi-codec \ + db \ + dialplan-asterisk \ + dialplan-directory \ + dialplan-xml \ + dingaling \ + directory \ + distributor \ + dptools \ + easyroute \ + enum \ + erlang-event \ + esf \ + event-multicast \ + event-socket \ + event-zmq \ + expr \ + fifo \ + file-string \ + flite \ + format-cdr \ + freetdm \ + fsk \ + fsv \ + g723-1 \ + g729 \ + gsmopen \ + h26x \ + h323 \ + hash \ + html5 \ + httapi \ + http-cache \ + ilbc \ + isac \ + java \ + json-cdr \ + lcr \ + ldap \ + local-stream \ + logfile \ + loopback \ + lua \ + managed \ + memcache \ + mongo \ + mp4 \ + mp4v \ + native-file \ + nibblebill \ + opus \ + oreka \ + perl \ + portaudio \ + portaudio-stream \ + posix-timer \ + python \ + radius-cdr \ + rayo \ + redis \ + rss \ + rtc \ + rtmp \ + sangoma-codec \ + say-de \ + say-en \ + say-es \ + say-fa \ + say-fr \ + say-hu \ + say-it \ + say-nl \ + say-pt \ + say-ru \ + say-th \ + say-zh \ + shell-stream \ + silk \ + siren \ + skel \ + skinny \ + skypopen \ + sms \ + snapshot \ + snipe-hunt \ + sndfile \ + snmp \ + snom \ + sofia \ + sonar \ + spandsp \ + spidermonkey \ + spidermonkey-core-db \ + spidermonkey-curl \ + spidermonkey-odbc \ + spidermonkey-socket \ + spidermonkey-teletone \ + spy \ + ssml \ + stress \ + syslog \ + timerfd \ + tone-stream \ + tts-commandline \ + unimrcp \ + valet-parking \ + verto \ + vmd \ + voicemail \ + voicemail-ivr \ + vp8 \ + xml-cdr \ + xml-curl \ + xml-ldap \ + xml-rpc \ + xml-radius \ + xml-scgi \ + yaml \ + + +PKG_CONFIG_DEPENDS:= \ + CONFIG_FS_WITH_ALSA \ + CONFIG_FS_WITH_APR_CONFIG_SWITCHES \ + CONFIG_FS_WITH_APR_IPV6 \ + CONFIG_FS_WITH_APR_SCTP \ + CONFIG_FS_WITH_APR_THREADS \ + CONFIG_FS_WITH_BUILTIN_ZRTP \ + CONFIG_FS_WITH_CORE_LIBEDIT_SUPPORT \ + CONFIG_FS_WITH_DEFAULT_HEAD \ + CONFIG_FS_WITH_ERLANG \ + CONFIG_FS_WITH_FHS \ + CONFIG_FS_WITH_FIXED_POINT \ + CONFIG_FS_WITH_LATEST_HEAD \ + CONFIG_FS_WITH_LOCAL_SOURCE \ + CONFIG_FS_WITH_LZMA \ + CONFIG_FS_WITH_MYSQL \ + CONFIG_FS_WITH_ODBC \ + CONFIG_FS_WITH_OGG \ + CONFIG_FS_WITH_OPENSSL \ + CONFIG_FS_WITH_OPENWRT_SOURCE \ + CONFIG_FS_WITH_OPT \ + CONFIG_FS_WITH_POSTGRESQL \ + CONFIG_FS_WITH_SILENT_RULES \ + CONFIG_FS_WITH_SQLITE3 \ + CONFIG_FS_WITH_SRTP \ + CONFIG_FS_WITH_SRTP_GENERIC_AESICM \ + CONFIG_FS_WITH_SRTP_KERNEL_LINUX \ + CONFIG_FS_WITH_SRTP_OPENSSL \ + CONFIG_FS_WITH_STUN \ + CONFIG_FS_WITH_VISIBILITY \ + $(patsubst %,CONFIG_PACKAGE_$(PKG_NAME)-mod-%,$(FS_MOD_AVAILABLE)) \ + + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + + +ifneq ($(CONFIG_CCACHE),) +TARGET_CC=$(TARGET_CC_NOCACHE) +TARGET_CXX=$(TARGET_CXX_NOCACHE) +endif + + +ifneq ($(CONFIG_CCACHE),) +TARGET_CC=$(TARGET_CC_NOCACHE) +TARGET_CXX=$(TARGET_CXX_NOCACHE) +endif + + +define Package/$(PKG_NAME)/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + URL:=http://www.$(PKG_NAME).org/ + MAINTAINER:=Mazi Lo +endef + + +define Package/$(PKG_NAME) +$(call Package/$(PKG_NAME)/Default) + MENU:=1 + TITLE:=FreeSWITCH open source telephony platform ($(PKG_SOURCE_VERSION_SHORT)) + DEPENDS:=+FS_WITH_CORE_LIBEDIT_SUPPORT:libedit +FS_WITH_OPENSSL:libopenssl +libcurl +libdb47 +libgdbm $(ICONV_DEPENDS) $(INTL_DEPENDS) +libjpeg +libncurses +libopenldap +libpcre +libpthread +librt +libspeex +libspeexdsp +FS_WITH_SQLITE3:libsqlite3 +FS_WITH_SRTP:libsrtp +SSP_SUPPORT:libssp +libstdcpp +libuuid +PACKAGE_$(PKG_NAME)-mod-perl:perl +endef + + +define Package/$(PKG_NAME)/description + FreeSWITCH is an open source telephony platform designed to + facilitate the creation of voice and chat driven products + scaling from a soft-phone up to a soft-switch. +endef + + +define Package/$(PKG_NAME)/config + source "$(SOURCE)/Config.in" +endef + + +define Package/$(PKG_NAME)-mod-spandsp/config + config FS_WITH_FIXED_POINT + depends on PACKAGE_$(PKG_NAME)-mod-spandsp + bool "Enable fixed point support for spandsp (may degrade performance)" + default n + help + Compile spandsp package with a fixed point support. ONLY enabled this + option when necessary, i.e. CPU doesn't support floating computation. +endef + + +define Package/$(PKG_NAME)-example-config +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH example config (commented) + DEPENDS:= $(PKG_NAME) +endef + + +define Package/$(PKG_NAME)-example-config/description + The default configuration included with FreeSWITCH. It is not intended to be + a final product, and is thus moved to /usr/share/$(PKG_NAME)/examples/conf to + be an example of how FreeSWITCH can be configured. +endef + + +define Package/$(PKG_NAME)-config-upstream-defaults +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH upstream config + DEPENDS:= $(PKG_NAME) +endef + + +define Package/$(PKG_NAME)-config-upstream-defaults/description + The default configuration included with FreeSWITCH. It is not intended to be + a final product, and but is included for those who don't want to use the + OpenWRT configuration and/or want to try things as prepared by upstream. +endef + + +define Package/$(PKG_NAME)-config-minimal +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH minimal config + DEPENDS:= $(PKG_NAME) +endef + + +define Package/$(PKG_NAME)-config-minimal/description + A minimal configuration of FreeSWITCH for OpenWRT devices. Is what the UCI + configuration began with. +endef + + +define Package/$(PKG_NAME)-collection-upstream-defaults +$(call Package/$(PKG_NAME)/Default) + TITLE:=FS upstream def sample conf + DEPENDS:= $(PKG_NAME) \ + +$(PKG_NAME)-config-upstream-defaults \ + +$(PKG_NAME)-mod-callcenter \ + +$(PKG_NAME)-mod-codec2 \ + +$(PKG_NAME)-mod-commands \ + +$(PKG_NAME)-mod-conference \ + +$(PKG_NAME)-mod-curl \ + +$(PKG_NAME)-mod-dialplan-xml \ + +$(PKG_NAME)-mod-dingaling \ + +$(PKG_NAME)-mod-dptools \ + +$(PKG_NAME)-mod-event-socket \ + +$(PKG_NAME)-mod-g723-1 \ + +$(PKG_NAME)-mod-g729 \ + +$(PKG_NAME)-mod-hash \ + +$(PKG_NAME)-mod-http-cache \ + +$(PKG_NAME)-mod-ilbc \ + +$(PKG_NAME)-mod-local-stream \ + +$(PKG_NAME)-mod-lua \ + +$(PKG_NAME)-mod-native-file \ + +$(PKG_NAME)-mod-say-en \ + +$(PKG_NAME)-mod-sndfile \ + +$(PKG_NAME)-mod-sofia \ + +$(PKG_NAME)-mod-syslog \ + +$(PKG_NAME)-mod-tone-stream \ + +$(PKG_NAME)-mod-xml-curl \ + +$(PKG_NAME)-mod-xml-rpc \ + +$(PKG_NAME)-tools +endef + + +define Package/$(PKG_NAME)-collection-minimal +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH minimal package collection + DEFAULT:=y + DEPENDS:= $(PKG_NAME) \ + +$(PKG_NAME)-config-minimal \ + +$(PKG_NAME)-mod-codec2 \ + +$(PKG_NAME)-mod-commands \ + +$(PKG_NAME)-mod-dialplan-xml \ + +$(PKG_NAME)-mod-dptools \ + +$(PKG_NAME)-mod-event-socket \ + +$(PKG_NAME)-mod-hash \ + +$(PKG_NAME)-mod-local-stream \ + +$(PKG_NAME)-mod-sndfile \ + +$(PKG_NAME)-mod-sofia \ + +$(PKG_NAME)-mod-syslog \ + +$(PKG_NAME)-mod-tone-stream \ + +$(PKG_NAME)-tools +endef + + +define Package/$(PKG_NAME)-sounds-en-08KHz +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH 8KHz english sounds + DEPENDS:= $(PKG_NAME) +endef + + +define Package/$(PKG_NAME)-sounds-en-16KHz +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH 16KHz english sounds + DEPENDS:= +$(PKG_NAME)-sounds-en-08KHz +endef + + +define Package/$(PKG_NAME)-sounds-en-32KHz +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH 32KHz english sounds + DEPENDS:= +$(PKG_NAME)-sounds-en-16KHz +endef + + +define Package/$(PKG_NAME)-sounds-en-48KHz +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH 48KHz english sounds + DEPENDS:= +$(PKG_NAME)-sounds-en-32KHz +endef + + +define Package/$(PKG_NAME)-sounds-moh-08KHz +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH 8KHz music-on-hold sounds + DEPENDS:= $(PKG_NAME) +endef + + +define Package/$(PKG_NAME)-sounds-moh-16KHz +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH 16KHz music-on-hold sounds + DEPENDS:= +$(PKG_NAME)-sounds-moh-08KHz +endef + + +define Package/$(PKG_NAME)-sounds-moh-32KHz +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH 32KHz music-on-hold sounds + DEPENDS:= +$(PKG_NAME)-sounds-moh-16KHz +endef + + +define Package/$(PKG_NAME)-sounds-moh-48KHz +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH 48KHz music-on-hold sounds + DEPENDS:= +$(PKG_NAME)-sounds-moh-32KHz +endef + + +define Package/$(PKG_NAME)-tools +$(call Package/$(PKG_NAME)/Default) + TITLE:=FreeSWITCH control tools + DEPENDS:= $(PKG_NAME) +endef + + +define Download/files + define Download/$(1) + FILE:=$(2) + URL:=$(if $(4),$(4),http://files.$(PKG_NAME).org)/$(5) + MD5SUM:=$(3) + endef + define Prepare/$(1) + $(LN) $(DL_DIR)/$(2) $(PKG_BUILD_DIR)/$(6) + endef + $$(eval $$(call Download,$(1))) +endef + + +MAKE_INSTALL_TARGETS:=install + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-celt),) + $(eval $(call Download/files,celt,celt-0.10.0.tar.gz,a656f6176e9be84027c0e51ceedd710f,,downloads/libs/,libs/)) +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-curl),) + $(eval $(call Download/files,json-cdr,json-c-0.9.tar.gz,4653b3b9c568bb9c782178abfaac128d,,downloads/libs/,libs/)) +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-event-zmq),) + $(eval $(call Download/files,event-zmq,zeromq-2.1.9.tar.gz,94c5e0262a79c5f82bc0b178c1f8a33d,http://download.zeromq.org http://download.zeromq.org/historic,,libs/)) +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-flite),) + $(eval $(call Download/files,flite,flite-1.5.4-current.tar.bz2,f3a2d88b1059f6f4ff3c20a8169bc0f4,,downloads/libs/,libs/)) +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-mongo),) + $(eval $(call Download/files,mongo,mongo-c-driver-0.92.2.tar.gz,afab25a33abd3f1e0ba79c5a9da92651,,downloads/libs/,libs/)) +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-opus),) + $(eval $(call Download/files,opus,opus-1.1-p2.tar.gz,5da7cb39925bfb7dd60ea2e810f71357,,downloads/libs/,libs/)) +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-ldap)|$(CONFIG_PACKAGE_$(PKG_NAME)-mod-xml-ldap),) + $(eval $(call Download/files,ldap,openldap-2.4.19.tar.gz,4a6dab2711fcf141f19bb680bc335887,,downloads/libs/,libs/)) +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-08KHz),) + $(eval $(call Download/files,sounds-en-08KHz,$(PKG_NAME)-sounds-en-us-callie-8000-1.0.50.tar.gz,14cccba7b5c56f027fea391f1e0ee2d6,,,)) + MAKE_INSTALL_TARGETS+= sounds-install +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-16KHz),) + $(eval $(call Download/files,sounds-en-16KHz,$(PKG_NAME)-sounds-en-us-callie-16000-1.0.50.tar.gz,261f42e310baa97cc4dcfdc51971aff8,,,)) + MAKE_INSTALL_TARGETS+= hd-sounds-install +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-32KHz),) + $(eval $(call Download/files,sounds-en-32KHz,$(PKG_NAME)-sounds-en-us-callie-32000-1.0.50.tar.gz,f204512fadc49a3267ff4a5e899b77a5,,,)) + MAKE_INSTALL_TARGETS+= uhd-sounds-install +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-48KHz),) + $(eval $(call Download/files,sounds-en-48KHz,$(PKG_NAME)-sounds-en-us-callie-48000-1.0.50.tar.gz,8622a77a5d6dcf5e47bdf30d6a33e27c,,,)) + MAKE_INSTALL_TARGETS+= cd-sounds-install +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-08KHz),) + $(eval $(call Download/files,sounds-moh-08KHz,$(PKG_NAME)-sounds-music-8000-1.0.50.tar.gz,c1f62dc26360f39f8eb442d5efd0a3aa,,,)) + MAKE_INSTALL_TARGETS+= moh-install +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-16KHz),) + $(eval $(call Download/files,sounds-moh-16KHz,$(PKG_NAME)-sounds-music-16000-1.0.50.tar.gz,d253e26baa85e0e2e727a1cb1cca898e,,,)) + MAKE_INSTALL_TARGETS+= hd-moh-install +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-32KHz),) + $(eval $(call Download/files,sounds-moh-32KHz,$(PKG_NAME)-sounds-music-32000-1.0.50.tar.gz,0e3ee69cb4ba2813ed0d3f7811332b63,,,)) + MAKE_INSTALL_TARGETS+= uhd-moh-install +endif + + +ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-48KHz),) + $(eval $(call Download/files,sounds-moh-48KHz,$(PKG_NAME)-sounds-music-48000-1.0.50.tar.gz,873a62df1ab3be4191eb2488156ec2c2,,,)) + MAKE_INSTALL_TARGETS+= cd-moh-install +endif + + +# +# XXX: -fgnu89-inline is not supported on all compiler versions, so only enable it on avr32 where it solves build issues +# +ifneq ($(CONFIG_avr32),) + TARGET_CFLAGS += -fgnu89-inline + TARGET_CXXFLAGS += -fgnu89-inline +endif + + +ifneq ($(CONFIG_USE_EGLIBC),) + ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),) + TARGET_CFLAGS += -DNO_GETLOGIN + endif +endif + + +FS_TARGET_CFLAGS:= $(TARGET_CFLAGS) -DLUA_USE_LINUX $(FPIC) -std=gnu99 -Wno-format -Wno-unused-variable -Wno-unused-but-set-variable -Wno-implicit-function-declaration +FS_TARGET_CXXFLAGS:= $(TARGET_CXXFLAGS) +FS_TARGET_CPPFLAGS:= -I. -I./lua $(TARGET_CPPFLAGS) $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-json-cdr),-Wno-error) -I`ls -d $(PKG_BUILD_DIR)/libs/*|grep tiff`/libtiff -I$(PKG_BUILD_DIR)/libs/spandsp/src + + +#MAKE_FLAGS += \ +# OPT_FLAGS+="$(TARGET_CFLAGS)" + + +MAKE_VARS += \ + AR="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ar" \ + CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)" \ + CXX="$(TOOLCHAIN_DIR)/bin/$(TARGET_CXX)" \ + RANLIB="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ranlib" \ + CC_FOR_BUILD="$(HOSTCC)" \ + + +CONFIGURE_ARGS+= \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --prefix="/usr/share/$(PKG_NAME)" \ + --bindir="/usr/bin" \ + --libdir="/usr/lib" \ + --srcdir="$(PKG_BUILD_DIR)" \ + --sysconfdir="/etc/$(PKG_NAME)" \ + --with-modinstdir="/usr/lib/$(PKG_NAME)" \ + --with-random="/dev/urandom" \ + $(call autoconf_bool,CONFIG_FS_WITH_BUILTIN_ZRTP,zrtp) \ + $(call autoconf_bool,CONFIG_FS_WITH_CORE_LIBEDIT_SUPPORT,core-libedit-support) \ + $(call autoconf_bool,CONFIG_FS_WITH_FHS,fhs) \ + $(call autoconf_bool,CONFIG_FS_WITH_APR_IPV6,ipv6) \ + $(call autoconf_bool,CONFIG_FS_WITH_LZMA,lzma) \ + $(call autoconf_bool,CONFIG_FS_WITH_ODBC,core-odbc-support) \ + $(call autoconf_bool,CONFIG_FS_WITH_OPT,optimization) \ + $(call autoconf_bool,CONFIG_FS_WITH_POSTGRESQL,core-pgsql-pkgconfig) \ + $(call autoconf_bool,CONFIG_FS_WITH_POSTGRESQL,core-pgsql-support) \ + $(call autoconf_bool,CONFIG_FS_WITH_SILENT_RULES,silent-rules) \ + $(call autoconf_bool,CONFIG_FS_WITH_SRTP,srtp) \ + $(call autoconf_bool,CONFIG_FS_WITH_SRTP_GENERIC_AESICM,generic-aesicm) \ + $(call autoconf_bool,CONFIG_FS_WITH_SRTP_KERNEL_LINUX,kernel-linux) \ + $(call autoconf_bool,CONFIG_FS_WITH_SRTP_OPENSSL,openssl) \ + $(call autoconf_bool,CONFIG_FS_WITH_STUN,stun) \ + $(call autoconf_bool,CONFIG_FS_WITH_APR_THREADS,threads) \ + $(call autoconf_bool,CONFIG_FS_WITH_VISIBILITY,visibility) \ + $(call autoconf_bool,CONFIG_PACKAGE_$(PKG_NAME)-mod-spandsp && CONFIG_FS_WITH_FIXED_POINT,fixed-point) \ + $(call autoconf_bool,CONFIG_PACKAGE_$(PKG_NAME)-mod-spandsp,builtin-tiff) \ + $(call autoconf_bool,CONFIG_PACKAGE_$(PKG_NAME)-mod-timerfd,timerfd-wrapper) \ + $(if $(CONFIG_FS_WITH_ODBC),--with-odbc-lib="$(STAGING_DIR)/usr/lib") \ + $(if $(CONFIG_FS_WITH_ODBC),--with-odbc="$(STAGING_DIR)/usr") \ + $(if $(CONFIG_FS_WITH_OGG),--with-ogg="$(STAGING_DIR)/usr") \ + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-celt),--with-ogg="$(STAGING_DIR)/usr",--without-ogg) \ + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-erlang-event),--with-erlang="$(CONFIG_FS_WITH_ERLANG)",--without-erlang) \ + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-java),--with-java="$(STAGING_DIR)/usr",--without-java) \ + $(if ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-curl)|$(CONFIG_PACKAGE_$(PKG_NAME)-mod-xml-cdr)|$(CONFIG_PACKAGE_$(PKG_NAME)-mod-xml-curl)),--with-libcurl="$(STAGING_DIR)/usr",--without-libcurl) \ + --with$(if $(CONFIG_FS_WITH_MYSQL),,out)-mysql \ + --with$(if $(CONFIG_FS_WITH_OPENSSL),,out)-openssl \ + --with$(if $(CONFIG_FS_WITH_POSTGRESQL),,out)-pgsql \ + --with$(if $(CONFIG_FS_WITH_SQLITE3),,out)-sqlite3 \ + + +ifeq ($(ARCH),arm) + CONFIGURE_ARGS+= --enable-arm5e-asm \ + +endif + + +CONFIGURE_VARS+= \ + config_TARGET_CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)" \ + config_TARGET_CXX="$(TOOLCHAIN_DIR)/bin/$(TARGET_CXX)" \ + config_TARGET_CFLAGS="$(FS_TARGET_CPPFLAGS) $(FS_TARGET_CFLAGS)" \ + config_TARGET_CXXFLAGS="$(FS_TARGET_CPPFLAGS) $(FS_TARGET_CXXFLAGS)" \ + config_TARGET_CPPFLAGS="$(FS_TARGET_CPPFLAGS)" \ + config_TARGET_READLINE_INC="$(FS_TARGET_CPPFLAGS)" \ + config_TARGET_READLINE_LIBS="-lreadline -lncurses" \ + config_TARGET_LIBS="-lpthread -ldl" \ + config_BUILD_CC="$(HOSTCC)" \ + CC_FOR_BUILD="$(HOSTCC)" \ + BUILDTOOL_CC="$(HOSTCC)" \ + BUILDTOOL_CCLD="$(HOSTCC)" \ + CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)" \ + CXX="$(TOOLCHAIN_DIR)/bin/$(TARGET_CXX)" \ + AR="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ar" \ + RANLIB="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ranlib" \ + CFLAGS="$(FS_TARGET_CPPFLAGS) $(FS_TARGET_CFLAGS)" \ + CXXFLAGS="$(FS_TARGET_CPPFLAGS) $(FS_TARGET_CXXFLAGS)" \ + CPPFLAGS="$(FS_TARGET_CPPFLAGS)" \ + LDFLAGS="-L$(STAGING_DIR)/usr/lib/perl5/5.20/CORE -Wl,-rpath-link=\"$(STAGING_DIR)/usr/lib\" -Wl,-rpath-link=\"$(STAGING_DIR)/usr/lib$(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-perl),/perl5/5.20/CORE)\" -Wl,-rpath,/usr/lib -Wl,-rpath,/usr/lib$(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-perl),/perl5/5.20/CORE -lperl -lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc)" \ + HOST_CC="/usr/bin/cc" \ + HOST_CXX="/usr/bin/g++" \ + CROSS_COMPILE="1" \ + $(if $(CONFIG_FS_WITH_APR_SCTP),ac_cv_header_netinet_sctp_h="yes") \ + + +define Build/Prepare + $(call Build/Prepare/Default) + $(call Prepare/celt) + $(call Prepare/event-zmq) + $(call Prepare/flite) + $(call Prepare/json-cdr) + $(call Prepare/ldap) + $(call Prepare/mongo) + $(call Prepare/opus) + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-08KHz),$(call Prepare/sounds-en-08KHz)) + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-16KHz),$(call Prepare/sounds-en-16KHz)) + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-32KHz),$(call Prepare/sounds-en-32KHz)) + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-48KHz),$(call Prepare/sounds-en-48KHz)) + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-08KHz),$(call Prepare/sounds-moh-08KHz)) + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-16KHz),$(call Prepare/sounds-moh-16KHz)) + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-32KHz),$(call Prepare/sounds-moh-32KHz)) + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-48KHz),$(call Prepare/sounds-moh-48KHz)) +ifeq ($(CONFIG_FS_WITH_LOCAL_SOURCE),y) + (cd $(PKG_BUILD_DIR); $(if $(CONFIG_FS_WITH_LATEST_HEAD),if $(QUILT_CMD) top > /dev/null 2>&1 && [ -f $(PKG_BUILD_DIR)/patches/series ]; then $(QUILT_CMD) pop -a; fi; git pull;) if $(QUILT_CMD) next > /dev/null 2>&1; then $(QUILT_CMD) push -a; fi) +endif +endef + + +define Build/Configure + (cd $(PKG_BUILD_DIR); $(if $(CONFIG_FS_WITH_LATEST_HEAD),if $(QUILT_CMD) top > /dev/null 2>&1 && [ -f $(PKG_BUILD_DIR)/patches/series ]; then $(QUILT_CMD) pop -a; fi; git pull;) if $(QUILT_CMD) next > /dev/null 2>&1; then $(QUILT_CMD) push -a; fi) + (cd $(PKG_BUILD_DIR); $(AM_TOOL_PATHS) ./bootstrap.sh) + $(foreach m,$(FS_MOD_AVAILABLE), + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-$(m)), + $(SED) 's|^[ #]*\([^#]*/mod_$(subst -,_,$(m))\)$$$$|\1|g' $(PKG_BUILD_DIR)/modules.conf + , + $(SED) 's|^\([^#]*/mod_$(subst -,_,$(m))\)$$$$|#\1|g' $(PKG_BUILD_DIR)/modules.conf + ) + ) + $(call Build/Configure/Default) +endef + + +define Build/Compile + $(call Build/Compile/Default, \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all $(MAKE_INSTALL_TARGETS) \ + ) + $(SED) 's|^\([ \t]*\)\(.*\)"mod_console"\(.*\)$$$$|\1|' $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml + $(SED) 's|^\([ \t]*\)\(.*\)$$$$|\1\2"mod_syslog"\3\4|' $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml +endef + + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/include $(1)/usr + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib$(PKG_NAME).{a,so*} $(1)/usr/lib/ +endef + + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DIR) $(1)/etc/default + $(INSTALL_DIR) $(1)/etc/$(PKG_NAME) + $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)/scripts + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/include + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) + $(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME) + $(INSTALL_DATA) ./files/$(PKG_NAME).default $(1)/etc/default/$(PKG_NAME) + $(INSTALL_DATA) ./files/$(PKG_NAME).hotplug $(1)/etc/hotplug.d/iface/90-$(PKG_NAME) + $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/include $(1)/usr/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib$(PKG_NAME)* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/$(PKG_NAME).pc $(1)/usr/lib/pkgconfig/ + $(if $(1)/usr/lib/lib$(PKG_NAME).la,$(STAGING_DIR_HOST)/bin/sed -i -re 's|$(STAGING_DIR)||g;s|$(TOOLCHAIN_DIR)||g;s|$(TARGET_CROSS)|usr|g;s|$(REAL_GNU_TARGET_NAME)|usr|g;s|-L$(PKG_BUILD_DIR)(.*)libzrtp ||g;:a;s|((-[IL]/\S+\s).*)\2|\1|;ta' $(1)/usr/lib/lib$(PKG_NAME).la) +endef + + +define Package/$(PKG_NAME)-collection-upstream-defaults/install + $(INSTALL_DIR) $(1)/etc/$(PKG_NAME) +endef + + +define Package/$(PKG_NAME)-example-config/install + $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/examples/conf + $(CP) $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/* $(1)/usr/share/$(PKG_NAME)/examples/conf/ +endef + + +define Package/$(PKG_NAME)-config-upstream-defaults/install + $(INSTALL_DIR) $(1)/etc/$(PKG_NAME) + $(CP) $(PKG_INSTALL_DIR)/etc/$(PKG_NAME) $(1)/etc +endef + + +define Package/$(PKG_NAME)-collection-minimal/install + $(INSTALL_DIR) $(1)/etc/$(PKG_NAME) +endef + + +define Package/$(PKG_NAME)-collection-uci-minimal/install + $(INSTALL_DIR) $(1)/etc/$(PKG_NAME) +endef + + +define Package/$(PKG_NAME)-config-minimal/install + $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)/autoload_configs + + # + # Copying dialplan directory jingle_profiles sip_profiles $(PKG_NAME).xml + # fur_elise.ttml mime.types tetris.ttml tones.conf vars.xml + # + $(foreach f,dialplan directory jingle_profiles sip_profiles $(PKG_NAME).xml fur_elise.ttml mime.types tetris.ttml vars.xml,$(if $(PKG_BUILD_DIR)/conf/vanilla/$(f),$(CP) $(PKG_BUILD_DIR)/conf/vanilla/$(f) $(1)/etc/$(PKG_NAME);)) + + # + # Copying acl ivr modules post_load_modules switch timezones + # + $(foreach f,acl ivr modules post_load_modules switch timezones,$(if $(PKG_BUILD_DIR)/conf/vanilla/autoload_configs/$(f).conf.xml,$(CP) $(PKG_BUILD_DIR)/conf/vanilla/autoload_configs/$(f).conf.xml $(1)/etc/$(PKG_NAME)/autoload_configs;)) +endef + + +define Package/$(PKG_NAME)-sounds-en-08KHz/install + # + # sounds-en-8KHz + # + for dir in `(cd $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie;ls)`; \ + do \ + [ -d $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/8000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/8000; \ + $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/8000/* $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/8000; \ + done +endef + + +define Package/$(PKG_NAME)-sounds-en-16KHz/install + # + # sounds-en-16KHz + # + for dir in `(cd $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie;ls)`; \ + do \ + [ -d $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/16000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/16000; \ + $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/16000/* $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/16000; \ + done +endef + + +define Package/$(PKG_NAME)-sounds-en-32KHz/install + # + # sounds-en-32KHz + # + for dir in `(cd $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie;ls)`; \ + do \ + [ -d $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/32000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/32000; \ + $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/32000/* $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/32000; \ + done +endef + + +define Package/$(PKG_NAME)-sounds-en-48KHz/install + # + # sounds-en-48KHz + # + for dir in `(cd $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie;ls)`; \ + do \ + [ -d $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/48000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/48000; \ + $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/48000/* $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/48000; \ + done +endef + + +define Package/$(PKG_NAME)-sounds-moh-08KHz/install + # + # sounds-moh-8KHz + # + [ -d $(1)/usr/share/$(PKG_NAME)/sounds/music/8000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/music/8000; + $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/music/8000 $(1)/usr/share/$(PKG_NAME)/sounds/music; +endef + + +define Package/$(PKG_NAME)-sounds-moh-16KHz/install + # + # sounds-moh-16KHz + # + [ -d $(1)/usr/share/$(PKG_NAME)/sounds/music/16000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/music/16000; + $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/music/16000 $(1)/usr/share/$(PKG_NAME)/sounds/music; +endef + + +define Package/$(PKG_NAME)-sounds-moh-32KHz/install + # + # sounds-moh-32KHz + # + [ -d $(1)/usr/share/$(PKG_NAME)/sounds/music/32000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/music/32000; + $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/music/32000 $(1)/usr/share/$(PKG_NAME)/sounds/music; +endef + + +define Package/$(PKG_NAME)-sounds-moh-48KHz/install + # + # sounds-moh-48KHz + # + [ -d $(1)/usr/share/$(PKG_NAME)/sounds/music/48000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/music/48000; + $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/music/48000 $(1)/usr/share/$(PKG_NAME)/sounds/music; +endef + + +define Package/$(PKG_NAME)-tools/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_cli $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_encode $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_ivrd $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/fsxs $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/gentls_cert $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/tone2wav $(1)/usr/bin/ +endef + + +# 1. Name +# 2. Title +# 3. Selection on module configuration file +# 4. Files (module files include different names) +# 5. Files (supporting files include different names) +# 6. Inter module depends +# 7. Extra depends +# +define BuildPlugin + define Package/$(PKG_NAME)-mod-$(1) + $$(call Package/$(PKG_NAME)/Default) + TITLE:= FS $(2) module + DEPENDS:= $(PKG_NAME) $(foreach m,$(6),+$(PKG_NAME)-mod-$(m)) $(7) + endef + + define Package/$(PKG_NAME)-mod-$(1)/install + [ -z "mod_$(subst -,_,$(1))" ] || $(INSTALL_DIR) $$(1)/usr/lib/$(PKG_NAME) + + for f in $$$$(realpath $$$$(wildcard $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)/mod_$(subst -,_,$(1)).*)) $$$$(wildcard $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)/$(4)_*); \ + do \ + $(CP) $$$$$$$${f} $$(1)/usr/lib/$(PKG_NAME)/; \ + done + + # + # mod_$(subst -,_,$(1)): $(5) + # + $(foreach f,$(5),[ -d $(dir $$(1)/usr/${f}) ] || $(INSTALL_DIR) $(dir $$(1)/usr/${f});$(CP) $$$$(wildcard $(PKG_INSTALL_DIR)/usr/${f}*) $(dir $$(1)/usr/${f});) + + # + # mod_$(subst -,_,$(1)): Clean installed library control files from referencig to OpenWRT PATH. + # + $(STAGING_DIR_HOST)/bin/sed -i -re 's|$(STAGING_DIR)||g;s|$(TOOLCHAIN_DIR)||g;s|$(TARGET_CROSS)|usr|g;s|$(REAL_GNU_TARGET_NAME)|usr|g;s|-L$(PKG_BUILD_DIR)(.*)libzrtp ||g;s|-L$(PKG_BUILD_DIR)(.*)libtiff ||g;:a;s|((-[IL]/\S+\s).*)\2|\1|;ta' $(foreach l,`find $$(1)/usr/lib -name "*.la" -print`,$(l)) + + # + # 1. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/autoload_configs/$(subst -,_,$(1)).conf.xml))) + # + $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/autoload_configs/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/autoload_configs/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(SED) 's|/usr/local/lib|/usr/lib|g;s|/usr/local|/etc|g' $$(1)/etc/$(PKG_NAME)/autoload_configs/$(subst -,_,$(1)).conf.xml) + + # + # 2. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/$(3)/$(1)/*/$(subst -,_,$(1)).conf.xml))) + # + $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/$(3)/$(1)/*/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/$(3)/$(1)/*/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(SED) 's|/usr/local/lib|/usr/lib|g;s|/usr/local|/etc|g' $$(1)/etc/$(PKG_NAME)/autoload_configs/$(subst -,_,$(1)).conf.xml) + + # + # 3. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf/autoload_configs/$(subst -,_,$(1)).conf.xml))) + # + $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf/autoload_configs/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf/autoload_configs/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(SED) 's|/usr/local/lib|/usr/lib|g;s|/usr/local|/etc|g' $$(1)/etc/$(PKG_NAME)/autoload_configs/$(subst -,_,$(1)).conf.xml) + + # + # 4. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf*/$(subst -,_,$(1)).conf.xml))) + # + $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf*/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf*/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(SED) 's|/usr/local/lib|/usr/lib|g;s|/usr/local|/etc|g' $$(1)/etc/$(PKG_NAME)/autoload_configs/$(subst -,_,$(1)).conf.xml) + + # + # 5. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/$(subst -,_,$(1)).conf.xml))) + # + $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(SED) 's|/usr/local/lib|/usr/lib|g;s|/usr/local|/etc|g' $$(1)/etc/$(PKG_NAME)/autoload_configs/$(subst -,_,$(1)).conf.xml) + + # + # 6. Additional configuration files for mod_$(subst -,_,$(1)) from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/$(1)/*.$(1)))) + # + $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/$(1)/*.$(1))),[ -d $$(1)/etc/$(PKG_NAME)/$(1) ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/$(1);$(CP) $(PKG_BUILD_DIR)/conf/$(3)/$(1) $$(1)/etc/$(PKG_NAME)) + endef + + define Package/$(PKG_NAME)-mod-$(1)/postinst +#!/bin/sh +sed -i -e 's|^\([ \t]*\)\(.*\)$$$$|\1\2"mod_$(subst -,_,$(1))"\3\4|' $$$${IPKG_INSTROOT}/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml + endef + + define Package/$(PKG_NAME)-mod-$(1)/prerm +#!/bin/sh +sed -i -e 's|^\([ \t]*\)\(.*\)"mod_$(subst -,_,$(1))"\(.*\)$$$$|\1|' $$$${IPKG_INSTROOT}/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml + endef + + $$(eval $$(call BuildPackage,$(PKG_NAME)-mod-$(1))) +endef + + +$(eval $(call BuildPackage,$(PKG_NAME))) +$(eval $(call BuildPackage,$(PKG_NAME)-collection-upstream-defaults)) +$(eval $(call BuildPackage,$(PKG_NAME)-collection-minimal)) +$(eval $(call BuildPackage,$(PKG_NAME)-sounds-en-08KHz)) +$(eval $(call BuildPackage,$(PKG_NAME)-sounds-en-16KHz)) +$(eval $(call BuildPackage,$(PKG_NAME)-sounds-en-32KHz)) +$(eval $(call BuildPackage,$(PKG_NAME)-sounds-en-48KHz)) +$(eval $(call BuildPackage,$(PKG_NAME)-sounds-moh-08KHz)) +$(eval $(call BuildPackage,$(PKG_NAME)-sounds-moh-16KHz)) +$(eval $(call BuildPackage,$(PKG_NAME)-sounds-moh-32KHz)) +$(eval $(call BuildPackage,$(PKG_NAME)-sounds-moh-48KHz)) +$(eval $(call BuildPackage,$(PKG_NAME)-tools)) +$(eval $(call BuildPackage,$(PKG_NAME)-example-config)) +$(eval $(call BuildPackage,$(PKG_NAME)-config-upstream-defaults)) +$(eval $(call BuildPackage,$(PKG_NAME)-config-minimal)) + + +# +# $(eval $(call BuildPlugin,Name,Title,Selection on module Conf File,Files,Inter Depends,Extra Depends)) +# +$(eval $(call BuildPlugin,abstraction,An Abstraction To API Call,vanilla,,,,)) +$(eval $(call BuildPlugin,alsa,Alsa Endpoint,vanilla,,,,+FS_WITH_ALSA:alsa-lib @FS_WITH_ALSA)) +$(eval $(call BuildPlugin,amr,Adaptive Multi-Rate On Bandwidth Codec,vanilla,,,,)) +$(eval $(call BuildPlugin,amrwb,Wide Band AMR,vanilla,,,,)) +$(eval $(call BuildPlugin,avmd,Advanced Voice Mail Detection,vanilla,,,,)) +$(eval $(call BuildPlugin,basic,BASIC,vanilla,,,,)) +$(eval $(call BuildPlugin,bert,Naive Bit Error Rate Tester,vanilla,,,,)) +$(eval $(call BuildPlugin,blacklist,Blacklist,vanilla,,,,)) +$(eval $(call BuildPlugin,bv,BroadVoice 16/32-bit Audio Codec,vanilla,,,,)) +$(eval $(call BuildPlugin,callcenter,Call Center,vanilla,,,,)) +$(eval $(call BuildPlugin,cdr-csv,CSV-CDR Handler,mod,,,,)) # ~/conf +$(eval $(call BuildPlugin,cdr-mongodb,MongoDB CDR logger,vanilla,,,,)) +$(eval $(call BuildPlugin,cdr-pg-csv,PostgreSQL CDR Handler,vanilla,,,,+coreutils +FS_WITH_POSTGRESQL:libpq @FS_WITH_POSTGRESQL)) +$(eval $(call BuildPlugin,cdr-sqlite,SQLite3 CDR Handler,vanilla,,,,@FS_WITH_SQLITE3)) +$(eval $(call BuildPlugin,celt,CELT Ultra-Low Delay Codec,vanilla,,,,+libogg)) +$(eval $(call BuildPlugin,cepstral,Cepstral Interface,vanilla,,,,@BROKEN)) # needs +$(eval $(call BuildPlugin,cidlookup,Data Query For CID->NAME Services,mod,,,,+libcurl)) # ~/conf +$(eval $(call BuildPlugin,cluechoo,Framework Demo,vanilla,,,,)) +$(eval $(call BuildPlugin,codec2,CoDec 2,,,,,)) +$(eval $(call BuildPlugin,commands,API Commands,vanilla,,,,)) +$(eval $(call BuildPlugin,conference,Conference Room,vanilla,,,,)) +$(eval $(call BuildPlugin,console,Console Logger,vanilla,,,,)) +$(eval $(call BuildPlugin,curl,HTTP Request,vanilla,,,,+libcurl)) +$(eval $(call BuildPlugin,dahdi-codec,DAHDI Codecs,vanilla,,,,)) +$(eval $(call BuildPlugin,db,Database Backend,vanilla,,,,+libdb47)) +$(eval $(call BuildPlugin,dialplan-asterisk,Asterisk Dialplan Parser,vanilla,,,,)) +$(eval $(call BuildPlugin,dialplan-directory,Dialplan Directory,vanilla,,,,)) +$(eval $(call BuildPlugin,dialplan-xml,Dialplan-XML Interface,vanilla,,,,)) +$(eval $(call BuildPlugin,dingaling,Jabber Interface,vanilla,,,,+libopenssl)) +$(eval $(call BuildPlugin,directory,Search By Name Directory IVR,vanilla,,,,)) +$(eval $(call BuildPlugin,distributor,Simple Robin-Round Load,vanilla,,,,)) +$(eval $(call BuildPlugin,dptools,Dialplan Tools,vanilla,,,,)) +$(eval $(call BuildPlugin,easyroute,Simple DID Routing,vanilla,,,,)) +$(eval $(call BuildPlugin,enum,ENUM Routing,,,,,+libldns @BROKEN)) +$(eval $(call BuildPlugin,erlang-event,Erlang Event Handler,vanilla,,,,+erlang)) +$(eval $(call BuildPlugin,esf,Extra SIP Functionality,vanilla,,,,)) +$(eval $(call BuildPlugin,event-multicast,Multicast Event Handler,vanilla,,,,)) +$(eval $(call BuildPlugin,event-socket,Socket Event Handler,vanilla,,,,)) +$(eval $(call BuildPlugin,event-zmq,Socket Event Handler By Zero MQ,vanilla,,,,+libuuid)) +$(eval $(call BuildPlugin,expr,Expression Evaluation,vanilla,,,,)) +$(eval $(call BuildPlugin,fifo,FIFO,vanilla,,,,)) +$(eval $(call BuildPlugin,file-string,Streaming Multiple Sound Files Sequentially,vanilla,,,,@OBSOLETE)) # merged into dptools +$(eval $(call BuildPlugin,flite,Festival TTS,vanilla,,,,@(!(armeb||avr32)||BROKEN))) +$(eval $(call BuildPlugin,format-cdr,XML CDR Module to files or curl,vanilla,,,,)) +$(eval $(call BuildPlugin,fsk,Bell-202 1200-Baud FSK Decoder,vanilla,,,,)) +$(eval $(call BuildPlugin,fsv,Video Player / Recorder,vanilla,,,,)) +$(eval $(call BuildPlugin,g723-1,G.723.1 Codec,vanilla,,,,)) +$(eval $(call BuildPlugin,g729,G.729 Codec,vanilla,,,,)) +$(eval $(call BuildPlugin,gsmopen,GSM Modem compatible Endpoint,mod,,,alsa,+FS_WITH_ALSA:alsa-lib +FS_WITH_LZMA:liblzma @FS_WITH_ALSA @BROKEN)) # needs gsmlib +$(eval $(call BuildPlugin,h26x,H26X Linear Codec,vanilla,,,,)) +$(eval $(call BuildPlugin,h323,H323 Endpoint,mod,,,,@BROKEN)) # Req. H323Plus v1.24.x or newer +$(eval $(call BuildPlugin,hash,API For Manipulating A Hash Table,vanilla,,,,)) +#$(eval $(call BuildPlugin,html5,HTML5 Endpoint Module,vanilla,,,,)) # defunct? +$(eval $(call BuildPlugin,httapi,HT Telephony API and HTTP Caching,mod,,,,)) # ~/conf +$(eval $(call BuildPlugin,http-cache,HTTP GET With Caching,mod,,,,+libcurl)) # ~/conf +$(eval $(call BuildPlugin,ilbc,ILBC Codec,vanilla,,,,)) +$(eval $(call BuildPlugin,isac,iSAC Codec,vanilla,,,,)) +$(eval $(call BuildPlugin,java,Java Language Interface,vanilla,,,,@BROKEN)) # needs java +$(eval $(call BuildPlugin,json-cdr,JSon-CDR Interface,mod,,,,+libcurl)) +$(eval $(call BuildPlugin,ldap,LDAP interface,vanilla,,,,+libopenldap)) +$(eval $(call BuildPlugin,lcr,Least Cost Routing,vanilla,,,,)) +$(eval $(call BuildPlugin,local-stream,Multi-Channel On Same Stream,vanilla,,,,)) +$(eval $(call BuildPlugin,logfile,File Logger,vanilla,,,,)) +$(eval $(call BuildPlugin,loopback,Loopback to Dialplan Endpoint,vanilla,,,,)) +$(eval $(call BuildPlugin,lua,LUA Language Interface,vanilla,,,,)) +$(eval $(call BuildPlugin,managed,Media Switching Software Library,vanilla,,,,+glib2 @BROKEN)) # needs Mono +$(eval $(call BuildPlugin,memcache,MemCached Interface,vanilla,,,,+libmemcached @BROKEN)) # Req host libmemcached +$(eval $(call BuildPlugin,mongo,A Document-Oriented Database,vanilla,,,,@BROKEN)) +$(eval $(call BuildPlugin,mp4,MP4 File Format Support For Video,vanilla,,,,@BROKEN)) # needs host libmp4v2 +$(eval $(call BuildPlugin,mp4v,MP4 CoDec Support For Video,vanilla,,,,)) +$(eval $(call BuildPlugin,native-file,WAV Format Sound Player,vanilla,,,,)) +$(eval $(call BuildPlugin,nibblebill,Credit / Debit Billing,vanilla,,,,)) +$(eval $(call BuildPlugin,opus,Opus CoDec,vanilla,,,,)) +$(eval $(call BuildPlugin,oreka,Media Recording with Oreka,vanilla,,,,)) +$(eval $(call BuildPlugin,perl,Perl Language Interface,vanilla,,lib/perl5/5.20/$(PKG_NAME).la lib/perl5/5.20/$(PKG_NAME).pm lib/perl5/5.20/$(PKG_NAME).so,,+perl +libdb47 +libgdbm)) +$(eval $(call BuildPlugin,portaudio,Portaudio To Sound Card Interface,vanilla,,,alsa,+FS_WITH_ALSA:alsa-lib @FS_WITH_ALSA @BROKEN)) # needs portaudio +$(eval $(call BuildPlugin,portaudio-stream,Portaudio Streaming Interface,vanilla,,,alsa,+FS_WITH_ALSA:alsa-lib @FS_WITH_ALSA @BROKEN)) # needs portaudio +$(eval $(call BuildPlugin,posix-timer,POSIX Compliant Soft Timer,vanilla,,,,)) +$(eval $(call BuildPlugin,python,Python Language Interface,vanilla,,,,python @BROKEN)) +$(eval $(call BuildPlugin,radius-cdr,Radius-CDR interface,vanilla,,,,@BROKEN)) # fails in freeradius-client +$(eval $(call BuildPlugin,rayo,Rayo server & node implementation,vanilla,,,,)) +$(eval $(call BuildPlugin,redis,Redis Limited Backend,vanilla,,,,)) +$(eval $(call BuildPlugin,rss,RRS Feeds via TTS,vanilla,,,,)) +$(eval $(call BuildPlugin,rtc,RTC endpoint,vanilla,,,,)) +$(eval $(call BuildPlugin,rtmp,RTMP Protocol Handler,vanilla,,,,)) +$(eval $(call BuildPlugin,sangoma-codec,Sangoma Codec,vanilla,,,,@BROKEN)) # Req. Sangoma CoDec source +$(eval $(call BuildPlugin,say-de,German Say,vanilla,,,,)) +$(eval $(call BuildPlugin,say-en,English Say,vanilla,,,,)) +$(eval $(call BuildPlugin,say-es,Spanish Say,vanilla,,,,)) +$(eval $(call BuildPlugin,say-fa,Persian Say,vanilla,,,,)) +$(eval $(call BuildPlugin,say-fr,French Say,vanilla,,,,)) +$(eval $(call BuildPlugin,say-hu,Hungarian Say,vanilla,,,,)) +$(eval $(call BuildPlugin,say-it,Italian Say,vanilla,,,,)) +$(eval $(call BuildPlugin,say-nl,Dutch Say,vanilla,,,,)) +$(eval $(call BuildPlugin,say-pt,Portugeese Say,vanilla,,,,)) +$(eval $(call BuildPlugin,say-ru,Russian Say,vanilla,,,,)) +$(eval $(call BuildPlugin,say-th,Thai Say,vanilla,,,,)) +$(eval $(call BuildPlugin,say-zh,Chineese Say,vanilla,,,,)) +$(eval $(call BuildPlugin,shell-stream,Streaming Audio Through CLI,vanilla,,,,)) +$(eval $(call BuildPlugin,silk,Skype(TM) SILK Codec Module,vanilla,,,,)) +$(eval $(call BuildPlugin,siren,G.722.1 Codec,vanilla,,,,)) +$(eval $(call BuildPlugin,skel,Template For New Module,vanilla,,,,)) +$(eval $(call BuildPlugin,skinny,Skinny Call Control Protocol (SCCP),vanilla,,,,)) +$(eval $(call BuildPlugin,skypopen,Skype Compatible Endpoint,mod,,,,@FEATURE_drawing-backend_libX11)) +$(eval $(call BuildPlugin,sms,SMS,vanilla,,,,)) +$(eval $(call BuildPlugin,snapshot,Record Audio Snapshot to File,vanilla,,,,)) +$(eval $(call BuildPlugin,sndfile,Multi-Format Sound File,vanilla,,,,)) +$(eval $(call BuildPlugin,snipe-hunt,Snipe Hunt (Simple Example Module),vanilla,,,,)) +$(eval $(call BuildPlugin,snmp,SNMP AgentX Subagent,vanilla,,,,+libnetsnmp)) +$(eval $(call BuildPlugin,snom,SNOM specific features,vanilla,,,,)) +$(eval $(call BuildPlugin,sofia,SOFIA SIP,mod,,,,)) # ~/conf +$(eval $(call BuildPlugin,sonar,Sonar Ping Timer,vanilla,,,,)) +$(eval $(call BuildPlugin,spandsp,Span DSP,mod,,,,+libjpeg +FS_WITH_LZMA:liblzma @FS_WITH_LZMA)) # ~/conf +$(eval $(call BuildPlugin,spidermonkey,JavaScript,vanilla,,,,@BROKEN)) # fails in js +$(eval $(call BuildPlugin,spidermonkey-core_db,JavaScript DB,vanilla,,,,@BROKEN)) +$(eval $(call BuildPlugin,spidermonkey-curl,JavaScript Curl,vanilla,,,,@BROKEN)) +$(eval $(call BuildPlugin,spidermonkey-odbc,JavaScript ODBC,vanilla,,,,@BROKEN)) +$(eval $(call BuildPlugin,spidermonkey-socket,JavaScript Socket,vanilla,,,,@BROKEN)) +$(eval $(call BuildPlugin,spidermonkey-teletone,JavaScript Teletone,vanilla,,,,@BROKEN)) +$(eval $(call BuildPlugin,spy,User Spy,vanilla,,,,)) +$(eval $(call BuildPlugin,ssml,SSML audio rendering format,mod,,,rayo,)) +$(eval $(call BuildPlugin,stress,Voice Stress Detection,vanilla,,,,)) +$(eval $(call BuildPlugin,syslog,SysLog logger,vanilla,,,,)) +$(eval $(call BuildPlugin,timerfd,Linux Kernel timerfd API,vanilla,,,,)) +$(eval $(call BuildPlugin,tone-stream,Tone Generation Stream,vanilla,,,,)) +$(eval $(call BuildPlugin,tts-commandline,ASR TTS Command Interface,vanilla,,,,)) +$(eval $(call BuildPlugin,unimrcp,UniMRCP (MRCP Client),vanilla,,,,@BROKEN)) +$(eval $(call BuildPlugin,valet-parking,Valet Parking Application,vanilla,,,,)) +$(eval $(call BuildPlugin,verto,HTML5 Verto interface,vanilla,,lib/perl5/5.20/MCAST.so lib/perl5/5.20/MCAST.la lib/perl5/5.20/MCAST.pm,perl rtc,)) +$(eval $(call BuildPlugin,vmd,VoiceMail Beep Detection,vanilla,,,,)) +$(eval $(call BuildPlugin,voicemail,VoiceMail,vanilla,,,,)) +$(eval $(call BuildPlugin,voicemail-ivr,VoiceMail IVR,vanilla,,,,)) +$(eval $(call BuildPlugin,vp8,VP8 Video Codec,vanilla,,,,)) +$(eval $(call BuildPlugin,xml-cdr,XML-CDR Handler,vanilla,,,,+libcurl)) +$(eval $(call BuildPlugin,xml-curl,XML-Curl Gateway,vanilla,,,,+libcurl)) +$(eval $(call BuildPlugin,xml-ldap,LDAP-XML Gateway,vanilla,,,,+PACKAGE_$(PKG_NAME)-mod-ldap:libopenldap)) +$(eval $(call BuildPlugin,xml-rpc,XML-RPC Interface,vanilla,,,,)) +$(eval $(call BuildPlugin,xml-radius,Radius authentication and authorization,vanilla,,,,+freeradius-client @BROKEN)) # freeradius-client isn't yet supported by OpenWRT. +$(eval $(call BuildPlugin,xml-scgi,SCGI XML Gateway,vanilla,,,,)) +$(eval $(call BuildPlugin,yaml,YAML language,vanilla,,,,+libyaml @BROKEN)) diff --git a/net/freeswitch/files/freeswitch.config b/net/freeswitch/files/freeswitch.config new file mode 100644 index 00000000000..9b4ab8499a8 --- /dev/null +++ b/net/freeswitch/files/freeswitch.config @@ -0,0 +1,11 @@ + +config 'global' 'state' + option 'started' '0' + +config 'profile_top' 'internal_top' + +config 'profile_top' 'external_top' + +config 'external_gateway' 'external_example' + + diff --git a/net/freeswitch/files/freeswitch.default b/net/freeswitch/files/freeswitch.default new file mode 100644 index 00000000000..079c314a72f --- /dev/null +++ b/net/freeswitch/files/freeswitch.default @@ -0,0 +1,11 @@ +#FS_DIR="/opt" +FS_DIR_ETC="$FS_DIR/etc/freeswitch" +FS_DIR_MOD="$FS_DIR/usr/lib/freeswitch" +FS_DIR_DB="$FS_DIR/tmp/freeswitch/db" +FS_DIR_LOG="$FS_DIR/tmp/freeswitch/log" +FS_DIR_SCRIPTS="$FS_DIR/usr/share/freeswitch/scripts" +FS_DIR_HTDOCS="$FS_DIR/usr/share/freeswitch/htdocs" +FS_DIR_RECORDINGS="/var/lib/freeswitch/recordings" # NOTE: must be changed in config as well +FS_DIR_VM_STORAGE="/var/lib/freeswitch/storage" # NOTE: must be changed in config as well + +OPTIONS="-conf $FS_DIR_ETC -log $FS_DIR_LOG -db $FS_DIR_DB -mod $FS_DIR_MOD -htdocs $FS_DIR_HTDOCS -scripts $FS_DIR_SCRIPTS" diff --git a/net/freeswitch/files/freeswitch.hotplug b/net/freeswitch/files/freeswitch.hotplug new file mode 100644 index 00000000000..ef9656cfb2c --- /dev/null +++ b/net/freeswitch/files/freeswitch.hotplug @@ -0,0 +1,65 @@ +#!/bin/sh + +. /lib/functions.sh +LOAD_STATE=1 + +if [ "$ACTION" = "ifup" ]; then + /etc/init.d/freeswitch enabled && { + local not_all_up="$(sh -c ' + . /lib/functions.sh + + LOAD_STATE=1 + local if_is_down=0 + local network_ignore="" + + check_if_down () { + local cfg="$1" + local up + local proto + config_get_bool up "$1" up 0 + config_get proto "$1" proto + if [ "$proto" != "none" ] && [ "$up" -ne 1 ]; then + local new_down=1 + local oIFS="$IFS" + local ignore + IFS=" " + for ignore in $network_ignore; do + [ "$cfg" = "$ignore" ] && new_down=0 + done + IFS="$oIFS" + [ "$new_down" = "1" ] && if_is_down=1 + fi + } + + append_ignore() { + local cfg="$1" + local network + config_get network "$1" network + append network_ignore "$network" + } + + LOAD_STATE=1 + config_load freeswitch + config_foreach append_ignore network_ignore + config_load network + config_foreach check_if_down interface + + echo "$if_is_down" + ')" + [ "$not_all_up" = "0" ] && { + local started + { + mkdir -p /tmp/freeswitch + lock /tmp/freeswitch/.start.lck + config_load freeswitch + config_get started "state" started + [ "$started" != "1" ] && { + /etc/init.d/freeswitch start + uci_set_state freeswitch global state started 1 + } + lock -u /tmp/freeswitch/.start.lck + } & + } + } +fi + diff --git a/net/freeswitch/files/freeswitch.init b/net/freeswitch/files/freeswitch.init new file mode 100644 index 00000000000..9329cfeae84 --- /dev/null +++ b/net/freeswitch/files/freeswitch.init @@ -0,0 +1,40 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=90 + +DEFAULT=/etc/default/freeswitch +OPTIONS="" + +#boot() { +# # Do nothing on boot +# exit 0 +#} + +start() { + [ -f $DEFAULT ] && . $DEFAULT + mkdir -p $FS_DIR_DB + mkdir -p $FS_DIR_LOG + mkdir -p $FS_DIR_RECORDINGS + mkdir -p $FS_DIR_VM_STORAGE + ulimit -s 240 + $FS_DIR/usr/bin/freeswitch $OPTIONS -nc +} + +stop() { + [ -f $DEFAULT ] && . $DEFAULT + $FS_DIR/usr/bin/freeswitch $OPTIONS -stop +} + +restart() { + # stopping freeswitch is non-blocking, so we wait until freeswitch's + # event socket is down, and then wait an additional ten seconds so that + # freeswitch should be completely shutdown before we start it again + local retval + stop + fs_cli -x status >/dev/null 2>&1 + retval=$? + while [ $retval -eq 0 ]; do sleep 1; fs_cli -x status >/dev/null 2>&1; retval=$?; done + sleep 10 + start +} + diff --git a/net/freeswitch/patches/0000000-build-openwrt_rules.mk.patch b/net/freeswitch/patches/0000000-build-openwrt_rules.mk.patch new file mode 100644 index 00000000000..31fb16fdccd --- /dev/null +++ b/net/freeswitch/patches/0000000-build-openwrt_rules.mk.patch @@ -0,0 +1,10 @@ +--- /dev/null ++++ b/build/openwrt_rules.mk +@@ -0,0 +1,7 @@ ++OPENWRT_DIR=$(shell (cd $(BASE)/../../..;pwd)) ++STAGING_PREFIX=$(OPENWRT_DIR)/staging_dir/host ++STAGING_DIR=$(OPENWRT_DIR)/staging_dir/$(shell (cd $(BASE)/..;basename `pwd`)) ++ARCH="$(shell grep CONFIG_ARCH $(OPENWRT_DIR)/.config|cut -d= -d'"' -f2)" ++GNU_TARGET_NAME=$(ARCH)-openwrt-linux ++ ++include $(OPENWRT_DIR)/rules.mk diff --git a/net/freeswitch/patches/0000001-build-modules_conf_in.patch b/net/freeswitch/patches/0000001-build-modules_conf_in.patch new file mode 100644 index 00000000000..26aad5b9d84 --- /dev/null +++ b/net/freeswitch/patches/0000001-build-modules_conf_in.patch @@ -0,0 +1,10 @@ +--- a/build/modules.conf.in ++++ b/build/modules.conf.in +@@ -35,6 +35,7 @@ applications/mod_httapi + #applications/mod_rad_auth + #applications/mod_redis + #applications/mod_rss ++#applications/mod_skel + #applications/mod_sonar + applications/mod_sms + #applications/mod_snapshot diff --git a/net/freeswitch/patches/0000002-build-config-erlang_m4.patch b/net/freeswitch/patches/0000002-build-config-erlang_m4.patch new file mode 100644 index 00000000000..ebf79b7b983 --- /dev/null +++ b/net/freeswitch/patches/0000002-build-config-erlang_m4.patch @@ -0,0 +1,97 @@ +--- a/build/config/erlang.m4 ++++ b/build/config/erlang.m4 +@@ -1,6 +1,6 @@ + AC_DEFUN([CHECK_ERLANG], [ + # +-# Erlang checks for mod_erlang_event ++# Erlang check + # + AC_ARG_WITH( + [erlang], +@@ -19,22 +19,23 @@ then + if test ! -x "$with_erlang" ; then + AC_MSG_ERROR([Specified erlang does not exist or is not executable: $with_erlang]) + fi +- AC_MSG_RESULT([$with_erlang]) +- AC_SUBST([ERLANG], ["$with_erlang"]) ++ AC_MSG_RESULT(["$with_erlang/bin/erl"]) ++ AC_SUBST([ERL],["$with_erlang/bin/erl"]) + else +- AC_PATH_PROG([ERLANG], ["erl"], ["no"], ["$PATH:/usr/bin:/usr/local/bin"]) ++ AC_ERLANG_NEED_ERL(["$with_erlang/bin"]) + fi + +- if test "$ERLANG" != "no" ; then ++ if test "$ERL" != "no" ; then + AC_MSG_CHECKING([erlang version]) +- ERLANG_VER="`$ERLANG -version 2>&1 | cut -d' ' -f6`" ++ ERLANG_VER="`$ERL -version 2>&1 | cut -d' ' -f6`" + + if test -z "$ERLANG_VER" ; then + AC_MSG_ERROR([Unable to detect erlang version]) ++ else ++ AC_MSG_RESULT([$ERLANG_VER]) + fi +- AC_MSG_RESULT([$ERLANG_VER]) + +- ERLANG_LIBDIR=`$ERLANG -noshell -eval 'io:format("~n~s/lib~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1` ++ ERLANG_LIBDIR=`$ERL -noshell -eval 'io:format("~n~s/lib~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1` + AC_MSG_CHECKING([erlang libdir]) + if test -z "`echo $ERLANG_LIBDIR`" ; then + AC_MSG_ERROR([failed]) +@@ -42,9 +43,16 @@ then + ERLANG_LDFLAGS="-L$ERLANG_LIBDIR $ERLANG_LDFLAGS" + LIBS="-L$ERLANG_LIBDIR $LIBS" + fi ++ ++ # ++ # Don't use the above ERLANG_LDFLAGS ++ # ++ ERLANG_LIBDIR="${STAGING_DIR}/usr/lib" ++ ERLANG_LDFLAGS="-L$ERLANG_LIBDIR" ++ LIBS="-L$ERLANG_LIBDIR $LIBS" + AC_MSG_RESULT([$ERLANG_LIBDIR]) + +- ERLANG_INCDIR=`$ERLANG -noshell -eval 'io:format("~n~s/include~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1` ++ ERLANG_INCDIR=`$ERL -noshell -eval 'io:format("~n~s/include~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1` + AC_MSG_CHECKING([erlang incdir]) + if test -z "`echo $ERLANG_INCDIR`" ; then + AC_MSG_ERROR([failed]) +@@ -58,10 +66,11 @@ then + + ERLANG_LIB="ei" + +- # check liei ++ # check libei + AC_CHECK_LIB([$ERLANG_LIB], [ei_encode_version], [has_libei="yes"], [has_libei="no"]) + # maybe someday ei will actually expose this? +- AC_CHECK_LIB([$ERLANG_LIB], [ei_link_unlink], [ERLANG_CFLAGS="$ERLANG_CFLAGS -DEI_LINK_UNLINK"]) ++ # until then, we comment it out ++ #AC_CHECK_LIB([$ERLANG_LIB], [ei_link_unlink], [ERLANG_CFLAGS="$ERLANG_CFLAGS -DEI_LINK_UNLINK"]) + + if test "$has_libei" = "no" ; then + AS_IF([test "$with_erlang" = "try"], +@@ -75,7 +84,7 @@ then + ) + else + ERLANG_LDFLAGS="$ERLANG_LDFLAGS -lei" +- AC_MSG_NOTICE([Your erlang seems OK, do not forget to enable mod_erlang_event in modules.conf]) ++ AC_MSG_NOTICE([Your erlang seems OK. You can now use ErLang in your codes.]) + AC_SUBST([ERLANG_CFLAGS], [$ERLANG_CFLAGS]) + AC_SUBST([ERLANG_LDFLAGS], [$ERLANG_LDFLAGS]) + fi +@@ -85,12 +94,12 @@ then + + else + AS_IF([test "$with_erlang" = "try"], +- [AC_MSG_WARN([Could not find erlang, mod_erlang_event will not build, use --with-erlang to specify the location])], ++ [AC_MSG_WARN([Could not find erlang, codes depend on erlang will not build, use --with-erlang to specify the location])], + [AC_MSG_ERROR([Could not find erlang, use --with-erlang to specify the location])] + ) + fi + else +- AC_MSG_WARN([erlang support disabled, building mod_erlang_event will fail!]) ++ AC_MSG_WARN([erlang support disabled!]) + fi + + ]) diff --git a/net/freeswitch/patches/0000010-configure_ac.patch b/net/freeswitch/patches/0000010-configure_ac.patch new file mode 100644 index 00000000000..2bc11fa0ede --- /dev/null +++ b/net/freeswitch/patches/0000010-configure_ac.patch @@ -0,0 +1,160 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -229,13 +229,16 @@ AX_COMPILER_VENDOR + if test "x${cross_compiling}" = "xyes"; then + CC_FOR_BUILD=${CC_FOR_BUILD-gcc} + case "$host" in +- arm*-linux-gnueabi*|arm*-*-linux-gnueabi*) ++ arm*-linux-gnueabi*|arm*-*-linux-*) + # spandsp modem + ac_cv_file__dev_ptmx=yes + # libjs + export ac_cv_va_copy=yes ++ # sofia-sip ++ export ac_cv_dev_urandom=yes + # srtp + export ac_cv_file__dev_urandom=yes ++ export ac_cv_file___dev_urandom_=yes + # rpl_malloc + export ac_cv_func_realloc_0_nonnull=yes + export ac_cv_func_malloc_0_nonnull=yes +@@ -248,7 +251,7 @@ if test "x${cross_compiling}" = "xyes"; + export apr_cv_mutex_recursive=yes + export ac_cv_func_pthread_rwlock_init=yes + export apr_cv_type_rwlock_t=yes +- export apr_cv_process_shared_works=yes ++ export apr_cv_process_shared_works=no + export apr_cv_mutex_robust_shared=yes + ;; + esac +@@ -378,9 +381,6 @@ elif test "x${ax_cv_c_compiler_vendor}" + elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then + APR_ADDTO(SWITCH_AM_CFLAGS, -fPIC) + APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC) +- if test "$ac_cv_gcc_supports_w_no_unused_result" = yes; then +- APR_ADDTO(SWITCH_AM_CFLAGS, -Werror) +- fi + if test "${enable_64}" = "yes"; then + case "$host" in + *darwin12.*|*darwin11.*|*darwin10.*|*darwin9.*|*darwin8.*) +@@ -839,7 +839,6 @@ AC_CHECK_LIB(pthread, pthread_setschedpa + + AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket)) + +-AC_CHECK_FILE(/dev/ptmx, [AC_DEFINE(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx])]) + AC_CHECK_LIB(util, openpty, [AC_DEFINE(HAVE_OPENPTY, 1, [Define if you have openpty()])]) + + AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[ +@@ -1163,14 +1162,14 @@ case $host in + ;; + esac + +-if ! (test -x "$PKG_CONFIG" || test -x "$(which pkg-config)"); then +- AC_MSG_ERROR([You need to install pkg-config to configure FreeSWITCH.]) ++if ! test -x "${STAGING_DIR}/../host/bin/pkg-config"; then ++ AC_MSG_ERROR([Missing tools/pkg-config package needed to configure FreeSWITCH.]) + fi + +-# temporary workaround for Debian libldns-dev package bug +-if test "$cross_compiling" != "yes" && test -f /usr/lib/pkg-config/libldns.pc; then +- path_push_unique PKG_CONFIG_PATH /usr/lib/pkg-config +-fi ++# ++# Workaround for OpenWRT pkg-config ++# ++path_push_unique PKG_CONFIG_PATH ${STAGING_DIR}/usr/lib/pkg-config + + module_enabled() { + grep -v -e "\#" -e "^\$" modules.conf | sed -e "s|^.*/||" | grep "^${1}\$" >/dev/null +@@ -1191,7 +1190,7 @@ PKG_CHECK_MODULES([LDNS], [libldns >= 1. + AC_CHECK_LIB([ldns], [ldns_str2rdf_a], [LDNS_LIBS=-lldns]) + AS_IF([test -z "$LDNS_LIBS"],[ + if module_enabled mod_enum; then +- AC_MSG_ERROR([You need to either install libldns-dev or disable mod_enum in modules.conf]) ++ AC_MSG_ERROR([You need to either install libldns or disable mod_enum in modules.conf]) + else + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_LDNS],[false]) + fi],[ +@@ -1269,18 +1268,18 @@ AM_CONDITIONAL([HAVE_MYSQL],[test "$foun + # perl checks + # + +-AC_CHECK_PROG(PERL,perl,[ac_cv_have_perl=yes],[ac_cv_have_perl=no]) +- +-# -a "x$ac_cv_have_EXTERN_h" != "xno" ++AC_CHECK_PROG([PERL],[perl],[ac_cv_have_perl=yes],[ac_cv_have_perl=no],[${STAGING_DIR}/../host/usr/bin]) ++PERL=$as_dir/$ac_word$ac_exec_ext + + if test "x$ac_cv_have_perl" != "xno"; then +- PERL=perl +- PERL_SITEDIR="`$PERL -MConfig -e 'print $Config{archlib}'`" +- PERL_LIBDIR="-L`$PERL -MConfig -e 'print $Config{archlib}'`/CORE" +- PERL_LIBS="`$PERL -MConfig -e 'print $Config{libs}'`" +- PERL_CFLAGS="-w -DMULTIPLICITY `$PERL -MExtUtils::Embed -e ccopts | sed -e 's|-arch x86_64 -arch i386||'` -DEMBED_PERL" +- PERL_LDFLAGS="`$PERL -MExtUtils::Embed -e ldopts| sed -e 's|-arch x86_64 -arch i386||'`" +- PERL_INC="`$PERL -MExtUtils::Embed -e perl_inc`" ++ PERL_SITELIB="/usr/lib/perl5/5.20" ++ PERL_SITEDIR="${STAGING_DIR}${PERL_SITELIB}" ++ PERL_COREDIR="${PERL_SITEDIR}/CORE" ++ PERL_INC="-I${PERL_COREDIR}" ++ PERL_CFLAGS="-w -DMULTIPLICITY -fwrapv -fno-strict-aliasing -pipe -fstack-protector ${PERL_INC} -DEMBED_PERL" ++ PERL_LIBDIR="-L${PERL_COREDIR}" ++ PERL_LIBS="-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc " ++ PERL_LDFLAGS="${LDFLAGS} -lpthread ${PERL_LIBS}" + + save_CFLAGS="$CFLAGS" + CFLAGS="$PERL_CFLAGS" +@@ -1293,12 +1292,15 @@ if test "x$ac_cv_have_perl" != "xno"; th + AC_CHECK_LIB([perl], [perl_alloc], ac_cv_use_libperl=yes, ac_cv_use_libperl=no) + LDFLAGS="$save_LDFLAGS" + +- AC_SUBST(PERL_SITEDIR) +- AC_SUBST(PERL_LIBDIR) +- AC_SUBST(PERL_LIBS) ++ AC_SUBST(PERL) + AC_SUBST(PERL_CFLAGS) +- AC_SUBST(PERL_LDFLAGS) ++ AC_SUBST(PERL_COREDIR) + AC_SUBST(PERL_INC) ++ AC_SUBST(PERL_LDFLAGS) ++ AC_SUBST(PERL_LIBDIR) ++ AC_SUBST(PERL_LIBS) ++ AC_SUBST(PERL_SITEDIR) ++ AC_SUBST(PERL_SITELIB) + fi + + AM_CONDITIONAL([HAVE_PERL],[test "x$ac_cv_have_perl" != "xno" -a "x$ac_cv_have_EXTERN_h" != "xno" -a "x$ac_cv_use_libperl" != "xno"]) +@@ -1307,17 +1309,19 @@ AM_CONDITIONAL([HAVE_PERL],[test "x$ac_c + # php checks + # + +-AC_CHECK_PROG(PHP,php,[ac_cv_have_php=yes],[ac_cv_have_php=no]) +-AC_CHECK_PROG(PHP_CONFIG,php-config,[ac_cv_have_php_config=yes],[ac_cv_have_php_config=no]) ++AC_CHECK_PROG([PHP],[php],[ac_cv_have_php=yes],[ac_cv_have_php=no],[${STAGING_DIR}/../host/usr/bin:/usr/bin]) ++PHP=$as_dir/$ac_word$ac_exec_ext ++ ++AC_CHECK_PROG([PHP_CONFIG],[php-config],[ac_cv_have_php_config=yes],[ac_cv_have_php_config=no],[${STAGING_DIR}/../host/usr/bin]) ++PHP_CONFIG=$as_dir/$ac_word$ac_exec_ext ++ + AM_CONDITIONAL([HAVE_PHP],[test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"]) + + if test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"; then +- PHP=php +- PHP_CONFIG=php-config + PHP_LDFLAGS="`$PHP_CONFIG --ldflags`" +- PHP_LIBS="`$PHP_CONFIG --libs | sed -r 's/ ?-l(bz2|pcre|xml2|gssapi_krb5|krb5|k5crypto|com_err|history|z|readline|gmp|ssl|crypto)//g'`" ++ PHP_LIBS="`$PHP_CONFIG --libs | sed -r 's/ ?-l(bz2|pcre|xml2|gssapi_krb5|krb5|k5crypto|com_err|history|z|readline|gmp|ssl|crypt(o|))//g;s/^/-lcrypto/g'`" + PHP_EXT_DIR="`$PHP_CONFIG --extension-dir`" +- PHP_INC_DIR="`$PHP -r 'echo ini_get("include_path");' | cut -d: -f2`" ++ PHP_INC_DIR="`$PHP_CONFIG --include-dir`" + PHP_INI_DIR="`$PHP_CONFIG --configure-options | tr " " "\n" | grep -- --with-config-file-scan-dir | cut -f2 -d=`" + PHP_CFLAGS="`$PHP_CONFIG --includes`" + AC_SUBST(PHP_LDFLAGS) +@@ -1425,6 +1429,7 @@ then + AC_MSG_NOTICE([Your python seems OK, do not forget to enable mod_python in modules.conf]) + AC_SUBST([PYTHON_CFLAGS], [$PYTHON_CFLAGS]) + AC_SUBST([PYTHON_LDFLAGS], [$PYTHON_LDFLAGS]) ++ AC_SUBST([PYTHON_LIB], [$PYTHON_LIB]) + fi + else + AS_IF([test "$with_python" = "try"], diff --git a/net/freeswitch/patches/0000011-Makefile.am.patch b/net/freeswitch/patches/0000011-Makefile.am.patch new file mode 100644 index 00000000000..7814d85da71 --- /dev/null +++ b/net/freeswitch/patches/0000011-Makefile.am.patch @@ -0,0 +1,57 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,3 +1,7 @@ ++BASE=. ++ ++include $(BASE)/build/openwrt_rules.mk ++ + EXTRA_DIST = + SUBDIRS = . src build + AUTOMAKE_OPTIONS = foreign subdir-objects +@@ -172,7 +176,6 @@ ZRTP_LIBS = -lbn -lzrtp + libfreeswitch_la_LDFLAGS += $(ZRTP_LDFLAGS) + libfreeswitch_la_LIBADD += $(ZRTP_LIBS) + CORE_LIBS += libs/libzrtp/libzrtp.a +-LIBS += libs/libzrtp/third_party/bnlib/libbn.a + endif + + library_includedir = $(includedir) +@@ -311,7 +314,7 @@ endif + $(libfreeswitch_la_SOURCES): $(CORE_LIBS) $(switch_builddir)/modules.conf + + src/include/switch_swigable_cpp.h: $(switch_srcdir)/src/include/switch_cpp.h +- cat $(switch_srcdir)/src/include/switch_cpp.h | perl $(switch_srcdir)/build/strip.pl > $(switch_srcdir)/src/include/switch_swigable_cpp.h ++ cat $(switch_srcdir)/src/include/switch_cpp.h | $(STAGING_DIR)/../host/usr/bin/perl $(switch_srcdir)/build/strip.pl > $(switch_srcdir)/src/include/switch_swigable_cpp.h + # $(CC) -E $(switch_srcdir)/src/include/switch_cpp.h \ + # -I$(switch_srcdir)/src/include -I$(switch_srcdir)/libs/libteletone/src \ + # -DSWITCH_DECLARE_CLASS= -DSWITCH_DECLARE\(x\)=x -DSWITCH_DECLARE_CONSTRUCTOR= \ +@@ -374,7 +377,7 @@ fs_ivrd_LDFLAGS = $(AM_LDFLAGS) -lpthrea + nodist_freeswitch_SOURCES = src/include/switch_version.h + freeswitch_SOURCES = src/switch.c + freeswitch_CFLAGS = $(AM_CFLAGS) $(CORE_CFLAGS) +-freeswitch_LDFLAGS = $(AM_LDFLAGS) -lpthread -rpath $(libdir) ++freeswitch_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS) $(LIBS) -lpthread + freeswitch_LDADD = libfreeswitch.la libs/apr/libapr-1.la + + if HAVE_ODBC +@@ -633,7 +636,9 @@ sndfile-reconf: + + tiff-reconf: + cd libs/tiff-4.0.2 && autoreconf -fi +- cd libs/tiff-4.0.2 && sh ./configure.gnu $(MY_DEFAULT_ARGS) ++ cd libs/tiff-4.0.2 && sh ./configure.gnu $(MY_DEFAULT_ARGS) --host="$(GNU_TARGET_NAME)" --prefix="/usr" ++ cd libs/spandsp && autoreconf -fi ++ cd libs/spandsp && sh ./configure.gnu $(MY_DEFAULT_ARGS) --host="$(GNU_TARGET_NAME)" --prefix="/usr" + cd libs/tiff-4.0.2 && make + + python-reconf: +@@ -653,9 +658,6 @@ iks-reconf: + $(MAKE) mod_dingaling-clean + + spandsp-reconf: tiff-reconf +- cd libs/spandsp && $(MAKE) clean || echo +- cd libs/spandsp && autoreconf -fi +- cd libs/spandsp && sh ./configure.gnu $(MY_DEFAULT_ARGS) + cd libs/spandsp && $(MAKE) + + sofia-reconf: diff --git a/net/freeswitch/patches/1114000-libs-libcodec2-src-Makefile_am.patch b/net/freeswitch/patches/1114000-libs-libcodec2-src-Makefile_am.patch new file mode 100644 index 00000000000..cb7e3a63fc9 --- /dev/null +++ b/net/freeswitch/patches/1114000-libs-libcodec2-src-Makefile_am.patch @@ -0,0 +1,15 @@ +--- a/libs/libcodec2/src/Makefile.am ++++ b/libs/libcodec2/src/Makefile.am +@@ -88,6 +88,12 @@ codebookge.$(OBJEXT): codebookge.c + + codebook.lo: codebook.c + ++generate_codebook: ++ $(CC_FOR_BUILD) -o generate_codebook generate_codebook.c -lm ++ ++genlspdtcb: ++ $(CC_FOR_BUILD) -o genlspdtcb genlspdtcb.c -lm ++ + codebook.c: generate_codebook $(CODEBOOKS) + ./generate_codebook lsp_cb $(CODEBOOKS) > codebook.c + diff --git a/net/freeswitch/patches/1122000-libs-libzrtp-include-zrtp_config.patch b/net/freeswitch/patches/1122000-libs-libzrtp-include-zrtp_config.patch new file mode 100644 index 00000000000..04638852c6f --- /dev/null +++ b/net/freeswitch/patches/1122000-libs-libzrtp-include-zrtp_config.patch @@ -0,0 +1,20 @@ +--- a/libs/libzrtp/include/zrtp_config.h ++++ b/libs/libzrtp/include/zrtp_config.h +@@ -68,8 +68,16 @@ + * If the byte order is not specified manually in zrtp_config_user.h - try to detect it automatically + */ + #if !defined(ZRTP_BYTE_ORDER) ++#if defined(linux) || defined(__linux) + +-#if defined(_i386_) || defined(i_386_) || defined(_X86_) || defined(x86) || defined(__i386__) || \ ++#include ++#if __BYTE_ORDER == __LITTLE_ENDIAN ++#define ZRTP_BYTE_ORDER ZBO_LITTLE_ENDIAN ++#elif __BYTE_ORDER == __BIG_ENDIAN ++#define ZRTP_BYTE_ORDER ZBO_BIG_ENDIAN ++#endif ++ ++#elif defined(_i386_) || defined(i_386_) || defined(_X86_) || defined(x86) || defined(__i386__) || \ + defined(__i386) || defined(_M_IX86) || defined(__I86__) + /* + * Generic i386 processor family, little-endian diff --git a/net/freeswitch/patches/1128080-libs-sofia-sip-configure_gnu.patch b/net/freeswitch/patches/1128080-libs-sofia-sip-configure_gnu.patch new file mode 100644 index 00000000000..73b61728184 --- /dev/null +++ b/net/freeswitch/patches/1128080-libs-sofia-sip-configure_gnu.patch @@ -0,0 +1,8 @@ +--- a/libs/sofia-sip/configure.gnu ++++ b/libs/sofia-sip/configure.gnu +@@ -1,4 +1,4 @@ + #! /bin/sh + srcpath=$(dirname $0 2>/dev/null ) || srcpath="." +-$srcpath/configure "$@" --with-pic --with-glib=no --disable-shared --without-doxygen --disable-stun ++$srcpath/configure "$@" --with-pic --with-glib=no --disable-shared --without-doxygen + diff --git a/net/freeswitch/patches/1129000-libs-spandsp-src-spandsp-fast_convert_h.patch b/net/freeswitch/patches/1129000-libs-spandsp-src-spandsp-fast_convert_h.patch new file mode 100644 index 00000000000..e2fb3daf288 --- /dev/null +++ b/net/freeswitch/patches/1129000-libs-spandsp-src-spandsp-fast_convert_h.patch @@ -0,0 +1,11 @@ +--- a/libs/spandsp/src/spandsp/fast_convert.h ++++ b/libs/spandsp/src/spandsp/fast_convert.h +@@ -195,7 +195,7 @@ extern "C" + { + return (long int) (x); + } +-#elif defined(__ppc__) || defined(__powerpc__) ++#elif 0 /* defined(__ppc__) || defined(__powerpc__) */ + static __inline__ long int lfastrint(register double x) + { + int res[2]; diff --git a/net/freeswitch/patches/1129100-libs-spandsp-src-t4_rx_c.patch b/net/freeswitch/patches/1129100-libs-spandsp-src-t4_rx_c.patch new file mode 100644 index 00000000000..7fac54049f9 --- /dev/null +++ b/net/freeswitch/patches/1129100-libs-spandsp-src-t4_rx_c.patch @@ -0,0 +1,11 @@ +--- a/libs/spandsp/src/t4_rx.c ++++ b/libs/spandsp/src/t4_rx.c +@@ -50,7 +50,7 @@ + #include "spandsp/stdbool.h" + #endif + #include "floating_fudge.h" +-#include ++#include + + #include "spandsp/telephony.h" + #include "spandsp/alloc.h" diff --git a/net/freeswitch/patches/1129200-libs-spandsp-src-t4_tx_c.patch b/net/freeswitch/patches/1129200-libs-spandsp-src-t4_tx_c.patch new file mode 100644 index 00000000000..ed36237548f --- /dev/null +++ b/net/freeswitch/patches/1129200-libs-spandsp-src-t4_tx_c.patch @@ -0,0 +1,11 @@ +--- a/libs/spandsp/src/t4_tx.c ++++ b/libs/spandsp/src/t4_tx.c +@@ -50,7 +50,7 @@ + #include "spandsp/stdbool.h" + #endif + #include "floating_fudge.h" +-#include ++#include + + #include "spandsp/telephony.h" + #include "spandsp/alloc.h" diff --git a/net/freeswitch/patches/1130800-libs-srtp-configure-ac.patch b/net/freeswitch/patches/1130800-libs-srtp-configure-ac.patch new file mode 100644 index 00000000000..6fbfeb515db --- /dev/null +++ b/net/freeswitch/patches/1130800-libs-srtp-configure-ac.patch @@ -0,0 +1,18 @@ +--- a/libs/srtp/configure.ac ++++ b/libs/srtp/configure.ac +@@ -130,9 +130,12 @@ if test "$enable_kernel_linux" = "yes"; + fi + AC_MSG_RESULT($enable_kernel_linux) + +-dnl Check for /dev/urandom +-AC_CHECK_FILE(/dev/urandom, DEV_URANDOM=/dev/urandom, +- [AC_CHECK_FILE(/dev/random, DEV_URANDOM=/dev/random)]) ++ ++dnl Check for /dev/urandom ONLY when NOT cross compiling ++if test "$cross_compiling" != yes; then ++ AC_CHECK_FILE(/dev/urandom, DEV_URANDOM=/dev/urandom, ++ [AC_CHECK_FILE(/dev/random, DEV_URANDOM=/dev/random)]) ++fi + + dnl Checks for header files. + AC_HEADER_STDC diff --git a/net/freeswitch/patches/1137000-libs-xmlrpc-c-config_mk_in.patch b/net/freeswitch/patches/1137000-libs-xmlrpc-c-config_mk_in.patch new file mode 100644 index 00000000000..79cb33e5030 --- /dev/null +++ b/net/freeswitch/patches/1137000-libs-xmlrpc-c-config_mk_in.patch @@ -0,0 +1,13 @@ +--- a/libs/xmlrpc-c/config.mk.in ++++ b/libs/xmlrpc-c/config.mk.in +@@ -335,8 +335,8 @@ endif + # The cross compiling user can update config.mk or override + # BUILDTOOL_CC on a make command. + +-BUILDTOOL_CC = $(CC) +-BUILDTOOL_CCLD = $(CCLD) ++BUILDTOOL_CC = $(HOSTCC) ++BUILDTOOL_CCLD = $(HOSTCC) + + # Here are the commands 'make install' uses to install various kinds of files: + diff --git a/net/freeswitch/patches/1137200-libs-xmlrpc-c-lib-expat-gennmtab-Makefile.patch b/net/freeswitch/patches/1137200-libs-xmlrpc-c-lib-expat-gennmtab-Makefile.patch new file mode 100644 index 00000000000..d50d200ad81 --- /dev/null +++ b/net/freeswitch/patches/1137200-libs-xmlrpc-c-lib-expat-gennmtab-Makefile.patch @@ -0,0 +1,16 @@ +--- a/libs/xmlrpc-c/lib/expat/gennmtab/Makefile ++++ b/libs/xmlrpc-c/lib/expat/gennmtab/Makefile +@@ -1,3 +1,5 @@ ++TOPDIR=$(shell (cd $(SRCDIR)/../../../../..; pwd)) ++ + ifeq ($(SRCDIR),) + updir = $(shell echo $(dir $(1)) | sed 's/.$$//') + EXPATDIR := $(call updir,$(CURDIR)) +@@ -7,6 +9,7 @@ ifeq ($(SRCDIR),) + endif + SUBDIR := lib/expat/gennmtab + ++include $(TOPDIR)/rules.mk + include $(BLDDIR)/config.mk + + LDFLAGS = $(LADD) diff --git a/net/freeswitch/patches/1301010-src-include-timerfd_wrap_h.patch b/net/freeswitch/patches/1301010-src-include-timerfd_wrap_h.patch new file mode 100644 index 00000000000..dbf995e500f --- /dev/null +++ b/net/freeswitch/patches/1301010-src-include-timerfd_wrap_h.patch @@ -0,0 +1,27 @@ +--- a/src/include/timerfd_wrap.h ++++ b/src/include/timerfd_wrap.h +@@ -55,20 +55,12 @@ SWITCH_BEGIN_EXTERN_C + + + #ifndef __NR_timerfd +-#if defined(__x86_64__) +-#define __NR_timerfd_create 283 +-#define __NR_timerfd_settime 286 +-#define __NR_timerfd_gettime 287 +-#elif defined(__i386__) +-#define __NR_timerfd_create 322 +-#define __NR_timerfd_settime 325 +-#define __NR_timerfd_gettime 326 +-#else +-#error invalid system +-#endif ++#include + #endif + +-#define TFD_TIMER_ABSTIME (1 << 0) ++#ifndef TFD_TIMER_ABSTIME ++#include ++#endif + + int timerfd_create(int clockid, int flags) + { diff --git a/net/freeswitch/patches/1304050-src-mod-codecs-mod_celt-Makefile_am.patch b/net/freeswitch/patches/1304050-src-mod-codecs-mod_celt-Makefile_am.patch new file mode 100644 index 00000000000..55d349aff31 --- /dev/null +++ b/net/freeswitch/patches/1304050-src-mod-codecs-mod_celt-Makefile_am.patch @@ -0,0 +1,11 @@ +--- a/src/mod/codecs/mod_celt/Makefile.am ++++ b/src/mod/codecs/mod_celt/Makefile.am +@@ -19,7 +19,7 @@ $(CELT_DIR): + + $(CELT_BUILDDIR)/Makefile: $(CELT_DIR) + mkdir -p $(CELT_BUILDDIR) +- cd $(CELT_BUILDDIR) && $(DEFAULT_VARS) $(CELT_DIR)/configure $(DEFAULT_ARGS) --disable-shared --with-pic --srcdir=$(CELT_DIR) ++ cd $(CELT_BUILDDIR) && $(DEFAULT_VARS) $(CELT_DIR)/configure $(DEFAULT_ARGS) --disable-shared --with-pic --srcdir=$(CELT_DIR) --with-ogg=$(STAGING_DIR)/usr + $(TOUCH_TARGET) + + $(CELT_LA): $(CELT_BUILDDIR)/Makefile diff --git a/net/freeswitch/patches/1304130-src-mod-codecs-mod_isac-typedefs_h.patch b/net/freeswitch/patches/1304130-src-mod-codecs-mod_isac-typedefs_h.patch new file mode 100644 index 00000000000..84de2af6ba3 --- /dev/null +++ b/net/freeswitch/patches/1304130-src-mod-codecs-mod_isac-typedefs_h.patch @@ -0,0 +1,11 @@ +--- a/src/mod/codecs/mod_isac/typedefs.h ++++ b/src/mod/codecs/mod_isac/typedefs.h +@@ -66,7 +66,7 @@ + #define WEBRTC_ARCH_X86 + #define WEBRTC_ARCH_32_BITS + #define WEBRTC_ARCH_LITTLE_ENDIAN +-#elif defined(__ARMEL__) ++#elif defined(__ARMEL__) || defined(__mips__) + // TODO(andrew): We'd prefer to control platform defines here, but this is + // currently provided by the Android makefiles. Commented to avoid duplicate + // definition warnings. diff --git a/net/freeswitch/patches/1304150-src-mod-codecs-mod_opus-Makefile_am.patch b/net/freeswitch/patches/1304150-src-mod-codecs-mod_opus-Makefile_am.patch new file mode 100644 index 00000000000..bedf1dfe005 --- /dev/null +++ b/net/freeswitch/patches/1304150-src-mod-codecs-mod_opus-Makefile_am.patch @@ -0,0 +1,11 @@ +--- a/src/mod/codecs/mod_opus/Makefile.am ++++ b/src/mod/codecs/mod_opus/Makefile.am +@@ -19,7 +19,7 @@ $(OPUS_DIR)/configure: + + $(OPUS_BUILDDIR)/Makefile: $(OPUS_DIR)/configure + mkdir -p $(OPUS_BUILDDIR) +- cd $(OPUS_BUILDDIR) && $(DEFAULT_VARS) $(OPUS_DIR)/configure $(MY_DEFAULT_ARGS) ++ cd $(OPUS_BUILDDIR) && $(DEFAULT_VARS) $(OPUS_DIR)/configure $(MY_DEFAULT_ARGS) --host=$(host) --disable-shared --with-pic --srcdir=$(OPUS_DIR) + $(TOUCH_TARGET) + + $(OPUS_LA): $(OPUS_BUILDDIR)/Makefile diff --git a/net/freeswitch/patches/1306000-src-mod-directories-mod_ldap-Makefile_am.patch b/net/freeswitch/patches/1306000-src-mod-directories-mod_ldap-Makefile_am.patch new file mode 100644 index 00000000000..2872754d995 --- /dev/null +++ b/net/freeswitch/patches/1306000-src-mod-directories-mod_ldap-Makefile_am.patch @@ -0,0 +1,11 @@ +--- a/src/mod/directories/mod_ldap/Makefile.am ++++ b/src/mod/directories/mod_ldap/Makefile.am +@@ -13,7 +13,7 @@ mod_ldap_la_CFLAGS = $(AM_CFLAGS) -DWI + mod_ldap_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(LDAPLA) $(LIBLBERLA) + mod_ldap_la_LDFLAGS = -avoid-version -module -no-undefined -shared + +-MY_DEFAULT_ARGS= --build=$(build) --host=$(host) --target=$(target) --prefix="$(prefix)" --exec_prefix="$(exec_prefix)" --libdir="$(libdir)" --disable-slapd --disable-bdb --disable-hdb ++MY_DEFAULT_ARGS= --build=$(build) --host=$(host) --target=$(target) --prefix="$(prefix)" --exec_prefix="$(exec_prefix)" --libdir="$(libdir)" --with-yielding_select=yes --disable-slapd --disable-bdb --disable-hdb + + $(MODNAME).lo: $(LDAPLA) $(LIBLBERLA) + diff --git a/net/freeswitch/patches/1307000-src-mod-endpoints-mod_gsmopen-Makefile_am.patch b/net/freeswitch/patches/1307000-src-mod-endpoints-mod_gsmopen-Makefile_am.patch new file mode 100644 index 00000000000..1d744220c68 --- /dev/null +++ b/net/freeswitch/patches/1307000-src-mod-endpoints-mod_gsmopen-Makefile_am.patch @@ -0,0 +1,11 @@ +--- a/src/mod/endpoints/mod_gsmopen/Makefile.am ++++ b/src/mod/endpoints/mod_gsmopen/Makefile.am +@@ -12,7 +12,7 @@ SPANDSP_LA=$(SPANDSP_BUILDDIR)/src/libsp + mod_LTLIBRARIES = mod_gsmopen.la + mod_gsmopen_la_SOURCES = mod_gsmopen.cpp gsmopen_protocol.cpp + mod_gsmopen_la_CXXFLAGS = $(SWITCH_AM_CXXFLAGS) +-mod_gsmopen_la_CPPFLAGS = -I$(SPANDSP_DIR)/src -I$(TIFF_DIR)/libtiff -I$(SPANDSP_BUILDDIR)/src -I$(TIFF_BUILDDIR)/libtiff -I. ++mod_gsmopen_la_CPPFLAGS = -I$(SPANDSP_DIR)/src -I$(TIFF_DIR)/libtiff -I$(SPANDSP_BUILDDIR)/src -I$(TIFF_BUILDDIR)/libtiff -I. -fpermissive + mod_gsmopen_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(SPANDSP_LA) $(TIFF_LA) + mod_gsmopen_la_LDFLAGS = -avoid-version -module -no-undefined -lctb-0.16 -lgsmme + diff --git a/net/freeswitch/patches/1307010-src-mod-endpoints-mod_gsmopen-gsmlib-gsmlib-1.10-patched-13ubuntu-configure_in.patch b/net/freeswitch/patches/1307010-src-mod-endpoints-mod_gsmopen-gsmlib-gsmlib-1.10-patched-13ubuntu-configure_in.patch new file mode 100644 index 00000000000..1c397c09331 --- /dev/null +++ b/net/freeswitch/patches/1307010-src-mod-endpoints-mod_gsmopen-gsmlib-gsmlib-1.10-patched-13ubuntu-configure_in.patch @@ -0,0 +1,24 @@ +--- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/configure.in ++++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/configure.in +@@ -56,21 +56,6 @@ dnl Checks for programs. + AC_PROG_CPP + AC_PROG_CXX + +-dnl check for gcc 2.95.x +-AC_TRY_RUN([ +-#include +-main() +-{ +-#if defined(__GNUC__) && \ +- ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) +- return 1; +-#endif +- return 0; +-} +-],, +-[echo "need at least gcc 2.95 to compile correctly" +-exit 1]) +- + dnl check for alloca + AC_FUNC_ALLOCA + diff --git a/net/freeswitch/patches/1307161-src-mod-endpoints-mod_verto-Makefile_am.patch b/net/freeswitch/patches/1307161-src-mod-endpoints-mod_verto-Makefile_am.patch new file mode 100644 index 00000000000..e1411aa747f --- /dev/null +++ b/net/freeswitch/patches/1307161-src-mod-endpoints-mod_verto-Makefile_am.patch @@ -0,0 +1,28 @@ +--- a/src/mod/endpoints/mod_verto/Makefile.am ++++ b/src/mod/endpoints/mod_verto/Makefile.am +@@ -9,19 +9,19 @@ mod_verto_la_LIBADD = $(switch_builddi + mod_verto_la_LDFLAGS = -avoid-version -module -no-undefined -shared + + if HAVE_PERL +-#perldir = $(PERL_SITEDIR) +-noinst_LTLIBRARIES = MCAST.la ++perldir = "$(PERL_SITELIB)" ++perl_LTLIBRARIES = MCAST.la + MCAST_la_SOURCES = mcast/mcast_wrap.cpp mcast/perlxsi.c mcast/mcast.c mcast/mcast_cpp.cpp + MCAST_la_CFLAGS = $(CC_CFLAGS) $(CFLAGS) $(SWITCH_AM_CFLAGS) $(PERL_CFLAGS) + MCAST_la_CXXFLAGS = $(SWITCH_AM_CXXFLAGS) $(CXXFLAGS) -w $(PERL_INC) + MCAST_la_CPPFLAGS = -I$(switch_srcdir)/src/mod/endpoints/mod_verto/mcast + MCAST_la_LDFLAGS = -avoid-version -module -no-undefined -shared $(PERL_LDFLAGS) + +-#install-data-local: perlmod-install ++install-data-local: perlmod-install + +-#perlmod-install: install-perlLTLIBRARIES +-# install -d -m 755 $(DESTDIR)$(PERL_SITEDIR) +-# install -m 755 mcast/MCAST.pm $(DESTDIR)$(PERL_SITEDIR) ++perlmod-install: install-perlLTLIBRARIES ++ install -d -m 755 $(DESTDIR)$(perldir) ++ install -m 755 mcast/MCAST.pm $(DESTDIR)$(perldir) + endif + + mcast/esl_wrap.cpp: diff --git a/net/freeswitch/patches/1310040-src-mod-languages-mod_perl-Makefile_am.patch b/net/freeswitch/patches/1310040-src-mod-languages-mod_perl-Makefile_am.patch new file mode 100644 index 00000000000..c6a15880461 --- /dev/null +++ b/net/freeswitch/patches/1310040-src-mod-languages-mod_perl-Makefile_am.patch @@ -0,0 +1,32 @@ +--- a/src/mod/languages/mod_perl/Makefile.am ++++ b/src/mod/languages/mod_perl/Makefile.am +@@ -1,22 +1,22 @@ + include $(top_srcdir)/build/modmake.rulesam + MODNAME=mod_perl +-PERL = perl +-PERL_LIBDIR =-L`perl -MConfig -e 'print $$Config{archlib}'`/CORE +-PERL_LIBS =`perl -MConfig -e 'print $$Config{libs}'` + +-perldir=$(prefix)/perl ++perldir="$(PERL_SITELIB)" ++ + mod_LTLIBRARIES = mod_perl.la + perl_LTLIBRARIES = freeswitch.la + mod_perl_la_SOURCES = mod_perl.c freeswitch_perl.cpp mod_perl_wrap.cpp perlxsi.c + mod_perl_la_CFLAGS = $(AM_CFLAGS) + mod_perl_la_CXXFLAGS = $(AM_CXXFLAGS) +-mod_perl_la_CPPFLAGS = -w -DMULTIPLICITY `$(PERL) -MExtUtils::Embed -e ccopts` -DEMBED_PERL -I$(switch_srcdir)/libs/libteletone/src/ ++mod_perl_la_CPPFLAGS = ${PERL_CFLAGS} -I$(switch_srcdir)/libs/libteletone/src/ + mod_perl_la_LIBADD = $(switch_builddir)/libfreeswitch.la +-mod_perl_la_LDFLAGS = -avoid-version -module -no-undefined -shared `$(PERL) -MExtUtils::Embed -e ldopts` `$(PERL) -MConfig -e 'print $$Config{libs}'` ++#mod_perl_la_LDFLAGS = -avoid-version -module -no-undefined -shared `$(PERL) -MExtUtils::Embed -e ldopts` `$(PERL) -MConfig -e 'print $$Config{libs}'` ++mod_perl_la_LDFLAGS = -avoid-version -module -no-undefined -shared ${PERL_LDFLAGS} + + freeswitch_la_SOURCES = freeswitch_perl.cpp mod_perl_wrap.cpp perlxsi.c + freeswitch_la_LDFLAGS = -avoid-version -module -no-undefined -shared $(LDFLAGS) +-freeswitch_la_CPPFLAGS = -w -DMULTIPLICITY `$(PERL) -MExtUtils::Embed -e ccopts` -DEMBED_PERL -I$(switch_srcdir)/libs/libteletone/src/ ++freeswitch_la_CPPFLAGS = ${PERL_CFLAGS} -I$(switch_srcdir)/libs/libteletone/src/ ++ + reswig: swigclean mod_perl_wrap.cpp + + swigclean: clean diff --git a/net/kamailio-3.x/Makefile b/net/kamailio-3.x/Makefile new file mode 100644 index 00000000000..73d76d50ce9 --- /dev/null +++ b/net/kamailio-3.x/Makefile @@ -0,0 +1,243 @@ +# +# Copyright (C) 2014 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:=kamailio3 +PKG_VERSION:=3.3.7 +PKG_RELEASE:=7 + +PKG_SOURCE_URL:=http://www.kamailio.org/pub/kamailio/$(PKG_VERSION)/src/ +PKG_SOURCE:=kamailio-$(PKG_VERSION)$(PKG_VARIANT)_src.tar.gz +PKG_MD5SUM:=519d1dfbddf7dbead3a020321582d471 +PKG_USE_MIPS16:=0 + +PKG_LICENSE:=GPL-2.0+ +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=Jiri Slachta + +INCL_MODULES:= +KAM_MODULES:= + +include $(INCLUDE_DIR)/nls.mk +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS += $(FPIC) +PREBUILT_STAMP=$(STAGING_DIR)/stamp/.$(PKG_NAME)_prebuilt +TAR_CMD:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components 1 $(TAR_OPTIONS) + +define Package/kamailio3/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + URL:=http://www.kamailio.org/ + DEPENDS:=$(ICONV_DEPENDS) +libncurses +libpthread +libreadline +endef + +define Package/kamailio3 +$(call Package/kamailio3/Default) + TITLE:=Mature and flexible open source SIP server, v$(PKG_VERSION) + MENU:=1 +endef + +define Package/kamailio3/conffiles +/etc/default/kamailio +/etc/kamailio/kamailio.cfg +/etc/kamailio/dictionary.kamailio +/etc/kamailio/kamctlrc +endef + +define Package/kamailio3/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kam{ailio,ctl,dbctl} $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/sercmd $(1)/usr/sbin/ + + $(INSTALL_DIR) $(1)/usr/lib/kamailio/modules{,_s,_k} + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/kamailio/lib*.so* $(1)/usr/lib/kamailio/ + + $(INSTALL_DIR) $(1)/etc/kamailio + $(CP) \ + $(PKG_INSTALL_DIR)/etc/kamailio/{dictionary.kamailio,kamailio.cfg,kamctlrc} \ + $(1)/etc/kamailio/ + + $(INSTALL_DIR) $(1)/etc/default + $(CP) \ + ./files/kamailio.default \ + $(1)/etc/default/kamailio + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) \ + ./files/kamailio.init \ + $(1)/etc/init.d/kamailio + + $(INSTALL_DIR) $(1)/usr/lib/kamailio + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/kamailio/kamctl \ + $(1)/usr/lib/kamailio/ +endef + +define Package/kamailio3/install/module + $(INSTALL_DIR) $(1)/usr/lib/kamailio/$(3) + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/kamailio/$(3)/*$(2).so* $(1)/usr/lib/kamailio/$(3)/ +endef + +define Package/kamailio3/install/dbfiles + $(INSTALL_DIR) $(1)/usr/share/kamailio/$(2) + $(CP) $(PKG_INSTALL_DIR)/usr/share/kamailio/$(2)/* $(1)/usr/share/kamailio/$(2)/ +endef + +define BuildKamailio3Module + define Package/kamailio3-mod-$(subst _,-,$(1)) + $$(call Package/kamailio3/Default) + TITLE:= kamailio3 $(2) module + DEPENDS:=kamailio3 $(4) + endef + + define Package/kamailio3-mod-$(subst _,-,$(1))/description +This package provides support for $(3) in Kamailio. + endef + + define Package/kamailio3-mod-$(subst _,-,$(1))/install +$(call Package/kamailio3/install/module,$$(1),$(1),$(5)) +$(foreach d,$(6),$(call Package/kamailio3/install/dbfiles,$$(1),$(d));) + endef + + INCL_MODULES+=$(1) + KAM_MODULES+=kamailio3-mod-$(subst _,-,$(1)) +endef + +################################ +# Kamailio module parameters +# Module params: +# 1 - Name +# 2 - Title +# 3 - Description +# 4 - Dependencies +# 5 - Subdir +# 6 - DB file directories +################################ + +$(eval $(call BuildKamailio3Module,acc,Accounting,,+kamailio3-mod-tm,modules_k)) +$(eval $(call BuildKamailio3Module,alias_db,Database-backend aliases,,+kamailio3-mod-db-sqlite,modules_k)) +$(eval $(call BuildKamailio3Module,auth,Authentication Framework,,,modules)) +$(eval $(call BuildKamailio3Module,auth_db,Database-backend authentication,,+kamailio3-mod-auth +kamailio3-mod-db-sqlite,modules_k)) +$(eval $(call BuildKamailio3Module,auth_diameter,Diameter-backend authentication,,+kamailio3-mod-sl,modules_k)) +$(eval $(call BuildKamailio3Module,avpops,AVP operation,,,modules)) +$(eval $(call BuildKamailio3Module,benchmark,Config benchmark,,,modules_k)) +$(eval $(call BuildKamailio3Module,cfgutils,Config utilities,,,modules_k)) +$(eval $(call BuildKamailio3Module,cfg_db,Load core and module parameters from database,,+kamailio3-mod-db-sqlite,modules)) +$(eval $(call BuildKamailio3Module,cfg_rpc,Update core and module parameters at runtime via RPC interface,,,modules)) +$(eval $(call BuildKamailio3Module,ctl,BINRPC transport interface,,,modules)) +$(eval $(call BuildKamailio3Module,db_flatstore,Fast writing-only text database-backed,,,modules)) +$(eval $(call BuildKamailio3Module,db_mysql,MySQL database-backend,,+libmysqlclient,modules,mysql)) +$(eval $(call BuildKamailio3Module,db_postgres,PostgreSQL Database-backend,,+libpq,modules,postgres)) +$(eval $(call BuildKamailio3Module,db_sqlite,Sqlite DB support,,+libsqlite3,modules_k,db_sqlite)) +$(eval $(call BuildKamailio3Module,db_text,Text database-backend,,,modules_k,dbtext/kamailio)) +$(eval $(call BuildKamailio3Module,db_unixodbc,UnixODBC Database-backend,,+unixodbc,modules_k)) +$(eval $(call BuildKamailio3Module,dialog,Dialog support,,+kamailio3-mod-rr +kamailio3-mod-tm,modules_k)) +$(eval $(call BuildKamailio3Module,dialplan,Dialplan management,,+libpcre,modules)) +$(eval $(call BuildKamailio3Module,dispatcher,Dispatcher,,,modules_s)) +$(eval $(call BuildKamailio3Module,diversion,Diversion header insertion,,,modules_s)) +$(eval $(call BuildKamailio3Module,domain,Multi-domain support,,,modules_k)) +$(eval $(call BuildKamailio3Module,domainpolicy,Domain policy,,,modules_k)) +$(eval $(call BuildKamailio3Module,enum,ENUM lookup,,,modules)) +$(eval $(call BuildKamailio3Module,exec,External exec,,,modules_k)) +$(eval $(call BuildKamailio3Module,group,Database-backend user-groups,,,modules_k)) +$(eval $(call BuildKamailio3Module,h350,H.350,,+kamailio3-mod-ldap +libopenldap,modules_k)) +$(eval $(call BuildKamailio3Module,htable,Hash Table,,,modules_k)) +$(eval $(call BuildKamailio3Module,imc,IM conferencing,,+kamailio3-mod-db-mysql +kamailio3-mod-tm,modules_k)) +$(eval $(call BuildKamailio3Module,ipops,IP and IPv6 operations module,,,modules)) +$(eval $(call BuildKamailio3Module,kex,Core extensions,,,modules_k)) +$(eval $(call BuildKamailio3Module,lcr,Least Cost Routing,,+kamailio3-mod-tm +libpcre,modules)) +$(eval $(call BuildKamailio3Module,ldap,LDAP connector,,+libopenldap,modules_k)) +$(eval $(call BuildKamailio3Module,maxfwd,Max-Forward processor,,,modules_k)) +$(eval $(call BuildKamailio3Module,mediaproxy,Automatic NAT traversal,,+kamailio3-mod-dialog,modules)) +$(eval $(call BuildKamailio3Module,mi_datagram,Datagram support for Management Interface,,,modules_k)) +$(eval $(call BuildKamailio3Module,mi_fifo,FIFO support for Management Interface,,,modules_k)) +$(eval $(call BuildKamailio3Module,mi_rpc,RPC support for Management Interface,,,modules)) +$(eval $(call BuildKamailio3Module,msilo,SIP message silo,,+kamailio3-mod-tm,modules_k)) +$(eval $(call BuildKamailio3Module,nat_traversal,NAT traversal,,+kamailio3-mod-dialog +kamailio3-mod-sl +kamailio3-mod-tm,modules_k)) +$(eval $(call BuildKamailio3Module,nathelper,NAT traversal helper,,+rtpproxy,modules_k)) +$(eval $(call BuildKamailio3Module,path,SIP path insertion,,+kamailio3-mod-rr,modules_k)) +$(eval $(call BuildKamailio3Module,pdt,Prefix-to-Domain translator,,,modules_k)) +$(eval $(call BuildKamailio3Module,permissions,Permissions control,,,modules_k)) +$(eval $(call BuildKamailio3Module,pike,Flood detector,,,modules_k)) +$(eval $(call BuildKamailio3Module,presence,Presence server,,+kamailio3-mod-sl +kamailio3-mod-tm +libxml2,modules_k)) +$(eval $(call BuildKamailio3Module,presence_dialoginfo,Dialog Event presence,,+kamailio3-mod-presence,modules_k)) +$(eval $(call BuildKamailio3Module,presence_mwi,Message Waiting Indication presence,,+kamailio3-mod-presence,modules_k)) +$(eval $(call BuildKamailio3Module,presence_xml,XCAP presence,,+kamailio3-mod-presence +kamailio3-mod-xcap-client,modules_k)) +$(eval $(call BuildKamailio3Module,pua,Presence User Agent,,+kamailio3-mod-tm +libxml2,modules_k)) +$(eval $(call BuildKamailio3Module,pua_bla,Bridged Line Appearence PUA,,+kamailio3-mod-presence +kamailio3-mod-pua +kamailio3-mod-usrloc,modules_k)) +$(eval $(call BuildKamailio3Module,pua_dialoginfo,Dialog Event PUA,,+kamailio3-mod-dialog +kamailio3-mod-pua,modules_k)) +$(eval $(call BuildKamailio3Module,pua_mi,PUA Management Interface,,+kamailio3-mod-pua,modules_k)) +$(eval $(call BuildKamailio3Module,pua_usrloc,PUA User Location,,+kamailio3-mod-pua +kamailio3-mod-usrloc,modules_k)) +$(eval $(call BuildKamailio3Module,pua_xmpp,PUA XMPP,,+kamailio3-mod-presence +kamailio3-mod-pua +kamailio3-mod-xmpp,modules_k)) +$(eval $(call BuildKamailio3Module,pv,Pseudo-Variables,,,modules_k)) +$(eval $(call BuildKamailio3Module,qos,QoS control,,+kamailio3-mod-dialog,modules_k)) +$(eval $(call BuildKamailio3Module,ratelimit,Traffic shapping,,,modules)) +$(eval $(call BuildKamailio3Module,regex,Regular Expression,,+libpcre,modules_k)) +$(eval $(call BuildKamailio3Module,registrar,SIP Registrar,,+kamailio3-mod-usrloc,modules_k)) +$(eval $(call BuildKamailio3Module,rls,Resource List Server,,+kamailio3-mod-presence +kamailio3-mod-pua +kamailio3-mod-tm +libxml2,modules_k)) +$(eval $(call BuildKamailio3Module,rr,Record-Route and Route,,,modules_k)) +$(eval $(call BuildKamailio3Module,rtimer,Routing Timer,,,modules_k)) +$(eval $(call BuildKamailio3Module,rtpproxy,RTP proxy,,+kamailio3-mod-tm,modules)) +$(eval $(call BuildKamailio3Module,sanity,SIP sanity checks,,+kamailio3-mod-sl,modules)) +$(eval $(call BuildKamailio3Module,sipcapture,SIP capture module,,,modules)) +$(eval $(call BuildKamailio3Module,siptrace,SIP trace,,,modules_k)) +$(eval $(call BuildKamailio3Module,siputils,SIP utilities,,+kamailio3-mod-sl,modules_k)) +$(eval $(call BuildKamailio3Module,sl,Stateless replier,,,modules)) +$(eval $(call BuildKamailio3Module,sms,SIP-to-SMS IM gateway,,+kamailio3-mod-tm,modules)) +$(eval $(call BuildKamailio3Module,speeddial,Per-user speed-dial controller,,,modules_k)) +$(eval $(call BuildKamailio3Module,sqlops,SQL operations,,,modules_k)) +$(eval $(call BuildKamailio3Module,statistics,Script statistics,,,modules_k)) +$(eval $(call BuildKamailio3Module,sst,SIP Session Timer,,+kamailio3-mod-dialog +kamailio3-mod-sl,modules_k)) +$(eval $(call BuildKamailio3Module,textops,Text operations,,,modules_k)) +$(eval $(call BuildKamailio3Module,tls,TLS operations,,+libopenssl,modules)) +$(eval $(call BuildKamailio3Module,tm,Transaction,,,modules)) +$(eval $(call BuildKamailio3Module,tmx,Transaction module extensions,,,modules_k)) +$(eval $(call BuildKamailio3Module,uac,User Agent Client,,+kamailio3-mod-tm,modules_k)) +$(eval $(call BuildKamailio3Module,uac_redirect,User Agent Client redirection,,+kamailio3-mod-tm,modules_k)) +$(eval $(call BuildKamailio3Module,uri_db,Database-backend SIP URI checking,,,modules_k)) +$(eval $(call BuildKamailio3Module,userblacklist,User blacklists,,,modules_k)) +$(eval $(call BuildKamailio3Module,usrloc,User location,,+libxml2,modules_k)) +$(eval $(call BuildKamailio3Module,utils,Misc utilities,,+libcurl +libxml2,modules)) +$(eval $(call BuildKamailio3Module,xcap_client,XCAP Client,,+libcurl,modules_k)) +$(eval $(call BuildKamailio3Module,xlog,Advanced logger,,,modules_k)) +$(eval $(call BuildKamailio3Module,xmpp,SIP-to-XMPP Gateway,,+kamailio3-mod-tm +libexpat +libxml2,modules_k)) + +PKG_MAKE_ARGS:= \ + prefix=/ \ + cfg_dir=/etc/kamailio/ \ + bin_dir=/usr/sbin/ \ + data_dir=/usr/share/kamailio/ \ + lib_dir=/usr/lib/kamailio/ \ + modules_dir=/usr/lib/kamailio/ \ + include_modules="$(INCL_MODULES)" \ + cfg_target:=/etc/kamailio/ \ + TLS_HOOKS=1 \ + extra_defs="-DUSE_PTHREAD_MUTEX " \ + CFLAGS="$(TARGET_CFLAGS)" \ + LOCALBASE="$(STAGING_DIR)/usr" \ + SYSBASE="$(STAGING_DIR)/usr" \ + PCREDEFS:="$(TARGET_CPPFLAGS)" \ + PCRELIBS:="$(TARGET_LDFLAGS)" \ + CROSS_COMPILE=$(TARGET_CROSS) \ + CC="$(TARGET_CC)" \ + ARCH="$(ARCH)" \ + DESTDIR=$(PKG_INSTALL_DIR) \ + quiet=verbose + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) $(PKG_MAKE_ARGS) \ + EXTRA_LIBS=-L$(STAGING_DIR)/usr/lib/ \ + all + $(MAKE) -C $(PKG_BUILD_DIR) $(PKG_MAKE_ARGS) \ + install +endef + +$(eval $(call BuildPackage,kamailio3)) +$(foreach m,$(KAM_MODULES),$(eval $(call BuildPackage,$(m)))) diff --git a/net/kamailio-3.x/files/kamailio.default b/net/kamailio-3.x/files/kamailio.default new file mode 100644 index 00000000000..1fc875db17b --- /dev/null +++ b/net/kamailio-3.x/files/kamailio.default @@ -0,0 +1,14 @@ +# +# Kamailio startup options +# + +# Set to yes to enable kamailio, once configured properly. +#RUN_KAMAILIO=yes + +# Amount of shared and private memory to allocate +# for the running Kamailio server (in Mb) +#SHM_MEMORY=64 +#PKG_MEMORY=4 + +# Config file +#CFGFILE=/etc/kamailio/kamailio.cfg diff --git a/net/kamailio-3.x/files/kamailio.init b/net/kamailio-3.x/files/kamailio.init new file mode 100644 index 00000000000..6d66c5aee61 --- /dev/null +++ b/net/kamailio-3.x/files/kamailio.init @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2014 OpenWrt.org + +START=99 + +BINFILE=/usr/sbin/kamailio +PIDFILE=/var/run/kamailio.pid +DEFAULTS=/etc/default/kamailio +CFGFILE=/etc/kamailio/kamailio.cfg +SHM_MEMORY=8 +PKG_MEMORY=2 +RUN_KAMAILIO=no + +start() { + # Load startup options if available + if [ -f $DEFAULTS ]; then + . $DEFAULTS + fi + + if [ "$RUN_KAMAILIO" != "yes" ]; then + echo "[WARNING] Kamailio not yet configured. Edit /etc/default/kamailio first." + else + start-stop-daemon -S -x $BINFILE -b -- -P $PIDFILE -f $CFGFILE -m $SHM_MEMORY -M $PKG_MEMORY + fi +} + +stop() { + start-stop-daemon -K -x $BINFILE -p $PIDFILE -q + rm -rf $PID_FILE +} diff --git a/net/kamailio-3.x/patches/050-fix-kamailio-utils.patch b/net/kamailio-3.x/patches/050-fix-kamailio-utils.patch new file mode 100644 index 00000000000..9edb7937de7 --- /dev/null +++ b/net/kamailio-3.x/patches/050-fix-kamailio-utils.patch @@ -0,0 +1,68 @@ +diff -rupN kamailio3-3.3.7/utils/kamctl/kamctl kamailio3-new/utils/kamctl/kamctl +--- kamailio3-3.3.7/utils/kamctl/kamctl 2014-03-06 16:30:33.000000000 +0100 ++++ kamailio3-new/utils/kamctl/kamctl 2014-08-07 17:01:21.806954644 +0200 +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + # + # $Id$ + # +diff -rupN kamailio3-3.3.7/utils/kamctl/kamctlrc kamailio3-new/utils/kamctl/kamctlrc +--- kamailio3-3.3.7/utils/kamctl/kamctlrc 2014-03-06 16:30:33.000000000 +0100 ++++ kamailio3-new/utils/kamctl/kamctlrc 2014-08-07 17:00:58.446953700 +0200 +@@ -142,3 +142,6 @@ + ## Extra start options - default is: not set + # example: start Kamailio with 64MB share memory: STARTOPTIONS="-m 64" + # STARTOPTIONS= ++ ++#Disable colour printing in terminal ++NOHLPRINT=1 +diff -rupN kamailio3-3.3.7/utils/kamctl/kamdbctl kamailio3-new/utils/kamctl/kamdbctl +--- kamailio3-3.3.7/utils/kamctl/kamdbctl 2014-03-06 16:30:33.000000000 +0100 ++++ kamailio3-new/utils/kamctl/kamdbctl 2014-08-07 17:01:15.494954389 +0200 +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + # + # $Id$ + # +diff -rupN kamailio3-3.3.7/utils/kamctl/kamdbctl.base kamailio3-new/utils/kamctl/kamdbctl.base +--- kamailio3-3.3.7/utils/kamctl/kamdbctl.base 2014-03-06 16:30:33.000000000 +0100 ++++ kamailio3-new/utils/kamctl/kamdbctl.base 2014-08-07 16:59:44.870950728 +0200 +@@ -32,14 +32,14 @@ INSTALL_PRESENCE_TABLES=${INSTALL_PRESEN + + # Used by dbtext and db_berkeley to define tables to be created, used by + # postgres to do the grants +-STANDARD_TABLES=${STANDARD_TABLES:-version acc dbaliases domain domain_attrs grp +- uri speed_dial lcr_gw lcr_rule lcr_rule_target pdt subscriber +- location re_grp trusted address missed_calls usr_preferences ++STANDARD_TABLES=${STANDARD_TABLES:-version acc dbaliases domain domain_attrs grp \ ++ uri speed_dial lcr_gw lcr_rule lcr_rule_target pdt subscriber \ ++ location re_grp trusted address missed_calls usr_preferences \ + aliases silo dialog dialog_vars dispatcher dialplan} +-EXTRA_TABLES=${EXTRA_TABLES:-imc_members imc_rooms cpl sip_trace domainpolicy +- carrierroute carrier_name domain_name carrierfailureroute userblacklist ++EXTRA_TABLES=${EXTRA_TABLES:-imc_members imc_rooms cpl sip_trace domainpolicy \ ++ carrierroute carrier_name domain_name carrierfailureroute userblacklist \ + globalblacklist htable purplemap uacreg pl_pipes mtree mtrees} +-PRESENCE_TABLES=${PRESENCE_TABLES:-presentity active_watchers watchers xcap ++PRESENCE_TABLES=${PRESENCE_TABLES:-presentity active_watchers watchers xcap \ + pua rls_presentity rls_watchers} + + # SQL definitions +@@ -62,11 +62,11 @@ GREP=${GREP:-grep} + SED=${SED:-sed} + + # define what modules should be installed +-STANDARD_MODULES=${STANDARD_MODULES:-standard acc lcr domain group permissions +- registrar usrloc msilo alias_db uri_db +- speeddial avpops auth_db pdt dialog dispatcher ++STANDARD_MODULES=${STANDARD_MODULES:-standard acc lcr domain group permissions \ ++ registrar usrloc msilo alias_db uri_db \ ++ speeddial avpops auth_db pdt dialog dispatcher \ + dialplan} +-EXTRA_MODULES=${EXTRA_MODULES:-imc cpl siptrace domainpolicy carrierroute ++EXTRA_MODULES=${EXTRA_MODULES:-imc cpl siptrace domainpolicy carrierroute \ + userblacklist htable purple uac pipelimit mtree} + + ############################################################ diff --git a/net/kamailio-3.x/patches/100-cross_compile.patch b/net/kamailio-3.x/patches/100-cross_compile.patch new file mode 100644 index 00000000000..a4ee4d8d14a --- /dev/null +++ b/net/kamailio-3.x/patches/100-cross_compile.patch @@ -0,0 +1,11 @@ +--- a/modules_s/ldap/Makefile ++++ b/modules_s/ldap/Makefile +@@ -14,7 +14,7 @@ + # LD_SCOPE_CHILDREN defined + #DEFS += -DHAVE_SCOPE_CHILDREN + +-LIBS=-L$(LOCALBASE)/lib -L /usr/lib -lldap ++LIBS=-L$(LOCALBASE)/lib -lldap + + DEFS+=-DSER_MOD_INTERFACE + diff --git a/net/kamailio-4.x/Makefile b/net/kamailio-4.x/Makefile new file mode 100644 index 00000000000..503e1fe9c98 --- /dev/null +++ b/net/kamailio-4.x/Makefile @@ -0,0 +1,249 @@ +# +# Copyright (C) 2014 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:=kamailio4 +PKG_VERSION:=4.2.1 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=http://www.kamailio.org/pub/kamailio/$(PKG_VERSION)/src/ +PKG_SOURCE:=kamailio-$(PKG_VERSION)$(PKG_VARIANT)_src.tar.gz +PKG_MD5SUM:=c2bccebd88156bf02957468e36dda648 +PKG_USE_MIPS16:=0 + +PKG_LICENSE:=GPL-2.0+ +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=Jiri Slachta + +INCL_MODULES:= +KAM_MODULES:= + +include $(INCLUDE_DIR)/nls.mk +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS += $(FPIC) +PREBUILT_STAMP=$(STAGING_DIR)/stamp/.$(PKG_NAME)_prebuilt +TAR_CMD:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components 1 $(TAR_OPTIONS) + +define Package/kamailio4/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + URL:=http://www.kamailio.org/ + DEPENDS:=$(ICONV_DEPENDS) +libncurses +libpthread +libreadline +libxml2 +endef + +define Package/kamailio4 +$(call Package/kamailio4/Default) + TITLE:=Mature and flexible open source SIP server, v$(PKG_VERSION) + MENU:=1 +endef + +define Package/kamailio4/conffiles +/etc/default/kamailio +/etc/kamailio/kamailio.cfg +/etc/kamailio/kamailio-advanced.cfg +/etc/kamailio/dictionary.kamailio +/etc/kamailio/kamctlrc +endef + +define Package/kamailio4/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/sbin/kam{ailio,cmd,ctl,dbctl} \ + $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib/kamailio/modules + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/lib/kamailio/lib*.so* \ + $(1)/usr/lib/kamailio/ + $(INSTALL_DIR) $(1)/etc/kamailio + $(CP) \ + $(PKG_INSTALL_DIR)/etc/kamailio/{dictionary.kamailio,kamailio-advanced.cfg,kamailio.cfg,kamctlrc} \ + $(1)/etc/kamailio/ + $(INSTALL_DIR) $(1)/etc/default + $(CP) \ + ./files/kamailio.default \ + $(1)/etc/default/kamailio + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) \ + ./files/kamailio.init \ + $(1)/etc/init.d/kamailio + $(INSTALL_DIR) $(1)/usr/lib/kamailio + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/kamailio/kamctl \ + $(1)/usr/lib/kamailio/ +endef + +define Package/kamailio4/install/dbfiles + $(INSTALL_DIR) $(1)/usr/share/kamailio/$(2) + $(CP) $(PKG_INSTALL_DIR)/usr/share/kamailio/$(2)/* $(1)/usr/share/kamailio/$(2)/ +endef + +define Package/kamailio4/install/module + $(INSTALL_DIR) $(1)/usr/lib/kamailio/modules + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/kamailio/modules/*$(2).so* $(1)/usr/lib/kamailio/modules/ +endef + +define BuildKamailio4Module + define Package/kamailio4-mod-$(subst _,-,$(1)) + $$(call Package/kamailio4/Default) + TITLE:= kamailio4 $(2) module + DEPENDS:=kamailio4 $(4) + endef + + define Package/kamailio4-mod-$(subst _,-,$(1))/description +This package provides support for $(3) in Kamailio. + endef + + define Package/kamailio4-mod-$(subst _,-,$(1))/install +$(call Package/kamailio4/install/module,$$(1),$(1)) +$(foreach d,$(5),$(call Package/kamailio4/install/dbfiles,$$(1),$(d));) + endef + + INCL_MODULES+=$(1) + KAM_MODULES+=kamailio4-mod-$(subst _,-,$(1)) +endef + +################################ +# Kamailio module parameters +# Params: +# 1 - Module name +# 2 - Module title +# 3 - Module description +# 4 - Dependencies +# 5 - Kamailio DB files +################################ + +$(eval $(call BuildKamailio4Module,acc,Accounting,,+kamailio4-mod-tm)) +$(eval $(call BuildKamailio4Module,alias_db,Database-backend aliases,,+kamailio4-mod-db-sqlite)) +$(eval $(call BuildKamailio4Module,auth,Authentication Framework,,)) +$(eval $(call BuildKamailio4Module,auth_db,Database-backend authentication,,+kamailio4-mod-auth +kamailio4-mod-db-sqlite)) +$(eval $(call BuildKamailio4Module,auth_diameter,Diameter-backend authentication,,+kamailio4-mod-sl)) +$(eval $(call BuildKamailio4Module,avpops,AVP operation,,)) +$(eval $(call BuildKamailio4Module,benchmark,Config benchmark,,)) +$(eval $(call BuildKamailio4Module,cfgutils,Config utilities,,)) +$(eval $(call BuildKamailio4Module,cfg_db,Load core and module parameters from database,,+kamailio4-mod-db-sqlite)) +$(eval $(call BuildKamailio4Module,cfg_rpc,Update core and module parameters at runtime via RPC interface,,)) +$(eval $(call BuildKamailio4Module,cnxcc,Limit call duration,,+kamailio4-mod-dialog)) +$(eval $(call BuildKamailio4Module,corex,Legacy functions,,)) +$(eval $(call BuildKamailio4Module,ctl,BINRPC transport interface,,)) +$(eval $(call BuildKamailio4Module,db_flatstore,Fast writing-only text database-backed,,)) +$(eval $(call BuildKamailio4Module,db_mysql,MySQL database-backend,,+libmysqlclient,mysql)) +$(eval $(call BuildKamailio4Module,db_postgres,PostgreSQL Database-backend,,+libpq,postgres)) +$(eval $(call BuildKamailio4Module,db_sqlite,Sqlite DB support,,+libsqlite3,db_sqlite)) +$(eval $(call BuildKamailio4Module,db_text,Text database-backend,,,dbtext/kamailio)) +$(eval $(call BuildKamailio4Module,db_unixodbc,UnixODBC Database-backend,,+unixodbc)) +$(eval $(call BuildKamailio4Module,dialog,Dialog support,,+kamailio4-mod-rr +kamailio4-mod-tm)) +$(eval $(call BuildKamailio4Module,dialog_ng,Dialog support,,+kamailio4-mod-rr +kamailio4-mod-tm)) +$(eval $(call BuildKamailio4Module,dialplan,Dialplan management,,)) +$(eval $(call BuildKamailio4Module,dispatcher,Dispatcher,,)) +$(eval $(call BuildKamailio4Module,diversion,Diversion header insertion,,)) +$(eval $(call BuildKamailio4Module,domain,Multi-domain support,,)) +$(eval $(call BuildKamailio4Module,domainpolicy,Domain policy,,)) +$(eval $(call BuildKamailio4Module,enum,ENUM lookup,,)) +$(eval $(call BuildKamailio4Module,exec,External exec,,)) +$(eval $(call BuildKamailio4Module,group,Database-backend user-groups,,)) +$(eval $(call BuildKamailio4Module,h350,H.350,,+kamailio4-mod-ldap +libopenldap)) +$(eval $(call BuildKamailio4Module,htable,Hash Table,,)) +$(eval $(call BuildKamailio4Module,imc,IM conferencing,,+kamailio4-mod-db-mysql +kamailio4-mod-tm)) +$(eval $(call BuildKamailio4Module,ipops,IP and IPv6 operations,,)) +$(eval $(call BuildKamailio4Module,json,Access to JSON document attributes,,+libjson)) +$(eval $(call BuildKamailio4Module,kex,Core extensions,,)) +$(eval $(call BuildKamailio4Module,lcr,Least Cost Routing,,+kamailio4-mod-tm +libpcre)) +$(eval $(call BuildKamailio4Module,ldap,LDAP connector,,+libopenldap)) +$(eval $(call BuildKamailio4Module,maxfwd,Max-Forward processor,,)) +$(eval $(call BuildKamailio4Module,mediaproxy,Automatic NAT traversal,,+kamailio4-mod-dialog)) +$(eval $(call BuildKamailio4Module,mi_datagram,Datagram support for Management Interface,,)) +$(eval $(call BuildKamailio4Module,mi_fifo,FIFO support for Management Interface,,)) +$(eval $(call BuildKamailio4Module,mi_rpc,RPC support for Management Interface,,)) +$(eval $(call BuildKamailio4Module,msilo,SIP message silo,,+kamailio4-mod-tm)) +$(eval $(call BuildKamailio4Module,msrp,MSRP routing engine,,+kamailio4-mod-tls)) +$(eval $(call BuildKamailio4Module,nathelper,NAT helper,,+kamailio4-mod-usrloc)) +$(eval $(call BuildKamailio4Module,nat_traversal,NAT traversal,,+kamailio4-mod-dialog +kamailio4-mod-sl +kamailio4-mod-tm)) +$(eval $(call BuildKamailio4Module,path,SIP path insertion,,+kamailio4-mod-rr)) +$(eval $(call BuildKamailio4Module,pdt,Prefix-to-Domain translator,,)) +$(eval $(call BuildKamailio4Module,permissions,Permissions control,,)) +$(eval $(call BuildKamailio4Module,pike,Flood detector,,)) +$(eval $(call BuildKamailio4Module,presence,Presence server,,+kamailio4-mod-sl +kamailio4-mod-tm +libxml2)) +$(eval $(call BuildKamailio4Module,presence_dialoginfo,Dialog Event presence,,+kamailio4-mod-presence)) +$(eval $(call BuildKamailio4Module,presence_mwi,Message Waiting Indication presence,,+kamailio4-mod-presence)) +$(eval $(call BuildKamailio4Module,presence_xml,XCAP presence,,+kamailio4-mod-presence +kamailio4-mod-xcap-client)) +$(eval $(call BuildKamailio4Module,pua,Presence User Agent,,+kamailio4-mod-tm +libxml2)) +$(eval $(call BuildKamailio4Module,pua_bla,Bridged Line Appearence PUA,,+kamailio4-mod-presence +kamailio4-mod-pua +kamailio4-mod-usrloc)) +$(eval $(call BuildKamailio4Module,pua_dialoginfo,Dialog Event PUA,,+kamailio4-mod-dialog +kamailio4-mod-pua)) +$(eval $(call BuildKamailio4Module,pua_mi,PUA Management Interface,,+kamailio4-mod-pua)) +$(eval $(call BuildKamailio4Module,pua_usrloc,PUA User Location,,+kamailio4-mod-pua +kamailio4-mod-usrloc)) +$(eval $(call BuildKamailio4Module,pua_xmpp,PUA XMPP,,+kamailio4-mod-presence +kamailio4-mod-pua +kamailio4-mod-xmpp)) +$(eval $(call BuildKamailio4Module,pv,Pseudo-Variables,,)) +$(eval $(call BuildKamailio4Module,qos,QoS control,,+kamailio4-mod-dialog)) +$(eval $(call BuildKamailio4Module,ratelimit,Traffic shapping,,)) +$(eval $(call BuildKamailio4Module,regex,Regular Expression,,+libpcre)) +$(eval $(call BuildKamailio4Module,registrar,SIP Registrar,,+kamailio4-mod-usrloc)) +$(eval $(call BuildKamailio4Module,rls,Resource List Server,,+kamailio4-mod-presence +kamailio4-mod-pua +kamailio4-mod-tm +libxml2)) +$(eval $(call BuildKamailio4Module,rr,Record-Route and Route,,)) +$(eval $(call BuildKamailio4Module,rtimer,Routing Timer,,)) +$(eval $(call BuildKamailio4Module,rtpengine,RTP engine,,+kamailio4-mod-tm)) +$(eval $(call BuildKamailio4Module,rtpproxy,RTP proxy,,+kamailio4-mod-tm)) +$(eval $(call BuildKamailio4Module,sanity,SIP sanity checks,,+kamailio4-mod-sl)) +$(eval $(call BuildKamailio4Module,sipcapture,SIP capture,,)) +$(eval $(call BuildKamailio4Module,siptrace,SIP trace,,)) +$(eval $(call BuildKamailio4Module,siputils,SIP utilities,,+kamailio4-mod-sl)) +$(eval $(call BuildKamailio4Module,sl,Stateless replier,,)) +$(eval $(call BuildKamailio4Module,sms,SIP-to-SMS IM gateway,,+kamailio4-mod-tm)) +$(eval $(call BuildKamailio4Module,speeddial,Per-user speed-dial controller,,)) +$(eval $(call BuildKamailio4Module,sqlops,SQL operations,,)) +$(eval $(call BuildKamailio4Module,statistics,Script statistics,,)) +$(eval $(call BuildKamailio4Module,stun,STUN server support,,)) +$(eval $(call BuildKamailio4Module,sst,SIP Session Timer,,+kamailio4-mod-dialog +kamailio4-mod-sl)) +$(eval $(call BuildKamailio4Module,textops,Text operations,,)) +$(eval $(call BuildKamailio4Module,tls,TLS operations,,+libopenssl)) +$(eval $(call BuildKamailio4Module,topoh,Topology hiding,,+kamailio4-mod-rr)) +$(eval $(call BuildKamailio4Module,tm,Transaction,,)) +$(eval $(call BuildKamailio4Module,tmx,Transaction module extensions,,)) +$(eval $(call BuildKamailio4Module,uac,User Agent Client,,+kamailio4-mod-tm)) +$(eval $(call BuildKamailio4Module,uac_redirect,User Agent Client redirection,,+kamailio4-mod-tm)) +$(eval $(call BuildKamailio4Module,uri_db,Database-backend SIP URI checking,,)) +$(eval $(call BuildKamailio4Module,userblacklist,User blacklists,,)) +$(eval $(call BuildKamailio4Module,usrloc,User location,,)) +$(eval $(call BuildKamailio4Module,utils,Misc utilities,,+libcurl +libxml2)) +$(eval $(call BuildKamailio4Module,xcap_client,XCAP Client,,+libcurl)) +$(eval $(call BuildKamailio4Module,xlog,Advanced logger,,)) +$(eval $(call BuildKamailio4Module,xmpp,SIP-to-XMPP Gateway,,+kamailio4-mod-tm +libexpat)) + +PKG_MAKE_ARGS:= \ + prefix=/ \ + cfg_dir=/etc/kamailio/ \ + bin_dir=/usr/sbin/ \ + data_dir=/usr/share/kamailio/ \ + lib_dir=/usr/lib/kamailio/ \ + modules_dir=/usr/lib/kamailio/ \ + include_modules="$(INCL_MODULES)" \ + cfg_target:=/etc/kamailio/ \ + TLS_HOOKS=1 \ + extra_defs="-DUSE_PTHREAD_MUTEX " \ + CFLAGS="$(TARGET_CFLAGS)" \ + LOCALBASE="$(STAGING_DIR)/usr" \ + SYSBASE="$(STAGING_DIR)/usr" \ + PCREDEFS:="$(TARGET_CPPFLAGS)" \ + PCRELIBS:="$(TARGET_LDFLAGS)" \ + CROSS_COMPILE=$(TARGET_CROSS) \ + CC="$(TARGET_CC)" \ + ARCH="$(ARCH)" \ + DESTDIR=$(PKG_INSTALL_DIR) \ + quiet=verbose + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) $(PKG_MAKE_ARGS) \ + EXTRA_LIBS=-L$(STAGING_DIR)/usr/lib/ \ + all + $(MAKE) -C $(PKG_BUILD_DIR) $(PKG_MAKE_ARGS) \ + install +endef + +$(eval $(call BuildPackage,kamailio4)) +$(foreach m,$(KAM_MODULES),$(eval $(call BuildPackage,$(m)))) diff --git a/net/kamailio-4.x/files/kamailio.default b/net/kamailio-4.x/files/kamailio.default new file mode 100644 index 00000000000..1fc875db17b --- /dev/null +++ b/net/kamailio-4.x/files/kamailio.default @@ -0,0 +1,14 @@ +# +# Kamailio startup options +# + +# Set to yes to enable kamailio, once configured properly. +#RUN_KAMAILIO=yes + +# Amount of shared and private memory to allocate +# for the running Kamailio server (in Mb) +#SHM_MEMORY=64 +#PKG_MEMORY=4 + +# Config file +#CFGFILE=/etc/kamailio/kamailio.cfg diff --git a/net/kamailio-4.x/files/kamailio.init b/net/kamailio-4.x/files/kamailio.init new file mode 100644 index 00000000000..6d66c5aee61 --- /dev/null +++ b/net/kamailio-4.x/files/kamailio.init @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2014 OpenWrt.org + +START=99 + +BINFILE=/usr/sbin/kamailio +PIDFILE=/var/run/kamailio.pid +DEFAULTS=/etc/default/kamailio +CFGFILE=/etc/kamailio/kamailio.cfg +SHM_MEMORY=8 +PKG_MEMORY=2 +RUN_KAMAILIO=no + +start() { + # Load startup options if available + if [ -f $DEFAULTS ]; then + . $DEFAULTS + fi + + if [ "$RUN_KAMAILIO" != "yes" ]; then + echo "[WARNING] Kamailio not yet configured. Edit /etc/default/kamailio first." + else + start-stop-daemon -S -x $BINFILE -b -- -P $PIDFILE -f $CFGFILE -m $SHM_MEMORY -M $PKG_MEMORY + fi +} + +stop() { + start-stop-daemon -K -x $BINFILE -p $PIDFILE -q + rm -rf $PID_FILE +} diff --git a/net/kamailio-4.x/patches/050-fix-kamailio-utils.patch b/net/kamailio-4.x/patches/050-fix-kamailio-utils.patch new file mode 100644 index 00000000000..68c9ddd31d7 --- /dev/null +++ b/net/kamailio-4.x/patches/050-fix-kamailio-utils.patch @@ -0,0 +1,78 @@ +--- a/utils/kamctl/kamctl ++++ b/utils/kamctl/kamctl +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + # + # control tool for maintaining Kamailio + # +--- a/utils/kamctl/kamctlrc ++++ b/utils/kamctl/kamctlrc +@@ -147,3 +147,6 @@ + ## Extra start options - default is: not set + # example: start Kamailio with 64MB share memory: STARTOPTIONS="-m 64" + # STARTOPTIONS= ++ ++# Disable colour printing in terminal ++NOHLPRINT=1 +--- a/utils/kamctl/kamdbctl ++++ b/utils/kamctl/kamdbctl +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + # + # control tool for maintaining Kamailio databases + # +--- a/utils/kamctl/kamdbctl.base ++++ b/utils/kamctl/kamdbctl.base +@@ -33,18 +33,18 @@ INSTALL_DBUID_TABLES=${INSTALL_DBUID_TAB + + # Used by dbtext and db_berkeley to define tables to be created, used by + # postgres to do the grants +-STANDARD_TABLES=${STANDARD_TABLES:-version acc dbaliases domain domain_attrs +- grp uri speed_dial lcr_gw lcr_rule lcr_rule_target pdt subscriber +- location location_attrs re_grp trusted address missed_calls +- usr_preferences aliases silo dialog dialog_vars dispatcher dialplan ++STANDARD_TABLES=${STANDARD_TABLES:-version acc dbaliases domain domain_attrs \ ++ grp uri speed_dial lcr_gw lcr_rule lcr_rule_target pdt subscriber \ ++ location location_attrs re_grp trusted address missed_calls \ ++ usr_preferences aliases silo dialog dialog_vars dispatcher dialplan \ + acc_cdrs} +-EXTRA_TABLES=${EXTRA_TABLES:-imc_members imc_rooms cpl sip_trace domainpolicy +- carrierroute carrier_name domain_name carrierfailureroute userblacklist +- globalblacklist htable purplemap uacreg pl_pipes mtree mtrees ++EXTRA_TABLES=${EXTRA_TABLES:-imc_members imc_rooms cpl sip_trace domainpolicy \ ++ carrierroute carrier_name domain_name carrierfailureroute userblacklist \ ++ globalblacklist htable purplemap uacreg pl_pipes mtree mtrees \ + sca_subscriptions mohqcalls mohqueues rtpproxy} +-PRESENCE_TABLES=${PRESENCE_TABLES:-presentity active_watchers watchers xcap ++PRESENCE_TABLES=${PRESENCE_TABLES:-presentity active_watchers watchers xcap \ + pua rls_presentity rls_watchers} +-DBUID_TABLES=${UID_TABLES:-uid_credentials uid_domain uid_domain_attrs ++DBUID_TABLES=${UID_TABLES:-uid_credentials uid_domain uid_domain_attrs \ + uid_global_attrs uid_uri uid_uri_attrs uid_user_attrs} + + # SQL definitions +@@ -68,17 +68,17 @@ GREP=${GREP:-grep} + SED=${SED:-sed} + + # define what modules should be installed +-STANDARD_MODULES=${STANDARD_MODULES:-standard acc lcr domain group +- permissions registrar usrloc msilo alias_db uri_db speeddial ++STANDARD_MODULES=${STANDARD_MODULES:-standard acc lcr domain group \ ++ permissions registrar usrloc msilo alias_db uri_db speeddial \ + avpops auth_db pdt dialog dispatcher dialplan} + + PRESENCE_MODULES=${PRESENCE_MODULES:-presence rls} + +-EXTRA_MODULES=${EXTRA_MODULES:-imc cpl siptrace domainpolicy carrierroute +- userblacklist htable purple uac pipelimit mtree sca mohqueue ++EXTRA_MODULES=${EXTRA_MODULES:-imc cpl siptrace domainpolicy carrierroute \ ++ userblacklist htable purple uac pipelimit mtree sca mohqueue \ + rtpproxy} + +-DBUID_MODULES=${UID_MODULES:-uid_auth_db uid_avp_db uid_domain uid_gflags ++DBUID_MODULES=${UID_MODULES:-uid_auth_db uid_avp_db uid_domain uid_gflags \ + uid_uri_db} + + ############################################################ diff --git a/net/miax/Makefile b/net/miax/Makefile new file mode 100644 index 00000000000..2f99f3245b3 --- /dev/null +++ b/net/miax/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2014 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:=miax +PKG_VERSION:=1.4 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/miax +PKG_MD5SUM:=44f0d2ef46ee2697d890b7b96846adc7 +PKG_CHECK_FORMAT_SECURITY:=0 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=COPYING LICENSE + +include $(INCLUDE_DIR)/package.mk + +define Package/miax + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + DEPENDS:=+libpthread + TITLE:=A console iax (asterisk) client + URL:=http://www.eja.it/?l=en&n=miax +endef + +define Package/miax/description + miax is a console iax (asterisk) client, it can work with + a soundcard as a normal voip phone, taking input/output from + keyboard or analog/gsm/isdn modem. +endef + +define Build/Compile + $(MAKE) -C "$(PKG_BUILD_DIR)" \ + CC="$(TARGET_CC)" \ + OFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="$(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + all +endef + +define Package/miax/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/miax $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,miax)) diff --git a/net/miax/patches/001-cross.patch b/net/miax/patches/001-cross.patch new file mode 100644 index 00000000000..f47c1101d9d --- /dev/null +++ b/net/miax/patches/001-cross.patch @@ -0,0 +1,24 @@ +diff -ruN miax-1.4-old/Makefile miax-1.4-new/Makefile +--- miax-1.4-old/Makefile 2005-04-27 18:56:13.000000000 +0200 ++++ miax-1.4-new/Makefile 2005-11-30 01:07:21.000000000 +0100 +@@ -1,4 +1,5 @@ +-CFLAGS= -Iiax/ -Igsm/inc -DIAXC_IAX2 -DLIBIAX -g -DPOSIXSLEEP -DLINUX -O2 ++OFLAGS= -02 -g ++CFLAGS= -Iiax/ -Igsm/inc $(CPPFLAGS) -DIAXC_IAX2 -DLIBIAX -DPOSIXSLEEP -DLINUX $(OFLAGS) + SYSLIBS=-lpthread -lm -lbluetooth + + +@@ -32,11 +33,10 @@ + miax.o + + all: $(OBJS) +- gcc $(OBJS) $(CFLAGS) $(SYSLIBS) -o miax +- cp miax /bin/miax ++ $(CC) $(OBJS) $(CFLAGS) $(LDFLAGS) $(SYSLIBS) -o miax + + static: $(OBJS) bluetooth.o +- gcc $(OBJS) $(CFLAGS) $(SYSLIBS) -static -o miax ++ $(CC) $(OBJS) $(CFLAGS) $(LDFLAGS) $(SYSLIBS) -static -o miax + + clean: + rm -f $(OBJS) miax diff --git a/net/miax/patches/002-remove-bluetooth-support.patch b/net/miax/patches/002-remove-bluetooth-support.patch new file mode 100644 index 00000000000..02532e04979 --- /dev/null +++ b/net/miax/patches/002-remove-bluetooth-support.patch @@ -0,0 +1,465 @@ +--- a/bluetooth.c ++++ b/bluetooth.c +@@ -1,345 +0,0 @@ +-/* +-* Miax +-* +-* Copyright (C) 2004 by Ubaldo Porcheddu +-* +-* This program is free software; you can redistribute it and/or modify +-* it under the terms of the GNU General Public License as published by +-* the Free Software Foundation; either version 2 of the License, or +-* (at your option) any later version. +-* +-* This program is distributed in the hope that it will be useful, +-* but WITHOUT ANY WARRANTY; without even the implied warranty of +-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-* General Public License for more details. +-* +-* You should have received a copy of the GNU General Public License +-* along with this program; if not, write to the Free Software +-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-*/ +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include "iaxclient_lib.h" +- +-#define RTP 320 +-#define AFRAME 48 +- +-static int fd_audio, il=0, ol=0, audio=0, compression=0; +-static char dev_audio[10], in[512], out[512]; +-static int fd_modem, call=0, callsetup=0, m_status=0; +-static bdaddr_t src, dst; +-static int btchannel=3; +-static int init=0; +-extern int debug; +- +-int bt_init(char *devs) { +- int l; +- +- if (init == 0) { +- l=strlen(devs); +- str2ba(strtok(devs,"/"), &src); +- str2ba(strtok(NULL,"/"), &dst); +- if (l > 35) { btchannel=atoi(strtok(NULL,"/")); } +- init=1; +- } +- return 0; +- } +- +- +-int rfcomm_connect(bdaddr_t *src, bdaddr_t *dst, int channel) { +- +- struct sockaddr_rc addr; +- int s; +- +- if ((s = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)) < 0) { +- return -1; +- } +- memset(&addr, 0, sizeof(addr)); +- addr.rc_family = AF_BLUETOOTH; +- bacpy(&addr.rc_bdaddr, src); +- addr.rc_channel = 0; +- if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) { +- close(s); +- return -1; +- } +- memset(&addr, 0, sizeof(addr)); +- addr.rc_family = AF_BLUETOOTH; +- bacpy(&addr.rc_bdaddr, dst); +- addr.rc_channel = channel; +- if (connect(s, (struct sockaddr *)&addr, sizeof(addr)) < 0 ){ +- close(s); +- return -1; +- } +- +- return s; +- } +- +- +-int sco_connect(bdaddr_t *src, bdaddr_t *dst) { +- +- struct sockaddr_sco addr; +- struct sco_conninfo conn; +- struct sco_options opts; +- int s, size; +- +- if ((s = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_SCO)) < 0) { +- return -1; +- } +- memset(&addr, 0, sizeof(addr)); +- addr.sco_family = AF_BLUETOOTH; +- bacpy(&addr.sco_bdaddr, src); +- if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) { +- close(s); +- return -1; +- } +- memset(&addr, 0, sizeof(addr)); +- addr.sco_family = AF_BLUETOOTH; +- bacpy(&addr.sco_bdaddr, dst); +- if (connect(s, (struct sockaddr *)&addr, sizeof(addr)) < 0 ){ +- close(s); +- return -1; +- } +- +- return s; +- } +- +- +-int bt_audio_init(char *dev, int enc) { +- +- compression=enc; +- return bt_init(dev); +- } +- +- +-int bt_audio_open() { +- +- if ((fd_audio = sco_connect(&src, &dst)) < 0) { +- perror("Can't connect SCO audio channel"); +- close(fd_modem); +- return -1; +- } +- audio=1; +- fprintf(stderr, "BT audio ready.\n"); +- +- return fd_audio; +- } +- +- +-int bt_audio_close() { +- +- audio=-1; +- +- return close(fd_audio); +- } +- +- +-int bt_audio_out(struct iaxc_call *call, void *encoded) { +- +- char buf[512], data[RTP]; +- int i=0,n=0,x=0,y=0,z=0; +- +- if (audio == 0) { bt_audio_open(); } +- if (audio == 1) { +- +- y=RTP+ol; +- memmove(buf,out,ol); +- +- if (compression == 0) { +- memmove(data,encoded,RTP); +- } +- else { +- if (!call->gsmin) { call->gsmin = gsm_create(); } +- gsm_decode(call->gsmin, encoded, data); +- } +- +- for(i=ol;i 0) { +- if (debug > 4) { fprintf(stderr, "Miax: dtmf %c\n", dtmf_c); } +- iax_send_dtmf(call->session,dtmf_c); +- } +- +- if ( compression == 0) { +- iax_send_voice(call->session, AST_FORMAT_SLINEAR, buf , RTP); +- } +- else { +- if(!call->gsmout) { call->gsmout = gsm_create(); } +- gsm_encode(call->gsmout, (short *) buf, (void *)&fo); +- iax_send_voice(call->session, AST_FORMAT_GSM, (char *)&fo, sizeof(gsm_frame)); +- } +- } +- +- return 1; +- } +- +- +-int bt_modem_init(char *dev) { +- +- char *buf,tmp[1024]; +- int n=0,z=-1; +- +- bt_init(dev); +- +- if ((fd_modem = rfcomm_connect(&src, &dst, btchannel)) < 0) { +- perror("Can't connect RFCOMM channel"); +- return -1; +- } +- +- bt_modem("ATZ\r",tmp); +- bt_modem("ATE1\r",tmp); +- bt_modem("AT+CIND=?\r",tmp); +- buf=strtok(tmp,"("); +- while( buf=strtok(NULL,"))") ) { +- n++; +- if (strstr(buf,"\"call\"")) { call=n; z++;} +- if (strstr(buf,"\"callsetup\"")) { callsetup=n; z++; } +- } +- +- z+=bt_modem("AT+CLIP=1\r",tmp); +- z+=bt_modem("AT+CMER=3,0,0,1\r",tmp); +- fprintf(stderr, "BT modem ready.\n"); +- +- m_status=1; +- +- return fd_modem; +- } +- +-int bt_modem_close() { +- +- char buf[256]; +- int l=0; +- +- if (m_status > 1) { +- m_status=-1; +- bt_modem("AT+CHUP\r",buf); +- l=close(fd_modem); +- } +- +- return l; +- } +- +- +-int bt_modem(char* send, char *receive) { +- +- int l=0; +- fd_set rfds; +- struct timeval tv; +- int retval; +- +- FD_ZERO(&rfds); +- FD_SET(fd_modem, &rfds); +- tv.tv_sec = 1; +- tv.tv_usec = 0; +- +- if (strlen(send)) { write(fd_modem,send,strlen(send)); } +- +- if (m_status >= 0) { +- if (retval = select(fd_modem+1, &rfds, NULL, NULL, &tv) > 0) { +- memset(receive,0,1024); +- l=read(fd_modem,receive,1024); +- if (debug > 3) { fprintf(stderr, "%s\n", receive); } +- } +- } +- +- return l; +- } +- +- +-int bt_modem_loop(int status, char *number) { +- +- char buf[1024], tmp[1024]; +- +- if (m_status < 0) { return -1; } +- +- if (status == 130 && m_status != 3) { +- bt_modem("ATA\r",tmp); +- m_status=3; +- status=0; +- return 100; +- } +- if (status == 100 && m_status != 2) { +- sprintf(buf,"ATDT%s;\r",number); +- bt_modem(buf,tmp); +- status=0; +- m_status=2; +- } +- +- +- if (bt_modem("",buf)) { +- +- sprintf(tmp,"+CIEV: %d,0",callsetup); +- if (strstr(buf,tmp) && m_status != 5) { +- m_status=5; +- return 130; +- } +- +- sprintf(tmp,"+CIEV: %d,0",call); +- if (strstr(buf,tmp)) { return -5; } +- +- if (strstr(buf,"+CLIP:") && m_status != 4) { +- strcpy(tmp,strtok(buf,"\"")); +- strcpy(number,strtok(NULL,"\"")); +- m_status=4; +- return 101; +- } +- if (strstr(buf,"ERROR")) { return 1; } +- if (strstr(buf,"BUSY")) { return -2; } +- if (strstr(buf,"NO DIALTONE")) { return -3; } +- if (strstr(buf,"NO CARRIER")) { return -4; } +- if (strstr(buf,"RING")) { return 2; } +- if (strstr(buf,"OK")) { return 1; } +- } +- +- return 0; +- } +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + OFLAGS= -02 -g + CFLAGS= -Iiax/ -Igsm/inc $(CPPFLAGS) -DIAXC_IAX2 -DLIBIAX -DPOSIXSLEEP -DLINUX $(OFLAGS) +-SYSLIBS=-lpthread -lm -lbluetooth ++SYSLIBS=-lpthread -lm + + + OBJS=\ +@@ -28,14 +28,13 @@ OBJS=\ + iax/iaxclient_lib.o \ + dtmf.o \ + oss.o \ +- bluetooth.o \ + modem.o \ + miax.o + + all: $(OBJS) + $(CC) $(OBJS) $(CFLAGS) $(LDFLAGS) $(SYSLIBS) -o miax + +-static: $(OBJS) bluetooth.o ++static: $(OBJS) + $(CC) $(OBJS) $(CFLAGS) $(LDFLAGS) $(SYSLIBS) -static -o miax + + clean: +--- a/miax.c ++++ b/miax.c +@@ -130,7 +130,6 @@ void usage() { + fprintf(stderr, " -a audio device\n"); + fprintf(stderr, " -g gsm codec\n"); + fprintf(stderr, " -m modem device\n"); +- fprintf(stderr, " -b bluetooth device\n"); + fprintf(stderr, " -i modem init string\n"); + fprintf(stderr, " -l log level\n"); + fprintf(stderr, " -o log output\n"); +--- a/miax.h ++++ b/miax.h +@@ -23,55 +23,53 @@ + + int debug=0; + int status=0; +-int bt; //bluetooth ++int bt; //bluetooth + int m=0; //modem + char number[1024]; + +-int audio_init(char *dev, int compression) { +- (bt) ? bt_audio_init(dev, compression) : oss_audio_init(dev, compression); ++int audio_init(char *dev, int compression) { ++ oss_audio_init(dev, compression); + } + +-int audio_open() { +- (bt) ? bt_audio_open() : oss_audio_open(); ++int audio_open() { ++ oss_audio_open(); + } + +-int audio_out(struct iaxc_call *call, void *encoded) { +- (bt) ? bt_audio_out(call,encoded) : oss_audio_out(call,encoded) ; ++int audio_out(struct iaxc_call *call, void *encoded) { ++ oss_audio_out(call,encoded) ; + } + +-int audio_in(struct iaxc_call *call) { +- (bt) ? bt_audio_in(call) : oss_audio_in(call) ; ++int audio_in(struct iaxc_call *call) { ++ oss_audio_in(call) ; + } + +-int audio_close () { +- (bt) ? bt_audio_close() : oss_audio_close() ; ++int audio_close () { ++ oss_audio_close() ; + } + +-int modem_init(char *dev) { +- (bt) ? bt_modem_init(dev) : tty_modem_init(dev) ; ++int modem_init(char *dev) { ++ tty_modem_init(dev) ; + } + +-int modem(char *val) { ++int modem(char *val) { + char tmp[1024]; +- +- (bt) ? bt_modem(val, tmp) : tty_modem(val, tmp) ; ++ ++ tty_modem(val, tmp) ; + } + +-int modem_close() { +- (bt) ? bt_modem_close() : tty_modem_close() ; ++int modem_close() { ++ tty_modem_close() ; + } + +-int modem_loop(int status, char *number) { +- if (bt) { return bt_modem_loop(status, number); } +- else { return tty_modem_loop(status, number); } ++int modem_loop(int status, char *number) { ++ return tty_modem_loop(status, number); + } + + int miax_loop(int status, char *number) { +- if (m > 0 && bt > 0) { return bt_modem_loop(status, number); } +- if (m > 0 && bt == 0) { return tty_modem_loop(status, number); } +- if (m == 0) { ++ if (m > 0) { return tty_modem_loop(status, number); } ++ if (m == 0) { + printf("\nMiax console.\t[h] to hangup or quit\n"); +- return console_loop(status, number); ++ return console_loop(status, number); + } + } + #endif diff --git a/net/pcapsipdump/Makefile b/net/pcapsipdump/Makefile new file mode 100644 index 00000000000..ca26bda5724 --- /dev/null +++ b/net/pcapsipdump/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2009-2010 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:=pcapsipdump +PKG_VERSION:=0.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/pcapsipdump +PKG_MD5SUM:=2c04c54c3478f7cb94978d54538006d2 + +PKG_LICENSE:=GPL-2.0+ +PKG_LICENSE_FILES:=LICENSE + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/pcapsipdump + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + DEPENDS:=+libpcap $(CXX_DEPENDS) + TITLE:=SIP sessions dumping tool + URL:=http://sourceforge.net/projects/pcapsipdump/ +endef + +define Package/pcapsipdump/description + pcapsipdump is a tool for dumping SIP sessions (+RTP traffic, if available) to disk in a + fashion similar to "tcpdump -w" (format is exactly the same), but one file per sip session + (even if there is thousands of concurrect SIP sessions). +endef + +TARGET_CC=$(TARGET_CXX) + +define Build/Compile + $(TARGET_CONFIGURE_OPTS) \ + $(MAKE) -C $(PKG_BUILD_DIR) \ + CPPFLAGS="$(TARGET_CXXFLAGS) -fno-rtti" \ + LIBS="-lpcap" +endef + +define Package/pcapsipdump/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/pcapsipdump $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,pcapsipdump)) diff --git a/net/restund/Makefile b/net/restund/Makefile new file mode 100644 index 00000000000..46cfe7bb220 --- /dev/null +++ b/net/restund/Makefile @@ -0,0 +1,117 @@ +# +# Copyright (C) 2010-2014 OpenWrt.org +# Copyright (C) 2010 Alfred E. Heggestad +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=restund +PKG_VERSION:=0.4.2 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.creytiv.com/pub/ +PKG_MD5SUM:=dd58fc56c29f812fc14988412a3bf14a + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=docs/COPYING +PKG_MAINTAINER:=Jiri Slachta + +restund-mods:= mysql + +PKG_CONFIG_DEPENDS:= $(patsubst %,CONFIG_PACKAGE_restund-mod-%,$(restund-mods)) + +include $(INCLUDE_DIR)/package.mk + +define Package/restund/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + URL:=http://www.creytiv.com/ +endef + +define Package/restund +$(call Package/restund/Default) + TITLE:=Modular STUN/TURN server + DEPENDS:=+libre +libpthread +endef + +restund-mod-mysql := USE_MYSQL + +RESTUND_MOD_OPTIONS:= \ + $(foreach m,$(restund-mods),$(restund-mod-$(m))=$(if $(CONFIG_PACKAGE_restund-mod-$(m)),1)) + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + LIBRE_MK="$(STAGING_DIR)/usr/share/re/re.mk" \ + LIBRE_INC="$(STAGING_DIR)/usr/include/re" \ + LIBRE_SO="$(STAGING_DIR)/usr/lib" \ + CC="$(TARGET_CC)" \ + EXTRA_CFLAGS="$(TARGET_CFLAGS)" \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + SYSROOT="$$$$($(FIND) $(TOOLCHAIN_DIR) -path '*/include/pthread.h' | sed -ne '1s#/include/pthread.h##p')" \ + SYSROOT_ALT="$(STAGING_DIR)/usr" \ + RELEASE=1 \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + OS="linux" \ + $(RESTUND_MOD_OPTIONS) \ + all install +endef + +define Package/restund/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/restund $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib/restund/modules + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/restund/modules/auth.so \ + $(PKG_INSTALL_DIR)/usr/lib/restund/modules/binding.so \ + $(PKG_INSTALL_DIR)/usr/lib/restund/modules/stat.so \ + $(PKG_INSTALL_DIR)/usr/lib/restund/modules/status.so \ + $(PKG_INSTALL_DIR)/usr/lib/restund/modules/syslog.so \ + $(PKG_INSTALL_DIR)/usr/lib/restund/modules/turn.so \ + $(1)/usr/lib/restund/modules/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/etc/restund.conf $(1)/etc/ + $(SED) \ + 's|^\(module_path\)\([ \t]\+\).*$$$$|\1\2/usr/lib/restund/modules|g' \ + $(1)/etc/restund.conf + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/restund.init $(1)/etc/init.d/restund +endef + +define Package/restund/conffiles +/etc/restund.conf +endef + +# +# 1. Name +# 2. Title +# 3. Files +# 4. Depends +# +define BuildPlugin + + define Package/restund-mod-$(1) + $$(call Package/restund/Default) + TITLE:= restund $(2) module + DEPENDS:= restund $(4) + endef + + define Package/restund-mod-$(1)/install + [ -z "$(3)" ] || $(INSTALL_DIR) $$(1)/usr/lib/restund/modules + for f in $(3); do \ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/restund/modules/$$$$$$$${f}.so \ + $$(1)/usr/lib/restund/modules/ ; \ + done + endef + + $$(eval $$(call BuildPackage,restund-mod-$(1))) +endef + +$(eval $(call BuildPackage,restund)) + +$(eval $(call BuildPlugin,mysql,MySQL database backend,mysql_ser,+PACKAGE_restund-mod-mysql:libmysqlclient)) diff --git a/net/restund/files/restund.init b/net/restund/files/restund.init new file mode 100644 index 00000000000..d6360ff83af --- /dev/null +++ b/net/restund/files/restund.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# +# Copyright (C) 2010-2011 OpenWrt.org +# Copyright (C) 2010 Alfred E. Heggestad +# + +START=60 + +start() { + service_start /usr/sbin/restund +} + +stop() { + service_stop /usr/sbin/restund +} diff --git a/net/rtpproxy/Makefile b/net/rtpproxy/Makefile new file mode 100644 index 00000000000..3aed248ede2 --- /dev/null +++ b/net/rtpproxy/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2013 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:=rtpproxy +PKG_VERSION:=1.2.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://b2bua.org/chrome/site/ +PKG_MD5SUM:=b0b5d6cdce3f17cdbbac473c11a2d0e5 +PKG_CHECK_FORMAT_SECURITY:=0 +PKG_INSTALL:=1 + +PKG_LICENSE:=BSD-2-Clause +PKG_LICENSE_FILES:=COPYING + +include $(INCLUDE_DIR)/package.mk + +define Package/rtpproxy + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + DEPENDS:=+libpthread + TITLE:=RTP (Realtime Transport Protocol) proxy + URL:=http://www.rtpproxy.org/ +endef + +# uses GNU configure + +define Package/rtpproxy/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rtpproxy $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,rtpproxy)) diff --git a/net/sipp/Makefile b/net/sipp/Makefile new file mode 100644 index 00000000000..967b568e3e6 --- /dev/null +++ b/net/sipp/Makefile @@ -0,0 +1,71 @@ +# +# Copyright (C) 2013 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:=sipp +PKG_VERSION:=3.3.990 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/sipp +PKG_MD5SUM:=904fffbc277bafce28762ebb041b9620 +PKG_CHECK_FORMAT_SECURITY:=0 + +PKG_LICENSE:=GPL-2.0+ BSD-3-Clause Zlib +PKG_LICENSE_FILES:=LICENSE.txt + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/sipp + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + DEPENDS:= +libncurses +libpthread $(CXX_DEPENDS) + TITLE:=test tool / traffic generator for the SIP protocol + URL:=http://sipp.sourceforge.net/ +endef + +define Package/sipp/description + SIPp is a free Open Source test tool / traffic generator for the SIP + protocol. It includes a few basic SipStone user agent scenarios (UAC and + UAS) and establishes and releases multiple calls with the INVITE and BYE + methods. +endef + +TAR_CMD:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components 1 $(TAR_OPTIONS) + +CONFIGURE_ARGS+= \ + --build=$(GNU_HOST_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --target=$(GNU_TARGET_NAME) \ + --enable-epoll \ + --without-gsl \ + --without-pcap \ + --with-rtpstream \ + --without-sctp + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CC_linux="$(TARGET_CXX)" \ + CPP_linux="$(TARGET_CXX)" \ + CCLINK_linux="$(TARGET_CXX)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS_linux="$(TARGET_CPPFLAGS) -fno-rtti" \ + LFLAGS_linux="$(TARGET_LDFLAGS)" \ + LIBS="-lncurses -ldl -lpthread -lm" \ + all +endef + +define Package/sipp/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/sipp $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,sipp)) diff --git a/net/siproxd/Makefile b/net/siproxd/Makefile new file mode 100644 index 00000000000..57be9c54a3a --- /dev/null +++ b/net/siproxd/Makefile @@ -0,0 +1,89 @@ +# +# Copyright (C) 2014 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:=siproxd +PKG_VERSION:=0.8.1 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/siproxd +PKG_MD5SUM:=1a6f9d13aeb2d650375c9a346ac6cbaf + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +PKG_LICENSE:=GPL-2.0+ +PKG_LICENSE_FILES:=COPYING + +include $(INCLUDE_DIR)/package.mk + +define Package/siproxd/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + URL:=http://siproxd.sourceforge.net/ +endef + +define Package/siproxd + $(call Package/siproxd/Default) + DEPENDS:=+libltdl +libpthread +libosip2 + TITLE:=SIP (Session Initiation Protocol) proxy + MENU:=1 +endef + +define Package/siproxd/description + Siproxd is a proxy/masquerading daemon for the SIP protocol. +endef + +define Package/siproxd/conffiles +/etc/config/siproxd +endef + +CONFIGURE_ARGS+= \ + --with-libosip-prefix="$(STAGING_DIR)/usr" \ + --disable-doc + +MAKE_FLAGS+= \ + SUBDIRS="src scripts contrib" \ + LIBLTDL="$(STAGING_DIR)/usr/lib/libltdl.la" \ + +define Package/siproxd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/siproxd $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/siproxd.config $(1)/etc/config/siproxd + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/siproxd.init $(1)/etc/init.d/siproxd +endef + +define BuildPlugin + define Package/siproxd-mod-$(1) + $$(call Package/siproxd/Default) + TITLE:= siproxd $(1) plugin + DEPENDS:=siproxd + endef + + define Package/siproxd-mod-$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib/siproxd + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/siproxd/plugin_$(1)*.so* $$(1)/usr/lib/siproxd + endef + + $$(eval $$(call BuildPackage,siproxd-mod-$(1))) +endef + +$(eval $(call BuildPackage,siproxd)) +$(eval $(call BuildPlugin,defaulttarget)) +$(eval $(call BuildPlugin,demo)) +$(eval $(call BuildPlugin,fix_bogus_via)) +$(eval $(call BuildPlugin,logcall)) +$(eval $(call BuildPlugin,prefix)) +$(eval $(call BuildPlugin,regex)) +$(eval $(call BuildPlugin,shortdial)) +$(eval $(call BuildPlugin,stun)) diff --git a/net/siproxd/files/siproxd.config b/net/siproxd/files/siproxd.config new file mode 100644 index 00000000000..b65148c7edb --- /dev/null +++ b/net/siproxd/files/siproxd.config @@ -0,0 +1,3 @@ +config siproxd general + option if_inbound lan + option if_outbound wan diff --git a/net/siproxd/files/siproxd.init b/net/siproxd/files/siproxd.init new file mode 100644 index 00000000000..1ad6e0fa4ca --- /dev/null +++ b/net/siproxd/files/siproxd.init @@ -0,0 +1,235 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008 Alina Friedrichsen +# Copyright (C) 2011 OpenWrt.org + +START=50 + +SERVICE_USE_PID=1 + +siproxd_bin="/usr/sbin/siproxd" +siproxd_conf_dir="/var/etc" +siproxd_conf_prefix="$siproxd_conf_dir/siproxd-" +siproxd_registration_dir="/var/lib/siproxd" +siproxd_pid_dir="/var/run/siproxd" + +deal_with_lists () { + echo "$2" = "$1" >> "$siproxd_conf_prefix$cfg" +} + +start_instance() { + local cfg="$1" + + config_get if_inbound "$cfg" if_inbound + config_get if_outbound "$cfg" if_outbound + config_get host_outbound "$cfg" host_outbound + config_get hosts_allow_reg "$cfg" hosts_allow_reg + config_get hosts_allow_sip "$cfg" hosts_allow_sip + config_get hosts_deny_sip "$cfg" hosts_deny_sip + config_get sip_listen_port "$cfg" sip_listen_port 5060 + config_get_bool daemonize "$cfg" daemonize 1 + config_get silence_log "$cfg" silence_log 4 + config_get user "$cfg" user nobody + config_get chrootjail "$cfg" chrootjail + config_get registration_file "$cfg" registration_file "$siproxd_registration_dir/siproxd_registrations-$cfg" + config_get autosave_registrations "$cfg" autosave_registrations 300 + config_get pid_file "$cfg" pid_file "$siproxd_pid_dir/siproxd-$cfg.pid" + config_get_bool rtp_proxy_enable "$cfg" rtp_proxy_enable 1 + config_get rtp_port_low "$cfg" rtp_port_low 7070 + config_get rtp_port_high "$cfg" rtp_port_high 7089 + config_get rtp_timeout "$cfg" rtp_timeout 300 + config_get rtp_dscp "$cfg" rtp_dscp 46 + config_get sip_dscp "$cfg" sip_dscp 0 + config_get rtp_input_dejitter "$cfg" rtp_input_dejitter 0 + config_get rtp_output_dejitter "$cfg" rtp_output_dejitter 0 + config_get tcp_timeout "$cfg" tcp_timeout 600 + config_get tcp_connect_timeout "$cfg" tcp_connect_timeout 500 + config_get tcp_keepalive "$cfg" tcp_keepalive 20 + config_get default_expires "$cfg" default_expires 600 + config_get proxy_auth_realm "$cfg" proxy_auth_realm + config_get proxy_auth_passwd "$cfg" proxy_auth_passwd + config_get proxy_auth_pwfile "$cfg" proxy_auth_pwfile + config_get debug_level "$cfg" debug_level 0x00000000 + config_get debug_port "$cfg" debug_port 0 + config_get mask_host "$cfg" mask_host + config_get masked_host "$cfg" masked_host + config_get ua_string "$cfg" ua_string Siproxd-UA + config_get use_rport "$cfg" use_rport 0 + config_get outbound_proxy_host "$cfg" outbound_proxy_host + config_get outbound_proxy_port "$cfg" outbound_proxy_port + config_get outbound_domain_name "$cfg" outbound_domain_name + config_get outbound_domain_host "$cfg" outbound_domain_host + config_get outbound_domain_port "$cfg" outbound_domain_port + + if [ -f "$siproxd_conf_prefix$cfg" ]; then + rm "$siproxd_conf_prefix$cfg" + fi + if [ -n "$if_inbound" ]; then + echo if_inbound = "$if_inbound" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$if_outbound" ]; then + echo if_outbound = "$if_outbound" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$host_outbound" ]; then + echo host_outbound = "$host_outbound" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$hosts_allow_reg" ]; then + echo hosts_allow_reg = "$hosts_allow_reg" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$hosts_allow_sip" ]; then + echo hosts_allow_sip = "$hosts_allow_sip" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$hosts_deny_sip" ]; then + echo hosts_deny_sip = "$hosts_deny_sip" >> "$siproxd_conf_prefix$cfg" + fi + echo sip_listen_port = "$sip_listen_port" >> "$siproxd_conf_prefix$cfg" + echo daemonize = "$daemonize" >> "$siproxd_conf_prefix$cfg" + echo silence_log = "$silence_log" >> "$siproxd_conf_prefix$cfg" + echo user = "$user" >> "$siproxd_conf_prefix$cfg" + if [ -n "$chrootjail" ]; then + if [ ! -d "$chrootjail" ]; then + mkdir -p "$chrootjail" + chmod 0755 "$chrootjail" + fi + echo chrootjail = "$chrootjail" >> "$siproxd_conf_prefix$cfg" + fi + echo registration_file = "$registration_file" >> "$siproxd_conf_prefix$cfg" + echo autosave_registrations = "$autosave_registrations" >> "$siproxd_conf_prefix$cfg" + + echo pid_file = "$pid_file" >> "$siproxd_conf_prefix$cfg" + echo rtp_proxy_enable = "$rtp_proxy_enable" >> "$siproxd_conf_prefix$cfg" + echo rtp_port_low = "$rtp_port_low" >> "$siproxd_conf_prefix$cfg" + echo rtp_port_high = "$rtp_port_high" >> "$siproxd_conf_prefix$cfg" + echo rtp_timeout = "$rtp_timeout" >> "$siproxd_conf_prefix$cfg" + echo rtp_dscp = "$rtp_dscp" >> "$siproxd_conf_prefix$cfg" + echo sip_dscp = "$sip_dscp" >> "$siproxd_conf_prefix$cfg" + echo rtp_input_dejitter = "$rtp_input_dejitter" >> "$siproxd_conf_prefix$cfg" + echo rtp_output_dejitter = "$rtp_output_dejitter" >> "$siproxd_conf_prefix$cfg" + echo tcp_timeout = "$tcp_timeout" >> "$siproxd_conf_prefix$cfg" + echo tcp_connect_timeout = "$tcp_connect_timeout" >> "$siproxd_conf_prefix$cfg" + echo tcp_keepalive = "$tcp_keepalive" >> "$siproxd_conf_prefix$cfg" + echo default_expires = "$default_expires" >> "$siproxd_conf_prefix$cfg" + if [ -n "$proxy_auth_realm" ]; then + echo proxy_auth_realm = "$proxy_auth_realm" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$proxy_auth_passwd" ]; then + echo proxy_auth_passwd = "$proxy_auth_passwd" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$proxy_auth_pwfile" ]; then + echo proxy_auth_pwfile = "$proxy_auth_pwfile" >> "$siproxd_conf_prefix$cfg" + fi + echo debug_level = "$debug_level" >> "$siproxd_conf_prefix$cfg" + echo debug_port = "$debug_port" >> "$siproxd_conf_prefix$cfg" + if [ -n "$mask_host" ]; then + echo mask_host = "$mask_host" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$masked_host" ]; then + echo masked_host = "$masked_host" >> "$siproxd_conf_prefix$cfg" + fi + echo ua_string = "$ua_string" >> "$siproxd_conf_prefix$cfg" + echo use_rport = "$use_rport" >> "$siproxd_conf_prefix$cfg" + if [ -n "$outbound_proxy_host" ]; then + echo outbound_proxy_host = "$outbound_proxy_host" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$outbound_proxy_port" ]; then + echo outbound_proxy_port = "$outbound_proxy_port" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$outbound_domain_name" ]; then + echo outbound_domain_name = "$outbound_domain_name" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$outbound_domain_host" ]; then + echo outbound_domain_host = "$outbound_domain_host" >> "$siproxd_conf_prefix$cfg" + fi + if [ -n "$outbound_domain_port" ]; then + echo outbound_domain_port = "$outbound_domain_port" >> "$siproxd_conf_prefix$cfg" + fi + + # handle plugins + config_get plugindir "$cfg" plugindir "/usr/lib/siproxd/" + echo plugindir = "$plugindir" >> "$siproxd_conf_prefix$cfg" + + config_list_foreach "$cfg" 'load_plugin' deal_with_lists "load_plugin" + + # plugin_demo.so + config_get plugin_demo_string "$cfg" plugin_demo_string + if [ -n "$plugin_demo_string" ]; then + echo plugin_demo_string = "$plugin_demo_string" >> "$siproxd_conf_prefix$cfg" + fi + + # plugin_shortdial.so + config_get plugin_shortdial_akey "$cfg" plugin_shortdial_akey + if [ -n "$plugin_shortdial_akey" ]; then + echo plugin_shortdial_akey = "$plugin_shortdial_akey" >> "$siproxd_conf_prefix$cfg" + fi + config_list_foreach "$cfg" 'plugin_shortdial_entry' deal_with_lists "plugin_shortdial_entry" + + # plugin_defaulttarget.so + config_get_bool plugin_defaulttarget_log "$cfg" plugin_defaulttarget_log + if [ -n "$plugin_defaulttarget_log" ]; then + echo plugin_defaulttarget_log = "$plugin_defaulttarget_log" >> "$siproxd_conf_prefix$cfg" + fi + config_get plugin_defaulttarget_target "$cfg" plugin_defaulttarget_target + if [ -n "$plugin_defaulttarget_target" ]; then + echo plugin_defaulttarget_target = "$plugin_defaulttarget_target" >> "$siproxd_conf_prefix$cfg" + fi + + # plugin_fix_bogus_via.so + config_get plugin_fix_bogus_via_networks "$cfg" plugin_fix_bogus_via_networks + if [ -n "$plugin_fix_bogus_via_networks" ]; then + echo plugin_fix_bogus_via_networks = "$plugin_fix_bogus_via_networks" >> "$siproxd_conf_prefix$cfg" + fi + + # plugin_stun.so + config_get plugin_stun_server "$cfg" plugin_stun_server + if [ -n "$plugin_stun_server" ]; then + echo plugin_stun_server = "$plugin_stun_server" >> "$siproxd_conf_prefix$cfg" + fi + config_get plugin_stun_port "$cfg" plugin_stun_port + if [ -n "$plugin_stun_port" ]; then + echo plugin_stun_port = "$plugin_stun_port" >> "$siproxd_conf_prefix$cfg" + fi + config_get plugin_stun_period "$cfg" plugin_stun_period + if [ -n "$plugin_stun_period" ]; then + echo plugin_stun_period = "$plugin_stun_period" >> "$siproxd_conf_prefix$cfg" + fi + + # plugin_prefix.so + config_get plugin_prefix_akey "$cfg" plugin_prefix_akey + if [ -n "$plugin_prefix_akey" ]; then + echo plugin_prefix_akey = "$plugin_prefix_akey" >> "$siproxd_conf_prefix$cfg" + fi + + # plugin_regex.so + config_list_foreach "$cfg" 'plugin_regex_desc' deal_with_lists "plugin_regex_desc" + config_list_foreach "$cfg" 'plugin_regex_pattern' deal_with_lists "plugin_regex_pattern" + config_list_foreach "$cfg" 'plugin_regex_replace' deal_with_lists "plugin_regex_replace" + + SERVICE_PID_FILE="$pid_file" \ + service_start $siproxd_bin --config "$siproxd_conf_prefix$cfg" +} + +stop_instance() { + local cfg="$1" + + config_get pid_file "$cfg" pid_file "$siproxd_pid_dir/siproxd-$cfg.pid" + + SERVICE_PID_FILE="$pid_file" \ + service_stop $siproxd_bin +} + +start() { + mkdir -m 0755 -p "$siproxd_conf_dir" + mkdir -m 0755 -p "$siproxd_registration_dir" + [ -d "$siproxd_pid_dir" ] || { + mkdir -m 0755 -p "$siproxd_pid_dir" + chmod 0750 "$siproxd_pid_dir" + chown nobody:nogroup "$siproxd_pid_dir" + } + + config_load 'siproxd' + config_foreach start_instance 'siproxd' +} + +stop() { + config_load 'siproxd' + config_foreach stop_instance 'siproxd' +} diff --git a/net/siproxd/patches/010-fix-bogus-libltdl-dependency.patch b/net/siproxd/patches/010-fix-bogus-libltdl-dependency.patch new file mode 100644 index 00000000000..20f3b6b5d51 --- /dev/null +++ b/net/siproxd/patches/010-fix-bogus-libltdl-dependency.patch @@ -0,0 +1,26 @@ +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -77,8 +77,8 @@ plugin_regex_la_LDFLAGS = -module -avoid + # else Cygwin goes beserk when building...) + # + sbin_PROGRAMS = siproxd +-siproxd_LDFLAGS=-export-dynamic +-siproxd_LDADD = $(LIBLTDL) $(DLOPENPLUGINS) ++siproxd_LDFLAGS=-export-dynamic -lltdl ++siproxd_LDADD = $(DLOPENPLUGINS) + siproxd_SOURCES = siproxd.c proxy.c register.c sock.c utils.c \ + sip_utils.c sip_layer.c log.c readconf.c rtpproxy.c \ + rtpproxy_relay.c accessctl.c route_processing.c \ +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -326,8 +326,8 @@ plugin_prefix_la_LDFLAGS = -module -avoi + # + plugin_regex_la_SOURCES = plugin_regex.c + plugin_regex_la_LDFLAGS = -module -avoid-version -shrext '.so' +-siproxd_LDFLAGS = -export-dynamic +-siproxd_LDADD = $(LIBLTDL) $(DLOPENPLUGINS) ++siproxd_LDFLAGS = -export-dynamic -lltdl ++siproxd_LDADD = $(DLOPENPLUGINS) + siproxd_SOURCES = siproxd.c proxy.c register.c sock.c utils.c \ + sip_utils.c sip_layer.c log.c readconf.c rtpproxy.c \ + rtpproxy_relay.c accessctl.c route_processing.c \ diff --git a/net/siproxd/patches/011-include-sys-time.patch b/net/siproxd/patches/011-include-sys-time.patch new file mode 100644 index 00000000000..81fabda4de9 --- /dev/null +++ b/net/siproxd/patches/011-include-sys-time.patch @@ -0,0 +1,10 @@ +--- siproxd-0.8.1/src/dejitter.c ++++ siproxd-0.8.1/src/dejitter.c +@@ -24,6 +24,7 @@ + + #include + #include ++#include + #include + + #include diff --git a/net/sipsak/Makefile b/net/sipsak/Makefile new file mode 100644 index 00000000000..b2357a7ca56 --- /dev/null +++ b/net/sipsak/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (C) 2006-2013 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:=sipsak +PKG_VERSION:=0.9.6-1 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/sipsak.berlios +PKG_MD5SUM:=c4eb8e282902e75f4f040f09ea9d99d5 + +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-0.9.6 +PKG_INSTALL:=1 + +PKG_LICENSE:=GPL-2.0+ +PKG_LICENSE_FILES:=COPYING + +include $(INCLUDE_DIR)/package.mk + +define Package/sipsak + SECTION:=net + CATEGORY:=Network + SUBMENU:=Telephony + DEPENDS:=+libopenssl + TITLE:=SIP (Session Initiation Protocol) stress and diagnostics utility + URL:=http://sourceforge.net/projects/sipsak.berlios/ +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --disable-gnutls \ + ) +endef + +define Package/sipsak/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sipsak $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,sipsak)) diff --git a/net/sipsak/patches/001-ssp.patch b/net/sipsak/patches/001-ssp.patch new file mode 100644 index 00000000000..1dda867757a --- /dev/null +++ b/net/sipsak/patches/001-ssp.patch @@ -0,0 +1,22 @@ +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -363,7 +363,7 @@ AC_DEFUN([SIPSAK_GCC_STACK_PROTECT_CC],[ + AC_MSG_CHECKING([whether ${CC} accepts -fstack-protector]) + ssp_old_cflags="$CFLAGS" + CFLAGS="$CFLAGS -fstack-protector" +- AC_TRY_COMPILE(,,, ssp_cc=no) ++ AC_TRY_LINK(,,, ssp_cc=no) + echo $ssp_cc + if test "X$ssp_cc" = "Xno"; then + CFLAGS="$ssp_old_cflags" +--- a/configure ++++ b/configure +@@ -2923,7 +2923,7 @@ main () + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>conftest.er1 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 diff --git a/net/sipsak/patches/002-no_cares_ruli.patch b/net/sipsak/patches/002-no_cares_ruli.patch new file mode 100644 index 00000000000..759ec943334 --- /dev/null +++ b/net/sipsak/patches/002-no_cares_ruli.patch @@ -0,0 +1,276 @@ +diff -urN sipsak-0.9.6/configure sipsak-0.9.6.new/configure +--- sipsak-0.9.6/configure 2006-01-28 22:11:34.000000000 +0100 ++++ sipsak-0.9.6.new/configure 2012-08-06 16:45:07.051588486 +0200 +@@ -5954,264 +5954,6 @@ + + + +- echo "$as_me:$LINENO: checking for ares_version.h" >&5 +-echo $ECHO_N "checking for ares_version.h... $ECHO_C" >&6 +- +- ares_incdir=NONE +- ares_libdir=NONE +- ares_libcall=NONE +- ares_incdirs="/usr/include /usr/local/include /sw/include" +- ares_libdirs="/usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib /sw/lib" +- ares_libexten=".so .dylib .a" +- +- for dir in $ares_incdirs; do +- try="$dir/ares_version.h" +- if test -f $try; then +- ares_incdir=$dir; +- break; +- fi +- done +- +- if test "$ares_incdir" = "NONE"; then +- echo "$as_me:$LINENO: result: not found" >&5 +-echo "${ECHO_T}not found" >&6 +- else +- echo "$as_me:$LINENO: result: found at $ares_incdir" >&5 +-echo "${ECHO_T}found at $ares_incdir" >&6 +- +- echo "$as_me:$LINENO: checking for c-ares lib" >&5 +-echo $ECHO_N "checking for c-ares lib... $ECHO_C" >&6 +- +- for dir in $ares_libdirs; do +- for extension in $ares_libexten; do +- try="$dir/libcares$extension" +- if test -f $try; then +- ares_libdir=$dir; +- ares_libcall=cares; +- break; +- fi +- done +- if test "$ares_libdir" != "NONE"; then +- break; +- fi +- done +- +- if test "$ares_libdir" = "NONE"; then +- echo "$as_me:$LINENO: result: not found" >&5 +-echo "${ECHO_T}not found" >&6 +- else +- echo "$as_me:$LINENO: result: found at $ares_libdir" >&5 +-echo "${ECHO_T}found at $ares_libdir" >&6 +- fi +- +- echo "$as_me:$LINENO: checking for ares_version in -lcares" >&5 +-echo $ECHO_N "checking for ares_version in -lcares... $ECHO_C" >&6 +-if test "${ac_cv_lib_cares_ares_version+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- ac_check_lib_save_LIBS=$LIBS +-LIBS="-lcares $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +-/* Override any gcc2 internal prototype to avoid an error. */ +-#ifdef __cplusplus +-extern "C" +-#endif +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char ares_version (); +-int +-main () +-{ +-ares_version (); +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.$ac_objext conftest$ac_exeext +-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest$ac_exeext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_cv_lib_cares_ares_version=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-ac_cv_lib_cares_ares_version=no +-fi +-rm -f conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-LIBS=$ac_check_lib_save_LIBS +-fi +-echo "$as_me:$LINENO: result: $ac_cv_lib_cares_ares_version" >&5 +-echo "${ECHO_T}$ac_cv_lib_cares_ares_version" >&6 +-if test $ac_cv_lib_cares_ares_version = yes; then +- +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_CARES_H 1 +-_ACEOF +- +- LIBS="$LIBS -L$ares_libdir -l$ares_libcall" +- CFLAGS="$CFLAGS -I$ares_incdir" +- SIPSAK_HAVE_ARES="1" +- +- +-fi +- +- fi +- +-if test "X$SIPSAK_HAVE_ARES" == "X"; then +- +- echo "$as_me:$LINENO: checking for ruli.h" >&5 +-echo $ECHO_N "checking for ruli.h... $ECHO_C" >&6 +- +- ruli_incdir=NONE +- ruli_libdir=NONE +- ruli_incdirs="/usr/include /usr/local/include /sw/include" +- ruli_libdirs="/usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib /sw/lib" +- ruli_libexten=".so .dylib .a" +- +- for dir in $ruli_incdirs; do +- try="$dir/ruli.h" +- if test -f $try; then +- ruli_incdir=$dir; +- break; +- fi +- done +- +- if test "$ruli_incdir" = "NONE"; then +- echo "$as_me:$LINENO: result: not found" >&5 +-echo "${ECHO_T}not found" >&6 +- else +- echo "$as_me:$LINENO: result: found at $ruli_incdir" >&5 +-echo "${ECHO_T}found at $ruli_incdir" >&6 +- +- echo "$as_me:$LINENO: checking for libruli" >&5 +-echo $ECHO_N "checking for libruli... $ECHO_C" >&6 +- +- for dir in $ruli_libdirs; do +- for extension in $ruli_libexten; do +- try="$dir/libruli$extension" +- if test -f $try; then +- ruli_libdir=$dir; +- break; +- fi +- done +- if test "$ruli_libdir" != "NONE"; then +- break; +- fi +- done +- +- if test "$ruli_libdir" = "NONE"; then +- echo "$as_me:$LINENO: result: not found" >&5 +-echo "${ECHO_T}not found" >&6 +- else +- echo "$as_me:$LINENO: result: found at $ruli_libdir" >&5 +-echo "${ECHO_T}found at $ruli_libdir" >&6 +- fi +- +- echo "$as_me:$LINENO: checking for ruli_sync_query in -lruli" >&5 +-echo $ECHO_N "checking for ruli_sync_query in -lruli... $ECHO_C" >&6 +-if test "${ac_cv_lib_ruli_ruli_sync_query+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- ac_check_lib_save_LIBS=$LIBS +-LIBS="-lruli $LIBS" +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +-/* Override any gcc2 internal prototype to avoid an error. */ +-#ifdef __cplusplus +-extern "C" +-#endif +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char ruli_sync_query (); +-int +-main () +-{ +-ruli_sync_query (); +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.$ac_objext conftest$ac_exeext +-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest$ac_exeext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_cv_lib_ruli_ruli_sync_query=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-ac_cv_lib_ruli_ruli_sync_query=no +-fi +-rm -f conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-LIBS=$ac_check_lib_save_LIBS +-fi +-echo "$as_me:$LINENO: result: $ac_cv_lib_ruli_ruli_sync_query" >&5 +-echo "${ECHO_T}$ac_cv_lib_ruli_ruli_sync_query" >&6 +-if test $ac_cv_lib_ruli_ruli_sync_query = yes; then +- +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_RULI_H 1 +-_ACEOF +- +- LIBS="$LIBS -L$ruli_libdir -lruli" +- CFLAGS="$CFLAGS -I$ruli_incdir" +- +-fi +- +- fi +- +-else +- + for ac_header in arpa/nameser.h + do + as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +@@ -6361,7 +6103,6 @@ + + done + +-fi + + + # Check for T1 timer value diff --git a/net/yate/Makefile b/net/yate/Makefile new file mode 100644 index 00000000000..5933fbd2481 --- /dev/null +++ b/net/yate/Makefile @@ -0,0 +1,275 @@ +# +# Copyright (C) 2006-2014 OpenWrt.org +# Copyright (C) 2006-2011 SMBPhone +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/uclibc++.mk + +RELEASEVER:=5.4.0 + +PKG_NAME:=yate +PKG_VERSION:=$(RELEASEVER)-1 +PKG_RELEASE:=4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://yate.null.ro/tarballs/yate5/ +PKG_MD5SUM:=427fd2ffde51116271534f398bf913e8 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=Jiri Slachta + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/$(PKG_NAME)/Default + SUBMENU:=Telephony + SECTION:=net + CATEGORY:=Network + URL:=http://yate.null.ro/ +endef + +define Package/$(PKG_NAME) + $(call Package/yate/Default) + DEPENDS:=+libpthread $(CXX_DEPENDS) + TITLE:=Yet Another Telephony Engine + MENU:=1 +endef + +define Package/$(PKG_NAME)/conffiles +/etc/yate/yate.conf +/etc/init.d/yate +endef + +define Package/$(PKG_NAME)/Default/description + Is a next-generation telephony engine focused on the VoIP and PSTN. It does + SIP, H.323, IAX, PSTN, and more. +endef + +define Package/$(PKG_NAME)-scripts-perl + $(call Package/yate/Default) + DEPENDS += $(PKG_NAME) $(PKG_NAME)-mod-extmodule +perl + TITLE:= Perl module for Yate +endef + +define Package/$(PKG_NAME)-sounds + $(call Package/yate/Default) + DEPENDS += $(PKG_NAME) + TITLE := Sounds for Yate +endef + +define Package/$(PKG_NAME)-collection-basic + $(call Package/yate/Default) + DEPENDS += $(PKG_NAME) \ + +$(PKG_NAME)-sounds \ + +$(PKG_NAME)-mod-dumbchan \ + +$(PKG_NAME)-mod-regfile \ + +$(PKG_NAME)-mod-regexroute \ + +$(PKG_NAME)-mod-rmanager \ + +$(PKG_NAME)-mod-tonegen \ + +$(PKG_NAME)-mod-yrtpchan \ + +$(PKG_NAME)-mod-ysipchan + TITLE := Basic Yate Server +endef + +TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include $(if $(CONFIG_BIG_ENDIAN),-DBIGENDIAN,) + +CONFIGURE_ARGS+= \ + --enable-strings \ + --enable-poll \ + --enable-inline \ + --enable-atomics \ + --disable-sse2 \ + --disable-sctp \ + --enable-resolver \ + --enable-internalregex \ + --disable-dahdi \ + --disable-zaptel \ + --disable-wpcard \ + --disable-tdmcard \ + --disable-wanpipe \ + --enable-ilbc \ + --enable-ilbc-webrtc \ + --enable-isac-float \ + --disable-isac-fixed \ + --enable-rtti \ + --with-libpq="$(STAGING_DIR)/usr" \ + --with-mysql="$(STAGING_DIR)/usr" \ + --without-wphwec \ + --without-libgsm \ + --with-libspeex="$(STAGING_DIR)/usr/include" \ + --without-amrnb \ + --with-spandsp="$(STAGING_DIR)/usr/include" \ + --without-pwlib \ + --without-openh323 \ + --with-openssl="$(STAGING_DIR)/usr" \ + --with-zlib="$(STAGING_DIR)/usr" \ + --without-libqt4 \ + --without-qtstatic \ + --without-coredumper \ + --without-doxygen \ + --without-kdoc + +CONFIGURE_VARS+= \ + LDFLAGS="$$$$LDFLAGS -nodefaultlibs" \ + LIBS="-lc -luClibc++ -lpthread -lresolv -ldl -lm -lc $(LIBGCC_S)" + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/usr/lib + + for yatelib in "" sig mgcp jabber script; do \ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libyate$$$${yatelib}.so.$(RELEASEVER) $(1)/usr/lib ;\ + $(LN) ./libyate$$$${yatelib}.so.$(RELEASEVER) $(1)/usr/lib/libyate$$$${yatelib}.so ;\ + done + + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/yate $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/$(PKG_NAME) + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/yate/yate.conf $(1)/etc/$(PKG_NAME)/yate.conf + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/yate.init $(1)/etc/init.d/yate +endef + +define Package/$(PKG_NAME)-scripts-perl/install + $(INSTALL_DIR) $(1)/usr/share/yate/scripts + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/yate/scripts/Yate.pm $(1)/usr/share/yate/scripts/ +endef + +define Package/$(PKG_NAME)-sounds/install + $(INSTALL_DIR) $(1)/usr/share/yate/sounds + $(CP) $(PKG_INSTALL_DIR)/usr/share/yate/sounds/ $(1)/usr/share/yate/ +endef + +define Package/$(PKG_NAME)-collection-basic/install +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(STAGING_DIR)/usr/include/ + $(INSTALL_DIR) $(STAGING_DIR)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(STAGING_DIR)/usr/lib/ +endef + +define BuildPlugin + define Package/$(PKG_NAME)-mod-$(1) + $(call Package/yate/Default) + DEPENDS:= $(PKG_NAME) $(4) + TITLE:=$(3) + endef + + $(if $(PKG_BUILD_DIR)/conf.d/$(1).conf.sample, + define Package/$(PKG_NAME)-mod-$(1)/conffiles + /etc/yate/$(1).conf + endef + ,) + + define Package/$(PKG_NAME)-mod-$(1)/description + $(3) module for $(PKG_NAME) + endef + + define Package/$(PKG_NAME)-mod-$(1)/install + $$(INSTALL_DIR) $$(1)/usr/lib/yate/$(2) + $$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/usr/lib/yate/$(2)/$(1).yate $$(1)/usr/lib/yate/$(2)/$(1).yate + if [ -f $$(PKG_INSTALL_DIR)/etc/yate/$(1).conf ]; then \ + $$(INSTALL_DIR) $$(1)/etc/yate ;\ + $$(INSTALL_DATA) $$(PKG_INSTALL_DIR)/etc/yate/$(1).conf $$(1)/etc/yate/ ;\ + fi + $(if $(5),$(foreach extra_file,$(5),\ + $(INSTALL_DIR) $$(1)$(dir $(extra_file)) ; \ + $(CP) $(PKG_INSTALL_DIR)$(extra_file) $$(1)$(extra_file) ; \ + ),) + endef + + $$(eval $$(call BuildPackage,$(PKG_NAME)-mod-$(1))) +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) +$(eval $(call BuildPackage,$(PKG_NAME)-collection-basic)) +$(eval $(call BuildPackage,$(PKG_NAME)-scripts-perl)) +$(eval $(call BuildPackage,$(PKG_NAME)-sounds)) +$(eval $(call BuildPlugin,accfile,server,SIP or H.323 client (from file),)) +$(eval $(call BuildPlugin,alsachan,client,ALSA Sound Channel,+alsa-lib)) +$(eval $(call BuildPlugin,amrnbcodec,,AMR-NB Codec,@BROKEN)) # Missing amr-nb library +$(eval $(call BuildPlugin,analog,server,Analog (e.g. POTS) Channel,)) +$(eval $(call BuildPlugin,analogdetect,server,Analog Data Detector,)) +$(eval $(call BuildPlugin,analyzer,,Test Call Generator and AQ Analyzer,)) +$(eval $(call BuildPlugin,cache,server,CNAM and LNP memory caches,)) +$(eval $(call BuildPlugin,callcounters,server,Count Active Call Legs,)) +$(eval $(call BuildPlugin,callfork,,Call Forker,)) +$(eval $(call BuildPlugin,callgen,,Call Generator,)) +$(eval $(call BuildPlugin,ccongestion,server,Accept Status from Installed Engine Monitors,)) +$(eval $(call BuildPlugin,cdrbuild,,Call Detail Record Builder,)) +$(eval $(call BuildPlugin,cdrcombine,,Call Detail Records per call instead of per call leg,)) +$(eval $(call BuildPlugin,cdrfile,,Call Detail Record to File,)) +$(eval $(call BuildPlugin,ciscosm,server,SS7 Support,)) +$(eval $(call BuildPlugin,clustering,server,Clustering Server Support,)) +$(eval $(call BuildPlugin,conference,,Conference Room Mixer,)) +$(eval $(call BuildPlugin,cpuload,server,Monitor CPU load and Inform Yate,)) +$(eval $(call BuildPlugin,dbpbx,server,PBX IVR and Multi-routing from Database,)) +$(eval $(call BuildPlugin,dbwave,server,Wav Media for DB Storage,+$(PKG_NAME)-mod-wavefile)) +$(eval $(call BuildPlugin,dumbchan,,Dummy Channel,)) +$(eval $(call BuildPlugin,enumroute,,ENUM Routing,)) +$(eval $(call BuildPlugin,eventlogs,server,Write events and alarms to log files,)) +$(eval $(call BuildPlugin,extmodule,,External Module Handler,)) +$(eval $(call BuildPlugin,faxchan,,Spandsp Fax Channel,+libspandsp)) +$(eval $(call BuildPlugin,filetransfer,,File Transfer Driver,)) +$(eval $(call BuildPlugin,gvoice,,Google Voice support,)) +$(eval $(call BuildPlugin,heartbeat,server,Linux-HA compatible heartbeat,)) +$(eval $(call BuildPlugin,ilbccodec,,iLBC Codec,)) +$(eval $(call BuildPlugin,ilbcwebrtc,,iLBC Codec from the WebRTC project,)) +$(eval $(call BuildPlugin,isaccodec,,internet Speech Audio Codec,)) +$(eval $(call BuildPlugin,isupmangler,sig,ISUP parameter mangling in a STP,)) +$(eval $(call BuildPlugin,jabberclient,client,Jabber Client,)) +$(eval $(call BuildPlugin,jabberserver,jabber,Jabber Server,)) +$(eval $(call BuildPlugin,javascript,,Routing using the embedded Javascript language,)) +$(eval $(call BuildPlugin,jbfeatures,jabber,Jabber Server Features,)) +$(eval $(call BuildPlugin,lateroute,server,Last Chance Routing,)) +$(eval $(call BuildPlugin,mgcpca,server,Media Gateway Control Protocol Agent,)) +$(eval $(call BuildPlugin,mgcpgw,server,Media Gateway Control Protocol Gateway,)) +$(eval $(call BuildPlugin,moh,,On Hold (music) Generator,)) +$(eval $(call BuildPlugin,monitoring,server,Monitoring/gathering Information,)) +$(eval $(call BuildPlugin,mrcpspeech,server,MRCP v2 Voice/Tone Detector and Synthesizer,)) +$(eval $(call BuildPlugin,msgsniff,,Sample Message Sniffer,)) +$(eval $(call BuildPlugin,mux,,Data Multiplexor,)) +$(eval $(call BuildPlugin,mysqldb,server,MySQL Backend DB,+libmysqlclient-r)) +$(eval $(call BuildPlugin,openssl,,Encrypted transport (OpenSSL),+libopenssl)) +$(eval $(call BuildPlugin,osschan,client,OSS Sound Channel,)) +$(eval $(call BuildPlugin,park,server,Call Parking,)) +$(eval $(call BuildPlugin,pbx,,PBX Message Handlers,)) +$(eval $(call BuildPlugin,pbxassist,server,Full featured PBX and IVR,)) +$(eval $(call BuildPlugin,pgsqldb,server,PostgrestSQL Backend DB,+libpq)) +$(eval $(call BuildPlugin,presence,server,Presence,)) +$(eval $(call BuildPlugin,queues,server,Call Distribution and Queues from Database,)) +$(eval $(call BuildPlugin,queuesnotify,server,Notify when queued call status changes,)) +$(eval $(call BuildPlugin,regexroute,,Regular Expression Based Routing,)) +$(eval $(call BuildPlugin,regfile,server,Registration based on users in file,)) +$(eval $(call BuildPlugin,register,server,Call Detail Record to a database,)) +$(eval $(call BuildPlugin,rmanager,,Yate Remote Management,)) +$(eval $(call BuildPlugin,sigtransport,server,SIGTRAN (SS7 over IP) connection provider,)) +$(eval $(call BuildPlugin,sip_cnam_lnp,sip,Query CNAM and LNP databases using SIP INVITE,)) +$(eval $(call BuildPlugin,sipfeatures,server,SIP Features (SUBSCRIBE/NOTIFY),)) +$(eval $(call BuildPlugin,speexcodec,,Speex Codec,+libspeex)) +$(eval $(call BuildPlugin,subscription,server,Subcription handler and presence notifier,)) +$(eval $(call BuildPlugin,tdmcard,server,TDM Cards Signalling and Data Driver,@BROKEN)) # Missing TDM libraries +$(eval $(call BuildPlugin,tonedetect,,Detectors for Various Tones,)) +$(eval $(call BuildPlugin,tonegen,,Tones Generator,)) +$(eval $(call BuildPlugin,users,server,Users,)) +$(eval $(call BuildPlugin,wavefile,,Wav file Record and Playback,)) +$(eval $(call BuildPlugin,wpcard,server,Wanpipe PRI cards Signalling and Data Driver,@BROKEN)) # Mising wanpipe and PRI libraries +$(eval $(call BuildPlugin,yiaxchan,,IAX Channel,)) +$(eval $(call BuildPlugin,yjinglechan,,Jingle Channel,)) +$(eval $(call BuildPlugin,yradius,server,RADIUS Client,)) +$(eval $(call BuildPlugin,yrtpchan,,RTP Channel and Other Data Helper,)) +$(eval $(call BuildPlugin,ysigchan,server,SS7/ISDN Protocols - Yate Signalling Library,)) +$(eval $(call BuildPlugin,ysipchan,,SIP Channel,)) +$(eval $(call BuildPlugin,ysnmpagent,server,SNMP Protocol Agent,,/usr/share/yate/data/NULL-TEAM-MIB.txt /usr/share/yate/data/snmp_mib.conf /usr/share/yate/data/YATE-MIB.txt)) +$(eval $(call BuildPlugin,ysockschan,,SOCKS Channel,)) +$(eval $(call BuildPlugin,ystunchan,,STUN Support,)) +$(eval $(call BuildPlugin,zlibcompress,,Zlib Compression,+zlib)) + diff --git a/net/yate/files/yate.init b/net/yate/files/yate.init new file mode 100644 index 00000000000..4fe8c58c03d --- /dev/null +++ b/net/yate/files/yate.init @@ -0,0 +1,25 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2013 OpenWrt.org +START=50 + +SERVICE_USE_PID=1 + +YATE_BINARY="/usr/bin/yate" +YATE_LOG_FILE="" +YATE_OPTIONS="-d -s -p /var/run/yate.pid" + +start() { + if [ -n "$YATE_LOG_FILE" ]; then + YATE_OPTIONS="$YATE_OPTIONS -r -l $YATE_LOG_FILE" + fi + + service_start $YATE_BINARY $YATE_OPTIONS +} + +stop() { + service_stop $YATE_BINARY +} + +reload() { + service_reload $YATE_BINARY +} diff --git a/net/yate/patches/001-ppc-fix.patch b/net/yate/patches/001-ppc-fix.patch new file mode 100644 index 00000000000..6a1315b8974 --- /dev/null +++ b/net/yate/patches/001-ppc-fix.patch @@ -0,0 +1,31 @@ +Index: yate/libs/miniwebrtc/typedefs.h +=================================================================== +--- yate.orig/libs/miniwebrtc/typedefs.h ++++ yate/libs/miniwebrtc/typedefs.h +@@ -79,6 +79,26 @@ + #elif defined(__mips__) + #define WEBRTC_ARCH_32_BITS + #define WEBRTC_BIG_ENDIAN ++#elif defined(__powerpc64__) ++#define WEBRTC_ARCH_PPC64 1 ++#define WEBRTC_ARCH_64_BITS ++#ifdef __LITTLE_ENDIAN__ ++#define WEBRTC_ARCH_LITTLE_ENDIAN ++#define WEBRTC_LITTLE_ENDIAN ++#else ++#define WEBRTC_ARCH_BIG_ENDIAN ++#define WEBRTC_BIG_ENDIAN ++#endif ++#elif defined(__powerpc__) ++#define WEBRTC_ARCH_PPC 1 ++#define WEBRTC_ARCH_32_BITS ++#ifdef __LITTLE_ENDIAN__ ++#define WEBRTC_ARCH_LITTLE_ENDIAN ++#define WEBRTC_LITTLE_ENDIAN ++#else ++#define WEBRTC_ARCH_BIG_ENDIAN ++#define WEBRTC_BIG_ENDIAN ++#endif + #else + #error Please add support for your architecture in typedefs.h + #endif