Actions

Difference between revisions of "VS-SDK for AlphaCom"

From Zenitel Wiki

m
m (Event reports)
Line 75: Line 75:
  
 
The event handlers:
 
The event handlers:
 +
#region The AlphaNet Handlers
 +
private static void HandleStationConnect(StationConnect sc)
 +
{
 +
  // Use the objects internal ToString() method:
 +
    Console.WriteLine(sc);
 +
}
 +
private static void HandleStationDisconnect(StationDisconnect sd)
 +
{
 +
  Console.WriteLine(sd);
 +
}
 +
#endregion
  
 +
If only part of the information contained in an object is of interest, then there are a multitude of methods available to retrieve just that information, as for example:
  
 
==Sample software==
 
==Sample software==

Revision as of 15:36, 19 October 2017

AlphaCom icon 300px.png

This article is under construction. The software described here is not available yet.

Introduction

The SDK provides dll's, helpfiles and some sample software to make integration of 3rd party software with the AlphaCom as easy as possible. The 3 sample applications are delivered including source code. These 3 samples cover many (if not all) aspects of what normally is expected from an integration with AlphaCom. Users of the SDK are allowed to freely use parts of the sample source code in their own software.

Licensing

The possibility to retrieve intercom station state information from the exchange is a licensed feature, and requires the presence of an ‘API/OPC interface’ license in the AlphaCom XE exchange for at least as many stations as that of the status to be retrieved.
Note that every AlphaCom in an AlphaNet requires such a license.

  • 1009649901 - STENTOFON API License Supporting 40 Stations
  • 1009649902 - STENTOFON API License Supporting 80 Stations
  • 1009649903 - STENTOFON API License Supporting 160 Stations
  • 1009649904 - STENTOFON API License Supporting 240 Stations
  • 1009649905 - STENTOFON API License Supporting 320 Stations
  • 1009649906 - STENTOFON API License Supporting 400 Stations
  • 1009649907 - STENTOFON API License Supporting 552 Stations

DLL description

Stentofon.AlphaCom.AlphaNet.dll

The Stentofon.AlphaCom.AlphaNet.dll implements the AlphaCom Data Protocol and handles the communication with the AlphaCom XE exchanges. It raises events and exposes methods to be able to receive data from, and send commands to the exchange. The .dll supports auto-discovery of the complete AlphaCom XE network configuration. This makes the system very easy to configure and set up. In addition, the .dll will track and report all state changes in the AlphaCom XE network which the 3rd program subscribes to. The .dll supports the STENTOFON AlphaNet. This means that all AlphaCom XE exchanges and stations in a network can be addressed by having an IP connection to just one of the AlphaCom XE exchanges. The .dll requires Microsoft .NET 4.6.2 The DLL contains three name spaces:

  • Messages
  • Client
  • Config

Stentofon.AlphaCom.Data.dll

The Stentofon.AlphaCom.Data.dll is not strictly required, but it provides a standardized way of storing and retrieving AlphaCom XE network, exchange and station information and states. Storage can be in an MSSQL database or in memory ’AlphaComStateStorages.MSSQL’ or ‘AlphaComStateStorages.IN_MEMORY’. The .dll requires Microsoft .NET 4.6.2 The DLL contains one name space:

  • State

Communication with the AlphaCom XE exchange

Software based on the SDK have 2 possibilities to communicate with AlphaCom:

  • Direct connection to either TCP port 61112 or 61113
  • Connection via a 'Service Provider'

Also when there is an AlphaNet of multiple AlphaCom servers, it is only necessary to connect to a single AlphaCom, it does in this case not matter with which ALphaCom the connection will be established.

Direct connection

AlphaCom has 2 communication ports available for API/OPC based software, ports 61112 and 61113. These 2 ports are independent. In an AlphaNet, it is possible to use up to 10 ports, divided over at least 5 exchanges (this AlphaNet capability is available as from AMC-IP software version a.d.c.d).

Service provider

Sometimes there is a requirement for more connection points to an AlphaCom. As from SDK version 2.1.3.1 an 'Service provider' will be included. This serveice provider will itself connect to either port 61112 or 61113 but then make multiple ports available for other software to connect. In effect the service provider acts as a port expander.

TCP communication ports

To be able to communicate with either of port 61112 or 61113, the port must be enabled in the exchange using AlphaWeb, the web server which is integrated in the AlphaCom xE. Log in to AlphaWeb and select ‘System Configuration/Filters’ and enable the required port number for the physical Ethernet port the API will connect to.

Connecting to the AlphaCom XE

At software start up it is only necessary to provide the following information:

  • IP address of AlphaCom or service provider
  • Port to connect to
    • 61112 or 61113 for AlphaCom
    • The port to connect to as configured for the service provider
  • Information whether the connection is direct or via the service provider
    • DIRECT_TCP
    • PC_REMOTE

Calling the method _client.Connect(); will then:

  • Establish the connection
  • Discover all nodes which are part of the AlphaNet
  • Discover all intercom stations which are configured in each of the nodes
  • Handle all messages which are required to keep the connection

AlphaCom Data Protocol message classes

The API communicates with AlphaCom XE via the AlphaCom Data Protocol. The ‘.Messages’-namespace provides classes for AlphaCom Data Protocol Messages.

using Stentofon.AlphaCom.AlphaNet.Messages;

Event reports

Activity inside the exchange can raise events. The following is an example. Register for some events:

// Register for some events
_client.OnStationConnect += HandleStationConnect;
_client.OnStationDisconnect += HandleStationDisconnect;

The event handlers:

#region The AlphaNet Handlers
private static void HandleStationConnect(StationConnect sc)
{
  // Use the objects internal ToString() method:
    Console.WriteLine(sc);
}
private static void HandleStationDisconnect(StationDisconnect sd)
{
  Console.WriteLine(sd);
}
#endregion

If only part of the information contained in an object is of interest, then there are a multitude of methods available to retrieve just that information, as for example:

Sample software