chan_dongle + asterisk 10

Asterisk

Asterisk

По мотивам предыдущей статьи:
Huawei 1550 + Asterisk = дешевый GSM шлюз

После выхода новой версии Asterisk – 10, chan_datacard не захотел собираться, да и вообще проект давно не обновлялся и на GoogleCode стоит урл на asterisk-chan-dongle
Значит бум собирать Dongle

Делаем все по мануалу
1.1) Goto package source directory

1.2) Run aclocal

1.3) Run autoconf
autoconf
1.4) Install missing files
automake -a
continue with step 2.3)

2) For build and install from package
2.1) Unpack sources
tar xzvf package.tgz
2.2) Goto package source directory
2.3) Configure package
simple
./configure
explicite set install directory for module
DESTDIR=”/usr/lib/asterisk/modules” ./configure
turn off some parts
./configure –disable-manager –disable-apps
explicite set path to asterisk headers
./configure –with-asterisk=/usr/src/asterisk-1.6.2.13/include
or
CFLAGS=”-I /usr/src/asterisk-1.6.2.13/include” ./configure
enable debugging
./configure –enable-debug
2.4) Build package
make
2.5) Install package
make install

svn checkout http://asterisk-chan-dongle.googlecode.com/svn/trunk/ asterisk-chan-dongle-read-only

И тут “невдача спіткала радянських спортсменів”:

config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
gcc -g -O2 -O6 -I.  -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H  -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT channel.o -MF .channel.o.d -MP  -o channel.o -c channel.c
channel.c: В функции ‘channel_read’:
channel.c:633:22: ошибка: ‘union ast_frame_subclass’ не содержит элемента с именем ‘codec’
channel.c: В функции ‘channel_write’:
channel.c:747:44: ошибка: ‘union ast_frame_subclass’ не содержит элемента с именем ‘codec’
channel.c: В функции ‘new_channel’:
channel.c:1161:27: предупреждение: в присваивании целое преобразуется в указатель без приведения типа
channel.c:1162:25: ошибка: incompatible types when assigning to type ‘struct ast_format’ from type ‘int’
channel.c:1163:24: ошибка: incompatible types when assigning to type ‘struct ast_format’ from type ‘int’
channel.c: В функции ‘start_local_channel’:
channel.c:1252:34: ошибка: ‘AST_FORMAT_AUDIO_MASK’ undeclared (first use in this function)
channel.c:1252:34: замечание: each undeclared identifier is reported only once for each function it appears in
channel.c: На верхнем уровне:
channel.c:1383:2: предупреждение: при инициализации целое преобразуется в указатель без приведения типа
make: *** [channel.o] Ошибка 1

лезем на баг-трекер и находим там патч
patch3.patch
применяем его

patch -p0 -i patch3.patch.txt

Собираем все в кучу

aclocal && autoconf && automake -a
./configure
make
make install
cp etc/dongle.conf /etc/asterisk/
asterisk -vr
Aster*CLI> core restart now

Проверяем

*CLI> dongle show devices
ID           Group State      RSSI Mode Submode Provider Name  Model      Firmware          IMEI             IMSI             Number   
dongle0      0     Free       20   0    0       Ukrtelecom     E1550      11.608.14.11.174  35244504378***  25507104005***  +38091*******

