TypeError: null is not an object (evaluating 'constraints.optional')] when call sipUa.call

51 Views Asked by At

I have a problem when trying to run sipUA.call. Below is my configuration, until now I am still not sure what's wrong.

let options = { "eventHandlers": { failed: e => _eventCallback("failed", e), ended: e => _eventCallback("ended", e), }, "mediaConstraints": { audio: true, video: true }, }; 
this.sipUA.call(callNumber, options);

Here is the log:

[TypeError: null is not an object (evaluating 'constraints.optional')]

Thank you so much for help

Try this in my options variable

{ "eventHandlers": { failed: e => _eventCallback("failed", e), ended: e => _eventCallback("ended", e) }, "mediaConstraints": { audio: true, video: true } }

or

{ "eventHandlers": { failed: (e) => { _eventCallback("failed", e); }, ended: (e) => { _eventCallback("ended", e); } }, "mediaConstraints": { audio: true, video: true } }

I already try both of them but the error still stays the same, this happens on my phone with Android 10 and iPhone with ios 16.4.1. But on my phone with Android 9, it runs normally without any errors. In my Android 9 phone, it will request permission to microphone and my camera as well. I still could not figure out this error. Been stuck here a few days and I think everything is already correct. I also already upgrade react-native-jssip to the newest version but still the same.

0

There are 0 best solutions below