Hello everyone,
We are using the AMI for obtaining information about contact statuses from an Asterisk server in a third party application that we are developing. So far, this works fine, however, we noticed that sometimes, no ContactStatus
events will be sent.
After some digging, it turned out that the AMI only emits ContactStatus
events for contacts that already existed when we started the Asterisk service. New contacts that have been added later do not emit any ContactStatus
events, despite working flawlessly and outputting in the console (asterisk -rvvvv
)
Is this a bug? Or can anyone point me to a potential configuration issue?
This is an example when registering/unregistering from a client that has been added after Asterisk has been started:
Output of the console:
-- Removed contact 'sips:74@ip:61406;transport=TLS;ob' from AOR '74' due to shutdown
-- Added contact 'sips:74@ip;transport=TLS;ob' to AOR '74' with expiration of 120 second
Output of AMI:
[nothing]
However, after we restart asterisk or reload pjsip using pjsip reload
Output of the console:
-- Removed contact 'sips:74@ip:61406;transport=TLS;ob' from AOR '74' due to shutdown
-- Added contact 'sips:74@ip;transport=TLS;ob' to AOR '74' with expiration of 120 second
Output of AMI:
Event: ContactStatus
Privilege: system,all
SystemName: asterisk-238
URI: sips:74@ip:61640;transport=TLS;ob
ContactStatus: Removed
AOR: 74
EndpointName: 74
RoundtripUsec: 0
[...]
Event: ContactStatus
Privilege: system,all
SystemName: asterisk-238
URI: sips:74@ip:61653;transport=TLS;ob
ContactStatus: NonQualified
AOR: 74
EndpointName: 74
RoundtripUsec: 0
So as you can see, the AMI works as expected but only after reloading PJSIP, which is not an option to do constantly in production.