-
-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: sip streaming api #88
Conversation
hmm, it seems like the polling isn't working for me. I get stuck at "Creating SIP Session..." whether I have |
Just kidding I think there's something up with the camera and it just happened to be working when running with the old code, but not the new code. I'll keep you posted |
@bourdakos1 any luck? It's working perfectly for me.. Any thoughts on the api? |
I can confirm it's just the camera's (the ring iOS app isn't loading either). I think everything looks good, the only thing is that you only supply a |
Sorry @bourdakos1, I should have asked what your intentions were with the Thanks for checking everything else over, I can't wait for the improved stream start times that this will have in homebridge. Nice work on the initial refactor! |
That's what I was thinking as well, but I believe the sip module always creates a udp transport on port 5060 no matter what AND a tls transport on port 5061 (only if we give tls options, which we do) |
There could be a problem running const port = await getPort({port: 5060})
const tls_port = await getPort({port: 5061}) |
Yea, here's the code in https://github.com/kirm/sip.js/blob/master/sip.js to back it up: if(options.udp === undefined || options.udp)
protocols.UDP = makeUdpTransport(options, callbackAndLog);
if(options.tcp === undefined || options.tcp)
protocols.TCP = makeTcpTransport(options, callbackAndLog);
if(options.tls)
protocols.TLS = makeTlsTransport(options, callbackAndLog);
if(options.ws_port && WebSocket)
protocols.WS = makeWsTransport(options, callbackAndLog); makeUdpTransport: var address = options.address || '0.0.0.0';
var port = options.port || 5060;
var socket = dgram.createSocket(net.isIPv6(address) ? 'udp6' : 'udp4', onMessage);
socket.bind(port, address); makeTlsTransport: var server = tls.createServer(options.tls, callback);
server.listen(options.tls_port || 5061, options.address); We would have to pass |
I'm up for |
Just pushed a commit disable the upd and tcp transports. Does that look like a good solution to you? |
I’m okay with it, does it work? |
When I was using the linphone python client disabling udp always broke it for me, but I didn’t have everything nailed down properly at the time |
Works perfectly 😄. I'll push out a release in a few minutes |
@bourdakos1 I did a fair bit of cleanup and performance tweaking:
videoStream
andaudioStream
both have the following format:invite
can take a new set ofRtpOptions
if you want to redirect the call to different ports. I'm not using this yet, but I might do this for homebridge. Haven't tested if re-invite actually worksvod
request is immediately followed by a check for active dings (even if polling isn't enabled). I did a lot of testing and the ding was always sitting there waiting immediately, so this should work without any need for waiting or polling. It also means we start the stream as fast as possible. In my testing, I'm getting a live stream in < 2 seconds 🐎If you don't have any objections, I'll get this merged and released as v
5.0.0