mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-14 08:05:37 +00:00
FS-6665 #resolve #comment This should fix it
This commit is contained in:
parent
b186ca9f74
commit
e7700c0ac4
3
html5/verto/demo/js/verto-min.js
vendored
3
html5/verto/demo/js/verto-min.js
vendored
@ -210,7 +210,8 @@ if(dialog.state.val>$.verto.enum.state.new.val&&dialog.state.val<$.verto.enum.st
|
||||
dialog.rtc.useVideo(dialog.videoStream);};$.verto.dialog.prototype.useStereo=function(on){var dialog=this;dialog.params.useStereo=on;dialog.rtc.useStereo(on);};$.verto.dialog.prototype.dtmf=function(digits){var dialog=this;if(digits){dialog.sendMethod("verto.info",{dtmf:digits});}};$.verto.dialog.prototype.transfer=function(dest,params){var dialog=this;if(dest){cur_call.sendMethod("verto.modify",{action:"transfer",destination:dest,params:params});}};$.verto.dialog.prototype.hold=function(params){var dialog=this;cur_call.sendMethod("verto.modify",{action:"hold",params:params});};$.verto.dialog.prototype.unhold=function(params){var dialog=this;cur_call.sendMethod("verto.modify",{action:"unhold",params:params});};$.verto.dialog.prototype.toggleHold=function(params){var dialog=this;cur_call.sendMethod("verto.modify",{action:"toggleHold",params:params});};$.verto.dialog.prototype.message=function(msg){var dialog=this;var err=0;if(!msg.to){console.error("Missing To");err++;}
|
||||
if(!msg.body){console.error("Missing Body");err++;}
|
||||
if(err){return false;}
|
||||
dialog.sendMethod("verto.info",{msg:msg});return true;};$.verto.dialog.prototype.answer=function(params){var dialog=this;if(!dialog.answered){if(params){if(params.useVideo){dialog.useVideo(true);}}
|
||||
dialog.sendMethod("verto.info",{msg:msg});return true;};$.verto.dialog.prototype.answer=function(params){var dialog=this;if(!dialog.answered){if(params){if(params.useVideo){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.answered=true;}};$.verto.dialog.prototype.handleAnswer=function(params){var dialog=this;if(dialog.state.val>=$.verto.enum.state.active.val){return;}
|
||||
if(dialog.state.val>=$.verto.enum.state.early.val){dialog.setState($.verto.enum.state.active);}else{dialog.rtc.answer(params.sdp,function(){dialog.setState($.verto.enum.state.active);},function(e){console.error(e);dialog.hangup();});console.log("ANSWER SDP",params.sdp);}};$.verto.dialog.prototype.cidString=function(enc){var dialog=this;var party=dialog.params.remote_caller_id_name+(enc?" <":" <")+dialog.params.remote_caller_id_number+(enc?">":">");return party;};$.verto.dialog.prototype.sendMessage=function(msg,params){var dialog=this;if(dialog.callbacks.onMessage){dialog.callbacks.onMessage(dialog.verto,dialog,msg,params);}};$.verto.dialog.prototype.handleInfo=function(params){var dialog=this;dialog.sendMessage($.verto.enum.message.info,params.msg);};$.verto.dialog.prototype.handleDisplay=function(params){var dialog=this;if(params.display_name){dialog.params.remote_caller_id_name=params.display_name;}
|
||||
if(params.display_number){dialog.params.remote_caller_id_number=params.display_number;}
|
||||
|
@ -111,7 +111,9 @@ var callbacks = {
|
||||
|
||||
$("#ansbtn").click(function() {
|
||||
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');
|
||||
});
|
||||
|
@ -1779,6 +1779,8 @@
|
||||
if (params.useVideo) {
|
||||
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.answered = true;
|
||||
|
@ -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_number = switch_channel_get_variable(tech_pvt->channel, "callee_id_number");
|
||||
}
|
||||
|
||||
|
||||
if (zstr(caller_id_name)) {
|
||||
caller_id_name = "Outbound Call";
|
||||
}
|
||||
@ -1924,7 +1924,8 @@ static switch_bool_t verto__answer_func(const char *method, cJSON *params, jsock
|
||||
cJSON *dialog = NULL;
|
||||
const char *call_id = NULL, *sdp = NULL;
|
||||
int err = 0;
|
||||
|
||||
const char *callee_id_name = NULL, *callee_id_number = NULL;
|
||||
|
||||
*response = obj;
|
||||
|
||||
if (!(dialog = cJSON_GetObjectItem(params, "dialogParams"))) {
|
||||
@ -1942,6 +1943,9 @@ static switch_bool_t verto__answer_func(const char *method, cJSON *params, jsock
|
||||
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))) {
|
||||
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
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@ -3855,7 +3865,7 @@ static switch_call_cause_t verto_outgoing_channel(switch_core_session_t *session
|
||||
if (!zstr(outbound_profile->destination_number)) {
|
||||
dest = strdup(outbound_profile->destination_number);
|
||||
}
|
||||
|
||||
|
||||
if (zstr(dest)) {
|
||||
goto end;
|
||||
}
|
||||
@ -3863,6 +3873,15 @@ static switch_call_cause_t verto_outgoing_channel(switch_core_session_t *session
|
||||
if (!switch_stristr("u:", dest)) {
|
||||
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;
|
||||
|
||||
if (dial_str) {
|
||||
@ -3885,6 +3904,21 @@ static switch_call_cause_t verto_outgoing_channel(switch_core_session_t *session
|
||||
}
|
||||
|
||||
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",
|
||||
|
@ -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,
|
||||
"Bah HUMBUG! Sticking with %s@%uh@%ui\n",
|
||||
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 */
|
||||
match = 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user