Asterisk 16 LTS & PJSIP; hello world works but no sound coming from endpoints

1

I have recently set up an Asterisk server with version 16.4.0 LTS. I am completely new to asterisk yet I have managed to set up the server with the service and it runs smoothly among LAN users and it works ok for the internet with the ISPs of my country (Chile). Yet I think I have some issues with the configuration parameters of the PJSIP file as I have different problems that relate to NAT issues.

I am in Brasil and my server is in Chile, I also have an user testing from Germany.

I can call the server and can call any endpoint on the server. I set up a hello world test and I can call and hear the hello world with no issues. With RTP debug option on I can see how the packets reach well my endpoint in Brasil. But whenever I call any user and we try to communicate neither side hears any sound. Same happening with user in Germany.

When I look at the CLI I get this:

-- PJSIP/Brasil-0000000b answered PJSIP/Chile-0000000a
       > 0x7f380c041530 -- Strict RTP learning after remote address set to: 179.155.225.168:49202
       > 0x7f380c03a4f0 -- Strict RTP learning after remote address set to: 192.168.1.200:53250
    -- Channel PJSIP/Brasil-0000000b joined 'simple_bridge' basic-bridge <ec2f76a3-8e8c-453a-ada4-fb9326489237>
    -- Channel PJSIP/Chile-0000000a joined 'simple_bridge' basic-bridge <ec2f76a3-8e8c-453a-ada4-fb9326489237>
       > Bridge ec2f76a3-8e8c-453a-ada4-fb9326489237: switching from simple_bridge technology to native_rtp
       > Locally RTP bridged 'PJSIP/Chile-0000000a' and 'PJSIP/Brasil-0000000b' in stack
    -- Channel PJSIP/Brasil-0000000b left 'native_rtp' basic-bridge <ec2f76a3-8e8c-453a-ada4-fb9326489237>
    -- Channel PJSIP/Chile-0000000a left 'native_rtp' basic-bridge <ec2f76a3-8e8c-453a-ada4-fb9326489237>
  == Spawn extension (from-internal, 110, 1) exited non-zero on 'PJSIP/PruebaLocal-0000000a'

The above applies and neither side can hear the other.

However when calling internally, users can call eachother and hear eachother with no problems. I get the following at the CLI when they call internally;

 == Setting global variable 'SIPDOMAIN' to '192.168.1.20'
    -- Executing [104@from-internal:1] Dial("PJSIP/Chile1-00000011", "PJSIP/Chile2,30") in new stack
    -- Called PJSIP/Chile2
    -- PJSIP/Chile2-00000012 is ringing
    -- PJSIP/Chile2-00000012 is ringing
    -- PJSIP/Chile2-00000012 answered PJSIP/Chile1-00000011
       > 0x7f380c020920 -- Strict RTP learning after remote address set to: 192.168.1.102:53848
       > 0x7f380c0461e0 -- Strict RTP learning after remote address set to: 192.168.1.107:16400
    -- Channel PJSIP/Chile2-00000012 joined 'simple_bridge' basic-bridge <54d507b3-7af2-4b8c-ae73-61dc84b5d2c8>
    -- Channel PJSIP/Chile1-00000011 joined 'simple_bridge' basic-bridge <54d507b3-7af2-4b8c-ae73-61dc84b5d2c8>
       > Bridge 54d507b3-7af2-4b8c-ae73-61dc84b5d2c8: switching from simple_bridge technology to native_rtp
       > Remotely bridged 'PJSIP/Chile1-00000011' and 'PJSIP/Chile2-00000012' - media will flow directly between them
       > 0x7f380c020920 -- Strict RTP learning after remote address set to: 192.168.1.102:53848
       > 0x7f380c0461e0 -- Strict RTP learning after remote address set to: 192.168.1.107:16400
    -- Channel PJSIP/Chile1-00000011 left 'native_rtp' basic-bridge <54d507b3-7af2-4b8c-ae73-61dc84b5d2c8>
    -- Channel PJSIP/Chile2-00000012 left 'native_rtp' basic-bridge <54d507b3-7af2-4b8c-ae73-61dc84b5d2c8>
  == Spawn extension (from-internal, 104, 1) exited non-zero on 'PJSIP/Chile1-00000011'

My PJSIP looks like this:

;
;General Settings first
;

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060
;bind=0.0.0.0
local_net=192.168.1.0/24
external_media_address=THE_IP_FOR_MY_SERVER
external_signaling_address=THE_IP_FOR_MY_SERVER

;
;Phones on LAN
;
[endpoint_internal](!)
type=endpoint
context=from-internal
disallow=all
allow=alaw
allow=ulaw
;allow=g729
direct_media=no

;
;Phones outside LAN
;
[endpoint_external](!)
type=endpoint
context=from-internal
disallow=all
allow=alaw
allow=ulaw
;allow=g729

;From here testing
direct_media=no
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
ice_support=yes

;
;Auth options for our clients
;
[auth_userpass](!)
type=auth
auth_type=userpass

[aor_dynamic](!)
type=aor
remove_existing=yes
max_contacts=10

;Internal Users
[Chile](endpoint_internal)
auth=Chile
aors=Chile
[Chile](auth_userpass)
password=STRONG_PASSWORD
username=Chile
[Chile](aor_dynamic)

;External users
[Brasil](endpoint_external)
auth=Brasil
aors=Brasil
[Brasil](auth_userpass)
password=STRONG_PASSWORD
username=Brasil
[Brasil](aor_dynamic)

And My extension conf looks like this:

[Phones]
exten=>110,1,Dial(PJSIP/Brasil,30)
exten=>111,1,Dial(PJSIP/Chile,30)

If anyone has an idea or can point some direction of solving this I would highly appreciate it.

Regards.

mann138

Posted 2019-07-30T21:00:13.267

Reputation: 11

Answers

0

Make sure that the RTP ports are forwarded on both servers (Brasil and Germany). You may refer to the values set in rtp.conf. By default it is 10000 to 20000 UDP.

JP Loh

Posted 2019-07-30T21:00:13.267

Reputation: 1

They are on the server side (Chile), just checked on the asterisk server but how do I make sure that is the same here in Brazil, I am not in a server in Brazil by the way, I'm running an xlite softphone but on a home under ISP's router. – mann138 – 2019-07-31T21:59:13.783

0

I disabled the firewall in the CentOS machine (we have another for the whole lan) and everything worked well now.

mann138

Posted 2019-07-30T21:00:13.267

Reputation: 11