Created
July 6, 2016 08:27
-
-
Save daothanh/e97a0b3025f4d313a71baa95ff47d2c6 to your computer and use it in GitHub Desktop.
Cach gui signal cuoc goi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Gui signal begin call | |
session.signal({ | |
type: "begincall", | |
to: _stream.connection, | |
data: { | |
streamId: _selfstream.streamId + "|" + _selfstream.name | |
} | |
}, function(error) { | |
if (error) { | |
console.log("signal error: " + error.reason); | |
} else { | |
console.log("signal sent: begincall:"); | |
} | |
}); | |
// GUi signal accept call | |
session.signal({ | |
type: "acceptcall", | |
to: _streams[_streamId].connection, | |
data: { | |
callaccepted: _selfstream.streamId + "|" + _selfstream.name + "|yes" | |
} | |
}, | |
function(error) { | |
if (error) { | |
console.log("signal error: " + error.reason); | |
} else { | |
console.log("signal sent"); | |
} | |
} | |
); | |
//GUi signal khi reject call | |
session.signal({ | |
type: "acceptcall", | |
to: _streams[_streamId].connection, | |
data: { | |
callaccepted: _selfstream.streamId + "|" + _selfstream.name + "|no" | |
} | |
}, | |
function(error) { | |
if (error) { | |
console.log("signal error: " + error.reason); | |
} else { | |
console.log("signal sent"); | |
} | |
} | |
); | |
//Gui signal khi end call | |
session.signal({ | |
type: "endcall", | |
to: _stream.connection, | |
data: { | |
streamId: _selfstream.streamId + "|" + _selfstream.name | |
} | |
}, function(error) { | |
if (error) { | |
console.log("signal error: " + error.reason); | |
} else { | |
console.log("signal sent"); | |
disconnect(); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment