Rename the folder to asterisk-chan-dongle to prepare for VARIANT build.
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
+++ /dev/null
-#
-# 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:=6
-
-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 <jiri@slachta.eu>
-
-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))
+++ /dev/null
---- a/app.c
-+++ b/app.c
-@@ -114,7 +114,44 @@ static int app_send_sms_exec (attribute_
- 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 @@ static const struct dongle_application
- " 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
+++ /dev/null
-From da5cd41e8554eaf1133f85282c253da2c74ff7eb Mon Sep 17 00:00:00 2001
-From: "bg_one@mail.ru" <bg111@users.noreply.github.com>
-Date: Fri, 6 Sep 2013 19:37:05 +0000
-Subject: [PATCH] added E1752 to seven_bit_modems
-
----
- at_response.c | 1 +
- 1 files changed, 1 insertions(+), 0 deletion(-)
-
---- a/at_response.c
-+++ b/at_response.c
-@@ -1590,6 +1590,7 @@ static int at_response_cgmm (struct pvt*
- "E171",
- "E153",
- "E156B",
-+ "E1752",
- };
-
- ast_copy_string (pvt->model, str, sizeof (pvt->model));
+++ /dev/null
-From da5cd41e8554eaf1133f85282c253da2c74ff7eb Mon Sep 17 00:00:00 2001
-From: "bg_one@mail.ru" <bg111@users.noreply.github.com>
-Date: Fri, 6 Sep 2013 19:37:05 +0000
-Subject: [PATCH] added E1752 to seven_bit_modems
-
----
- configure.in | 2 +-
- 1 files changed, 1 insertions(+), 1 deletion(-)
-
---- a/configure.in
-+++ b/configure.in
-@@ -2,7 +2,7 @@ dnl init
- dnl AC_REVISION($Revision: 1.30 $)
- AC_PREREQ([2.60])
- AC_INIT([chan_dongle],[1.1],[http://code.google.com/p/asterisk-chan-dongle/issues/list],[chan_dongle],[http://code.google.com/p/asterisk-chan-dongle])
--PACKAGE_REVISION="34"
-+PACKAGE_REVISION="35"
- AC_CANONICAL_TARGET
- AM_INIT_AUTOMAKE
- AC_CONFIG_HEADERS([config.h])
+++ /dev/null
---- a/channel.c
-+++ b/channel.c
-@@ -495,6 +495,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)
- {
-@@ -522,6 +535,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)
- {
-@@ -535,6 +549,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
- {
-@@ -544,6 +559,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;
- }
-
--- /dev/null
+#
+# 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:=6
+
+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 <jiri@slachta.eu>
+
+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))
--- /dev/null
+--- a/app.c
++++ b/app.c
+@@ -114,7 +114,44 @@ static int app_send_sms_exec (attribute_
+ 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 @@ static const struct dongle_application
+ " 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
--- /dev/null
+From da5cd41e8554eaf1133f85282c253da2c74ff7eb Mon Sep 17 00:00:00 2001
+From: "bg_one@mail.ru" <bg111@users.noreply.github.com>
+Date: Fri, 6 Sep 2013 19:37:05 +0000
+Subject: [PATCH] added E1752 to seven_bit_modems
+
+---
+ at_response.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletion(-)
+
+--- a/at_response.c
++++ b/at_response.c
+@@ -1590,6 +1590,7 @@ static int at_response_cgmm (struct pvt*
+ "E171",
+ "E153",
+ "E156B",
++ "E1752",
+ };
+
+ ast_copy_string (pvt->model, str, sizeof (pvt->model));
--- /dev/null
+From da5cd41e8554eaf1133f85282c253da2c74ff7eb Mon Sep 17 00:00:00 2001
+From: "bg_one@mail.ru" <bg111@users.noreply.github.com>
+Date: Fri, 6 Sep 2013 19:37:05 +0000
+Subject: [PATCH] added E1752 to seven_bit_modems
+
+---
+ configure.in | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletion(-)
+
+--- a/configure.in
++++ b/configure.in
+@@ -2,7 +2,7 @@ dnl init
+ dnl AC_REVISION($Revision: 1.30 $)
+ AC_PREREQ([2.60])
+ AC_INIT([chan_dongle],[1.1],[http://code.google.com/p/asterisk-chan-dongle/issues/list],[chan_dongle],[http://code.google.com/p/asterisk-chan-dongle])
+-PACKAGE_REVISION="34"
++PACKAGE_REVISION="35"
+ AC_CANONICAL_TARGET
+ AM_INIT_AUTOMAKE
+ AC_CONFIG_HEADERS([config.h])
--- /dev/null
+--- a/channel.c
++++ b/channel.c
+@@ -495,6 +495,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)
+ {
+@@ -522,6 +535,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)
+ {
+@@ -535,6 +549,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
+ {
+@@ -544,6 +559,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;
+ }
+