onsip / SIP.js

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

Upgrading from v.0.7.8 to v.0.9.2 with temasys plugin #512

Closed amnporter closed 6 years ago

amnporter commented 6 years ago

I'm currently running into an error when trying to use SIP.js on IE11 with the temasys plugin. Everything works fine on chrome. Please have a look at the errors below and hopefully you'll be able to point me in the right direction.

I've confirmed that RTCOfferOptions is an empty object and modifiers is an empty array that is being passed into createOfferOrAnswer() to create the offer.

from plugin line 2: You'll notice we get 'Script error for "createOffer": Error: Argument 2 is not optional.'

661253 [1940] INFO FireBreath <> - C:\ws\plg\plugin_src\TemPeerConnectionDedicated.cpp:694 - TemWebRTC::TemPeerConnectionDedicated::addStream - Adding stream...
661254 [1940] INFO FireBreath <> - c:\ws\plg\firebreath\src\activexcore\JSAPI_IDispatchEx.h:546 - FB::ActiveX::JSAPI_IDispatchEx<class FB::ActiveX::COMJavascriptObject<&struct _GUID const CLSID_FBComJavascriptObject,struct IFBComJavascriptObject,&struct _GUID const DIID_IFBComEventSource,&struct _GUID const LIBID_PGiLib>,struct IFBComJavascriptObject,&struct _GUID const DIID_IFBComEventSource>::InvokeEx - Script error for "createOffer": Error: Argument 2 is not optional.
661305 [1940] INFO FireBreath <> - C:\ws\plg\plugin_src\TemPeerConnectionDedicated.cpp:988 - TemWebRTC::TemPeerConnectionDedicated::close_w - Removing stream from peerconnection...
661305 [6184] INFO FireBreath <> - C:\ws\plg\plugin_src\TemJSLogger.cpp:70 - TemWebRTC::TemJSLogger::OnLogMessage - [WEBRTC] <--> (webrtcsession.cc:818): Session:8386692613985689057 Old state:STATE_INIT New state:STATE_CLOSED”

363838 [14004] INFO FireBreath <> - C:\ws\plg\plugin_src\TemJSLogger.cpp:70 - TemWebRTC::TemJSLogger::OnLogMessage - [WEBRTC] <--> (webrtcvoiceengine.cc:981): webrtc: VideoCaptureWindowsDSInfo::VideoCaptureWindowsDSInfo CoInitializeEx(NULL, COINIT_APARTMENTTHREADED) => RPC_E_CHANGED_MODE, error 0x80010106

from SIP.js:

Error: Error: Argument 2 is not optional.
   at createOfferOrAnswer (/js/sip-0.9.2.js:8901:9)
   at streamAdditionSucceeded (/js/sip-0.9.2.js:8790:11)
   at ZoneDelegate.prototype.invoke (/polyfills.bundle.js:8918:13)
   at onInvoke (vendor.bundle.js:94533:13)
   at ZoneDelegate.prototype.invoke /polyfills.bundle.js:8918:13)
   at Zone.prototype.run (/polyfills.bundle.js:8670:17)
   at Anonymous function (/polyfills.bundle.js:9401:17)
   at ZoneDelegate.prototype.invokeTask (/polyfills.bundle.js:8951:13)
   at onInvokeTask (/vendor.bundle.js:94524:13)
   at ZoneDelegate.prototype.invokeTask (/polyfills.bundle.js:8951:13)
   at Zone.prototype.runTask (/polyfills.bundle.js:8720:21)"

