Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot load chan_dongle.so #18

Closed
qpirsel opened this issue Nov 13, 2016 · 5 comments
Closed

Cannot load chan_dongle.so #18

qpirsel opened this issue Nov 13, 2016 · 5 comments

Comments

@qpirsel
Copy link

qpirsel commented Nov 13, 2016

Hi!

I'm currently trying to build a gsm gateway with freepbx and chan_dongle. I've already spent a lot of time figuring out the error message automake: error: no 'Makefile.am' found for any configure output during autoconf -a.

Because I'm far away from whats being an expert I thought I can skip the next steps until I found this post and followed the procedure except with astversion 131202 which I'm running and got the module installed - although I've still no idea if I can ignore the autoconf error...

Anyway, after all I tried to show up my device in asterisk but it didn't know the dongle command. Then I realized that I should check if the module is already loaded but it wasn't so I tried it manually with the result shown below.

root@orangepipc:/var/log/asterisk# asterisk -r
Asterisk 13.12.2, Copyright (C) 1999 - 2014, Digium, Inc. and others.
Created by Mark Spencer [email protected]
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.

Connected to Asterisk 13.12.2 currently running on orangepipc (pid = 1561)
orangepipc*CLI> module load chan_dongle.so
Unable to load module chan_dongle.so
Command 'module load chan_dongle.so' failed.
[2016-11-13 08:20:10] WARNING[2767]: loader.c:599 load_dynamic_module: Error loading module 'chan_dongle.so': /usr/lib/asterisk/modules/chan_dongle.so: undefined symbol: manager_event_sent_notify
[2016-11-13 08:20:10] WARNING[2767]: loader.c:1087 load_resource: Module 'chan_dongle.so' could not be loaded.

Thanks in advance for any advise

wdoekes added a commit that referenced this issue Nov 13, 2016
Clarifies the "no makefile.am" problem from #18, but doesn't fix it.
@wdoekes
Copy link
Owner

wdoekes commented Nov 13, 2016

Works fine over here with Asterisk 13. Are you sure you checked out and built the latest version?

@qpirsel
Copy link
Author

qpirsel commented Nov 13, 2016

I've performed a clean git clone https://github.com/wdoekes/asterisk-chan-dongle.git just now. When I configure with astversion make will abort as below:

make
gcc -g -O2 -O6 -Wno-old-style-declaration -I. -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -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
gcc -g -O2 -O6 -Wno-old-style-declaration -I. -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -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 -Wno-old-style-declaration -I. -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -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 -Wno-old-style-declaration -I. -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -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 -Wno-old-style-declaration -I. -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -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 -Wno-old-style-declaration -I. -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -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
In file included from at_response.c:25:0:
channel.h:32:16: warning: ‘struct ast_assigned_ids’ declared inside parameter list
   const struct ast_channel * requestor);
                ^
channel.h:32:16: warning: its scope is only this definition or declaration, which is probably not what you want
gcc -g -O2 -O6 -Wno-old-style-declaration -I. -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self -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
In file included from chan_dongle.c:69:0:
channel.h:32:16: warning: ‘struct ast_assigned_ids’ declared inside parameter list
   const struct ast_channel * requestor);
                ^
chan_dongle.c: In function ‘public_state_init’:
chan_dongle.c:1660:59: error: ‘AST_FORMAT_CAP_FLAG_DEFAULT’ undeclared (first use in this function)
    if (!(channel_tech.capabilities = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT))) {
                                                           ^
chan_dongle.c:1660:59: note: each undeclared identifier is reported only once for each function it appears in
chan_dongle.c:1660:38: error: too many arguments to function ‘ast_format_cap_alloc’
    if (!(channel_tech.capabilities = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT))) {
                                      ^
In file included from /usr/include/asterisk/format_pref.h:28:0,
                 from /usr/include/asterisk/frame.h:34,
                 from /usr/include/asterisk/channel.h:141,
                 from ast_compat.h:10,
                 from chan_dongle.c:53:
/usr/include/asterisk/format_cap.h:57:24: note: declared here
 struct ast_format_cap *ast_format_cap_alloc(void);
                        ^
chan_dongle.c:1663:53: warning: passing argument 2 of ‘ast_format_cap_append’ from incompatible pointer type
    ast_format_cap_append(channel_tech.capabilities, ast_format_slin, 0);
                                                     ^
In file included from /usr/include/asterisk/format_pref.h:28:0,
                 from /usr/include/asterisk/frame.h:34,
                 from /usr/include/asterisk/channel.h:141,
                 from ast_compat.h:10,
                 from chan_dongle.c:53:
/usr/include/asterisk/format_cap.h:95:6: note: expected ‘const struct ast_format_cap *’ but argument is of type ‘struct ast_format *’
 void ast_format_cap_append(struct ast_format_cap *dst, const struct ast_format_cap *src);
      ^
chan_dongle.c:1663:4: error: too many arguments to function ‘ast_format_cap_append’
    ast_format_cap_append(channel_tech.capabilities, ast_format_slin, 0);
    ^
In file included from /usr/include/asterisk/format_pref.h:28:0,
                 from /usr/include/asterisk/frame.h:34,
                 from /usr/include/asterisk/channel.h:141,
                 from ast_compat.h:10,
                 from chan_dongle.c:53:
/usr/include/asterisk/format_cap.h:95:6: note: declared here
 void ast_format_cap_append(struct ast_format_cap *dst, const struct ast_format_cap *src);
      ^
In file included from chan_dongle.c:44:0:
chan_dongle.c: At top level:
chan_dongle.c:1775:1: error: unknown field ‘support_level’ specified in initializer
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, MODULE_DESCRIPTION,
 ^
chan_dongle.c:1777:20: error: ‘AST_MODULE_SUPPORT_EXTENDED’ undeclared here (not in a function)
   .support_level = AST_MODULE_SUPPORT_EXTENDED,
                    ^
Makefile:66: recipe for target 'chan_dongle.o' failed
make: *** [chan_dongle.o] Error 1
root@orangepipc:/usr/src/asterisk-chan-dongle#

When I run ./configure --with-asterisk=/usr/src/asterisk-13.12.2/include I get this:

checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking target system type... armv7l-unknown-linux-gnueabihf
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... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
configure: error: Please set --with-astversion=Mmmuu (major.minor.micro)

@qpirsel
Copy link
Author

qpirsel commented Nov 15, 2016

K, I tried serveral variants including the one posted on the man page (always with clean clones). It doesn't make any difference. Ther error is always the same during make.

@wdoekes
Copy link
Owner

wdoekes commented Nov 16, 2016

You should not have to pass ./configure --with-asterisk=/usr/src/asterisk-13.12.2/include if you're not cross compiling.

If you have installed your Asterisk correctly, its include files are in /usr/include. You will need to set --with-astversion=Mmmuu to the version that corresponds to the installed version.

Here you can see the canonical way to build chan_dongle, even with different versions:
https://github.com/wdoekes/asterisk-chan-dongle/blob/master/.travis.yml#L26

And here the latest build report for 13:
https://travis-ci.org/wdoekes/asterisk-chan-dongle/jobs/175508169

@qpirsel
Copy link
Author

qpirsel commented Nov 17, 2016

Ok, the canonical way seems to work. At least I can load the module after placing it and conf file to the correct places.

@qpirsel qpirsel closed this as completed Nov 22, 2016
shalzz pushed a commit to shalzz/asterisk-chan-dongle that referenced this issue Apr 23, 2022
# This is the 1st commit message:

Create DONATIONS.txt
# This is the commit message wdoekes#2:

Update README.md
# This is the commit message wdoekes#3:

Update DONATIONS.txt
# This is the commit message wdoekes#4:

Update DONATIONS.txt
# This is the commit message wdoekes#5:

Update DONATIONS.txt
# This is the commit message wdoekes#6:

Update chan_quectel.h
# This is the commit message wdoekes#7:

Update README.md
# This is the commit message wdoekes#8:

Update cpvt.h
# This is the commit message wdoekes#9:

Add files via upload
# This is the commit message wdoekes#10:

Delete DONATIONS.txt
# This is the commit message wdoekes#11:

Update README.md
# This is the commit message wdoekes#12:

Update README.md
# This is the commit message wdoekes#13:

Update README.md
# This is the commit message wdoekes#14:

Add files via upload
# This is the commit message wdoekes#15:

Update README.md
# This is the commit message wdoekes#16:

Update README.md
# This is the commit message wdoekes#17:

Update README.md
# This is the commit message wdoekes#18:

Update README.md
# This is the commit message wdoekes#19:

Update README.md
# This is the commit message wdoekes#20:

Update README.md
# This is the commit message wdoekes#21:

Update README.md
# This is the commit message wdoekes#22:

Update README.md
# This is the commit message wdoekes#23:

Add files via upload

Added Simcom support
# This is the commit message wdoekes#24:

Update README.md
# This is the commit message wdoekes#25:

Update README.md
# This is the commit message wdoekes#26:

Added support for Quectel UAC configuration
# This is the commit message wdoekes#27:

Conf file when using UAC
# This is the commit message wdoekes#28:

Update README.md
# This is the commit message wdoekes#29:

Update README.md
# This is the commit message wdoekes#30:

Quectel CREG correction

chan_dongle code assumes 4 parameters in response to command and 3 for URC. However quectel provides 5 and 4 respectively. This fix helps pass on correct status of registration.
# This is the commit message wdoekes#31:

No force registration status

Due to CREG parse issues, earlier registration status was always kept on, now will show unregistered if not connected to network
# This is the commit message wdoekes#32:

Create readme.md
# This is the commit message wdoekes#33:

For compilation with openwrt sdk
# This is the commit message wdoekes#34:

Support for openwrt sdk compilation
# This is the commit message wdoekes#35:

Fix for lac and cell id

Ref IchthysMaranatha#6
Post fix values may have a trailing double quote for quectel devices
# This is the commit message wdoekes#36:

Updated call ids for simcom

Add call termination for call ids 1 and 2
# This is the commit message wdoekes#37:

comment for simcom audio

Added default audio port for simcom in comment
# This is the commit message wdoekes#38:

Integrated ALSA support for UAC

Integrated driver for ALSA added, no need for bridging additional Asterisk ALSA channel when using UAC mode. Please use non-ALSA integrated branch if there is no need for UAC and you wish to avoid alsa dependency when compiling and running
# This is the commit message wdoekes#39:

Update COPYRIGHT.txt

Attribute copyright for alsa code copied from chan_alsa.c https://github.com/asterisk/asterisk/blob/master/channels/chan_alsa.c
# This is the commit message wdoekes#40:

Update README.md
# This is the commit message wdoekes#41:

Conf file with UAC device support
# This is the commit message wdoekes#42:

UAC mode conf file
# This is the commit message wdoekes#43:

Added alsa-lib for compilation
# This is the commit message wdoekes#44:

Delete Makefile.in
# This is the commit message wdoekes#45:

alsa-lib dependency addition
# This is the commit message wdoekes#46:

Fix for simcom audio issues with immediate answer in dialplan
# This is the commit message wdoekes#47:

Note for Quectel serial audio

Added remark to disable gps messages
# This is the commit message wdoekes#48:

Added note for Pi users
# This is the commit message wdoekes#49:

Quectel creg formatting fix

Removed trailing double quotes in reporting lac/cid
# This is the commit message wdoekes#50:

add gitattributes
# This is the commit message wdoekes#51:

Send DTMF using AT command

Corrected at command for dtmf generation
# This is the commit message wdoekes#52:

Fix for busy on call rejection for simcom

For those who receive 'busy' additionally on call rejection when dialling out. Author only receives 'no carrier' on rejection. Reported and solved by @mpmc here IchthysMaranatha#22
# This is the commit message wdoekes#53:

Removal of redundant closetty
# This is the commit message wdoekes#54:

Update busy fix for call rejection

Updated fix as submitted by @mpmc here IchthysMaranatha#22
Author does not receive busy response on call rejection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants