FritzBox 7490 as trunk (pjsip) outgoing fine, incoming not working

Hi!
I am new to freepbx and I am trying to setup it using a Fritzbox 7490 as trunk with pjsip.
So far outgoing calls are working fine. But when trying an incoming call, nothing happens.
I have to say that:

  • There is a firewall (opnsense) between the FritzBox and freepbx
  • Currently I have a second FritzBox (also behind the firewall and no special settings there) which is using the “outside” Fritz as trunk without any problems (in&out).

as I do not know which settings could be important, I am attaching screenshots of all settings of the trunk. Oh, ping is working fine from freepbx to the external FritzBox…
I hope, somebody knows the problem or at least where to look…
best regards and thanks in advance,
Otto

https://wiki.freepbx.org/display/SUP/Providing+Great+Debug

A log might help.

Do you know if you are reaching the asterisk box with the inbound call?

Hi!
I will provide a log as soon as I am back to the box.
What do you mean with “reaching the asterisk box with the inbound call”?
I can call from one extension to a different one and an external SIP provider also works in and out…

The incoming call from the Fritzbox, does Asterisk “see” the failed attempt, or does it not even reach Asterisk? The log will answer this question anyway.

Ahm… no. there is nothing in the logs when a call is incoming from the Fritz

Well that is telling in itself. It is being blocked on the network or Asterisk firewall level. Is the FreePBX firewall allowing Fritzbox traffic to reach the server?

You might need to monitor via wireshark to see what’s going on between the boxes.

OMG. I did not think about the freepbx firewall :frowning:
I will check! Thanks a lot!

hm, hm… now I disabled the freepbx firewall.
but there is nothing in the full log
only:
pbx*CLI> pjsip show history
No. Timestamp (Dir) Address SIP Message
===== ========== ============================== ===================================
00000 1597943757 * ==> 10.0.0.1:5060 OPTIONS sip:[email protected]:5060 SIP/2.0
00001 1597943757 * <== 10.0.0.1:5060 SIP/2.0 401 Unauthorized
00002 1597943757 * ==> 10.0.0.1:5060 OPTIONS sip:[email protected]:5060 SIP/2.0
00003 1597943757 * <== 10.0.0.1:5060 SIP/2.0 200 OK
00004 1597943817 * ==> 10.0.0.1:5060 OPTIONS sip:[email protected]:5060 SIP/2.0
00005 1597943817 * <== 10.0.0.1:5060 SIP/2.0 401 Unauthorized
00006 1597943817 * ==> 10.0.0.1:5060 OPTIONS sip:[email protected]:5060 SIP/2.0
00007 1597943817 * <== 10.0.0.1:5060 SIP/2.0 200 OK

How can I enable the needed logging?

In the trunk, set Authentication to Outbound. Next, at the CLI type
pjsip set logger on
and confirm that the REGISTER requests have the correct IP address in the Contact header.
If that’s ok see whether anything gets logged on a failing incoming call.

did everything. but nothing to see…
I am getting a little bit desperate tough… :frowning:

you could try a chan_sip trunk instead of pjsip…

EDIT: By the way, what are the settings of the Fritzbox? Did you configure the freePBX-phone-device (Fritzbox settings) to receive ALL incoming calls?

Hi!
hm…
yes, I did. as mentioned, if I use another Fritzbox as client (with the same extension) everything is working fine. in and out…

Interesting…I have several Fritzboxes connected to freePBX servers…either as trunk or as an extension. I just use chan_sip for trunks. If you want I can post my settings here…

Yes, this would be very kind!
I will be able to test them tomorrow evening tough…

Just one more question…did you create an inbound route for your Fritzbox trunk…without an inbound route either with CID or DID, calls will never get through…

I have a any DID any CID route. this should be OK, shouldnt it?

Yes, should be ok. I just realized that I use most of my Fritzboxes as an extension in freePBX. I have one example here, where I connected my Fritzbox through a chan_sip trunk with freePBX. It is a door bell, so I just use it for incoming calls…and it activates a script to create a screenshot of a video camera at the door, which displays it on my cisco phones.
Anyway, it should work with incoming calls on your system…
the register string of the incoming settings is username:[email protected]:port
The context in my case is from-trunk-sip-fritzbox because I have an agi script for the video camera. In your case a context=from-trunk should work, I think…

thanks a lot!
will try this tomorrow evening…

otto?..you are located in Germany right?..if you are in the U.S. you have to change alaw to ulaw…or remove both lines regarding allow/disallow

I am in Austria…
so not in the US…