Help me on outbound call using asterisk

I am new to asterisk.
i have basically setuped asterisk we had an old asterisk thats working and we want an new asterisk system as a backup now i have the same pjsip.conf extensions.conf and stuff now i have used them in the new asterisk now when i try to outbound call.
i am using an ip based sip trunk for this.

channel originate PJSIP/+918849653720@jio extension s@outbound

i am getting this

  -- Called +918849653720@jio
<--- Transmitting SIP request (937 bytes) to UDP:100.64.0.20:5060 --->
INVITE sip:+918849653720@100.64.0.20 SIP/2.0
Via: SIP/2.0/UDP 192.168.3.94:5060;rport;branch=z9hG4bKPj9bdf10ca-86d5-40f9-991f-c325dfc3646e
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=59db3a6e-9d51-47d5-b7cd-c60c612e6755
To: <sip:+918849653720@100.64.0.20>
Contact: <sip:asterisk@192.168.3.94:5060>
Call-ID: ec99d00f-3563-4dbe-bfb0-199d4f43a5e6
CSeq: 29789 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 20.10.0
Content-Type: application/sdp
Content-Length:   237

v=0
o=- 2144696397 2144696397 IN IP4 192.168.3.94
s=Asterisk
c=IN IP4 192.168.3.94
t=0 0
m=audio 18660 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

<--- Transmitting SIP request (937 bytes) to UDP:100.64.0.20:5060 --->
INVITE sip:+918849653720@100.64.0.20 SIP/2.0
Via: SIP/2.0/UDP 192.168.3.94:5060;rport;branch=z9hG4bKPj9bdf10ca-86d5-40f9-991f-c325dfc3646e
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=59db3a6e-9d51-47d5-b7cd-c60c612e6755
To: <sip:+918849653720@100.64.0.20>
Contact: <sip:asterisk@192.168.3.94:5060>
Call-ID: ec99d00f-3563-4dbe-bfb0-199d4f43a5e6
CSeq: 29789 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 20.10.0
Content-Type: application/sdp
Content-Length:   237

v=0
o=- 2144696397 2144696397 IN IP4 192.168.3.94
s=Asterisk
c=IN IP4 192.168.3.94
t=0 0
m=audio 18660 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

<--- Transmitting SIP request (937 bytes) to UDP:100.64.0.20:5060 --->
INVITE sip:+918849653720@100.64.0.20 SIP/2.0
Via: SIP/2.0/UDP 192.168.3.94:5060;rport;branch=z9hG4bKPj9bdf10ca-86d5-40f9-991f-c325dfc3646e
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=59db3a6e-9d51-47d5-b7cd-c60c612e6755
To: <sip:+918849653720@100.64.0.20>
Contact: <sip:asterisk@192.168.3.94:5060>
Call-ID: ec99d00f-3563-4dbe-bfb0-199d4f43a5e6
CSeq: 29789 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 20.10.0
Content-Type: application/sdp
Content-Length:   237

v=0
o=- 2144696397 2144696397 IN IP4 192.168.3.94
s=Asterisk
c=IN IP4 192.168.3.94
t=0 0
m=audio 18660 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

<--- Transmitting SIP request (937 bytes) to UDP:100.64.0.20:5060 --->
INVITE sip:+918849653720@100.64.0.20 SIP/2.0
Via: SIP/2.0/UDP 192.168.3.94:5060;rport;branch=z9hG4bKPj9bdf10ca-86d5-40f9-991f-c325dfc3646e
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=59db3a6e-9d51-47d5-b7cd-c60c612e6755
To: <sip:+918849653720@100.64.0.20>
Contact: <sip:asterisk@192.168.3.94:5060>
Call-ID: ec99d00f-3563-4dbe-bfb0-199d4f43a5e6
CSeq: 29789 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 20.10.0
Content-Type: application/sdp
Content-Length:   237

v=0
o=- 2144696397 2144696397 IN IP4 192.168.3.94
s=Asterisk
c=IN IP4 192.168.3.94
t=0 0
m=audio 18660 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

<--- Transmitting SIP request (937 bytes) to UDP:100.64.0.20:5060 --->
INVITE sip:+918849653720@100.64.0.20 SIP/2.0
Via: SIP/2.0/UDP 192.168.3.94:5060;rport;branch=z9hG4bKPj9bdf10ca-86d5-40f9-991f-c325dfc3646e
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=59db3a6e-9d51-47d5-b7cd-c60c612e6755
To: <sip:+918849653720@100.64.0.20>
Contact: <sip:asterisk@192.168.3.94:5060>
Call-ID: ec99d00f-3563-4dbe-bfb0-199d4f43a5e6
CSeq: 29789 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 20.10.0
Content-Type: application/sdp
Content-Length:   237

v=0
o=- 2144696397 2144696397 IN IP4 192.168.3.94
s=Asterisk
c=IN IP4 192.168.3.94
t=0 0
m=audio 18660 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

Asterisk is sending a SIP INVITE, but getting no response, so you’d need to investigate outside of Asterisk.

can i share the configs to you sir? and what do mean by saying outside the asterisk? i am new to this

