I’m setting up a FreePBX system integrated with a FRITZ!Box to handle incoming and outgoing calls. My goal is to play a welcome message and then route incoming calls to a single extension or all extensions connected to the FRITZ!Box (both IP and analog devices).
Current Setup:
I’ve configured a PJSIP trunk between FreePBX and the FRITZ!Box, and it successfully handles incoming calls.
I’ve created a welcome message using Announcements in FreePBX, which plays correctly when a call is received.
I can successfully route calls to an extension configured on FreePBX, but I cannot route calls to a single extension (e.g., **610) or to all extensions (e.g., **9) on the FRITZ!Box.
Question:
How can I configure FreePBX to route calls, after the welcome message, to a single extension or all extensions on the FRITZ!Box (e.g., by using the code **610 for a specific extension or **9 for all extensions)?
Current Configuration:
FreePBX Version: 17
Asterisk Version: 21.6.0
SIP Trunk: Configured with the FRITZ!Box extension credentials.
Welcome Announcement: Created via Announcements and linked to an Inbound Route.
What I’ve Tried So Far:
I configured a Misc Destination with the value **610 and another one with **9, but neither seems to work.
I verified that the FRITZ!Box accepts calls routed to individual extensions (**610, **620) and to the group (**9), but FreePBX doesn’t seem to route the call properly through the trunk.
Any advice or guidance on how to properly configure FreePBX to route calls to a single extension or all FRITZ!Box extensions would be greatly appreciated.
Why dont you use multiple sip-trunks/extensions in freePBX for every Fritz!box extension (analog, ISDN, DECT)?
EDIT: Where is your outside line coming from?
The main challenge is that FRITZ!Box extensions (analog, ISDN, DECT) are not designed to behave like independent SIP accounts that can be registered individually in FreePBX. The FRITZ!Box essentially manages these extensions internally and does not expose them as separate SIP trunks or accounts. This is why a single SIP trunk is configured between FreePBX and the FRITZ!Box, allowing FreePBX to communicate with the FRITZ!Box for both inbound and outbound calls.
Additionally, FRITZ!Box extensions are primarily intended for direct use with endpoints like analog phones, DECT handsets, or devices registered directly to the FRITZ!Box. For example, if I configure an internal number on the FRITZ!Box (like **610), it can’t be registered separately on FreePBX or a softphone. This means that FreePBX can route calls to the FRITZ!Box, but the handling of those calls to the individual extensions (e.g., **610, **620) remains the FRITZ!Box’s responsibility.
Answer to Your Question:
My outside line comes directly from the provider and is managed by the FRITZ!Box, which is why the FRITZ!Box acts as the intermediary between the external line and FreePBX. FreePBX connects to the FRITZ!Box using a PJSIP trunk to route calls in both directions.
What I’m Trying to Achieve:
I have successfully routed calls to extensions on FreePBX.
However, I’m struggling to route calls to specific FRITZ!Box extensions (e.g., **610) or a group of extensions (e.g., **9 for all extensions).
If you have any guidance on how to accomplish this with my current setup, I’d greatly appreciate it!
Actually, a FritzBox can do exactly that. I have been using several Fritz!boxes as an analog/DECT-SIP-converter. I add some screenshots, but unfortunately the GUI is german. I have an analog-door-intercom module (Auerswald) which is connected to the Fritzbox through the phone-port and a DECT-phone, extension numbers 30 (**2) and 16 (**610). I created SIP-Trunks to the freePBX server with these numbers in the Fritzbox (outgoing numbers). They match the extension 30 and 16 in freePBX. The Fritzbox can handle up to 8 calls simultaneously (keep in mind…that’s the limit ;). You have to add rules for each phone (Fritzbox) that it only rings, if the call comes in through a defined trunk (30 or 16).
On my system, the external line is a pjsip trunk on the freePBX server. But maybe, if you already have a working external line on the Fritzbox, it would work too. So…except for the external line, I have identical setups…and they work!
You should also migrate your existing SIP-phones from the Fritzbox to freePBX. freePBX is a powerful phone system, the Fritzbox is a great product for everything…internetmodem, router, small pbx, smart home center…a german made (designed) all-rounder…but freePBX is the right choice, when it comes to phone calls.
You would also increase the audio quality, if you switch from a copper cable line to a SIP-trunk (freePBX)…if not already done so. In Germany/Austria the g722 codec is standard…not ulaw/alaw.
If I were you…I would first create a backup of your Fritzbox settings and try the new configuration. So you always can go back.
One more thing…I think the reason, why you cannot route calls from freePBX to Fritzbox extensions (without a separate sip extension trunk) is that freePBX cannot use “**” for extension/group numbers…but I might be wrong…
EDIT: You would have to go to Admin>Feature Codes and adjust the settings for “**”.
EDIT2: @matteo86 are you still here?
You would have to deactivate the feature code for directed call pickup, otherwise you can not route calls to **XXX numbers.
"I tried what you suggested, but unfortunately, it still doesn’t work.
The issue, in my opinion, is that the incoming call is first received by the FRITZ!Box and then passed to all registered extensions, including the FreePBX server. Since FreePBX is also one of the extensions, it picks up the call. However, for the FRITZ!Box to transfer the call to other extensions, it requires specific manual actions:
Pressing the “R” button on the phone during the call.
Dialing ** followed by the internal extension number (e.g., **610).
For a direct transfer, dialing *4 from a DECT phone or R4 from other phones.
If I want to consult the other extension before transferring, I need to wait for the second extension to answer, then either transfer the call as described or return to the first caller by pressing R1.
It looks like the FreePBX is trying to send the call directly to **XXX without an intermediary step.
Here’s the FRITZ!Box guide that explains the manual transfer process:
Do you have any ideas on how to automate this process via FreePBX?"
Your setup is too complicated. You have to create sip-extensions for every analog/DECT phone (in freePBX), which is connected to the Fritzbox. In the Fritzbox you create external numbers (Sip-Trunks), which match the extension numbers/credentials.
I added the screenshots above. They are in german, but you will find the relevant settings.
This is describing a process for analogue phone lines, not for VoIP.
Asterisk can emulate an analogue phone, but it requires expensive hardware, and this sounds like a home automation project.
FreePBX doesn’t support passing a transfer request back upstream, without custom dialplan (Transfer application). It can’t do attended transfers in this way, at all, and for blind transfers, it would use SIP REFER, not emulate a recall button, in any way.
@Charles_Darwin Thanks for your detailed explanation, and also thanks to @David55 for the insights on how FreePBX handles SIP transfers.
I followed your suggested approach to set up SIP extensions for each analog/DECT phone connected to the FRITZ!Box, treating them as external SIP numbers (trunks) in the FRITZ!Box and corresponding SIP extensions in FreePBX.
Current Issue:
The SIP number in the FRITZ!Box does not register (no green dot next to it).
What I Did:
1. Configured a new SIP number in FRITZ!Box (“Propri Numeri”)
Provider:SIP Trunking
Registration number:620
Internal number in the FRITZ!Box:620
Username:620
Authentication Username:620
Password: (same as FreePBX)
Registrar:FreePBX IP:5060
Proxy Server: (empty)
Outbound Proxy: (empty)
2. Created a PJSIP Extension in FreePBX
User Extension:620
Display Name:Phone Office
Secret (Password): (same as FRITZ!Box)
Max Contacts:2
Rewrite Contact:Yes
RTP Symmetric:Yes
3. Created a PJSIP Trunk in FreePBX
Trunk Name:F-620
Outbound CallerID620
PJSIP Settings:
SIP Server:FRITZ!Box IP
SIP Server Port:5060
Username:620
Password: (same as FRITZ!Box)
Context:from-internal
4. Created an Outbound Route in FreePBX
Trunk Sequence:F-620
Dial Patterns:6XX
I’d appreciate any guidance on why the SIP number does not register and how this further.
EDIT: All phones should be registered as extensions in freePBX. In this scenario the Fritzbox is just an analog/SIP gateway. But you still need a separate outbound trunk from freePBX to the Fritzbox…to be able to call somebody outside of your location. So the dial pattern for the outgoing trunk should match the outgoing pattern, not the 6XX.
EDIT2: You can use any extension number in freePBX. 620 is not required. If you want to make an internal call, you just dial the freePBX extension number. The routing from the 620 phone to the Fritzbox-freePBX-pjsip-extension is done within the Fritzbox. You can create a Fritzbox rule that 620 always uses the SIP-trunk e.g. 30 for incoming and outgoing calls.
Could you please check if 5060 is the correct port in freePBX? Go to Asterisk-Sip-settings > Sip-settings(chan-pjsip)
What does it say in UDP port-to-listen-on? 5060?
EDIT: Could you please stop by more often…I am already at a certain age and if a conversation takes that long…I simply forget what we already discussed
For incoming calls in freePBX you can create an announcement or an IVR or a ring group…the possibilities are endless…
I have a similar setup except for the outbound trunk. My freePBX servers use a sip-trunk to the outside world! But theoretically the scenario above should work too. I am just not sure, if the outbound-trunk from freePBX to the Fritzbox can be routed to the outbound-line of the Fritzbox.