HiPath OpenOffice Playground

Wmenn,,Horemu

OSO

Welcome to the HiPath OpenOffice Playground !

Here You will find preliminary documentation for use with the open interfaces of HiPath 3000 and OpenOffice EE / ME / SE.

Please note before using and downloading the materials offered within this article.

All programs, documents and informations are preliminary or in beta status and are subject of modifications. No support is given for these materials. THE PROGRAMS AND ACCOMPANYING DOCUMENTATION ARE FURNISHED TO YOU "AS IS" WITHOUT WARRANTY OF ANY KIND.

Application Integration with HiPath OpenOffice ME / EE and HiPath 3000
Within this chapter different applications are listed together with their integration or connectiom capabilities. In addition some exeriences regarding the connection are given as far as known. For further information application manufacture has to be contacted. No warrenty can be given to the correctness of information below.

Official information about application certification can be obtained from HiPath technoloy partner program

Manufacturer
Tobit.Software AG

Application category
Unified messaging solution

Short description
.......The exchange of messages is only one of the hightlights of David.zehn!. Not for nothing, David.zehn! has been the measure of all things in the area of Unified Messaging for a many years. Nevermind if you work with eMails, telefaxes, VoiceMails, SMS messages or even RSS-Feeds: David.zehn! unifies what belongs together and provides all information and media in one unique interface. Thus the sending, receiving and editing of different information will be as fast and efficient as never before. etc......

Tobit David.zehn

Native connection capabilities
ISDN / CAPI

supported - Server is connected via ISDN card to PXB

TAPI

not supported

CSTA

not supported

HTTP (g-server interface )

not supported

External Database access

Supported - Proprietary API incl. coding examples for different programming languages is offered by manufacturer

Other

PBX call data record interface

Prerequisites
ISDN Card / CAPI

Allgemeine Anforderungen, die Sie in Zusammenhang mit David/FaxWare sicherstellen sollten:

Sie sollten einen Rufnummernblock (EAZ/MSN/DDI) innerhalb der Telefonanlage definieren können. Die eingehenden Rufe innerhalb dieses Blocks müssen an die ISDN-Karte durchgestellt werden können. Sofern Sie die Anrufbeantworterfunktion von David nutzen wollen, so sollte die Telefonanlage die ursprünglich gewählte DDI oder MSN über die ISDN-Karte an David übergeben können, um mit dieser Information an den entsprechenden User über die Verteilung weiterverteilen zu können. Ein »unteranlagenfähiger S0-Anschluss« stellt intern nicht nur EAZs/MSNs (max. 10 pro S0-Bus) zur Verfügung, sondern kann auch mehrstellige Durchwahlen anbieten. Dies ist gerade in größeren Installationen für interne Anrufbeantworter oder Fax-Verteilung sinnvoll.

In der Telefonanlage darf keine Diensteeinschränkung vorliegen, d.h. alle Dienste müssen freizuschalten sein.

Um die CTI-Funktionen von DAVID nutzen zu können, müssen Sie sicherstellen, dass die Telefonanlage ebenso den ETSI-Standard unterstützt.

Um die Telefonie-Dienste der David Information Server Engine einsetzen zu können, müssen die folgenden Voraussetzungen erfüllt sein:

Telefonanschluss Für die Nutzung der Telefonie-Dienste müssen Sie über einen oder mehrere ISDN-Anschlüsse sowie über eine geeignet ausgestattete Telefonanlage verfügen. Die Supplementary Service ECT sind nur an einem Teilnehmeranschluss (Mehrgeräteanschluß) definiert. Somit ist ECT an einem Anlagenanschluß nicht möglich.

Kommunikationshardware Die Telefonanlage muss auf dem verwendeten S0-Bus das Vermitteln per »ECT-Connect «unterstützen. Dies ist gewährleistet, wenn die TK-Anlage die »Supplementary Services« nach ETSI-Standard unterstützt. Gleiches gilt für den CAPI-Treiber der eingesetzten ISDN-Karte, der ebenfalls ein ECT-Connect unterstützen muss. Außerdem sollte die Telefonanlage über die Fähigkeit verfügen, ursprünglich gewählte Durchwahlnummern (MSN) über die ISDN-Karte an DvISE zu übergeben, um diese Informationen für die interne Verteilung nutzen zu können.

