PJSIP commands missing from CLI

Apologies in advance, I am completely new to Asterisk.

I’ve just downloaded and installed Asterisk 20.1 from source on AWS Linux.

My understanding is that PJSIP should be installed and enabled by default, however none of the pjsip commands appear to be available on the CLI.

When I look at module show, I do not see chan_pjsip.so listed as being loaded, and when I try to load it via module load chan_pjsip.so I get an error:

Command ‘module load chan_pjsip.so’ failed.
[Jan 17 21:30:22] ERROR[3979]: loader.c:283 module_load_error: Error loading module ‘chan_pjsip.so’: /usr/lib/asterisk/modules/chan_pjsip.so: undefined symbol: ast_sip_cli_traverse_objects

I am sure I need to do something to tell Asterisk to load the pjsip module, but I am not sure what that is. Suggestions?

I don’t know if when you say you download Asterisk that means, you installed Asterisk using the package manager of your Linux distro. But if you install Asterisk from source, make sure you use this parameter ./configure --with-pjproject-bundled

It probably had an error when Asterisk started. Try running Asterisk with the console ‘on’ using ‘sudo asterisk -cvvv’ (the -c is console, vvv is verbose level 3). You can also load the log (/var/log/asterisk/messages.log) into an editor to find possible errors.

You most likely have a module missing. Try having autoload set to yes, in modules.conf, and disable every line starting with “noload”. You can disable them either by putting a ; before them, or just deleting them.

Most common problems with modules not loading correctly, is the module depending on another, that’s not loaded.

Some modules refuse to load, if their configuration file is not present, in most cases an empty file will be sufficient.

If you stop Asterisk from running in the background, using whatever method is used by your distro, eg. systemctl stop asterisk.service, you can run Asterisk in the foreground, and easily see if a module fails loading, just start asterisk by running, asterisk -Tc The c option enables the asterisk console, and the -T option will provide a timestamp before each line, I find timestamps nice to have, but you can leave it out.

Any warning and error displayed when Asterisk starts up, needs to be considered, any message about missing configuration files, should be addressed.

Once you’ve got it started and the pjsip modules load, you can experiment with disabling modules in modules.conf, to only load what you need. (If you want a smaller memory and CPU footprint)