[SOLVED] Amazon EC2 - Problem with Asterisk 13.18.5 on Ubuntu LTS 16.04 amd64

I am a begginer in Asterisk and need help to resolve some configurations in my Amazon EC2 server, the calls are connecting but the voice doesn’t can hear in the both sides. I tried many configurations but anyone works, tried the STUN server too but doesn’t work.

Can anyone help me?

sip.conf
[general]
context=basico ; Default context for incoming calls. Defaults to 'default’
port=5060
bindport=5060
bindaddr=0.0.0.0
udpbindaddr=0.0.0.0 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
tcpenable=no ; Enable server for incoming TCP connections (default is no)
tcpbindaddr=0.0.0.0 ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
transport=udp ; Set the default transports. The order determines the primary default transport.
srvlookup=yes ; Enable DNS SRV lookups on outbound calls
maxexpirey=360 ; Maximum allowed time of incoming registrations (seconds)
defaultexpirey=120 ; Default length of incoming/outgoing registration
;disallow=all ; First disallow all codecs
;allow=ulaw ; Allow codecs in order of preference
;allow=ilbc ; see https://wiki.asterisk.org/wiki/display/AST/RTP+Packetization
allow=all
videosupport=yes ; Turn on support for SIP video. You need to turn this
textsupport=yes ; Support for ITU-T T.140 realtime text.
;canreinvite=yes
externip=35.177.150.209
localnet=192.168.0.0/255.255.0.0
nat=yes
qualify=yes
accept_outofcall_message=yes
outofcall_message_context=message

[8000] ;Leandro Notebook
type=friend
secret=2323Sapo
host=dynamic
context=basico
nat=yes
accept_outofcall_message=yes
outofcall_message_context=message

[8001] ;Leandro Celular
type=friend
secret=2323Sapo
host=dynamic
context=basico
nat=yes
accept_outofcall_message=yes
outofcall_message_context=message

extensions.conf
[general]
static=yes
clearglobalvars=no

[globals]
CONSOLE=Console/dsp ; Console interface for demo
IAXINFO=guest ; IAXtel username/password
TRUNKMSD=1 ; MSD digits to strip (usually 1 or 0)

[basico]
exten => _X.,1,Dial(SIP/${EXTEN},60})
exten => _X.,2,Answer()
exten => _X.,3,Hangup()

rtp.conf
[general]
rtpstart=10000
rtpend=20000

[ice_host_candidates]


----------------------FULL INFORMATIONS----------------------

Global Settings:

UDP Bindaddress: 0.0.0.0:5060
TCP SIP Bindaddress: Disabled
TLS SIP Bindaddress: Disabled
Videosupport: Yes
Textsupport: Yes
Ignore SDP sess. ver.: No
AutoCreate Peer: Off
Match Auth Username: No
Allow unknown access: Yes
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:
Externaddr: 35.177.150.209:0
Externrefresh: 10
Localnet: 192.168.0.0/255.255.0.0

Global Signalling Settings:

Codecs: (ulaw|alaw|gsm|h263|g723|g726|g726aal2|adpcm|slin|slin|slin|slin|slin|slin|slin|slin|slin|lpc10|g729|speex|speex|speex|ilbc|g722|siren7|siren14|testlaw|g719|opus|jpeg|png|h261|h263p|h264|mpeg4|vp8|vp9|red|t140|silk|silk|silk|silk)
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:
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:
MOH Interpret: default
MOH Suggest:
Voice Mail Extension: asterisk
RTCP Multiplexing: No

The option it is externaddr

nat=yes is deprecated, use nat=force_rport,comedia instead.

localnet should match the Internal local net of Amazon

I think the reason to deprecate it was to stop people using it without thinking. Unfortunately, they still do, but they spell it out. nat= may be of some benefit for use form within NAT, but it is mainly for use from outside NAT.

Also, canreinvite has been renamed directmedia, and type=friend is usually a worse choice than type=peer.

Also that one is depreacted but I didnt make reference becuase is commented out

