Fritzbox antwortet nicht auf SIP request von Asterisk

ksiretsa

Neuer User
Mitglied seit
10 Sep 2024
Beiträge
3
Punkte für Reaktionen
0
Punkte
1
Hallo zusammen,

ich komme nicht weiter.
Der Server auf dem Asterisk läuft ist die Schnittstelle zwischen VPN und Heimnetz. Im Endeffekt soll das Softphone im VPN über Asterisk mit dem Festnetz der Fritzbox telefonieren.
Das Softphone wurde schon direkt an der Fritzbox verwendet mit dem gleichen Account den auch Asterisk nutzt und es hat funktioniert.

Danke schonmal für eure Zeit. Wenn ich Informationen vergessen habe, bitte fragen.

FRITZ!Box 7590 AX - FRITZ!OS:7.81

Debian GNU/Linux 12 (bookworm)
6.1.0-25-amd64
Asterisk 20.9.2

Netzwerktopologie:
Softphone: vpn->10.0.0.4
Asterisk: eth->192.168.178.11 / vpn->10.0.0.2
Fritzbox: eth->192.168.178.1

Firewalls gibt es keine, außer die der Fritzbox.

Auszug aus dem Fritzbox Log:
Code:
SIP Clients:
0: registered last status 2 -- reachability 99 %
    contact 0: iface=homenet: host=sip:[email protected]:5060, my=192.168.178.1, expire Tue Sep 10 08:50:27 2024
Also sieht so aus als ob Asterisk registriert wäre.

pjsip set logger on
Softphone und Asterisk quatschen kurz dann soll der Anruf an die Fritzbox gehen aber keine Antwort bis dann das Softphone auflegt.
Anruf:
Code:
<--- Received SIP request (1115 bytes) from UDP:10.0.0.4:47869 --->
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 10.0.0.4:47869;branch=z9hG4bK.fp-ULbRAT;rport
From: "lin" <sip:[email protected]>;tag=MmQwJtD1q
To: sip:[email protected]
CSeq: 20 INVITE
Call-ID: aKblml9fTh
Max-Forwards: 70
Supported: replaces, outbound, gruu, path, record-aware
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, PRACK, UPDATE
Content-Type: application/sdp
Content-Length: 538
Contact: <sip:[email protected]:47869;transport=udp>;expires=3599
User-Agent: LinphoneAndroid/5.2.5 (Pixel 5a) LinphoneSDK/5.3.47 (tags/5.3.47^0)

v=0
o=6001 600 3061 IN IP4 10.0.0.4
s=Talk
c=IN IP4 10.0.0.4
t=0 0
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
a=record:off
m=audio 47455 RTP/AVP 96 97 98 0 8 18 101 99 100
a=rtpmap:96 opus/48000/2
a=fmtp:96 useinbandfec=1
a=rtpmap:97 speex/16000
a=fmtp:97 vbr=on
a=rtpmap:98 speex/8000
a=fmtp:98 vbr=on
a=fmtp:18 annexb=yes
a=rtpmap:101 telephone-event/48000
a=rtpmap:99 telephone-event/16000
a=rtpmap:100 telephone-event/8000
a=rtcp:41591
a=rtcp-fb:* trr-int 1000
a=rtcp-fb:* ccm tmmbr

<--- Transmitting SIP response (443 bytes) to UDP:10.0.0.4:47869 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.0.0.4:47869;rport=47869;received=10.0.0.4;branch=z9hG4bK.fp-ULbRAT
Call-ID: aKblml9fTh
From: "lin" <sip:[email protected]>;tag=MmQwJtD1q
To: <sip:[email protected]>;tag=z9hG4bK.fp-ULbRAT
CSeq: 20 INVITE
WWW-Authenticate: Digest realm="asterisk",nonce="1725958225/a4d15019c53a08c769de49c5c923abb1",opaque="60d4e2ad374d89b4",algorithm=MD5,qop="auth"
Server: Asterisk PBX 20.9.2
Content-Length:  0


<--- Received SIP request (307 bytes) from UDP:10.0.0.4:47869 --->
ACK sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 10.0.0.4:47869;branch=z9hG4bK.fp-ULbRAT;rport
Call-ID: aKblml9fTh
From: "lin" <sip:[email protected]>;tag=MmQwJtD1q
To: <sip:[email protected]>;tag=z9hG4bK.fp-ULbRAT
Contact: <sip:[email protected]:47869;transport=udp>;expires=3599
Max-Forwards: 70
CSeq: 20 ACK


<--- Received SIP request (1389 bytes) from UDP:10.0.0.4:47869 --->
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 10.0.0.4:47869;branch=z9hG4bK.4JIaC0XEp;rport
From: "lin" <sip:[email protected]>;tag=MmQwJtD1q
To: sip:[email protected]
CSeq: 21 INVITE
Call-ID: aKblml9fTh
Max-Forwards: 70
Supported: replaces, outbound, gruu, path, record-aware
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, PRACK, UPDATE
Content-Type: application/sdp
Content-Length: 538
Contact: <sip:[email protected]:47869;transport=udp>;expires=3599
User-Agent: LinphoneAndroid/5.2.5 (Pixel 5a) LinphoneSDK/5.3.47 (tags/5.3.47^0)
Authorization:  Digest realm="asterisk", nonce="1725958225/a4d15019c53a08c769de49c5c923abb1", algorithm=MD5, opaque="60d4e2ad374d89b4", username="6001",  uri="sip:[email protected]", response="62f6bb235c30e313a905cd659ac08336", cnonce="e74id1a5l-mM0YwF", nc=00000001, qop=auth

v=0
o=6001 600 3061 IN IP4 10.0.0.4
s=Talk
c=IN IP4 10.0.0.4
t=0 0
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
a=record:off
m=audio 47455 RTP/AVP 96 97 98 0 8 18 101 99 100
a=rtpmap:96 opus/48000/2
a=fmtp:96 useinbandfec=1
a=rtpmap:97 speex/16000
a=fmtp:97 vbr=on
a=rtpmap:98 speex/8000
a=fmtp:98 vbr=on
a=fmtp:18 annexb=yes
a=rtpmap:101 telephone-event/48000
a=rtpmap:99 telephone-event/16000
a=rtpmap:100 telephone-event/8000
a=rtcp:41591
a=rtcp-fb:* trr-int 1000
a=rtcp-fb:* ccm tmmbr

<--- Transmitting SIP response (269 bytes) to UDP:10.0.0.4:47869 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.0.0.4:47869;rport=47869;received=10.0.0.4;branch=z9hG4bK.4JIaC0XEp
Call-ID: aKblml9fTh
From: "lin" <sip:[email protected]>;tag=MmQwJtD1q
To: <sip:[email protected]>
CSeq: 21 INVITE
Server: Asterisk PBX 20.9.2
Content-Length:  0


    -- Executing [1337@internal:1] Dial("PJSIP/6001-00000006", "PJSIP/1337@mytrunk") in new stack
    -- Called PJSIP/1337@mytrunk
<--- Transmitting SIP request (942 bytes) to UDP:192.168.178.1:5060 --->
INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.178.11:5060;rport;branch=z9hG4bKPj48a04520-54df-4259-8485-7ffbebef8e0f
From: "lin" <sip:[email protected]>;tag=2460d52f-ed44-4e65-b3b8-d32cef758ebc
To: <sip:[email protected]>
Contact: <sip:[email protected]:5060>
Call-ID: 808a07ed-61fd-49b7-9686-5790814c77e7
CSeq: 8596 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, REFER, MESSAGE
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 20.9.2
Content-Type: application/sdp
Content-Length:   263

v=0
o=- 583836739 583836739 IN IP4 192.168.178.11
s=Asterisk
c=IN IP4 192.168.178.11
t=0 0
m=audio 10930 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:140
a=sendrecv

<--- Transmitting SIP request (942 bytes) to UDP:192.168.178.1:5060 --->
INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.178.11:5060;rport;branch=z9hG4bKPj48a04520-54df-4259-8485-7ffbebef8e0f
From: "lin" <sip:[email protected]>;tag=2460d52f-ed44-4e65-b3b8-d32cef758ebc
To: <sip:[email protected]>
Contact: <sip:[email protected]:5060>
Call-ID: 808a07ed-61fd-49b7-9686-5790814c77e7
CSeq: 8596 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, REFER, MESSAGE
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 20.9.2
Content-Type: application/sdp
Content-Length:   263