DvISE Ports Mindestens einer der installierten ISDN-Ports (=B-Kanal) muss für den Dienst »ECT« eingerichtet sein. Die aktivierten Dienste eines Ports können in der DvISE Port-Konfiguration am Server überprüft und ggf. geändert werden. Ist bei keinem der Ports der ECT-Dienst aktiviert, können die Telefonie-Dienste nicht genutzt werden.

David.InfoCenter An jeder Arbeitsstation, über welche die Telefonie-Dienste genutzt werden sollen, muss in der Konfiguration des Tobit InfoCenters unterhalb von »Optionen -> Einstellungen -> Benutzerprofil« die Nummer des lokalen Telefonanschlusses, vorangestellt ein »*«, (um eine Amtsholung für diese interne Nummer zu unterbinden), angegeben werden (Beispiel *123). Mit dieser Nummer wird bei Nutzung der Telefonie Dienste standardmäßig verbunden.

Script Über sogenannte Scripts wird das Verhalten des Systems bei ein- oder ausgehenden Anrufen bestimmt. Abhängig von dem verwendeten Script werden unterschiedliche Funktionen ausgeführt. Das Standard-Script, das direkt nach der DvISE-Installation aktiv ist, bietet Funktionen für die meisten Einsatzzwecke. Dieses Script trägt den Namen TLD.DCC und befindet sich im Verzeichnis »DAVID\TLD\COMMON« auf dem DvISE Server. Die Anpassung an persönliche Anforderungen geschieht im Allgemeinen über das Tobit InfoCenter. Hierzu existieren z.B. bestimmte Archives unterhalb von »Archive - System - DvISE - Datenbank«. Die Scriptbearbeitung ist in David.zehn! standardmäßig möglich.

Database access

Use of DZ-dvapi32 requires David.zehn! SW at least incl. actual feature pack.

PBX Call data record interface

PBXpense via RS232 interface

PBXpense wird als weiteres Software-Module auf dem David Server geladen. Um die Dienste von PBXpense nutzen zu können, muss der Server über eine serielle Schnittstelle mit der Telefonanlage verbunden sein. Über diese Schnittstelle liest das Programm den von der Telefonanlage gelieferten Datenstrom ein und wertet die enthaltenen Verbindungsdaten aus.

Experiences within real installations
Currently no experiences regarding connection of Davis.zehn! to HiPath 500 / 3000 and Hipath OpenOffice ME / EE platforms are available.

Remarks
ISDN

Supplementary Service ECT is available at the ISDN subscriber line of HiPath 3000

Call data records 

HiPath 3000 supports RS232 (V.24) interface and tranmission of single call data records.

HiPath openOffice ME / EE neither offers RS232 interface nor transmission of single call data records.

Database access

HiPath OpenOffice ME myPortal integration

David.zehn! database can be connected to ESTOS Metadir (as stated by ESTOS). Therefore it should be possible to access Tobit.zehn! database via Metadir and LDAP from HiPath OpenOffice ME myPortal application.

Manufacturer
SAGE group

Application category
Customer relationship management SW (CRM)

