Home Reference Source

Configuring the chosen stack

Create a .npmrc file with the next content

sippo_stack = "<stack>"

where stack is one of:

Ericsson
Janus
OpenTok
Oracle
SIPoWS

Installing dependencies

Make sure the @quobis NPM scope is configured in the machine. This will be accomplished with the next command:

npm config set @quobis:registry http://npm.internal.quobis.com:4873/

After check it, install dependencies

npm install

Note that this will be needed every time the stack being used is changed.

Launching tests

gulp test

And to continuously run the tests and watch for changes:

gulp tdd

Publishing the package

npm publish

Generating a distributable file

npm run dist

A standalone package with UMD wrapping will be generated. It can export the Sippo global variable or be required as a CommonJS or an AMD module.

Generating the API documentation

gulp doc

The API documentation will be generated in the doc directory.

Cleaning the source code

gulp clean

All the compiled files will be removed.

Logging

SippoJS defines 6 log levels:

By default, WARN level is used. This means only messages with ERROR and WARN level are printed.

To enable the debug message you can use the sippodebug property for the local storage of the domain where SippoJS is being used. For example, pasting the next code to the browser console will enable every debug message:

localStorage.sippodebug = '*'

About SippoJS requirements

WebRTC adapter is currently required in almost every case to insulate the app from spec changes and prefix differences. You can obtain more information at:

An ES5 compatible JavaScript engine is expected. Additionaly, some post ES5 features are also needed. For that reason, the next polyfills are suggested when targeting old browsers and need to be included by applications using SippoJS in order to work as expected in them:

E2E Testing

Dependencies

You must have downloaded in you computer the following repositories:

Also you must have been installed the following packages:

Running the environment

In order to run the environment you must follow those steps:

  1. Ensure the environment is properly configured: Open the test-e2e/environment/docker-compose-base.yml, test-e2e/environment/docker-compose-janus.yml files and check if the context and volumes fields have the relative paths properly pointing to your local repositories.
  2. Ensure docker daemon is running. If not: sudo systemctl start docker
  3. Now, we should run the environment. If we want to run only the test for a STACK (janus or SIPoWS in this moment are the stack supported), we should do the next:

    • Janus: in order to run the environment for Janus, we should execute ` npm run e2e-environment -- start -s janus

    • SIPoWS: in order to run the environment for SIPoWS, we should execute ` npm run e2e-environment -- start -s exsip

When the testing of the code ends, we can stop the environment that is running using the next command: npm run e2e-environment stop

Skip running some services

In order to run some services locally, because maybe you're developping over some of them, you can pass the flag --skip-wac or --skip-qss (or both of them) through the e2e-environment npm scripts, in order to avoid launching those services.

Attach to some container

You can attach to any of the docker containers launches using docker attach <container-name>. When you finish to look around, just press Ctrl+C to exit.

Running the tests

We could run either the tests for all stacks or for a specific stack. The commands to use are the followings: