I'm having problems getting the audio to flow with SIP.js 0.8.3 on Safari to a FreeSWITCH MSU.
I've tried with the minimal Alice/Bob application from the https://sipjs.com/ homepage. (I did modify the Simple.js code so that registration is not required.)
On investigation I have found that Safari defines the addTrack() method on the peerConnection, but if we use this path in SessionDescriptionHandler::getDescription() then nothing is added to the peerConnection local stream (as evidenced by printing peerConnection.getLocalStreams() at regular intervals). Firefox will create a local stream after the tracks are added.
If I modify SIP.js to use the peerConnection.addStream() method then both of the audio and video tracks are added to the stream. But, I still cannot see an outgoing audio stream. I am using the PCMU codec for audio.
In both of these cases the video works fine!! In the absence of a "chrome://webrtc-internals" page in Safari I have checked the delivery of the audio RTP packets in FreeSWITCH and Wireshark.
I can't see any glaring problems with the SIP.js code but it seems that many application (eg. https://appr.tc) are working fine on Safari! I attached the minimal webpage that I have been using.
Has anyone got SIP.js 0.8.3 working on Safari?
Thanks,
Richard
Demo page:
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>WebRTC Demo</title>
<script src="sip.js"></script>
</head>
<body>
<video id="video-of-bob"></video>
<video id="video-of-alice" muted="muted"></video>
<button id="alice-video-button" class="right" type="button">video</button>
<script>
var domain = 'example.com'; //CHANGED
var aliceURI = 'alice.' + window.token + '@' + domain;
var aliceName = 'Alice';
var bobURI = "sip:li...@example.com"; //CHANGED
var bobName = 'Bob';
// Function: createSimple
// creates a SIP.js Simple instance with the given arguments plugged into the
// configuration. This is a standard Simple instance for WebRTC calls.
//
// Arguments:
// callerURI: the URI of the caller, aka, the URI that belongs to this user.
// displayName: what name we should display the user as
// remoteVideo: the DOM element id of the video for the remote
// buttonId: the DOM element id of the button for that user
function createSimple(callerURI, displayName, target, remoteVideo, buttonId) {
var remoteVideoElement = document.getElementById(remoteVideo);
var button = document.getElementById(buttonId);
var configuration = {
media: {
remote: {
video: remoteVideoElement,
// Need audio to be not null to do audio & video instead of just video
audio: remoteVideoElement
}
},
ua: {
wsServers: "wss://example.com/websocket", //ADDED
register: false, //ADDED
traceSip: true,
uri: callerURI,
displayName: displayName,
userAgentString: SIP.C.USER_AGENT + " sipjs.com"
}
};
var simple = new SIP.WebRTC.Simple(configuration);
button.addEventListener('click', function() {
// No current call up
if (simple.state === SIP.WebRTC.Simple.C.STATUS_NULL ||
simple.state === SIP.WebRTC.Simple.C.STATUS_COMPLETED) {
simple.call(target);
} else {
simple.hangup();
}
});
return simple;
}
var aliceSimple = createSimple(aliceURI, aliceName, bobURI, 'video-of-bob', 'alice-video-button');
</script>
</body>
</html>
```
Thanks Eric, i'll check it out on Monday!
--
You received this message because you are subscribed to a topic in the Google Groups "SIP.js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sip_js/Cax3oYUI8xs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sip_js+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sip_js/41040b33-409a-4765-8a04-7b56aa73a1a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.