[SOLVED]Asterisk and Nat (yet another issue!)

I’m new to Asterisk and hope someone can help me to solve a trouble I’ve been spending days on :frowning:

My network configuration is depicted herehttp://it.tinypic.com/view.php?pic=dfk3up&s=8. Basically a cable modem which feeds a nat router/firewall ending up in 2 vlan.
On the lan side I have Asterisk 11.8.1 running on a small equipment (OpenWrt) and some sip clients (ip phones and softphones). Calls between phones on the lan side are ok.

Asterisk has a trunk (peer) towards a voip provider and registers ok. Calls from pstn to voip provider’s number are ok: the extensions ring and audio is ok in both directions.
Troubles arise when I try to place a call from one of the phones to pstn (or to a mobile phone) using the provider’s trunk. Pstn phone rings but I have no ringback tone and, if answer the call, no audio both ways.

The cable modem has the firewall as its DMZ host, forwarding all traffic incoming on ex.te.rn.ip to the firewall and the firewall forwards utp ports 10000-20000 to Asterisk’s host.
It doesn’t forward udp 5060 port because there is nothing outside that needs to register to Asterisk, though I tried forwarding that port too but nothing changed.

Setting in a softphone on the same lan the voip provider’s parameters gets everything ok: a call to pstn gets ringback tone and audio is ok, so I can exclude any provider’s issue.

This is the relevant part of sip.conf

[general]
language = it
tonezone = it
context=public
allowguest=no
srvlookup=yes
transport=udp
keepalive=30
udpbindaddr=0.0.0.0
tcpenable=no
externaddr = ex.te.rn.ip
localnet=192.168.30.0/24
dtmfmode=auto
disallow = all
allow = alaw
allow = ulaw
allow = g726
rtpkeepalive = 30
nat = force_rport, comedia


register => *********:***********@voip.eutelia.it/eutelia_ext


[eutelia]
type = peer
context = eutelia
defaultuser = ************
fromuser = ************
secret = *************
host = voip.eutelia.it
port = 5060
qualify = yes
insecure = invite,port
canreinvite = no
directmedia = no



[utenti](!)
type=friend
context=LocalSets
host=dynamic
qualify=yes
secret=*******


[41](utenti)
fullname=Papero


[42](utenti)
fullname=Gatto


[43](utenti)
fullname=Topo


[44](utenti)
fullname=Coniglio

rtp.conf

[general]
rtpstart=14940
rtpend=14990

stunaddr=stun.voip.eutelia.it:3478

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
  Realm. auth:            No
  Our auth realm          OpenWrt
  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 11.8.1
  SDP Session Name:       Asterisk PBX 11.8.1
  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
  Call Events:            Off
  Auth. Failure Events:   Off
  T.38 support:           No
  T.38 EC mode:           Unknown
  T.38 MaxDtgrm:          -1
  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:             ex.te.rn.ip:0
  Externrefresh:          10
  Localnet:               192.168.30.0/255.255.255.0

Global Signalling Settings:
---------------------------
  Codecs:                 (ulaw|alaw|g726)
  Codec Order:            alaw:20,ulaw:20,g726:20
  Relax DTMF:             No
  RFC2833 Compensation:   No
  Symmetric RTP:          No
  Compact SIP headers:    No
  RTP Keepalive:          30 
  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:      3600 secs
  Reg. default duration:  120 secs
  Sub. min duration       60 secs
  Sub. max duration:      3600 secs
  Outbound reg. timeout:  20 secs
  Outbound reg. attempts: 0
  Outbound reg. retry 403:0
  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:                public
  Record on feature:      automon
  Record off feature:     automon
  Force rport:            Yes
  DTMF:                   auto
  Qualify:                0
  Keepalive:              30
  Use ClientCode:         No
  Progress inband:        Never
  Language:               it
  Tone zone:              it
  MOH Interpret:          default
  MOH Suggest:            
  Voice Mail Extension:   asterisk

log.txt: https://www.dropbox.com/s/0ignum8di89nnug/log.txt

Any help appreciated. Thank you.

You need a rule for inbound port 5060 traffic, even if it turns out to be auto-generated by the router.

Having routers be clever is not a good thing. You may be better using port forwarding and disabling any SIP support.

[quote]You need a rule for inbound port 5060 traffic, even if it turns out to be auto-generated by the router.
[/quote]
I DID but nothing changed (and I disabled the forwording).

I’ve disabled sip alg in both modem and router. :frowning: :frowning: :frowning: :frowning: :frowning:

