Merge pull request #187 from micmac1/master
New PR: asterisk chan-dongle and chan-lantiq
This commit is contained in:
commit
b152ecb040
7 changed files with 97 additions and 82 deletions
|
@ -81,32 +81,6 @@ $(foreach b,$(8),$(call Package/asterisk13/install/sbin,$$(1),$(b));)
|
||||||
$$(eval $$(call BuildPackage,asterisk13-$(1)))
|
$$(eval $$(call BuildPackage,asterisk13-$(1)))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define BuildAsterisk13NonSharedModule
|
|
||||||
define Package/asterisk13-$(1)
|
|
||||||
$$(call Package/asterisk13/Default)
|
|
||||||
TITLE:=$(2) support
|
|
||||||
DEPENDS:= asterisk13 $(patsubst +%,+PACKAGE_asterisk13-$(1):%,$(4))
|
|
||||||
PKG_FLAGS:=nonshared
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/asterisk13-$(1)/conffiles
|
|
||||||
$(subst $(space),$(newline),$(foreach c,$(5),/etc/asterisk/$(c)))
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/asterisk13-$(1)/description
|
|
||||||
This package provides support for '$(3)' in Asterisk.
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/asterisk13-$(1)/install
|
|
||||||
$(foreach c,$(5),$(call Package/asterisk13/install/conffile,$$(1),$(c));)
|
|
||||||
$(foreach m,$(6),$(call Package/asterisk13/install/module,$$(1),$(m));)
|
|
||||||
$(foreach s,$(7),$(call Package/asterisk13/install/sounds,$$(1),$(s));)
|
|
||||||
$(foreach b,$(8),$(call Package/asterisk13/install/sbin,$$(1),$(b));)
|
|
||||||
endef
|
|
||||||
|
|
||||||
$$(eval $$(call BuildPackage,asterisk13-$(1)))
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/asterisk13/Default
|
define Package/asterisk13/Default
|
||||||
SUBMENU:=Telephony
|
SUBMENU:=Telephony
|
||||||
SECTION:=net
|
SECTION:=net
|
||||||
|
@ -276,13 +250,6 @@ AST_MENUSELECT_OPTS = \
|
||||||
--without-curses \
|
--without-curses \
|
||||||
--with-libxml2="$(STAGING_DIR_HOSTPKG)/usr"
|
--with-libxml2="$(STAGING_DIR_HOSTPKG)/usr"
|
||||||
|
|
||||||
define Build/Prepare
|
|
||||||
$(call Build/Prepare/Default)
|
|
||||||
ifneq ($(CONFIG_TARGET_lantiq),)
|
|
||||||
$(CP) ./src-lantiq/* $(PKG_BUILD_DIR)/
|
|
||||||
endif
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/Configure
|
define Build/Configure
|
||||||
cd $(PKG_BUILD_DIR); \
|
cd $(PKG_BUILD_DIR); \
|
||||||
./bootstrap.sh
|
./bootstrap.sh
|
||||||
|
@ -375,7 +342,6 @@ $(eval $(call BuildAsterisk13Module,cdr-sqlite3,Provides CDR SQLITE3,Call Detail
|
||||||
$(eval $(call BuildAsterisk13Module,chan-alsa,ALSA channel,the channel chan_alsa,+alsa-lib,alsa.conf,chan_alsa,,))
|
$(eval $(call BuildAsterisk13Module,chan-alsa,ALSA channel,the channel chan_alsa,+alsa-lib,alsa.conf,chan_alsa,,))
|
||||||
$(eval $(call BuildAsterisk13Module,chan-dahdi,DAHDI channel,DAHDI channel support,+dahdi-tools-libtonezone +kmod-dahdi +libpri @!aarch64,chan_dahdi.conf,chan_dahdi,,))
|
$(eval $(call BuildAsterisk13Module,chan-dahdi,DAHDI channel,DAHDI channel support,+dahdi-tools-libtonezone +kmod-dahdi +libpri @!aarch64,chan_dahdi.conf,chan_dahdi,,))
|
||||||
$(eval $(call BuildAsterisk13Module,chan-iax2,IAX2 channel,IAX support,+asterisk13-res-timing-timerfd,iax.conf iaxprov.conf,chan_iax2,,))
|
$(eval $(call BuildAsterisk13Module,chan-iax2,IAX2 channel,IAX support,+asterisk13-res-timing-timerfd,iax.conf iaxprov.conf,chan_iax2,,))
|
||||||
$(eval $(call BuildAsterisk13NonSharedModule,chan-lantiq,Lantiq TAPI channel,An implementation of Lantiq TAPI channel,@TARGET_lantiq +kmod-ltq-vmmc,lantiq.conf,chan_lantiq,,))
|
|
||||||
$(eval $(call BuildAsterisk13Module,chan-motif,Jingle channel,Motif Jingle Channel Driver,+asterisk13-res-xmpp,motif.conf,chan_motif,,))
|
$(eval $(call BuildAsterisk13Module,chan-motif,Jingle channel,Motif Jingle Channel Driver,+asterisk13-res-xmpp,motif.conf,chan_motif,,))
|
||||||
$(eval $(call BuildAsterisk13Module,chan-oss,OSS channel,the channel chan_oss,,oss.conf,chan_oss,,))
|
$(eval $(call BuildAsterisk13Module,chan-oss,OSS channel,the channel chan_oss,,oss.conf,chan_oss,,))
|
||||||
$(eval $(call BuildAsterisk13Module,chan-sip,SIP channel,the channel chan_sip,+asterisk13-app-confbridge,sip.conf sip_notify.conf,chan_sip,,))
|
$(eval $(call BuildAsterisk13Module,chan-sip,SIP channel,the channel chan_sip,+asterisk13-app-confbridge,sip.conf sip_notify.conf,chan_sip,,))
|
||||||
|
|
|
@ -8,13 +8,13 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=asterisk-chan-dongle
|
PKG_NAME:=asterisk-chan-dongle
|
||||||
PKG_VERSION:=1.1-20170724
|
PKG_VERSION:=1.1-20170913
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||||
PKG_SOURCE_URL:=git://github.com/wdoekes/asterisk-chan-dongle.git
|
PKG_SOURCE_URL:=git://github.com/wdoekes/asterisk-chan-dongle.git
|
||||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||||
PKG_SOURCE_VERSION:=1e452f7598266be0970cec582ba32dbc5568868d
|
PKG_SOURCE_VERSION:=4ef5ad7eea7245a031101875be08b924aa1e151b
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
|
|
||||||
PKG_FIXUP:=autoreconf
|
PKG_FIXUP:=autoreconf
|
||||||
|
|
|
@ -1,46 +0,0 @@
|
||||||
--- a/channel.c
|
|
||||||
+++ b/channel.c
|
|
||||||
@@ -539,6 +539,19 @@ again:
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+// see https://github.com/openwrt/telephony/issues/7
|
|
||||||
+static inline void change_audio_endianness_to_le(struct iovec *iov, int iovcnt)
|
|
||||||
+{
|
|
||||||
+#if __BYTE_ORDER == __LITTLE_ENDIAN
|
|
||||||
+ return; // nothing to do
|
|
||||||
+#else
|
|
||||||
+ for(;iovcnt-->0;iov++)
|
|
||||||
+ {
|
|
||||||
+ ast_swapcopy_samples(iov->iov_base, iov->iov_base, iov->iov_len/2);
|
|
||||||
+ }
|
|
||||||
+#endif
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
#/* */
|
|
||||||
static void timing_write (struct pvt* pvt)
|
|
||||||
{
|
|
||||||
@@ -566,6 +579,7 @@ static void timing_write (struct pvt* pv
|
|
||||||
iovcnt = mixb_read_n_iov (&pvt->a_write_mixb, iov, FRAME_SIZE);
|
|
||||||
mixb_read_n_iov (&pvt->a_write_mixb, iov, FRAME_SIZE);
|
|
||||||
mixb_read_upd (&pvt->a_write_mixb, FRAME_SIZE);
|
|
||||||
+ change_audio_endianness_to_le(iov, iovcnt);
|
|
||||||
}
|
|
||||||
else if (used > 0)
|
|
||||||
{
|
|
||||||
@@ -579,6 +593,7 @@ static void timing_write (struct pvt* pv
|
|
||||||
iov[iovcnt].iov_base = silence_frame;
|
|
||||||
iov[iovcnt].iov_len = FRAME_SIZE - used;
|
|
||||||
iovcnt++;
|
|
||||||
+ change_audio_endianness_to_le(iov, iovcnt);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
@@ -588,6 +603,7 @@ static void timing_write (struct pvt* pv
|
|
||||||
iov[0].iov_base = silence_frame;
|
|
||||||
iov[0].iov_len = FRAME_SIZE;
|
|
||||||
iovcnt = 1;
|
|
||||||
+ // ignore endianness for zeros
|
|
||||||
// continue;
|
|
||||||
}
|
|
||||||
|
|
87
net/asterisk-chan-lantiq/Makefile
Normal file
87
net/asterisk-chan-lantiq/Makefile
Normal file
|
@ -0,0 +1,87 @@
|
||||||
|
#
|
||||||
|
# Copyright (C) 2017 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:=chan-lantiq
|
||||||
|
PKG_VERSION:=1.0
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
PKG_LICENSE:=GPL-2.0
|
||||||
|
PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
|
||||||
|
|
||||||
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
||||||
|
|
||||||
|
PKG_FLAGS:=nonshared
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define Package/$(PKG_NAME)/Default
|
||||||
|
SUBMENU:=Telephony
|
||||||
|
SECTION:=net
|
||||||
|
CATEGORY:=Network
|
||||||
|
TITLE:=Lantiq channel driver
|
||||||
|
URL:=https://github.com/kochstefan/asterisk_channel_lantiq
|
||||||
|
DEPENDS:=@(TARGET_lantiq_falcon||TARGET_lantiq_xway||TARGET_lantiq_xrx200) +kmod-ltq-vmmc
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/asterisk13-$(PKG_NAME)
|
||||||
|
$(call Package/$(PKG_NAME)/Default)
|
||||||
|
DEPENDS+=asterisk13
|
||||||
|
VARIANT:=asterisk13
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/description/Default
|
||||||
|
An implementation of a Lantiq TAPI channel driver for Asterisk.
|
||||||
|
endef
|
||||||
|
|
||||||
|
Package/asterisk13-$(PKG_NAME)/description = $(Package/description/Default)
|
||||||
|
|
||||||
|
define Package/conffiles/Default
|
||||||
|
/etc/asterisk/lantiq.conf
|
||||||
|
endef
|
||||||
|
|
||||||
|
Package/asterisk13-$(PKG_NAME)/conffiles = $(Package/conffiles/Default)
|
||||||
|
|
||||||
|
define Package/Install/Default
|
||||||
|
$(INSTALL_DIR) $(1)/etc/asterisk
|
||||||
|
$(INSTALL_CONF) $(SOURCE)/files/lantiq-$(BUILD_VARIANT).conf.sample \
|
||||||
|
$(1)/etc/asterisk/lantiq.conf
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/chan_lantiq.so \
|
||||||
|
$(1)/usr/lib/asterisk/modules
|
||||||
|
endef
|
||||||
|
|
||||||
|
Package/asterisk13-$(PKG_NAME)/install = $(Package/Install/Default)
|
||||||
|
|
||||||
|
ifeq ($(BUILD_VARIANT),asterisk13)
|
||||||
|
CHAN_LANTIQ_AST_INCLUDES:=-I$(STAGING_DIR)/usr/include/asterisk-13/include
|
||||||
|
endif
|
||||||
|
|
||||||
|
define Build/Prepare
|
||||||
|
$(CP) $(SOURCE)/files/chan_lantiq-$(BUILD_VARIANT).c $(PKG_BUILD_DIR)/chan_lantiq.c
|
||||||
|
$(CP) $(SOURCE)/files/default.exports $(PKG_BUILD_DIR)/chan_lantiq.exports
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Configure
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Compile
|
||||||
|
cd $(PKG_BUILD_DIR) && \
|
||||||
|
$(TARGET_CC) -o chan_lantiq.o -c chan_lantiq.c -MD -MT chan_lantiq.o \
|
||||||
|
-MF .chan_lantiq.o.d -MP -pthread \
|
||||||
|
$(CHAN_LANTIQ_AST_INCLUDES) \
|
||||||
|
$(TARGET_CFLAGS) \
|
||||||
|
$(TARGET_CPPFLAGS) \
|
||||||
|
-Wall -Wstrict-prototypes -Wmissing-prototypes \
|
||||||
|
-Wmissing-declarations $(FPIC) -DAST_MODULE=\"chan_lantiq\" && \
|
||||||
|
$(TARGET_CC) -o chan_lantiq.so -pthread $(TARGET_LDFLAGS) -shared \
|
||||||
|
-Wl,--version-script,chan_lantiq.exports,--warn-common \
|
||||||
|
chan_lantiq.o
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,asterisk13-$(PKG_NAME)))
|
8
net/asterisk-chan-lantiq/files/default.exports
Normal file
8
net/asterisk-chan-lantiq/files/default.exports
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
global:
|
||||||
|
/* See main/asterisk.exports.in for an explanation why this is
|
||||||
|
* needed. */
|
||||||
|
_IO_stdin_used;
|
||||||
|
local:
|
||||||
|
*;
|
||||||
|
};
|
Loading…
Reference in a new issue