chan_mobile r460 compile fail

Kernel 2.6.22.9
Asterisk 1.4.12
trunk revision 460

root@core:/kituri/voip/asterisk-1.4/add-on svn/trunk# ./configure
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 uname… /usr/bin/uname
checking for gcc… gcc
checking for C compiler default output file name… a.out
checking whether the C compiler works… yes
checking whether we are cross compiling… no
checking for suffix of executables…
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking for g++… g++
checking whether we are using the GNU C++ compiler… yes
checking whether g++ accepts -g… yes
checking for a BSD-compatible install… /usr/bin/ginstall -c
checking whether ln -s works… yes
checking for GNU make… make
checking for grep… /usr/bin/grep
checking for basename… /usr/bin/basename
checking for dirname… /usr/bin/dirname
checking for sh… /bin/sh
checking for ln… /usr/bin/ln
checking how to run the C preprocessor… gcc -E
checking for grep that handles long lines and -e… (cached) /usr/bin/grep
checking for egrep… /usr/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 for ba2str in -lbluetooth… yes
checking bluetooth/bluetooth.h usability… yes
checking bluetooth/bluetooth.h presence… yes
checking for bluetooth/bluetooth.h… yes
checking for initscr in -lcurses… yes
checking curses.h usability… yes
checking curses.h presence… yes
checking for curses.h… yes
checking for initscr in -lncurses… yes
checking for curses.h… (cached) yes
checking for -Wdeclaration-after-statement support… yes
checking for mysql_config… /usr/local/bin/mysql_config
checking for mysql_init in -lmysqlclient… yes
checking for asterisk.h… yes
configure: creating ./config.status
config.status: creating build_tools/menuselect-deps
config.status: creating makeopts

           .$$$$$$$$$$$$$$$=..
        .$7$7..          .7$$7:.
      .$$:.                 ,$7.7
    .$7.     7$$$$           .$$77
 ..$$.       $$$$$            .$$$7
..7$   .?.   $$$$$   .?.       7$$$.

$.$. .$$$7. $$$$7 .7$$$. .$$$.
.777. .$$$$$$77$$$77$$$$$7. $$$,
$$$~ .7$$$$$$$$$$$$$7. .$$$.
.$$7 .7$$$$$$$7: ?$$$.
$$$ ?7$$$$$$$$$$I .$$$7
$$$ .7$$$$$$$$$$$$$$$$ :$$$.
$$$ $$$$$$7$$$$$$$$$$$$ .$$$.
$$$ $$$ 7$$$7 .$$$ .$$$.
$$$$ $$$$7 .$$$.
7$$$7 7$$$$ 7$$$
$$$$$ $$$
$$$$7. $$ ™
$$$$$$$. .7$$$$$$ $$
$$$$$$$$$$$$7$$$$$$$$$.$$$$$$
$$$$$$$$$$$$$$$$.

configure: Package configured for:
configure: OS type : Linux
configure: Host CPU : i686
root@core:/kituri/voip/asterisk-1.4/add-on svn/trunk#



root@core:/kituri/voip/asterisk-1.4/add-on svn/trunk# make
make[1]: Entering directory /kituri/voip/asterisk-1.4/add-on svn/trunk/menuselect' make[2]: Entering directory/kituri/voip/asterisk-1.4/add-on svn/trunk/menuselect’
make[3]: Entering directory /kituri/voip/asterisk-1.4/add-on svn/trunk/menuselect/mxml' if test -f config.status; then \ ./config.status --recheck; \ ./config.status; \ else \ ./configure; \ fi checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for a BSD-compatible install... /usr/bin/ginstall -c checking for ranlib... ranlib checking for ar... /usr/bin/ar checking for cp... /usr/bin/cp checking for ln... /usr/bin/ln -s -s -s -s -s checking for mkdir... /usr/bin/mkdir checking for nroff... /usr/bin/nroff checking for rm... /usr/bin/rm checking for strdup... yes checking for vsnprintf... yes configure: creating ./config.status config.status: creating Makefile config.status: creating mxml.list config.status: creating mxml.pc config.status: creating config.h touch config.h gcc -O -Wall -O -Wall -O -Wall -O -Wall -O -Wall -c mxml-attr.c gcc -O -Wall -O -Wall -O -Wall -O -Wall -O -Wall -c mxml-entity.c gcc -O -Wall -O -Wall -O -Wall -O -Wall -O -Wall -c mxml-file.c gcc -O -Wall -O -Wall -O -Wall -O -Wall -O -Wall -c mxml-index.c gcc -O -Wall -O -Wall -O -Wall -O -Wall -O -Wall -c mxml-node.c gcc -O -Wall -O -Wall -O -Wall -O -Wall -O -Wall -c mxml-search.c gcc -O -Wall -O -Wall -O -Wall -O -Wall -O -Wall -c mxml-set.c gcc -O -Wall -O -Wall -O -Wall -O -Wall -O -Wall -c mxml-private.c gcc -O -Wall -O -Wall -O -Wall -O -Wall -O -Wall -c mxml-string.c /usr/bin/rm -f libmxml.a /usr/bin/ar crvs libmxml.a mxml-attr.o mxml-entity.o mxml-file.o mxml-index.o mxml-node.o mxml-search.o mxml-set.o mxml-private.o mxml-string.o a - mxml-attr.o a - mxml-entity.o a - mxml-file.o a - mxml-index.o a - mxml-node.o a - mxml-search.o a - mxml-set.o a - mxml-private.o a - mxml-string.o ranlib libmxml.a make[3]: Leaving directory/kituri/voip/asterisk-1.4/add-on svn/trunk/menuselect/mxml’
gcc -Wall -o menuselect.o -g -c -D_GNU_SOURCE menuselect.c
gcc -Wall -o menuselect_curses.o -g -c -D_GNU_SOURCE menuselect_curses.c
gcc -Wall -o strcompat.o -g -c -D_GNU_SOURCE strcompat.c
gcc -g -Wall -o menuselect menuselect.o menuselect_curses.o strcompat.o mxml/libmxml.a -lncurses
make[2]: Leaving directory /kituri/voip/asterisk-1.4/add-on svn/trunk/menuselect' make[1]: Leaving directory/kituri/voip/asterisk-1.4/add-on svn/trunk/menuselect’
make[1]: Entering directory /kituri/voip/asterisk-1.4/add-on svn/trunk' build_tools/mkdep -fPIC -fPIC chan_mobile.c [CC] chan_mobile.c -> chan_mobile.o chan_mobile.c: In functionmbl_load_config’:
chan_mobile.c:1846: error: too many arguments to function ast_config_load' make[1]: *** [chan_mobile.o] Error 1 make[1]: Leaving directory/kituri/voip/asterisk-1.4/add-on svn/trunk’
make: *** [all] Error 2
root@core:/kituri/voip/asterisk-1.4/add-on svn/trunk#

Hello,
chan_mobile is intended to be used with asterisk trunk.

If you want to use with 1.4.x, you have to change few things in source:

first:

— chan_mobile.c.orig 2007-10-17 16:54:21.000000000 +0200
+++ chan_mobile.c 2007-10-17 16:54:53.000000000 +0200
@@ -514,7 +514,7 @@
chn->writeformat = prefformat;
chn->readformat = prefformat;
chn->tech_pvt = pvt;

  •           ast_channel_set_fd(chn, 0, pvt->io_pipe[0]);
    

+/* ast_channel_set_fd(chn, 0, pvt->io_pipe[0]); */
if (state == AST_STATE_RING)
chn->rings = 1;
ast_string_field_set(chn, language, “en”);
@@ -1843,7 +1843,7 @@
char nadapters = 0;
struct ast_flags config_flags = { 0 };

  •   cfg = ast_config_load(MBL_CONFIG, config_flags);
    
  •   cfg = ast_config_load(MBL_CONFIG);
      if (!cfg)
              return 0;
    

second: run this

#!/bin/bash

cat chan_mobile.c | sed -e ‘s/ast_debug(1,/ast_log(LOG_DEBUG,/’ > .tmp
mv .tmp chan_mobile.c

cat chan_mobile.c | sed -e ‘s/ast_debug(2,/ast_log(LOG_DEBUG,/’ > .tmp
mv .tmp chan_mobile.c

Using Debian 4.0 asterisk 4.13 and Zaptel 1.4.5.1, I’ve applied the patch you mention, and the sed too, but it won’t compile yet.

Having this error


[CC] chan_mobile.c -> chan_mobile.o
chan_mobile.c:178: warning: ‘struct ast_cli_args’ declared inside parameter list
chan_mobile.c:178: warning: its scope is only this definition or declaration, which is probably not what you want
chan_mobile.c:179: warning: ‘struct ast_cli_args’ declared inside parameter list
chan_mobile.c:180: warning: ‘struct ast_cli_args’ declared inside parameter list
chan_mobile.c:183: error: initializer element is not constant
chan_mobile.c:183: error: (near initialization for ‘mbl_cli[0].cmda[0]’)
chan_mobile.c:184: error: initializer element is not constant
chan_mobile.c:184: error: (near initialization for ‘mbl_cli[0].cmda[1]’)
chan_mobile.c:185: error: initializer element is not constant
chan_mobile.c:185: error: (near initialization for ‘mbl_cli[0].cmda[2]’)
chan_mobile.c:248: warning: ‘struct ast_cli_args’ declared inside parameter list
chan_mobile.c:249: error: conflicting types for ‘handle_cli_mobile_show_devices’
chan_mobile.c:178: error: previous declaration of ‘handle_cli_mobile_show_devices’ was here
chan_mobile.c: In function ‘handle_cli_mobile_show_devices’:
chan_mobile.c:257: error: ‘CLI_INIT’ undeclared (first use in this function)
chan_mobile.c:257: error: (Each undeclared identifier is reported only once
chan_mobile.c:257: error: for each function it appears in.)
chan_mobile.c:258: error: ‘struct ast_cli_entry’ has no member named ‘command’
chan_mobile.c:263: error: ‘CLI_GENERATE’ undeclared (first use in this function)
chan_mobile.c:267: error: dereferencing pointer to incomplete type
chan_mobile.c:267: error: request for member ‘argc’ in something not a structure or union
chan_mobile.c:267: warning: comparison between pointer and integer
chan_mobile.c:268: error: ‘CLI_SHOWUSAGE’ undeclared (first use in this function)
chan_mobile.c:268: warning: return from incompatible pointer type
chan_mobile.c:270: error: dereferencing pointer to incomplete type
chan_mobile.c:270: error: request for member ‘fd’ in something not a structure or union
chan_mobile.c:270: warning: passing argument 1 of ‘ast_cli’ makes integer from pointer without a cast
chan_mobile.c:274: error: dereferencing pointer to incomplete type
chan_mobile.c:274: error: request for member ‘fd’ in something not a structure or union
chan_mobile.c:276: warning: passing argument 1 of ‘ast_cli’ makes integer from pointer without a cast
chan_mobile.c:281: error: ‘CLI_SUCCESS’ undeclared (first use in this function)
chan_mobile.c:281: warning: return from incompatible pointer type
chan_mobile.c: At top level:
chan_mobile.c:284: warning: ‘struct ast_cli_args’ declared inside parameter list
chan_mobile.c:285: error: conflicting types for ‘handle_cli_mobile_search’
chan_mobile.c:179: error: previous declaration of ‘handle_cli_mobile_search’ was here
chan_mobile.c: In function ‘handle_cli_mobile_search’:
chan_mobile.c:298: error: ‘CLI_INIT’ undeclared (first use in this function)
chan_mobile.c:299: error: ‘struct ast_cli_entry’ has no member named ‘command’
chan_mobile.c:304: error: ‘CLI_GENERATE’ undeclared (first use in this function)
chan_mobile.c:308: error: dereferencing pointer to incomplete type
chan_mobile.c:308: error: request for member ‘argc’ in something not a structure or union
chan_mobile.c:308: warning: comparison between pointer and integer
chan_mobile.c:309: error: ‘CLI_SHOWUSAGE’ undeclared (first use in this function)
chan_mobile.c:309: warning: return from incompatible pointer type
chan_mobile.c:318: error: dereferencing pointer to incomplete type
chan_mobile.c:318: error: request for member ‘fd’ in something not a structure or union
chan_mobile.c:318: warning: passing argument 1 of ‘ast_cli’ makes integer from pointer without a cast
chan_mobile.c:319: error: ‘CLI_SUCCESS’ undeclared (first use in this function)
chan_mobile.c:319: warning: return from incompatible pointer type
chan_mobile.c:329: error: dereferencing pointer to incomplete type
chan_mobile.c:329: error: request for member ‘fd’ in something not a structure or union
chan_mobile.c:329: warning: passing argument 1 of ‘ast_cli’ makes integer from pointer without a cast
chan_mobile.c:340: error: dereferencing pointer to incomplete type
chan_mobile.c:340: error: request for member ‘fd’ in something not a structure or union
chan_mobile.c:341: warning: passing argument 1 of ‘ast_cli’ makes integer from pointer without a cast
chan_mobile.c:344: error: dereferencing pointer to incomplete type
chan_mobile.c:344: error: request for member ‘fd’ in something not a structure or union
chan_mobile.c:344: warning: passing argument 1 of ‘ast_cli’ makes integer from pointer without a cast
chan_mobile.c:349: warning: return from incompatible pointer type
chan_mobile.c: At top level:
chan_mobile.c:352: warning: ‘struct ast_cli_args’ declared inside parameter list
chan_mobile.c:353: error: conflicting types for ‘handle_cli_mobile_rfcomm’
chan_mobile.c:180: error: previous declaration of ‘handle_cli_mobile_rfcomm’ was here
chan_mobile.c: In function ‘handle_cli_mobile_rfcomm’:
chan_mobile.c:358: error: ‘CLI_INIT’ undeclared (first use in this function)
chan_mobile.c:359: error: ‘struct ast_cli_entry’ has no member named ‘command’
chan_mobile.c:365: error: ‘CLI_GENERATE’ undeclared (first use in this function)
chan_mobile.c:369: error: dereferencing pointer to incomplete type
chan_mobile.c:369: error: request for member ‘argc’ in something not a structure or union
chan_mobile.c:369: warning: comparison between pointer and integer
chan_mobile.c:370: error: ‘CLI_SHOWUSAGE’ undeclared (first use in this function)
chan_mobile.c:370: warning: return from incompatible pointer type
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: incompatible type for argument 1 of ‘strlen’
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: invalid operands to binary +
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: cannot convert to a pointer type
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: incompatible type for argument 2 of ‘__builtin_strcmp’
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: invalid operands to binary +
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: cannot convert to a pointer type
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: incompatible type for argument 2 of ‘__builtin_strcmp’
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: cannot convert to a pointer type
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: invalid operands to binary +
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: cannot convert to a pointer type
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: incompatible type for argument 1 of ‘strlen’
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: incompatible type for argument 2 of ‘__builtin_strcmp’
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: cannot convert to a pointer type
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: cannot convert to a pointer type
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: cannot convert to a pointer type
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: cannot convert to a pointer type
chan_mobile.c:373: error: dereferencing pointer to incomplete type
chan_mobile.c:373: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:373: error: incompatible type for argument 2 of ‘__builtin_strcmp’
chan_mobile.c:378: error: dereferencing pointer to incomplete type
chan_mobile.c:378: error: request for member ‘fd’ in something not a structure or union
chan_mobile.c:378: error: dereferencing pointer to incomplete type
chan_mobile.c:378: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:378: warning: passing argument 1 of ‘ast_cli’ makes integer from pointer without a cast
chan_mobile.c:379: error: ‘CLI_SUCCESS’ undeclared (first use in this function)
chan_mobile.c:379: warning: return from incompatible pointer type
chan_mobile.c:382: error: dereferencing pointer to incomplete type
chan_mobile.c:382: error: request for member ‘argv’ in something not a structure or union
chan_mobile.c:385: warning: return from incompatible pointer type
make[1]: *** [chan_mobile.o] Error 1


If you want the configure.log I can email it, no problem.

Thank you very much for your attention

Otto Krumm

Hello,
it seems you do not have corresponding dev packages installed.

I installed asterisk from sources, which means all include files and headers are allready in place, but when you install from packages, it usually installs just bare program.

Do apt-get install asterisk-dev bluez-dev and retry.