I. BACKGROUND notes:
SIP server IP (Centos): 192.168.11.61, server IP (Windows): 192.168.11.19
Second, the purpose:
The SIP server (FreeSWITCH) can be accessed from the 192.168.11.19 via Nodejs's MODESL inline, enabling access to the status information of the SIPs server. Have seen a lot of documents before,SIP Server and inline programs are on a computer, this article provides a separate implementation of the way for everyone to refer to.
Third, the specific setting:
① in Conf/autoload_configs/event_socket.conf.xml, the modified Listen-ip is: 192.168.11.61, the default is: 127.0.0.1, the following parameters are set:
<configuration name= "event_socket.conf" description= "Socket Client" >
<settings>
<param name= "Nat-map" value= "false"/>
<param name= "Listen-ip" value= "192.168.11.61"/>
<param name= "Listen-port" value= "8021"/>
<param name= "Password" value= "Cluecon"/>
<!--<param name= "Apply-inbound-acl" value= "LAN"/>--
</settings>
</configuration>
② Installing Nodejs (specific installation is not covered in this article), download Modesl (HTTPS://WWW.NPMJS.ORG/PACKAGE/MODESL)
③esl.js Inline Code writing:
var ESL = require (' D:\\testchat\\modesl '),
conn = new ESL. Connection (' 192.168.11.61 ', 8021, ' Cluecon ', function () {
Conn.api (' Vension ', function (res) {
Res is an ESL. Event instance
Console.log (Res.getbody ());
});
});
Modesl and esl.js are put D:\\testchat directory, start doc into the D:\\testcha folder, input node Esl.js can see the FS version information, replace other instructions, you can achieve convenient operation.
Based on this, the FreeSWITCH information can be passed through the HTTP module to the Web interface, you can also store this information in db, analyze ... Then you can try out other apps.
Nodejs implementing ESL Inline FreeSWITCH setting instructions