Asterisk dials extension (PJSIP/ext) but nothing happens

Hi.

I’am trying to migrate from FreePBX 15 to standalone Asterisk 18 (compiled from latest source) on Debian 11 Buster. Registration works fine, but i cannot make call between two internal extensions.

When i try to make calls between my two extensions (201 and 202) i get something like this:

Connected to Asterisk 18.6.0 currently running on debian (pid = 1213)
Parsing /etc/asterisk/logger.conf
Core debug is still 2.
    -- Executing [202@from-internal:1] Dial("PJSIP/201-00000008", "PJSIP/202") in new stack
    -- Called PJSIP/202
  == Everyone is busy/congested at this time (1:0/1/0)
    -- Auto fallthrough, channel 'PJSIP/201-00000008' status is 'CONGESTION'

Here is my /etc/asterisk/pjsip.conf:

[transport-tcp]
type = transport
protocol = tcp
bind = 0.0.0.0

;================================ ENDPOINT TEMPLATES ==
[endpoint-internal](!)
type = endpoint
context = from-internal
allow = alaw,opus,h264

[auth-userpass](!)
type = auth
auth_type = userpass

[aor-single-reg](!)
type = aor
max_contacts = 1

;================================ ENDPOINT DEFINITIONS ==
[201](endpoint-internal)
auth = 201
aors = 201
callerid = Redmi Note 8 Pro <201>

[201](auth-userpass)
password = xxxxxxxxxx
username = 201

[201](aor-single-reg)
mailboxes = 201

[202](endpoint-internal)
auth = 202
aors = 202
callerid = Mama <202>

[202](auth-userpass)
password = xxxxxxxxxx
username = 202

[202](aor-single-reg)
mailboxes = 202

And here is /etc/asterisk/extensions.conf:

[from-internal]
exten = _2XX,1,Dial(PJSIP/${EXTEN})

debian*CLI> pjsip show endpoints:

 Endpoint:  <Endpoint/CID.....................................>  <State.....>  <Channels.>
    I/OAuth:  <AuthId/UserName...........................................................>
        Aor:  <Aor............................................>  <MaxContact>
      Contact:  <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
  Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress..................>
   Identify:  <Identify/Endpoint.........................................................>
        Match:  <criteria.........................>
    Channel:  <ChannelId......................................>  <State.....>  <Time.....>
        Exten: <DialedExten...........>  CLCID: <ConnectedLineCID.......>
==========================================================================================

 Endpoint:  201/201                                              Not in use    0 of inf
     InAuth:  201/201
        Aor:  201                                                1
      Contact:  201/sip:201@192.168.2.2:51533;transport=TC d2fa39df1d NonQual         nan

 Endpoint:  202/202                                              Not in use    0 of inf
     InAuth:  202/202
        Aor:  202                                                1
      Contact:  202/sip:202@100.122.213.208:47656;transpor 79b6547102 NonQual         nan


Objects found: 2

I am on host with public static IP, no firewall of any type. On the same host FreePBX 15 works fine.

Thank you in advance for any help.

Best regards.

Add “disallow=all” above the “allow…” line.

Thank you!

Anyway, the problem was with NAT settings. Adding

rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes

to endpoints solved my main issue. Anyway, there is another strange problem. When i am making voice call i can pickup, but there is no audio on both sides at all. But when i make video call (H264), the sound (and video) is working without any problems.

When making audio-only call:

 -- Executing [201@from-internal:1] Dial("PJSIP/202-00000010", "PJSIP/201") in new stack
    -- Called PJSIP/201
    -- PJSIP/201-00000011 is ringing
       > 0x7fa7d0039e70 -- Strict RTP learning after remote address set to: 192.168.2.173:5004
    -- PJSIP/201-00000011 answered PJSIP/202-00000010
       > 0x7fa7d0029250 -- Strict RTP learning after remote address set to: 192.168.2.56:56306
    -- Channel PJSIP/201-00000011 joined 'simple_bridge' basic-bridge <427cb468-0f93-49cf-8625-ad354f90d2b0>
    -- Channel PJSIP/202-00000010 joined 'simple_bridge' basic-bridge <427cb468-0f93-49cf-8625-ad354f90d2b0>
       > Bridge 427cb468-0f93-49cf-8625-ad354f90d2b0: switching from simple_bridge technology to native_rtp
       > Remotely bridged 'PJSIP/202-00000010' and 'PJSIP/201-00000011' - media will flow directly between them
       > 0x7fa7d0039e70 -- Strict RTP learning after remote address set to: 192.168.2.173:5004
       > 0x7fa7d0039e70 -- Strict RTP qualifying stream type: audio
       > 0x7fa7d0029250 -- Strict RTP learning after remote address set to: 192.168.2.56:56306
    -- Channel PJSIP/201-00000011 left 'native_rtp' basic-bridge <427cb468-0f93-49cf-8625-ad354f90d2b0>
    -- Channel PJSIP/202-00000010 left 'native_rtp' basic-bridge <427cb468-0f93-49cf-8625-ad354f90d2b0>
  == Spawn extension (from-internal, 201, 1) exited non-zero on 'PJSIP/202-00000010'

and as i mentioned there is no audio at all. After abount 30 seconds call is automatically terminated.

Making video call:

 -- Executing [201@from-internal:1] Dial("PJSIP/202-00000012", "PJSIP/201") in new stack
    -- Called PJSIP/201
    -- PJSIP/201-00000013 is ringing
       > 0x7fa7d0065d60 -- Strict RTP learning after remote address set to: 192.168.2.173:5004
       > 0x7fa7d0068910 -- Strict RTP learning after remote address set to: 192.168.2.173:5006
    -- PJSIP/201-00000013 answered PJSIP/202-00000012
       > 0x7fa7d0039e70 -- Strict RTP learning after remote address set to: 192.168.2.56:57104
       > 0x7fa7d00714d0 -- Strict RTP learning after remote address set to: 192.168.2.56:22992
    -- Channel PJSIP/201-00000013 joined 'simple_bridge' basic-bridge <9bf65b06-a3b9-4ca5-a638-da512c0931d2>
    -- Channel PJSIP/202-00000012 joined 'simple_bridge' basic-bridge <9bf65b06-a3b9-4ca5-a638-da512c0931d2>
       > 0x7fa7d0039e70 -- Strict RTP qualifying stream type: audio
       > 0x7fa7d0039e70 -- Strict RTP switching source address to 83.23.134.232:57104
       > 0x7fa7d00714d0 -- Strict RTP qualifying stream type: video
       > 0x7fa7d00714d0 -- Strict RTP switching source address to 83.23.134.232:22992
       > 0x7fa7d0065d60 -- Strict RTP qualifying stream type: audio
       > 0x7fa7d0065d60 -- Strict RTP switching source address to 83.23.134.232:5004
       > 0x7fa7d0068910 -- Strict RTP qualifying stream type: video
       > 0x7fa7d0068910 -- Strict RTP switching source address to 83.23.134.232:5006
       > 0x7fa7d0039e70 -- Strict RTP learning complete - Locking on source address 83.23.134.232:57104
       > 0x7fa7d0065d60 -- Strict RTP learning complete - Locking on source address 83.23.134.232:5004
       > 0x7fa7d00714d0 -- Strict RTP learning complete - Locking on source address 83.23.134.232:22992
       > 0x7fa7d0068910 -- Strict RTP learning complete - Locking on source address 83.23.134.232:5006
    -- Channel PJSIP/201-00000013 left 'simple_bridge' basic-bridge <9bf65b06-a3b9-4ca5-a638-da512c0931d2>
    -- Channel PJSIP/202-00000012 left 'simple_bridge' basic-bridge <9bf65b06-a3b9-4ca5-a638-da512c0931d2>
  == Spawn extension (from-internal, 201, 1) exited non-zero on 'PJSIP/202-00000012'

audio (and video) works fine.

Try:
rtp_symmetric=no