How to obtain sip call status

Hello
I have a question i’m actually building an application using sip.js base and i wanted to obtain the status of a call for example i have a janusinstance and i want to know if janusinstance is actually calling or not
I searched but i can’t find a good solution
Could anyone help me ?
Thank’s you a lot by advance

You can have sip plugin emit events, and then based on your event handler of choice have this info fed to it.
Otherwise you can query admin API and list all sessions, then for each session query every handle_id and by that know how many streams and details there are about the call

Thanks a lot for your response, but my problem is probably specific because I work with two Janus instances simultaneously.

To explain, I instantiate two Janus instances, one on each server. This allows me to switch between the first or second instance if my primary server goes down or becomes overloaded.

However, I encounter an issue when managing the UI during a call termination. When the other party (presumably using a basic smartphone) hangs up, the event is triggered on both my Janus instances. I’m unsure why this is happening.

Do you have any ideas on how I can achieve a correct result (simply updating the UI with a function)?

Thanks in advance!