提交 7bbdbadb authored 作者: Anthony Minessale's avatar Anthony Minessale

tweak some cid display issues

上级 eccf505a
This diff was suppressed by a .gitattributes entry.
......@@ -1430,9 +1430,13 @@
var RTCcallbacks = {};
if (dialog.direction == $.verto.enum.direction.inbound) {
if (dialog.params.display_direction === "outbound") {
dialog.params.remote_caller_id_name = dialog.params.caller_id_name;
dialog.params.remote_caller_id_number = dialog.params.caller_id_number;
} else {
dialog.params.remote_caller_id_name = dialog.params.callee_id_name;
dialog.params.remote_caller_id_number = dialog.params.callee_id_number;
}
if (!dialog.params.remote_caller_id_name) {
dialog.params.remote_caller_id_name = "Nobody";
......
......@@ -963,33 +963,25 @@ static switch_bool_t check_auth(jsock_t *jsock, cJSON *params, int *code, char *
static void set_call_params(cJSON *params, verto_pvt_t *tech_pvt) {
const char *caller_id_name = NULL;
const char *caller_id_number = NULL;
const char *callee_id_name = NULL;
const char *callee_id_number = NULL;
if (switch_channel_outbound_display(tech_pvt->channel)) {
caller_id_name = switch_channel_get_variable(tech_pvt->channel, "caller_id_name");
caller_id_number = switch_channel_get_variable(tech_pvt->channel, "caller_id_number");
} else {
caller_id_name = switch_channel_get_variable(tech_pvt->channel, "verto_remote_caller_id_name");
caller_id_number = switch_channel_get_variable(tech_pvt->channel, "verto_remote_caller_id_number");
callee_id_name = switch_channel_get_variable(tech_pvt->channel, "callee_id_name");
callee_id_number = switch_channel_get_variable(tech_pvt->channel, "callee_id_number");
if (!caller_id_name) {
caller_id_name = switch_channel_get_variable(tech_pvt->channel, "callee_id_name");
}
if (caller_id_name) cJSON_AddItemToObject(params, "caller_id_name", cJSON_CreateString(caller_id_name));
if (caller_id_number) cJSON_AddItemToObject(params, "caller_id_number", cJSON_CreateString(caller_id_number));
if (!caller_id_number) {
caller_id_number = switch_channel_get_variable(tech_pvt->channel, "callee_id_number");
}
}
if (callee_id_name) cJSON_AddItemToObject(params, "callee_id_name", cJSON_CreateString(callee_id_name));
if (callee_id_number) cJSON_AddItemToObject(params, "callee_id_number", cJSON_CreateString(callee_id_number));
cJSON_AddItemToObject(params, "display_direction",
cJSON_CreateString(switch_channel_direction(tech_pvt->channel) == SWITCH_CALL_DIRECTION_OUTBOUND ? "outbound" : "inbound"));
if (zstr(caller_id_name)) {
caller_id_name = "Outbound Call";
}
if (zstr(caller_id_number)) {
caller_id_number = switch_channel_get_variable(tech_pvt->channel, "destination_number");
}
cJSON_AddItemToObject(params, "caller_id_name", cJSON_CreateString(caller_id_name));
cJSON_AddItemToObject(params, "caller_id_number", cJSON_CreateString(caller_id_number));
}
static jsock_t *get_jsock(const char *uuid)
......@@ -1883,8 +1875,12 @@ static switch_status_t messagehook (switch_core_session_t *session, switch_core_
if (name || number) {
jmsg = jrpc_new_req("verto.display", tech_pvt->call_id, &params);
switch_ivr_eavesdrop_update_display(session, name, number);
switch_channel_set_variable(tech_pvt->channel, "last_sent_display_name", name);
switch_channel_set_variable(tech_pvt->channel, "last_sent_display_number", number);
cJSON_AddItemToObject(params, "display_name", cJSON_CreateString(name));
cJSON_AddItemToObject(params, "display_number", cJSON_CreateString(number));
set_call_params(params, tech_pvt);
jsock_queue_event(jsock, &jmsg, SWITCH_TRUE);
}
......
......@@ -1691,7 +1691,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(const char *originator_uu
if (switch_channel_direction(originator_channel) == SWITCH_CALL_DIRECTION_OUTBOUND && !switch_channel_test_flag(originator_channel, CF_DIALPLAN)) {
if (!switch_channel_test_flag(originator_channel, CF_RECOVERING_BRIDGE)) {
switch_channel_flip_cid(originator_channel);
}
switch_channel_set_flag(originator_channel, CF_DIALPLAN);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论