Asterisk 1.8 - problem retransmission

dear team,

i have a problem with my asterisk 1.8 server.

my setup:

  1. modem (pirelli prg av4202n). internal ip of the modem 10.0.0.138. firewall disabled. DMZ Host -> 10.0.0.139
  2. debian squeeze with asterisk 1.8 (10.0.0.139)

if i call to the asterisk from external, after 6 seconds the call hangs, with the following message:
WARNING[24012]: chan_sip.c:3694 retrans_pkt: Retransmission timeout reached on transmission 172f78…f1d3 for seqno 35…53 (Critical Response) – See wiki.asterisk.org/wiki/display/ … nsmissions
Packet timed out after 6397ms with no response

if i made a call from asterisk to the outside, all working fine…

the port 5060 UDP and 3478 UDP and 1024-65535 UDP are forwarded to my asterisk.

sip.conf:
[general]
alwaysauthreject=yes
port=5060
bindaddr=0.0.0.0
context=sonstige

externip=My Official IP
localnet=192.168.0.0/255.255.255.0

register => user:pass@sipserver.net/user

; phone 1
[1234]
type=friend
context=meine-telefone
secret=passwd
host=dynamic

; phone 2
[5678]
type=friend
context=meine-telefone
secret=passwd
host=dynamic

[ext-sip-account]
type=friend
context=von-voip-provider
username=username
fromuser=username
secret=password
host=sipserver.net
fromdomain=sipserver.net
qualify=yes
insecure=port,invite
nat=yes
canreinvite=no

extensions.conf:
[sonstige]

[meine-telefone]
exten => 1234,1,Dial(SIP/1234)
exten => 4567,1,Dial(SIP/4567)

; Verbindung ausgehend
exten => _0[1-9].,1,Dial(SIP/${EXTEN}@ext-sip-account)

[von-voip-provider]

exten => _4MYNUMBER,1,Dial(SIP/1234)

what i can do? or try?

can you help me?

thank you very much!

kind regards markus

192.168.0/24 <> 10.0.0/24!

I am assuming that a sip debug would show that it is retransmitting 200 OK and failing to receive an ACK.

Also, why does insecure include port? Why is nat set to yes?

alwaysauthreject would make more sense if you didn’t allow guests.

The name canreinvite is deprecated in favour of directmedia.

Type=peer is more secure than type=friend.

You don’t have an extension in von-voip-provider that matches the callback extension you have specified in the register.

hello and thank you for your answer!

i have changed my sip.conf into:

[ext-sip-account]
type=peer
context=von-voip-provider
username=username
fromuser=username
secret=password
host=sipserver.net
fromdomain=sipserver.net
qualify=yes
insecure=port,invite

my debug log:
To: sip:437xxxxxxxx4@178.xx.xx.58:1024;tag=as120fdb94
Call-ID: 7a7fac75-a17d-1230-35aa-001d0963f1d3
CSeq: 35700498 INVITE
Server: Asterisk PBX 1.8.17.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: sip:437xxxxxxxx4@178.xx.xx.58:5060
Content-Type: application/sdp
Content-Length: 266

v=0
o=root 5xxxxxxxx15xxxxxxxx1IN IP4 178.xx.xx.58
s=Asterisk PBX 1.8.17.0
c=IN IP4 178.xx.xx.58
t=0 0
m=audio 16558 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv


<— SIP read from UDP:92.xx.xx.37:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 178.xx.xx.58:5060;branch=z9hG4bK13acd3b3;rport=1024
From: “asterisk” sip:552487049@178.xx.xx.58;tag=as7d6f4ce1
To: sip:sipserver.net;tag=4D4t71UKyvNjH
Call-ID: 667ccdde55ca9e5e065a3ccb59b49ce7@178.xx.xx.58:5060
CSeq: 102 OPTIONS
Contact: sip:92.xx.xx.37
User-Agent: FreeSWITCH
Accept: application/sdp
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY
Supported: timer, precondition, path, replaces
Allow-Events: talk, hold, refer
Content-Length: 0

<------------->
— (13 headers 0 lines) —
Retransmitting #5 (NAT) to 92.xx.xx.37:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 92.xx.xx.37;branch=z9hG4bKDay5p1tXNKpSH;received=92.xx.xx.37;rport=5060
From: “0xxxxxxxx221” sip:0xxxxxxxx221@92.xx.xx.37;tag=H3cXy1p1rgQ5Q
To: sip:437xxxxxxxx4@178.xx.xx.58:1024;tag=as120fdb94
Call-ID: 7a7fac75-a17d-1230-35aa-001d0963f1d3
CSeq: 35700498 INVITE
Server: Asterisk PBX 1.8.17.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: sip:437xxxxxxxx4@178.xx.xx.58:5060
Content-Type: application/sdp
Content-Length: 266

