Max_contacts, remove_existing, and unavailable contacts

When max_contacts for a PJSIP endpoint is set greater than 1, and remove_existing is set to no, it will ensure that the first endpoints to register to a particular endpoint will not be overwritten by subsequent registrations that exceed max_contacts.

I have run into a problem several times now, especially when my endpoints are behind SonicWALL routers, that the external port for the device will change aggressively, the device will reregister on that new port, and therefore max_contacts will be hit. The funny thing is that all of the existing contacts preventing the registration will not QUALIFY and are UNAVAILABLE. This seems incorrect to me; if a device is attempting to register, and there are no available contact slots, we should remove an unavailable contact to make room for the registration. We know we have a good endpoint on the other line, and are holding a spot for an AWoL endpoint and no-one gets online.

I have submitted a patch to Asterisk to change this behavior, and the developers disagree that this patch is needed or correct.

I’m posting this here so if anyone is interested in seeing that this patch is either merged or discarded should comment on the JIRA issue here:

[ASTERISK-29525] PJSIP remove_existing unavailable contacts - Digium/Asterisk JIRA

Your feedback will be appreciated.

What you propose looks interesting but the reading the comments the main reason to keep this behavior is this

" can’t really delete unavailable contacts if their registration hasn’t timed out yet. They may be temporarily unavailable because of a network issue b.locking OPTIONS requests and come back a short while later. If their registration hasn’t expired, their contact needs to remain in place".

So I think reducing the registration time could help to delete that contact in case it becomes UNAVAILABLE

I suggest try to discuss this on the asterisk-users Info Page , most of the user who use this forum are not developers

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