[Problem] Asterisk / Pjsip / FRITZ!Box 7590

User0815b

Neuer User
Mitglied seit
12 Dez 2022
Beiträge
5
Punkte für Reaktionen
1
Punkte
3
Hey Liebe Leute,

Ich bin hier jetzt seit einigen Tagen am stöbern finde aber keine Lösung für mein Problem.
Daher der Post mit der Bitte um Hilfe

Folgendes Setup:

Fritzbox ip:192.168.0.1 -->openwrt ip:192.168.0.2-->asterisk ip:172.22.22.220

Fritzbox iphone:
name:asterisk passwort:Geheim123! intern:**620
(öffentlich teilen ist aus, ist das das problem ? die verschiedenen Netzwerke ? Kommunizieren können die alle miteinander)



Asterisk Settings:

Pjsip:
Code:
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

[transport-tcp]
type=transport
protocol=tcp
bind=0.0.0.0

[fritzbox]
type=registration
;transport=transport-tcp
outbound_auth=fritzbox
server_uri=sip:192.168.0.1:5060
client_uri=sip:[email protected]:5060


[fritzbox]
type=auth
auth_type=userpass
password=Geheim123!
username=asterisk

[fritzbox]
type = aor
contact = sip:192.168.0.1:5060

[asterisk]
type = endpoint
context = incoming
outbound_auth = fritzbox
aors = fritzbox
disallow=all
allow=ulaw
allow=alaw
allow=gsm
from_domain = 192.168.0.1
from_user = asterisk

[fritzbox]
type = identify
endpoint = asterisk
match = 192.168.0.1

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

[6001]
type = aor
remove_existing = yes
max_contacts = 1

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

[6002]
type = endpoint
context = internal
disallow = all
allow = ulaw,alaw
aors = 6002
auth = auth6002

[6002]
type = aor
remove_existing = yes
max_contacts = 1

[auth6002]
type=auth
auth_type=userpass
password=1234
username=6002



Extensions:
Code:
[incoming]

exten => _.,1,Goto(internal,6001,1)

[internal]

exten => 6001,1,NoOp(Rufe 6001)
same => n,Dial(PJSIP/6001)
same => n,Hangup()

exten => 6002,1,NoOp(Rufe 6002)
same => n,Dial(PJSIP/6002)
same => n,Hangup()

exten => _0X.,1,Goto(outgoing,${EXTEN:1},1)


[outgoing]

exten => _X.,1,Dial(PJSIP/asterisk/${EXTEN})

Wäre super wenn Ihr helfen könntet , ich denke die Verbindung zur Fritze passt nicht


Fehler:
Code:
Connected to Asterisk 20.0.0~dfsg+~cs6.12.40431414-2 currently running on OSMO (pid = 1123)
    -- Executing [0004915259587859@internal:1] Goto("PJSIP/6001-00000000", "outgoing,004915259586666,1") in new stack
    -- Goto (outgoing,004915259587859,1)
    -- Executing [004915259587859@outgoing:1] Dial("PJSIP/6001-00000000", "PJSIP/asterisk/004915259586666") in new stack
[Dec 12 11:55:47] ERROR[2570]: res_pjsip.c:849 ast_sip_create_dialog_uac: Endpoint 'asterisk': Could not create dialog to invalid URI '004915259586666'.  Is endpoint registered and reachable?
[Dec 12 11:55:47] ERROR[2570]: chan_pjsip.c:2672 request: Failed to create outgoing session to endpoint 'asterisk'
[Dec 12 11:55:47] NOTICE[2576][C-00000001]: app_dial.c:2707 dial_exec_full: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Auto fallthrough, channel 'PJSIP/6001-00000000' status is 'CHANUNAVAIL'

ich fuxxe mich noch rein wäre super wenn wer helfen könnte und erklärt was jetzt nicht passt
Finde halt immer nur infos in sip etc. das ja tod ? quasi

Grüße
DerFragende123;)
 
Zuletzt bearbeitet:
Wer mir bei der Lösung helfen kann dem biete ich auch einen kleinen Dank (20-50e) , so ist es nicht !
 
Eigentlich müsste das einfach so gehen. Kannst Du Dir die SIP-Nachrichten über den Asterisk eigenen SIP-Logger (oder Wireshark oder die capture.html auf der FRITZ!Box) mal anschauen.
 
Wenn Du es nicht extra noch betont hättest, würde ich auf eine Netzwerkursache (Routing zwischen den beiden Netzen) tippen, weil das das Fehlerbild meiner Meinung nach hergibt.

Funktioniert die Registrierung von asterisk an der fritzbox (pjsip show registrations)?

Weiters würde ich beim endpoint und bei der registration explizit den transport=transport-udp angeben, da Du mehrere transports definiert hast. Die Doku sagt:

Warning
Not specifying a transport will DEFAULT to the first configured transport in pjsip.conf which is valid for the URI we are trying to contact.

Meiner Erfahrung nach kann asterisk hier sehr unerwartet entscheiden, was der "first configured" ist. Also kann in jedem Fall nicht schaden, den anzugeben.

Mitloggen mit "pjsip set logger add FRITZBOX-IP" ist wie schon erwähnt sicher auch interessant, um zu sehen ob und was überhaupt zurück kommt.
 
Danke für die Rückmeldungen !

Schaue ich gleich
Logs folgen

pjsip.conf (einige änderungen kann sein, dass verschlimmbessert habe , könnt ggf mal schauen die sip:urls vorallem)
Code:
[global]
type=global
endpoint_identifier_order=ip,username

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

[transport-tcp]
type=transport
protocol=tcp
bind=0.0.0.0

[fritzbox]
type=registration
transport=transport-udp
outbound_auth=fritzbox
server_uri=sip:[email protected]:5060
client_uri=sip:[email protected]:5060


[fritzbox]
type=auth
auth_type=userpass
password=Geheim123!
username=asterisk

[fritzbox]
type = aor
contact = sip:[email protected]:5060

[asterisk]
type = endpoint
context = incoming
outbound_auth = fritzbox
aors = fritzbox
disallow=all
allow=ulaw
allow=alaw
allow=gsm
from_domain = 192.168.0.1
from_user = asterisk

[fritzbox]
type = identify
endpoint = asterisk
match = 192.168.0.1

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

[6001]
type = aor
remove_existing = yes
max_contacts = 1

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

[6002]
type = endpoint
context = internal
disallow = all
allow = ulaw,alaw
aors = 6002
auth = auth6002

[6002]
type = aor
remove_existing = yes
max_contacts = 1

[auth6002]
type=auth
auth_type=userpass
password=1234
username=6002

extensions.conf
Code:
[incoming]

exten => _X.,1,Goto(internal,6001,1)

[internal]

exten => 6001,1,NoOp(Rufe 6001)
same => n,Dial(PJSIP/6001)
same => n,Hangup()

exten => 6002,1,NoOp(Rufe 6002)
same => n,Dial(PJSIP/6002)
same => n,Hangup()

exten => _0X.,1,Goto(outgoing,${EXTEN:1},1)


[outgoing]

exten => _X.,1,Dial(PJSIP/asterisk/${EXTEN})

Jetzt der Debug
Code:
─(root㉿OSMO)-[~]
└─# service asterisk restart
                                                                                                                                                                                                        
┌──(root㉿OSMO)-[~]
└─# asterisk -rvvv 
Asterisk 20.0.0~dfsg+~cs6.12.40431414-2, Copyright (C) 1999 - 2022, Sangoma Technologies Corporation and others.
Created by Mark Spencer <[email protected]>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 20.0.0~dfsg+~cs6.12.40431414-2 currently running on OSMO (pid = 3961)
OSMO*CLI> core set debug 4
Core debug was OFF and is now 4.
OSMO*CLI> core set verbose 4
Console verbose was 3 and is now 4.
OSMO*CLI> pjsip show registrations

 <Registration/ServerURI..............................>  <Auth....................>  <Status.......>
==========================================================================================

 fritzbox/sip:[email protected]:5060                  fritzbox                    Registered        (exp. 276s)

Objects found: 1

    -- Added contact 'sip:[email protected]:38054;transport=tcp' to AOR '6001' with expiration of 3600 seconds
    -- Removed contact 'sip:[email protected]:39306;transport=tcp' from AOR '6001' due to remove existing
  == Contact 6001/sip:[email protected]:39306;transport=tcp has been deleted
OSMO*CLI> pjsip set logger add 192.168.0.1
PJSIP Logging Enabled for host: 192.168.0.1
    -- Executing [0004915259587859@internal:1] Goto("PJSIP/6001-00000000", "outgoing,004915259587859,1") in new stack
    -- Goto (outgoing,004915259587859,1)
    -- Executing [004915259587859@outgoing:1] Dial("PJSIP/6001-00000000", "PJSIP/asterisk/004915259587859") in new stack
[Dec 12 21:15:14] ERROR[4082]: res_pjsip.c:849 ast_sip_create_dialog_uac: Endpoint 'asterisk': Could not create dialog to invalid URI '004915259587859'.  Is endpoint registered and reachable?
[Dec 12 21:15:14] ERROR[4082]: chan_pjsip.c:2672 request: Failed to create outgoing session to endpoint 'asterisk'
[Dec 12 21:15:14] NOTICE[4088][C-00000001]: app_dial.c:2707 dial_exec_full: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Auto fallthrough, channel 'PJSIP/6001-00000000' status is 'CHANUNAVAIL'
<--- Transmitting SIP request (580 bytes) to UDP:192.168.0.1:5060 --->
REGISTER sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 172.22.22.220:5060;rport;branch=z9hG4bKPj077d435f-271a-4ad4-b899-6391f1a6e73d
From: <sip:[email protected]>;tag=203d1897-2038-42d0-9d49-80cf9f8388d1
To: <sip:[email protected]>
Call-ID: 063cee4c-303a-44c2-9a71-7f7a7fffd92c
CSeq: 58092 REGISTER
Contact: <sip:[email protected]:5060>
Expires: 3600
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Max-Forwards: 70
User-Agent: Asterisk PBX 20.0.0~dfsg+~cs6.12.40431414-2
Content-Length:  0


<--- Received SIP response (458 bytes) from UDP:192.168.0.1:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 172.22.22.220:5060;rport=5060;branch=z9hG4bKPj077d435f-271a-4ad4-b899-6391f1a6e73d;received=192.168.0.2
From: <sip:[email protected]>;tag=203d1897-2038-42d0-9d49-80cf9f8388d1
To: <sip:[email protected]>;tag=B6F02F69594CF053
Call-ID: 063cee4c-303a-44c2-9a71-7f7a7fffd92c
CSeq: 58092 REGISTER
WWW-Authenticate: Digest realm="fritz.box", nonce="BB54764A0257AADC"
User-Agent: FRITZ!OS
Content-Length: 0


<--- Transmitting SIP request (750 bytes) to UDP:192.168.0.1:5060 --->
REGISTER sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 172.22.22.220:5060;rport;branch=z9hG4bKPjd70c69b8-a8b5-454b-9a0d-52f595850f39
From: <sip:[email protected]>;tag=203d1897-2038-42d0-9d49-80cf9f8388d1
To: <sip:[email protected]>
Call-ID: 063cee4c-303a-44c2-9a71-7f7a7fffd92c
CSeq: 58093 REGISTER
Contact: <sip:[email protected]:5060>
Expires: 3600
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Max-Forwards: 70
User-Agent: Asterisk PBX 20.0.0~dfsg+~cs6.12.40431414-2
Authorization: Digest username="asterisk", realm="fritz.box", nonce="BB54764A0257AADC", uri="sip:[email protected]:5060", response="88caed338ae54f72c4f72c156be48cef"
Content-Length:  0


<--- Received SIP response (700 bytes) from UDP:192.168.0.1:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.22.22.220:5060;rport=5060;branch=z9hG4bKPjd70c69b8-a8b5-454b-9a0d-52f595850f39;received=192.168.0.2
From: <sip:[email protected]>;tag=203d1897-2038-42d0-9d49-80cf9f8388d1
To: <sip:[email protected]>;tag=4D286AFE95C282D8
Call-ID: 063cee4c-303a-44c2-9a71-7f7a7fffd92c
CSeq: 58093 REGISTER
Contact: <sip:[email protected]:5060>;expires=300
User-Agent: AVM FRITZ!Box 7590 154.07.50 (Nov 18 2022)
Supported: 100rel,replaces,timer
Allow-Events: telephone-event,refer,reg
Allow: INVITE,ACK,OPTIONS,CANCEL,BYE,UPDATE,PRACK,INFO,SUBSCRIBE,NOTIFY,REFER,MESSAGE,PUBLISH
Accept: application/sdp, multipart/mixed
Accept-Encoding: identity
Content-Length: 0


OSMO*CLI>

@IEEE @sonyKatze

Habe im ersten post die Netzwerktopologie mal dargestellt.

Fritzbox ip:192.168.0.1 -->openwrt ip:192.168.0.2-->asterisk ip:172.22.22.220

Was macht meine zweite router ip im verlauf ggf. da der Fehler ? (192.168.0.2)
Code:
Via: SIP/2.0/UDP 172.22.22.220:5060;rport=5060;branch=z9hG4bKPj077d435f-271a-4ad4-b899-6391f1a6e73d;received=192.168.0.2

Was bedeutet das
Code:
Contact: <sip:[email protected]:5060>
muss ich in der ext s zuteilen ?
Wie hier im Verlauf erwähnt

kann ich den debug auch in der config quasi festlegen, dass er immer lggt ?

sieht so aus, als würde der als in der fritze reggen ? und die blockt mal nicht ? (Response 401 o 200)

das kommt jetzt regelm.
Code:
OSMO*CLI> pjsip show registrations

 <Registration/ServerURI..............................>  <Auth....................>  <Status.......>
==========================================================================================

 fritzbox/sip:[email protected]:5060                  fritzbox                    Registered        (exp. 244s)

Objects found: 1

<--- Transmitting SIP request (580 bytes) to UDP:192.168.0.1:5060 --->
REGISTER sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 172.22.22.220:5060;rport;branch=z9hG4bKPj54825672-41e5-4b1c-acd6-3491ef49b6a5
From: <sip:[email protected]>;tag=04e486b4-4c46-4f14-91b1-644b7e51f552
To: <sip:[email protected]>
Call-ID: 063cee4c-303a-44c2-9a71-7f7a7fffd92c
CSeq: 58096 REGISTER
Contact: <sip:[email protected]:5060>
Expires: 3600
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Max-Forwards: 70
User-Agent: Asterisk PBX 20.0.0~dfsg+~cs6.12.40431414-2
Content-Length:  0


<--- Received SIP response (458 bytes) from UDP:192.168.0.1:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 172.22.22.220:5060;rport=5060;branch=z9hG4bKPj54825672-41e5-4b1c-acd6-3491ef49b6a5;received=192.168.0.2
From: <sip:[email protected]>;tag=04e486b4-4c46-4f14-91b1-644b7e51f552
To: <sip:[email protected]>;tag=F5EA34FF91B9906B
Call-ID: 063cee4c-303a-44c2-9a71-7f7a7fffd92c
CSeq: 58096 REGISTER
WWW-Authenticate: Digest realm="fritz.box", nonce="C4EFEAE339B2FD41"
User-Agent: FRITZ!OS
Content-Length: 0


<--- Transmitting SIP request (750 bytes) to UDP:192.168.0.1:5060 --->
REGISTER sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 172.22.22.220:5060;rport;branch=z9hG4bKPj069a838c-1362-4d5a-9789-a7423cd3b86e
From: <sip:[email protected]>;tag=04e486b4-4c46-4f14-91b1-644b7e51f552
To: <sip:[email protected]>
Call-ID: 063cee4c-303a-44c2-9a71-7f7a7fffd92c
CSeq: 58097 REGISTER
Contact: <sip:[email protected]:5060>
Expires: 3600
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Max-Forwards: 70
User-Agent: Asterisk PBX 20.0.0~dfsg+~cs6.12.40431414-2
Authorization: Digest username="asterisk", realm="fritz.box", nonce="C4EFEAE339B2FD41", uri="sip:[email protected]:5060", response="b717037b33e69d608bf831ce20ce4fa0"
Content-Length:  0