Short description
....... Choose ACT! and provide superior service to your prospects, customers, or anyone you contact regularly because you have a complete, integrated view of your relationships—all in one easy-to-access location. Impress contacts with your follow-up, leave no task undone, and make informed decisions so you can successfully advance your business...... [http://www.sagecrmsolutions.com/products/actbysage ACT! homepage]

Native connection capabilities
ISDN / CAPI

no information available

TAPI

supported

CSTA

not supported

HTTP (g-server interface )

not supported

External Database access

no information available

Other

no information available

Prerequisites
TAPI

A TAPI line has to be available at client side. Therefore a A TAPI-TSP SW has to be installed on the client or remote TAPI line has to be used within a network.

Database access

no information available

Experiences within real installations
Experiences were made with a TAPI connection within the following environment:


 * ACT! 6
 * Callbride Collection V2 with optipoint 420
 * Hipath TAPI 120
 * HiPath OpenOffice ME

Szenario 1 use of Callbride Collection No function as connection will not be established. It seems that ACT 6 ! closes the TAPI line after the TSP sends out messages about display content.

Scenario 2 use of HiPath TAPi 120 Connection is established properly. Outgoing, incoming call and consultation hold were successfully perfomed by using the dialer which is part of ACT ! 6. Other features like call transfer were not tested. Callers number is transmitted within incoming call.

Remarks
The integrated dialed uses an own window and offers only basic features. Workflow integration is only done basically. Different add-ons exist in the market which offers a better telephony integration e.g. Melville-Schellmann.

It is essential to enter phone numbers and the location parameters correctly into the ACT ! database. Unfortunately the operation manual does not explain this issue and its dependencies clearly.

If the telephon number formats within the database does not match exactly the number format which is transmitted by TAPI-TSP caller identification for incoming calls will not work.

Code examples
In this article code examples, code snippets can be placed, that are helpful for further integration of the G-Server functionality into any application written in any programing language. Because some moduels like login, http(s), cookie-handling are used by everybody, many members of the G-Server comunity are grateful for access to the code-samples. Contents [hide] 1 General 1.1 Login Procedure for G-Server 1.1.1 Step 1: Login 1.1.2 Step 2: Evaluate the response from G-Server: 1.1.3 Step 3: Send command to G-Server (e.g. MakeCall): 1.1.4 JAVA Code Samples for the Post-Request 1.1.5 C++ Code Samples for the Post-Request 2 C++ 2.1 CHttpClient Example.c 	2.2 CHttpClient Example.h  	3 C#  	3.1 C# HttpClient 4 HTML/Javascript 4.1 IFrame 5 VB.NET 2008 6 Perl 6.1 TimeStamp - g-Server Response

In this secition we talk about the easy way to create applications for the G-Server. Several samples will be listed. The programming languages are
 * JAVA
 * C++
 * Javascript

Login Procedure for G-Server
The login procedure is set for ensuring the connection between the application site and the G-Server and protecting it against unauthorized access. There are 3 steps of the procedure:

Step 1: Login
Http-Request from HttpClient to G-Server This HttpRequest contains:
 * URL: http://127.0.0.1:8801/login (if G-Server installed on local machine)
 * Request type: POST
 * POST-Parameter: gsUser=admin&gsPass=adminpass (default administrator account)

Step 2: Evaluate the response from G-Server:

 * Example code: GetHeaderValue(„Set-cookie“, cookie)
 * The Cookie (z.B. „yMGW3eibFw6MjmIIGiPG5CGz4c0UluZl“) must be read and saved for further usage.
 * The login procedure is finished after this step.

Step 3: Send command to G-Server (e.g. MakeCall):
HttpRequest from HttpClient to G-Server. This HttpRequest contains
 * URL: http://127.0.0.1:8801/cgi-bin/gadgetapi?cmd=MakeCall&callingDevice=100&calledDirectoryNumber=101
 * Request Type: GET
 * Request Header: „Cookie= yMGW3eibFw6MjmIIGiPG5CGz4c0UluZl“ (use the cookie vaule saved by last step)

With the 3rd step the HttpRequest for MakeCall from phone 100 to 101 is completed. The validation time of a session cookie is 15 min., i.e. if there is no request been sent within 15 minutes, the login sequence has to be repeated.

JAVA Code Samples for the Post-Request
JAVA Code Sample

HttpURLConnection connection = getHttpURLConnection(loginURL,10000); connection.setRequestMethod("POST"); PrintWriter out = new PrintWriter(connection.getOutputStream); out.print("gsUser="+myUsername+"&gsPass="+myPassword); out.close; connection.connect; String cookie = connection.getHeaderField("Set-Cookie"); if(connection.getResponseCode == 200 && cookie != null){ String cookieToken = cookie.split(";")[0]; String[] s = cookieToken.split("="); if (s.length>1) myCookies.put(s[0].trim, s[1]); else myCookies.put(s[0],""); } else {throw new AuthenticationFailedException;}

C++ Code Samples for the Post-Request
C++ Code Sample client = new CAtlHttpClient; GsParam* gsParams = new GsParam; //login CAtlNavigateData loginNavData; BYTE * pData; CString sData; sData = "gsUser=" + gsParams->username + "&gsPass=" + gsParams->password; printf("nav data: %s\n", CT2A(sData)); pData = new BYTE[sData.GetLength+1]; memcpy(pData, CT2A(sData), sData.GetLength+1); pData[sData.GetLength+1]=0; loginNavData.SetPostData(pData, sData.GetLength, _T("application/x-www-form-urlencoded")); loginNavData.SetMethod(ATL_HTTP_METHOD_POST); CString loginUrl; loginUrl = "http://"; loginUrl.Append(gsParams->ipAddress); loginUrl.Append(_T(":")); loginUrl.Append(gsParams->port); loginUrl.Append(_T("/login")); printf("login request: %s\n", CT2A(loginUrl)); if (client->Navigate( loginUrl, &loginNavData )) {           if(client->GetHeaderValue(_T("Set-cookie"),cookie)) {                 int curPos = 0; setCookie(cookie.Tokenize(_T(";"), curPos)); return true; }           else return false; //return true; }     else return false;

C++
The recommended structured approach to integrate the G-Server functionality into a C++ program is to include a Headerfile in the beginning, that contains all the required G-Server functionality/security access and to just use then methods from this included header file.

CHttpClient Example.c
// This code was developed for using gebeCom G-Server // Copyright (C) gebeCom GmbH // All rights reserved. // // Get more information at www.gebecom.de // Contact: gsi@gebecom.de void main {	printf("== Start HttpClient =="); HttpClient *myClient = new HttpClient("127.0.0.1", "8801", "admin", "adminpass", false); if(myClient->Login) printf("\nlogin success"); else printf("\nlogin failed"); if(myClient->MakeCall("100", "101")) printf("\nMake call to 101"); else printf("\nCould not make call to 101"); getchar; }
 * 1) include 

