FreePBX 17 PJSIP Trunk to FreePBX 16 (Asterisk 18) Shows UP but Calls Fail with “Service Unavailable”

I’m facing an interoperability issue between two FreePBX servers.

Setup:

Source Server: FreePBX 17

Destination Server: FreePBX 16 running Asterisk 18

Issue:

When creating a PJSIP trunk from FreePBX 17 to FreePBX 16, the trunk shows as Reachable/UP, but outbound calls fail with “Service Unavailable”.

On the FreePBX 16 side, Asterisk 18 appears to reject the INVITEs during call attempts.

What I Tested:

Created trunk without authentication → same issue

Created trunk with authentication → same issue

Registration status becomes successful in both cases

Problem only occurs during call setup

Observed Behavior:

OPTIONS qualify works correctly

INVITE requests are rejected by the FreePBX 16/Asterisk 18 server

Calls never establish

Has anyone experienced compatibility issues between FreePBX 17 and FreePBX 16 PJSIP trunks, especially with Asterisk 18?

Any guidance on required PJSIP settings, endpoint identification, codecs, or security/auth matching would be appreciated.

Set verbosity to 3 on the full log, test a call, and on the end that is sending the 503, read the full log

172.16.100.88 windows machine with microsip with registered extension 999 dials 911 on 172.16.10.17

172.16.107.244 is the Freepbx 17 with asterisk 22 trunk with asterisk 11 in this case.

1 INVITE [email protected] [email protected] 8 172.16.100.88:56539 172.16.107.244:5090 REJECTED
2 OPTIONS [email protected] [email protected] 2 172.16.107.244:5090 172.16.100.88:56539

                                       Call flow for d928c8f80b5b4ba68a07c15d2effe2bd (Color by Request/Response)
                                                    xINVITE sip:[email protected]:5090 SIP/2.0
   172.16.100.88:56539           172.16.107.244:5090xVia: SIP/2.0/UDP 172.16.100.88:56539;rport;branch=z9hG4bKPj51cbfb64cfbd416ab9be38dec3ec21f3
  qqqqqqqqqqwqqqqqqqqq          qqqqqqqqqqwqqqqqqqqqxMax-Forwards: 70

13:49:45.591601 x INVITE (SDP) x xFrom: “999” sip:[email protected];tag=30ceacf91cd743b78c5517784f77119e
+0.001252 x qqqqqqqqqqqqqqqqqqqqqqqqqq> x xTo: sip:[email protected]
13:49:45.592853 x 401 Unauthorized x xContact: “999” sip:[email protected]:56539;ob
+0.003150 x <qqqqqqqqqqqqqqqqqqqqqqqqqq x xCall-ID: d928c8f80b5b4ba68a07c15d2effe2bd
13:49:45.596003 x ACK x xCSeq: 19260 INVITE
+0.000083 x qqqqqqqqqqqqqqqqqqqqqqqqqq> x xAllow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
13:49:45.596086 x INVITE (SDP) x xSupported: replaces, 100rel, timer, norefersub
+0.005568 x qqqqqqqqqqqqqqqqqqqqqqqqqq> x xSession-Expires: 1800
13:49:45.601654 x 100 Trying x xMin-SE: 90
+0.442304 x <qqqqqqqqqqqqqqqqqqqqqqqqqq x xUser-Agent: MicroSIP/3.22.3
13:49:46.043958 x 183 Session Progress (SDP) x xContent-Type: application/sdp
+3.973036 x <qqqqqqqqqqqqqqqqqqqqqqqqqq x xContent-Length: 343
13:49:50.016994 x 503 Service Unavailable x x
+0.010744 x <qqqqqqqqqqqqqqqqqqqqqqqqqq x xv=0
13:49:50.027738 x ACK x xo=- 3987269386 3987269386 IN IP4 172.16.100.88
x qqqqqqqqqqqqqqqqqqqqqqqqqq> x xs=pjmedia
x x xb=AS:84
x x xt=0 0
x x xa=X-nat:0
x x xm=audio 4018 RTP/AVP 8 0 101
x x xc=IN IP4 172.16.100.88
x x xb=TIAS:64000
x x xa=rtcp:4019 IN IP4 172.16.100.88
x x xa=sendrecv
x x xa=rtpmap:8 PCMA/8000
x x xa=rtpmap:0 PCMU/8000
x x xa=rtpmap:101 telephone-event/8000
x x xa=fmtp:101 0-16
x x xa=ssrc:1376395821 cname:3afc2c7b17082d70

PJSIP Server

SIP server with Asterisk 11

Not sure on sip trunk details but disallow=all seems strange. Did you look at the full log like I suggested to see why the call is rejected?

disallow=all is highly desirable. Without it, all codecs are enabled (and the allow is unnecessary). Having all codecs enabled can cause problems, including with over long packets.

There are some questionable setting, which indicate copy and paste coding (and possibly a failure to adequately describe the network configuration), and they really shouldn’t be using chan_sip, if they want good support here, but none of these are the cause of their problem.

If the allow comes after the disallow, which it does, that is correct.

Also we need to see a proper SIP trace from the system using PJSIP and is rejecting the call. Showing it from the microsip side on the other PBX doesn’t tell us what the receiving PBX is doing with the call.

No need to make it complicated. A sip trace likely won’t tell us anything, they already said they’re getting a 503. They need to enable verbose logging and look at the full log to see WHY the 503 is being sent.

I get this working pjsip to pjsip trunk using Intra route option from the outbound routes

Now I have to make something like for local calls it use intra and for US calls it should use it without infra