v=0
o=- 583836739 583836739 IN IP4 192.168.178.11
s=Asterisk
c=IN IP4 192.168.178.11
t=0 0
m=audio 10930 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:140
a=sendrecv

<--- Received SIP request (307 bytes) from UDP:10.0.0.4:47869 --->
CANCEL sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 10.0.0.4:47869;branch=z9hG4bK.4JIaC0XEp;rport
Call-ID: aKblml9fTh
From: "lin" <sip:[email protected]>;tag=MmQwJtD1q
To: sip:[email protected]
Max-Forwards: 70
CSeq: 21 CANCEL
User-Agent: LinphoneAndroid/5.2.5 (Pixel 5a) LinphoneSDK/5.3.47 (tags/5.3.47^0)

pjsip.conf:
Code:
;===============TRANSPORT

[simpletrans]
type=transport
protocol=udp
bind=0.0.0.0

;===============EXTENSION 6001

[6001]
type=endpoint
context=internal
disallow=all
allow=ulaw,alaw
auth=auth6001
aors=6001

[auth6001]
type=auth
auth_type=userpass
password=6001
username=6001

[6001]
type=aor
max_contacts=1

;===============TRUNK

[mytrunk]
type=registration
outbound_auth=mytrunk
server_uri=sip:192.168.178.1
client_uri=sip:[email protected]
retry_interval=60

[mytrunk]
type=auth
auth_type=userpass
password=password
username=username

[mytrunk]
type=aor
contact=sip:192.168.178.1:5060

[mytrunk]
type=endpoint
context=from-external
disallow=all
allow=ulaw,alaw
outbound_auth=mytrunk
aors=mytrunk

[mytrunk]
type=identify
endpoint=mytrunk
match=192.168.178.1

extensions.conf:
Code:
[internal]

exten => _X.,1,Dial(PJSIP/${EXTEN}@mytrunk)
 
Zuletzt bearbeitet:
konnte dem nicht vollstaendig folgen.
irgendwie hab ich mir gedacht, dass es vielleicht daran liegt, dass asterisk versucht mit dem vpn interface die fritzbox zu erreichen und die fritzbox somit nie etwas bekommen hat, auf das sie haette antworten koennen.
kurz mit chatgpt verhandelt und das hat dann folgendes ausgespuckt:
Code:
[transport-local]
type=transport
protocol=udp
bind=192.168.178.11:5060  ; Binde an die lokale Netzwerkschnittstelle
local_net=192.168.178.0/24

[transport-vpn]
type=transport
protocol=udp
bind=10.0.0.2:5060        ; Binde an die VPN-Netzwerkschnittstelle
local_net=10.0.0.0/24
achso und dann wird per dialplan kontext und somit interface gewechselt. allerdings funktionieren die anrufe in beide richtungen noch nicht, also ist das noch nicht ganz richtig:
Code:
[internal]
exten => _X.,1,NoOp(from VPN)
exten => _X.,n,Dial(PJSIP/${EXTEN}@mytrunk,30,TtrPJSIP/transport-vpn)

[from-external]
exten => _X.,1,NoOp(from EXT)
exten => _X.,n,Dial(PJSIP/${EXTEN}@6001,30,TtrPJSIP/transport-local)

hm. wenn ich von aussen anrufe dann nimmt die fritzbox kontakt mit asterisk auf und bricht mit folgendem fehler ab: 484 Address Incomplete
vom softphone nach aussen sieht es immer noch so aus also ob kein kontakt zwischen fritzbox und asterisk zustande kommt.
 
Zuletzt bearbeitet:
AVM kann nicht in andere Subnetze antworten. Folglich muss Du darauf achten, dass der FRITZ!Box im SIP und SDP keine IP-Adresse aus Deinerm 10er-Netz enthalten sind, sondern nur aus dem 192.168.178er-Netz sieht.
die fritzbox somit nie etwas bekommen hat
Das müsstest Du über einen Paket-Mitschnitt sehen, die FRITZ!Box hat unter „fritz.box → Hilfe → Support“ so einen Paket-Mitschnitt.
 
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.