Best way to pull Reg.Contact Information

Hi ,

Can someone suggest a way to store and update information of all peers in seperate mysql database without using realtime asterisk. Now I am able to see contact information when I type command “sip show peer xxxx” for a specific peer.

Where can I get Reg.Contact information for all peers at once and store it mysql database . astdb.sqlite3 is storing peer information in SIP/Registry key temporarily when a peer comes on line but it clears the entry as soon as peer goes offline . I want to have persistent entries somewhere and keep updating it when changes happen. Can I save information using AMI event listener . I found only basic information like below without contact information.
Event: PeerStatus
Privilege: system,all
SequenceNumber: 75
File: manager.c
Line: 1856
Func: manager_default_msg_cb
ChannelType: SIP
Peer: SIP/2030
PeerStatus: Reachable

I am not sure the motivation but you could turn off SIP qualify setting so at least Asterisk never takes the peer offline due to network hiccups - it would require the peer to specifically un-register, or re-register with a new IP/port eg. when you reboot the phone.

To log more permanently, you could look into the mysql AFTER INSERT trigger command, to stuff those updates into a separate audit/log table.

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