Get and put asterisk ari device status

get and put asterisk ari device status, via API;s

curl -v -u your_username:your_password http://your_asterisk_server:8088/ari/endpoints

I already tried this method, but it is not working

You have provided nowhere near enough information. You need to show and describe what you actually tried, what you expected the outcome to be, and what actually happened.

i want to get device status like busy incall dnd via ARI GET API, and want to set Status of a device(extension) via ARI API

You can retrieve the device state of any endpoint, just like you can from the dialplan. You can NOT set the device status of an explicit endpoint. They are managed by each channel driver themselves. You can only set a custom device state which is different and then up to you to use.

how can i retrieve a device state via ARI api on SIP, and how can i set custom device status.

https://docs.asterisk.org/Asterisk_20_Documentation/API_Documentation/Asterisk_REST_Interface/Devicestates_REST_API/

Getting

{
“message”: “Uncontrolled device specified”
}

while suing PUT API in deviceStates

Are you trying to change the device state of a PJSIP endpoint, for example? If so then you can’t as I previously stated. If you aren’t then you need to always show what exactly you are doing. Not just show the result. Showing only the result means we all have to guess, sometimes we guess wrong, sometimes we guess right.

I AM using this API

curl -X PUT
-H “Content-Type: application/json”
-d ‘{“state”: “INUSE”}’
-u ARI:password
http://IP:PORT/ari/deviceStates/PJSIP%2F1001

getting error
“message”: “Uncontrolled device specified”

as you replyed , can I get deviceStates in “SIP” ?

You can get the device state of a PJSIP endpoint. You CAN NOT control it.

according to Official Documentation, we can change it by PUT Request

PUT /deviceStates/{deviceName} void Change the state of a device controlled by ARI. (Note - implicitly creates the device state).

“Change the state of a device controlled by ARI.”

PJSIP endpoints are controlled by PJSIP, not by ARI.

You can only control devices created by ARI, passing in “Stasis:test” for example would create a device named “Stasis:test” and allow controlling it.

Thanks

Is there any other way to get and control extension States .

Device states of channel drivers such as PJSIP are controlled by that channel driver. There is no other way around it, they control them and determine what their value is.

How can i use Stasis App in asterisk , Guide me from skretch Step by step

I want to Use Stasis App in Ari to manage endpoint State.

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