pipobscure / NodeJS-AsteriskManager

NodeJS Asterisk Manager API
Other
249 stars 103 forks source link

support for 'autherror' event #74

Open micodix opened 2 years ago

micodix commented 2 years 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.