Skip to content

This is everything you need to get SIP.js running on iOS. Background incoming calls, Transfer, Hold, Mute, all working.

Notifications You must be signed in to change notification settings

MikelEiza/iOS-SIP.js

 
 

Repository files navigation

iOS-SIP.js

This is everything you need to get SIP.js running on iOS. Background incoming calls, Transfer, Hold, Mute, all working.

NOTE: SIP.js Video is not supported by this plugin at this time. Only Audio works.

Installation

Example Usage

You need to configure your SIP.js User Agent to use the custom media handler provided by this plugin when the environment is iOS + Cordova. See below for an example.

        window.ua = new SIP.UA({
          traceSip: false,
          log: {
            builtinEnabled: false
          },
          displayName: $scope.session.account.name,
          uri: $scope.sipUsername,
          rel100: 'supported',
          authorizationUser: $scope.sipUsername,
          password: $scope.sipPassword,
          wsServers: 'ws://'+$scope.sipDomain+':5066',
          register: true,
          mediaHandlerFactory: function defaultFactory (session, options) {        
            if (window.cordova && device.platform === 'iOS') {
              window.console.log('Using Custom Cordova Media Handler');
              PhoneRTCMediaHandler = cordova.require('com.bettervoice.phonertc.mediahandler')(SIP);
              return new PhoneRTCMediaHandler(session, options);
            }
            else {
              window.console.log('Using Normal SIP.js Media Handler');
              return new SIP.WebRTC.MediaHandler.defaultFactory(session, options);
            }        
          },
          media: {
            constraints: {
              audio: true,
              video: false
            },
            render: {
              remote: {
                audio: document.createElement('audio')
              }
            }
          }
        });

About

This is everything you need to get SIP.js running on iOS. Background incoming calls, Transfer, Hold, Mute, all working.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • JavaScript 88.9%
  • Objective-C 8.0%
  • Swift 2.7%
  • C 0.4%