Merge pull request #4 from VittGam/master

Add DAHDI support
This commit is contained in:
Jiri Slachta 2014-12-23 09:53:52 +01:00
commit bc22a11844
3 changed files with 220 additions and 3 deletions

91
libs/dahdi-linux/Makefile Normal file
View file

@ -0,0 +1,91 @@
#
# 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
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=dahdi-linux
PKG_VERSION:=2.10.0.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/
PKG_MD5SUM:=a23e91cc474f241616a5a038ae2b1e72
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Vittorio Gambaletta <openwrt@vittgam.net>
DAHDI_MODULES_EXTRA:=
include $(INCLUDE_DIR)/package.mk
define KernelPackage/dahdi
SUBMENU:=Voice over IP
TITLE:=DAHDI basic infrastructure
DEPENDS:=@USB_SUPPORT +kmod-lib-crc-ccitt
URL:=http://www.asterisk.org/
FILES:= $(PKG_BUILD_DIR)/drivers/dahdi/dahdi.$(LINUX_KMOD_SUFFIX)
AUTOLOAD:=$(call AutoProbe,dahdi)
endef
define KernelPackage/dahdi/description
This package contains DAHDI basic infrastructure.
endef
define KernelPackage/dahdi-echocan-oslec
SUBMENU:=Voice over IP
TITLE:=DAHDI OSLEC echo canceller support
DEPENDS:=kmod-dahdi
URL:=http://www.asterisk.org/
FILES:= $(PKG_BUILD_DIR)/drivers/staging/echo/echo.$(LINUX_KMOD_SUFFIX) \
$(PKG_BUILD_DIR)/drivers/dahdi/dahdi_echocan_oslec.$(LINUX_KMOD_SUFFIX)
AUTOLOAD:=$(call AutoProbe,echo dahdi_echocan_oslec)
endef
define KernelPackage/dahdi-echocan-oslec/description
This package contains DAHDI OSLEC echo canceller support.
endef
define Build/Configure
endef
TARGET_CFLAGS += $(FPIC)
define Build/Prepare
$(Build/Prepare/Default)
mkdir -p $(PKG_BUILD_DIR)/drivers/staging/echo/
$(CP) $(PKG_BUILD_DIR)/../linux-$(LINUX_VERSION)/drivers/misc/echo/* $(PKG_BUILD_DIR)/drivers/staging/echo/ || $(CP) $(PKG_BUILD_DIR)/../linux-$(LINUX_VERSION)/drivers/staging/echo/* $(PKG_BUILD_DIR)/drivers/staging/echo/
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
ARCH="$(LINUX_KARCH)" \
$(TARGET_CONFIGURE_OPTS) \
CROSS_COMPILE="$(TARGET_CROSS)" \
KERNELVERSION="$(KERNEL)" \
KERNEL_VERSION="$(LINUX_VERSION)" \
KERNELDIR="$(LINUX_DIR)" \
KSRC:="$(LINUX_DIR)" \
KVERS:="$(LINUX_VERSION)" \
TOPDIR:="$(TOPDIR)" \
INCLUDE_DIR:="$(INCLUDE_DIR)" \
PWD:="$(PKG_BUILD_DIR)" \
MODULES_EXTRA:="$(DAHDI_MODULES_EXTRA)"
endef
define Build/InstallDev
mkdir -p $(1)/usr/include/dahdi
$(CP) $(PKG_BUILD_DIR)/include/dahdi/dahdi_config.h $(1)/usr/include/dahdi/
$(CP) $(PKG_BUILD_DIR)/include/dahdi/fasthdlc.h $(1)/usr/include/dahdi/
$(CP) $(PKG_BUILD_DIR)/include/dahdi/kernel.h $(1)/usr/include/dahdi/
$(CP) $(PKG_BUILD_DIR)/include/dahdi/user.h $(1)/usr/include/dahdi/
$(CP) $(PKG_BUILD_DIR)/include/dahdi/wctdm_user.h $(1)/usr/include/dahdi/
endef
$(eval $(call KernelPackage,dahdi))
$(eval $(call KernelPackage,dahdi-echocan-oslec))

114
libs/dahdi-tools/Makefile Normal file
View file

@ -0,0 +1,114 @@
#
# 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:=dahdi-tools
PKG_VERSION:=2.10.0.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/dahdi-tools/releases/
PKG_MD5SUM:=224c5b86195249d5ce462ca316332087
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Vittorio Gambaletta <openwrt@vittgam.net>
include $(INCLUDE_DIR)/package.mk
define Package/dahdi-cfg/Default
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=Telephony
DEPENDS=+kmod-dahdi
endef
define Package/dahdi-cfg
$(call Package/dahdi-cfg/Default)
DEPENDS+=+libpthread
TITLE:=DAHDI tools dahdi_cfg and dahdi_scan
endef
define Package/dahdi-monitor
$(call Package/dahdi-cfg/Default)
TITLE:=DAHDI tools dahdi_monitor, dahdi_speed and dahdi_test
endef
define Package/dahdi-tool
$(call Package/dahdi-cfg/Default)
TITLE:=DAHDI tools dahdi_tool
endef
define Package/dahdi-tools-libtonezone
$(call Package/dahdi-cfg/Default)
SECTION:=libs
CATEGORY:=Libraries
TITLE:=DAHDI tonezone library
endef
TARGET_CFLAGS += $(FPIC)
EXTRA_CFLAGS:= $(TARGET_CPPFLAGS)
CONFIGURE_ARGS+= \
--with-dahdi="$(STAGING_DIR)/usr" \
--without-newt \
--without-usb \
--without-selinux \
--without-ppp
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \
HOSTCC="$(HOSTCC)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
CFLAGS="$(TARGET_CFLAGS) -I. -DBUILDING_TONEZONE -I$(STAGING_DIR)/usr/include" \
KSRC="$(LINUX_DIR)" \
DESTDIR="$(PKG_INSTALL_DIR)" \
INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
DAHDI_INCLUDE="$(STAGING_DIR)/usr/include" \
CONFIGURE_SILENT="--silent" \
dahdi_cfg dahdi_monitor dahdi_tool dahdi_scan dahdi_speed dahdi_test fxotune libs
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libtonezone.so $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/libtonezone.a $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/include/dahdi
$(CP) $(PKG_BUILD_DIR)/tonezone.h $(1)/usr/include/dahdi/
endef
define Package/dahdi-cfg/install
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_BUILD_DIR)/dahdi_cfg $(1)/usr/sbin/
$(CP) $(PKG_BUILD_DIR)/dahdi_scan $(1)/usr/sbin/
endef
define Package/dahdi-monitor/install
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_BUILD_DIR)/dahdi_monitor $(1)/usr/sbin/
$(CP) $(PKG_BUILD_DIR)/dahdi_speed $(1)/usr/sbin/
$(CP) $(PKG_BUILD_DIR)/dahdi_test $(1)/usr/sbin/
endef
define Package/dahdi-tool/install
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_BUILD_DIR)/dahdi_tool $(1)/usr/sbin/
endef
define Package/dahdi-tools-libtonezone/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libtonezone.so $(1)/usr/lib/
cd $(1)/usr/lib/; ln -s libtonezone.so libtonezone.so.2.0
endef
$(eval $(call BuildPackage,dahdi-cfg))
$(eval $(call BuildPackage,dahdi-monitor))
$(eval $(call BuildPackage,dahdi-tool))
$(eval $(call BuildPackage,dahdi-tools-libtonezone))

View file

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=asterisk11
PKG_VERSION:=11.15.0
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/asterisk/releases/
@ -156,6 +156,16 @@ define Package/asterisk11-sounds/install
rm -f $(1)/usr/lib/asterisk/sounds/conf-*
endef
ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk11-chan-dahdi),)
CONFIGURE_ARGS+= \
--with-dahdi="$(STAGING_DIR)/usr" \
--with-tonezone="$(STAGING_DIR)/usr"
else
CONFIGURE_ARGS+= \
--without-dahdi \
--without-tonezone
endif
ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk11-curl),)
CONFIGURE_ARGS+= \
--with-libcurl="$(STAGING_DIR)/usr"
@ -224,7 +234,6 @@ CONFIGURE_ARGS+= \
--without-bluetooth \
--without-cap \
--without-curses \
--without-dahdi \
--with-gsm=internal \
--without-gtk2 \
--with-ilbc=internal \
@ -248,7 +257,6 @@ CONFIGURE_ARGS+= \
--without-tds \
--without-termcap \
--without-tinfo \
--without-tonezone \
--with-uuid="$(STAGING_DIR)/usr" \
--without-vorbis \
--without-vpb \
@ -318,6 +326,7 @@ $(eval $(call BuildPackage,asterisk11-sounds))
$(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-dahdiras,Execute an ISDN RAS,support for executing an ISDN RAS using DAHDI,+asterisk11-chan-dahdi,,,app_dahdiras,))
$(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,))
@ -345,6 +354,7 @@ $(eval $(call BuildAsterisk11Module,cdr-sqlite3,Provides CDR SQLITE3,Call Detail
$(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-dahdi,DAHDI codec,DAHDI native transcoding support,+asterisk11-chan-dahdi,,,codec_dahdi,))
$(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,))
@ -375,6 +385,7 @@ $(eval $(call BuildAsterisk11Module,func-shell,Shell,support for shell execution
$(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-dahdi,DAHDI channel,DAHDI channel support,+dahdi-tools-libtonezone +kmod-dahdi-linux,/etc/asterisk/chan_dahdi.conf,chan_dahdi.conf,chan_dahdi,))
$(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,))
@ -398,6 +409,7 @@ $(eval $(call BuildAsterisk11Module,res-fax,FAX modules,Generic FAX resource for
$(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-dahdi,DAHDI Timing Interface,,+asterisk11-chan-dahdi,,,res_timing_dahdi,))
$(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,))