[SOLVED] NAT enabled and no voice in internal calls - Ubuntu 16.04 in Cloud

I solved many issues in the configuration of Asterisk 13.18.5 but I have problems yet with local network. The calls are with no voice in both ways, if I put both equipaments in diferents networks and use the internet to comunicate the calls works perfectly, but in the same network doesn’t work.

Below has informations about the Asterisk settings, and the debug for a short call from the number 5000 to the number 9000.

The IP and mask of my localnet is 192.168.0.0/255.255.255.0

Complete SIP and RTP Debug - call of 30 seconds

<--- SIP read from UDP:187.107.128.238:26803 --->
INVITE sip:9000@solaristelecom.ddns.net;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 187.107.128.238:26803;branch=z9hG4bK-524287-1---ff2312adbd2b8aaa;rport
Max-Forwards: 70
Contact: <sip:5000@187.107.128.238:26803;transport=UDP>
To: <sip:9000@solaristelecom.ddns.net;transport=UDP>
From: <sip:5000@solaristelecom.ddns.net;transport=UDP>;tag=4dbcf45c
Call-ID: m15zlQ0qeui4L60bpqJNIA..
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Content-Type: application/sdp
User-Agent: Zoiper rd82a609
Allow-Events: presence, kpml, talk
Content-Length: 247

v=0
o=Zoiper 0 0 IN IP4 187.107.128.238
s=Zoiper
c=IN IP4 187.107.128.238
t=0 0
m=audio 26956 RTP/AVP 3 0 8 101
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
<------------->
--- (13 headers 12 lines) ---
Sending to 187.107.128.238:26803 (NAT)
Sending to 187.107.128.238:26803 (NAT)
Using INVITE request as basis request - m15zlQ0qeui4L60bpqJNIA..
Found peer '5000' for '5000' from 187.107.128.238:26803

<--- Reliably Transmitting (NAT) to 187.107.128.238:26803 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 187.107.128.238:26803;branch=z9hG4bK-524287-1---ff2312adbd2b8aaa;received=187.107.128.238;rport=26803
From: <sip:5000@solaristelecom.ddns.net;transport=UDP>;tag=4dbcf45c
To: <sip:9000@solaristelecom.ddns.net;transport=UDP>;tag=as1d7ff502
Call-ID: m15zlQ0qeui4L60bpqJNIA..
CSeq: 1 INVITE
Server: Asterisk PBX 13.18.5
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="6f01dedd"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog 'm15zlQ0qeui4L60bpqJNIA..' in 6720 ms (Method: INVITE)

<--- SIP read from UDP:187.107.128.238:26803 --->
ACK sip:9000@solaristelecom.ddns.net;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 187.107.128.238:26803;branch=z9hG4bK-524287-1---ff2312adbd2b8aaa;rport
Max-Forwards: 70
To: <sip:9000@solaristelecom.ddns.net;transport=UDP>;tag=as1d7ff502
From: <sip:5000@solaristelecom.ddns.net;transport=UDP>;tag=4dbcf45c
Call-ID: m15zlQ0qeui4L60bpqJNIA..
CSeq: 1 ACK
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---

<--- SIP read from UDP:187.107.128.238:26803 --->
INVITE sip:9000@solaristelecom.ddns.net;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 187.107.128.238:26803;branch=z9hG4bK-524287-1---34d154556c5c4508;rport
Max-Forwards: 70
Contact: <sip:5000@187.107.128.238:26803;transport=UDP>
To: <sip:9000@solaristelecom.ddns.net;transport=UDP>
From: <sip:5000@solaristelecom.ddns.net;transport=UDP>;tag=4dbcf45c
Call-ID: m15zlQ0qeui4L60bpqJNIA..
CSeq: 2 INVITE
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Content-Type: application/sdp
User-Agent: Zoiper rd82a609
Authorization: Digest username="5000",realm="asterisk",nonce="6f01dedd",uri="sip:9000@solaristelecom.ddns.net;transport=UDP",response="7453c54e005ce9293a1b3f5701f6803d",algorithm=MD5
Allow-Events: presence, kpml, talk
Content-Length: 247

v=0
o=Zoiper 0 0 IN IP4 187.107.128.238
s=Zoiper
c=IN IP4 187.107.128.238
t=0 0
m=audio 26956 RTP/AVP 3 0 8 101
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
<------------->
--- (14 headers 12 lines) ---
Sending to 187.107.128.238:26803 (NAT)
Using INVITE request as basis request - m15zlQ0qeui4L60bpqJNIA..
Found peer '5000' for '5000' from 187.107.128.238:26803
  == Using SIP RTP CoS mark 5