root@ip-172-31-3-42:/etc/asterisk# ifconfig
eth0      Link encap:Ethernet  HWaddr 06:57:5a:1e:7a:9a
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::457:5aff:fe1e:7a9a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:9001  Metric:1
          RX packets:9154 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12167 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3384744 (3.3 MB)  TX bytes:3180907 (3.1 MB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:198 errors:0 dropped:0 overruns:0 frame:0
          TX packets:198 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:14754 (14.7 KB)  TX bytes:14754 (14.7 KB)

image

what the localnet I shoud to use?

I changed the parameter nat=force_rport,comedia and now the voice works in only 1 side, another side is mute.

Did you add externaddr=35.177.150.209

Yes, but the correct ip now is 35.177.81.66

[general]

externaddr=35.177.81.66
localnet=192.168.0.0/255.255.0.0
nat=yes
qualify=yes
accept_outofcall_message=yes
outofcall_message_context=message

I solve a little bit of the problem, I can hear the both side when stay in the same network, if some equipament stay out of network the audio stay mute.

should be
nat=force_rport,comedia also the same on the SIP peers configuration

sorry, now stay ok, but can’t hear in one side.

[general]
context=basico ; Default context for incoming calls. Defaults to 'default’
port=5060
bindport=5060
bindaddr=0.0.0.0
udpbindaddr=0.0.0.0 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
tcpenable=no ; Enable server for incoming TCP connections (default is no)
tcpbindaddr=0.0.0.0 ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
transport=udp ; Set the default transports. The order determines the primary default transport.
srvlookup=yes ; Enable DNS SRV lookups on outbound calls
maxexpirey=360 ; Maximum allowed time of incoming registrations (seconds)
defaultexpirey=120 ; Default length of incoming/outgoing registration
;disallow=all ; First disallow all codecs
;allow=ulaw ; Allow codecs in order of preference
;allow=ilbc ; see Home - Asterisk Documentation
allow=all
videosupport=yes ; Turn on support for SIP video. You need to turn this
textsupport=yes ; Support for ITU-T T.140 realtime text.
;canreinvite=yes
externaddr=35.177.81.66
localnet=192.168.0.0/255.255.0.0
nat=force_rport,comedia
qualify=yes
accept_outofcall_message=yes
outofcall_message_context=message

[8000] ;Leandro Notebook
type=friend
secret=2323Sapo
host=dynamic
context=basico
nat=force_rport,comedia
accept_outofcall_message=yes
outofcall_message_context=message

[8001] ;Leandro Celular
type=friend
secret=2323Sapo
host=dynamic
context=basico
nat=force_rport,comedia
accept_outofcall_message=yes
outofcall_message_context=message

On the general configuration add also media_address = 35.177.81.66

I put but continue without audio in one side.

sip.conf

[general]
context=basico
port=5060
bindport=5060
bindaddr=0.0.0.0
udpbindaddr=0.0.0.0
tcpenable=no
tcpbindaddr=0.0.0.0
transport=udp
srvlookup=yes
maxexpirey=360
defaultexpirey=120
allow=all
externaddr=35.177.81.66
media_address=35.177.81.66
localnet=192.168.0.0/255.255.0.0
nat=force_rport,comedia
qualify=yes

[8000] ;Leandro Notebook
type=friend
secret=2323Sapo
host=dynamic
context=basico
nat=force_rport,comedia

[8001] ;Leandro Celular
type=friend
secret=2323Sapo
host=dynamic
context=basico
nat=force_rport,comedia

On the Asterisk side settings seems to be correct, make a sip trace and rtp debug and debug what could be your issue

SIP trace

<--- Transmitting (NAT) to 187.107.128.238:28612 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 187.107.128.238:28612;branch=z9hG4bK-524287-1---4619431fca0e8a7b;received=187.107.128.238;rport=28612
From: <sip:8000@35.177.81.66;transport=UDP>;tag=561ccd75
To: <sip:8000@35.177.81.66;transport=UDP>;tag=as269d279b
Call-ID: 503iRKnQeIWHG4WmCWZPBQ..
CSeq: 1 SUBSCRIBE
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="1daa7f88"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '503iRKnQeIWHG4WmCWZPBQ..' in 13312 ms (Method: SUBSCRIBE)
Really destroying SIP dialog 'kVEu-sXaNUG726a4LDfCsw..' Method: PUBLISH
Retransmitting #1 (NAT) to 187.107.128.238:28612:
INVITE sip:8000@187.107.128.238:28612 SIP/2.0
Via: SIP/2.0/UDP 35.177.81.66:5060;branch=z9hG4bK151be1ae;rport
Max-Forwards: 70
From: <sip:8001@35.177.81.66>;tag=as7119ad8d
To: <sip:8000@187.107.128.238:28612;rinstance=347f974a8de46591;transport=UDP>;tag=8a400932
Contact: <sip:8001@35.177.81.66:5060>
Call-ID: 2d1edd2866043eb00cc0f13e6acab724@35.177.81.66:5060
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: 879

v=0
o=root 895250715 895250716 IN IP4 35.177.81.66
s=Asterisk PBX 13.18.5
c=IN IP4 177.79.28.74
t=0 0
m=audio 61916 RTP/AVP 0 8 3 4 111 112 5 10 118 7 18 110 117 119 97 9 102 115 116 107 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:4 G723/8000
a=fmtp:4 annexa=no
a=rtpmap:111 G726-32/8000
a=rtpmap:112 AAL2-G726-32/8000
a=rtpmap:5 DVI4/8000
a=rtpmap:10 L16/8000
a=rtpmap:118 L16/16000
a=rtpmap:7 LPC/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:110 speex/8000
a=rtpmap:117 speex/16000
a=rtpmap:119 speex/32000
a=rtpmap:97 iLBC/8000
a=rtpmap:9 G722/8000
a=rtpmap:102 G7221/16000
a=fmtp:102 bitrate=32000
a=rtpmap:115 G7221/32000
a=fmtp:115 bitrate=48000
a=rtpmap:116 G719/48000
a=fmtp:116 bitrate=64000
a=rtpmap:107 opus/48000/2
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:20
a=sendrecv

---

<--- SIP read from UDP:187.107.128.238:28612 --->
SUBSCRIBE sip:8000@35.177.81.66;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 187.107.128.238:28612;branch=z9hG4bK-524287-1---5ad9459629df2759
Max-Forwards: 70
Contact: <sip:8000@187.107.128.238:28612;transport=UDP>
To: <sip:8000@35.177.81.66;transport=UDP>
From: <sip:8000@35.177.81.66;transport=UDP>;tag=561ccd75
Call-ID: 503iRKnQeIWHG4WmCWZPBQ..
CSeq: 2 SUBSCRIBE
Expires: 600
Accept: application/watcherinfo+xml
User-Agent: Z 3.15.40006 rv2.8.20
Authorization: Digest username="8000",realm="asterisk",nonce="1daa7f88",uri="sip:8000@35.177.81.66;transport=UDP",response="6f05fc774352b43a44f9834cf9dd4e89",algorithm=MD5
Event: presence.winfo
Allow-Events: presence, kpml, talk
Content-Length: 0

<------------->
--- (15 headers 0 lines) ---
Creating new subscription
Sending to 187.107.128.238:28612 (NAT)
Found peer '8000' for '8000' from 187.107.128.238:28612

<--- Transmitting (NAT) to 187.107.128.238:28612 --->
SIP/2.0 489 Bad Event
Via: SIP/2.0/UDP 187.107.128.238:28612;branch=z9hG4bK-524287-1---5ad9459629df2759;received=187.107.128.238;rport=28612
From: <sip:8000@35.177.81.66;transport=UDP>;tag=561ccd75
To: <sip:8000@35.177.81.66;transport=UDP>;tag=as269d279b
Call-ID: 503iRKnQeIWHG4WmCWZPBQ..
CSeq: 2 SUBSCRIBE
Server: Asterisk PBX 13.18.5
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


<------------>
Really destroying SIP dialog '503iRKnQeIWHG4WmCWZPBQ..' Method: SUBSCRIBE

<--- SIP read from UDP:187.107.128.238:28612 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 35.177.81.66:5060;branch=z9hG4bK151be1ae;rport=5060
Contact: <sip:8000@187.107.128.238:28612>
To: <sip:8000@187.107.128.238:28612;rinstance=347f974a8de46591;transport=UDP>;tag=8a400932
From: <sip:8001@35.177.81.66>;tag=as7119ad8d
Call-ID: 2d1edd2866043eb00cc0f13e6acab724@35.177.81.66:5060
CSeq: 103 INVITE
Content-Type: application/sdp
User-Agent: Z 3.15.40006 rv2.8.20
Allow-Events: presence, kpml, talk
Content-Length: 246

v=0
o=Z 0 3 IN IP4 187.107.128.238
s=Z
c=IN IP4 187.107.128.238
t=0 0
m=audio 28680 RTP/AVP 0 3 110 8 97 101
a=rtpmap:110 speex/8000
a=rtpmap:97 iLBC/8000
a=fmtp:97 mode=30
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
<------------->
--- (11 headers 12 lines) ---
Found RTP audio format 0
Found RTP audio format 3
Found RTP audio format 110
Found RTP audio format 8
Found RTP audio format 97
Found RTP audio format 101
Found audio description format speex for ID 110
Found audio description format iLBC for ID 97
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw|alaw|gsm|h263|g723|g726|g726aal2|adpcm|slin|slin|slin|slin|slin|slin|slin|slin|slin|lpc10|g729|speex|speex|speex|ilbc|g722|siren7|siren14|testlaw|g719|opus|jpeg|png|h261|h263p|h264|mpeg4|vp8|vp9|red|t140|silk|silk|silk|silk), peer - audio=(ulaw|gsm|alaw|ilbc|speex)/video=(nothing)/text=(nothing), combined - (ulaw|alaw|gsm|speex|ilbc)
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:28680
Transmitting (NAT) to 187.107.128.238:28612:
ACK sip:8000@187.107.128.238:28612 SIP/2.0
Via: SIP/2.0/UDP 35.177.81.66:5060;branch=z9hG4bK1fc4c12b;rport
Max-Forwards: 70
From: <sip:8001@35.177.81.66>;tag=as7119ad8d
To: <sip:8000@187.107.128.238:28612;rinstance=347f974a8de46591;transport=UDP>;tag=8a400932
Contact: <sip:8001@35.177.81.66:5060>
Call-ID: 2d1edd2866043eb00cc0f13e6acab724@35.177.81.66:5060
CSeq: 103 ACK
User-Agent: Asterisk PBX 13.18.5
Content-Length: 0


