pipobscure / NodeJS-AsteriskManager

NodeJS Asterisk Manager API
Other
246 stars 102 forks source link

Bugfix in ManagerEvent function. #61

Closed davibaltar closed 3 years ago

davibaltar commented 5 years ago

At times when the queue grows too large, the 'event.response' parameter at line 180 of the 'ami.js' file receives a string vector instead of a string. This causes the module to be aborted at the time of the 'event.response.toLowerCase ()'. The fix ensures that always a string in the 'event.response' and avoids the error: 'TypeError: event.response.toLowerCase is not a function', where: event.response = ["Success", "Success"]

After correction, if 'event.response' receives a string vector, it is ignored, not affecting module operation.