Skip to content

Instantly share code, notes, and snippets.

@saukap
Last active July 1, 2017 07:02
Show Gist options
  • Save saukap/f7d6b29d128a36305faabe31900db4fa to your computer and use it in GitHub Desktop.
Save saukap/f7d6b29d128a36305faabe31900db4fa to your computer and use it in GitHub Desktop.
voxengine scenario - transmit headers when call is declined
require(Modules.PushService);
// VoxEngine.forwardCallToUser() <-- Previous code
// Code to transmit headers when call is declined.
VoxImplant.addEventListener(AppEvents.CallAlerting, function (e) {
var newCall = VoxEngine.callUser(e.destination, e.callerid, e.displayName, null, e.video);
VoxEngine.easyProcess(e.call, newCall, null);
newCall.addEventListener(CallEvents.Failed, function(ex) {
e.call.reject(ex.code, ex.headers);
});
});
require(Modules.PushService);
// VoxEngine.forwardCallToUserDirect() <-- Previous code
// Code to transmit headers when call is declined.
VoxImplant.addEventListener(AppEvents.CallAlerting, function (e) {
var newCall = VoxEngine.callUserDirect(e.call, e.destination, e.callerid, e.displayName, null);
VoxEngine.easyProcess(e.call, newCall, null, true);
newCall.addEventListener(CallEvents.Failed, function(ex) {
e.call.reject(ex.code, ex.headers);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment