FritzBox as freepbx trunk

Hello everyone,
I would like to use my fritz!box 6890 as trunk for inbound and outbound calls in a raspbx instance.
The Fritz is behind an ubiquity router/firewall so it’s not on the same subnet.
I think that the firewall is ok because I can register a Cisco SPA504 voip phone and make/receive calls.

With the fritzbox I get registration timeout → no inbound / outbound call is possible.

I cannot figure out why this is appening. Tried all the configurations from this and other forums, but without success.

the current configuration (not working) is very similar to this one:
sip Settings – Outgoing:
Trunk Name: Fritz_chansip_out_XXXXXXXX

PEER Details:
==> username=YYYYYYYYYY
==> fromuser=YYYYYYYYYY
==> type=peer
==> secret=MYPASSWORD
==> qualify=yes
==> insecure=invite
==> host=192.168.178.1
==> fromdomain=fritz.box
==> dtmfmode=rfc2833
==> directmedia=no
==> context=from-trunk

sip Settings – Incoming:
USER Context: (leer lassen)
USER Details: (leer lassen)
Register String: YYYYYYYYYY:[email protected]/YYYYYYYYYY

I believe there is something elesewhere to be modified.

This is the debug:

[2022-09-25 19:11:23] NOTICE[1336]: chan_sip.c:16034 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #15)
Really destroying SIP dialog ‘[email protected]’ Method: REGISTER
Retransmitting #1 (NAT) to 10.0.2.1:5060:
REGISTER sip:10.0.2.1 SIP/2.0
Via: SIP/2.0/UDP 10.0.2.1:5060;branch=z9hG4bK72412511;rport
Max-Forwards: 70
From: sip:[email protected];tag=as6e9fdbdd
To: sip:[email protected]
Call-ID: [email protected]
CSeq: 116 REGISTER
Supported: replaces, timer
User-Agent: FPBX-15.0.23.25(16.21.1)
Expires: 120
Contact: sip:[email protected]:5060
Content-Length: 0

Thanks everyone for the precious help!

The request isn’t reaching the Fritzbox, or its reply is not reaching Asterisk. You need to trace it through the network to find out where it is getting lost.

Unless you arrange otherwise

10.0.2.1

and

192.168.178.1

are mutually un-routable

I really would recommend using PJSIP instead of chan-SIP. Your FreePBX should be in the FritzBox-Network. Your phones should be in FritzBox-Network. You don’t need NAT.
My FritzBox has the IP 192.168.50.1 in this example. The FritzBox is holding the outside PSTN-line.


and this

Very important to know:
You need to create an “IP-Phone” within your FritzBox config, with a named user and a different password. In my case the user is named “linkKeller” and the Password should have 8 digits.
The FreePBX-Trunk is using this user/PW to connect to the FritzBox line.
And you really need a specific context (in my case I named it “custom-get-did-from-sip-linkKeller”.
This context is needed because the FB is not forwarding the DID, so your inbound-route would not react on incomming calls. The context sets a fixed DID.
And also very important to know: The FB reacts quite critical on wrong registering users/PWs / FreePBX-trunks. It increases the block-time each time by doubling. Therefore be patient. I once had to wait one full day until the block was released.

extensions_custom.conf:

[custom-get-did-from-sip-linkKeller]
exten => _.,1,Noop(Fixing DID to [yourPhoneNumber} da DID von FB nur s)
exten => _.,n,Goto(from-trunk,[yourPhoneNumber},1)

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.