How to clean contacts when using realtime pjsip?

Hi,
I am having some dead contacts on my asterisk server.
I tried to use database deltree, but it does not work

ip-121-12-12-12*CLI> database deltree registrar/contact
Database entries do not exist.

My server is set up with real-time pjsip
https://wiki.asterisk.org/wiki/display/AST/Setting+up+PJSIP+Realtime

I confirm that in my MySQL database, ps_contacts table is clean.
However, when I do pjsip show contacts, it still have the dead contacts inside.

ip-121-12-12-12*CLI> pjsip show contacts

Contact: <Aor/ContactUri…> <Hash…> <RTT(ms)…>

Contact: camerasiptest3/sip:camerasiptest3@112.12.12.12: 77665cbae4 NonQual nan
Contact: camerasiptest3/sip:camerasiptest3@112.12.12.12: bd850979db NonQual nan
Contact: camerasiptest3/sip:camerasiptest3@91.12.123.12 7199d148ea NonQual nan
Contact: camerasiptest4/sip:camerasiptest4@112.12.12.12: 4d6e18b8b8 NonQual nan
Contact: camerasiptest4/sip:camerasiptest4@91.12.123.12 56fa199329 NonQual nan
Contact: camerasiptest5/sip:camerasiptest5@112.12.12.12: 762a9d06eb NonQual nan
Contact: camerasiptest5/sip:camerasiptest5@91.12.123.12 05ad61e798 NonQual nan

Objects found: 7

I also has a sorcery setting

[test_sorcery_section]

test=memory

[test_sorcery_cache]

test/cache=test

test=memory
[res_pjsip]

endpoint=realtime,ps_endpoints

auth=realtime,ps_auths

aor=realtime,ps_aors

domain_alias=realtime,ps_domain_aliases

contact=realtime,ps_contacts

I’m guessing those are static contacts you have defined in your pjsip.conf, or realtime ps_aors table. Do a select on your ps_aors table and see what’s defined for the “contact” field(s).

Static contacts by their nature remain until no longer defined in the configuration.

Thanks.
I found the problem, it was my stupid mistake. :frowning: I looked into the wrong database for another asterisk server. Could I delete this post?

To delete a post I believe you can select the ‘…’ button (show more) and select the trash can icon (delete this post).

However it doesn’t hurt to leave it and who knows someone else may find it useful later. They might even be clued in to see if they too are looking at the wrong place :slight_smile: