pipobscure / NodeJS-AsteriskManager

NodeJS Asterisk Manager API
Other
246 stars 102 forks source link

support for 'autherror' event #74

Open micodix opened 1 year ago

micodix commented 1 year ago

This adds support for a new 'autherror' event. It will be triggered as soon as the authentication to the AMI using the Login action fails.

Motivation: If the connection to the AMI is closed, it is not necessarily clear that it is due to a failed authentication. This can currently only be determined via the action response in a 'response' event. However, it is not obvious to listen for this event to notice the authentication failure and it's not an efficient / reliable solution to check all AMI responses for a specific error message.