提交 e7700c0a authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-6665 #resolve #comment This should fix it

上级 b186ca9f
This diff was suppressed by a .gitattributes entry.
...@@ -111,7 +111,9 @@ var callbacks = { ...@@ -111,7 +111,9 @@ var callbacks = {
$("#ansbtn").click(function() { $("#ansbtn").click(function() {
cur_call.answer({ cur_call.answer({
useStereo: $("#use_stereo").is(':checked') useStereo: $("#use_stereo").is(':checked'),
callee_id_name: $("#name").val(),
callee_id_number: $("#cid").val(),
}); });
$('#dialog-incoming-call').dialog('close'); $('#dialog-incoming-call').dialog('close');
}); });
......
...@@ -1779,6 +1779,8 @@ ...@@ -1779,6 +1779,8 @@
if (params.useVideo) { if (params.useVideo) {
dialog.useVideo(true); dialog.useVideo(true);
} }
dialog.params.callee_id_name = params.callee_id_name;
dialog.params.callee_id_number = params.callee_id_number;
} }
dialog.rtc.createAnswer(dialog.params.sdp); dialog.rtc.createAnswer(dialog.params.sdp);
dialog.answered = true; dialog.answered = true;
......
...@@ -934,7 +934,7 @@ static void set_call_params(cJSON *params, verto_pvt_t *tech_pvt) { ...@@ -934,7 +934,7 @@ static void set_call_params(cJSON *params, verto_pvt_t *tech_pvt) {
caller_id_name = switch_channel_get_variable(tech_pvt->channel, "callee_id_name"); caller_id_name = switch_channel_get_variable(tech_pvt->channel, "callee_id_name");
caller_id_number = switch_channel_get_variable(tech_pvt->channel, "callee_id_number"); caller_id_number = switch_channel_get_variable(tech_pvt->channel, "callee_id_number");
} }
if (zstr(caller_id_name)) { if (zstr(caller_id_name)) {
caller_id_name = "Outbound Call"; caller_id_name = "Outbound Call";
} }
...@@ -1924,7 +1924,8 @@ static switch_bool_t verto__answer_func(const char *method, cJSON *params, jsock ...@@ -1924,7 +1924,8 @@ static switch_bool_t verto__answer_func(const char *method, cJSON *params, jsock
cJSON *dialog = NULL; cJSON *dialog = NULL;
const char *call_id = NULL, *sdp = NULL; const char *call_id = NULL, *sdp = NULL;
int err = 0; int err = 0;
const char *callee_id_name = NULL, *callee_id_number = NULL;
*response = obj; *response = obj;
if (!(dialog = cJSON_GetObjectItem(params, "dialogParams"))) { if (!(dialog = cJSON_GetObjectItem(params, "dialogParams"))) {
...@@ -1942,6 +1943,9 @@ static switch_bool_t verto__answer_func(const char *method, cJSON *params, jsock ...@@ -1942,6 +1943,9 @@ static switch_bool_t verto__answer_func(const char *method, cJSON *params, jsock
err = 1; goto cleanup; err = 1; goto cleanup;
} }
callee_id_name = cJSON_GetObjectCstr(dialog, "callee_id_name");
callee_id_number = cJSON_GetObjectCstr(dialog, "callee_id_number");
if ((session = switch_core_session_locate(call_id))) { if ((session = switch_core_session_locate(call_id))) {
verto_pvt_t *tech_pvt = switch_core_session_get_private_class(session, SWITCH_PVT_SECONDARY); verto_pvt_t *tech_pvt = switch_core_session_get_private_class(session, SWITCH_PVT_SECONDARY);
...@@ -1968,6 +1972,12 @@ static switch_bool_t verto__answer_func(const char *method, cJSON *params, jsock ...@@ -1968,6 +1972,12 @@ static switch_bool_t verto__answer_func(const char *method, cJSON *params, jsock
} }
if (!err) { if (!err) {
if (callee_id_name) {
switch_channel_set_profile_var(tech_pvt->channel, "callee_id_name", callee_id_name);
}
if (callee_id_number) {
switch_channel_set_profile_var(tech_pvt->channel, "callee_id_number", callee_id_number);
}
switch_channel_mark_answered(tech_pvt->channel); switch_channel_mark_answered(tech_pvt->channel);
} }
...@@ -3855,7 +3865,7 @@ static switch_call_cause_t verto_outgoing_channel(switch_core_session_t *session ...@@ -3855,7 +3865,7 @@ static switch_call_cause_t verto_outgoing_channel(switch_core_session_t *session
if (!zstr(outbound_profile->destination_number)) { if (!zstr(outbound_profile->destination_number)) {
dest = strdup(outbound_profile->destination_number); dest = strdup(outbound_profile->destination_number);
} }
if (zstr(dest)) { if (zstr(dest)) {
goto end; goto end;
} }
...@@ -3863,6 +3873,15 @@ static switch_call_cause_t verto_outgoing_channel(switch_core_session_t *session ...@@ -3863,6 +3873,15 @@ static switch_call_cause_t verto_outgoing_channel(switch_core_session_t *session
if (!switch_stristr("u:", dest)) { if (!switch_stristr("u:", dest)) {
char *dial_str = verto_get_dial_string(dest, NULL); char *dial_str = verto_get_dial_string(dest, NULL);
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "verto_orig_dest", dest);
if (zstr(switch_event_get_header(var_event, "origination_callee_id_number"))) {
char *trimmed_dest = strdup(dest);
char *p = strchr(trimmed_dest, '@');
if (p) *p = '\0';
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "origination_callee_id_number", trimmed_dest);
free(trimmed_dest);
}
cause = SWITCH_CAUSE_USER_NOT_REGISTERED; cause = SWITCH_CAUSE_USER_NOT_REGISTERED;
if (dial_str) { if (dial_str) {
...@@ -3885,6 +3904,21 @@ static switch_call_cause_t verto_outgoing_channel(switch_core_session_t *session ...@@ -3885,6 +3904,21 @@ static switch_call_cause_t verto_outgoing_channel(switch_core_session_t *session
} }
return cause; return cause;
} else {
const char *dialed_user = switch_event_get_header(var_event, "dialed_user");
const char *dialed_domain = switch_event_get_header(var_event, "dialed_domain");
if (dialed_user) {
if (dialed_domain) {
switch_event_add_header(var_event, SWITCH_STACK_BOTTOM, "verto_orig_dest", "%s@%s", dialed_user, dialed_domain);
} else {
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "verto_orig_dest", dialed_user);
}
if (zstr(switch_event_get_header(var_event, "origination_callee_id_number"))) {
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "origination_callee_id_number", dialed_user);
outbound_profile->callee_id_number = switch_sanitize_number(switch_core_strdup(outbound_profile->pool, dialed_user));
}
}
} }
if ((cause = switch_core_session_outgoing_channel(session, var_event, "rtc", if ((cause = switch_core_session_outgoing_channel(session, var_event, "rtc",
......
...@@ -3502,7 +3502,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s ...@@ -3502,7 +3502,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG,
"Bah HUMBUG! Sticking with %s@%uh@%ui\n", "Bah HUMBUG! Sticking with %s@%uh@%ui\n",
imp->iananame, imp->samples_per_second, imp->microseconds_per_packet / 1000); imp->iananame, imp->samples_per_second, imp->microseconds_per_packet / 1000);
} else if ((ptime && codec_ms && codec_ms * 1000 != imp->microseconds_per_packet) || remote_codec_rate != codec_rate || map_channels != imp->number_of_channels) { } else if ((ptime && codec_ms && codec_ms * 1000 != imp->microseconds_per_packet) || remote_codec_rate != codec_rate) {
/* ptime does not match */ /* ptime does not match */
match = 0; match = 0;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论