MT#56526 Discontinue dialogic setting/provisioning

The feature was never really used and no customer is using
it at the moment.

Change-Id: Id90a1cacbc238312066c02cbbfd8a423b77c24a4
mr11.3
Marco Capetta 2 years ago
parent fa82bac3ca
commit 35949e9a59

@ -108,12 +108,6 @@ log4perl.appender.Default.layout.ConversionPattern=%d{ISO8601} [%p] [%F +%L] %m{
element_order package_id
</voucher_csv>
<dialogic>
own_ip 10.15.20.199
username dialogic
password Dial0gic
</dialogic>
<fees_csv>
element_order source
element_order destination

@ -6,7 +6,6 @@ use parent 'Catalyst::Controller';
use NGCP::Panel::Form;
use NGCP::Panel::Utils::DialogicImg;
use NGCP::Panel::Utils::Message;
use NGCP::Panel::Utils::Navigation;
use NGCP::Panel::Utils::Preferences;
@ -452,89 +451,6 @@ sub servers_delete :Chained('servers_base') :PathPart('delete') :Args(0) {
return;
}
sub servers_flash_dialogic :Chained('servers_base') :PathPart('flash/dialogic') :Args(0) {
my ($self, $c) = @_;
my $config = {
ip_sip => $c->stash->{server_result}->ip,
ip_client => $c->config->{dialogic}{own_ip},
};
my $dialogic_group = $c->model('DB')->resultset('voip_preference_groups')->find({
name => 'Dialogic Settings',
});
for my $tmp_pref ($dialogic_group->voip_preferences->all) {
my $pref_name = $tmp_pref->attribute;
my $cfg_name = $pref_name =~ s/^dialogic_//r;
my $peer_pref = NGCP::Panel::Utils::Preferences::get_peer_preference_rs(
c => $c,
attribute => $pref_name,
peer_host => $c->stash->{server_result},
)->first;
next unless $peer_pref;
$config->{$cfg_name} = $peer_pref->value;
}
if (exists $config->{out_codecs}) {
my @new_out_codecs = map { s/^\s+|\s+$//gr } split(m/,/, $config->{out_codecs});
$config->{out_codecs} = \@new_out_codecs;
}
$c->response->header('X-Accel-Buffering' => 'no');
$c->response->body('');
$c->response->headers->content_type('text/plain');
try {
if ($config->{mode} ne 'none') {
my $api = NGCP::Panel::Utils::DialogicImg->new(
server => 'https://' . $config->{ip_config},
);
$c->write("Logging in ...\n");
$api->login( $c->config->{dialogic}{username}, $c->config->{dialogic}{password} );
die "Couldn't log in to dialogic." if ($api->appid == 0);
my $resp = $api->obtain_lock();
die "Couldn't connect to dialogic to obtain lock."
unless ($resp->code == 200);
if ($config->{mode} eq 'sipsip') {
$resp = $api->create_all_sipsip($config, sub {
my ($shortlog, $resp) = @_;
$c->write($shortlog);
});
} elsif ($config->{mode} eq 'sipisdn') {
$resp = $api->create_all_sipisdn($config, sub {
my ($shortlog, $resp) = @_;
$c->write($shortlog);
});
} elsif ($config->{mode} eq 'sipss7') {
$resp = $api->create_all_sipss7($config, sub {
my ($shortlog, $resp) = @_;
$c->write($shortlog);
});
}
} else {
$c->write("Dialogic not enabled. Doing nothing.\n");
}
NGCP::Panel::Utils::Message::info(
c => $c,
data => { $c->stash->{server_result}->get_inflated_columns },
desc => $c->loc('Dialogic successfully flashed.'),
);
} catch ($e) {
NGCP::Panel::Utils::Message::error(
c => $c,
error => $e,
desc => $c->loc('Failed to flash dialogic'),
);
$c->write("Failed to flash dialogic. Probably could not log in.");
};
#NGCP::Panel::Utils::Navigation::back_or($c, $c->uri_for_action('/peering/servers_root', [$c->req->captures->[0]]));
return;
}
sub servers_preferences_list :Chained('servers_base') :PathPart('preferences') :CaptureArgs(0) {
my ($self, $c) = @_;

@ -3519,34 +3519,6 @@ msgstr "Geräte-Profil nicht gefunden"
msgid "Device profile successfully deleted"
msgstr "Geräte-Profil erfolgreich gelöscht"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Configuration IP"
msgstr "Dialogic Konfigurations-IP"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Mode"
msgstr "Dialogic-Modus"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Optical Link"
msgstr "Dialogic optischer Link"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Out Codecs"
msgstr "Dialogic ausgehende Codecs"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic RTP IP"
msgstr "Dialogic RTP IP"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Settings"
msgstr "Dialogic Einstellungen"
#: lib/NGCP/Panel/Controller/Peering.pm
msgid "Dialogic successfully flashed."
msgstr "Dialogic erfolgreich geflasht."
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dir"
msgstr "Verzeichnis"
@ -4809,10 +4781,6 @@ msgstr "Registriertes Gerät nicht gefunden."
msgid "Failed to find voicemail user."
msgstr "Benutzer für Sprachnachricht nicht gefunden."
#: lib/NGCP/Panel/Controller/Peering.pm
msgid "Failed to flash dialogic"
msgstr "Dialogic-Flash fehlgeschlagen"
#: lib/NGCP/Panel/Controller/Administrator.pm
msgid "Failed to generate client certificate."
msgstr "Erstellen des Client-Zertifikats fehlgeschlagen."
@ -5384,10 +5352,6 @@ msgstr "Firmwarekennung"
msgid "First Name"
msgstr "Vorname"
#: share/templates/peering/preferences.tt
msgid "Flash Dialogic"
msgstr "Flash Dialogic"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Folder"
msgstr "Ordner"
@ -6034,18 +5998,10 @@ msgstr "IP-Header, der für die \"allowed_ips\"-Prüfung verwendet werden soll"
msgid "IP successfully unbanned"
msgstr "IP erfolgreich entsperrt"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "IP that the Dialogic IMG will configure on it's second port for the RTP traffic. Must be different from the SIP IP."
msgstr "IP, die auf dem zweiten Port des Dialogic IMG für den RTP-Verkehr konfigurieren werden soll. Muss sich von der SIP-IP unterscheiden."
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "IP transport of the sip packet (TCP/UDP)"
msgstr "IP-Transportprotokoll des SIP-Pakets (TCP/UDP)"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "IP under which the Dialogic IMG's webinterface is accessible for confiuration."
msgstr "IP, unter der das Webinterface des Dialogic IMG erreichbar ist."
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "IPv4/IPv6 briding mode"
msgstr "IPv4-/IPv6-Bridge-Modus"
@ -10383,10 +10339,6 @@ msgstr "Abrechnungsprofile festlegen"
msgid "Set billing profiles by"
msgstr "Abrechnungsprofile festlegen nach"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Set dialogic mode, which is used to autoprovision configuration on a Dialogic IMG."
msgstr "Einstellen des Dialogic-Modus, der für die automatische Bereitstellung (Auto-Provisioning) der Konfiguration auf einem Dialogic IMG verwendet wird."
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Set id"
msgstr "Set-ID"

@ -2083,34 +2083,6 @@ msgstr "Perfil de Dispositivo no encontrado"
msgid "Device profile successfully deleted"
msgstr "Perfil de Dispositivo eliminado con éxito"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Configuration IP"
msgstr "Configuración IP de Dialogic"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Mode"
msgstr "Modo Dialogic"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Optical Link"
msgstr "Enlace Óptico Dialogic"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Out Codecs"
msgstr "Códecs de Salida Dialogic"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic RTP IP"
msgstr "IP RTP de Dialogic"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Settings"
msgstr "Ajustes de Dialogic"
#: lib/NGCP/Panel/Controller/Peering.pm
msgid "Dialogic successfully flashed."
msgstr "Dialogic se ha actualizado con éxito."
#: lib/NGCP/Panel/Controller/Billing.pm lib/NGCP/Panel/Controller/CallListSuppression.pm lib/NGCP/Panel/Controller/Subscriber.pm lib/NGCP/Panel/Utils/HeaderManipulations.pm
msgid "Direction"
msgstr "Dirección"
@ -3161,10 +3133,6 @@ msgstr "Fallo al encontrar dispositivo registrado."
msgid "Failed to find voicemail user."
msgstr "Fallo al encontrar usuario de buzón."
#: lib/NGCP/Panel/Controller/Peering.pm
msgid "Failed to flash dialogic"
msgstr "Fallo en la escritura de firmware Dialogic"
#: lib/NGCP/Panel/Controller/Administrator.pm
msgid "Failed to generate client certificate."
msgstr "Fallo al generar certificado cliente."
@ -3700,10 +3668,6 @@ msgstr "Etiqueta del Firmware"
msgid "First Name"
msgstr "Nombre"
#: share/templates/peering/preferences.tt
msgid "Flash Dialogic"
msgstr "Actualizar Firmware Dialogic"
#: lib/NGCP/Panel/Utils/Voucher.pm
msgid "For Contract #"
msgstr "Para el Contrato #"
@ -4066,14 +4030,6 @@ msgstr "Cabecera IP a utilizar para la comprobación de \"allowed_ips\""
msgid "IP successfully unbanned"
msgstr "IP ha sido refrendada con éxito"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "IP that the Dialogic IMG will configure on it's second port for the RTP traffic. Must be different from the SIP IP."
msgstr "IP que el IMG de Dialogic configurará en su segundo puerto para el tráfico RTP. Debe ser diferente de la IP SIP."
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "IP under which the Dialogic IMG's webinterface is accessible for confiuration."
msgstr "IP bajo la cual se puede acceder a la interfaz web de Dialogic IMG para su configuración."
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "IPv4/IPv6 briding mode"
msgstr "Modo IPv4/IPv6 briding"
@ -6983,10 +6939,6 @@ msgstr "Establecer al valor MIN_SE del SBC. El sistema deplicará 422 si el MIN_
msgid "Set RTP relay mode for this peer/domain/user"
msgstr "Establece el modo de retransmisión RTP para este peer/dominio/usuario"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Set dialogic mode, which is used to autoprovision configuration on a Dialogic IMG."
msgstr "Establece el modo Dialogic, que se utiliza para autoaprovisonar la configuración en una IMG Dialogic."
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Set to 'if both parties are behind same NAT' if you want to allow RTP to bypass RTP-Proxy if the SIP UAs are within the same LAN of each other as determined by the 'received' IP address check (peer-to-peer mode)"
msgstr "Establezca \"si ambas partes están detrás de la misma NAT\" si desea permitir que RTP pase por alto el RTP-Proxy si las UAs SIP están dentro de la misma LAN una de la otra según lo determinado por la comprobación de la dirección IP \"received\" (modo peer-to-peer)"

@ -2083,34 +2083,6 @@ msgstr "Profile de périphérique non trouvé"
msgid "Device profile successfully deleted"
msgstr "Profile de périphérique supprimé avec succès"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Configuration IP"
msgstr "Configuration IP dialogic"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Mode"
msgstr "Mode dialogic"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Optical Link"
msgstr "Lien optique dialogic"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Out Codecs"
msgstr "Codecs dialogic de sortie"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic RTP IP"
msgstr "RTP IP dialogic"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Settings"
msgstr "Paramètres dialogic"
#: lib/NGCP/Panel/Controller/Peering.pm
msgid "Dialogic successfully flashed."
msgstr "Dialogic flashé avec succès."
#: lib/NGCP/Panel/Controller/Billing.pm lib/NGCP/Panel/Controller/CallListSuppression.pm lib/NGCP/Panel/Controller/Subscriber.pm lib/NGCP/Panel/Utils/HeaderManipulations.pm
msgid "Direction"
msgstr "Direction"
@ -3161,10 +3133,6 @@ msgstr "Echec lors de la recherche du périphérique enregistré."
msgid "Failed to find voicemail user."
msgstr "Echec lors de la recherche de l'utilisateur de la boite vocale."
#: lib/NGCP/Panel/Controller/Peering.pm
msgid "Failed to flash dialogic"
msgstr "Echec lors du flashage du composant dialogic"
#: lib/NGCP/Panel/Controller/Administrator.pm
msgid "Failed to generate client certificate."
msgstr "Echec lors de la génération du certificat client."
@ -3700,10 +3668,6 @@ msgstr "Tag firmware"
msgid "First Name"
msgstr "Prénom"
#: share/templates/peering/preferences.tt
msgid "Flash Dialogic"
msgstr "Flasher dialogic"
#: lib/NGCP/Panel/Utils/Voucher.pm
msgid "For Contract #"
msgstr "Pour le contrat #"
@ -4066,14 +4030,6 @@ msgstr "En-tête IP à utiliser pour la vérification de \"allowed_ips\"."
msgid "IP successfully unbanned"
msgstr "IP autorisée avec succès"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "IP that the Dialogic IMG will configure on it's second port for the RTP traffic. Must be different from the SIP IP."
msgstr "IP que l'IMG dialogic utilisera sur son second port pour le trafic RTP. Doit être différent de l'IP SIP."
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "IP under which the Dialogic IMG's webinterface is accessible for confiuration."
msgstr "IP à laquelle l'interface web l'IMG dialogic est accessible pour configuration."
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "IPv4/IPv6 briding mode"
msgstr "Mode dual stack IPv4/IPv6"
@ -6983,10 +6939,6 @@ msgstr "Définir la valeur Min-SE dans le SBC. Ceci est également utilisé pour
msgid "Set RTP relay mode for this peer/domain/user"
msgstr "Définir le mode de relais RTP pour ce peer/domaine/utilisateur"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Set dialogic mode, which is used to autoprovision configuration on a Dialogic IMG."
msgstr "Définit le mode dialogique, qui est utilisé pour la configuration automatique de la configuration d'un IMG Dialogic."
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Set to 'if both parties are behind same NAT' if you want to allow RTP to bypass RTP-Proxy if the SIP UAs are within the same LAN of each other as determined by the 'received' IP address check (peer-to-peer mode)"
msgstr "Réglez sur 'si les deux parties sont derrière le même NAT' si vous voulez permettre à RTP de contourner RTP-Proxy si les UAs SIP sont dans le même LAN comme déterminé par la vérificaion del'adresse IP 'reçue' (mode point-à-point)"

@ -2084,34 +2084,6 @@ msgstr "Profilo dispositivo non trovato"
msgid "Device profile successfully deleted"
msgstr "Profilo dispositivo eliminato con successo"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Configuration IP"
msgstr "Configurazione IP Dialogic"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Mode"
msgstr "Modo Dialogic"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Optical Link"
msgstr "Collegamento Ottico Dialogic"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Out Codecs"
msgstr "Codecs in Uscita Dialogic"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic RTP IP"
msgstr "Indirizzo IP per RTP Dialogic"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Settings"
msgstr "Impostazioni Dialogic"
#: lib/NGCP/Panel/Controller/Peering.pm
msgid "Dialogic successfully flashed."
msgstr "Configurazione Dialogic trasmessa con successo."
#: lib/NGCP/Panel/Controller/Billing.pm lib/NGCP/Panel/Controller/CallListSuppression.pm lib/NGCP/Panel/Controller/Subscriber.pm lib/NGCP/Panel/Utils/HeaderManipulations.pm
msgid "Direction"
msgstr "Direzione"
@ -3162,10 +3134,6 @@ msgstr "Ricerca dispositivo registrato fallita."
msgid "Failed to find voicemail user."
msgstr "Ricerca utente casella vocale fallita."
#: lib/NGCP/Panel/Controller/Peering.pm
msgid "Failed to flash dialogic"
msgstr "Provisioning Dispositivo Dialogic fallito"
#: lib/NGCP/Panel/Controller/Administrator.pm
msgid "Failed to generate client certificate."
msgstr "Generazione del certificato client fallita"
@ -3701,10 +3669,6 @@ msgstr ""
msgid "First Name"
msgstr "Nome"
#: share/templates/peering/preferences.tt
msgid "Flash Dialogic"
msgstr "Configura Dialogic"
#: lib/NGCP/Panel/Utils/Voucher.pm
msgid "For Contract #"
msgstr "Per Contratto #"
@ -4067,14 +4031,6 @@ msgstr ""
msgid "IP successfully unbanned"
msgstr "IP bannato con successo"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "IP that the Dialogic IMG will configure on it's second port for the RTP traffic. Must be different from the SIP IP."
msgstr "Indirizzo IP che il dispositivo Dialogic IMG configurerè sulla sua seconda porta per il traffico RTP. Deve essere diverso dall´IP SIP"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "IP under which the Dialogic IMG's webinterface is accessible for confiuration."
msgstr "Indirizzo IP a cui accedere alla interfaccia grafica di configurazione del dispositivo Dialogic IMG."
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "IPv4/IPv6 briding mode"
msgstr "IPv4/IPv6 modalità bridging"
@ -6984,10 +6940,6 @@ msgstr "Imposta il valore Min-SE in SBC. Questo viene anche usato per creare ris
msgid "Set RTP relay mode for this peer/domain/user"
msgstr "Imposta la modalità di relay RTP per questo peer/dominio/utente"
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Set dialogic mode, which is used to autoprovision configuration on a Dialogic IMG."
msgstr "Imposta modalità Dialogic, che viene usata per autoconfigurare il Dialogic IMG."
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Set to 'if both parties are behind same NAT' if you want to allow RTP to bypass RTP-Proxy if the SIP UAs are within the same LAN of each other as determined by the 'received' IP address check (peer-to-peer mode)"
msgstr "Imposta a 'se entrambe le parti sono dietro lo stesso NAT' se vuoi abilitare lo streaming RTP direttamente end-to-end, nel caso li UA SIP siano all´interno della stessa LAN come determinato dal controllo sull´indirizzo IP 'received' (peer-to-peer mode)"

@ -3498,34 +3498,6 @@ msgstr ""
msgid "Device profile successfully deleted"
msgstr ""
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Configuration IP"
msgstr ""
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Mode"
msgstr ""
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Optical Link"
msgstr ""
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Out Codecs"
msgstr ""
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic RTP IP"
msgstr ""
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dialogic Settings"
msgstr ""
#: lib/NGCP/Panel/Controller/Peering.pm
msgid "Dialogic successfully flashed."
msgstr ""
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Dir"
msgstr ""
@ -4784,10 +4756,6 @@ msgstr ""
msgid "Failed to find voicemail user."
msgstr ""
#: lib/NGCP/Panel/Controller/Peering.pm
msgid "Failed to flash dialogic"
msgstr ""
#: lib/NGCP/Panel/Controller/Administrator.pm
msgid "Failed to generate client certificate."
msgstr ""
@ -5363,10 +5331,6 @@ msgstr ""
msgid "First Name"
msgstr ""
#: share/templates/peering/preferences.tt
msgid "Flash Dialogic"
msgstr ""
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Folder"
msgstr ""
@ -6037,18 +6001,10 @@ msgstr ""
msgid "IP successfully unbanned"
msgstr ""
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "IP that the Dialogic IMG will configure on it's second port for the RTP traffic. Must be different from the SIP IP."
msgstr ""
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "IP transport of the sip packet (TCP/UDP)"
msgstr ""
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "IP under which the Dialogic IMG's webinterface is accessible for confiuration."
msgstr ""
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "IPv4/IPv6 briding mode"
msgstr ""
@ -10362,10 +10318,6 @@ msgstr ""
msgid "Set billing profiles by"
msgstr ""
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Set dialogic mode, which is used to autoprovision configuration on a Dialogic IMG."
msgstr ""
#: lib/NGCP/Panel/Utils/DbStrings.pm
msgid "Set id"
msgstr ""

File diff suppressed because it is too large Load Diff

@ -2,7 +2,7 @@
[%
helper.messages = messages;
helper.edit_preference = edit_preference;
helper.preference = preference;
helper.preference_meta = preference_meta;
@ -18,73 +18,9 @@
helper.top_buttons = [
{ name = c.loc('Back'), uri = c.uri_for(group.id, "servers"), icon = 'icon-arrow-left' },
## Commented the button 'Flash Dialogic' to stop confusing users as
## implementation was never finished and will not be finished (as no longer necessary).
## The code revert is not trivial and unnecessary as ngcp-panel will be deprecated in mr10.5+.
## Therefore hiding unnecessary button on WEB interface:
# { name = c.loc('Flash Dialogic'), uri = "javascript:call_flash_dialogic('" _ c.uri_for_action("/peering/servers_flash_dialogic", [c.req.captures.0, c.req.captures.1]) _ "');", icon = 'icon-star' },
];
PROCESS 'helpers/pref_table.tt';
%]
<script type="text/javascript">
function call_flash_dialogic (url) {
console.log("calling", url);
$("#ngcp-livelog").text('');
var last_response_len = false;
$.ajax(url, {
xhrFields: {
onprogress: function(e)
{
var this_response, response = e.currentTarget.response;
if(last_response_len === false)
{
this_response = response;
last_response_len = response.length;
}
else
{
this_response = response.substring(last_response_len);
last_response_len = response.length;
}
$("#ngcp-livelog").append(this_response);
$("#ngcp-livelog")[0].scrollIntoView(false);
//console.log(this_response);
}
}
})
.done(function(data)
{
console.log('Done');
$("#ngcp-livelog").append("\nDone.\nYou can close this window now.");
$("#ngcp-livelog")[0].scrollIntoView(false);
})
.fail(function(data)
{
console.log('Error: ', data);
$("#ngcp-livelog").append("\nError.");
$("#ngcp-livelog")[0].scrollIntoView(false);
});
console.log('Request Sent');
$("#ngcp-test-modal").modal('show');
}
</script>
<div id="ngcp-test-modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Flashing Dialogic ...</h3>
</div>
<div class="modal-body">
<p>Please Wait ...</p>
<pre id="ngcp-livelog"></pre>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
[% # vim: set tabstop=4 syntax=html expandtab: -%]

@ -1,112 +0,0 @@
use NGCP::Panel::Utils::DialogicImg;
use strict;
use warnings;
use DDP;
use Data::Dumper;
exit if try_parse_file(@ARGV);
my $resp;
my $test = NGCP::Panel::Utils::DialogicImg->new(
server => 'https://10.15.20.149',
);
p $test->login( 'dialogic', 'Dial0gic' );
$resp = $test->obtain_lock();
p $resp->code;
print "LOGGED IN, LOCK OBTAINED ############################\n";
my $result = $test->create_all_sipsip({
ip_sip => '10.15.21.92',
ip_rtp => '10.15.22.11',
ip_client => '10.15.20.144',
in_codecs => ['G711 ulaw', 'G711 alaw', 'G729', 'AMR'],
out_codecs => ['G711 ulaw', 'G711 alaw', 'G729', 'AMR'],
ss7_opc => '1-1-1',
ss7_apc => '2-2-2', # adjacent point code
ss7_dpc => '2-2-2',
ip_nfs_server => '192.168.51.45',
nfs_path => '//export/users/dialogic2',
snmp_system_name => 'Dialogic2',
snmp_system_location => 'foobar',
snmp_system_contact => 'foobar',
snmp_community_name => 'bar',
use_optical_spans => 1,
is_isdn_userside => 1,
},
2,
);
exit;
# $resp = $test->delete_all_bn2020;
# $resp = $test->delete_all_bn2020;
# p $resp->code;
# exit 0;
# $resp = $test->reboot_and_wait;
# p $resp;
# sleep 2;
# exit;
# print "login again\n";
# p $test->login( 'dialogic', 'Dial0gic' );
# $resp = $test->get( '/oamp/configuration/objects', { appid => $test->appid } );
# $resp = $test->obtain_lock();
# p $resp->code;
# print_documentation_md($test);
# $resp = $test->get_config;
# p $resp;
# #p $test->classinfo;
# exit;
# $test->pids->{facility} = 10008;
# $resp = $test->create_ds1_spans;
# p $resp;
# p $resp->data;
# exit;
sub print_documentation_md {
my ($api) = @_;
my $classinfo = $api->build_documentation;
for my $class (keys %{ $classinfo }) {
my $parent = $classinfo->{$class}{parent};
my $options = $classinfo->{$class}{options};
print "\n#$class\n\n";
print "This is a child of `$parent`\n\n";
print "## Options\n\n";
print "Name|Description|Default|Alternatives\n";
print "----|-----------|-------|------------\n";
for my $o (@{ $options }) {
my ( $name, $displayname, $default, $choices )
= @{$o}{ 'name', 'displayname', 'default', 'choices' };
my $choices_str = $choices && @{$choices}
? join( ", ", map {"`$_`"} @{$choices} ) : '';
if ($default) {
$default = "`$default`";
}
print "`$name` | $displayname | $default | $choices_str \n";
}
}
return;
}
sub try_parse_file {
return unless ($#ARGV >= 1);
print "parsing $ARGV[0]\n";
use Data::Serializer::Raw;
my $s = Data::Serializer::Raw->new(serializer => 'XML::Simple');
print Dumper $s->retrieve($ARGV[0]);
print "\n";
return 1;
}
1;
Loading…
Cancel
Save