Pjsip outgoing calls giving error

Hi,
I just tried to migrate sip.conf to pjsip.conf, incoming is working but outgoing calls having issue. softphone users also not working. please suggest solution.

[global]
type=global
endpoint_identifier_order=username,ip,anonymous

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

[airtel]
type=registration
transport=transport-udp
outbound_auth=airtel_auth
server_uri=sip:dl.ims.airtel.in
client_uri=sip:+911141212300@dl.ims.airtel.in
contact_user=+911141212300
outbound_proxy=sip:10.5.68.229:5060
retry_interval=60
expiration=120
endpoint=airtel_endpoint
line=yes

[airtel_auth]
type=auth
auth_type=userpass
username=+911141212300@dl.ims.airtel.in
password=Help123456

[airtel_endpoint]
type=endpoint
transport=transport-udp
context=default
disallow=all
allow=ulaw,alaw
dtmf_mode=rfc4733
aors=airtel_aor
from_user=+911141212300
from_domain=dl.ims.airtel.in
outbound_auth=airtel_auth
outbound_proxy=sip:dl.ims.airtel.in:5060
rewrite_contact=yes
force_rport=yes
bind_rtp_to_media_address=yes

[airtel_aor]
type=aor
contact=sip:dl.ims.airtel.in:5060
outbound_proxy=sip:10.5.68.229:5060
max_contacts=1
default_expiration=120
qualify_frequency=60

[airtel_identify]
type=identify
endpoint=airtel_endpoint
match=10.5.68.229

[8003]
type=endpoint
context=default
disallow=all
allow=ulaw,alaw
auth=8003_auth
aors=8003
callerid=“8003” <0000000000>

[8003_auth]
type=auth
username=8003
password=123456

[8003_aor]
type=aor
max_contacts=1

Following error showing

asterisk -rx “pjsip show endpoint airtel_endpoint”
hannel originate PJSIP/09582291326@airtel_endpoint extension 9582291326@default
[Dec 28 12:59:59] ERROR[23254]: res_pjsip.c:993 ast_sip_create_dialog_uac: Endpoint ‘airtel_endpoint’: Could not create dialog to invalid URI ‘airtel_aor’. Is endpoint registered and reachable?
[Dec 28 12:59:59] ERROR[23254]: chan_pjsip.c:2698 request: Failed to create outgoing session to endpoint ‘airtel_endpoint’

[Dec 28 13:46:53] WARNING[34302]: res_pjsip_registrar.c:1166 find_registrar_aor: AOR ‘’ not found for endpoint ‘8003’ (192.168.1.24:39172)

Most outbound proxies only support loose routing. Many don’t even like the presence of Route headers, so need those suppressing with a “;hide” parameter. Semicolons need escaping in the configuration files. (These are common issues over on the FreePBX forum.)

David can you please explain with example. what parameter/command I need to add/subtract We are using asterisk 20.8.3

https://www.google.com/search?q=freepbx+outbound+proxy+hide+parameter

I think you want to suggest like
outbound_proxy=sip:10.5.68.229:5060;lr
I have test with it but no improvement.

[Dec 28 18:50:29] ERROR[6911]: res_pjsip.c:993 ast_sip_create_dialog_uac: Endpoint ‘airtel_endpoint’: Could not create dialog to invalid URI ‘airtel_aor’. Is endpoint registered and reachable?
[Dec 28 18:50:29] ERROR[6911]: chan_pjsip.c:2698 request: Failed to create outgoing session to endpoint ‘airtel_endpoint’

Did you read the bit about escaping semicolons?

Although I’m not sure if it would fail in the way shown, having both static and dynamic contacts for the same AOR is not normally a sensible thing to do.

I see two three example settings,
outbound_proxy=sip:10.5.68.229:5060;lr;hide
“outbound_proxy=sip:10.5.68.229:5060;lr;hide”

I tried both but no improvements, may be I saw wrong post.[quote=“david551, post:6, topic:106041, full:true”]
Did you read the bit about escaping semicolons?

Although I’m not sure if it would fail in the way shown, having both static and dynamic contacts for the same AOR is not normally a sensible thing to do.
[/quote]

`[quote="helpinghandindia, post:7, topic:106041"]
outbound_proxy=sip:10.5.68.229:5060\;lr;hide
[/quote]

`

You have to escape semi colon

outbound_proxy=sip:10.5.68.229:5060;lr

outbound_proxy=sip:10.5.68.229:5060;lr
I tried same first.
May be I am making some mistake in typing but as I checked again, already implemented.
outbound_proxy=sip:10.5.68.229:5060\;lr;hide

outbound_proxy=sip:dl.ims.airtel.in:5060\;lr\;hide

res_pjsip.c:993 ast_sip_create_dialog_uac: Endpoint 'airtel_endpoint': Could not create dialog to invalid URI 'airtel_aor'.  Is endpoint registered and reachable?
[Dec 28 19:36:01] ERROR[20504]: chan_pjsip.c:2698 request: Failed to create outgoing session to endpoint 'airtel_endpoint'

Is the endpoint reachable? What does “pjsip show contacts” show? Is the SIP OPTIONS request being sent, and not responded to?

The problem has to be further isolated.

asterisk -rx “pjsip show contacts”

Contact: <Aor/ContactUri…> <Hash…> <RTT(ms)…>

Contact: 8081/sip:8081@192.168.1.24:7446;rinstance=a15c 5ce1c01b21 Avail 103.287
Contact: airtel_aor/sip:dl.ims.airtel.in:5060 880f7b58d3 Unavail nan

The qualify seems to be failing. It is not responding to the OPTIONS requests used to probe connectivity.

aor Unavail showing,
I am not experienced in this but tried a lot , still not resolved.

[airtel_aor]
type=aor
contact=sip:dl.ims.airtel.in
qualify_frequency=60
max_contacts=1

waiting for experts support.

On Saturday 28 December 2024 at 16:46:28, helpinghandindia via Asterisk
Community wrote:

contact=sip:dl.ims.airtel.in

I don’t know if you’ve checked, or have some local / private DNS service which
works differently, but the name dl.ims.airtel.in does not resolve for me:

$ host dl.ims.airtel.in
Host dl.ims.airtel.in not found: 3(NXDOMAIN)

$ dig any ims.airtel.in

;; QUESTION SECTION:
;dl.ims.airtel.in. IN MX

;; AUTHORITY SECTION:
ims.airtel.in. 34 IN SOA this.name.is.invalid.

Antony.


You can tell that the day just isn’t going right when you find yourself using
the telephone before the toilet.

                                               Please reply to the list;
                                                     please *don't* CC me.

ping dl.ims.airtel.in
PING dl.ims.airtel.in (10.5.68.229) 56(84) bytes of data.
64 bytes from dl.ims.airtel.in (10.5.68.229): icmp_seq=1 ttl=57 time=5.01 ms

/etc/hosts
10.5.68.229 dl.ims.airtel.in

old working sip.conf
register => +911141212300:Help123456:+911141212300@dl.ims.airtel.in@dl.ims.airtel.in/+911141212300

On Saturday 28 December 2024 at 17:14:44, helpinghandindia via Asterisk
Community wrote:

ping dl.ims.airtel.in
PING dl.ims.airtel.in (10.5.68.229) 56(84) bytes of data.
64 bytes from dl.ims.airtel.in (10.5.68.229): icmp_seq=1 ttl=57 time=5.01
ms

/etc/hosts
10.5.68.229 dl.ims.airtel.in

Aha, so it’s a private address, only accessible on your local network. Okay.

Antony.


2 days of trial and error can easily save you 5 minutes spent reading the
manual.

                                               Please reply to the list;
                                                     please *don't* CC me.

The registrar address is the same as its domain, and the contact address domain, so it is unlikely that there is an outbound proxy involved. Also, if you have correctly quoted the outbound proxy, “hide” is given as a comment, not a parameter, and it is possible that their server doesn’t like being treated as a proxy.

