I have been going through the events when a call is placed over a pjsip extension and I am getting events from DeviceStateChange, PeerStatus and ContactStatus. The events are mostly similar and kind of duplicate. So just wondering whats the difference between these three entities so that best one for my use case can be selected.
I don’t see a lot of redundancy here, but that depends on what one is interested in. An endpoint is neither a contact nor a device and sometimes the difference matters and sometimes not. For example, you could easily move an endpoint to a different device and that generally means a different AOR and contact. I needed some time to get used to this level of abstraction…
Device State is technology independent. Contact status and peer status only have meaning for SIP and may well only be implemented for chan_pjsip. It looks to me as though device states are the only ones that change during a normal call.
Thanks for the replies. I am mostly interested to know when a SIP phone goes offline [unavailable] because of network issues. Which entity would be most appropriate?
Their essentially all degenerate. I’d suggest looking at them in the order device, peer, contact, and use the first one that provides the information you need, as that order should be most general to most specific, and, for example device will tell you if non-VoIP devices have become unusable, e.g. because of an alarm on an ISDN link.
I would assume that peer and device would not show a fault if only one of multiple contacts was lost, but it looks like you need contact to see the round trip time.