PJSIP IP Authentication callout failed

pjsip.conf

[general]
transport = udp


[transudp]
type = transport
protocol = udp
bind = 0.0.0.0:5060

[providersip]
type=aor
contact=sip:98.23.xxxx:5060
qualify_frequency=15

[providersip]
type=endpoint
context=providerio
disallow=all
allow=ulaw
allow=alaw
aors=providersip
direct_media=yes
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
trust_id_inbound=yes
send_rpid=yes
transport=transudp
from_domain=98.23.xxxx

[providersip]
type=identify
endpoint=providersip
match=98.23.xxx

Is this config enough for IP Authentication?

pjsip show contacts

  Contact:  <Aor/ContactUri..............................> <Hash....> <Status> <RTT(ms)..>
==========================================================================================

  Contact:  providersip/sip:98.23.xxx:5060                  dd88ab80ab NonQual         nan
  Contact:  provider2sip/sip:username@19xxxxxx         7dce928a5b NonQual         nan

Objects found: 2

this is the asterisk call file am using
Channel: PJSIP/+22xxxxxx@providersip
MaxRetries: 2
RetryTime: 60
WaitTime: 30
Context: providerio
Priority: 1
Application: Playback
Data: hello-world

I see the messages below when i run this call file in asterisk 20. Note that there are two endpoints for two sip providers and the one using the username and password authentication is working fine but this one using IP authentication is not

NOTICE[61967]: pbx_spool.c:450 attempt_thread: Call failed to go through, reason (3) Remote end Ringing
– Attempting call on PJSIP/+22xxxxxx@providersip for application Playback(hello-world) (Retry 3)
– Called +22xxxxxx@providersip

I also see this log:

<--- Transmitting SIP request (955 bytes) to UDP:98.23.xxx:5060 --->
INVITE sip:+22xxxxxx@98.23.xxx:5060 SIP/2.0
Via: SIP/2.0/UDP 197.xxxxxx:5060;rport;branch=z9hG4bKPjb7e5a385-e06c-4ac9-8807-c4154f6f46a1
From: "Anonymous" <sip:anonymous@98.23.xxx>;tag=4b8318e5-4f07-4710-8208-cd987e09376d
To: <sip:+22xxxxxx@98.23.xxx>
Contact: <sip:asterisk@197.xxxxxx:5060>
Call-ID: 79d0b99f-8a63-41d1-a3cb-bc40f3c05dfb
CSeq: 1631 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 20.5.2
Content-Type: application/sdp
Content-Length:   265

v=0
o=- 1360658842 1360658842 IN IP4 197.xxxxxx
s=Asterisk
c=IN IP4 197.xxxxxx
t=0 0
m=audio 29230 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<--- Transmitting SIP request (955 bytes) to UDP:98.23.xxx:5060 --->
INVITE sip:+22xxxxxx@98.23.xxx:5060 SIP/2.0
Via: SIP/2.0/UDP 197.xxxxxx:5060;rport;branch=z9hG4bKPjb7e5a385-e06c-4ac9-8807-c4154f6f46a1
From: "Anonymous" <sip:anonymous@98.23.xxx>;tag=4b8318e5-4f07-4710-8208-cd987e09376d
To: <sip:+22xxxxxx@98.23.xxx>
Contact: <sip:asterisk@197.xxxxxx:5060>
Call-ID: 79d0b99f-8a63-41d1-a3cb-bc40f3c05dfb
CSeq: 1631 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 20.5.2
Content-Type: application/sdp
Content-Length:   265

v=0
o=- 1360658842 1360658842 IN IP4 197.xxxxxx
s=Asterisk
c=IN IP4 197.xxxxxx
t=0 0
m=audio 29230 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

According to your output it’s not getting any kind of response from the remote side, which would mean it either doesn’t like your SIP INVITE for some reason and is ignoring you or the IP address/port is incorrect.

I just notice that the SIP server of the provider is actually a local ip which i put in the place of 98.23.xxxx. The VPN connection with the SIP provider is connected and seem to be working fine.
The sip provider has a Device peer IP address which is a public IP and then the sip server has local IP.
Do i need to edit the config considering this?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.