Found RTP audio format 3
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 101
Found audio description format GSM for ID 3
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw), peer - audio=(ulaw|gsm|alaw)/video=(nothing)/text=(nothing), combined - (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 187.107.128.238:26956
Looking for 9000 in rotadesaida (domain solaristelecom.ddns.net)
sip_route_dump: route/path hop: <sip:5000@187.107.128.238:26803;transport=UDP>

<--- Transmitting (NAT) to 187.107.128.238:26803 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 187.107.128.238:26803;branch=z9hG4bK-524287-1---34d154556c5c4508;received=187.107.128.238;rport=26803
From: <sip:5000@solaristelecom.ddns.net;transport=UDP>;tag=4dbcf45c
To: <sip:9000@solaristelecom.ddns.net;transport=UDP>
Call-ID: m15zlQ0qeui4L60bpqJNIA..
CSeq: 2 INVITE
Server: Asterisk PBX 13.18.5
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:9000@18.231.94.137:5060>
Content-Length: 0


<------------>
    -- Executing [9000@rotadesaida:1] Dial("SIP/5000-0000001e", "SIP/9000,60}") in new stack
  == Using SIP RTP CoS mark 5
    -- Called SIP/9000
    -- SIP/9000-0000001f is ringing

<--- Transmitting (NAT) to 187.107.128.238:26803 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 187.107.128.238:26803;branch=z9hG4bK-524287-1---34d154556c5c4508;received=187.107.128.238;rport=26803
From: <sip:5000@solaristelecom.ddns.net;transport=UDP>;tag=4dbcf45c
To: <sip:9000@solaristelecom.ddns.net;transport=UDP>;tag=as16a5846c
Call-ID: m15zlQ0qeui4L60bpqJNIA..
CSeq: 2 INVITE
Server: Asterisk PBX 13.18.5
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:9000@18.231.94.137:5060>
Content-Length: 0


<------------>

<--- SIP read from UDP:187.107.128.238:26803 --->


<------------->
Really destroying SIP dialog 'q4nJHVeXCGkkDyqJC0bT-A..' Method: REGISTER
    -- SIP/9000-0000001f answered SIP/5000-0000001e
Audio is at 13546
Adding codec ulaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<--- Reliably Transmitting (NAT) to 187.107.128.238:26803 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 187.107.128.238:26803;branch=z9hG4bK-524287-1---34d154556c5c4508;received=187.107.128.238;rport=26803
From: <sip:5000@solaristelecom.ddns.net;transport=UDP>;tag=4dbcf45c
To: <sip:9000@solaristelecom.ddns.net;transport=UDP>;tag=as16a5846c
Call-ID: m15zlQ0qeui4L60bpqJNIA..
CSeq: 2 INVITE
Server: Asterisk PBX 13.18.5
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:9000@18.231.94.137:5060>
Content-Type: application/sdp
Content-Length: 252

v=0
o=root 900640356 900640356 IN IP4 18.231.94.137
s=Asterisk PBX 13.18.5
c=IN IP4 18.231.94.137
t=0 0
m=audio 13546 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:150
a=sendrecv

<------------>
    -- Channel SIP/9000-0000001f joined 'simple_bridge' basic-bridge <1c14bda2-7752-4007-bb22-b14ae8c7996a>
    -- Channel SIP/5000-0000001e joined 'simple_bridge' basic-bridge <1c14bda2-7752-4007-bb22-b14ae8c7996a>
Got  RTP packet from    187.107.128.238:28680 (type 00, seq 047893, ts 507758788, len 000160)
Got  RTP packet from    187.107.128.238:26956 (type 95, seq 030655, ts 278111166, len 000001)

<--- SIP read from UDP:187.107.128.238:26803 --->
ACK sip:9000@18.231.94.137:5060 SIP/2.0
Via: SIP/2.0/UDP 187.107.128.238:26803;branch=z9hG4bK-524287-1---648cc00cd92a76ca;rport
Max-Forwards: 70
Contact: <sip:5000@187.107.128.238:26803;transport=UDP>
To: <sip:9000@solaristelecom.ddns.net;transport=UDP>;tag=as16a5846c
From: <sip:5000@solaristelecom.ddns.net;transport=UDP>;tag=4dbcf45c
Call-ID: m15zlQ0qeui4L60bpqJNIA..
CSeq: 2 ACK
User-Agent: Zoiper rd82a609
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---
Audio is at 13546
Adding codec ulaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 187.107.128.238:26803:
INVITE sip:5000@187.107.128.238:26803;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 18.231.94.137:5060;branch=z9hG4bK5d504f48;rport
Max-Forwards: 70
From: <sip:9000@solaristelecom.ddns.net;transport=UDP>;tag=as16a5846c
To: <sip:5000@solaristelecom.ddns.net;transport=UDP>;tag=4dbcf45c
Contact: <sip:9000@18.231.94.137:5060>
Call-ID: m15zlQ0qeui4L60bpqJNIA..
CSeq: 102 INVITE
User-Agent: Asterisk PBX 13.18.5
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
X-asterisk-Info: SIP re-invite (External RTP bridge)
Content-Type: application/sdp
Content-Length: 254

v=0
o=root 900640356 900640357 IN IP4 18.231.94.137
s=Asterisk PBX 13.18.5
c=IN IP4 187.107.128.238
t=0 0
m=audio 28680 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:150
a=sendrecv

---

<--- SIP read from UDP:187.107.128.238:26803 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 18.231.94.137:5060;branch=z9hG4bK5d504f48;rport=5060
Contact: <sip:5000@187.107.128.238:26803;transport=UDP>
To: <sip:5000@solaristelecom.ddns.net;transport=UDP>;tag=4dbcf45c
From: <sip:9000@solaristelecom.ddns.net;transport=UDP>;tag=as16a5846c
Call-ID: m15zlQ0qeui4L60bpqJNIA..
CSeq: 102 INVITE
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Content-Type: application/sdp
User-Agent: Zoiper rd82a609
Allow-Events: presence, kpml, talk
Content-Length: 247

v=0
o=Zoiper 0 1 IN IP4 187.107.128.238
s=Zoiper
c=IN IP4 187.107.128.238
t=0 0
m=audio 26956 RTP/AVP 0 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
<------------->
--- (12 headers 12 lines) ---
Found RTP audio format 0
Found RTP audio format 3
Found RTP audio format 8
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format GSM for ID 3
Found audio description format PCMA for ID 8
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw), peer - audio=(ulaw|gsm|alaw)/video=(nothing)/text=(nothing), combined - (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 187.107.128.238:26956
Transmitting (NAT) to 187.107.128.238:26803:
ACK sip:5000@187.107.128.238:26803;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 18.231.94.137:5060;branch=z9hG4bK21fe3cea;rport
Max-Forwards: 70
From: <sip:9000@solaristelecom.ddns.net;transport=UDP>;tag=as16a5846c
To: <sip:5000@solaristelecom.ddns.net;transport=UDP>;tag=4dbcf45c
Contact: <sip:9000@18.231.94.137:5060>
Call-ID: m15zlQ0qeui4L60bpqJNIA..
CSeq: 102 ACK
User-Agent: Asterisk PBX 13.18.5
Content-Length: 0


---
    -- Channel SIP/9000-0000001f left 'native_rtp' basic-bridge <1c14bda2-7752-4007-bb22-b14ae8c7996a>
Audio is at 13546
Adding codec ulaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 187.107.128.238:26803:
INVITE sip:5000@187.107.128.238:26803;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 18.231.94.137:5060;branch=z9hG4bK0dafbe49;rport
Max-Forwards: 70
From: <sip:9000@solaristelecom.ddns.net;transport=UDP>;tag=as16a5846c
To: <sip:5000@solaristelecom.ddns.net;transport=UDP>;tag=4dbcf45c
Contact: <sip:9000@18.231.94.137:5060>
Call-ID: m15zlQ0qeui4L60bpqJNIA..
CSeq: 103 INVITE
User-Agent: Asterisk PBX 13.18.5
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
X-asterisk-Info: SIP re-invite (External RTP bridge)
Content-Type: application/sdp
Content-Length: 252

v=0
o=root 900640356 900640358 IN IP4 18.231.94.137
s=Asterisk PBX 13.18.5
c=IN IP4 18.231.94.137
t=0 0
m=audio 13546 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:150
a=sendrecv

---
    -- Channel SIP/5000-0000001e left 'native_rtp' basic-bridge <1c14bda2-7752-4007-bb22-b14ae8c7996a>
  == Spawn extension (rotadesaida, 9000, 1) exited non-zero on 'SIP/5000-0000001e'
Scheduling destruction of SIP dialog 'm15zlQ0qeui4L60bpqJNIA..' in 6720 ms (Method: ACK)

<--- SIP read from UDP:187.107.128.238:26803 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 18.231.94.137:5060;branch=z9hG4bK0dafbe49;rport=5060
Contact: <sip:5000@187.107.128.238:26803;transport=UDP>
To: <sip:5000@solaristelecom.ddns.net;transport=UDP>;tag=4dbcf45c
From: <sip:9000@solaristelecom.ddns.net;transport=UDP>;tag=as16a5846c
Call-ID: m15zlQ0qeui4L60bpqJNIA..
CSeq: 103 INVITE
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Content-Type: application/sdp
User-Agent: Zoiper rd82a609
Allow-Events: presence, kpml, talk
Content-Length: 247

v=0
o=Zoiper 0 2 IN IP4 187.107.128.238
s=Zoiper
c=IN IP4 187.107.128.238
t=0 0
m=audio 26956 RTP/AVP 0 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
<------------->
--- (12 headers 12 lines) ---
Found RTP audio format 0
Found RTP audio format 3
Found RTP audio format 8
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format GSM for ID 3
Found audio description format PCMA for ID 8
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw), peer - audio=(ulaw|gsm|alaw)/video=(nothing)/text=(nothing), combined - (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 187.107.128.238:26956
Transmitting (NAT) to 187.107.128.238:26803:
ACK sip:5000@187.107.128.238:26803;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 18.231.94.137:5060;branch=z9hG4bK06ddf3be;rport
Max-Forwards: 70
From: <sip:9000@solaristelecom.ddns.net;transport=UDP>;tag=as16a5846c
To: <sip:5000@solaristelecom.ddns.net;transport=UDP>;tag=4dbcf45c
Contact: <sip:9000@18.231.94.137:5060>
Call-ID: m15zlQ0qeui4L60bpqJNIA..
CSeq: 103 ACK
User-Agent: Asterisk PBX 13.18.5
Content-Length: 0


---
Reliably Transmitting (NAT) to 187.107.128.238:26803:
BYE sip:5000@187.107.128.238:26803;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 18.231.94.137:5060;branch=z9hG4bK145c606d;rport
Max-Forwards: 70
From: <sip:9000@solaristelecom.ddns.net;transport=UDP>;tag=as16a5846c
To: <sip:5000@solaristelecom.ddns.net;transport=UDP>;tag=4dbcf45c
Call-ID: m15zlQ0qeui4L60bpqJNIA..
CSeq: 104 BYE
User-Agent: Asterisk PBX 13.18.5
Proxy-Authorization: Digest username="5000", realm="asterisk", algorithm=MD5, uri="sip:solaristelecom.ddns.net", nonce="6f01dedd", response="091711130438864c6e0d7f0c388643d0"
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0


---
Scheduling destruction of SIP dialog 'm15zlQ0qeui4L60bpqJNIA..' in 6720 ms (Method: ACK)

<--- SIP read from UDP:187.107.128.238:26803 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 18.231.94.137:5060;branch=z9hG4bK145c606d;rport=5060
Contact: <sip:5000@187.107.128.238:26803;transport=UDP>
To: <sip:5000@solaristelecom.ddns.net;transport=UDP>;tag=4dbcf45c
From: <sip:9000@solaristelecom.ddns.net;transport=UDP>;tag=as16a5846c
Call-ID: m15zlQ0qeui4L60bpqJNIA..
CSeq: 104 BYE
User-Agent: Zoiper rd82a609
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
Really destroying SIP dialog 'm15zlQ0qeui4L60bpqJNIA..' Method: ACK

ip-172-31-23-81*CLI> sip show settings

Global Settings:
----------------
  UDP Bindaddress:        0.0.0.0:5060
  TCP SIP Bindaddress:    Disabled
  TLS SIP Bindaddress:    Disabled
  Videosupport:           No
  Textsupport:            No
  Ignore SDP sess. ver.:  No
  AutoCreate Peer:        Off
  Match Auth Username:    No
  Allow unknown access:   No
  Allow subscriptions:    Yes
  Allow overlap dialing:  Yes
  Allow promisc. redir:   No
  Enable call counters:   No
  SIP domain support:     No
  Path support :          No
  Realm. auth:            No
  Our auth realm          asterisk
  Use domains as realms:  No
  Call to non-local dom.: Yes
  URI user is phone no:   No
  Always auth rejects:    Yes
  Direct RTP setup:       No
  User Agent:             Asterisk PBX 13.18.5
  SDP Session Name:       Asterisk PBX 13.18.5
  SDP Owner Name:         root
  Reg. context:           (not set)
  Regexten on Qualify:    No
  Trust RPID:             No
  Send RPID:              No
  Legacy userfield parse: No
  Send Diversion:         Yes
  Caller ID:              asterisk
  From: Domain:
  Record SIP history:     Off
  Auth. Failure Events:   Off
  T.38 support:           No
  T.38 EC mode:           Unknown
  T.38 MaxDtgrm:          4294967295
  SIP realtime:           Disabled
  Qualify Freq :          60000 ms
  Q.850 Reason header:    No
  Store SIP_CAUSE:        No

Network QoS Settings:
---------------------------
  IP ToS SIP:             CS0
  IP ToS RTP audio:       CS0
  IP ToS RTP video:       CS0
  IP ToS RTP text:        CS0
  802.1p CoS SIP:         4
  802.1p CoS RTP audio:   5
  802.1p CoS RTP video:   6
  802.1p CoS RTP text:    5
  Jitterbuffer enabled:   No

Network Settings:
---------------------------
  SIP address remapping:  Enabled using externaddr
  Externhost:             <none>
  Externaddr:             18.231.94.137:0
  Externrefresh:          10
  Localnet:               172.31.16.0/255.255.240.0
                          192.168.0.0/255.255.255.0

Global Signalling Settings:
---------------------------
  Codecs:                 (ulaw)
  Relax DTMF:             No
  RFC2833 Compensation:   No
  Symmetric RTP:          Yes
  Compact SIP headers:    No
  RTP Keepalive:          0 (Disabled)
  RTP Timeout:            0 (Disabled)
  RTP Hold Timeout:       0 (Disabled)
  MWI NOTIFY mime type:   application/simple-message-summary
  DNS SRV lookup:         Yes
  Pedantic SIP support:   Yes
  Reg. min duration       60 secs
  Reg. max duration:      360 secs
  Reg. default duration:  120 secs
  Sub. min duration       60 secs
  Sub. max duration:      360 secs
  Outbound reg. timeout:  20 secs
  Outbound reg. attempts: 0
  Outbound reg. retry 403:No
  Notify ringing state:   Yes
    Include CID:          No
  Notify hold state:      No
  SIP Transfer mode:      open
  Max Call Bitrate:       384 kbps
  Auto-Framing:           No
  Outb. proxy:            <not set>
  Session Timers:         Accept
  Session Refresher:      uas
  Session Expires:        1800 secs
  Session Min-SE:         90 secs
  Timer T1:               500
  Timer T1 minimum:       100
  Timer B:                32000
  No premature media:     Yes
  Max forwards:           70

Default Settings:
-----------------
  Allowed transports:     UDP
  Outbound transport:     UDP
  Context:                basico
  Record on feature:      automon
  Record off feature:     automon
  Force rport:            Yes
  DTMF:                   rfc2833
  Qualify:                2000
  Keepalive:              0
  Use ClientCode:         No
  Progress inband:        No
  Language:
  Tone zone:              <Not set>
  MOH Interpret:          default
  MOH Suggest:
  Voice Mail Extension:   asterisk
  RTCP Multiplexing:      No
----

This is the Flow Sequence that I got with tcpdump.

The call in the logs is not local.

David, I was with both equipaments in the same network, but was with NAT and STUN enabled.

Then should be local, not ?

Local would be with all addresses in 192.168.0/24

yes, but my intention is use the equipaments in the 2 modes:

First:
Make calls and talks in local network;

Second:
Make calls and talks in external network;

In the both modes I don’t want to change settings in mobile or server, then I need to use STUN and NAT because de second option require it.

If you use STUN or NAT, the call is leaving the local network, and we need much more detail of the topology to understand what is going wrong.

(STUN is a way of finding the correct NAT settings, so the above is really just using NAT.)

Yes, I understand, thank you David::

The problem then is, using NAT I have problems when the equipaments stays in the same local network.

The reallity is that the both equipaments has the same public IP if is incoming to NAT, may need some specific forwarding .

May an image can explain better…

Have you set directmedia to no for the peers in sip.conf?

jcolp, no.

I should to do it? put in general parameters?

It can go into general or per-peer.

jcolp,
Was it.
I solved putting directmedia=no.

Very thanks