### Janode Example Execution Source: https://github.com/meetecho/janode/blob/master/README.md Steps to set up and run Janode examples, including building example configurations and executing the main example script. ```bash cd examples/echotest npm run build npm run build-config node src/echotest.js --janode-log=info ``` -------------------------------- ### Janode Installation and Build Source: https://github.com/meetecho/janode/blob/master/README.md Provides commands for installing the Janode library from npm and for building the library from its source code. ```bash npm install janode ``` ```bash npm run build ``` -------------------------------- ### Janode Documentation Build Source: https://github.com/meetecho/janode/blob/master/README.md Commands required to install development dependencies and build the project's HTML documentation. ```bash npm install ``` ```bash npm run build-docs ``` -------------------------------- ### Janode EchoTest Plugin Usage Source: https://github.com/meetecho/janode/blob/master/README.md Demonstrates connecting to Janus, creating a session, attaching to the EchoTest plugin, handling WebRTC and plugin-specific events, and initiating a call. ```javascript import Janode from 'janode'; const { Logger } = Janode; import EchoTestPlugin from 'janode/plugins/echotest'; const connection = await Janode.connect({ is_admin: false, address: { url: 'ws://127.0.0.1:8188/', apisecret: 'secret' } }); const session = await connection.create(); // Attach to a plugin using the plugin descriptor const echoHandle = await session.attach(EchoTestPlugin) // Janode exports "EVENT" property with core events echoHandle.on(Janode.EVENT.HANDLE_WEBRTCUP, _ => Logger.info('webrtcup event')); echoHandle.on(Janode.EVENT.HANDLE_MEDIA, evtdata => Logger.info('media event', evtdata)); echoHandle.on(Janode.EVENT.HANDLE_SLOWLINK, evtdata => Logger.info('slowlink event', evtdata)); echoHandle.on(Janode.EVENT.HANDLE_HANGUP, evtdata => Logger.info('hangup event', evtdata)); echoHandle.on(Janode.EVENT.HANDLE_DETACHED, evtdata => Logger.info('detached event', evtdata)); // Refer to plugin documentation // plugins export "EVENT" property with specific plugin events echoHandle.on(EchoTestPlugin.EVENT.ECHOTEST_RESULT, evtdata => Logger.info('echotest result event', evtdata)); // Specific method exported by the plugin // "offer" got from the client const { jsep: answer } = await echoHandle.start({ video: true, jsep: offer }); // detach the handle await echoHandle.detach(); ``` -------------------------------- ### Janode Admin API Session Listing Source: https://github.com/meetecho/janode/blob/master/README.md Demonstrates connecting to the Janus Admin API and retrieving a list of all active sessions managed by the server. ```javascript import Janode from 'janode'; const admin = await Janode.connect({ is_admin: true, address: { url: 'ws://127.0.0.1:7188/', apisecret: 'secret' } }); // Get the list of active sessions const data = await admin.listSessions(); ``` -------------------------------- ### Janode Transport Configuration Source: https://github.com/meetecho/janode/blob/master/README.md Illustrates how to configure Janode to connect to the Janus server using different transport protocols, specifically WebSockets and Unix DGRAM Sockets. ```javascript /* Use UNIX DGRAM Sockets */ const admin = await Janode.connect({ is_admin: true, address: { url: 'file://tmp/janusapi', apisecret: 'secret' } }); ``` ```javascript /* Use WebSockets */ const admin = await Janode.connect({ is_admin: true, address: { url: 'ws://127.0.0.1:7188/', apisecret: 'secret' } }); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.