danshuk / asterisk-chan-dongle

Automatically exported from code.google.com/p/asterisk-chan-dongle
Other
2 stars 0 forks source link

compile error on asterisk 11.5.0 #144

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. install asterisk 11.5.0
2. get chan-dongle
3. try to compile

What is the expected output? What do you see instead?
Expecting to compile without warnings and/or warnings/errors

gcc -g -O2 -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
app.c: In function ‘app_status_exec’:
app.c:37:2: warning: missing initializer [-Wmissing-field-initializers]
app.c:37:2: warning: (near initialization for ‘args.resource’) 
[-Wmissing-field-initializers]
app.c: In function ‘app_send_sms_exec’:
app.c:82:2: warning: missing initializer [-Wmissing-field-initializers]
app.c:82:2: warning: (near initialization for ‘args.device’) 
[-Wmissing-field-initializers]
app.c: In function ‘app_register’:
app.c:162:3: warning: passing argument 2 of ‘ast_register_application2’ 
from incompatible pointer type [enabled by default]
/usr/include/asterisk/module.h:458:5: note: expected ‘int (*)(struct 
ast_channel *, const char *)’ but argument is of type ‘int (*)(struct 
ast_channel *, void *)’
gcc -g -O2 -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
gcc -g -O2 -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
gcc -g -O2 -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
gcc -g -O2 -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
gcc -g -O2 -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
at_response.c: In function ‘start_pbx’:
at_response.c:854:16: error: dereferencing pointer to incomplete type
at_response.c:861:10: error: dereferencing pointer to incomplete type
at_response.c: In function ‘at_response_clcc’:
at_response.c:922:23: error: dereferencing pointer to incomplete type
make: *** [at_response.o] Error 1

What version of the product are you using? On what operating system?
Gentoo

Please provide any additional information below.

Original issue reported on code.google.com by dex...@d3xt3r01.tk on 16 Aug 2013 at 5:22

GoogleCodeExporter commented 8 years ago
Also, someone should modify app.c, channel.c, cli.c to include ast_version.h if 
asterisk is newer ( I don't know when exactly they changed that ) 

Original comment by dex...@d3xt3r01.tk on 16 Aug 2013 at 5:38

GoogleCodeExporter commented 8 years ago
wdoekes does it again ! :)
Attached the patch so everyone can benefit it ! :)
Should apply just fine on revision r34.
Only thing, do:
make CPPFLAGS="-DASTERISK_VERSION_NUM=110500"
instead of just make.

Original comment by dex...@d3xt3r01.tk on 18 Aug 2013 at 6:25

Attachments:

GoogleCodeExporter commented 8 years ago
Or this. Which should work on 1.8 and 10 as well.

CPPFLAGS="-DASTERISK_VERSION_NUM=110500" ./configure
make

Original comment by wal...@wjd.nu on 19 Aug 2013 at 5:47

Attachments:

GoogleCodeExporter commented 8 years ago
Hello,

Dear "dex...@d3xt3r01.tk" your patch does not work. When receive one call get 
this:
Asked to get a channel of unsupported format (nothing) while capability is 
(ulaw)
And call are hangup.

Dear "wal...@wjd.nu" your patch does not work. When i receive call have no 
audio and get this:
Dropping incompatible voice frame on Dongle/modulo01-0100000000 of format 
unknown since our native format has changed to (slin)

I use the follow version with asterisk 11.05.01 without problem:
https://github.com/jstasiak/asterisk-chan-dongle/archive/asterisk11.zip

aclocal && autoconf && automake -a
./configure
make
make install

by

Original comment by gio...@gmail.com on 9 Sep 2013 at 12:08

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Yes, it's working and compiled smoothly for me too on Huawei E173u-81. Voice 
wasn't not blocked on this modem!

Asterisk release 11.5.1 on a i686 Linux Debian 6 x86.

Original comment by pgras...@gmail.com on 22 Sep 2013 at 4:13

GoogleCodeExporter commented 8 years ago
asterisk-chan-dongle_fix-asterisk-11_r34.patch is missing code to set codec 
capabilities in chan_dongle.c:

@@ -1659,6 +1661,15 @@
                rv = AST_MODULE_LOAD_FAILURE;
                if(discovery_restart(state) == 0)
                {
+#if ASTERISK_VERSION_NUM >= 100000 /* 10+ */
+                       /* set preferred capabilities */
+                       ast_format_set(&chan_dongle_format, AST_FORMAT_SLINEAR, 
0);
+                       if (!(channel_tech.capabilities = 
ast_format_cap_alloc())) {
+                               return AST_MODULE_LOAD_FAILURE;
+                       }
+                       ast_format_cap_add(channel_tech.capabilities, 
&chan_dongle_format);
+                       chan_dongle_format_cap = channel_tech.capabilities;
+#endif
                        /* register our channel type */
                        if(ast_channel_register(&channel_tech) == 0)
                        {

Attaching full svn diff.

Original comment by gpuzan...@gmail.com on 23 Oct 2013 at 4:43

Attachments:

GoogleCodeExporter commented 8 years ago
> if (!(channel_tech.capabilities = ast_format_cap_alloc())) 

I've got error on this line as follow :-

chan_dongle.c: In function ‘public_state_init’:
chan_dongle.c:1668: error: too few arguments to function 
‘ast_format_cap_alloc’
make: *** [chan_dongle.o] Error 1

Original comment by isa...@gmail.com on 24 Mar 2014 at 8:44