Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script src="https://rawgit.com/onsip/SIP.js/0.8.0/dist/sip-0.8.0.js"></script>
- <!--script src="sip-0.12.0.js"></script-->
- <video id="remoteVideo"></video>
- <video id="localVideo" muted="muted"></video>
- <script>
- var options = {
- media: {
- constraints: {
- audio: true,
- video: true
- }
- }
- };
- var userAgent = new SIP.UA({
- uri: 'brian@192.168.0.100',
- wsServers: ['wss://192.168.0.100:7443'],
- authorizationUser: 'brian',
- password: '1234',
- hackViaTcp: false,
- hackIpInContact: false,
- hackWssInTransport: false,
- hackAllowUnregisteredOptionTags: false,
- registrarServer: 'sip:192.168.0.100',
- register: true,
- });
- userAgent.on("connected", function() {
- console.log("Connected $$$$$$$$$$$$$$$$$$$$$$$$");
- var options = {
- 'extraHeaders': [ 'X-Foo: foo', 'X-Bar: bar' ]
- };
- userAgent.register(options);
- });
- userAgent.on("registered", function() {
- console.warn("Register $$$$");
- // session = userAgent.invite('sip:1002@192.168.0.100', options);
- });
- userAgent.on('invite', function (session) {
- console.warn("invite $$$$");
- session.accept({
- media: {
- render: {
- remote: {
- video: document.getElementById('remoteVideo')
- },
- local: {
- video: document.getElementById('localVideo')
- }
- }
- }
- });
- });
- </script>
Add Comment
Please, Sign In to add comment