Outside Asterisk means that the problem is with the network, or the remote system.

However, it does look as though you are behind NAT, but haven’t set the external signalling address (media address and local networks). On the other hand, you are sending rport, so the remote end should reply to the address from which the request came, not to the, unrouteable 192.168 address, so that would still make the fault outside Asterisk (failure to honour rport, or the router not actually routing responses correctly.

this is my pjsip.conf and i am using asterisk 20. is this correct?

[transport-udp-nat]
type = transport
protocol = udp
bind = 0.0.0.0
; NAT settings
;local_net = 10.0.0.0/8
;external_media_address = 203.0.113.1
;external_signaling_address = 203.0.113.1

[jio] 
type=aor 
contact=sip:jio@100.64.0.20 
qualify_frequency=60
maximum_expiration=3600 
minimum_expiration=60 
default_expiration=120 
 
[pjsiptrunk] 
type=identify 
endpoint=jio
match=100.64.0.20
 
[jio] 
type=endpoint 
context=from-pstn
disallow=all 
allow=ulaw 
allow=alaw
rtp_symmetric=yes 
rewrite_contact=yes 
rtp_timeout=60 
use_ptime=yes 
moh_suggest=default 
direct_media=no 
send_rpid=yes 
inband_progress=no 
language=en 
aors=jio
send_connected_line=false
t38_udptl=no
t38_udptl_ec=none
fax_detect=no
trust_id_inbound=no
t38_udptl_nat=no
dtmf_mode=rfc4733

I’d need details of your network, up to and including 100.64.0.20, to know whether this right. Also the instructions your provider gave you with regard to addresses. 100.64.0.20 is a shared address, so I’d expect it to get special treatment for routing, and that there would probably be NAT or a second interface involved.

where and how can i find the details?

They are details you should already know before you attempt setting up a connection to a provider. They are a combination of the requirements of the provider and your design for how to meet those requirements.

The provider is using an IP address in the shared range, which requires special consideration when designing the network.

the client said this:

100.64.0.20 is the gateway which was used when we used sip line on pc with phonedialer

on the astersik which is working

there is route add command which is executed to use a gateway address

for 100.64.0.20 and 100.64.0.21

i gave that details yedterday

and asked you whether you have used the same or not

the easiest way to diagnoze is

whether you can reach the gateway 100.64.0.20

when we connect the link

route add 100.64.0.21 gw 100.65.183.113

is this correct?

This is the first post mentioning route add.

Your asterisk box has an interface with the address 192.168.3.94, that is not on the same sub-network as 100.65.183.113, so would also need a route add to define a route to that address, or probably a second interface that is on the correct sub-net.

With just a second route add, you still have the problem that you are asking the provider to respond to a private address which may be in use by many of their customers.

I think we need a diagram of the locations of the routers, their addresses, and address ranges covered by the various network segments.

i added some routes

sudo ip route add 100.64.0.20 via 100.65.183.113
sudo ip route add 100.64.0.21 via 100.65.183.113

This is the latest things i am getting

Connected to Asterisk 20.10.0 currently running on saltriver-ThinkCentre-M710s (                                                                             pid = 1950)
saltriver-ThinkCentre-M710s*CLI> channel originate PJSIP/08849653720@jio extensi                                                                             on s@outbound
    -- Called 08849653720@jio
<--- Transmitting SIP request (929 bytes) to UDP:100.64.0.20:5060 --->
INVITE sip:08849653720@100.64.0.20 SIP/2.0
Via: SIP/2.0/UDP 100.65.183.125:5060;rport;branch=z9hG4bKPjurhC76hpDNPYEY0iihM.N                                                                             BxrV9pelI2g
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=aU1RxqkDdqiW-ArDgDlrJ-13                                                                             LqCeTD1b
To: <sip:08849653720@100.64.0.20>
Contact: <sip:asterisk@100.65.183.125:5060>
Call-ID: ajYKbtC.0jx-9gA39imIS1EC2xudQNbl
CSeq: 23231 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL,                                                                              UPDATE, PRACK, INFO, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 20.10.0
Content-Type: application/sdp
Content-Length:   241

v=0
o=- 1915816983 1915816983 IN IP4 100.65.183.125
s=Asterisk
c=IN IP4 100.65.183.125
t=0 0
m=audio 13680 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 (437 bytes) from UDP:100.64.0.20:5060 --->
SIP/2.0 500 Server Internal Error
Via: SIP/2.0/UDP 100.65.183.125:5060;received=100.65.183.125;rport=5060;branch=z                                                                             9hG4bKPjurhC76hpDNPYEY0iihM.NBxrV9pelI2g
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=aU1RxqkDdqiW-ArDgDlrJ-13                                                                             LqCeTD1b
To: <sip:08849653720@100.64.0.20>;tag=1c234182505
Call-ID: ajYKbtC.0jx-9gA39imIS1EC2xudQNbl
CSeq: 23231 INVITE
Reason: SIP ;cause=500 ;text="Classification Failure"
Content-Length: 0


<--- Transmitting SIP request (409 bytes) to UDP:100.64.0.20:5060 --->
ACK sip:08849653720@100.64.0.20 SIP/2.0
Via: SIP/2.0/UDP 100.65.183.125:5060;rport;branch=z9hG4bKPjurhC76hpDNPYEY0iihM.N                                                                             BxrV9pelI2g
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=aU1RxqkDdqiW-ArDgDlrJ-13                                                                             LqCeTD1b
To: <sip:08849653720@100.64.0.20>;tag=1c234182505
Call-ID: ajYKbtC.0jx-9gA39imIS1EC2xudQNbl
CSeq: 23231 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 20.10.0
Content-Length:  0


saltriver-ThinkCentre-M710s*CLI> exit
Asterisk cleanly ending (0).
Executing last minute cleanups
root@saltriver-ThinkCentre-M710s:/usr/src/asterisk-20.10.0# sudo rm  extensions.                                                                             conf
root@saltriver-ThinkCentre-M710s:/usr/src/asterisk-20.10.0# sudo touch  extensio                                                                             ns.conf
root@saltriver-ThinkCentre-M710s:/usr/src/asterisk-20.10.0# sudo nano extensions                                                                             .conf
root@saltriver-ThinkCentre-M710s:/usr/src/asterisk-20.10.0# sudo asterisk -rx 'd                                                                             ialplan reload'
Dialplan reloaded.
root@saltriver-ThinkCentre-M710s:/usr/src/asterisk-20.10.0# sudo asterisk -rx 'p                                                                             jsip reload'
Module 'res_pjsip.so' reloaded successfully.
Module 'res_pjsip_authenticator_digest.so' reloaded successfully.
Module 'res_pjsip_endpoint_identifier_ip.so' reloaded successfully.
Module 'res_pjsip_mwi.so' reloaded successfully.
Module 'res_pjsip_notify.so' reloaded successfully.
Module 'res_pjsip_outbound_publish.so' reloaded successfully.
Module 'res_pjsip_publish_asterisk.so' reloaded successfully.
Module 'res_pjsip_outbound_registration.so' reloaded successfully.
root@saltriver-ThinkCentre-M710s:/usr/src/asterisk-20.10.0# sudo asterisk -rvvv
Asterisk 20.10.0, Copyright (C) 1999 - 2022, Sangoma Technologies Corporation and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 20.10.0 currently running on saltriver-ThinkCentre-M710s (pid = 1950)
saltriver-ThinkCentre-M710s*CLI> channel originate PJSIP/08849653720@jio extension s@outbound
    -- Called 08849653720@jio
<--- Transmitting SIP request (929 bytes) to UDP:100.64.0.20:5060 --->
INVITE sip:08849653720@100.64.0.20 SIP/2.0
Via: SIP/2.0/UDP 100.65.183.125:5060;rport;branch=z9hG4bKPj4JHJJADNgZem9-HCTo9qYqOzxSgRHYCj
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=Gl74V-EO-v.9uPJLt3MxvQcxA0qNyW7K
To: <sip:08849653720@100.64.0.20>
Contact: <sip:asterisk@100.65.183.125:5060>
Call-ID: LCG9kvkv2wrrUENcQq5kLWL0y6QTBwf7
CSeq: 22122 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 20.10.0
Content-Type: application/sdp
Content-Length:   241

v=0
o=- 1836891397 1836891397 IN IP4 100.65.183.125
s=Asterisk
c=IN IP4 100.65.183.125
t=0 0
m=audio 17616 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 (438 bytes) from UDP:100.64.0.20:5060 --->
SIP/2.0 500 Server Internal Error
Via: SIP/2.0/UDP 100.65.183.125:5060;received=100.65.183.125;rport=5060;branch=z9hG4bKPj4JHJJADNgZem9-HCTo9qYqOzxSgRHYCj
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=Gl74V-EO-v.9uPJLt3MxvQcxA0qNyW7K
To: <sip:08849653720@100.64.0.20>;tag=1c1172020539
Call-ID: LCG9kvkv2wrrUENcQq5kLWL0y6QTBwf7
CSeq: 22122 INVITE
Reason: SIP ;cause=500 ;text="Classification Failure"
Content-Length: 0


<--- Transmitting SIP request (410 bytes) to UDP:100.64.0.20:5060 --->
ACK sip:08849653720@100.64.0.20 SIP/2.0
Via: SIP/2.0/UDP 100.65.183.125:5060;rport;branch=z9hG4bKPj4JHJJADNgZem9-HCTo9qYqOzxSgRHYCj
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=Gl74V-EO-v.9uPJLt3MxvQcxA0qNyW7K
To: <sip:08849653720@100.64.0.20>;tag=1c1172020539
Call-ID: LCG9kvkv2wrrUENcQq5kLWL0y6QTBwf7
CSeq: 22122 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 20.10.0
Content-Length:  0

type or paste code here

The call attempt was rejected by the remote side with this reason. Why that is and how to resolve it, no clue. Entirely possible it is due to the fact that your From header is anonymous.

Never faced this error before neither gpt can help

The anonymous is my guess too, but you haven’t said who the provider is, so we can’t look up their documentation. We can’t identify them by IP, as they are using a shared, not a public, address.

They may want from user setting to an account name, or phone number.