Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
0ee9477
Going forward development is now being done using node.js 16 (LTS cur…
john-e-riordan Sep 4, 2022
18fab76
Update package-lock to version 2
john-e-riordan Sep 5, 2022
958ced5
Update linting and formatting dependencies
john-e-riordan Sep 4, 2022
5959056
Update testing dependencies
john-e-riordan Sep 4, 2022
f015e71
Update testing dependencies
john-e-riordan Sep 4, 2022
d4a0c9f
Update typescript dependency
john-e-riordan Sep 4, 2022
98599d8
Update karma and jasmine dependencies
john-e-riordan Sep 5, 2022
505901b
Update parser genererator dependencies
john-e-riordan Sep 5, 2022
747cc11
Update package-lock
john-e-riordan Sep 5, 2022
128a05b
Fix broken DTMF test
john-e-riordan Sep 4, 2022
91e575b
Fix small warning on documentation generation
john-e-riordan Sep 5, 2022
26ca798
fix typo in docs/session-description-handler.md
namikinn Jul 8, 2021
52d129a
Update vscode workspace settings
john-e-riordan Sep 5, 2022
5ac8def
Update doc genererator dependency
john-e-riordan Sep 5, 2022
8829673
Update documentation
john-e-riordan Sep 5, 2022
6d29892
Update TODO
john-e-riordan Sep 5, 2022
6f598b6
Update MIGRATION
john-e-riordan Sep 26, 2022
6f4187e
Update AUTHORS
john-e-riordan Sep 27, 2022
4ffbaaf
Update RELEASE
john-e-riordan Sep 27, 2022
bd1b6e0
Update TODO
john-e-riordan Sep 27, 2022
78a3bf1
Update dependencies
john-e-riordan Sep 27, 2022
1cd4d32
Version 0.20.1
john-e-riordan Sep 27, 2022
4bdb093
Add a test for sendInitialProvisionalResponse
john-e-riordan Sep 27, 2022
3bd4491
Add onCancel delegation for Invitation
Aug 24, 2021
18d70dd
Add tests for onAck and onCancel Session delegates
john-e-riordan Sep 27, 2022
66b32e5
Add remarks with regard to onAck and onCancel
john-e-riordan Sep 27, 2022
f4a1a26
Fix unsubscribe by disabling N timer on unsubscribe
Aug 8, 2022
d15754c
Update vscode settings
john-e-riordan Sep 28, 2022
5dae220
Fix lint configuration
john-e-riordan Sep 28, 2022
5baf7db
Lint
john-e-riordan Sep 28, 2022
5b0c29e
SimpleUser support for early media
john-e-riordan Sep 28, 2022
b26885c
Pass SDH options MediaStreamFactory
john-e-riordan Sep 28, 2022
6c30def
Update scripts in package.json
john-e-riordan Sep 28, 2022
d58ecf6
Replace Travis CI with GitHub CI
john-e-riordan Sep 28, 2022
dc03997
Documentation fix
john-e-riordan Sep 28, 2022
74eef5e
FIX: Remove GRUU from REGISTER contact
zusrut May 5, 2022
9199109
New instanceId options
danvirsen Sep 28, 2022
53ef633
More informative error message
john-e-riordan Sep 29, 2022
f3946e7
Make iceGatheringComplete() public
john-e-riordan Sep 29, 2022
3b29c3e
Comment tweak.
john-e-riordan Sep 29, 2022
930462f
ECMAScript module (ESM) support
john-e-riordan Oct 1, 2022
75fdb64
Do not emit map files to lib by default
john-e-riordan Oct 1, 2022
a5557ff
Update TODO
john-e-riordan Oct 2, 2022
258c503
Cleanup issue in SimpleUser
john-e-riordan Oct 2, 2022
f06939c
Fix double state trans error on getOffer() failure
john-e-riordan Oct 2, 2022
d8b4b3c
Add remarks to makeURI documentation
john-e-riordan Oct 4, 2022
b4b2abe
transport-fake.ts: Prevent potential infinite recursion.
seanbright Oct 12, 2022
bffde50
Merge pull request #1007 from seanbright/transport-fake-infinite-recu…
john-e-riordan Oct 12, 2022
723c056
simple-user.ts: Allow 0 for reconnection attempts and delay.
seanbright Oct 14, 2022
1361d0c
Merge pull request #1009 from seanbright/simple-user-optional-reconnects
john-e-riordan Oct 14, 2022
e2d80ad
session.ts: Send Reason header with BYE on re-INVITE failure.
seanbright Oct 14, 2022
2481a13
Merge pull request #1010 from seanbright/unused-extra-bye-headers
john-e-riordan Oct 14, 2022
87c8d50
Add SessionManager and update SimpleUser
john-e-riordan Oct 17, 2022
b53c8b7
Add SessionManager Docs
john-e-riordan Oct 20, 2022
94375a9
Add WebAudioSessionDescriptionHandler
john-e-riordan Oct 17, 2022
e144ae2
UserAgent issues - breaking change
john-e-riordan Oct 18, 2022
0d05f35
Subscriber - update comment to improve docs
john-e-riordan Oct 19, 2022
8fdb19d
Update TODO
john-e-riordan Oct 17, 2022
883737c
Update dev dependencies
john-e-riordan Oct 21, 2022
62f3d4c
Fix some comments
john-e-riordan Oct 21, 2022
c9e1946
Export grammer from core
john-e-riordan Oct 21, 2022
2af0372
SimpleUser isHeld/isMuted returns boolean
john-e-riordan Oct 21, 2022
d7fe217
Update UserFake for test support
john-e-riordan Oct 21, 2022
961a487
Update documentation
john-e-riordan Oct 21, 2022
91a9bf0
Update session description handler documentation
john-e-riordan Oct 21, 2022
717b2bd
Migration doc addition
john-e-riordan Oct 24, 2022
6979d20
Version 0.21.0
john-e-riordan Oct 24, 2022
70b6b66
Fix SessionManager option handling bug
john-e-riordan Oct 25, 2022
48cb9b5
SimpleUser and SessionManager optionally send DTMF via SDH.
seanbright Oct 24, 2022
7410755
Update docs
john-e-riordan Oct 25, 2022
742533a
Version 0.21.1
john-e-riordan Oct 25, 2022
9219aa1
Fix SessionManager registration expires bug
john-e-riordan Oct 27, 2022
f0c9dfe
SessionManager SIP OPTIONS ping feature
john-e-riordan Oct 27, 2022
b6550bd
Update docs
john-e-riordan Oct 27, 2022
2e1c525
Version 0.21.2
john-e-riordan Oct 27, 2022
8718c33
Merge remote-tracking branch 'upstream/main' into feature/REP-60578_2
netdad1712 Mar 12, 2023
c9a6e28
align with source sipJS source
netdad1712 Mar 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
33 changes: 25 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,45 @@
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
// "ecmaVersion": "latest",
"ecmaVersion": 2017,
"sourceType": "module",
"project": "./tsconfig-base.json"
},
"plugins": ["@typescript-eslint", "tree-shaking"],
"plugins": [
"@typescript-eslint",
"tree-shaking",
"prettier"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:prettier/recommended"
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
// "plugin:@typescript-eslint/recommended-requiring-type-checking",
// "plugin:@typescript-eslint/strict",
"prettier"
],
"rules": {
"no-console": "error",
"prettier/prettier": "error",
// "@typescript-eslint/explicit-member-accessibility": "error",
"@typescript-eslint/member-ordering": "error",
"tree-shaking/no-side-effects-in-initialization": 2
// "@typescript-eslint/member-ordering": "error",
"tree-shaking/no-side-effects-in-initialization": "error"
},
"overrides": [
{
"files": ["./demo/**/*.ts", "./test/**/*.ts"],
"rules": {
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-implied-eval": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/restrict-plus-operands": "off",
"tree-shaking/no-side-effects-in-initialization": "off"
}
}
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

timeout-minutes: 10

strategy:
matrix:
node-version: [16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
11 changes: 0 additions & 11 deletions .npmignore

This file was deleted.

26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

8 changes: 6 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
"files.associations": {
"*.json": "jsonc"
},
"typescript.tsdk": "node_modules/typescript/lib"
}
"files.exclude": {
"**/*.js": {
"when": "$(basename).ts"
}
}
}
2 changes: 2 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Authors

## John Riordan [@john-e-riordan](https://github.com/john-e-riordan)

## James Criscuolo [@james-criscuolo](https://github.com/james-criscuolo)

## Eric Green [@egreenmachine](https://github.com/egreenmachine)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![SIP.js Logo](https://sipjs.com/shared/img/logo.png "SIP.js")

[![Build Status](https://travis-ci.com/onsip/SIP.js.svg?branch=master)](https://travis-ci.com/onsip/SIP.js)
![Build Status](https://github.com/onsip/SIP.js/actions/workflows/node.js.yml/badge.svg)
[![npm version](https://badge.fury.io/js/sip.js.svg)](https://badge.fury.io/js/sip.js)

# SIP Library for JavaScript
Expand Down
108 changes: 86 additions & 22 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,86 @@
# How To version release SIP.js

* On your own github, checkout last tagged release on a new branch (note: this can be done on the repo's release branch, instead of making your own)
* remove all dist files
* cherry pick commits you want using -x flag (for "hot patch" releases)
* once ready, test.
* on master, npm version <major,minor,patch> --git-tag-version false
* DO NOT MANUALLY UPDATE THE VERSION. We now hardcode it in the library, using npm version will update it appropriately
* cherry pick version number commit to new branch (or just merge master, if you want everything)
* build and test.
* test again
* add new dist files (git add -f if it complains)
* commit

* push to local github
* merge (this step and the above one can be skipped if you just do it on the the repo's release branch itself)
* git tag (your version number)
* git push --tags
* get a clean release (as in, fresh clone)
* npm publish
* do release notes on github and release!
* update website
# How to version release SIP.js

On `main` branch...

## Development Dependencies

Prior to making a release, consider updating out of date dependencies.

* `npm outdated`
* `npm update --save`

Note that the source code itself has no dependencies.
A lot of work has been done to make it that way, so please keep it that way.

## Clean, Build and Test

Make sure it builds and the tests pass from a clean checkout.

* `git clean -xdf .`
* `npm i`
* `npm run build-and-test`

All tests must pass.

* `npm run build-demo`

All the demos must work.

## Documentation

Make sure the documentation is up to date and review any changes to the API. Commit any new documentation and consider the version number bump based on the changes to the API. If you commit any changes, go back to the Clean, Build and Test step.

* `npm run build-docs`

## Version

DO NOT MANUALLY UPDATE THE VERSION NUMBERS.

We hardcode the version in the library, using npm version will update it appropriately.

* `npm version <major.minor.patch> --git-tag-version false`

The updated files must be commited with a message "Version <major.minor.patch>".

## Before Publishing: Make Sure Your Package Installs and Works

This is important.

If you can not install it locally, you'll have problems trying to publish it. Or, worse yet, you'll be able to publish it, but you'll be publishing a broken or pointless package. So don't do that.

This approach will leverage the `npm pack` command to package up and zip your npm package into a single file (`<package-name>.tgz`), the same way it does for publishing. You can double check that your package will include only the files you intend it to when published and you can go to the project you want to use the package in and install it via this file. The steps to do this are as follows:

1. From within your npm package directory, run `npm pack` in your terminal. Note the .tgz file it produces and the location of it.
2. Change directories to the project directory where you want to use the npm package. Example: `cd /path/to/project`
3. From within the client project directory, run `npm install /path/to/package.tgz` but replace it with the proper path to the location of the .tgz file from step 1.
4. Then you can start using the package in that client project to test things out. This will give you the closest to production experience for using your npm package.
5. Delete the .tgz file created in step 1.

## Tag, Push and Publish

* `git tag <major.minor.patch>`
* `git push`
* `git push --tags`
* `npm publish`

### Sigh, don’t use .npmignore

Instead whitelist files in `package.json`. It's better to be exact about what we want in than to be forgetting to add what we want out.

```
"main": "./lib/index.js",
"files": [
"/lib"
],
```

## Update release notes on GitHub

Build the bundle files to upload.

`npm run build-bundles`

* Find 'Releases' on repository page
* Draft and publish release notes for new tag
* Upload bundles for new verison

4 changes: 2 additions & 2 deletions build/grammarGenerator.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";
const fs = require("fs"),
pegjs = require("pegjs"),
pegjs = require("peggy"),
tspegjs = require("ts-pegjs");

const thisFolder = "./src/grammar/pegjs",
Expand Down Expand Up @@ -52,7 +52,7 @@ const parser = pegjs.generate(grammarContents, {
plugins: [tspegjs],
"tspegjs": {
"tslintIgnores": "interface-name, trailing-comma, object-literal-sort-keys, max-line-length, only-arrow-functions, one-variable-per-declaration, no-consecutive-blank-lines, align, radix, quotemark, semicolon, object-literal-shorthand, variable-name, no-var-keyword, whitespace, curly, prefer-const, object-literal-key-quotes, no-string-literal, one-line, no-unused-expression, space-before-function-paren, arrow-return-shorthand",
"customHeader": "import { NameAddrHeader } from \"../../name-addr-header\";\nimport { URI } from \"../../uri\";"
"customHeader": "import { NameAddrHeader } from \"../../name-addr-header.js\";\nimport { URI } from \"../../uri.js\";"
},
"returnTypes": {
Contact: "URI | NameAddrHeader",
Expand Down
6 changes: 5 additions & 1 deletion build/webpack.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ module.exports = function (env) {
]
},
resolve: {
extensions: ['.ts', '.d.ts', '.js']
extensions: ['.ts', '.d.ts', '.js'],
extensionAlias: {
'.js': ['.ts', '.js'],
'.mjs': ['.mts', '.mjs']
}
},
optimization: {
minimizer: [
Expand Down
4 changes: 2 additions & 2 deletions demo/demo-1.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-use-before-define */
/* eslint-disable no-console */
import { SimpleUser, SimpleUserDelegate, SimpleUserOptions } from "../src/platform/web";
import { getAudio, getButton, getButtons, getInput, getSpan } from "./demo-utils";
import { SimpleUser, SimpleUserDelegate, SimpleUserOptions } from "../lib/platform/web/index.js";
import { getAudio, getButton, getButtons, getInput, getSpan } from "./demo-utils.js";

const serverSpan = getSpan("server");
const targetSpan = getSpan("target");
Expand Down
8 changes: 4 additions & 4 deletions demo/demo-2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable no-console */
/* eslint-disable @typescript-eslint/no-use-before-define */
import { SimpleUser, SimpleUserDelegate, SimpleUserOptions } from "../src/platform/web";
import { nameAlice, nameBob, uriAlice, uriBob, webSocketServerAlice, webSocketServerBob } from "./demo-users";
import { getButton, getInput, getVideo } from "./demo-utils";
import { SimpleUser, SimpleUserDelegate, SimpleUserOptions } from "../lib/platform/web/index.js";
import { nameAlice, nameBob, uriAlice, uriBob, webSocketServerAlice, webSocketServerBob } from "./demo-users.js";
import { getButton, getInput, getVideo } from "./demo-utils.js";

const connectAlice = getButton("connectAlice");
const connectBob = getButton("connectBob");
Expand Down Expand Up @@ -347,7 +347,7 @@ function makeDisconnectButtonClickListener(
function makeRegisterButtonClickListener(user: SimpleUser, registerButton: HTMLButtonElement): () => void {
return () => {
user
.register(undefined, {
.register({
// An example of how to get access to a SIP response message for custom handling
requestDelegate: {
onReject: (response) => {
Expand Down
12 changes: 6 additions & 6 deletions demo/demo-3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {
SimpleUser,
SimpleUserDelegate,
SimpleUserOptions
} from "../src/platform/web";
import { nameAlice, nameBob, uriAlice, uriBob, webSocketServerAlice, webSocketServerBob } from "./demo-users";
import { getButton, getDiv, getInput } from "./demo-utils";
} from "../lib/platform/web/index.js";
import { nameAlice, nameBob, uriAlice, uriBob, webSocketServerAlice, webSocketServerBob } from "./demo-users.js";
import { getButton, getDiv, getInput } from "./demo-utils.js";

// A class which extends SimpleUser to handle setup and use of a data channel
class SimpleUserWithDataChannel extends SimpleUser {
Expand Down Expand Up @@ -42,8 +42,8 @@ class SimpleUserWithDataChannel extends SimpleUser {
};
dataChannel.onerror = (event) => {
console.error(`[${this.id}] data channel onError`);
console.error(event.error);
alert(`[${this.id}] Data channel error.\n` + event.error);
console.error((event as RTCErrorEvent).error);
alert(`[${this.id}] Data channel error.\n` + (event as RTCErrorEvent).error);
};
dataChannel.onmessage = (event) => {
console.log(`[${this.id}] data channel onMessage`);
Expand Down Expand Up @@ -402,7 +402,7 @@ function makeDisconnectButtonClickListener(
function makeRegisterButtonClickListener(user: SimpleUser, registerButton: HTMLButtonElement): () => void {
return () => {
user
.register(undefined, {
.register({
// An example of how to get access to a SIP response message for custom handling
requestDelegate: {
onReject: (response) => {
Expand Down
6 changes: 5 additions & 1 deletion demo/webpack.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ module.exports = {
]
},
resolve: {
extensions: [ '.tsx', '.ts', '.js' ]
extensions: [ '.tsx', '.ts', '.js' ],
extensionAlias: {
'.js': ['.ts', '.js'],
'.mjs': ['.mts', '.mjs'],
}
},
output: {
filename: '[name].js',
Expand Down
11 changes: 2 additions & 9 deletions docs/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@

You just need to have [Node.js](http://nodejs.org/) and [Git](http://git-scm.com/).

### Node.js

* [Install Node.js via package manager](https://github.com/nodejs/node/wiki)
* [Install Node.js from sources](http://nodejs.org)

### Git

* [Install Git](http://git-scm.com/book/en/Getting-Started-Installing-Git)
Development is currently being done using Node.js version 16.

## How to build SIP.js

Expand Down Expand Up @@ -44,7 +37,7 @@ Run `npm run build-lib` to regenerate the `lib` folder.
SIP.js includes integration and units implemented using [Jasmine](https://jasmine.github.io/).
Run the tests as follows:
```
$ npm run command-line-test
$ npm run test
```
or
```
Expand Down
Loading