If you do need an outbound proxy, it should be set to the same value in all places where it is used, for a given endpoint.

As already pointed out, it doesn’t make sense to have both contact= and max_contacts= (static and dynamic contacts). I don’t think this will actually break anything, as I think the max_contacts will only present a potential security issue, not something that prevents normal operation.

I would want to see the Asterisk full log, with verbosity at least 3, and with the CLI command “pjsip set logger on”, in effect, to see if OPTIONS is being sent, to where, and with what result.

After few changes , current status, but outgoing still not working.
isk -rx “pjsip show registrations”

<Registration/ServerURI…> <Auth…> <Status…>

airtel/sip:dl.ims.airtel.in airtel_auth Registered (exp. 788s)

Objects found: 1

[root@localhost ~]# asterisk -rx “pjsip show contacts”

Contact: <Aor/ContactUri…> <Hash…> <RTT(ms)…>

Contact: 8081/sip:8081@192.168.1.24:22274;rinstance=8be 4e26aeaa9b Avail 104.255
Contact: airtel_aor/sip:dl.ims.airtel.in 494f3f125a Avail 4.734

Objects found: 2

[root@localhost ~]# asterisk -rx “pjsip show aors”

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

==========================================================================================

  Aor:  8003_aor                                             1

  Aor:  8004_aor                                             1

  Aor:  8081                                                 1
Contact:  8081/sip:8081@192.168.1.24:22274;rinstance=8 4e26aeaa9b Avail       103.196

  Aor:  8082                                                 1

  Aor:  airtel_aor                                           1
Contact:  airtel_aor/sip:dl.ims.airtel.in              494f3f125a Avail         4.734
ting [58509990494388@default:1] Set("PJSIP/8081-00000096", "CALLERID(num)=+911141212300") in new stack
    -- Executing [58509990494388@default:2] Progress("PJSIP/8081-00000096", "") in new stack
    -- Executing [58509990494388@default:3] Dial("PJSIP/8081-00000096", "PJSIP/09990494388@airtel_endpoint,,tTo") in new stack
<--- Transmitting SIP response (865 bytes) to UDP:192.168.1.24:22274 --->
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 192.168.1.24:22274;rport=22274;received=192.168.1.24;branch=z9hG4bK-d87543-4228de5a7d039a41-1--d87543-
Call-ID: 1e0c9a50b8627638OTA3YmI1MWY3MDU3OTdkYTBhNmVhODc4NTUxYTY0MWM.
From: "8081" <sip:8081@192.168.1.16>;tag=e878610e
To: "58509990494388" <sip:58509990494388@192.168.1.16>;tag=c1278754-c5f3-4a09-ad3c-2628b1d0f734
CSeq: 2 INVITE
Server: Asterisk PBX 20.9.2
Contact: <sip:192.168.1.16:5060>
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, INFO, REFER
Content-Type: application/sdp
Content-Length:   243

v=0
o=- 8 4 IN IP4 192.168.1.16
s=Asterisk
c=IN IP4 192.168.1.16
t=0 0
m=audio 14746 RTP/AVP 8 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:140
a=sendrecv

    -- Called PJSIP/09990494388@airtel_endpoint
<--- Transmitting SIP request (969 bytes) to UDP:10.5.68.229:5060 --->
INVITE sip:10.5.68.229:5060 SIP/2.0
Via: SIP/2.0/UDP 10.22.95.234:5060;rport;branch=z9hG4bKPjec6a2459-2925-4829-823d-06c52d5e3c26
From: <sip:+911141212300@dl.ims.airtel.in>;tag=b4dadb97-c495-4b5d-b37b-ec42ebe818fa
To: <sip:09990494388@dl.ims.airtel.in>
Contact: <sip:+911141212300@10.22.95.234:5060>
Call-ID: 4bf9348e-ceda-432a-a95e-51ae9bc18593
CSeq: 14672 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, INFO, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Route: <sip:09990494388@dl.ims.airtel.in>
Max-Forwards: 70
User-Agent: Asterisk PBX 20.9.2
Content-Type: application/sdp
Content-Length:   237

