Asterisk <-> NAT <-> Fritz!Box Fon

sted

Neuer User
Mitglied seit
21 Apr 2005
Beiträge
94
Punkte für Reaktionen
0
Punkte
0
Hallo zusammen,

neuster Schritt unserer VoIP Umgebung:

FBF (Home Office, DSL) an einen Asterisk koppeln, der in unserer DMZ, also hinter einer Linux Firewall steht.

Ich habe folgende Ports in beide Richtungen offen:
o 5060 - 5062 UDP
o 8000 - 8001 UDP
o 7078 - 7079 UDP

Die Registrieung der FBF klappt auf Anhieb. Es gibt auch keinen Timeout.
Rufe ich die Nummer der FBF an, klingelt das Telefon fröhlich, hebt man ab läuft der Anruf.
Auf Seite des Asterisk Server sieht alles gut aus, die FBF scheint den Anruf aber in jedem Fall nach ein bis vier Sekunden zu beenden.
In den Ereignissen der FBF sehe ich dann sowas:

Code:
Internettelefonie mit 599 über <Asterisk-externe-IP> fehlgeschalgen.
Fehlergrund: Request cancelled (487)

Wenn ich auf der Asterisk Console "sip debug peer 584" mache, sehe ich nichts in der Richtung.

Anruf 599 (SIP Nummer mit Phoner am Asterisk) an 584 (FBF Nummer):
Code:
asterisk-srv*CLI> sip debug peer 584
SIP Debugging Enabled for IP: <FBF-IP>:5060
11 headers, 0 lines
Reliably Transmitting:
OPTIONS sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491 SIP/2.0
Via: SIP/2.0/UDP <Asterisk-externe-IP>:5060;branch=z9hG4bK05275713
From: "asterisk" <sip:asterisk@<Asterisk-externe-IP>>;tag=as2204722c
To: <sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491>
Contact: <sip:asterisk@<Asterisk-externe-IP>>
Call-ID: 3f00bf073a9d4eb07ad8326d0d684348@<Asterisk-externe-IP>
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX
Date: Thu, 01 Dec 2005 12:48:28 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Content-Length: 0

 (no NAT) to <FBF-IP>:5060
asterisk-srv*CLI>

Sip read:
SIP/2.0 200 OK
Via: SIP/2.0/UDP <Asterisk-externe-IP>:5060;branch=z9hG4bK05275713
From: "asterisk" <sip:asterisk@<Asterisk-externe-IP>>;tag=as2204722c
To: <sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491>;tag=74BF1735BC027E55493697451B81
Call-ID: 3f00bf073a9d4eb07ad8326d0d684348@<Asterisk-externe-IP>
CSeq: 102 OPTIONS
Contact: <sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491>
User-Agent: AVM FRITZ!Box Fon WLAN 7050 (UI) 14.03.89 (3.01.03 tested by accredited T-Com test lab) (Oct 28 2005)
Supported: 100rel, replaces
Allow-Events: telephone-event, refer
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, UPDATE, PRACK, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE
Accept: application/sdp, multipart/mixed
Accept-Encoding: identity
Content-Length: 0


14 headers, 0 lines
Destroying call '3f00bf073a9d4eb07ad8326d0d684348@<Asterisk-externe-IP>'
    -- Executing Macro("SIP/599-ea11", "sipvm|SIP|584") in new stack
    -- Executing NoOp("SIP/599-ea11", "Macro SIPVM gestartet") in new stack
    -- Executing Dial("SIP/599-ea11", "SIP/584|30|r") in new stack