---

<--- SIP read from UDP:187.107.128.238:28612 --->
PUBLISH sip:8000@35.177.81.66;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 187.107.128.238:28612;branch=z9hG4bK-524287-1---7ef7342db8a578ee
Max-Forwards: 70
Contact: <sip:8000@187.107.128.238:28612;transport=UDP>
To: <sip:8000@35.177.81.66;transport=UDP>
From: <sip:8000@35.177.81.66;transport=UDP>;tag=2a448676
Call-ID: v2xYgdb571-F2KZ5A8T3ZQ..
CSeq: 1 PUBLISH
Expires: 600
Content-Type: application/pidf+xml
User-Agent: Z 3.15.40006 rv2.8.20
Event: presence
Allow-Events: presence, kpml, talk
Content-Length: 266

<?xml version="1.0" encoding="UTF-8"?>
<presence xmlns="urn:ietf:params:xml:ns:pidf" entity="sip:8000@35.177.81.66;transport=UDP"> <tuple id="8000" > <status><basic>open</basic></status> <note>On the phone</note> </tuple>
</presence>
<------------->
--- (14 headers 3 lines) ---
Sending to 187.107.128.238:28612 (NAT)

<--- Transmitting (NAT) to 187.107.128.238:28612 --->
SIP/2.0 489 Bad Event
Via: SIP/2.0/UDP 187.107.128.238:28612;branch=z9hG4bK-524287-1---7ef7342db8a578ee;received=187.107.128.238;rport=28612
From: <sip:8000@35.177.81.66;transport=UDP>;tag=2a448676
To: <sip:8000@35.177.81.66;transport=UDP>;tag=as52e7e0ce
Call-ID: v2xYgdb571-F2KZ5A8T3ZQ..
CSeq: 1 PUBLISH
Server: Asterisk PBX 13.18.5
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


<------------>
Really destroying SIP dialog 'v2xYgdb571-F2KZ5A8T3ZQ..' Method: PUBLISH

<--- SIP read from UDP:187.107.128.238:28612 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 35.177.81.66:5060;branch=z9hG4bK151be1ae;rport=5060
Contact: <sip:8000@187.107.128.238:28612>
To: <sip:8000@187.107.128.238:28612;rinstance=347f974a8de46591;transport=UDP>;tag=8a400932
From: <sip:8001@35.177.81.66>;tag=as7119ad8d
Call-ID: 2d1edd2866043eb00cc0f13e6acab724@35.177.81.66:5060
CSeq: 103 INVITE
Content-Type: application/sdp
User-Agent: Z 3.15.40006 rv2.8.20
Allow-Events: presence, kpml, talk
Content-Length: 246

v=0
o=Z 0 3 IN IP4 187.107.128.238
s=Z
c=IN IP4 187.107.128.238
t=0 0
m=audio 28680 RTP/AVP 0 3 110 8 97 101
a=rtpmap:110 speex/8000
a=rtpmap:97 iLBC/8000
a=fmtp:97 mode=30
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
<------------->
--- (11 headers 12 lines) ---
Transmitting (NAT) to 187.107.128.238:28612:
ACK sip:8000@187.107.128.238:28612 SIP/2.0
Via: SIP/2.0/UDP 35.177.81.66:5060;branch=z9hG4bK2c87cb73;rport
Max-Forwards: 70
From: <sip:8001@35.177.81.66>;tag=as7119ad8d
To: <sip:8000@187.107.128.238:28612;rinstance=347f974a8de46591;transport=UDP>;tag=8a400932
Contact: <sip:8001@35.177.81.66:5060>
Call-ID: 2d1edd2866043eb00cc0f13e6acab724@35.177.81.66:5060
CSeq: 103 ACK
User-Agent: Asterisk PBX 13.18.5
Content-Length: 0


---
Really destroying SIP dialog 'Z_K6tID9K4RLSMPNFbLMlg..' Method: REGISTER

<--- SIP read from UDP:187.107.128.238:28612 --->
BYE sip:8001@35.177.81.66:5060 SIP/2.0
Via: SIP/2.0/UDP 187.107.128.238:28612;branch=z9hG4bK-524287-1---70cb352e46794e70
Max-Forwards: 70
Contact: <sip:8000@187.107.128.238:28612>
To: <sip:8001@35.177.81.66>;tag=as7119ad8d
From: <sip:8000@187.107.128.238:28612;rinstance=347f974a8de46591;transport=UDP>;tag=8a400932
Call-ID: 2d1edd2866043eb00cc0f13e6acab724@35.177.81.66:5060
CSeq: 2 BYE
User-Agent: Z 3.15.40006 rv2.8.20
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---
Sending to 187.107.128.238:28612 (NAT)
Scheduling destruction of SIP dialog '2d1edd2866043eb00cc0f13e6acab724@35.177.81.66:5060' in 13312 ms (Method: BYE)

<--- Transmitting (NAT) to 187.107.128.238:28612 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 187.107.128.238:28612;branch=z9hG4bK-524287-1---70cb352e46794e70;received=187.107.128.238;rport=28612
From: <sip:8000@187.107.128.238:28612;rinstance=347f974a8de46591;transport=UDP>;tag=8a400932
To: <sip:8001@35.177.81.66>;tag=as7119ad8d
Call-ID: 2d1edd2866043eb00cc0f13e6acab724@35.177.81.66:5060
CSeq: 2 BYE
Server: Asterisk PBX 13.18.5
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


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

<--- SIP read from UDP:187.107.128.238:28612 --->
PUBLISH sip:8000@35.177.81.66;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 187.107.128.238:28612;branch=z9hG4bK-524287-1---c9560f515d903c3d
Max-Forwards: 70
Contact: <sip:8000@187.107.128.238:28612;transport=UDP>
To: <sip:8000@35.177.81.66;transport=UDP>
From: <sip:8000@35.177.81.66;transport=UDP>;tag=0c0def54
Call-ID: WrLB2BbmA68_E5BDzNWyUw..
CSeq: 1 PUBLISH
Expires: 600
Content-Type: application/pidf+xml
User-Agent: Z 3.15.40006 rv2.8.20
Event: presence
Allow-Events: presence, kpml, talk
Content-Length: 260

<?xml version="1.0" encoding="UTF-8"?>
<presence xmlns="urn:ietf:params:xml:ns:pidf" entity="sip:8000@35.177.81.66;transport=UDP"> <tuple id="8000" > <status><basic>open</basic></status> <note>Online</note> </tuple>
</presence>
<------------->
--- (14 headers 3 lines) ---
Sending to 187.107.128.238:28612 (NAT)