CHttpClient Example.h
// This code was developed for using gebeCom G-Server // Copyright (C) gebeCom GmbH // All rights reserved. // // Get more information at www.gebecom.de // Contact: gsi@gebecom.de class HttpClient { public: HttpClient(CString ip, CString port, CString user, CString password, bool https);// Constructor ~HttpClient;	// Destructor CString getCookie; void setCookie(CString cookie); CAtlHttpClient* getClient; bool Login;									//   Sends the login request bool isLoggedIn;								// Returns if Cookie is set bool MakeCall(std::string callingDevice, std::string calledDevice);		// Sennds make call request private: CAtlHttpClient* client;		// MS AtlHttpClient for Http use CString cookie;			// Cookie String for G-Server use CString GSUser;			// G-Server user CString GSPassword;		// G-Server password CString GSIP;			// G-Server IP address CString GSPort;			// G-Server Port bool GSHttps;			// Param if http or https should be used bool LoggedIn;			// Param if HttpClient is logged in }; HttpClient::HttpClient(CString ip, CString port, CString user, CString password, bool https) {	GSIP = ip; GSPort = port; GSUser = user; GSPassword = password; GSHttps = https; LoggedIn = false; setCookie("cookie"); } HttpClient::~HttpClient{} CString HttpClient::getCookie {	return cookie; } void HttpClient::setCookie(CString cookie) {	this->cookie = cookie; } CAtlHttpClient* HttpClient::getClient {	return client; } bool HttpClient::isLoggedIn { return LoggedIn; } bool HttpClient::Login {	client = new CAtlHttpClient; CAtlNavigateData loginNavData; BYTE * pData; CString sData; // Set POST data and transform it into Byte-String sData = "gsUser=" + GSUser + "&gsPass=" + GSPassword; pData = new BYTE[sData.GetLength+1]; memcpy(pData, sData, sData.GetLength+1); pData[sData.GetLength+1]=0; // Set login navigation data (header, post data, method) loginNavData.SetExtraHeaders(_T("Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\nAccept-Language: en-gb,en;q=0.5\nAccept-Encoding: gzip,deflate\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\nReferer: http://192.168.178.80:8801/login \n")); loginNavData.SetPostData(pData, sData.GetLength, _T("application/x-www-form-urlencoded")); loginNavData.SetMethod(ATL_HTTP_METHOD_POST); // Set login request Url CString loginUrl; if(GSHttps) loginUrl = "https://"; else loginUrl = "http://"; loginUrl.Append(GSIP); loginUrl.Append(_T(":")); loginUrl.Append(GSPort); loginUrl.Append(_T("/login")); // Execute the login request if (client->Navigate( loginUrl, &loginNavData )) {		if(client->GetHeaderValue(_T("Set-cookie"),cookie)) {			// Retrieve session id/cookie (Cookie is always set at the first position in request response) int curPos = 0; setCookie(cookie.Tokenize(_T(";"), curPos)); LoggedIn = true; }		else LoggedIn = false; }	else LoggedIn = false; return LoggedIn; } bool HttpClient::MakeCall(std::string callingDevice, std::string calledDevice) {		if(LoggedIn) { // Set make call request string CString m_urlStr; if(GSHttps) m_urlStr = "https://"; else m_urlStr = "http://"; m_urlStr.Append(GSIP); m_urlStr.Append(_T(":")); m_urlStr.Append(GSPort); m_urlStr.Append("/cgi-bin/gadgetapi?cmd=MakeCall&callingDevice="); m_urlStr.Append(callingDevice.data); m_urlStr.Append("&calledDirectoryNumber="); CString calledNummer = calledDevice.data; if(calledNummer.Left(7)==_T("+49("))calledNummer.Replace(_T("+49("),_T("00")); if(calledNummer.Find(_T(")")))calledNummer.Replace(_T(")"),_T("")); m_urlStr.Append(calledNummer); if(m_urlStr.Find("calledDirectoryNumber=T"))m_urlStr.Replace("calledDirectoryNumber=T","calledDirectoryNumber="); // Set navigation data (header, post data, method) CAtlNavigateData reqNavData; CString header; header = _T("Cookie:") + cookie + "\n"; reqNavData.SetExtraHeaders(header); reqNavData.SetMethod(ATL_HTTP_METHOD_GET); if(client->Navigate( m_urlStr, &reqNavData ))return true; else return false; } else return false; } C# C# HttpClient Bereitgestellt von Brandschutz Consult Ingenieurgesellschaft mbH Leipzig. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.IO; namespace G_Server_Server {   // unvollständige JSON Objektstruktur für die Events.... // abgebildet sind nur Art des Events sowie der Absender und Empfänger public class eventTyp {       public class device { public string deviceIdentifier;} public class hook { public string device;} public class eventName {           public eventHookswitch HookswitchEvent; public eventEstablished EstablishedEvent; public eventTransfered TransferedEvent; public eventDelivered DeliveredEvent; //Überprüfungsmethode für den Inhalt des JSON Objektes. //das JSON Objekt wird immer erzeugt. public string contains {               if (HookswitchEvent != null) {                   return "hook"; }               if (EstablishedEvent != null) {                   return "est"; }               if (TransferedEvent != null) {                   return "trans"; }               if (DeliveredEvent != null) {                   return "deli"; }               return "nix"; }       }        public class eventEstablished {           public device calledDevice; public device callingDevice; public string info {               return "Empfänger: " + calledDevice.deviceIdentifier + " Anrufer: " + callingDevice.deviceIdentifier; }       }        public class eventDelivered {           public device calledDevice; public device callingDevice; public string info {               return "Empfänger: " + calledDevice.deviceIdentifier + " Anrufer: " + callingDevice.deviceIdentifier; }       }        public class eventTransfered {           public device calledDevice; public device callingDevice; }       public class eventHookswitch { } public eventName jsonEvent; }   //Hauptevent - wird bei jeder Abfrage erzeugt. public class mainEvent {       public mainEvent { events = new List; } public string error; public List events; }   //Bis hier JSON Objekt Struktur //Hauptprogramm - Consolenanwendung class Program {       //Sessioncookie - wird benötigt damit man bei den Anfragen legitimisiert ist public CookieContainer cookie = new CookieContainer; static void Main(string[] args) {           Program myGServerclient = new Program; myGServerclient.anmelden; myGServerclient.abfragen; } //Bis hier JSON Objekt Struktur // JSON Serialisierer, wird nicht benötigt nur zur Vollständigkeit public string SerializedJSON(object toSerialize, string className) {           System.Web.Script.Serialization.JavaScriptSerializer jss; jss = new System.Web.Script.Serialization.JavaScriptSerializer; System.Text.StringBuilder sbControls = new System.Text.StringBuilder; jss.Serialize(toSerialize, sbControls); return className + "=" + sbControls.ToString; }       // JSON Deserialisierer // Entgegennahme des Event-Strings, Auswertung und Reaktion public void deSerializedJSON(string jsonString, string telefon) {           System.Web.Script.Serialization.JavaScriptSerializer jss; jss = new System.Web.Script.Serialization.JavaScriptSerializer; //JSON Objekt erstellen mainEvent Tester = new mainEvent; //JSON Event an das JSON Objekt übergeben/Deserialisieren. Tester = jss.Deserialize(jsonString); // Überprüfung ob ein Event aufgetreten ist. if (Tester.events.Count > 0) {               // Eventtyp überprüfen foreach (eventTyp ausleser in Tester.events) {                   // Event auswerten (vom Typ Delivered) if ( ausleser.jsonEvent.contains.Equals("deli")) {                       //Test ob man von intern rausruft. //evtl hier noch Test ob calling device leer ist?! //Anrufnummer ist unterdrückt, also auch abfangen if (!ausleser.jsonEvent.DeliveredEvent.callingDevice.deviceIdentifier.Equals(telefon)) {                           //Externe Aufruf - oder Reaktion Console.WriteLine(ausleser.jsonEvent.DeliveredEvent.info); }                     }                    // Event auswerten (vom Typ Transfered) if (ausleser.jsonEvent.contains.Equals("tranf")) {                       //Externe Aufruf - oder Reaktion }               }             }        }        //Objekt Klasse Telefonlist //um von einem Client mehrere Telefone abzufragen public class urlListe {           public List telefonListe = new List ; public void Set(int i)           { telefonListe.Add(i); }           public string Get(int i)            { return telefonListe[i].ToString; }           public int lenght {               return telefonListe.Count; }       }        //Methode um Events abzufragen public void abfragen {           ASCIIEncoding encoding = new ASCIIEncoding; HttpWebResponse response = null; //Hardcoded Telefonliste //Client-Telefone urlListe telefonListe = new urlListe; telefonListe.Set(26); telefonListe.Set(20); telefonListe.Set(21); telefonListe.Set(45); //Endlosschleife try {               while (true) {                   //Telefonindex durchlaufen - for Schleife wird bei einem Telefon nicht benötigt. for (int index = 0; index < telefonListe.lenght; index++) {                       //URL Webaufruf zur Abfrage string webstring = "http://192.168.1.250:8801/cgi-bin/gadgetapi?cmd=GetInstantEvents&deviceObject=" + telefonListe.Get(index); HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(webstring); myRequest.Method = "GET"; myRequest.ContentType = "application/x-www-form-urlencoded"; // Cookie verwenden - zur Authentifizierung myRequest.CookieContainer = cookie; response = (HttpWebResponse)myRequest.GetResponse; Stream newStream = response.GetResponseStream; StreamReader streamRead = new StreamReader(newStream); // Event auslesen und als String abspeichern string zeile = streamRead.ReadLine; while (zeile != null) {                       //kompletten String zur Überprüfung ausgeben //Console.WriteLine("Telefon {0}: {1}", telefonListe.Get(index), zeile); // Event-Objekt erzeugen und auswerten deSerializedJSON(zeile, telefonListe.Get(index)); // Read next line zeile = streamRead.ReadLine; }                    }                }            }            catch (Exception e)            { Console.Write(e.ToString); }       }        //beim G-Server anmelden und Session Cookie beziehen. public void anmelden {           ASCIIEncoding encoding = new ASCIIEncoding; string postData = "gsUser=admin2&gsPass=test"; byte[] data = encoding.GetBytes(postData); HttpWebResponse response = null; Stream dataStream = null; StreamReader reader = null; try {               // Prepare web request... HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://192.168.1.250:8801/login"); myRequest.Method = "POST"; myRequest.CookieContainer = new CookieContainer; cookie = myRequest.CookieContainer; myRequest.ContentType = "application/x-www-form-urlencoded"; myRequest.ContentLength = data.Length; Stream newStream = myRequest.GetRequestStream; // Send the data. newStream.Write(data, 0, data.Length); newStream.Close; HttpWebResponse myHttpWebResponse = (HttpWebResponse)myRequest.GetResponse; Stream streamResponse = myHttpWebResponse.GetResponseStream; }           catch (Exception e)            { Console.Write(e.ToString); }       }    } } HTML/Javascript IFrame The IFrame solution is in normal case the easiest method to send requests to the G-Server. You have just to create the two files "index.htm" and "script.js" and insert the code below. script.js // G-Server Data var GS_IP = "127.0.0.1"; var GS_PORT = "8801"; var GS_USER = "user"; var GS_PASSWORD = "password"; // Number of the own phone var PHONE = "100"; var COOKIE_RELOAD_TIME = 15000; var URL = "http://" + GS_IP + ":" + GS_PORT + "/cgi-bin/gadgetapi?cmd="; function makeCall(num) { var command = URL + "MakeCall&callingDevice=" + PHONE + "&calledDirectoryNumber=" + num; doCommand(command); } function clearCall { var command = URL + "ClearCall&callingDevice=" + PHONE; doCommand(command); } function doCommand(cmd) { resFrame.location.href = cmd; } // Autmated function that loads the cookie in which the session between local computer and G-Server is saved function getCookie { cookieFrame.document.write('' +		'' +		'' +		' '); cookieFrame.document.myForm.submit; window.setTimeout("clearCookieWin", COOKIE_RELOAD_TIME); } function clearCookieWin { cookieFrame.location.href = ""; window.setTimeout("getCookie", 100); }
 * 1) pragma once
 * 1) include
 * 2) include 

index.htm 

Make Call to 101 Clear Call

  VB.NET 2008 This example was kindly provided by Finley S.A. 2009. download example.

Perl TimeStamp - g-Server Response With the following Perl-Script G-Server responses can be converted into regular date-expression.

use warnings; use strict; my $time = time; # or any other epoch timestamp $time = 1236869477; my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = ( localtime($time) ); my @months = ( "Jan", "Feb", "Mar", "Apr", "May", "Jun",  "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ); print "Unix time " . $time . " converts to " . $months[$mon]. " " . $mday. ", " . ( $year + 1900 ); print " ". $hour. ":" . $min. ":" . $sec. "\n"; my $local_date = sprintf "%s %02d %02d:%02d:%02d\n", $months[$mon], $mday, $hour, $min, $sec; print "syslog format: $local_date\n";
 * 1) !/usr/bin/perl  -w
 * 1)  0    1    2     3     4    5     6     7     8
 * 1) You can use 'gmtime' for GMT/UTC dates instead of 'localtime'
 * 1) Output: Unix time 1236869477 converts to Mar 12, 2009 15:51:17
 * 1) Output: syslog format: Mar 12 15:51:17