We're at <Asterisk-externe-IP> port 14996
Answering/Requesting with root capability 0x4 (ulaw)
Answering with preferred capability 0x8 (alaw)
Answering with preferred capability 0x2 (gsm)
Answering with non-codec capability 0x1 (telephone-event)
12 headers, 12 lines
Reliably Transmitting:
INVITE sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491 SIP/2.0
Via: SIP/2.0/UDP <Asterisk-externe-IP>:5060;branch=z9hG4bK2ea756dd;rport
From: "599" <sip:599@<Asterisk-externe-IP>>;tag=as25d8d45f
To: <sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491>
Contact: <sip:599@<Asterisk-externe-IP>>
Call-ID: 42475d7923571b0c789166bd196322fb@<Asterisk-externe-IP>
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Date: Thu, 01 Dec 2005 12:48:28 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Content-Type: application/sdp
Content-Length: 267

v=0
o=root 11539 11539 IN IP4 <Asterisk-externe-IP>
s=session
c=IN IP4 <Asterisk-externe-IP>
t=0 0
m=audio 14996 RTP/AVP 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
 (NAT) to <FBF-IP>:5060
    -- Called 584
asterisk-srv*CLI>

Sip read:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP <Asterisk-externe-IP>:5060;branch=z9hG4bK2ea756dd;rport=5060
From: "599" <sip:599@<Asterisk-externe-IP>>;tag=as25d8d45f
To: <sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491>
Call-ID: 42475d7923571b0c789166bd196322fb@<Asterisk-externe-IP>
CSeq: 102 INVITE
User-Agent: AVM FRITZ!Box Fon WLAN 7050 (UI) 14.03.89 (3.01.03 tested by accredited T-Com test lab) (Oct 28 2005)
Content-Length: 0


8 headers, 0 lines
asterisk-srv*CLI>

Sip read:
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP <Asterisk-externe-IP>:5060;branch=z9hG4bK2ea756dd;rport=5060
From: "599" <sip:599@<Asterisk-externe-IP>>;tag=as25d8d45f
To: <sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491>;tag=5693961D17FAE27EB138B7903E63
Call-ID: 42475d7923571b0c789166bd196322fb@<Asterisk-externe-IP>
CSeq: 102 INVITE
Contact: <sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491>
User-Agent: AVM FRITZ!Box Fon WLAN 7050 (UI) 14.03.89 (3.01.03 tested by accredited T-Com test lab) (Oct 28 2005)
Content-Length: 0


9 headers, 0 lines
    -- SIP/584-8148 is ringing
asterisk-srv*CLI>

Sip read:
SIP/2.0 200 OK
Via: SIP/2.0/UDP <Asterisk-externe-IP>:5060;branch=z9hG4bK2ea756dd;rport=5060
From: "599" <sip:599@<Asterisk-externe-IP>>;tag=as25d8d45f
To: <sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491>;tag=5693961D17FAE27EB138B7903E63
Call-ID: 42475d7923571b0c789166bd196322fb@<Asterisk-externe-IP>
CSeq: 102 INVITE
Contact: <sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491>
User-Agent: AVM FRITZ!Box Fon WLAN 7050 (UI) 14.03.89 (3.01.03 tested by accredited T-Com test lab) (Oct 28 2005)
Supported: 100rel, replaces
Allow-Events: telephone-event, refer
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, UPDATE, PRACK, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE
Content-Type: application/sdp
Accept: application/sdp, multipart/mixed
Accept-Encoding: identity
Content-Length:   243

v=0
o=user 212952 212952 IN IP4 <FBF-IP>
s=session
c=IN IP4 <FBF-IP>
t=0 0
m=audio 7078 RTP/AVP 8 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-11
a=sendrecv
a=rtcp:7079

15 headers, 12 lines
Found RTP audio format 8
Found RTP audio format 0
Found RTP audio format 101
Peer audio RTP is at port <FBF-IP>:7078
Found description format PCMU
Found description format PCMA
Found description format telephone-event
Capabilities: us - 0xe (gsm|ulaw|alaw), peer - audio=0xc (ulaw|alaw)/video=0x0 (nothing), combined - 0xc (ulaw|alaw)
Non-codec capabilities: us - 0x1 (g723), peer - 0x1 (g723), combined - 0x1 (g723)
list_route: hop: <sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491>
set_destination: Parsing <sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491> for address/port to send to
set_destination: set destination to <FBF-IP>, port 5060
Transmitting:
ACK sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491 SIP/2.0
Via: SIP/2.0/UDP <Asterisk-externe-IP>:5060;branch=z9hG4bK76f25ec5;rport
From: "599" <sip:599@<Asterisk-externe-IP>>;tag=as25d8d45f
To: <sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491>;tag=5693961D17FAE27EB138B7903E63
Contact: <sip:599@<Asterisk-externe-IP>>
Call-ID: 42475d7923571b0c789166bd196322fb@<Asterisk-externe-IP>
CSeq: 102 ACK
User-Agent: Asterisk PBX
Content-Length: 0

 (NAT) to <FBF-IP>:5060
    -- SIP/584-8148 answered SIP/599-ea11
    -- Attempting native bridge of SIP/599-ea11 and SIP/584-8148

Ist recht lang, ja, aber die Infos die ich daraus ziehe ist, dass die FBF als RTP Port 7078 angibt. Ok, hab ich geöffnet, sollte also doch gehen?

Allerdings killt ja die FBF immer nach ein paar Sekunden. Liegt da doch noch ein Problem beim SIP?

Hier noch meine sip.conf (relevante Auszüge):
Code:
[general]
context=from-SIP                        ; Default context for incoming calls
port=5060                       ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=<Asterisk-lokale-ip>           ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
                                ; Note: Asterisk only uses the first host
                                ; in SRV records
                                ; Disabling DNS SRV lookups disables the
                                ; ability to place SIP calls based on domain
                                ; names to some other SIP users on the Internet


disallow=all                    ; First disallow all codecs
allow=ulaw                      ; Allow codecs in order of preference
allow=alaw
allow=gsm

canreinvite=yes                 ; Clients koennen direkt miteinander sprechen

externip=<Asterisk-externe-ip>

language=de                     ; Default language setting for all users/peers
nat=yes                         ; NAT settings
                                ; yes = Always ignore info and assume NAT
                                ; no = Use NAT mode only according to RFC3581
                                ; never = Never attempt NAT mode or RFC3581 support
                                ; route = Assume NAT, don't send rport (work around more UNIDEN bugs)

qualify=yes                     ; NAT Keep Alive

                                ; if we're behind a NAT

                                ; The externip and localnet is used
                                ; when registering and communicating with other proxies
                                ; that we're registered with
                                ; You may add multiple local networks.  A reasonable set of defaults
                                ; are:
localnet=<ein-paar-lokale-netze>


[599]
type=friend
host=dynamic
username=599
callerid="test" <599>
secret=geheim
nat=yes


[584]
type=friend
username=584
host=dynamic
callerid="Home Office" <584>
secret=1234
auth=md5
mailbox=584@voicemail
language=de
reinvite=no
canreinvite=no
nat=yes                         ; NAT
qualify=yes                     ; NAT Keep Alive

Gut, ich weiß, das ist jetzt sehr viel...
Wenn ihr nicht Lust habt alles zu lesen freue ich mich auch über irgendwleche Tipps und Sachen die ich möglicherweise nicht beachtet habe...

Danke schonmal,
stephan
 
Hmmmm gerade nochmal etwas debuggt, (asterisk mit -d zusätzlich zu vvvv) gestartet, nun taucht auch der CANCEL Header auf, der sowit ich das verstehe aber von Asterisk kommt gezeigt...

Code:
Sip read:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP <Asterisk-externe-IP>:5060;branch=z9hG4bK3dae44de;rport=5060
From: "124" <sip:124@<Asterisk-externe-IP>>;tag=as7dfd27e4
To: <sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491>
Call-ID: 32c0e383654c0dcd6bc316b063f06294@<Asterisk-externe-IP>
CSeq: 102 INVITE
User-Agent: AVM FRITZ!Box Fon WLAN 7050 (UI) 14.03.89 (3.01.03 tested by accredited T-Com test lab) (Oct 28 2005)
Content-Length: 0


