Problems with voice in internet extensions

My elastix has configured extensions outside the local network, have nat enabled and open the required ports.
In the local network “A” everything goes well with approximately 10 extensions
In network “B” everything goes well with approximately 5 extensions
In network “C” there are errors in 2 of the 5 extensions created but all the parameters are correct, in ocaciones in the “B” network the same happens in several extensions.
Network configuration A

[1010]
deny=0.0.0.0/0.0.0.0
secret=4p0y0l4b0r4l
dtmfmode=rfc2833
canreinvite=no
context=from-internal
host=dynamic
trustrpid=yes
sendrpid=no
type=friend
nat=yes
port=5060
qualify=yes
qualifyfreq=60
transport=udp
avpf=no
icesupport=no
encryption=no
callgroup=
pickupgroup=
dial=SIP/1010
mailbox=1010@device
permit=0.0.0.0/0.0.0.0
callerid=Recepcion Faca <1010>
callcounter=yes
faxdetect=no

Configuration error extension in network “B”
[5010]
deny=0.0.0.0/0.0.0.0
secret=4p0y0l4b0r4l
dtmfmode=rfc2833
canreinvite=no
context=from-internal
host=dynamic
trustrpid=yes
sendrpid=no
type=friend
nat=yes
port=5060
qualify=yes
qualifyfreq=60
transport=udp
avpf=no
icesupport=no
encryption=no
callgroup=
pickupgroup=
dial=SIP/5010
mailbox=5010@device
permit=0.0.0.0/0.0.0.0
callerid=Recepcion Madrid <5010>
callcounter=yes
faxdetect=no

localhost*CLI> sip show peers
Name/username Host Dyn Forcerport Comedia ACL Port Status Description
1010/1010 190.xxx.xxx.xxx D Yes Yes A 61820 OK (30 ms)
1020/1020 190.xxx.xxx.xxx D Yes Yes A 61674 OK (29 ms)
1030/1030 190.xxx.xxx.xxx D Yes Yes A 61673 OK (27 ms)
1050/1050 190.xxx.xxx.xxx D Yes Yes A 61815 OK (31 ms)
1090/1090 190.xxx.xxx.xxx D Yes Yes A 61818 OK (26 ms)
1120/1120 190.xxx.xxx.xxx D Yes Yes A 61819 OK (28 ms)
2000/2000 192.168.10.31 D No No A 5393 OK (24 ms)
2010/2010 192.168.10.23 D No No A 5060 OK (5 ms)
2030/2030 192.168.10.26 D No No A 5060 OK (5 ms)
2031/2031 192.168.10.32 D No No A 5060 OK (5 ms)
2040/2040 192.168.10.105 D No No A 38412 OK (114 ms)
2041/2041 192.168.10.20 D No No A 5060 OK (5 ms)
2042/2042 192.168.10.27 D No No A 5060 OK (5 ms)
2060/2060 190.xxx.xxx.xxx D Yes Yes A 1024 OK (34 ms)
2061/2061 192.168.10.22 D No No A 5060 OK (5 ms)
2062/2062 192.168.10.25 D No No A 5060 OK (5 ms)
2070/2070 192.168.10.24 D No No A 5060 OK (6 ms)
2080/2080 192.168.10.30 D No No A 5060 OK (5 ms)
2091/2091 192.168.10.21 D No No A 5060 OK (6 ms)
2092/2092 192.168.10.28 D No No A 5060 OK (5 ms)
2110/2110 192.168.50.4 D No No A 5060 OK (7 ms)
2111/2111 (Unspecified) D Yes Yes A 0 UNKNOWN
3010/3010 190.xxx.xxx.xxx D Yes Yes A 5060 OK (24 ms)
5010/5010 181.xxx.xxx.xxx D Yes Yes A 1024 OK (22 ms)
5020/5020 181.xxx.xxx.xxx D Yes Yes A 1027 OK (25 ms)
5030 (Unspecified) D Yes Yes A 0 UNKNOWN
5050/5050 181.xxx.xxx.xxx D Yes Yes A 1024 OK (19 ms)
5070/5070 181.xxx.xxx.xxx D Yes Yes A 5060 OK (17 ms)
5090/5090 181.xxx.xxx.xxx D Yes Yes A 1026 OK (24 ms)
5140/5140 181.xxx.xxx.xxx D Yes Yes A 1028 OK (22 ms)
6010/6010 181.xxx.xxx.xxx D Yes Yes A 5060 OK (34 ms)
7010/7010 190.xxx.xxx.xxx D Yes Yes A 5060 OK (29 ms)
8010/8010 186.xxx.xxx.xxx D Yes Yes A 8032 OK (45 ms)
TroncalClaro 10.xxx.xxx.xxx Auto (No) No 5060 OK (4 ms)

As I can see everything is fine, I do not know why the error is generated with the sound

I’d suggest providing the output of “sip set debug on” and “rtp set debug on” to see exactly what the signaling is providing and what RTP is going for a non-working case.

When executing the command “sip set debug on”

<------------>
Scheduling destruction of SIP dialog ‘50e3db362d12834d72c7fa5e0db53500@192.168.10.2:5060’ in 6400 ms (Method: INVITE)
set_destination: Parsing sip:5070@192.168.1.170:5060 for address/port to send to
set_destination: set destination to 192.168.1.170:5060
Reliably Transmitting (NAT) to 181.52.86.198:1024:
BYE sip:5070@192.168.1.170:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.2:5060;branch=z9hG4bK49d5ebfe;rport
Max-Forwards: 70
From: “Sistemas” sip:2110@192.168.10.2;tag=as334a06b4
To: sip:5070@192.168.1.170:5060;tag=358691635
Call-ID: 50e3db362d12834d72c7fa5e0db53500@192.168.10.2:5060
CSeq: 103 BYE
User-Agent: FPBX-2.11.0(11.13.0)
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0


<— SIP read from UDP:181.xxx.xxx.xxx:1024 —>
SIP/2.0 481 Call Leg/Transaction Does Not Exist
Via: SIP/2.0/UDP 192.168.10.2:5060;branch=z9hG4bK49d5ebfe;rport=5060;received=181.49.143.50
From: “Sistemas” sip:2110@192.168.10.2;tag=as334a06b4
To: sip:5070@192.168.1.170:5060;tag=358691635
Call-ID: 50e3db362d12834d72c7fa5e0db53500@192.168.10.2:5060
CSeq: 103 BYE
Contact: sip:5070@192.168.1.170:5060
Supported: replaces, path, timer
User-Agent: Grandstream GXP1610 1.0.2.4
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Length: 0

[2017-01-23 12:44:53] DEBUG[21274][C-000002c4]: res_rtp_asterisk.c:4231 ast_rtp_read: RTP NAT: Got audio from other end. Now sending to address 190.146.2.150:5004
Got RTP packet from 190.xxx.xxx.xxx:5004 (type 08, seq 063639, ts 6019840, len 000160)
Sent RTP packet to 192.168.10.23:5004 (type 08, seq 020768, ts 6019840, len 000160)
Got RTP packet from 190.xxx.xxx.xxx:5004 (type 08, seq 063640, ts 6020000, len 000160)
Sent RTP packet to 192.168.10.23:5004 (type 08, seq 020769, ts 6020000, len 000160)

The complete call please.