3
votes

I am running Asterisk 11 and using MySQL realtime. I've used FreePBX previously, and it shows all details how many users are registered in realtime. I can check a user registration if I type show peer username on Asterisk CLI. However, I would like to know whether a specific user has registered SIP server or not in realtime.

Example

UserA - registered
UserB - unregistered
UserC - registered

I checked sip_buddies table in MySQL, and it only shows regseconds. I couldn't figure out whether a user is registered or not with this information. Does anyone how to check user's registration in realtime?

2
Also consider using the Digium forums and IRC to get useful/specific feedback quickly. SO is great for a lot of things, but Asterisk feedback is not one of them.kmarks2

2 Answers

1
votes

This is not the specific answer, but is a relevant solution to different Asterisk setups. Some deployments use openSIPS as a clients registration proxy (it's better than the baked in SIP capabilities of Asterisk, even with the new pjsip stack). In this case "sip show peers" will be empty. In that case you can use the Management Interface via the opensipsctl application. opensipsctl ul show on the proxy will show all clients registered to the proxy.

1
votes

You have 3 options

1) (bad one) do command "sip show peers" (rtcachefriends has to be set to yes)

2) (better one) create an event listener, which will listen for an event via AMI and store that info.

3) (db variant) Set

rtupdate=yes
rtautoclear=yes

and check in db registration time. Downside - a lot of db writes.