Where to set max_contacts on trunk via web interface?

I see the log files of our newly set up FreePBX complaining max_contacts is not configured.

Question: I can’t find the place to set that in web front end. Can anyone tell me where to look please?

I’m sure it’s obvious when you know…
In case it’s relevant, ‘Vega’ is a Vega 50 Analog to SIP gateway. Calls are working fine both into and out of FreePBX -> Vega 50 -> Analog lines, but users and customers have both commented on poor quality lines, which is why I looked into the log files and saw this error message. I’m not sure it’s related to the call quality issues (which appear intermittent and for which I need to track down more specific detail) but I figure I should at least solve this message.

I also looked to edit it in the .conf files, but pjsip.aor.conf says ’ Do NOT edit this file as it is auto-generated by FreePBX. ’ & ‘This file was created by the new FreePBX ;
; BMO - Big Module Object.’, so I know that’s not the right solution.

Thanks in advance,

[2016-07-21 11:29:23] WARNING[20600]: res_pjsip_registrar.c:740 registrar_on_rx_request: AOR 'vega' has no configured max_contacts. Endpoint 'vega' unable to register
localhost*CLI> pjsip show aor vega

      Aor:  <Aor..............................................>  <MaxContact>
    Contact:  <Aor/ContactUri............................> <Hash....> <Status> <RTT(ms)..>

      Aor:  vega                                                 0
    Contact:  vega/sip:[email protected]:5060               db76eec5b5 Avail         4.488

 ParameterName        : ParameterValue
 authenticate_qualify : false
 contact              : sip:[email protected]:5060
 default_expiration   : 3600
 mailboxes            :
 max_contacts         : 0
 maximum_expiration   : 7200
 minimum_expiration   : 60
 outbound_proxy       :
 qualify_frequency    : 60
 qualify_timeout      : 3.000000
 remove_existing      : false
 support_path         : false
 voicemail_extension  :

Here it is:


Thanks for looking, but this is for a SIP trunk, rather than an extension. I’m beginning to think it’s missing from the web interface and a bug?

Screenshots of the advanced tab in the trunk settings:

I don’t do PJ-SIP, but I don’t think that max contacts (the number of phones that can be connected at the same time) is something a trunk should do. If you look at the top level Trunk definition, you should see a maximum channel limit, which does make sense, since a trunk is strictly point-to-point, but does allow for many conversations over that single link.

Steve, did you ever find an answer on this? I’m running into the same issue. I have a work-around in place, but it’s kind of cumbersome. I’m hoping for a real fix.

This was never an issue or a problem but not understanding the concept of “Trunks” in FreePBX. The trunks are not designed with the logic that endpoints are connecting to them. In most cases they are designed for outbound registrations so there aren’t any non-static contacts that need to register. The “Inbound Register” logic is that a single endpoint is registering not many.

What are you trying to do that requires this?

1 Like

Thank you for the reply! I’m using an ObiHai 200 unit with three Google Voice terminations on it. I’ve gone through several iterations of configuration methods using first SIP, then PJSIP. For Registration in the PJSIP settings for the trunk, the only way to get outbound and inbound working, Registration had to be set to “None”. Without specifying Max_Contacts greater than 0, the trunk setup doesn’t complete successfully.

I’ve figured out a fix for this, though it involves a little “under the hood” change. First, I was manually changing the pjsip.aor.conf file, adding the “max_contacts” entry and doing an “amportal restart”. I had to do this every time I made a change in the Web GUI. When applying configurations made in the GUI, it rewrites the config files, including pjsip.aor.conf. The file, /var/www/html/admin/modules/core/functions.inc/drivers/PJSip.class.php, is the file that rewrites the configuration files. I searched through the file to find where that aor type is written, and found the following section:

$conf['pjsip.aor.conf'][$tn] = array(
'type' => 'aor',
'qualify_frequency' => $qualify_frequency

I added the max_contacts line under the “type” line, as such:

$conf['pjsip.aor.conf'][$tn] = array(
'type' => 'aor',
'max_contacts' => '2',
'qualify_frequency' => $qualify_frequency

After adding this, I tested it a few times, making some simple changes in the Web GUI and applying them. It worked as I expected, and my pjsip aors are all being created and made available as I would expect. Of course, if the pjsip module or FreePBX gets upgraded, it may overwrite the php file, so I’ll be keeping this documented so I don’t forget. :slight_smile:

I may also add some if/then logic so it’s not added if not needed, but I currently don’t have any scenario where that would be necessary.

I hope this helps anyone else who may have run into this issue.

Trunks don’t meed max_contacts

By extension in advanced,you will find it

Can you please explain why you need Max_Contacts? I don’t use GV but have an OBi110 whose Line port is used as an FXO gateway in FreePBX. I use a simple chan_sip setup (OBi registers to Asterisk) and it works fine for both incoming and outgoing.

Is your OBi on the same network as the PBX? Are you also using its Phone port as an extension? What went wrong with chan_sip? With pjsip Registration Receive? With pjsip Registration None but without Max_Contacts?

There is no may about it, it will be. Again, why do you need to have this?

Like others here, I don’t know why you would need to accept inbound SIP registrations for a trunk. But that aside, we can see there is currently a GUI option for PJSIP trunks to receive registration:

Since max_contacts is required in order to receive a registration and if there is no way in the GUI to set it, please file a feature request to have the parameter added.

The Obi200 is on the same network as the PBX. I’m not using the phone port as an extension. As to what went wrong with chan_sip, it’s been months since I tried using it, but if I recall correctly, it seemed as if registration completed successfully, but I could not get audio in either direction. I verified that it showed up as a sip device using “sip show peers”. After some digging, I found that once a call was placed, inbound OR outbound, the Obi200 would reboot. This was a consistent situation, and I found that many others trying to do this were having the same experience. Eventually, I came upon a suggestion that using PJSIP worked for this configuration. I switched over to PJSIP, at which point I found that when attempting to register, I would get an error indicating that max_contacts was set to zero. Note that I have registration set to “none”, yet this error persists, preventing use of the trunk. Editing the pjsip.aor.conf file to include “max_contacts=1” resolved the registration issue. When registration was set to “receive” or “send”, I had one-way audio in one direction or the other.

Here is a thread from pbxinaflash forums where people discuss this issue:

Waiting for that feature request

Feature Request has been placed. Thank you!

1 Like