Get sip device real time status

We use Asterisk 16 with ARI and SIP endpoints (ip phones and trunks)
We want to get a real time status of the SIP devices - before making a call, check the device status
According to our finding the information in ARI endpoints list is delayed
Is it possible to send a message (/endpoints/sendMessage ) and get the information ?
Any other way to get the the status ? Maybe direct SIP communication with the device ? or Forcing Asterisk to check the devices ?
For example when we run “sip debug on” in the Asterisk CLI the status is updated faster

Any status of the phone known by Asterisk will the result of poling, so will always be delayed. Even if you could poll immediately before making the call, the phone could go offline between the poll and the call, so you still need to handle the failure of the call proper. It is, therefore, generally better to just code to handle the failure.

Also note that qualify takes several seconds to detect a phone is down, so whilst it can avoid discovering a phone is down when you actually call it, the information it provides can be many seconds out of date.

1 Like

In my case its SIP phones and external SIP trunks
Can I reduce the timeout ? the time it take Asterisk to pool the device ?
I thought of forcing Asterisk to send the SIP OPTIONS message using /endpoints/sendMessage

;qualify_frequency=0    ; Interval at which to qualify an AoR via OPTIONS requests.
                        ; (default: "0")
;qualify_timeout=3.0      ; Qualify timeout in fractional seconds (default: "3.0")

or if you have a legacy configuration:

;qualify=1000                    ; Consider it down if it's 1 second to reply
                                 ; Helps with NAT session
                                 ; qualify=yes uses default value
;;qualifyfreq=60                 ; Qualification: How often to check for the host to be up in seconds
				; and reported in milliseconds with sip show settings.
                                ; Set to low value if you use low timeout for NAT of UDP sessions
				; Default: 60

thanks for the quick reply
where do I find those parameters ? can you send a reference where I can read of the usage of those parameters ?

The comments explain the usage of the parameters, and I suspect that that is the most information that is readily available other than looking at the source code for the implementation details.

The parameters are in the relevant channel driver configurations files. If you are not already familiar with these, I would advise reading the sample configurations carefully so you are aware of what is available. The sample configurations are essential documentation for anyone configuring Asterisk directly (and I would suggest they are valuable tor GUI users, even though I don’t think GUIs typically include them). You can also find the latest development versions of them at https://github.com/asterisk/asterisk/tree/master/configs/samples

thanks, that was very helpful

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