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

esl.connection.createInbound is not a function #107

Closed fdl333 closed 2 years ago

fdl333 commented 2 years ago

I tried your very simple script and I get this message: esl.connection.createInbound is not a function

Script:

const esl = require('modesl');

const connectionOptions = { host: '127.0.0.1', port: 8021, };

const connection = esl.Connection.createInbound(connectionOptions, 'ClueCon', function () { connection.api('status', function (res) { console.log(res.getBody()); }); });

wfleischer commented 2 years ago

The createInbound function has been introduced with version 2.0 (see https://github.com/englercj/node-esl/blob/master/UPGRADE.md). It has not been released though. So you are trying updated examples on an older release.

batbrain9392 commented 2 years ago

@fdl333 maybe this'd help -

var esl = require('modesl'),
conn = new esl.Connection('127.0.0.1', 8021, 'ClueCon', function() {
    conn.api('status', function(res) {
        //res is an esl.Event instance
        console.log(res.getBody());
    });
});
fdl333 commented 2 years ago

Thank you! Will try immediately!

Francesco Facco de Lagarda

On 24 Aug 2022, at 18:23, Debmallya Bhattacharya @.***> wrote:

 @fdl333 maybe this'd help -

var esl = require('modesl'), conn = new esl.Connection('127.0.0.1', 8021, 'ClueCon', function() { conn.api('status', function(res) { //res is an esl.Event instance console.log(res.getBody()); }); }); — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

fdl333 commented 2 years ago

YUP! It works! Thanks sooo much!

From: Debmallya Bhattacharya @.> Sent: mercoledì 24 agosto 2022 18:23 To: englercj/node-esl @.> Cc: Francesco Facco de Lagarda @.>; Mention @.> Subject: Re: [englercj/node-esl] esl.connection.createInbound is not a function (Issue #107)

@fdl333 https://github.com/fdl333 maybe this'd help -

var esl = require('modesl'), conn = new esl.Connection('127.0.0.1', 8021, 'ClueCon', function() { conn.api('status', function(res) { //res is an esl.Event instance console.log(res.getBody()); }); });

— Reply to this email directly, view it on GitHub https://github.com/englercj/node-esl/issues/107#issuecomment-1225951753 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEXCWUVVAXHDIN6TTMGDUY3V2ZD7FANCNFSM5P73J3QQ . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AEXCWUWPBN3EAAZLHCZCSNLV2ZD7FA5CNFSM5P73J3Q2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOJEJIUCI.gif Message ID: @. @.> >