EADDRNOTAVAIL
fdl333 opened this issue · 4 comments
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 ...
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 :)
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 ...
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.)
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!