v=0
o=- 1899443707 1899443707 IN IP4 10.22.95.234
s=Asterisk
c=IN IP4 10.22.95.234
t=0 0
m=audio 11352 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:140
a=sendrecv

<--- Received SIP response (392 bytes) from UDP:10.5.68.229:5060 --->
SIP/2.0 100 Trying
Call-ID: 4bf9348e-ceda-432a-a95e-51ae9bc18593
Via: SIP/2.0/UDP 10.22.95.234:5060;received=10.22.95.234;branch=z9hG4bKPjec6a2459-2925-4829-823d-06c52d5e3c26;rport=5060
To: <sip:09990494388@dl.ims.airtel.in>
From: <sip:+911141212300@dl.ims.airtel.in>;tag=b4dadb97-c495-4b5d-b37b-ec42ebe818fa
CSeq: 14672 INVITE
Date: Sun, 29 Dec 2024 08:28:30 GMT
Content-Length: 0


<--- Received SIP response (461 bytes) from UDP:10.5.68.229:5060 --->
SIP/2.0 401 wrong_dialling_pattern
Call-ID: 4bf9348e-ceda-432a-a95e-51ae9bc18593
Via: SIP/2.0/UDP 10.22.95.234:5060;received=10.22.95.234;branch=z9hG4bKPjec6a2459-2925-4829-823d-06c52d5e3c26;rport=5060
To: <sip:09990494388@dl.ims.airtel.in>;tag=6758b1ae-6771082e734a04c-gm-po-lucentPCSF-097616
From: <sip:+911141212300@dl.ims.airtel.in>;tag=b4dadb97-c495-4b5d-b37b-ec42ebe818fa
CSeq: 14672 INVITE
Date: Sun, 29 Dec 2024 08:28:30 GMT
Content-Length: 0


<--- Transmitting SIP request (487 bytes) to UDP:10.5.68.229:5060 --->
ACK sip:10.5.68.229:5060 SIP/2.0
Via: SIP/2.0/UDP 10.22.95.234:5060;rport;branch=z9hG4bKPjec6a2459-2925-4829-823d-06c52d5e3c26
From: <sip:+911141212300@dl.ims.airtel.in>;tag=b4dadb97-c495-4b5d-b37b-ec42ebe818fa
To: <sip:09990494388@dl.ims.airtel.in>;tag=6758b1ae-6771082e734a04c-gm-po-lucentPCSF-097616
Call-ID: 4bf9348e-ceda-432a-a95e-51ae9bc18593
CSeq: 14672 ACK
Route: <sip:09990494388@dl.ims.airtel.in>
Max-Forwards: 70
User-Agent: Asterisk PBX 20.9.2
Content-Length:  0


[Dec 29 13:58:53] WARNING[16699]: res_pjsip_outbound_authenticator_digest.c:507 digest_create_request_with_auth: Endpoint: 'airtel_endpoint': No auth objects matching realm(s) '' from challenge found.

Seemingly rejecting due to “wrong_dialling_pattern” but what that means exactly I don’t know. Could be that the dialed number is in an invalid format, or your From username is an invalid format.

Aor: airtel_aor 1
Contact: airtel_aor/sip:dl.ims.airtel.in 494f3f125a Avail 5.705

all status seems right now
I also tried different dialing pattern but outgoing still not going, i

default:1] Set(“PJSIP/8081-00000034”, “PJSIP_HEADER(add,P-Asserted-Identity)=“sip:+911141212300@dl.ims.airtel.in””) in new stack
– Executing [9582291326@default:2] Dial(“PJSIP/8081-00000034”, “PJSIP/09582291326@airtel_endpoint”) in new stack
– Called PJSIP/09582291326@airtel_endpoint
[Dec 29 18:16:54] WARNING[2761]: res_pjsip_outbound_authenticator_digest.c:507 digest_create_request_with_auth: Endpoint: ‘airtel_endpoint’: No auth objects matching realm(s) ‘’ from challenge found.