PJSIP Setup Outbound SIP Trunk

Home » Asterisk Users » PJSIP Setup Outbound SIP Trunk
Asterisk Users 2 Comments

Hi,

I’ve currently migrating from chan_sip to chan_pjsip, for now I’m able to setup and configured extensions in PJSIP and incoming trunks but unable to configure outbound trunk as getting unauth/unregistered trunk endpoint message error message when making outbound calls. However, for inbound calls I’m not facing any issues.

I would like to know how can I configured outbound sip trunk bypassing registration and auth?

See below current configuration;

[trunk_proxy]
type=endpoint transport=transport-udp context=fromsip disallow=all allow=ulaw aors=trunk_proxy force_rport=no direct_media=yes ice_support=no trust_id_inbound=yes outbound_auth=trunk_proxy

[trunk_proxy]
type=aor contact=sip:10.3.120.208:5060

[trunk_proxy]
type=identify endpoint=trunk_proxy match.3.120.208

[trunk_proxy]
type=auth auth_type=userpass passwordusername=sip_proxy

[trunk_proxy]
type=registration outbound_auth=trunk_proxy server_uri=sip:10.3.120.208:5060
client_uri=sip:10.3.120.208:5060
auth_rejection_permanent=no

2 thoughts on - PJSIP Setup Outbound SIP Trunk

  • Where are the messages coming from? Is Asterisk sending an outbound registration, but getting rejected? If so make sure your username/password credentials are correct.

  • Thanks for reply.

    After going through the all configurations, there was syntax error with the dial plan for outbound call i.e. previously I was using
    “Dial(PJSIP/trunk_proxy/${EXTEN})” and was unable to make outbound calls. Later changed to “Dial( PJSIP/${EXTEN}@ trunk_proxy)” it worked as expected i.e. no need to set auth/reg for the SIP trunk as not setting it up at SIP
    Proxy end.

    Date: Wed, 16 Oct 2019 13:27:30 -0500