Need help, should work but doesn't

This is my setup.

New installed Raspbx (asterisk 18, freepbx 15) running on a raspberry pi 3b+
PBX located in my DMZ network
Useing a Pfsesne firewall
Port forward 5060-5061 and 10000-20000 to the PBX
Open SIP and RTP ports to and from internal network as well as DMZ
Outbound NAT with statci port for PBX
2 software phones (computer and my phone) on two seperated internal networks

The issue:
My phones can call each other, communication is esablished and sounds goes through in both direction.
When I try to call my friend on his Voip phone behind his PBX usein “extension@domain”. The call goes to him, communication is established but he can only hear me, i cant hear him.
if he tries to call me, my phone never ring.
looking at tcpdump on the my pbx i can see a INVITE is being recieved, but nothing happens after that, its like it never sends a reply back or pass on the invite the my internal phones.
Did a strace for asterisk process and it does nothing when my firend calls me, it should be spewing lines of code if someone called, which it does it its a internal call.

Ive been scratching my head to figure this out for a week now and im at my wits end.
Could use some help fixing this.

DejaVu or perhaps VujaDe :wink:

At the Asterisk CLI,

rtp set debug on

It will likely show what asterisk sees as far as media streams are concerned, and help you identify what part of your network is misbehaving (and under what conditions…)

do that, make a failing call and post a snippet from the log.

Okey do i turned RTP debug on and i saw nothing when my firend called. I turned SIP debug on and saw nothing as well.
I tailed /var/log/asterisk/full and nothing there either.
Did i tcpdump and the only thing i noticed was the following line but nothing else happened:
20:31:47.638729 IP “my_friendsIP”.50080 > “my_PBX_IP”.sip: SIP: INVITE sip:“my_extension”@“my_domain” SIP/2.0

Asterisk does not in general handle such calls properly. Some users have posted configurations to make it work, though I have no experience with them. There is not much community interest, because it’s difficult to dial that way on most IP phones, and impossible on analog phones.

Consider one of these workarounds:

  1. Set up a pjsip extension for your friend, e.g. extension 1234. Change the Dial setting to
    pjsip/1234/sip:extension@domain
    Then, dialing 1234 should ring your friend. If that doesn’t help, confirm that in Asterisk SIP Settings, External Address and Local Networks are correctly set. If you change these, after Submit and Apply Config, you must restart Asterisk. If you still have trouble, at the Asterisk command prompt type
    pjsip set logger on
    paste the Asterisk log for a failing call at pastebin.freepbx.org and post the link here.

  2. Configure a trunk to your friend’s PBX. Set up an Outbound Route where a prefix e.g. 999 uses that trunk. Then, dial 9992345 to reach extension 2345 on your friend’s system.

Then you have a lower level network problem you need to fix. Your SIP service needs to be listening on the same port your friend is sending stuff to

Then i dont know what it could be.
My firewall does port forward SIP and RTP to PBX, thats verified by running package caputre on my firewall and looking at the firewall log.
I also see SIP traffic (INVITE) on SIP port reaching my PBX, verified by useing tcpdump.
According to netstat on PBX its listening on tcp/udp on 0.0.0.0.0 for port 5060-5061 and 10000:20000

Traffic do flow to my PBX but its like it wont listen on incomeing external calls. Internal works fine and my friend have the exact same setup adn firewall rules. The exception is that he runs freepbx on a server on a voip internal network with his phones, while i run raspbx on a dmz network and my phones are on a seperate internal network.

Maybe try using sngrep it is less confusing, but should identify SIP calls coming to the outside of your firewall, what you do with the attempted connections is up to you though :wink:

Ohhh thats very handy.
This is what happens in my PBX when my friend calls me.

Then cursor down to an invite and identify why it fails in greater detail.

(I’m pretty sure you are not listening on 50080 though)

It doesnt say more than this, the call is still registered as “call setup”

Every entry there is identical when im cursor down

50080 is my friends port on his phone, it goes to my pbx on port 5060.
192.160.0.25 is my friends pbx and .50 his phone.

If it did, there would be a reply from your server,

I would agree, but there is nothing more than this.

when i did a internal call it looked like this and it works:

Exactly, you need to fix your network so it accepts incoming invites.

okey, so how do i make the pbx accept incomeing invites?
isnt “Allow Anonymous Inbound SIP Calls” and “Allow SIP Guests” set to yes exactly that?

Only if you are listening on the port that the inbound connection is requesting (You are apparently not) . Anonymous and Guest calls are rarely a good thing but also immaterial in this particular context.

Im very confused.
how can asterisk listen on a port which its already are?
My PBX/asterisk do listen on the incomeing port 5060 since it do recieve the invites from my friend, but it does nothing with it, it never reply nor send the invite to my phone.

Please show the log line from Asterisk, itself, showing that it has received the request. The sngrep(?) only shows that the machine received it, not that anything on that machine accepted ti.

Welcome ot the party david55.

As I said before, i turned on “rtp”, “sip”, “pjsip” logger before and nothing showed up from my friend calling my. stuff to show up when i make internal calls.
Its like asterisk simply drops external calls.
This cant be a network issue since the package reaches the PBX, this must be a application issu.

Please understand that if nothing is reaching your Asterisk, it is NOT any application apart from your firewall or the way you have configured Asterisk \s SIP channels. RTP will only show after a call is in progress, Chan_sip or chan_pjsip will only service Sessions Initiated to a port they are listening on.

I understand.
I have now effectivly disabled my firewall, I deleted every rule and left a single one for each network which allows anything.
I port forward any source on any protocal which tries to reach port 5060-5061 and 10000-20000 to my PBX.
I have a static outbound nat for my PBX on any port and any protocal.
Its still not working and its the same issue that i have descibed in this topic.
Since i cant make the firewall any more stupid that it is now, it cant be the firewall which is the issue.
Since external calls can send a invite to my PBX/asterisk but nothing else happens, then the fault have to be in the PBX/asterisk and not in my network. or would you disagree?
so it cant be my firewall nor network. what else is it but asterisk/freepbx issue?