Trunk outbound problem after converting to pjsip

hello.
Yesterday’s post helped me a lot.

Currently, inbound integration is complete.
Outbound is the problem…

This is a system that connects equipment provided by the SIP provider through a trunk.While proceeding with the sip module, I received a hint that conversion to pjsip was necessary in the process of authentication in this problem, and the conversion to pjsip was completed. Some have been helped by sip to pjsip conversion scripts. Currently, dialing from outside to 8001 works smoothly.

The problem is the outbound side of the trunk, but sngrep or logs do not seem to authenticate or send the packet itself to the SIP Provider side. PBX_070 is the account registered on the provider side equipment, and 192.168.x.1 private IP is the provider side equipment IP.

If you analyze logs with sngrep, two logs are generated inbound: A connecting to asterisk and B connecting to sip, while outbound only one log to asterisk occurs. Also, on the sip side, an early media message pops up.

Some of the sip and extension configuration are covered and shared, so please help.

According to the log, rtp works, but it seems that it cannot connect to the upper device. I’m guessing that this might be a problem with registeration. It worked in sip.conf, so it seems that something went wrong while changing to pjsip.

– asterisk message ------------------------------------------------------------------------
– Executing [90312849988@default:5] Dial(“PJSIP/8001-0000004f”, “PJSIP/031xxxxxxx@PBX_070,20,r”) in new stack
> 0x7ffabc02eed0 – Strict RTP learning after remote address set to: 192.168.x.164:63008
– Called PJSIP/031xxxxxxx@PBX_070
> 0x7ffabc02eed0 – Strict RTP switching to RTP target address 192.168.x.164:63008 as source
== Spawn extension (default, 9031xxxxxxx, 5) exited non-zero on ‘PJSIP/8001-0000004f’

—The inbound side of the extension is shown below. ------------------------------------------------------------
[inbound]
exten => PBX_070,1,Log(NOTICE,Inbound call from ${CALLERID(all)})
exten => PBX_070,n,ringing()
exten => PBX_070,n,Dial(PJSIP/8001)
exten => s,n,Hangup()

—The outbound side of the extension is shown below. ------------------------------------------------------------
[outbound]
exten => _90X.,1,Log(NOTICE,outbound call from ${CALLERID(all)} to ${EXTEN:1} through 070)
exten => _90X.,n,ringing()
exten => _90X.,n,Dial(PJSIP/${EXTEN:1}@PBX_070,20,r)
exten => _90X.,n,Hangup()

—sip.conf is shown below. ------------------------------------------------------------

[reg_192.168.x.1]
type = registration
retry_interval = 20
max_retries = 0
expiration = 120
transport = transport-udp
outbound_auth = auth_reg_192.168.x.1
client_uri = sip:PBX_070@192.168.x.1:5060
server_uri = sip:192.168.x.1:5060

[auth_reg_192.168.x.1]
type = auth
password = xxxxxxxxxx
username = PBX_070

[PBX_070]
type = aor
contact = sip:PBX_070@192.168.x.1
maximum_expiration = 3600
minimum_expiration = 30
default_expiration = 60

[PBX_070]
type = identify
endpoint = PBX_070
match = 192.168.x.1

[PBX_070]
type = auth
username = PBX_070
password = xxxxxxxxxxxxx

[PBX_070]
type = endpoint
context = default
transport = transport-udp
dtmf_mode = info
disallow = all
allow = ulaw
allow = ilbc
allow = alaw
allow = gsm
rtp_symmetric = yes
force_rport = yes
rewrite_contact = yes
outbound_proxy = 192.168.x.1:5060
direct_media = no
trust_id_inbound = no
send_rpid = yes
inband_progress = yes
from_domain = 192.168.x.1:5060
language = en
auth = PBX_070
outbound_auth = PBX_070
aors = PBX_070

I hope you meant pjsip.conf.

Could you please enable protocol logging, with “pjsip set logger on”, and could you mark up you logs and configurations as pre-formatted text for the forum, so that it doesn’t garble them.

Oh. this is my mistake. pjsip.conf is correct.
Let’s set it up like that and extract the result log.

Thank you for your comments.

Our intended scenario is below.

  1. from softphone to asterisk server : 8001@192.168.22.16490312849988@192.168.22.114
  2. from asterisk server to provider’s device : 0312849988@192.168.22.114PBX_070@192.168.22.1

but step 2 not working

this solved

I think you need both “pjsip set logger on” and “pjsip set logger verbose on” to see all the SIP packets.

I solved it through the pjsip trunk configuration.
thank you.