Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get incoming ring? #2

Closed
niftylettuce opened this issue Mar 20, 2017 · 12 comments
Closed

Get incoming ring? #2

niftylettuce opened this issue Mar 20, 2017 · 12 comments

Comments

@niftylettuce
Copy link

Would be cool to get the API endpoint for an incoming ring, figure it out @davglass 馃槅

@davglass
Copy link
Owner

You can, but you have to poll for it:

ring.authenticate(email, password, (e, token) => {
    console.log(e, token);
    const check = () => {
        console.log('Checking for ring activity..');
        ring.dings(token, (e, json) => {
            console.log(e, json);
        });
    };
    setInterval(check, 30 * 1000);
    check();
});

That should return a chunk of JSON that includes the event id which you can use to get the video stream.

@suhajdab
Copy link

suhajdab commented Mar 23, 2017

Thanks for this npm module! Works like a charm!
I tried getting the video stream for incoming, but I get a Error: API returned Status Code 404 when I use the event id for getting the recording.

@jugaltheshah
Copy link

Sorry for replying to an old thread. You might also be able to use something like Tasker and a plugin (https://play.google.com/store/apps/details?id=com.joaomgcd.autonotification) to intercept the Ring notification on Android. When you detect the notification, fire off a web request to a server that's listening, and have it check the feed. A bit clunky and involved, but you wouldn't have to poll!

@asantaga
Copy link

asantaga commented Sep 3, 2017

@suhajdab, BTW the reason why you cant get the incoming video stream (via recordings) is because the recording isnt available for about 30-60seconds after the ring.. Im guessing the bell records, then uploads to AWS where the recordings are held

@ghost
Copy link

ghost commented Sep 13, 2017

Im thinking this issue could be closed right? its pretty much closed?

@davglass
Copy link
Owner

It would still be nice to get the incoming ring. IIRC they use the SIP protocol to answer the ring. Not sure how to do that at the moment and I haven't had time to reverse engineer their api to do it. I'm also not sure if when you answer a call from one place will that stop anyone else from answering it. I just haven't played enough with the real time part of it yet. My use was to archive footage as well as use it to check battery/wifi status for external monitoring.

@ghost
Copy link

ghost commented Sep 13, 2017

Davglass, #1 covers the querying of the SIP. I found a lot of useful discussion on the python version of the ring api.. I got it working using the blink SIP client but the sip stream only works for 30s or so.. alas I dont have an immediate usecase for this so I stopped R&D

@aniceberg
Copy link

Any idea why Ring is returning this:

Checking for ring activity..
null []

instead of the JSON with the event id?

@davglass
Copy link
Owner

@aniceberg That means there wasn't an event in that check. It needs to poll for them. If the json contains data then there was a ring.

@aniceberg
Copy link

@davglass Thanks!

Got this from an event:

null [ { id: 1234913551677183000,
id_str: '1234913551677183223',
state: 'ringing',
protocol: 'sip',
doorbot_id: 1234567,
doorbot_description: 'Front Door',
device_kind: 'lpd_v1',
motion: false,
snapshot_url: '',
kind: 'ding',
sip_server_ip: '12.34.56.78',
sip_server_port: 15063,
sip_server_tls: true,
sip_session_id: '5kadceg027l7n-12345678docili',
sip_from: 'sip:7654321@ring.com',
sip_to: 'sip:5kadceg027l7n-12345678docili@12.34.56.78:15064;transport=tls',
audio_jitter_buffer_ms: 300,
video_jitter_buffer_ms: 300,
sip_endpoints: null,
expires_in: 150,
now: 1512680593.68837,
optimization_level: 1,
sip_token: '2533d5b27a85537e664c83eeab48a576705046d0b9e327dabbde1aefb960b472',
sip_ding_id: '6496913551677183223' } ]

Can you recommend a tool or two that could parse this information and initiate a SIP session with these inputs to bring up a live video feed on a web page?

@davglass
Copy link
Owner

Technically it should be possible, I've just not had the time to work on it lately.. I still have a box of their gear that I need to get installed too, but life happens ya know :(

@mrose17
Copy link
Collaborator

mrose17 commented Aug 27, 2018

i think that this is now a duplicate of #1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants
@suhajdab @davglass @mrose17 @niftylettuce @aniceberg @jugaltheshah @asantaga and others