v=0
o=root 5xxxxxxxx15xxxxxxxx1IN IP4 178.xx.xx.58
s=Asterisk PBX 1.8.17.0
c=IN IP4 178.xx.xx.58
t=0 0
m=audio 16558 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv


<— SIP read from UDP:92.xx.xx.37:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 178.xx.xx.58:5060;branch=z9hG4bK2b0f37a8;rport=1024
From: sip:552487049@sipserver.net;tag=as10de2aad
To: sip:552487049@sipserver.net;tag=FeZZg637K7FXr
Call-ID: 23c54f20579224010c00c01b6f44486c@[c0a8:fe:48f2:df7d::f48e:6c00]
CSeq: 1265 REGISTER
User-Agent: FreeSWITCH
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY
Supported: timer, precondition, path, replaces
WWW-Authenticate: Digest realm=“sipserver.net”, nonce=“b53f87c3-9b24-4aa6-b272-68bf2f153f3b”, stale=true, algorithm=MD5, qop="auth"
Content-Length: 0

<------------->
— (11 headers 0 lines) —
Retransmitting #6 (NAT) to 92.xx.xx.37:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 92.xx.xx.37;branch=z9hG4bKDay5p1tXNKpSH;received=92.xx.xx.37;rport=5060
From: “0xxxxxxxx221” sip:0xxxxxxxx221@92.xx.xx.37;tag=H3cXy1p1rgQ5Q
To: sip:437xxxxxxxx4@178.xx.xx.58:1024;tag=as120fdb94
Call-ID: 7a7fac75-a17d-1230-35aa-001d0963f1d3
CSeq: 35700498 INVITE
Server: Asterisk PBX 1.8.17.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: sip:437xxxxxxxx4@178.xx.xx.58:5060
Content-Type: application/sdp
Content-Length: 266

v=0
o=root 5xxxxxxxx15xxxxxxxx1IN IP4 178.xx.xx.58
s=Asterisk PBX 1.8.17.0
c=IN IP4 178.xx.xx.58
t=0 0
m=audio 16558 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv


[Nov 5 00:52:11] WARNING[24012]: chan_sip.c:3694 retrans_pkt: Retransmission timeout reached on transmission 7a7fac75-a17d-1230-35aa-001d0963f1d3 for seqno 35700498 (Critical Response) – See wiki.asterisk.org/wiki/display/ … nsmissions
Packet timed out after 6395ms with no response
Really destroying SIP dialog ‘7a7fac75-a17d-1230-35aa-001d0963f1d3’ Method: INVITE

<— SIP read from UDP:92.xx.xx.37:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 178.xx.xx.58:5060;branch=z9hG4bK2b0f37a8;rport=1024
From: sip:552487049@sipserver.net;tag=as10de2aad
To: sip:552487049@sipserver.net;tag=FeZZg637K7FXr
Call-ID: 23c54f20579224010c00c01b6f44486c@[c0a8:fe:48f2:df7d::f48e:6c00]
CSeq: 1265 REGISTER
User-Agent: FreeSWITCH
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY
Supported: timer, precondition, path, replaces
WWW-Authenticate: Digest realm=“sipserver.net”, nonce=“b53f87c3-9b24-4aa6-b272-68bf2f153f3b”, stale=true, algorithm=MD5, qop="auth"
Content-Length: 0

<------------->
— (11 headers 0 lines) —

<— SIP read from UDP:92.xx.xx.37:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 178.xx.xx.58:5060;branch=z9hG4bK6e971a35;rport=1024
From: sip:552487049@sipserver.net;tag=as17cf4a47
To: sip:552487049@sipserver.net;tag=tp2e0r425tHtN
Call-ID: 23c54f20579224010c00c01b6f44486c@[c0a8:fe:48f2:df7d::f48e:6c00]
CSeq: 1266 REGISTER
User-Agent: FreeSWITCH
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY
Supported: timer, precondition, path, replaces
WWW-Authenticate: Digest realm=“sipserver.net”, nonce=“0bbb7b30-e940-4ecd-9882-643405748963”, stale=true, algorithm=MD5, qop="auth"
Content-Length: 0

<------------->
— (11 headers 0 lines) —

<— SIP read from UDP:92.xx.xx.37:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 178.xx.xx.58:5060;branch=z9hG4bK6e971a35;rport=1024
From: sip:552487049@sipserver.net;tag=as17cf4a47
To: sip:552487049@sipserver.net;tag=tp2e0r425tHtN
Call-ID: 23c54f20579224010c00c01b6f44486c@[c0a8:fe:48f2:df7d::f48e:6c00]
CSeq: 1266 REGISTER
User-Agent: FreeSWITCH
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY
Supported: timer, precondition, path, replaces
WWW-Authenticate: Digest realm=“sipserver.net”, nonce=“0bbb7b30-e940-4ecd-9882-643405748963”, stale=true, algorithm=MD5, qop="auth"
Content-Length: 0

<------------->
— (11 headers 0 lines) —

<— SIP read from UDP:92.xx.xx.37:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 178.xx.xx.58:5060;branch=z9hG4bK6e971a35;rport=1024
From: sip:552487049@sipserver.net;tag=as17cf4a47
To: sip:552487049@sipserver.net;tag=tp2e0r425tHtN
Call-ID: 23c54f20579224010c00c01b6f44486c@[c0a8:fe:48f2:df7d::f48e:6c00]
CSeq: 1266 REGISTER
User-Agent: FreeSWITCH
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY
Supported: timer, precondition, path, replaces
WWW-Authenticate: Digest realm=“sipserver.net”, nonce=“0bbb7b30-e940-4ecd-9882-643405748963”, stale=true, algorithm=MD5, qop="auth"
Content-Length: 0

<------------->
— (11 headers 0 lines) —

<— SIP read from UDP:92.xx.xx.37:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 178.xx.xx.58:5060;branch=z9hG4bK782ad116;rport=1024
From: “asterisk” sip:552487049@178.xx.xx.58;tag=as06228521
To: sip:sipserver.net;tag=tQB8rtZK9Qtgr
Call-ID: 732316bb691bd1232fcb67c238190ec6@178.xx.xx.58:5060
CSeq: 102 OPTIONS
Contact: sip:92.xx.xx.37
User-Agent: FreeSWITCH
Accept: application/sdp
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY
Supported: timer, precondition, path, replaces
Allow-Events: talk, hold, refer
Content-Length: 0

<------------->
— (13 headers 0 lines) —

<— SIP read from UDP:92.xx.xx.37:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 178.xx.xx.58:5060;branch=z9hG4bK6e971a35;rport=1024
From: sip:552487049@sipserver.net;tag=as17cf4a47
To: sip:552487049@sipserver.net;tag=tp2e0r425tHtN
Call-ID: 23c54f20579224010c00c01b6f44486c@[c0a8:fe:48f2:df7d::f48e:6c00]
CSeq: 1266 REGISTER
User-Agent: FreeSWITCH
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY
Supported: timer, precondition, path, replaces
WWW-Authenticate: Digest realm=“sipserver.net”, nonce=“0bbb7b30-e940-4ecd-9882-643405748963”, stale=true, algorithm=MD5, qop="auth"
Content-Length: 0

<------------->
— (11 headers 0 lines) —

<— SIP read from UDP:92.xx.xx.37:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 178.xx.xx.58:5060;branch=z9hG4bK782ad116;rport=1024
From: “asterisk” sip:552487049@178.xx.xx.58;tag=as06228521
To: sip:sipserver.net;tag=tQB8rtZK9Qtgr
Call-ID: 732316bb691bd1232fcb67c238190ec6@178.xx.xx.58:5060
CSeq: 102 OPTIONS
Contact: sip:92.xx.xx.37
User-Agent: FreeSWITCH
Accept: application/sdp
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY
Supported: timer, precondition, path, replaces
Allow-Events: talk, hold, refer
Content-Length: 0

<------------->
— (13 headers 0 lines) —

<— SIP read from UDP:92.xx.xx.37:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 178.xx.xx.58:5060;branch=z9hG4bK782ad116;rport=1024
From: “asterisk” sip:552487049@178.xx.xx.58;tag=as06228521
To: sip:sipserver.net;tag=tQB8rtZK9Qtgr
Call-ID: 732316bb691bd1232fcb67c238190ec6@178.xx.xx.58:5060
CSeq: 102 OPTIONS
Contact: sip:92.xx.xx.37
User-Agent: FreeSWITCH
Accept: application/sdp
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY
Supported: timer, precondition, path, replaces
Allow-Events: talk, hold, refer
Content-Length: 0

<------------->
— (13 headers 0 lines) —

whats my problem :frowning: ?

whatyou mean with 192.168.0/24 <> 10.0.0/24?

i have currently set my extension.conf only to answer (but no telephone is currently connected) i only want try to find a solution that the retransmission problem …

can you help me?

sorry iam not a perfect asterisk user. iam a newbie in this.

tank you very much!!

many greets markus

my network config (detaild):

modem - does the dial in to the internet service provier
internal ip of this modem 10.0.0.138

the dmz host set to 10.0.0.139. thats my asterisk

I think all your dialogues are incomplete, however 92.xx.xx.37 is either not receiving the OK, failing to match it with the incoming request, or its ACK is failing to get through to Asterisk.

At the moment, I would say the configuration error is outside Asterisk.

By the way, did you correct your localnets? All the addresses are clearly non-local, so that is not causing a problem in the trace.

(Because you haven’t included the incoming INVITE, I can’t check it against the responses.)

hello david,

thank you for your help…

i think i must rebuild my network again.

in 2 hours the telephone numbers are ported to the asterisk…
now i must find a fast way to get the phones working…

now i have a root server with an official ip-address.
on this server running directly asterisk.

how i mus setup the sip.conf?

i have a phone adapter (linksys 112).
i do not have a private network.

my new constelation:
asterisk-dedicated-server (official ip-address)

phone 1 behind a router, connects to the official address of asterisk
phone 2 behind a router, connects to the official address of asterisk

is this possible?

must i setup a port forwarding from router for the phones?
must i use stun?

here my setup in sip.conf:
[general]
alwaysauthreject=yes
port=5060
bindaddr=0.0.0.0
context=sonstige
allowguest=no

; Muss gesetzt sein, sonst bricht das Gespraech nach zirka 30 Sekunden ab!
externip=5.XX.XX.182
localnet=5.XX.XX.182.0/255.255.255.248

; Verbindung zu Xpirio herstellen
register => user:pass@sipserver.net/user
; ^ ^ ^ ^
; | | | |
; User Passwort Provider User

[1234]
type=friend
context=meine-telefone
secret=pass
host=dynamic

[4567]
type=friend
context=meine-telefone
secret=pass
host=dynamic

[ext-sip-account]
type=peer
context=von-voip-provider
username=user
fromuser=user
secret=pass
host=sipserver.net
fromdomain=sipserver.net
qualify=yes
insecure=port,invite
directmedia=no

is this correct?

thank you!

localnets must not be the public address!!

The easiest configuration to debug is with Asterisk and all the phones on the same network.

I would suggest going back to the previous configuration and concentrating on the router configuration.

hello david, thanks for your messages.

okay i use now the old configuraton.

my problem is the following: how i can check via debug where my problem is?
what you mean where exactly my problem is?

with the debugging log i dont know what the debug means (exactly)

okay i tell you my network configuraion:

PUBLIC-IP-ADDRESS - Modem (Pirelli) - Internal IP of this device 10.0.0.138
via DMZ-Host all incomming pakets goes to 10.0.0.139 (my DD-WRT Router with Asterisk 1.8 installed)
on my DD-WRT Router here i have configured the WAN port of the router:
IP 10.0.0.139
NETMASK 255.255.255.0
GATEWAY 10.0.0.138

On this router the spi firewall is complete disabled.
the internal ip (there made nat) of the router is 192.168.0.254.

can you help me? what can i test?

thanks!

kind regards markus

You can’t check from the Asterisk debugging. You need the logs from the other side, to see whether the 200 OK is arriving and what, if any, response is being sent.

You may also need to get a packet capture from the router, which is a process in which I have no experience.

hello david,

i think i have found my problem:
my primary modem pirelli have integradet voip server. these blocks my requests…
now i try to install a new firmware on my modem, i hope it helps.

one another question:
if call outside with the phone 1 my official number appears with 433XXXXX1234 9999 but i want only see the primary number from my account (433XXXXX1234).

my extensions.conf:
[sonstige]

[meine-telefone]

; phone 1
exten => 9999,1,Dial(SIP/9999)

; phone 2
exten => 8888,1,Dial(SIP/8888)

; connection outside
exten => _0[1-9].,1,Dial(SIP/${EXTEN}@ext-sip-account)

[von-voip-provider]
exten => _433XXXXX1234,1,Dial(SIP/9999)
exten => _433XXXXX5678,1,Dial(SIP/8888)

how i can handle this?

phone 1 from number 433XXXXX1234
phone 2 from number 433XXXXX5678

thank you very much!

kind regards markus

The caller-ID thing is largely to do with your provider. You need to find out what algorithm they are using. It looks like they are concatenating the default CLID you are providing onto the number they know for you. You can’t completely blank the caller ID, as Asterisk will default it to “asterisk”.