onsip / SIP.js

A simple, intuitive, and powerful JavaScript signaling library
https://sipjs.com
MIT License
1.84k stars 690 forks source link

Deno support #1011

Open Hexagon opened 1 year ago

Hexagon commented 1 year ago

Deno works exactly like javacript in the browser. So as soon as you release a fully ESM compilant build it would/should/could be possible to build a server side sip client using Deno (i see that you're working on ESM support). Exciting! The idea with this is that it would be possible to build automated services that reads dynamic TTS messages when being called, or even simple IVRs.

Would be awesome if you had Deno in mind, and provide a standard way of including the library from Deno, like deno.land/x.

I've tried some of the other libraries, but this one seem to be closest to working!

Without any changes, manually vildingarnas latest master branch, it's already possible to connect to a server, listen for calls, reject calls and possibly more. See https://github.com/Hexagon/siphert for a very quick (but working) hack of a Deno client.

It seem like the biggest problem is that MediaStream isn't supported, which makes the library throw when making/accepting calls.

image

... and there doesn't seem to be any webrtc implementation for deno yet.

Hexagon commented 1 year ago

Update: Works great in Deno since 0.21.0 using:

import { ... } from "https://cdn.jsdelivr.net/npm/sip.js@0.21.0/lib/index.js";