Work SIP with Vue

463 views
Skip to first unread message

jers...@gmail.com

unread,
Jun 15, 2019, 6:38:01 PM6/15/19
to SIP.js
Hi there, I'm trying to use this library inside a vue project and the call is working fine also of close method. However when I try to get the answers provided by session function through of .on event I cant find to get the data inside of each .on event.

All looks like it is working with a type of promise or something like that

Example:
newSess.on("accepted", (e) => {
console.log("EVENT - Accepted");
state.accepted = true;
stopRinging();

//- attachMediaToSession Functionality
// attachMediaToSession(newSess);
if (state.accepted === true) {
let pc = newSess.sessionDescriptionHandler.peerConnection;
let Stream = '';

if (pc.getReceivers) {
Stream = new window.MediaStream();
pc.getReceivers().forEach(function (receiver) {
let track = receiver.track;
if (track) {
Stream.addTrack(track);
}
});
} else {
Stream = pc.getRemoteStreams()[0];
}

var domElement = document.getElementById("voice");
domElement.srcObject = Stream;
domElement.play();
}

console.log("Answered " + lastdial);
});
I cant get the vars modified inside before vue load so the data is not rendered into the template updated.

Please help!!!

Reply all
Reply to author
Forward
0 new messages