Here is the SIP logging as well:

Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | configuration parameters after validation:
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · viaHost: "REMOVED.invalid"
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · uri: sip: REMOVED
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · wsServers: [{"ws_uri":"wss://REMOVED.com:443","sip_uri":"<sip:REMOVED.com:443;transport=ws;lr>","weight":0,"status":0,"scheme":"WSS"}]
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · custom: {}
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · displayName: ""
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · password: NOT SHOWN
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · registerExpires: 600
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · register: false
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · registrarServer: sip:REMOVED.com
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · wsServerMaxReconnection: 3
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · wsServerReconnectionTimeout: 4
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · connectionRecoveryMinInterval: 2
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · connectionRecoveryMaxInterval: 30
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · keepAliveInterval: 0
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · extraSupported: []
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · usePreloadedRoute: false
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · userAgentString: "REMOVED.d6hbuzoi5987eg10000000000"
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · noAnswerTimeout: 60000
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · traceSip: true
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · hackViaTcp: false
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · hackIpInContact: false
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · hackWssInTransport: false
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · hackAllowUnregisteredOptionTags: false
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · sessionDescriptionHandlerFactoryOptions: {"constraints":{},"peerConnectionOptions":{}}
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · contactName: "asdfghjk"
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · contactTransport: "ws"
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · forceRport: false
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · autostart: true
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · autostop: true
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · rel100: "none"
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · replaces: "none"
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · sessionDescriptionHandlerFactory: function defaultFactory(session, options) {
    return new SessionDescriptionHandler(session, options);
  }
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · authenticationFactory: undefined
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · allowLegacyNotifications: false
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · allowOutOfDialogRefers: false
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · authorizationUser: "websip"
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · instanceId: "asdfghjk-asdf-asdf-asdf-asdfghjklzxc"
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · sipjsId: "asdfg"
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | · hostportParams: "REMOVED.com"
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | user requested startup...
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.transport | connecting to WebSocket wss://REMOVED.com:443
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.transport | WebSocket wss://REMOVED.com:443 connected
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | connection state set to 0
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.invitecontext.sessionDescriptionHandler | qu3sb8t29b0du6c2qume0000000000 | initPeerConnection
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.invitecontext.sessionDescriptionHandler | qu3sb8t29b0du6c2qume0000000000 | New peer connection created
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.invitecontext.sessionDescriptionHandler | qu3sb8t29b0du6c2qume0000000000 | acquiring local media
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.invitecontext.sessionDescriptionHandler | qu3sb8t29b0du6c2qume0000000000 | acquired local media streams
session.on('failed'){
  response: null
  cause: WebRTC Error
  SESSION_FAILED
       [
          0: "SESSION_FAILED",
          length: 1
       ]
}
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | user requested closure...
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | closing registerContext
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | closing session qu3sb8t29b0du6c2qume0000000000
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.inviteclientcontext | canceling RTCSession
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.inviteclientcontext | closing INVITE session qu3sb8t29b0du6c2qume0000000000
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.invitecontext.sessionDescriptionHandler | qu3sb8t29b0du6c2qume0000000000 | closing PeerConnection
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.invitecontext.sessionDescriptionHandler | qu3sb8t29b0du6c2qume0000000000 | Using getLocalStreams which is deprecated
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.invitecontext.sessionDescriptionHandler | qu3sb8t29b0du6c2qume0000000000 | Using getRemoteStreams which is deprecated
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.transport | closing WebSocket wss://REMOVED.com:443
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.transport | WebSocket disconnected (code: 1000| reason: Normal closure)
Mon Feb 12 2018 12:30:28 GMT-0500 (Eastern Standard Time) | sip.ua | connection state set to 1
SCRIPT5007: Unable to get property 'iceConnectionState' of undefined or null reference 
app (7,17937)
egreenmachine commented 6 years ago

Questions like this are best suited our mailing list, as this is not a bug in SIP.js. I am going to close this issue, and if anything else comes up please follow up there. Additionally, we do not support Temasys. With all that being said, we suspect that the Temasys plugin you are using is out of date. Between 0.7.X and 0.9.X we have moved from callback based WebRTC APIs (which have been deprecated) to promise based APIs. As you can see for the documentation on createOffer, the callback version does require 2 arguments and the promise version has no required arguments.

If you cannot get a Temasys plugin that supports the promise based API, then the last option is to copy our WebRTC.SessionDescriptionHandler and create your own with callback based WebRTC API's. It would not be a huge undertaking, but it is not something that we are going to officially support on the SIP.js side as we are trying to stick to spec.