Trouble registering. Endpoint exceeds max_contacts

[2022-04-20 13:51:46] WARNING[2073] res_pjsip_registrar.c: Registration attempt from endpoint '301' (43.245. 32.0:1990) to AOR '301' will exceed max contacts of 5

I do not understand this message. I set the value for the extension to 5 but I am only trying to register from my GSWave softphone. Can I explicitly unregister endpoints?

asterisk -x "pjsip show endpoints" | grep 301

You need to look through that list of devices and remove the configuration from them if you don’t want them to register.

I have two physical devices. X301 is configured on only one of them. Why would it somehow get registered 5 times? How do I force it to be unregistered?

The device is a GSWave softphone on Android

I must say, I only used the basic settings for the softphone. Are there any recommended settings for use with freePBX?

Is it registering with the same address and port each time?

Ah. I’ll check the logs but I did notice GSWave has “Random port” turned on.

Yes. It is registering with my IP address but where do I find the port?

I’d expect “pjsip show contacts” to provide that information, although I have a feeling this has been replaced by another command.

According to Asterisk 12 chan_pjsip CLI Specification - Asterisk Project - Asterisk Project Wiki the information should be available from “pjsip show endpoint …”.

So how do I unregister the extension when it reaches the maximum?

Assuming the status of [FREEPBX-16216] PJSIP "remove_existing" endpoint option can not be set in GUI - Sangoma Issue Tracker is correct, you will need to add custom lines to the type=aor section, to set remove_existing to yes.,

Where is that setting. Sorry

The issue says it isn’t accessible through the GUI. The Asterisk documentation for it is:asterisk/pjsip.conf.sample at master · asterisk/asterisk · GitHub

The general way of customising the configuration is given in Best way to add missing GUI configuration options to PJSIP endpoint - #2 by billsimon although I think a slightly different file is needed for an AOR, and I would suggest adding type=aor, after the +.

You might also want to set the max contacts to 1, which I think can be done from the GUI, and just might default to remove existing.

This renders the extension unreachable

The rtp_timeout options were the options that the author of the other post wanted to set; they are not the ones you want to set.

type=aor, as I said, is something that should go after the “+”, not in the body of the settings. Basically the [302] selects the section, the “+” means you are appending to section, and the type would indicate that you were appending to the one of that name that already contained that type setting.

As I said, I suspect that is the wrong file for an aor. If I understand the naming conventions, used by FreePBX, I would expect the file to be called pjsip_aor_custom_post.conf, but I’m really an Asterisk person, not a FreePBX one.

As it says in a more general answer to the question of dealing with options missing from the GUI (Change PJSIP settings - #4 by lgaetz), you need to change the appropriate file. I didn’t use that example because the example I used was more concrete, but it still has to be treated as an example of general principles, not something to be copied blindly. The other option listed there has already been used, as there is an issue requesting the addition of the option.

All very confusing.

I would fix this on the softphone.

The “unregister before new registration” setting would probably help (image stolen from onsip.com support section):

Try toggling that setting. I don’t use this software so I don’t know. I’m just trying to help you avoid editing custom files on FreePBX.

1 Like

So your saying it should be set to “Do not unregister”?

And, what about on the Yealink?

No, I’m saying try some alternate settings on the softphone until it works properly. If you can’t figure out GSWave then use Sangoma Connect which handles the provisioning for you.

[302](+type=aor)

And remove the type parameter she value below that

[302](+type=aor)
remove_existing=yes

Like that?