I think you need to capture at least the INVITE, 200 OK and any ACK, to make sure all the addresses are appropriate.

If they aren’t in the log I attached, could you tell me what to do ? Thanks

Sorry missed that. External attachments are something of a pain to access.

Could you edit out the noise and just leave the INVITE exchanges, then include it inline as a code item.

I don’t want to take advantage of you and I thank you for your kind patience, but downloading and searching a txt file is all that terrible?
I can for sure edit and trim it but I fear I’ll leave out some important pieces that may be fundamental to troubleshoot the issue. For this I attached a piece of the entire log… and didn’t include it in the post not to clutter.

Let me know if you’re unconfortable with it and I’ll try to do my best, thank you again.

Here the “simple” sip debug peer:

SIP Debugging Enabled for IP: 83.211.227.21
  == Using SIP RTP CoS mark 5
    -- Executing [9*pstn_number_called*@LocalSets:1] Dial("SIP/41-00000000", "SIP/eutelia/*pstn_number_called*,120,tT") in new stack
  == Using SIP RTP CoS mark 5
Audio is at 14970
Adding codec 100004 (alaw) to SDP
Adding codec 100003 (ulaw) to SDP
Adding codec 100011 (g726) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 83.211.227.21:5060:
INVITE sip:*pstn_number_called*@voip.eutelia.it:5060 SIP/2.0
Via: SIP/2.0/UDP ex.te.rn.ip:5060;branch=z9hG4bK01ded158;rport
Max-Forwards: 70
From: "Casa" <sip:**user**@ex.te.rn.ip>;tag=as1155b981
To: <sip:*pstn_number_called*@voip.eutelia.it:5060>
Contact: <sip:**user**@ex.te.rn.ip:5060>
Call-ID: 0315ac600fecde456798d65362b11673@ex.te.rn.ip:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 11.8.1
Date: Wed, 16 Apr 2014 16:46:39 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 317

v=0
o=root 1638620430 1638620430 IN IP4 ex.te.rn.ip
s=Asterisk PBX 11.8.1
c=IN IP4 ex.te.rn.ip
t=0 0
m=audio 14970 RTP/AVP 8 0 111 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

---
    -- Called SIP/eutelia/*pstn_number_called*
Retransmitting #1 (NAT) to 83.211.227.21:5060:
INVITE sip:*pstn_number_called*@voip.eutelia.it:5060 SIP/2.0
Via: SIP/2.0/UDP ex.te.rn.ip:5060;branch=z9hG4bK01ded158;rport
Max-Forwards: 70
From: "Casa" <sip:**user**@ex.te.rn.ip>;tag=as1155b981
To: <sip:*pstn_number_called*@voip.eutelia.it:5060>
Contact: <sip:**user**@ex.te.rn.ip:5060>
Call-ID: 0315ac600fecde456798d65362b11673@ex.te.rn.ip:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 11.8.1
Date: Wed, 16 Apr 2014 16:46:39 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 317

v=0
o=root 1638620430 1638620430 IN IP4 ex.te.rn.ip
s=Asterisk PBX 11.8.1
c=IN IP4 ex.te.rn.ip
t=0 0
m=audio 14970 RTP/AVP 8 0 111 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

---

<--- SIP read from UDP:83.211.227.21:5060 --->
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP ex.te.rn.ip:1024;branch=z9hG4bK01ded158;rport=1024
From: "Casa" <sip:**user**@ex.te.rn.ip>;tag=as1155b981
To: <sip:*pstn_number_called*@voip.eutelia.it:5060>;tag=c040a69dfc7733bdec8c921a7a9f2d3a.bd6f
Call-ID: 0315ac600fecde456798d65362b11673@ex.te.rn.ip:5060
CSeq: 102 INVITE
Proxy-Authenticate: Digest realm="voip.eutelia.it", nonce="534eb42b72836a7966d0d68183780329a89af68b", qop="auth"
Server: SPS CI RM GW 03
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
Transmitting (NAT) to 83.211.227.21:5060:
ACK sip:*pstn_number_called*@voip.eutelia.it:5060 SIP/2.0
Via: SIP/2.0/UDP ex.te.rn.ip:5060;branch=z9hG4bK01ded158;rport
Max-Forwards: 70
From: "Casa" <sip:**user**@ex.te.rn.ip>;tag=as1155b981
To: <sip:*pstn_number_called*@voip.eutelia.it:5060>;tag=c040a69dfc7733bdec8c921a7a9f2d3a.bd6f
Contact: <sip:**user**@ex.te.rn.ip:5060>
Call-ID: 0315ac600fecde456798d65362b11673@ex.te.rn.ip:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 11.8.1
Content-Length: 0


---
Audio is at 14970
Adding codec 100004 (alaw) to SDP
Adding codec 100003 (ulaw) to SDP
Adding codec 100011 (g726) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 83.211.227.21:5060:
INVITE sip:*pstn_number_called*@voip.eutelia.it:5060 SIP/2.0
Via: SIP/2.0/UDP ex.te.rn.ip:5060;branch=z9hG4bK22efab9e;rport
Max-Forwards: 70
From: "Casa" <sip:**user**@ex.te.rn.ip>;tag=as1155b981
To: <sip:*pstn_number_called*@voip.eutelia.it:5060>
Contact: <sip:**user**@ex.te.rn.ip:5060>
Call-ID: 0315ac600fecde456798d65362b11673@ex.te.rn.ip:5060
CSeq: 103 INVITE
User-Agent: Asterisk PBX 11.8.1
Proxy-Authorization: Digest username="**user**", realm="voip.eutelia.it", algorithm=MD5, uri="sip:*pstn_number_called*@voip.eutelia.it:5060", nonce="534eb42b72836a7966d0d68183780329a89af68b", response="dda0854e0ac6f6ddc1122179faca0725", qop=auth, cnonce="508e9269", nc=00000001
Date: Wed, 16 Apr 2014 16:46:39 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 317

v=0
o=root 1638620430 1638620431 IN IP4 ex.te.rn.ip
s=Asterisk PBX 11.8.1
c=IN IP4 ex.te.rn.ip
t=0 0
m=audio 14970 RTP/AVP 8 0 111 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

---

<--- SIP read from UDP:83.211.227.21:5060 --->
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP ex.te.rn.ip:1024;branch=z9hG4bK01ded158;rport=1024
From: "Casa" <sip:**user**@ex.te.rn.ip>;tag=as1155b981
To: <sip:*pstn_number_called*@voip.eutelia.it:5060>;tag=c040a69dfc7733bdec8c921a7a9f2d3a.bd6f
Call-ID: 0315ac600fecde456798d65362b11673@ex.te.rn.ip:5060
CSeq: 102 INVITE
Proxy-Authenticate: Digest realm="voip.eutelia.it", nonce="534eb42c7d7376cbec1588a4370e8fe764230da5", qop="auth"
Server: SPS CI RM GW 03
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
Transmitting (NAT) to 83.211.227.21:5060:
ACK sip:*pstn_number_called*@voip.eutelia.it:5060 SIP/2.0
Via: SIP/2.0/UDP ex.te.rn.ip:5060;branch=z9hG4bK22efab9e;rport
Max-Forwards: 70
From: "Casa" <sip:**user**@ex.te.rn.ip>;tag=as1155b981
To: <sip:*pstn_number_called*@voip.eutelia.it:5060>
Contact: <sip:**user**@ex.te.rn.ip:5060>
Call-ID: 0315ac600fecde456798d65362b11673@ex.te.rn.ip:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 11.8.1
Content-Length: 0


---
Retransmitting #1 (NAT) to 83.211.227.21:5060:
INVITE sip:*pstn_number_called*@voip.eutelia.it:5060 SIP/2.0
Via: SIP/2.0/UDP ex.te.rn.ip:5060;branch=z9hG4bK22efab9e;rport
Max-Forwards: 70
From: "Casa" <sip:**user**@ex.te.rn.ip>;tag=as1155b981
To: <sip:*pstn_number_called*@voip.eutelia.it:5060>
Contact: <sip:**user**@ex.te.rn.ip:5060>
Call-ID: 0315ac600fecde456798d65362b11673@ex.te.rn.ip:5060
CSeq: 103 INVITE
User-Agent: Asterisk PBX 11.8.1
Proxy-Authorization: Digest username="**user**", realm="voip.eutelia.it", algorithm=MD5, uri="sip:*pstn_number_called*@voip.eutelia.it:5060", nonce="534eb42b72836a7966d0d68183780329a89af68b", response="dda0854e0ac6f6ddc1122179faca0725", qop=auth, cnonce="508e9269", nc=00000001
Date: Wed, 16 Apr 2014 16:46:39 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 317

v=0
o=root 1638620430 1638620431 IN IP4 ex.te.rn.ip
s=Asterisk PBX 11.8.1
c=IN IP4 ex.te.rn.ip
t=0 0
m=audio 14970 RTP/AVP 8 0 111 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

---

<--- SIP read from UDP:83.211.227.21:5060 --->
SIP/2.0 100 Giving a try
Via: SIP/2.0/UDP ex.te.rn.ip:1024;branch=z9hG4bK22efab9e;rport=1024
From: "Casa" <sip:**user**@ex.te.rn.ip>;tag=as1155b981
To: <sip:*pstn_number_called*@voip.eutelia.it:5060>
Call-ID: 0315ac600fecde456798d65362b11673@ex.te.rn.ip:5060
CSeq: 103 INVITE
Server: SPS CI RM GW 03
Content-Length: 0

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

<--- SIP read from UDP:83.211.227.21:5060 --->
SIP/2.0 100 Giving a try
Via: SIP/2.0/UDP ex.te.rn.ip:1024;branch=z9hG4bK22efab9e;rport=1024
From: "Casa" <sip:**user**@ex.te.rn.ip>;tag=as1155b981
To: <sip:*pstn_number_called*@voip.eutelia.it:5060>
Call-ID: 0315ac600fecde456798d65362b11673@ex.te.rn.ip:5060
CSeq: 103 INVITE
Server: SPS CI RM GW 03
Content-Length: 0

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

<--- SIP read from UDP:83.211.227.21:5060 --->
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP ex.te.rn.ip:1024;received=ex.te.rn.ip;branch=z9hG4bK22efab9e;rport=1024
From: "Casa" <sip:**user**@ex.te.rn.ip>;tag=as1155b981
To: <sip:*pstn_number_called*@voip.eutelia.it:5060>;tag=4375C38-1C7F
Date: Wed, 16 Apr 2014 16:46:40 GMT
Call-ID: 0315ac600fecde456798d65362b11673@ex.te.rn.ip:5060
Server: Cisco-SIPGateway/IOS-12.x
CSeq: 103 INVITE
Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, COMET, REFER, SUBSCRIBE, NOTIFY, INFO, UPDATE, REGISTER
Allow-Events: telephone-event
Contact: <sip:494*pstn_number_called*@62.94.71.98:5060>
Record-Route: <sip:83.211.227.21;lr=on;ftag=as1155b981>
Content-Disposition: session;handling=required
Content-Type: application/sdp
Content-Length: 246

v=0
o=CiscoSystemsSIP-GW-UserAgent 9497 1989 IN IP4 62.94.71.98
s=SIP Call
c=IN IP4 62.94.199.39
t=0 0
m=audio 57180 RTP/AVP 8 101
c=IN IP4 62.94.199.39
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
<------------->
--- (15 headers 11 lines) ---
list_route: hop: <sip:83.211.227.21;lr=on;ftag=as1155b981>
Found RTP audio format 8
Found RTP audio format 101
Found audio description format PCMA for ID 8
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw|alaw|g726), peer - audio=(alaw)/video=(nothing)/text=(nothing), combined - (alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 62.94.199.39:57180
    -- SIP/eutelia-00000001 is making progress passing it to SIP/41-00000000
       > 0x6ab1f8 -- Probation passed - setting RTP source address to 192.168.30.12:5008


Called phone is ringing, but no ringback in the calling handset -> hang up




Scheduling destruction of SIP dialog '0315ac600fecde456798d65362b11673@ex.te.rn.ip:5060' in 6400 ms (Method: INVITE)
Reliably Transmitting (NAT) to 83.211.227.21:5060:
CANCEL sip:*pstn_number_called*@voip.eutelia.it:5060 SIP/2.0
Via: SIP/2.0/UDP ex.te.rn.ip:5060;branch=z9hG4bK22efab9e;rport
Max-Forwards: 70
From: "Casa" <sip:**user**@ex.te.rn.ip>;tag=as1155b981
To: <sip:*pstn_number_called*@voip.eutelia.it:5060>
Call-ID: 0315ac600fecde456798d65362b11673@ex.te.rn.ip:5060
CSeq: 103 CANCEL
User-Agent: Asterisk PBX 11.8.1
Content-Length: 0


---
Scheduling destruction of SIP dialog '0315ac600fecde456798d65362b11673@ex.te.rn.ip:5060' in 6400 ms (Method: INVITE)
  == Spawn extension (LocalSets, 9*pstn_number_called*, 1) exited non-zero on 'SIP/41-00000000'

<--- SIP read from UDP:83.211.227.21:5060 --->
SIP/2.0 200 canceling
Via: SIP/2.0/UDP ex.te.rn.ip:1024;branch=z9hG4bK22efab9e;rport=1024
From: "Casa" <sip:**user**@ex.te.rn.ip>;tag=as1155b981
To: <sip:*pstn_number_called*@voip.eutelia.it:5060>;tag=4b366c6191700ae3d7c4537c33bc6b4d-d2e6
Call-ID: 0315ac600fecde456798d65362b11673@ex.te.rn.ip:5060
CSeq: 103 CANCEL
Server: SPS CI RM GW 03
Content-Length: 0

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

<--- SIP read from UDP:83.211.227.21:5060 --->
SIP/2.0 487 Request Cancelled
Via: SIP/2.0/UDP ex.te.rn.ip:1024;received=ex.te.rn.ip;branch=z9hG4bK22efab9e;rport=1024
From: "Casa" <sip:**user**@ex.te.rn.ip>;tag=as1155b981
To: <sip:*pstn_number_called*@voip.eutelia.it:5060>;tag=4375C38-1C7F
Date: Wed, 16 Apr 2014 16:46:47 GMT
Call-ID: 0315ac600fecde456798d65362b11673@ex.te.rn.ip:5060
Server: Cisco-SIPGateway/IOS-12.x
CSeq: 103 INVITE
Allow-Events: telephone-event
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---
Transmitting (NAT) to 83.211.227.21:5060:
ACK sip:494*pstn_number_called*@62.94.71.98:5060 SIP/2.0
Via: SIP/2.0/UDP ex.te.rn.ip:5060;branch=z9hG4bK22efab9e;rport
Max-Forwards: 70
From: "Casa" <sip:**user**@ex.te.rn.ip>;tag=as1155b981
To: <sip:*pstn_number_called*@voip.eutelia.it:5060>;tag=4375C38-1C7F
Contact: <sip:**user**@ex.te.rn.ip:5060>
Call-ID: 0315ac600fecde456798d65362b11673@ex.te.rn.ip:5060
CSeq: 103 ACK
User-Agent: Asterisk PBX 11.8.1
Content-Length: 0


---
Scheduling destruction of SIP dialog '0315ac600fecde456798d65362b11673@ex.te.rn.ip:5060' in 6400 ms (Method: INVITE)
Really destroying SIP dialog '0315ac600fecde456798d65362b11673@ex.te.rn.ip:5060' Method: INVITE

As far as I know Invite packets seem right. Looking for more authoritative opinions…

You need to call the Progress application before Dial for early media to work.

[eutelia_out]
exten => _9[038].,1,Progress()
 same => n,Dial(SIP/eutelia/${EXTEN:1},${RINGTIME},tT)

Thank you, but unfortunately nothing changed. :cry:

Isn’t the line regarding the peer missing ?

Called SIP/eutelia/**********
       > 0xb7c298 -- Probation passed - setting RTP source address to 192.168.30.12:5008

--> 192.168.30.12 is ipphone address (ext 41). Isn't missing the line regarding the peer ?????


    -- SIP/eutelia-00000001 is making progress passing it to SIP/41-00000000

You may need to set the media address. That’s a new feature, so I’m not sure when it is needed.

Well, trying to solve the issue:

I gave freeSWITCH a try (forgive me :laughing: ) in the same network environment and… it works flawlessly;

then I tryed to figure out what’s going on the wire and tcpdump and wireshark has been good friends.

This is what tcpdump/wireshark got when I make a call using freeSWITCH

and this one when using asterisk

What I noticed is that asterisk sends 2 Invite requests one after the other (perhaps because the peer takes a bit more time to respond). Can this confuse the peer and prevent it to send the rtp stream?

There is a way to tell asterisk to wait a bit longer before resending another Invite request?

It is sending multiple requests because the network is losing some of them.

If you look carefully you’ll see that the network didn’t lose anything, it is Asterisk that is a bit hasty and resend Invite datagrams.

By the way, I can’t say (I’m not that expert) if the peer isn’t honoring properly the protocol, but what I can say for certain is that after adding in sip.conf

t1min=200

everything started working flawlessly.

If I reduce t1min to a value below the peer ping time it is not working again.

By now it seems solved and it wasn’t definitely a NAT issue !

The current timer configuration could be improved by adding a T1 jitter configuration value (in addition to or in place of T1min, which would be added to lastms to set T1. For example, if the lastms for a peer was 40ms and the T1jitter setting was 20, then T1 would be set to 60ms.
Again, a statically configured timert1 should override any calculated T1 regardless of the values set elsewhere, for both monitored and un-monitored peers.

issues.asterisk.org/jira/browse/ASTERISK-22841