Merge pull request #1031 in FS/freeswitch from ~THEHUNMONKGROUP/freeswitch:feature/FS-9683-pass-call-recovery-status-to-verto to master

* commit '34e491ffa1dca32846d1e0fb97e71f5ac7c34d22':
  FS-9683: Pass call recovery status to Verto
This commit is contained in:
Mike Jerris 2017-08-10 18:41:39 +00:00
commit 9127c41316
6 changed files with 30 additions and 1 deletions

View File

@ -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;

View File

@ -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;
@ -2682,7 +2687,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);

View File

@ -639,6 +639,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;

View File

@ -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;

View File

@ -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;

View File

@ -1232,6 +1232,11 @@ static void drop_detached(void)
static void attach_calls(jsock_t *jsock)
{
verto_pvt_t *tech_pvt;
cJSON *msg = NULL;
cJSON *params = NULL;
cJSON *reattached_sessions = NULL;
reattached_sessions = cJSON_CreateArray();
switch_thread_rwlock_rdlock(verto_globals.tech_rwlock);
for(tech_pvt = verto_globals.tech_head; tech_pvt; tech_pvt = tech_pvt->next) {
@ -1241,9 +1246,14 @@ static void attach_calls(jsock_t *jsock)
}
tech_reattach(tech_pvt, jsock);
cJSON_AddItemToArray(reattached_sessions, cJSON_CreateString(jsock->uuid_str));
}
}
switch_thread_rwlock_unlock(verto_globals.tech_rwlock);
msg = jrpc_new_req("verto.clientReady", NULL, &params);
cJSON_AddItemToObject(params, "reattached_sessions", reattached_sessions);
jsock_queue_event(jsock, &msg, SWITCH_TRUE);
}
static void detach_calls(jsock_t *jsock)