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

EADDRNOTAVAIL #59

Open
fdl333 opened this issue Mar 11, 2022 · 4 comments
Open

EADDRNOTAVAIL #59

fdl333 opened this issue Mar 11, 2022 · 4 comments

Comments

@fdl333
Copy link

fdl333 commented Mar 11, 2022

I'm trying your code to listen to events on a FS server on my network..

Code is on my PC...

If I try to connect from my PC via Putty to the FS server (192.168.1.234 : 8021) I get:
Content-Type: auth/request
Which is fine..

from same PC, if I run nodejs project with :
server.listen(8021, '192.168.1.234');
I get :
Uncaught Error Error: listen EADDRNOTAVAIL: address not available 192.168.1.234:8021

I checked firewall, etc .. but cant resolve ...

@shimaore
Copy link
Owner

Hi @fdl333
You'll need to use the client mode if you want to connect to FreeSwitch the same way you do with Putty.

Server is refusing to start because FreeSwitch is already using the port :)

@fdl333
Copy link
Author

fdl333 commented Mar 11, 2022

AH, ok ... but I dont understand: What I'm trying to do is write a node project that publishes freeswitch events to an MQTT broker... From what I see the client sends commands, but doesnt receive events ...
I suppose I'm confused between the use to client and server mode ...

@shimaore
Copy link
Owner

In that case your best bet is to use reconnect() to start the connection as a long-term client, and send an event_json() command to FreeSwitch to have it route events through your application (for example event_json("ALL") would send you all events, but you probably shouldn't do that).

Note that mod_mosquitto can also be used to forward events to MQTT if the only thing you want to do is forward the events. (Look for PUBLISH an event to a topic on that page.)

@fdl333
Copy link
Author

fdl333 commented Mar 11, 2022

Thank you so much .. yes I already use the mod_mosquitto, but it has to be a two-way connection: I want to publish all (or selected) events to mtqq and also subscribe in order to receive commands to send to freeswitch..

I'm not sure what you mean by the reconnect() ... I dont see it as an available function in
va cli = esl.client()
cli.reconnect .... does not exist

by the way, where in the world are you? I'm in Italy!

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