Yet another PJSIP NAT question

Brand new SNG7 1910 setup with all current updates as of today, including to Asterisk (13.29.2)

PBX has public IP and is NOT behind NAT. Extension is behind NAT. Registration goes to PBX but Asterisk is using the private IP of the device and not the public IP.

[2020-01-15 04:05:59] VERBOSE[27198] res_pjsip_registrar.c: Added contact 'sip:[email protected]' to AOR '201' with expiration of 3600 seconds
[2020-01-15 04:06:02] VERBOSE[16326] res_pjsip/pjsip_options.c: Contact 201/sip:[email protected] is now Unreachable. RTT: 0.000 msec

Of the many FreePBX setups I’ve done, this is the first time I’m seeing this behavior, and I checked other systems and I see no settings set differently. The External IP is correct, and the local networks setting is blank (as there are no local endpoints).

What am I missing here?

OK, I found it.

It seems that the behavior of new PJSIP extension creation changed at some point recently, as new PJSIP extensions used to have Rewrite Contact enabled by default, and now it isn’t.

Is there a way to make this enabled by default for new extension creation?

I don’t know the answer for sure, but I would check the “Advanced Settings” module. There is a SIP NAT setting which I believe is the default extensions module setting for the NAT= field for Chan_SIP extensions, but I would be surprised at all if it also did the equivalent field in pjsip extensions.

EDIT: There actually may be a separate field in Advanced Settings for your field. I have disabled pjsip in my installation and so I might not be able to see it!

This appears to be a serious bug. Updated all modules including Framework 15.0.16.40 and Core 15.0.9.64 yet new extensions have Rewrite Contact = No, even with SIP nat set to yes.

Did you check to see if there is a “PJSIP rewrite contact” field in advanced settings?

I can confirm on the latest versions of core and framework this setting is automatically being set to No for all (new) extensions. This completely breaks core system functionality of PJSIP extensions / trunks which have worked well at rewrite_contact=yes.

There is a JIRA issue (completed):
https://issues.freepbx.org/browse/FREEPBX-18699

FPBX Team has changed the value to no because Asterisk has no as default value.

Additionally there is no way at the moment to adjust the default value which is set by FreePBX. Only manually from Advanced settings of an extension. (maybe also from the bulk handler?)

The change was only supposed to affect trunks, not extensions.

Trunks should NOT default to having rewrite contact set to Yes.

But for extensions, it’s a reasonable choice.

1 Like

Agreed. It was only supposed to affect trunks…
I just took a look to the changes on source code:

I have a couple of big questions to FreePBX dev team regarding the quality of QA and code logic the last time…

btw this also affects freepbx v14 as well v15

Confirmed, FREEPBX-18699 should have applied to trunks only. Starting in Core module versions 14.0.28.29 and 15.0.9.56 (both of which are now in stable repo) the rewrite_contact param is disabled for all pjsip contacts by default. I have an internal ticket to deal with this.

Sorry, I didn’t see your update here and reopened the ticket (actually cloned it because I screwed up in JIRA). https://issues.freepbx.org/browse/FREEPBX-21031

@lgaetz I beleive 2x human error, dev team + testing team? :stuck_out_tongue:

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