englercj / node-esl

FreeSWITCH ESL implementation for Node.js; implements the full Event Socket Library specified in: http://wiki.freeswitch.org/wiki/Esl
http://englercj.github.com/node-esl/
MIT License
170 stars 111 forks source link

Method connection.executeAsync doesn't seem to work #40

Closed aalexgabi closed 9 years ago

aalexgabi commented 9 years ago

The connection.executeAsync method sets async flag to true and calls connection.execute. This is inside connection.execute:

    if(self.async) {
        self.once('');
    }

And generates:

Error: many only accepts instances of Function
    at EventEmitter.many (/node_modules/modesl/node_modules/eventemitter2/lib/eventemitter2.js:244:13)
    at EventEmitter.once (/node_modules/modesl/node_modules/eventemitter2/lib/eventemitter2.js:236:10)
    at Connection.execute (/node_modules/modesl/lib/esl/Connection.js:433:14)
    at Connection.executeAsync (/node_modules/modesl/lib/esl/Connection.js:462:10)
    at Object.self.publicAPI.playback (/vedeu/lib/JavaScript/calld/Inbound.js:132:27)
    at Object.Router.onMessage (/vedeu/daemons/calld/calld.js:108:47)
    at null.<anonymous> (/vedeu/lib/JavaScript/router.js:41:22)
    at emit (events.js:95:17)
    at Socket._flush (/node_modules/zmq/lib/index.js:510:19)
    at _zmq.onReady (/node_modules/zmq/lib/index.js:193:12)

EventEmitter2 API is:

emitter.once(event, listener)
englercj commented 9 years ago

Weird, looks like I just never actually implemented it. Just did a release for v1.1.3 that includes changes that should make it work. Sorry about that!