<--- Transmitting (NAT) to 187.107.128.238:28612 --->
SIP/2.0 489 Bad Event
Via: SIP/2.0/UDP 187.107.128.238:28612;branch=z9hG4bK-524287-1---c9560f515d903c3d;received=187.107.128.238;rport=28612
From: <sip:8000@35.177.81.66;transport=UDP>;tag=0c0def54
To: <sip:8000@35.177.81.66;transport=UDP>;tag=as15459cef
Call-ID: WrLB2BbmA68_E5BDzNWyUw..
CSeq: 1 PUBLISH
Server: Asterisk PBX 13.18.5
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0

RTP Debug – The call was dropped

Packet timed out after 6399ms with no response
  == Using SIP RTP CoS mark 5
    -- Executing [8000@basico:1] Dial("SIP/8001-0000002b", "SIP/8000,60}") in new stack
  == Using SIP RTP CoS mark 5
    -- Called SIP/8000
    -- Registered SIP '8001' at 177.79.11.98:43133
    -- SIP/8000-0000002c is ringing
    -- SIP/8000-0000002c answered SIP/8001-0000002b
    -- Channel SIP/8000-0000002c joined 'simple_bridge' basic-bridge <c4326753-0444-44f7-abad-27b6df83b523>
    -- Channel SIP/8001-0000002b joined 'simple_bridge' basic-bridge <c4326753-0444-44f7-abad-27b6df83b523>
Got  RTP packet from    187.107.128.238:28680 (type 00, seq 010930, ts 1303264712, len 000160)
Got  RTP packet from    187.107.128.238:28680 (type 00, seq 010931, ts 1303264872, len 000160)
Got  RTP packet from    187.107.128.238:28680 (type 00, seq 010932, ts 1303265032, len 000160)
Got  RTP packet from    187.107.128.238:28680 (type 00, seq 010933, ts 1303265192, len 000160)
Got  RTP packet from    187.107.128.238:28680 (type 00, seq 010934, ts 1303265352, len 000160)
Got  RTP packet from    187.107.128.238:28680 (type 00, seq 010935, ts 1303265512, len 000160)
Got  RTP packet from    187.107.128.238:28680 (type 00, seq 010936, ts 1303265672, len 000160)
Got  RTP packet from    187.107.128.238:28680 (type 00, seq 010937, ts 1303265832, len 000160)
Got  RTP packet from    187.107.128.238:28680 (type 00, seq 010938, ts 1303265992, len 000160)
Got  RTP packet from    187.107.128.238:28680 (type 00, seq 010939, ts 1303266152, len 000160)
Got  RTP packet from    187.107.128.238:28680 (type 00, seq 010940, ts 1303266312, len 000160)
Got  RTP packet from    187.107.128.238:28680 (type 00, seq 010941, ts 1303266472, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023694, ts 3683313600, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023695, ts 3683313760, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023696, ts 3683313920, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023697, ts 3683314080, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023698, ts 3683314240, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023699, ts 3683314400, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023700, ts 3683314560, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023701, ts 3683314720, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023702, ts 3683314880, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023703, ts 3683315040, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023704, ts 3683315200, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023705, ts 3683315360, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023706, ts 3683315520, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023707, ts 3683315680, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023708, ts 3683315840, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023709, ts 3683316000, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023710, ts 3683316160, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023711, ts 3683316320, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023712, ts 3683316480, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023713, ts 3683316640, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023714, ts 3683316800, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023715, ts 3683316960, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023716, ts 3683317120, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023717, ts 3683317280, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023718, ts 3683317440, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023719, ts 3683317600, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023720, ts 3683317760, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023721, ts 3683317920, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023722, ts 3683318080, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023723, ts 3683318240, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023724, ts 3683318400, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023725, ts 3683318560, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023726, ts 3683318720, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023727, ts 3683318880, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023728, ts 3683319040, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023729, ts 3683319200, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023730, ts 3683319360, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023731, ts 3683319520, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023732, ts 3683319680, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023733, ts 3683319840, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023734, ts 3683320000, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023735, ts 3683320160, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023736, ts 3683320320, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023737, ts 3683320480, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023738, ts 3683320640, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023739, ts 3683320800, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023740, ts 3683320960, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023741, ts 3683321120, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023742, ts 3683321280, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023743, ts 3683321440, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023744, ts 3683321600, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023745, ts 3683321760, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023746, ts 3683321920, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023747, ts 3683322080, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023748, ts 3683322240, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023749, ts 3683322400, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023750, ts 3683322560, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023751, ts 3683322720, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023752, ts 3683322880, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023753, ts 3683323040, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023754, ts 3683323200, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023755, ts 3683323360, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023756, ts 3683323520, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023757, ts 3683323680, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023758, ts 3683323840, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023759, ts 3683324000, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023760, ts 3683324160, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023761, ts 3683324320, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023762, ts 3683324480, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023763, ts 3683324640, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023764, ts 3683324800, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023765, ts 3683324960, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023766, ts 3683325120, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023767, ts 3683325280, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023768, ts 3683325440, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023769, ts 3683325600, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023770, ts 3683325760, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023771, ts 3683325920, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023772, ts 3683326080, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023773, ts 3683326240, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023774, ts 3683326400, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023775, ts 3683326560, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023776, ts 3683326720, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023777, ts 3683326880, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023778, ts 3683327040, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023779, ts 3683327200, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023780, ts 3683327360, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023781, ts 3683327520, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023782, ts 3683327680, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023783, ts 3683327840, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023784, ts 3683328000, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023785, ts 3683328160, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023786, ts 3683328320, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023787, ts 3683328480, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023788, ts 3683328640, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023789, ts 3683328800, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023790, ts 3683328960, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023791, ts 3683329120, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023792, ts 3683329280, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023793, ts 3683329440, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023794, ts 3683329600, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023795, ts 3683329760, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023796, ts 3683329920, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023797, ts 3683330080, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023798, ts 3683330240, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023799, ts 3683330400, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023800, ts 3683330560, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023801, ts 3683330720, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023802, ts 3683330880, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023803, ts 3683331040, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023804, ts 3683331200, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023805, ts 3683331360, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023806, ts 3683331520, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023807, ts 3683331680, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023808, ts 3683331840, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023809, ts 3683332000, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023810, ts 3683332160, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023811, ts 3683332320, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023812, ts 3683332480, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023813, ts 3683332640, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023814, ts 3683332800, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023815, ts 3683332960, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023816, ts 3683333120, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023817, ts 3683333280, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023818, ts 3683333440, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023819, ts 3683333600, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023820, ts 3683333760, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023821, ts 3683333920, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023822, ts 3683334080, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023823, ts 3683334240, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023824, ts 3683334400, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023825, ts 3683334560, len 000160)
Sent RTP packet to      187.107.128.238:28680 (type 00, seq 023826, ts 3683334720, len 000160)
[Jan  7 21:48:41] WARNING[25383]: chan_sip.c:4072 retrans_pkt: Retransmission timeout reached on transmission 9UdhObEy5uaLgw-Th_3k6w.. for seqno 2 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 6399ms with no response
[Jan  7 21:48:41] WARNING[25383]: chan_sip.c:4096 retrans_pkt: Hanging up call 9UdhObEy5uaLgw-Th_3k6w.. - no reply to our critical packet (see https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions).
    -- Channel SIP/8001-0000002b left 'native_rtp' basic-bridge <c4326753-0444-44f7-abad-27b6df83b523>
  == Spawn extension (basico, 8000, 1) exited non-zero on 'SIP/8001-0000002b'
    -- Channel SIP/8000-0000002c left 'native_rtp' basic-bridge <c4326753-0444-44f7-abad-27b6df83b523>

I had a little progress after configure the file res_stun_monitor.conf with:

[general]
stunaddr=stun.l.google.com:19302
stunrefresh=30

and the file rtp.conf with:

[general]
rtpstart=10000
rtpend=20000
icesupport=yes
stunaddr=stun.l.google.com:19302

but calls only working voice in the both sides if the 2 phones stay in differents networks, if stays in the same network only stay with mute audio.

Add the others networks like this localnet=192.168.0.0/255.255.0.0

ambiorixg12Leader6m
 lmoraes:
but calls only working voice in the both sides if the 2 phones stay in differents networks, if stays in the same network only stay with mute audio.

Add the others networks like this localnet=192.168.0.0/255.255.0.0

this localnet already exists in the file sip.conf

When dealing with NAT issue it is also needed make sure on the client side the network is properly configured to deal with NAT, it is not only Asterisk configuration issue

didn’t work:

nat=force_rport,comedia
localnet=192.168.0.0/255.255.0.0