mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-15 13:58:32 +00:00
FS-9683: Pass call recovery status to Verto
Previously, users implementing a Verto workflow where both user login and placing a new call are automated (eg., visiting a URL, and the videoconference loads automatically) faced the challenge of not having a reliable way to know that a page load will result in Verto's call recovery mechanism reconnecting an existing detached call or not. This adds a verto.clientReady JSON-RPC message, emitted after all calls are re-attached, which contains a 'reattached_sessions' array, containing the sess_id of any reattached session. Client side, this can be caught in the onMessage handler, under the $.verto.enum.message.clientReady key.
This commit is contained in:
1 parent
07d4d093b0
commit
34e491ffa1
6 files changed
+30
-1
No files matched your search
@@ -159,6 +159,9 @@ var callbacks = {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case $.verto.enum.message.clientReady:
|
||||
// console.error("clientReady", data);
|
||||
break;
|
||||
case $.verto.enum.message.info:
|
||||
var body = data.body;
|
||||
|
||||
|
||||
@@ -606,6 +606,11 @@
|
||||
|
||||
break;
|
||||
|
||||
case 'verto.clientReady':
|
||||
verto.callbacks.onMessage(verto, null, $.verto.enum.message.clientReady, data.params);
|
||||
console.debug("CLIENT READY", data.params);
|
||||
break;
|
||||
|
||||
default:
|
||||
console.error("INVALID METHOD OR NON-EXISTANT CALL REFERENCE IGNORED", data.method);
|
||||
break;
|
||||
@@ -2686,7 +2691,7 @@
|
||||
|
||||
$.verto.enum.state = $.verto.ENUM("new requesting trying recovering ringing answering early active held hangup destroy purge");
|
||||
$.verto.enum.direction = $.verto.ENUM("inbound outbound");
|
||||
$.verto.enum.message = $.verto.ENUM("display info pvtEvent");
|
||||
$.verto.enum.message = $.verto.ENUM("display info pvtEvent clientReady");
|
||||
|
||||
$.verto.enum = Object.freeze($.verto.enum);
|
||||
|
||||
|
||||
@@ -632,6 +632,11 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
|
||||
case $.verto.enum.message.display:
|
||||
$rootScope.$apply(function() {});
|
||||
break;
|
||||
case $.verto.enum.message.clientReady:
|
||||
$rootScope.$emit('clientReady', {
|
||||
reattached_sessions: params.reattached_sessions,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
console.warn('Got a not implemented message:', msg, dialog, params);
|
||||
break;
|
||||
|
||||
@@ -750,6 +750,9 @@ var callbacks = {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case $.verto.enum.message.clientReady:
|
||||
// console.error("clientReady", data);
|
||||
break;
|
||||
case $.verto.enum.message.info:
|
||||
if (data.msg) {
|
||||
data = data.msg;
|
||||
|
||||
@@ -441,6 +441,9 @@ var callbacks = {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case $.verto.enum.message.clientReady:
|
||||
// console.error("clientReady", data);
|
||||
break;
|
||||
case $.verto.enum.message.info:
|
||||
if (data.msg) {
|
||||
data = data.msg;
|
||||
|
||||
Reference in new issue
Block a user