Unable to install Asterisk Addons

I’m trying to install Asterisk 14.6 + Asterisk Addons. Installation of the Asterisk went well but when I change directory to asterisk_addon on make step I’ve got this error

make[1]: Entering directory `/root/asterisk_install/asterisk-addons/apps'
   [CC] app_addon_sql_mysql.c -> app_addon_sql_mysql.o
In file included from app_addon_sql_mysql.c:19:0:
/usr/local/include/asterisk.h:301:2: error: #error "Externally compiled modules must declare AST_MODULE_SELF_SYM."
 #error "Externally compiled modules must declare AST_MODULE_SELF_SYM."
  ^
In file included from app_addon_sql_mysql.c:35:0:
app_addon_sql_mysql.c: In function ‘load_module’:
app_addon_sql_mysql.c:594:9: error: ‘AST_MODULE_SELF’ undeclared (first use in this function)
  return ast_register_application(app, MYSQL_exec, synopsis, descrip);
         ^
app_addon_sql_mysql.c:594:9: note: each undeclared identifier is reported only once for each function it appears in
app_addon_sql_mysql.c:594:2: warning: passing argument 2 of ‘ast_register_application2’ from incompatible pointer type [enabled by default]
  return ast_register_application(app, MYSQL_exec, synopsis, descrip);
  ^
In file included from app_addon_sql_mysql.c:35:0:
/usr/local/include/asterisk/module.h:548:5: note: expected ‘int (*)(struct ast_channel *, const char *)’ but argument is of type ‘int (*)(struct ast_channel *, void *)’
 int ast_register_application2(const char *app, int (*execute)(struct ast_channel *, const char *),
     ^
make[1]: *** [app_addon_sql_mysql.o] Error 1
make[1]: Leaving directory `/root/asterisk_install/asterisk-addons/apps'
make: *** [apps] Error 2

Can anyone help with this?

That packages is deprecated since 1.8 if I recall. You need to do a make menuselect after the ./configure command with the asterisk sources.

1 Like

So, I don’t need to install this package from addons but from asterisk menuselect? I’m following tutorial where it is shown this

# cd /usr/src/asterisk/asterisk-addons-1.6.2.0
# make clean
# ./configure
# make menuselect
At this point, be sure to select at least the following items:
• Applications – app_addon_sql_mysql
• Call Detail Recording – cdr_addon_mysql
• Resource Modules – res_config_mysql
After you’ve got those selected, save and exit. Then proceed with the following steps:

That’s why I’m trying to install it from addons.

Your tutorial is old, that way of installation changed on 1.8, and based on your quote that was for 1.6.2.0 a completely dead version.

Yes now you use make menuselect and will find the SQL addons on the deprecated section. I think is better if you take a look on the ODBC configuration to setup realtime or cdr with MySQL.

Okay, thanks. Any idea what can be also the problem where chan_sip.so, voicemail etc can’t be loaded via CLI and on start time?

I don’t even see commands for them in CLI and when I try with module load chan_sip.so, got

*CLI> module show like chan_sip.so
Module                         Description                              Use Count  Status      Support Level
chan_sip.so                    Session Initiation Protocol (SIP)        0          Not Running          core
1 modules loaded

*CLI> module load chan_sip.so
Unable to load module chan_sip.so
Command 'module load chan_sip.so' failed.
SIP channel loading...


No, no Idea. But stop asterisk and then start it with the command:

asterisk -vvvvvvvddcg

Copy and paste the output here to see what’s going on.

Sorry for the long code but this is the output

[root@ asterisk-14.6.1]# asterisk -vvvvvvvddcg
Seeding global EID 'f4:03:43:44:de:bc' from 'br0' using 'siocgifhwaddr'
Unable to open specified master config file '/usr/local/etc/asterisk/asterisk.conf', using built-in defaults
Asterisk 14.6.1, Copyright (C) 1999 - 2016, Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
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.
=========================================================================
[ Initializing Custom Configuration Options ]
XSLT support not found. XML documentation may be incomplete.
Manager registered action DBGet
Manager registered action DBPut
Manager registered action DBDel
Manager registered action DBDelTree
UUID system initiated
PBX UUID: a4790c4d-a5fd-49dd-9767-7752f3f2930b
Resetting translation matrix
Registered 'audio' codec 'g723' at sample rate '8000' with id '1'
Created cached format with name 'g723'
Registered 'audio' codec 'ulaw' at sample rate '8000' with id '2'
Created cached format with name 'ulaw'
Registered 'audio' codec 'alaw' at sample rate '8000' with id '3'
Created cached format with name 'alaw'
Registered 'audio' codec 'gsm' at sample rate '8000' with id '4'
Created cached format with name 'gsm'
Registered 'audio' codec 'g726' at sample rate '8000' with id '5'
Created cached format with name 'g726'
Registered 'audio' codec 'g726aal2' at sample rate '8000' with id '6'
Created cached format with name 'g726aal2'
Registered 'audio' codec 'adpcm' at sample rate '8000' with id '7'
Created cached format with name 'adpcm'
Registered 'audio' codec 'slin' at sample rate '8000' with id '8'
Created cached format with name 'slin'
Registered 'audio' codec 'slin' at sample rate '12000' with id '9'
Created cached format with name 'slin12'
Registered 'audio' codec 'slin' at sample rate '16000' with id '10'
Created cached format with name 'slin16'
Registered 'audio' codec 'slin' at sample rate '24000' with id '11'
Created cached format with name 'slin24'
Registered 'audio' codec 'slin' at sample rate '32000' with id '12'
Created cached format with name 'slin32'
Registered 'audio' codec 'slin' at sample rate '44100' with id '13'
Created cached format with name 'slin44'
Registered 'audio' codec 'slin' at sample rate '48000' with id '14'
Created cached format with name 'slin48'
Registered 'audio' codec 'slin' at sample rate '96000' with id '15'
Created cached format with name 'slin96'
Registered 'audio' codec 'slin' at sample rate '192000' with id '16'
Created cached format with name 'slin192'
Registered 'audio' codec 'lpc10' at sample rate '8000' with id '17'
Created cached format with name 'lpc10'
Registered 'audio' codec 'g729' at sample rate '8000' with id '18'
Created cached format with name 'g729'
Registered 'audio' codec 'speex' at sample rate '8000' with id '19'
Created cached format with name 'speex'
Registered 'audio' codec 'speex' at sample rate '16000' with id '20'
Created cached format with name 'speex16'
Registered 'audio' codec 'speex' at sample rate '32000' with id '21'
Created cached format with name 'speex32'
Registered 'audio' codec 'ilbc' at sample rate '8000' with id '22'
Created cached format with name 'ilbc'
Registered 'audio' codec 'g722' at sample rate '16000' with id '23'
Created cached format with name 'g722'
Registered 'audio' codec 'siren7' at sample rate '16000' with id '24'
Created cached format with name 'siren7'
Registered 'audio' codec 'siren14' at sample rate '32000' with id '25'
Created cached format with name 'siren14'
Registered 'audio' codec 'testlaw' at sample rate '8000' with id '26'
Created cached format with name 'testlaw'
Registered 'audio' codec 'g719' at sample rate '48000' with id '27'
Created cached format with name 'g719'
Registered 'audio' codec 'opus' at sample rate '48000' with id '28'
Created cached format with name 'opus'
Registered 'image' codec 'jpeg' at sample rate '0' with id '29'
Created cached format with name 'jpeg'
Registered 'image' codec 'png' at sample rate '0' with id '30'
Created cached format with name 'png'
Registered 'video' codec 'h261' at sample rate '1000' with id '31'
Created cached format with name 'h261'
Registered 'video' codec 'h263' at sample rate '1000' with id '32'
Created cached format with name 'h263'
Registered 'video' codec 'h263p' at sample rate '1000' with id '33'
Created cached format with name 'h263p'
Registered 'video' codec 'h264' at sample rate '1000' with id '34'
Created cached format with name 'h264'
Registered 'video' codec 'mpeg4' at sample rate '1000' with id '35'
Created cached format with name 'mpeg4'
Registered 'video' codec 'vp8' at sample rate '1000' with id '36'
Created cached format with name 'vp8'
Registered 'text' codec 'red' at sample rate '0' with id '37'
Created cached format with name 'red'
Registered 'text' codec 't140' at sample rate '0' with id '38'
Created cached format with name 't140'
Registered 'audio' codec 'none' at sample rate '8000' with id '39'
Created cached format with name 'none'
Registered 'audio' codec 'silk' at sample rate '8000' with id '40'
Created cached format with name 'silk8'
Registered 'audio' codec 'silk' at sample rate '12000' with id '41'
Created cached format with name 'silk12'
Registered 'audio' codec 'silk' at sample rate '16000' with id '42'
Created cached format with name 'silk16'
Registered 'audio' codec 'silk' at sample rate '24000' with id '43'
Created cached format with name 'silk24'
Sorcery registered wizard 'bucket'
Sorcery registered wizard 'bucket_file'
Unable to load config file 'stasis.conf'
Could not load Stasis configuration; using defaults
[Sep 15 10:53:06] ERROR[26484]: logger.c:1823 init_logger: Errors detected in logger.conf.  Default console logging is being used.
  == Message handler 'dialplan' registered.
  == Registered custom function 'MESSAGE'
  == Registered custom function 'MESSAGE_DATA'
  == Registered application 'MessageSend'
  == Manager registered action MessageSend
  == Manager registered action DataGet
  == Registered channel type 'Surrogate' (Surrogate channel used to pull channel from an application)
  == Manager registered action BridgeTechnologyList
  == Manager registered action BridgeTechnologySuspend
  == Manager registered action BridgeTechnologyUnsuspend
  == Registered DNS resolver 'system' with priority '2147483647'
 Asterisk Dynamic Loader Starting:
[Sep 15 10:53:06] WARNING[26484]: loader.c:1293 load_modules: No 'modules.conf' found, no modules will be loaded.
[Sep 15 10:53:06] ERROR[26484]: config_options.c:655 aco_process_config: Unable to load config file 'features.conf'
[Sep 15 10:53:06] NOTICE[26484]: features_config.c:1857 load_config: Could not load features config; using defaults
  == Registered custom function 'FEATURE'
  == Registered custom function 'FEATUREMAP'
  == Registered application 'Bridge'
  == Manager registered action Bridge
[Sep 15 10:53:06] ERROR[26484]: config_options.c:655 aco_process_config: Unable to load config file 'acl.conf'
[Sep 15 10:53:06] WARNING[26484]: indications.c:1065 load_indications: Can't find indications config file indications.conf.
[Sep 15 10:53:06] ERROR[26484]: config_options.c:655 aco_process_config: Unable to load config file 'cdr.conf'
[Sep 15 10:53:06] NOTICE[26484]: cdr.c:4110 process_config: Failed to process CDR configuration; using defaults
[Sep 15 10:53:06] NOTICE[26484]: cdr.c:4213 cdr_toggle_runtime_options: CDR simple logging enabled.
[Sep 15 10:53:06] ERROR[26484]: config_options.c:655 aco_process_config: Unable to load config file 'udptl.conf'
[Sep 15 10:53:06] NOTICE[26484]: udptl.c:1324 __ast_udptl_reload: Could not load udptl config; using defaults
 Asterisk PBX Core Initializing
  == Registering builtin functions:
  == Registered custom function 'EXCEPTION'
  == Registered custom function 'TESTTIME'
  == Manager registered action ShowDialPlan
  == Manager registered action ExtensionStateList
  == Registered application 'Answer'
  == Registered application 'BackGround'
  == Registered application 'Busy'
  == Registered application 'Congestion'
  == Registered application 'ExecIfTime'
  == Registered application 'Goto'
  == Registered application 'GotoIf'
  == Registered application 'GotoIfTime'
  == Registered application 'ImportVar'
  == Registered application 'Hangup'
  == Registered application 'Incomplete'
  == Registered application 'NoOp'
  == Registered application 'Proceeding'
  == Registered application 'Progress'
  == Registered application 'RaiseException'
  == Registered application 'Ringing'
  == Registered application 'SayAlpha'
  == Registered application 'SayAlphaCase'
  == Registered application 'SayDigits'
  == Registered application 'SayNumber'
  == Registered application 'SayPhonetic'
  == Registered application 'SetAMAFlags'
  == Registered application 'Wait'
  == Registered application 'WaitExten'
  == Registered application 'Set'
  == Registered application 'MSet'
  == Registered channel type 'Local' (Local Proxy Channel Driver)
  == Manager registered action LocalOptimizeAway
