Clearing Unavailable PJSIP Registrations


Hoping someone could assist me with this learning curve.

I’d like to know the method for clearing,
Contact: 300/sip:300@;rinstance=15c96aec 753948493a Unavail 0.000
Contact: 300/sip:300@;rinstance=6776be82 6b280600b2 Unavail 0.000
Contact: 300/sip:300@;rinstance=0c890e9a 0142d265d2 Unavail 0.000

I have tried combinations of, database deltree registrar/contact with no joy.

I’ve tried pjsip show aor 300 and used the entire contact string to attempt to delete.
sip:300@;rinstance=15c96aec18b3da6b however it makes no difference.

I see in other posts I can also use remove_existing in pjsip.conf. Is this something I can do from the freepbx gui, or should I enter that in the pjsip_custom.conf as pjsip.conf is overwritten by freepbx.

Would really like a correct procedure for removing the unavail contacts when they occur.

Thank you,

Dynamic contacts are added and removed automatically upon registration, and unregistration. If a contact is not explicitly unregistered, and does not re-register before the given expiration then the dynamic contact is also removed at expiration time.

So either the endpoint (device) needs to explicitly unregister, or you can wait for the registration to “time out”.

If you really don’t want to wait for the “time out” then you should be able to delete them using the following:

*CLI> database deltree registrar/contact

That worked for me at least. Not sure why it didn’t work when you did it. After executing that command what kind of output did it give you? Does a “database show” list the contact?


Oh and remove_existing may or may not help you in this case. That option allows displacement of an existing contact by an incoming one when max_contacts is exceeded.

So if you have max_contacts set to 3 then when a new contact registers the “oldest”, or one set next to expire is essentially removed and the new one added in it’s place. The other two contacts would remain.

Ah, I see. I was trying to delete the one specific unavailable contact and never actually tried,
database deltree registrar/contact

Unfortunately, that appears to delete all available contacts as well. It requires a user reboot or disable/enable soft client, before they receive or make calls. It would be nice if I could just delete an unavailable contact to free up for it to register again. I’m having problems with my Internet provider and the IP is changing frequently so I’m getting blocked for max contacts. Eventually, a phone will register and create the contact again but I’d like to affect as few users as possible.

You should be able to delete an individual entry as well using the following:

*CLI> database del <family> <key>

For instance this worked for me:

*CLI> database del registrar/contact 101;@949152fdbe7da2c56519bf9b4985c047
Database entry removed.

I still have a bit of trouble with this. I get a reply Database entry removed, but pjsip show contacts 300 still lists the unavailable contact
Contact: 300/sip:300@;rinstance=f4431b48 89d1349b9a Unavail 0.000

How do you get this, 101;@949152fdbe7da2c56519bf9b4985c047

pjsip show aors or contact?

Thank you for your help,

I got that from listing out the database contents:

*CLI> database show

Admittedly, I don’t have a lot in the database so was easy to locate the item I needed. For a given item I then used everything up to the “:” as “key” portion when deleting.

After removing it now longer showed in the list of contacts when executing a “pjsip show contacts”. If it’s still there then perhaps you removed the wrong contact, or you have more than one contact registered for it.

That works great!

Thank You!!

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