<--- Received SIP response (700 bytes) from UDP:192.168.0.1:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.22.22.220:5060;rport=5060;branch=z9hG4bKPj069a838c-1362-4d5a-9789-a7423cd3b86e;received=192.168.0.2
From: <sip:[email protected]>;tag=04e486b4-4c46-4f14-91b1-644b7e51f552
To: <sip:[email protected]>;tag=B4EF28DD954B2D5A
Call-ID: 063cee4c-303a-44c2-9a71-7f7a7fffd92c
CSeq: 58097 REGISTER
Contact: <sip:[email protected]:5060>;expires=300
User-Agent: AVM FRITZ!Box 7590 154.07.50 (Nov 18 2022)
Supported: 100rel,replaces,timer
Allow-Events: telephone-event,refer,reg
Allow: INVITE,ACK,OPTIONS,CANCEL,BYE,UPDATE,PRACK,INFO,SUBSCRIBE,NOTIFY,REFER,MESSAGE,PUBLISH
Accept: application/sdp, multipart/mixed
Accept-Encoding: identity
Content-Length: 0
 
Zuletzt bearbeitet:
Das 's' im Contact Header ist mal fürs erste halb so wild, das solltest Du auch weg bringen indem Du in der registration section "contact_user = asterisk" ergänzt.

Das "received=192.168.0.2" lässt mich aber vermuten, dass zwischen Deinen Netzen nicht transparent geroutet wird, sondern der 192.168.0.2 ein NAT in das andere Netz macht. Damit werden tatsächliche IPs dann mit der 192.168.0.2 maskiert und daher sehen die Gegenstellen nur diese IP. Das könnte für einen flüssigen SIP Dialog alles andere als förderlich sein.

Ich würde an Deiner Stelle, sofern möglich, mal alles in das selbe Netz hängen, einfach als Proof dass alles richtig konfiguriert ist. Wenn das dann klappt, kannst Du Dir das Routing Thema vorknöpfen. Ich hab hier zu wenig Ahnung von openwrt, in jedem Fall sollte hier ein NAT zwischen den Netzen vermieden werden.
 
Habs !
Hier für die weiteren leidenden mit obelix von asterisk

Fritzbox 192.168.0.1 (voipuser:asterisk pw:LkTy4c7mxHH4?X6_)
Openwrt 192.168.0.2 and 192.168.1.1 (internal dhcp server )
ASterisk 192.168.1.10 (from openwrt via dhcp but static)

connection:
Fritz <-> OpenWRT <-> Asterisk

Code:
[global]
type=global
endpoint_identifier_order=ip,username

[transport-udp]
type=transport
protocol=udp
bind=192.168.1.10

[transport-tcp]
type=transport
protocol=tcp
bind=0.0.0.0

[fritzbox]
type=registration
transport=transport-udp
outbound_auth=fritzbox
contact_user = asterisk
server_uri=sip:[email protected]:5060
client_uri=sip:[email protected]:5060



[fritzbox]
type=auth
auth_type=userpass
password=LkTy4c7mxHH4?X6_
username=asterisk

[fritzbox]
type = aor
contact = sip:[email protected]:5060

[asterisk]
type = endpoint
context = incoming
outbound_auth = fritzbox
aors = fritzbox
disallow=all
allow=ulaw
allow=alaw
allow=gsm
;from_domain = 192.168.0.1
from_user = asterisk

[fritzbox]
type = identify
endpoint = asterisk
match = 192.168.0.1

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

[6001]
type = aor
remove_existing = yes
max_contacts = 1

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

[6002]
type = endpoint
context = internal
disallow = all
allow = ulaw,alaw
aors = 6002
auth = auth6002

[6002]
type = aor
remove_existing = yes
max_contacts = 1

[auth6002]
type=auth
auth_type=userpass
password=1234
username=6002

Code:
[incoming]

exten => _X.,1,Goto(internal,6001,1)
exten => asterisk,1,Goto(internal,6001,1)

[internal]

exten => 6001,1,NoOp(Rufe 6001)
same => n,Dial(PJSIP/6001)
same => n,Hangup()

exten => 6002,1,NoOp(Rufe 6002)
same => n,Dial(PJSIP/6002)
same => n,Hangup()

exten => _0X.,1,Goto(outgoing,${EXTEN:1},1)


[outgoing]

exten => _X.,1,Dial(PJSIP/${EXTEN}@asterisk)
exten => asterisk,1,Dial(PJSIP/${EXTEN}@asterisk)
 
Ja, ich hab Deinen Thread im Asterisk Forum mit dem entscheidenden Hinweis gesehen :)

Es ärgert mich, dass ich trotz mehrmaligen studieren Deiner Configs den falschen Dialstring nicht bemerkt habe. Aber Hauptsache es läuft jetzt wie von Dir gewünscht!
 
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.