using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using Remoteable;
namespace IPCChannelRemoting
{
/// <summary>
/// Remote Objekt ermöglicht der GN Server Config
GUI den Status Abruf der
/// GN Servers über den
IPC Channel.
/// </summary>
public class RemoteObj : MarshalByRefObject,
ISharedAssemblyInterface
{
/// <summary>
/// Konstruktor
/// </summary>
public RemoteObj()
{
}
/// <summary>
/// Ruft den aktuellen Status der angemeldeten GN User ab.
/// Jeder User wird in eine string Array gespeichert.
/// Die Gesamtheit aller User in einer ArrayList.
/// </summary>
/// <returns>ArrayList mit GN-UserInfos</returns>
public ArrayList GetUserList()
{
ArrayList result = new ArrayList();
foreach (ClientInfo client in MainClass.TCPServer.ClientList)
{
string[] values = new string[7];
values[0] = client.Line;
values[1] = client.strName;
values[2] = client.socket.RemoteEndPoint.ToString();
values[3] = client.Status.ToString("G");
values[4] = client.CallHandle.ToString();
values[5] = client.Number;
values[6] = client.Direction.ToString();
result.Add(values);
}
return result;
}
/// <summary>
/// Ruft den aktuellen Stand der TAPI-Lines ab.
/// Jede TAPI Line wird in einem string Array gespeichert. Die
/// Gesamtheit alle Lines wird in einer ArrayList gespeichert.
/// </summary>
/// <returns>ArrayList mit den TAPI Line Infos</returns>
public ArrayList GetLines()
{
ArrayList result=new ArrayList();
TAPILines tapiLines = frmMain.TAPILinesList;
foreach (TAPILine tl in tapiLines.TapiLinesList)
{
string[] values = new string[8];
values[0] = tl.AddressName;
values[1] = tl.DeviceName;
values[2] = tl.GWUserName;
values[3] = tl.CallActive.ToString();
values[4] = tl.CallHandle.ToString();
values[5] = tl.CallCalledID;
values[6] = tl.CallCallerID;
values[7] = tl.CallBegan;
result.Add(values);
}
return result;
}
/// <summary>
/// Test Methode um
IPC Verbindung zu testen.
/// </summary>
/// <returns></returns>
public string GetTest()
{
return "Test";
}
}
}
namespace Remoteable
{
/// <summary>
/// Interface für das Remote Objekt der
IPC Verbindung.
/// </summary>
public interface ISharedAssemblyInterface
{
ArrayList GetUserList();
ArrayList GetLines();
string GetTest();
}
}