diff --git a/html5/verto/video_demo/index.html b/html5/verto/video_demo/index.html index 84657696bc..1ed53637ce 100644 --- a/html5/verto/video_demo/index.html +++ b/html5/verto/video_demo/index.html @@ -95,8 +95,29 @@
+
+ + + + + + + + + + + + + + + +
+ + +
+ +

-


+ + +
+
+ Max Outgoing Bandwidth: + + + + + + + + + + + + + + + + + + + + + + + + + + +
+


+ + +
+
+ Max Incoming Bandwidth: + + + + + + + + + + + + + + + + + + + + + + + + + +
+


+ + -
diff --git a/html5/verto/video_demo/verto.js b/html5/verto/video_demo/verto.js index f42757ab83..a5a2367c29 100644 --- a/html5/verto/video_demo/verto.js +++ b/html5/verto/video_demo/verto.js @@ -13,6 +13,8 @@ var vid_height = 180; var local_vid_width = 320; var local_vid_height = 180; +var outgoingBandwidth; +var incomingBandwidth; $( ".selector" ).pagecontainer({ "theme": "a" }); @@ -537,6 +539,8 @@ function docall() { destination_number: $("#ext").val(), caller_id_name: $("#name").val(), caller_id_number: $("#cid").val(), + outgoingBandwidth: outgoingBandwidth, + incomingBandwidth: incomingBandwidth, useVideo: check_vid(), useStereo: $("#use_stereo").is(':checked'), useCamera: $("#usecamera").find(":selected").val(), @@ -567,6 +571,8 @@ function doshare(on) { destination_number: $("#ext").val() + "-screen", caller_id_name: $("#name").val() + " (Screen)", caller_id_number: $("#cid").val() + " (screen)", + outgoingBandwidth: outgoingBandwidth, + incomingBandwidth: incomingBandwidth, videoParams: screen_constraints.video.mandatory, useVideo: true, screenShare: true @@ -707,6 +713,162 @@ function init() { }); }); +// + outgoingBandwidth = $.cookie("verto_demo_outgoingBandwidth") || "default"; + $.cookie("verto_demo_outgoingBandwidth", outgoingBandwidth, { + expires: 365 + }); + + $("#outgoingBandwidth_250kb").prop("checked", outgoingBandwidth === "250").change(function(e) { + if ($("#outgoingBandwidth_250kb").is(':checked')) { + outgoingBandwidth = "250"; + $.cookie("verto_demo_outgoingBandwidth", outgoingBandwidth, { + expires: 365 + }); + } + }); + + $("#outgoingBandwidth_500kb").prop("checked", outgoingBandwidth === "500").change(function(e) { + if ($("#outgoingBandwidth_500kb").is(':checked')) { + outgoingBandwidth = "500"; + $.cookie("verto_demo_outgoingBandwidth", outgoingBandwidth, { + expires: 365 + }); + } + }); + + $("#outgoingBandwidth_1024kb").prop("checked", outgoingBandwidth === "1024").change(function(e) { + if ($("#outgoingBandwidth_1024kb").is(':checked')) { + outgoingBandwidth = "1024"; + $.cookie("verto_demo_outgoingBandwidth", outgoingBandwidth, { + expires: 365 + }); + } + }); + + $("#outgoingBandwidth_1536kb").prop("checked", outgoingBandwidth === "1536").change(function(e) { + if ($("#outgoingBandwidth_1536kb").is(':checked')) { + outgoingBandwidth = "1536"; + $.cookie("verto_demo_outgoingBandwidth", outgoingBandwidth, { + expires: 365 + }); + } + }); + + $("#outgoingBandwidth_2048kb").prop("checked", outgoingBandwidth === "2048").change(function(e) { + if ($("#outgoingBandwidth_2048kb").is(':checked')) { + outgoingBandwidth = "2048"; + $.cookie("verto_demo_outgoingBandwidth", outgoingBandwidth, { + expires: 365 + }); + } + }); + + $("#outgoingBandwidth_5120kb").prop("checked", outgoingBandwidth === "5120").change(function(e) { + if ($("#outgoingBandwidth_5120kb").is(':checked')) { + outgoingBandwidth = "5120"; + $.cookie("verto_demo_outgoingBandwidth", outgoingBandwidth, { + expires: 365 + }); + } + }); + + $("#outgoingBandwidth_0kb").prop("checked", outgoingBandwidth === "0").change(function(e) { + if ($("#outgoingBandwidth_0kb").is(':checked')) { + outgoingBandwidth = "0"; + $.cookie("verto_demo_outgoingBandwidth", outgoingBandwidth, { + expires: 365 + }); + } + }); + + $("#outgoingBandwidth_default").prop("checked", outgoingBandwidth === "default").change(function(e) { + if ($("#outgoingBandwidth_default").is(':checked')) { + outgoingBandwidth = "default"; + $.cookie("verto_demo_outgoingBandwidth", outgoingBandwidth, { + expires: 365 + }); + } + }); +// + + incomingBandwidth = $.cookie("verto_demo_incomingBandwidth") || "default"; + $.cookie("verto_demo_incomingBandwidth", incomingBandwidth, { + expires: 365 + }); + + $("#incomingBandwidth_250kb").prop("checked", incomingBandwidth === "250").change(function(e) { + if ($("#incomingBandwidth_250kb").is(':checked')) { + incomingBandwidth = "250"; + $.cookie("verto_demo_incomingBandwidth", incomingBandwidth, { + expires: 365 + }); + } + }); + + $("#incomingBandwidth_500kb").prop("checked", incomingBandwidth === "500").change(function(e) { + if ($("#incomingBandwidth_500kb").is(':checked')) { + incomingBandwidth = "500"; + $.cookie("verto_demo_incomingBandwidth", incomingBandwidth, { + expires: 365 + }); + } + }); + + $("#incomingBandwidth_1024kb").prop("checked", incomingBandwidth === "1024").change(function(e) { + if ($("#incomingBandwidth_1024kb").is(':checked')) { + incomingBandwidth = "1024"; + $.cookie("verto_demo_incomingBandwidth", incomingBandwidth, { + expires: 365 + }); + } + }); + + $("#incomingBandwidth_1536kb").prop("checked", incomingBandwidth === "1536").change(function(e) { + if ($("#incomingBandwidth_1536kb").is(':checked')) { + incomingBandwidth = "1536"; + $.cookie("verto_demo_incomingBandwidth", incomingBandwidth, { + expires: 365 + }); + } + }); + + $("#incomingBandwidth_2048kb").prop("checked", incomingBandwidth === "2048").change(function(e) { + if ($("#incomingBandwidth_2048kb").is(':checked')) { + incomingBandwidth = "2048"; + $.cookie("verto_demo_incomingBandwidth", incomingBandwidth, { + expires: 365 + }); + } + }); + + $("#incomingBandwidth_5120kb").prop("checked", incomingBandwidth === "5120").change(function(e) { + if ($("#incomingBandwidth_5120kb").is(':checked')) { + incomingBandwidth = "5120"; + $.cookie("verto_demo_incomingBandwidth", incomingBandwidth, { + expires: 365 + }); + } + }); + + $("#incomingBandwidth_0kb").prop("checked", incomingBandwidth === "0").change(function(e) { + if ($("#incomingBandwidth_0kb").is(':checked')) { + incomingBandwidth = "0"; + $.cookie("verto_demo_incomingBandwidth", incomingBandwidth, { + expires: 365 + }); + } + }); + + $("#incomingBandwidth_default").prop("checked", incomingBandwidth === "default").change(function(e) { + if ($("#incomingBandwidth_default").is(':checked')) { + incomingBandwidth = "default"; + $.cookie("verto_demo_incomingBandwidth", incomingBandwidth, { + expires: 365 + }); + } + }); +// var vqual = $.cookie("verto_demo_vqual") || "qvga"; $.cookie("verto_demo_vqual", vqual, { diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index 71ec4bcb19..813fa58129 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -3214,7 +3214,7 @@ static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock cJSON *dialog; verto_pvt_t *tech_pvt; char name[512]; - const char *var, *destination_number, *call_id = NULL, *sdp = NULL, + const char *var, *destination_number, *call_id = NULL, *sdp = NULL, *bandwidth = NULL, *caller_id_name = NULL, *caller_id_number = NULL, *remote_caller_id_name = NULL, *remote_caller_id_number = NULL,*context = NULL; *response = obj; @@ -3274,6 +3274,17 @@ static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock switch_channel_set_flag(channel, CF_VIDEO_ONLY); } + if ((bandwidth = cJSON_GetObjectCstr(dialog, "outgoingBandwidth"))) { + if (strcasecmp(bandwidth, "default")) { + switch_channel_set_variable(channel, "rtp_video_max_bandwidth_in", bandwidth); + } + } + + if ((bandwidth = cJSON_GetObjectCstr(dialog, "incomingBandwidth"))) { + if (strcasecmp(bandwidth, "default")) { + switch_channel_set_variable(channel, "rtp_video_max_bandwidth_out", bandwidth); + } + } switch_snprintf(name, sizeof(name), "verto.rtc/%s", destination_number); switch_channel_set_name(channel, name);