Ну а сами настройки аналогичны Datacard, только вместо слова datacard нужно писать dongle
по этой ссылке больше инфы http://wiki.e1550.mobi/doku.php?id=configuration

  1. Такая же проблемма Gentoo 3.3.8 + Asterisk 10.8.0
    не могу поставить ентот драйвер
    # emerge /net-misc/asterisk-chan_dongle
    не устанавливается и пишет
    ERROR: emerge /net-misc/asterisk-chan_dongle-9999 faled (compile phase):
    emake faled
    что опять ему надо то ? сам вряд ли разберусь опыта мало,
    прошу помощи у крутых гуру
    Вот build.log
    [32;01m * Package: net-misc/asterisk-chan_dongle-9999
    [32;01m * Repository: barzog-overlay
    [32;01m * USE: elibc_glibc kernel_linux userland_GNU x86
    [32;01m * FEATURES: sandbox
    >>> Unpacking source…
    [32;01m* subversion update start –>
    [32;01m* repository: http://asterisk-chan-dongle.googlecode.com/svn/trunk
    At revision 27.
    [32;01m* working copy: /usr/portage/distfiles/svn-src/asterisk-chan_dongle/trunk
    >>> Source unpacked in /var/tmp/portage/net-misc/asterisk-chan_dongle-9999/work
    >>> Preparing source in /var/tmp/portage/net-misc/asterisk-chan_dongle-9999/work/asterisk-chan_dongle-9999 …
    [32;01m* Running aclocal …
    [A [ ok ]
    [32;01m* Running autoconf …
    [A [ ok ]
    [33;01m* QA Notice: ‘automake’ called by src_prepare: net-misc/asterisk-chan_dongle-9999
    [33;01m* Use autotools.eclass instead of calling ‘automake’ directly.
    configure.in:6: installing `./config.guess’
    configure.in:6: installing `./config.sub’
    configure.in:7: installing `./install-sh’
    configure.in:7: installing `./missing’
    automake-1.11: no `Makefile.am’ found for any configure output
    >>>
    Source prepared.
    >>>
    Configuring source in /var/tmp/portage/net-misc/asterisk-chan_dongle-9999/work/asterisk-chan_dongle-9999 …
    ./configure –prefix=/usr –build=i686-pc-linux-gnu –host=i686-pc-linux-gnu –mandir=/usr/share/man –infodir=/usr/share/info –datadir=/usr/share –sysconfdir=/etc –localstatedir=/var/lib –disable-dependency-tracking
    checking build system type… i686-pc-linux-gnu
    checking host system type… i686-pc-linux-gnu
    checking target system type… i686-pc-linux-gnu
    checking for a BSD-compatible install… /usr/bin/install -c
    checking whether build environment is sane… yes
    checking for a thread-safe mkdir -p… /bin/mkdir -p
    checking for gawk… gawk
    checking whether make sets $(MAKE)… yes
    checking for i686-pc-linux-gnu-gcc… i686-pc-linux-gnu-gcc
    checking whether the C compiler works… yes
    checking for C compiler default output file name… a.out
    checking for suffix of executables…
    checking whether we are cross compiling… no
    checking for suffix of object files… o
    checking whether we are using the GNU C compiler… yes
    checking whether i686-pc-linux-gnu-gcc accepts -g… yes
    checking for i686-pc-linux-gnu-gcc option to accept ISO C89… none needed
    checking for style of include used by make… GNU
    checking dependency style of i686-pc-linux-gnu-gcc… none
    checking how to run the C preprocessor… i686-pc-linux-gnu-gcc -E
    checking for strip… strip
    checking for rm… rm
    checking for library containing iconv… none required
    checking for grep that handles long lines and -e… /bin/grep
    checking for egrep… /bin/grep -E
    checking for ANSI C header files… yes
    checking for sys/types.h… yes
    checking for sys/stat.h… yes
    checking for stdlib.h… yes
    checking for string.h… yes
    checking for memory.h… yes
    checking for strings.h… yes
    checking for inttypes.h… yes
    checking for stdint.h… yes
    checking for unistd.h… yes
    checking fcntl.h usability… yes
    checking fcntl.h presence… yes
    checking for fcntl.h… yes
    checking for stdlib.h… (cached) yes
    checking for string.h… (cached) yes
    checking sys/time.h usability… yes
    checking sys/time.h presence… yes
    checking for sys/time.h… yes
    checking termios.h usability… yes
    checking termios.h presence… yes
    checking for termios.h… yes
    checking whether asterisk.h in ../include… no
    checking whether asterisk.h in /usr/include… yes
    checking asterisk.h usability… yes
    checking asterisk.h presence… yes
    checking for asterisk.h… yes
    checking whether iconv.h in /usr/include… yes
    checking iconv.h usability… yes
    checking iconv.h presence… yes
    checking for iconv.h… yes
    checking for iconv use const inbuf… no
    checking for iconv_t in iconv.h… yes
    checking for AST_CONTROL_SRCCHANGE in asterisk/frame.h… yes
    checking for an ANSI C-conforming const… yes
    checking for inline… inline
    checking for size_t… yes
    checking for ssize_t… yes
    checking for uint64_t… yes
    checking whether CC supports -fvisibility=hidden… yes
    checking whether CC supports -fPIC… yes
    checking whether CC supports -Wall… yes
    checking whether CC supports -Wextra… yes
    checking whether CC supports -MD -MT conftest.o -MF /dev/null -MP… yes
    checking whether DESTDIR is /usr/lib/asterisk/modules… yes
    checking for working memcmp… yes
    checking for memchr… yes
    checking for memmove… yes
    checking for memset… yes
    checking for memmem… yes
    checking for strcasecmp… yes
    checking for strchr… yes
    checking for strncasecmp… yes
    checking for strtol… yes
    checking for realpath… yes
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating config.h
    config.status: executing depfiles commands
    >>> Source configured.
    >>> Compiling source in /var/tmp/portage/net-misc/asterisk-chan_dongle-9999/work/asterisk-chan_dongle-9999 …
    make -j2
    i686-pc-linux-gnu-gcc -O2 -march=i686 -pipe -O6 -I. -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT app.o -MF .app.o.d -MP -o app.o -c app.c i686-pc-linux-gnu-gcc -O2 -march=i686 -pipe -O6 -I. -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT at_command.o -MF .at_command.o.d -MP -o at_command.o -c at_command.c
    app.c: В функции ‘app_status_exec’:
    app.c:37:2: предупреждение: пропущен инициализатор
    app.c:37:2: предупреждение: (где-то рядом с инициализацией для ‘args.resource’)
    app.c: В функции ‘app_send_sms_exec’:
    app.c:82:2: предупреждение: пропущен инициализатор
    app.c:82:2: предупреждение: (где-то рядом с инициализацией для ‘args.device’)
    i686-pc-linux-gnu-gcc -O2 -march=i686 -pipe -O6 -I. -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H-fvisibility=hidden -fPIC -Wall -Wextra -MD -MT at_parse.o -MF .at_parse.o.d -MP -o at_parse.o -c at_parse.c i686-pc-linux-gnu-gcc -O2 -march=i686 -pipe -O6 -I. -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT at_queue.o -MF .at_queue.o.d -MP -o at_queue.o -c at_queue.c i686-pc-linux-gnu-gcc -O2 -march=i686 -pipe -O6 -I.-D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT at_read.o -MF .at_read.o.d -MP -o at_read.o -c at_read.c i686-pc-linux-gnu-gcc -O2 -march=i686 -pipe -O6 -I. -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT at_response.o -MF .at_response.o.d -MP -o at_response.o -c at_response.c i686-pc-linux-gnu-gcc -O2 -march=i686 -pipe -O6 -I. -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT chan_dongle.o -MF .chan_dongle.o.d -MP -o chan_dongle.o -c chan_dongle.c i686-pc-linux-gnu-gcc -O2 -march=i686 -pipe -O6 -I. -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT channel.o -MF .channel.o.d -MP -o channel.o -c channel.c
    channel.c:100:82: ошибка: expected declaration specifiers or ‘…’ before ‘format_t’
    channel.c: В функции ‘channel_request’:
    channel.c:110:2: ошибка: ‘format_t’ undeclared (first use in this function)
    channel.c:110:2: замечание: each undeclared identifier is reported only once for each function it appears in
    channel.c:110:11: ошибка: expected ‘;’ before ‘oldformat’
    channel.c:129:2: ошибка: ‘oldformat’ undeclared (first use in this function)
    channel.c:129:14: ошибка: ‘format’ undeclared (first use in this function)
    channel.c: В функции ‘channel_read’:
    channel.c:621:22: ошибка: ‘union ast_frame_subclass’ не содержит элемента с именем ‘codec’
    channel.c: В функции ‘channel_write’:
    channel.c:735:44: ошибка: ‘union ast_frame_subclass’ не содержит элемента с именем ‘codec’
    channel.c: В функции ‘new_channel’:
    channel.c:1149:27: предупреждение: в присваивании целое преобразуется в указатель без приведения типа
    channel.c:1150:25: ошибка: incompatible types when assigning to type ‘struct ast_format’ from type ‘int’
    channel.c:1151:24: ошибка: incompatible types when assigning to type ‘struct ast_format’ from type ‘int’
    channel.c: В функции ‘start_local_channel’:
    channel.c:1240:34: ошибка: ‘AST_FORMAT_AUDIO_MASK’ undeclared (first use in this function)
    channel.c: На верхнем уровне:
    channel.c:1371:2: предупреждение: при инициализации целое преобразуется в указатель без приведения типа
    channel.c:1372:2: предупреждение: несовместимый тип указателя в инициализации
    i686-pc-linux-gnu-gcc -O2 -march=i686 -pipe -O6 -I.
    -D_GNU_SOURCE -I/usr/include -I/usr/include -DHAVE_CONFIG_H -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT char_conv.o -MF .char_conv.o.d -MP
    -o char_conv.o -c char_conv.c
    make: *** [channel.o] Ошибка 1
    make: *** Ожидание завершения заданий…
    [31;01m* ERROR: net-misc/asterisk-chan_dongle-9999 failed (compile phase):
    [31;01m* emake failed
    [31;01m*
    [31;01m* If you need support, post the output of `emerge –info ‘=net-misc/asterisk-chan_dongle-9999’`,
    [31;01m* the complete build log and the output of `emerge -pqv ‘=net-misc/asterisk-chan_dongle-9999’`.
    [31;01m* This ebuild is from an overlay named ‘barzog-overlay’: ‘/var/lib/layman/barzog-overlay/’
    [31;01m* The complete build log is located at ‘/var/tmp/portage/net-misc/asterisk-chan_dongle-9999/temp/build.log’.
    [31;01m* The ebuild environment file is located at ‘/var/tmp/portage/net-misc/asterisk-chan_dongle-9999/temp/environment’.
    [31;01m* Working directory: ‘/var/tmp/portage/net-misc/asterisk-chan_dongle-9999/work/asterisk-chan_dongle-9999’
    [31;01m* S: ‘/var/tmp/portage/net-misc/asterisk-chan_dongle-9999/work/asterisk-chan_dongle-9999’

  2. Или придется на астер 1.8 откатиться

  3. @Vlakar
    А что это за ebuild такой? ) я всегда собирал с сырцов..

  4. admin :
    @Vlakar
    А что это за ebuild такой? ) я всегда собирал с сырцов..

    Он лежит в barog-overlay/net-misc/asterisk-chan_dongle-9999.ebuild
    из сырцов в gentoo не рекомендуют собирать 🙁 , не знаю почему, говорят систему порушить можно.

  1. No trackbacks yet.

You must be logged in to post a comment.