📜 ⬆️ ⬇️

Digium G400 and G800 Gateways (E1 PRI)



Last year Digium pleased us with new IP phones designed specifically for Asterisk, as well as the TDM-SIP family of gateways.

It was two new devices: G100 and G200, on one E1 port, and two E1 ports, respectively.
')
Quite inexpensive, and as it turned out stable, these gateways showed themselves only from the best side. It’s easy to make friends with Avaya, Panasonic, Asterisk, of course ... Yes, there’s PRI in Africa PRI :)

The manufacturer did not stop there, and today I am glad to present you a replenishment in the line of gateways from Digium. G400 and Digium G800, and as you could guess at 4 and ... 8 (!) E1 ports.


Technical details



As you can see, the performance has not changed. This is a half, 1U rackmount box. No moving parts.
Built on Asterisk, but with a web-based management interface. Echo cancellation is embedded.

You can connect an unlimited number of SIP trunks, but note that the number of maximum simultaneous calls (as with G711 and G729) is as follows: G100: 30, G200: 60, G400: 120, G800: 240.

As you can see, there are now two LAN ports on the gateways (On the G100 and G200 there was one).

So far I can not say that this device can be not only a VoIP router, but also a network router. But the gateway exactly supports two IP interfaces, and it is possible to assign two VLANs to one physical port (any of the 4096 Vlan tags are set via the GUI).

Datashit - docs.digium.com

Gateway api

An interesting feature that very few products have, I would even say that no one has it (correct if I am mistaken).

Through HTTPS requests and JSON gateway responses, you will be able to communicate with the device and complete its configuration and diagnostics.

Sample PHP code for uptime
To uncover
<? $GATEWAY_IP = 'CHANGEME'; $USERNAME = 'admin'; $PASSWORD = 'admin'; $ch = curl_init(); $fields = array( 'admin_uid' => $USERNAME, 'admin_password' => $PASSWORD ); curl_setopt($ch, CURLOPT_URL, "https://$GATEWAY_IP/admin/main.html"); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_COOKIEFILE, ''); $result = curl_exec($ch); if ($result === false) { $error = curl_error($ch); curl_close($ch); die("Login failed: $error"); } if (preg_match("/Welcome,\\s+$USERNAME/i", $result) == 0 || preg_match("/Log Out/i", $result) == 0) { curl_close($ch); die("Login Failed!"); } $request = array( 'request' => array( 'method' => 'gateway_list', 'parameters' => array() ) ); $string = json_encode($request, JSON_FORCE_OBJECT); $fields = array( 'request' => $string ); curl_setopt($ch, CURLOPT_URL, "https://$GATEWAY_IP/json"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); if ($result === false) { $error = curl_error($ch); curl_close($ch); die("Request failed: $error"); } curl_close($ch); $response = json_decode($result); $response_object = json_decode($response->response->result); print $response_object->gateway->model_name; print "\n"; print "Uptime "; print $response_object->gateway->uptime; print "\n"; ?> 


Or through PERL to get information about the device, and disable it
Like this
 #!/usr/bin/perl use strict; use HTTP::Cookies; use LWP::UserAgent; use Data::Dumper; use JSON; $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0; my $ua = new LWP::UserAgent; # Sometimes both of these are required my $cookies = new HTTP::Cookies(); $ua->cookie_jar($cookies); $ua->ssl_opts({'verify_hostname' => 0}); my $GATEWAY_IP = 'CHANGEME'; my $USERNAME = 'admin'; my $PASSWORD = 'admin'; # log in my $response = $ua->post("https://$GATEWAY_IP/admin/main.html", { admin_uid => $USERNAME, admin_password => $PASSWORD, act => 'login', }); my $content = $response->content; print $content; # Response from login is HTML page, check that the main page init() # function is called to be sure we have logged in and are looking at # the main page. if ($content !~ m/Welcome,\s+$USERNAME/i || $content !~ m/Log Out/i) { print "Login Failed!\n"; exit 1; } # get software version my $params = { 'request' => { 'method' => 'gateway_list', 'parameters' => { } }}; $response = $ua->post("https://$GATEWAY_IP/json", { 'request' => JSON->new->utf8->encode($params) }); # Response from non-login requests are JSON and must be decoded twice # as follows: $content = JSON->new->utf8->decode($response->content); my $res = JSON->new->utf8->decode($content->{'response'}{'result'}); # Uncomment this to see all available information #print Data::Dumper::Dumper($res); print sprintf("Model Number: %s\n", $res->{'gateway'}{'model_no'}); print sprintf("Software Version: %s\n", $res->{'gateway'}{'software_version'}); print sprintf("MAC Address: %s\n", $res->{'gateway'}{'mac_address'}); print sprintf("Uptime: %s\n", $res->{'gateway'}{'uptime'}); # shutdown my $params = { 'request' => { 'method' => 'system_reboot_save', 'parameters' => { 'action' => 'shutdown', 'confirm' => 'yes' } }}; # Change to actually reboot. if (0) { print "Shutting down.\n"; $response = $ua->post("https://$GATEWAY_IP/json", { 'request' => JSON->new->utf8->encode($params) }); } else { print "NOT ACTUALLY REBOOTING.\n"; } # Response from reboot/shutdown is unique in that the webserver cannot # send us a response verifying the shutdown went as expected # $content = JSON->new->utf8->decode($response->content); # print Data::Dumper::Dumper($content); 


And for Python lovers, there is also an example:

Sending email at the fallen link
 import sys import re import mechanize import cookielib import urllib import json from pprint import pprint def main(): gateway_ip = 'CHANGEME' gateway_user = 'admin' gateway_pass = 'admin' data = { 'admin_uid': gateway_user, 'admin_password': gateway_pass, 'act': 'login' } data_str = '&'.join(['%s=%s' % (k,v) for k,v in data.iteritems()]) # Log in req = mechanize.Request("https://%s/admin/main.html" % gateway_ip, data_str) cj = cookielib.LWPCookieJar() cj.add_cookie_header(req) res = mechanize.urlopen(req) lines = res.read() # Response from login is an HTML page. Check that the main page's init() # function is called to be sure we have logged in and are looking at # the main page. if re.search("Welcome,\s+%s" % gateway_user, lines) is None: print "Login Failed!" return 1 # Request connection status data = { "request" : { "method": "connection_status.list", } } # Something (mechanize?) doesn't like JSON with spaces in it. data_str = json.dumps(data, separators=(',',':')) req = mechanize.Request("https://%s/json" % gateway_ip, data_str) res = mechanize.urlopen(req) lines = res.read() response = json.loads(lines) result = json.loads(response['response']['result']) # check result for interface in result['connection_status']['t1_e1_interfaces']: if True or interface['status_desc'] != 'Up, Active': print "%s is down (status '%s') on %s!" % ( interface['name'], interface['status_desc'], gateway_ip ) # Send an email, postcard, or pidgeon to the sysadmin sys.exit(main() or 0) 



However, you can get more information on wiki.asterisk.org

Use cases

Well, in general, they have not changed since the appearance of the first representatives of the G-family.

You can accept E1 streams from the city provider and the old PBX:



You can use these gateways for virtual servers:



Can be used for transcoding:



Or due to the fact that the number of SIP connections is not limited, first of all it will be correct to do fault-tolerant routing, for example with Switchvox servers:



Extended Warranty

Together with the addition of new products, the manufacturer decided to expand the list of available services. So, for example, I can now announce the value of the extended warranty:

Price policy

Prices recommended by the manufacturer are as follows:
Digium G100 - $ 1195
Digium G200 - 1995 $
Digium G400 - $ 2995
Digium G800 - $ 3995

Of course, in retail Russia they will be a little higher. And as a comparison, Digium gives the following comparison with competitors:

Vendor / ModelDigium Gateway SeriesAudiocodes Mediant 600Audiocodes Mediant 1000/2000Mediatrix 3500 SeriesNET (formerly Quintum) TenorSangoma Vega SeriesPatton SmartNode
One E1G100Mediant 1000Model: 3531ResponsePointVega 100SN4950
* Street Price1195295033001499153011582309
* List Price119532783857195018001395
Two E1G200Mediant 1000Model: 3532Tenor DX 2030Vega 200SN4950
* Street Price19954,00045002299307718213999
* List Price199544855277295036202195
Four E1G400Mediant 1000Tenor DX 4060Vega 400
* Street Price2995N / A8,000N / A479070922050
* List Price2995N / A9180N / A586585452700
Eight E1G800Mediant 2000Tenor DX 8120N / A
* Street Price3995N / A15500N / A9999N / A
* List Price3995N / A17820N / A11750N / A

The only one who came close is Sangoma, but Digium claims that they are very difficult to set up. Is it so I can not say, maybe someone came across this iron?

In the presence of these products are expected by September 2013. Thank you for your attention.

PS For those who have reached the end, I give a magic link to access to the gateway interface gatewaytestdrive.digium.com
You can see the interface, functionality and more ...

Source: https://habr.com/ru/post/185468/


All Articles