How to get SIP user status with ARI?

2k views Asked by At

I'm trying to make a realtime application with Asterisk 15 ARI, and I need to get all agents/users (sip) status in queue... I need to know if the user has logged in queue, is on pause, in a call...

I'm reading the Asterisk ARI docs but not found anything about that.

I'm using node-ari-client to watch the Stasis events.

Thanks for u help.

2

There are 2 answers

1
Jerdguez On BEST ANSWER

I think AMI is more adequate for this purpose, as ARI is more suitable to build your dialplan application.

You may use AMI action QueueStatus to see who is logged in, paused, etc. Maybe https://www.npmjs.com/package/asterisk-ami-client will help you to build the client.

2
Kosmo On

ARI allows to get current state of SIP peers via http://localhost:8088/ari/endpoints/SIP

[
  {
    "technology": "SIP",
    "resource": "111",
    "state": "online",
    "channel_ids": []
  },
  {
    "technology": "SIP",
    "resource": "222",
    "state": "offline",
    "channel_ids": []
  },
 {
    "technology": "SIP",
    "resource": "333",
    "state": "unknown",
    "channel_ids": []
  },
]