onsip / SIP.js

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

0.6.0: Webcam Light Comes on Even if Video set to false #60

Closed lylepratt closed 10 years ago

lylepratt commented 10 years ago

Hi Guys. Just doing some testing on the new 0.6.0 release. Have found one minor issue:

When I accept a call with video: false, my webcam light is coming on as if Video is actually active. It did not do this on the 0.5.0 branch.

Here is the code i'm using to accept the call:

    session.accept({
        media: {
          audio: true,
          video: false,
          render: {
            remote: {
              audio: document.createElement('audio')
            }
          }
        }
      });
josephfrazier commented 10 years ago

Hey Lyle, thanks for the testing!

The syntax for the media property has changed slightly. You now need to put the constraints inside a constraints property. Try this instead:

    session.accept({
        media: {
            constraints: {
                audio: true,
                video: false
            },
            render: {
                remote: {
                    audio: document.createElement('audio')
                }
            }
        }
    });

I'll work on getting together a guide for migrating from 0.5.0. In the meantime, here's what's come to mind so far:

session.on('refer', function handleRefer (request) {
  var uri = request.parseHeader('refer-to').uri;
});

Let us know if you run into any more backwards incompatibilities, Joseph

lylepratt commented 10 years ago

Awesome that worked! Thanks for the other tips as well. The only other issue I've encountered so far was on mobile. I opened a separate issue for it here: https://github.com/joseph-onsip/sipjs-cordova/issues/4

james-criscuolo commented 10 years ago

Hi Lyle, It seems like this issue has been resolved, so I'm going to close it, but feel free to re-open it if the problem re-emerges.