Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cb is not a function Error crashing the esl server #78

Closed
axchanda opened this issue Jun 25, 2019 · 4 comments
Closed

cb is not a function Error crashing the esl server #78

axchanda opened this issue Jun 25, 2019 · 4 comments

Comments

@axchanda
Copy link

axchanda commented Jun 25, 2019

I get the following error, when executing the node-esl server, be it in server example or ivr example.

/usr/local/freeswitch/scripts/node-esl/examples/server/node_modules/modesl/lib/esl/Connection.js:711
            cb(evt);
            ^

TypeError: cb is not a function
    at module.exports.cbWrapper (/usr/local/freeswitch/scripts/node-esl/examples/server/node_modules/modesl/lib/esl/Connection.js:711:13)
    at module.exports.EventEmitter.emit (/usr/local/freeswitch/scripts/node-esl/examples/server/node_modules/eventemitter2/lib/eventemitter2.js:388:22)
    at module.exports.Connection._onEvent (/usr/local/freeswitch/scripts/node-esl/examples/server/node_modules/modesl/lib/esl/Connection.js:797:10)
    at module.exports.EventEmitter.emit (/usr/local/freeswitch/scripts/node-esl/examples/server/node_modules/eventemitter2/lib/eventemitter2.js:388:22)
    at module.exports.Parser._parseEvent (/usr/local/freeswitch/scripts/node-esl/examples/server/node_modules/modesl/lib/esl/Parser.js:208:10)
    at module.exports.Parser._parseBody (/usr/local/freeswitch/scripts/node-esl/examples/server/node_modules/modesl/lib/esl/Parser.js:100:10)
    at module.exports.Parser._parseHeaders (/usr/local/freeswitch/scripts/node-esl/examples/server/node_modules/modesl/lib/esl/Parser.js:76:37)
    at module.exports.Parser._parseBody (/usr/local/freeswitch/scripts/node-esl/examples/server/node_modules/modesl/lib/esl/Parser.js:103:10)
    at module.exports.Parser._parseHeaders (/usr/local/freeswitch/scripts/node-esl/examples/server/node_modules/modesl/lib/esl/Parser.js:76:37)
    at module.exports.Parser._parseBody (/usr/local/freeswitch/scripts/node-esl/examples/server/node_modules/modesl/lib/esl/Parser.js:103:10)

Please let me know what to do!

@axchanda
Copy link
Author

@englercj @lxfontes Any updates on this?

@englercj
Copy link
Owner

Looks like those examples don't pass a callback to execute but the code doesn't check for an undefined callback. Should change this line to change if cb exists before calling it: https://github.com/englercj/node-esl/blob/master/lib/esl/Connection.js#L709

@axchanda
Copy link
Author

axchanda commented Jul 6, 2019

Commenting that particular line in Connection.js solves this problem. Thanks, anyways @englercj!

@axchanda axchanda closed this as completed Jul 6, 2019
englercj added a commit that referenced this issue Jul 7, 2019
@englercj
Copy link
Owner

englercj commented Jul 7, 2019

Latest master should contain a fix for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants