Solution Unable to retrieve PJSIP transport in Asterisk

The error “Unable to retrieve PJSIP transport …” occurs when TRANSPORT does not exist or is specified incorrectly.

Let’s say TRANSPORT is configured in the /etc/asterisk/pjsip.conf file:

;================================ TRANSPORTS ==
[transport-udp]
type=transport
protocol=udp    ;udp,tcp,tls,ws,wss,flow
bind=0.0.0.0

And accordingly, it must be specified in the template or in the endpoint:

;===============ENDPOINT TEMPLATES
[endpoint-basic](!)
type=endpoint
transport=transport-udp  ;HERE
context=from-internal
disallow=all
allow=alaw
;===============EXTENSION 221
[221](endpoint-basic)
auth=auth221
aors=221

That is, as we see in my example, “transport-udp” is specified in TRANSPORTS and in ENDPOINT TEMPLATES or directly in the endpoint:

[221]
type=endpoint
transport=transport-udp  ;HERE
context=from-internal
disallow=all
allow=alaw
auth=auth221
aors=221

Let’s restart asterisk and make sure there is no error:

service asterisk restart
asterisk -rvv
pjsip show transports
pjsip show transport transport-udp
exit

If several TRANSPORTs are specified, then they must be on different ports, an example of specifying a port (if the port is not specified, then 5060 is used by default):

bind=0.0.0.0:5061

See also my article:
Installing Asterisk from source

Leave a comment

Leave a Reply