[Sep 15 10:53:06] ERROR[26484]: config_options.c:655 aco_process_config: Unable to load config file 'cel.conf'
[Sep 15 10:53:06] NOTICE[26484]: cel.c:1776 ast_cel_engine_init: Failed to process CEL configuration; using defaults
  == Manager registered action Ping
  == Manager registered action Events
  == Manager registered action Logoff
  == Manager registered action Login
  == Manager registered action Challenge
  == Manager registered action Hangup
  == Manager registered action Status
  == Manager registered action Setvar
  == Manager registered action Getvar
  == Manager registered action GetConfig
  == Manager registered action GetConfigJSON
  == Manager registered action UpdateConfig
  == Manager registered action CreateConfig
  == Manager registered action ListCategories
  == Manager registered action Redirect
  == Manager registered action Atxfer
  == Manager registered action Originate
  == Manager registered action Command
  == Manager registered action ExtensionState
  == Manager registered action PresenceState
  == Manager registered action AbsoluteTimeout
  == Manager registered action MailboxStatus
  == Manager registered action MailboxCount
  == Manager registered action ListCommands
  == Manager registered action SendText
  == Manager registered action UserEvent
  == Manager registered action WaitEvent
  == Manager registered action CoreSettings
  == Manager registered action CoreStatus
  == Manager registered action Reload
  == Manager registered action LoggerRotate
  == Manager registered action CoreShowChannels
  == Manager registered action ModuleLoad
  == Manager registered action ModuleCheck
  == Manager registered action AOCMessage
  == Manager registered action Filter
  == Manager registered action BlindTransfer
  == Registered custom function 'AMI_CLIENT'
[Sep 15 10:53:06] NOTICE[26484]: manager.c:8984 __init_manager: Unable to open AMI configuration manager.conf, or configuration is invalid.
  == Registered application 'CallCompletionRequest'
  == Registered application 'CallCompletionCancel'
 Asterisk Dynamic Loader Starting:
Asterisk Ready.

Also there is no directory modules in /usr/local/var/lib/asterisk/

I have no idea why is looking in thid directory

[root@ asterisk]# ls -ltr /usr/local/etc/asterisk/
total 0

Did you skip the step make samples during the installation?

Basically, you only need to do after downloading the sources:

cd ${SOURCE_AST_DIR}/contrib/scripts
./install_prereq install
cd ${SOURCE_AST_DIR}
./configure --with-pjproject-bundled  <-- the --with-pjproject-bundled is only if you want to use PJSIP
make menuselect
make
make install
make samples

This will create usually in /etc/asterisk all the files.

Take a look at the book: www.asteriskdocs.org
PS: replace ${SOURCE_AST_DIR} with your real asterisk sources path.

I have make the step with samples. Also I have all the files in /etc/asterisk.

No, you don’t if you are using chan_sip. When you compiled asterisk did you use the prefix or libdir flag on the configure command?

Also check the asterisk.conf file to check where is looking for files and modules.

No, no prefixes just ./configure.

In asteriks.conf I have

[directories](!)
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astdbdir => /var/lib/asterisk
astkeydir => /var/lib/asterisk
astdatadir => /var/lib/asterisk
astagidir => /var/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk
astsbindir => /usr/sbin

But still in console first line is

Unable to open specified master config file '/usr/local/etc/asterisk/asterisk.conf', using built-in defaults

seems like incorrect it should be /etc/asterisk/, no?

Remove the (!) and try again with the last command. Which OS are you using?

Still same

# asterisk -vvvvvvvddcg
Unable to open specified master config file '/usr/local/etc/asterisk/asterisk.conf', using built-in defaults

OS is CentOS

Linux sg5-0 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Either you uninstall it and start over, just create a symlink to that path or just copy all in those dirs. I really don’t know how you configured the system but is looking into /usr/local like if it was prefixed

¯\_(ツ)_/¯

Already done uninstall multiple type with this steps:

cd to asterisk source directory
make clean
make uninstall
make uninstall-all

killall -9 safe_asterisk
killall -9 asterisk
rm -rf /etc/asterisk
rm -rf /var/log/asterisk
rm -rf /var/lib/asterisk
rm -rf /var/spool/asterisk
rm -rf /usr/lib/asterisk

Then new installation like

cd to asterisk source directory
make clean
./configure
make menuselect <- everything is checked and available
make
make install
make samples

Is that the correct way to re-install asterisk?
How to create symlink? I guess must be from /usr/local/etc/asterisk/ -> /etc/asterisk/

Try my guide here - should get you started. https://github.com/lardconcepts/asterisk-digitalocean-voipfone-config/blob/master/Asterisk-14-on-Ubuntu.md

1 Like

Thanks for the answer. It will help me for the future. However, I have managed to fix this issue but now I have another and perhaps you can help there? ( I don’t see how to mark the post as solved here ).