asterisk / node-ari-client

Node.js client for ARI. This library is best effort with limited support.
Other
250 stars 98 forks source link

Error with Asterisk 14.7.0-rc1 #98

Closed jaunis closed 6 years ago

jaunis commented 6 years ago

The node-ari-client library is not working any more with Asterisk 14.7.0-rc1. It is failing during initialization with the following error :

SyntaxError: Unexpected end of input
    at Object.parse (native)
    at Object.obj.on.response (/usr/lib/node_modules/ari-client/node_modules/swagger-client/lib/swagger.js:136:44)
    at EventEmitter.res.response (/usr/lib/node_modules/ari-client/node_modules/swagger-client/lib/swagger.js:1309:19)
    at emitOne (events.js:77:13)
    at EventEmitter.emit (events.js:169:7)
    at emit (/usr/lib/node_modules/ari-client/node_modules/swagger-client/node_modules/shred/lib/shred/request.js:457:21)
    at /usr/lib/node_modules/ari-client/node_modules/swagger-client/node_modules/shred/lib/shred/request.js:477:9
    at setBodyAndFinish (/usr/lib/node_modules/ari-client/node_modules/swagger-client/node_modules/shred/lib/shred/response.js:103:7)
    at IncomingMessage.<anonymous> (/usr/lib/node_modules/ari-client/node_modules/swagger-client/node_modules/shred/lib/shred/response.js:120:7)
    at emitNone (events.js:72:20)
    at IncomingMessage.emit (events.js:166:7)
    at endReadableNT (_stream_readable.js:921:12)
    at nextTickCallbackWith2Args (node.js:442:9)
    at process._tickCallback (node.js:356:17)

I think it is due to Asterisk sending the HTTP headers and the body in two separate TCP packets. The issue is probably not on the Asterisk side, since standard tools like CURL are able to handle the response.

Everything was working fine until Asterisk 14.6.2.

jaunis commented 6 years ago

Well, maybe this has been fixed in 14.7.0-rc2 (see https://issues.asterisk.org/jira/browse/ASTERISK-27372). I will test it as soon as I can and keep you informed.

asteriskteam commented 6 years ago

Hey jaunis,

That issue has a patch that's been pushed through Gerrit ( https://gerrit.asterisk.org/#/c/6912/). It should fix your problems with ARI client. I hope this helps.

Ben Ford

On Thu, Oct 26, 2017 at 9:57 AM, jaunis notifications@github.com wrote:

Well, maybe this has been fixed in 14.7.0-rc2 (see https://issues.asterisk.org/jira/browse/ASTERISK-27372). I will test it as soon as I can and keep you informed.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/asterisk/node-ari-client/issues/98#issuecomment-339693775, or mute the thread https://github.com/notifications/unsubscribe-auth/ALIICPe_6R77KmosYHPCkiDrQbKEJgeqks5swJ3bgaJpZM4P6x6s .

jaunis commented 6 years ago

I've tested with version 14.7.1, it's working. Thanks a lot !