Skip to content

Commit

Permalink
Add gateway ping-min/max params
Browse files Browse the repository at this point in the history
  • Loading branch information
greenbea committed Nov 11, 2020
1 parent e5cf6bd commit 3f426ba
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/gateways/app_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "ping_min";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "ping_max";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "caller_id_in_from";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
Expand Down
42 changes: 42 additions & 0 deletions app/gateways/app_languages.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,48 @@
$text['label-ping']['sv-se'] = "Ping";
$text['label-ping']['uk-ua'] = "Пінг";

$text['label-ping_min']['en-us'] = "Ping Min";
$text['label-ping_min']['en-gb'] = "";
$text['label-ping_min']['ar-eg'] = "";
$text['label-ping_min']['de-at'] = "";
$text['label-ping_min']['de-ch'] = "";
$text['label-ping_min']['de-de'] = "";
$text['label-ping_min']['es-cl'] = "";
$text['label-ping_min']['es-mx'] = "";
$text['label-ping_min']['fr-ca'] = "";
$text['label-ping_min']['fr-fr'] = "";
$text['label-ping_min']['he-il'] = "";
$text['label-ping_min']['it-it'] = "";
$text['label-ping_min']['nl-nl'] = "";
$text['label-ping_min']['pl-pl'] = "";
$text['label-ping_min']['pt-br'] = "";
$text['label-ping_min']['pt-pt'] = "";
$text['label-ping_min']['ro-ro'] = "";
$text['label-ping_min']['ru-ru'] = "";
$text['label-ping_min']['sv-se'] = "";
$text['label-ping_min']['uk-ua'] = "";

$text['label-ping_max']['en-us'] = "Ping Max";
$text['label-ping_max']['en-gb'] = "";
$text['label-ping_max']['ar-eg'] = "";
$text['label-ping_max']['de-at'] = "";
$text['label-ping_max']['de-ch'] = "";
$text['label-ping_max']['de-de'] = "";
$text['label-ping_max']['es-cl'] = "";
$text['label-ping_max']['es-mx'] = "";
$text['label-ping_max']['fr-ca'] = "";
$text['label-ping_max']['fr-fr'] = "";
$text['label-ping_max']['he-il'] = "";
$text['label-ping_max']['it-it'] = "";
$text['label-ping_max']['nl-nl'] = "";
$text['label-ping_max']['pl-pl'] = "";
$text['label-ping_max']['pt-br'] = "";
$text['label-ping_max']['pt-pt'] = "";
$text['label-ping_max']['ro-ro'] = "";
$text['label-ping_max']['ru-ru'] = "";
$text['label-ping_max']['sv-se'] = "";
$text['label-ping_max']['uk-ua'] = "";

$text['label-password']['en-us'] = "Password";
$text['label-password']['en-gb'] = "Password";
$text['label-password']['ar-eg'] = "كلمة السر";
Expand Down
28 changes: 28 additions & 0 deletions app/gateways/gateway_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@
$retry_seconds = $_POST["retry_seconds"];
$extension = $_POST["extension"];
$ping = $_POST["ping"];
$ping_min = $_POST["ping_min"];
$ping_max = $_POST["ping_max"];
$channels = $_POST["channels"];
$caller_id_in_from = $_POST["caller_id_in_from"];
$supress_cng = $_POST["supress_cng"];
Expand Down Expand Up @@ -178,6 +180,8 @@
$array['gateways'][$x]["retry_seconds"] = $retry_seconds;
$array['gateways'][$x]["extension"] = $extension;
$array['gateways'][$x]["ping"] = $ping;
$array['gateways'][$x]["ping_min"] = $ping_min;
$array['gateways'][$x]["ping_max"] = $ping_max;
$array['gateways'][$x]["channels"] = $channels;
$array['gateways'][$x]["caller_id_in_from"] = $caller_id_in_from;
$array['gateways'][$x]["supress_cng"] = $supress_cng;
Expand Down Expand Up @@ -279,6 +283,8 @@
$retry_seconds = $row["retry_seconds"];
$extension = $row["extension"];
$ping = $row["ping"];
$ping_min = $row["ping_min"];
$ping_max = $row["ping_max"];
$channels = $row["channels"];
$caller_id_in_from = $row["caller_id_in_from"];
$supress_cng = $row["supress_cng"];
Expand Down Expand Up @@ -706,6 +712,28 @@
echo "</td>\n";
echo "</tr>\n";

echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-ping_min']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='ping_min' maxlength='255' min='1' max='65535' step='1' value=\"".escape($ping_min)."\">\n";
echo "<br />\n";
echo $text['description-ping_min']."\n";
echo "</td>\n";
echo "</tr>\n";

echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-ping_max']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='number' name='ping_max' maxlength='255' min='1' max='65535' step='1' value=\"".escape($ping_max)."\">\n";
echo "<br />\n";
echo $text['description-ping_max']."\n";
echo "</td>\n";
echo "</tr>\n";

if (permission_exists('gateway_channels')) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@
if (string.len(field.ping) > 0) then
table.insert(xml, [[ <param name="ping" value="]] .. field.ping .. [["/>]]);
end
if (string.len(field.ping_min) > 0) then
table.insert(xml, [[ <param name="ping-min" value="]] .. field.ping_min .. [["/>]]);
end
if (string.len(field.ping_max) > 0) then
table.insert(xml, [[ <param name="ping-max" value="]] .. field.ping_max .. [["/>]]);
end
if (string.len(field.context) > 0) then
table.insert(xml, [[ <param name="context" value="]] .. field.context .. [["/>]]);
end
Expand Down

0 comments on commit 3f426ba

Please sign in to comment.