No UserAgent in ContactStatus event

We are building a realtime view for the contacts using AMI.

Sending Action: PJSIPShowContacts we trigger asterisk to send Event: ContactList, and using this event we can build a list of all contacts existing at a specific moment.

Event: ContactList
ObjectType:
ObjectName:
ViaAddr:
ViaPort:
QualifyTimeout:
CallId:
RegServer:
PruneOnBoot:
Path:
Endpoint:
AuthenticateQualify:
Uri:
QualifyFrequency:
UserAgent:
ExpirationTime:
OutboundProxy:
Status:
RoundtripUsec:

To maintain this list updated, we use the ContactStatus as it looks its the only event triggered when a contact status changes.

Event: ContactStatus
URI:
ContactStatus:
AOR:
EndpointName:
RoundtripUsec:

As you can see in this event, there are not all the properties found in the ContactList event.
I’m interested in the UserAgent property.

Is there a reason this property is not included in this event ?

ContactStatus is a core event defined in the core. The storage of user agent in PJSIP was added after ContactStatus even existed I believe, so the person likely never thought to add it to ContactStatus. They may have also thought that it wasn’t needed as ContactStatus can occur when OPTIONS fails and succeeds so it would just sending the user agent out each time even though a registration didn’t occur.

In the case of ContactList the list is dynamically generated, there’s no work for a developer besides adding the new field to the Contact elsewhere and defining it exists. Every place then gets updated automatically.

2 Likes

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