8 headers, 0 lines
voip-erg*CLI>

Sip read:
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP <Asterisk-externe-IP>:5060;branch=z9hG4bK3dae44de;rport=5060
From: "124" <sip:124@<Asterisk-externe-IP>>;tag=as7dfd27e4
To: <sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491>;tag=451912D2934E77CBC017F5A1C82C
Call-ID: 32c0e383654c0dcd6bc316b063f06294@<Asterisk-externe-IP>
CSeq: 102 INVITE
Contact: <sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491>
User-Agent: AVM FRITZ!Box Fon WLAN 7050 (UI) 14.03.89 (3.01.03 tested by accredited T-Com test lab) (Oct 28 2005)
Content-Length: 0


9 headers, 0 lines
    -- SIP/584-8eb7 is ringing
    -- Nobody picked up in 30000 ms
Reliably Transmitting:
CANCEL sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491 SIP/2.0
Via: SIP/2.0/UDP <Asterisk-externe-IP>:5060;branch=z9hG4bK3dae44de;rport
From: "124" <sip:124@<Asterisk-externe-IP>>;tag=as7dfd27e4
To: <sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491>
Contact: <sip:124@<Asterisk-externe-IP>>
Call-ID: 32c0e383654c0dcd6bc316b063f06294@<Asterisk-externe-IP>
CSeq: 102 CANCEL
User-Agent: Asterisk PBX
Content-Length: 0

 (NAT) to <FBF-IP>:5060
Scheduling destruction of call '32c0e383654c0dcd6bc316b063f06294@<Asterisk-externe-IP>' in 15000 ms
    -- Executing Goto("CAPI[contr1/584]/12", "s-NOANSWER|1") in new stack
    -- Goto (macro-sipvm,s-NOANSWER,1)
    -- Executing VoiceMail("CAPI[contr1/584]/12", "u584") in new stack
    -- CAPI Answering for MSN 584
    -- Playing 'voicemail/voicemail/584/unavail' (language 'en')
voip-erg*CLI>

Sip read:
SIP/2.0 487 Request Cancelled
Via: SIP/2.0/UDP <Asterisk-externe-IP>:5060;branch=z9hG4bK3dae44de;rport=5060
From: "124" <sip:124@<Asterisk-externe-IP>>;tag=as7dfd27e4
To: <sip:584@<FBF-IP>;uniq=ECBF3640B3D5A79A5CE2AA193491>;tag=451912D2934E77CBC017F5A1C82C
Call-ID: 32c0e383654c0dcd6bc316b063f06294@<Asterisk-externe-IP>
CSeq: 102 INVITE
User-Agent: AVM FRITZ!Box Fon WLAN 7050 (UI) 14.03.89 (3.01.03 tested by accredited T-Com test lab) (Oct 28 2005)
Content-Length: 0


8 headers, 0 lines

Sehe ich das richtig, dass Asterisk ein CANCEL an die FBF sendet und die mit "Request Cancelled" antwortet?

Warum?!
 
Fürs Archiv:
Das ganze funktioniert soweit echt gut.

Wird bloß interessant, wenn mal eine zweite FBF bzw. ein zweiter SIP Client im Internet dazukommt. Aber ich denke das klappt dann auch.

Warum es "plötzlich" geht kann ich selber nicht richtig nachvollziehen. Einzige Änderung ist, dass die FBF nun auch einen DnyDNS Namen hat. Das kann aber eigentlich *NULL* Auswirkungen haben. Komisch...

Leider scheint Asterisk aber ein Problem zu haben, Gespräche zu vermitteln die zweimal geNATet wurden (interne FW -> DMZ -> externe FW), denn von intern nach extern kann ich (noch) nicht voipen.
Schaun mer mal.
 

Statistik des Forums

Themen
244,868
Beiträge
2,219,770
Mitglieder
371,584
Neuestes Mitglied
porcupine
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.