2.1.0 version.

This commit is contained in:
2018-02-15 22:59:05 +01:00
parent 7b586f1444
commit 35330993ff
41 changed files with 12066 additions and 2916 deletions

View File

@ -1,10 +1,101 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="textAttributeType">
<xs:restriction base="xs:string">
<xs:pattern value="yes|no" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="integerAttributeType">
<xs:restriction base="xs:integer" />
</xs:simpleType>
<xs:simpleType name="verticalAlignType">
<xs:restriction base="xs:string">
<xs:pattern value="top|middle|bottom" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="horizontalAlignType">
<xs:restriction base="xs:string">
<xs:pattern value="left|middle|right" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="titleTagType" mixed="true">
<xs:attribute name="wrap" default="yes">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="yes|no"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="lineTagType" mixed="true">
<xs:attribute name="Size" default="single">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="double|single" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Align" default="left">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="right|left|center" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="imageType" mixed="true">
<xs:attribute name="verticalAlign" type="verticalAlignType" />
<xs:attribute name="horizontalAlign" type="horizontalAlignType" />
<xs:attribute name="height">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0" />
<xs:maxInclusive value="40" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="width" type="integerAttributeType" default="0" />
</xs:complexType>
<xs:complexType name="softKeyType">
<xs:sequence>
<xs:element name="Label" type="xs:string" />
<xs:element name="URI" type="xs:string" />
</xs:sequence>
<xs:attribute name="index" use="required">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="1" />
<xs:maxInclusive value="6" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="icon" type="integerAttributeType" default="0" />
</xs:complexType>
<xs:complexType name="iconListType">
<xs:sequence>
<xs:element name="Icon" minOccurs="1" maxOccurs="unbounded">
<xs:complexType mixed="true">
<xs:attribute name="index" type="integerAttributeType" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="AastraIPPhoneTextScreen">
<xs:complexType>
<xs:sequence>
<xs:element name="Title" type="xs:string" />
<xs:element name="Title" type="titleTagType" minOccurs="0" maxOccurs="1"/>
<xs:element name="Text">
<xs:simpleType>
<xs:restriction base="xs:string">
@ -17,54 +108,97 @@
</xs:sequence>
<xs:attribute name="destroyOnExit" type="textAttributeType" default="no" />
<xs:attribute name="Beep" type="textAttributeType" default="no" />
<xs:attribute name="LockIn" type="textAttributeType" default="no" />
<xs:attribute name="Timeout" type="integerAttributeType" default="45" />
<xs:attribute name="cancelAction" type="xs:string" />
<xs:attribute name="allowAnswer" type="xs:string" default="no"/>
</xs:complexType>
</xs:element>
<xs:element name="AastraIPPhoneTextMenu">
<xs:complexType>
<xs:sequence>
<xs:element name="Title" type="xs:string" />
<xs:element name="Title" type="titleTagType" minOccurs="0" maxOccurs="1"/>
<xs:element name="MenuItem" minOccurs="1" maxOccurs="15">
<xs:complexType>
<xs:sequence>
<xs:element name="Prompt" type="xs:string" />
<xs:element name="URI" type="xs:string" />
<xs:all>
<xs:element name="Prompt" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="URI" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="Dial" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="Selection" type="xs:string" minOccurs="0" maxOccurs="1" />
</xs:sequence>
</xs:all>
<xs:attribute name="base" type="xs:string" />
<xs:attribute name="icon" type="integerAttributeType" default="0" />
</xs:complexType>
</xs:element>
<xs:element name="SoftKey" type="softKeyType" minOccurs="0" maxOccurs="6"/>
<xs:element name="SoftKey" type="softKeyType" minOccurs="0" maxOccurs="6" />
<xs:element name="IconList" type="iconListType" minOccurs="0" maxOccurs="1" />
</xs:sequence>
<xs:attribute name="destroyOnExit" type="textAttributeType" default="no" />
<xs:attribute name="Beep" type="textAttributeType" default="no" />
<xs:attribute name="style" type="xs:string" default="numbered" />
<xs:attribute name="defaultIndex" type="integerAttributeType" default="1" />
<xs:attribute name="Beep" type="textAttributeType" default="no" />
<xs:attribute name="LockIn" type="textAttributeType" default="no" />
<xs:attribute name="Timeout" type="integerAttributeType" default="45" />
<xs:attribute name="defaultIndex" type="integerAttributeType" default="1" />
<xs:attribute name="cancelAction" type="xs:string" />
<xs:attribute name="style" type="xs:string" default="numbered" />
<xs:attribute name="allowAnswer" type="xs:string" default="no"/>
</xs:complexType>
</xs:element>
<xs:element name="AastraIPPhoneInputScreen">
<xs:complexType>
<xs:sequence>
<xs:element name="Title" />
<xs:element name="Prompt" />
<xs:element name="Title" type="titleTagType" minOccurs="0" maxOccurs="1" />
<xs:element name="Prompt" minOccurs="0" maxOccurs="1" />
<xs:element name="URL" />
<xs:element name="Parameter" />
<xs:element name="Default" />
<xs:element name="SoftKey" type="softKeyType" minOccurs="0" maxOccurs="6"/>
<xs:element name="Parameter" minOccurs="0" maxOccurs="1" />
<xs:element name="Default" minOccurs="0" maxOccurs="1" />
<xs:element name="Selection" minOccurs="0" maxOccurs="1" />
<xs:element name="InputField" minOccurs="0" maxOccurs="6">
<xs:complexType>
<xs:sequence>
<xs:element name="Prompt" minOccurs="0" maxOccurs="1" />
<xs:element name="Parameter" minOccurs="0" maxOccurs="1" />
<xs:element name="Default" minOccurs="0" maxOccurs="1" />
<xs:element name="Selection" minOccurs="0" maxOccurs="1" />
<xs:element name="SoftKey" type="softKeyType" minOccurs="0" maxOccurs="6"/>
</xs:sequence>
<xs:attribute name="type" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="IP|string|number|timeUS|dateUS|timeInt|dateInt|Empty" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="password" type="textAttributeType" default="no" />
<xs:attribute name="editable" type="textAttributeType" default="yes" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="IP|string|number" />
<xs:pattern value="IP|string|number|timeUS|dateUS|timeInt|dateInt" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="password" type="textAttributeType" default="no" />
<xs:attribute name="destroyOnExit" type="textAttributeType" default="no" />
<xs:attribute name="editable" type="textAttributeType" default="yes" />
<xs:attribute name="Beep" type="textAttributeType" default="no" />
</xs:complexType>
<xs:attribute name="password" type="textAttributeType" default="no" />
<xs:attribute name="destroyOnExit" type="textAttributeType" default="no" />
<xs:attribute name="editable" type="textAttributeType" default="yes" />
<xs:attribute name="Beep" type="textAttributeType" default="no" />
<xs:attribute name="LockIn" type="textAttributeType" default="no" />
<xs:attribute name="Timeout" type="integerAttributeType" default="45" />
<xs:attribute name="defaultIndex" type="integerAttributeType" default="1" />
<xs:attribute name="cancelAction" type="xs:string" />
<xs:attribute name="allowAnswer" type="xs:string" default="no"/>
<xs:attribute name="displayMode" default="uncondensed">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="condensed|uncondensed" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="AastraIPPhoneDirectory">
@ -77,14 +211,20 @@
<xs:element name="Prompt" type="xs:string" />
<xs:element name="URI" type="xs:string" />
</xs:sequence>
<xs:attribute name="base" type="xs:string" />
<xs:attribute name="icon" type="integerAttributeType" default="0" />
</xs:complexType>
</xs:element>
<xs:element name="SoftKey" type="softKeyType" minOccurs="0" maxOccurs="6"/>
<xs:element name="SoftKey" type="softKeyType" minOccurs="0" maxOccurs="6" />
<xs:element name="IconList" type="iconListType" minOccurs="0" maxOccurs="1" />
</xs:sequence>
<xs:attribute name="destroyOnExit" type="textAttributeType" default="no" />
<xs:attribute name="Beep" type="textAttributeType" default="no" />
<xs:attribute name="destroyOnExit" type="textAttributeType" default="no" />
<xs:attribute name="Beep" type="textAttributeType" default="no" />
<xs:attribute name="LockIn" type="textAttributeType" default="no" />
<xs:attribute name="Timeout" type="integerAttributeType" default="45" />
<xs:attribute name="next" type="xs:string" />
<xs:attribute name="previous" type="xs:string" />
<xs:attribute name="cancelAction" type="xs:string" />
</xs:complexType>
</xs:element>
@ -98,6 +238,7 @@
</xs:element>
</xs:sequence>
<xs:attribute name="Beep" type="textAttributeType" default="no" />
<xs:attribute name="triggerDestroyOnExit" type="textAttributeType" default="no" />
</xs:complexType>
</xs:element>
@ -120,32 +261,105 @@
</xs:element>
</xs:sequence>
<xs:attribute name="Beep" type="textAttributeType" default="no" />
<xs:attribute name="triggerDestroyOnExit" type="textAttributeType" default="no" />
</xs:complexType>
</xs:element>
<xs:simpleType name="textAttributeType">
<xs:restriction base="xs:string">
<xs:pattern value="yes|no" />
</xs:restriction>
</xs:simpleType>
<xs:element name="AastraIPPhoneConfiguration">
<xs:complexType>
<xs:sequence>
<xs:element name="ConfigurationItem" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Parameter" type="xs:string" />
<xs:element name="Value" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="Beep" type="textAttributeType" default="no" />
<xs:attribute name="triggerDestroyOnExit" type="textAttributeType" default="no" />
</xs:complexType>
</xs:element>
<xs:group name="linesAndScroll">
<xs:sequence>
<xs:element name="Scroll" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="Line" type="lineTagType" minOccurs="1" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="Height" type="integerAttributeType" default="1" />
</xs:complexType>
</xs:element>
<xs:element name="Line" type="lineTagType" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:group>
<xs:element name="AastraIPPhoneFormattedTextScreen">
<xs:complexType>
<xs:sequence>
<xs:element name="Line" type="lineTagType" minOccurs="0" maxOccurs="unbounded" />
<xs:group ref="linesAndScroll" minOccurs="0" maxOccurs="1"/>
<xs:element name="SoftKey" type="softKeyType" minOccurs="0" maxOccurs="6" />
</xs:sequence>
<xs:attribute name="destroyOnExit" type="textAttributeType" default="no" />
<xs:attribute name="Beep" type="textAttributeType" default="no" />
<xs:attribute name="LockIn" type="textAttributeType" default="no" />
<xs:attribute name="Timeout" type="integerAttributeType" default="45" />
<xs:attribute name="cancelAction" type="xs:string" />
<xs:attribute name="allowAnswer" type="xs:string" default="no"/>
</xs:complexType>
</xs:element>
<xs:element name="AastraIPPhoneImageScreen">
<xs:complexType>
<xs:sequence>
<xs:element name="Image" type="imageType" />
<xs:element name="SoftKey" type="softKeyType" minOccurs="0" maxOccurs="6" />
</xs:sequence>
<xs:attribute name="destroyOnExit" type="textAttributeType" default="no" />
<xs:attribute name="Beep" type="textAttributeType" default="no" />
<xs:attribute name="LockIn" type="textAttributeType" default="no" />
<xs:attribute name="Timeout" type="integerAttributeType" default="45" />
<xs:attribute name="cancelAction" type="xs:string" />
</xs:complexType>
</xs:element>
<xs:element name="AastraIPPhoneImageMenu">
<xs:complexType>
<xs:sequence>
<xs:element name="Image" type="imageType" />
<xs:element name="URIList">
<xs:complexType>
<xs:sequence>
<xs:element name="URI" minOccurs="0" maxOccurs="12">
<xs:complexType mixed="true">
<xs:attribute name="base" />
<xs:attribute name="key" use="required" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]|#|\*" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SoftKey" type="softKeyType" minOccurs="0" maxOccurs="6" />
<xs:element name="IconList" type="iconListType" minOccurs="0" maxOccurs="1" />
</xs:sequence>
<xs:attribute name="destroyOnExit" type="textAttributeType" default="no" />
<xs:attribute name="Beep" type="textAttributeType" default="no" />
<xs:attribute name="LockIn" type="textAttributeType" default="no" />
<xs:attribute name="Timeout" type="integerAttributeType" default="45" />
<xs:attribute name="cancelAction" type="xs:string" />
<xs:attribute name="allowAnswer" type="xs:string" default="no"/>
</xs:complexType>
</xs:element>
<xs:simpleType name="integerAttributeType">
<xs:restriction base="xs:integer" />
</xs:simpleType>
<xs:complexType name="softKeyType">
<xs:sequence>
<xs:element name="Label" type="xs:string" />
<xs:element name="URI" type="xs:string" />
</xs:sequence>
<xs:attribute name="index" use="required">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="1" />
<xs:maxInclusive value="6" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:schema>

Binary file not shown.

BIN
PA-001008-00-00-XML-API.pdf Normal file

Binary file not shown.

View File

@ -1,19 +1,25 @@
AASTRA TELECOM INC.
April 2007
July 2007
-PA-001004-00-03-XML-API.pdf - Aastra IP Phone XML API document. For use with IP Phone SIP Release 1.4.2.
-AastraXMLSchema 1.4.2.xsd - XML Schema which can be used to validate XML development.
For use with IP Phone SIP Release 1.4.2.
-PA-001008-00-00-XML-API.pdf - Aastra IP Phone XML API document. For use with IP Phone SIP Release 2.1.0
-php_classes 1.4.2.zip - contains the directory php classes with all the XML classes.
-AastraXMLSchema 2.1.0.xsd - XML Schema which can be used to validate XML development.
For use with IP Phone SIP Release 2.1
-php_classes 2.1.0.zip - contains the directory php classes with all the XML classes.
The files are commented.
-asterisk sample source 1.4.2.zip - contains the source code of XML Asterisk integration described in the XML API document
-asterisk sample source 2.1.0.zip - contains the source code of XML Asterisk integration described in the XML API document
The files are commented.
-startup sample source 2.1.0.zip - contains the source code of the Asterisk self configuration described in the XML API Document
The files are commented.
For XML documents related to IP Phone SIP Release 1.3.0, see file PA-001004-00-00.zip
For XML documents related to IP Phone SIP Release 1.3.1, see file PA-001004-00-01.zip
For XML documents related to IP Phone SIP Release 1.4.1, see file PA-001004-00-02.zip
For XML documents related to IP Phone SIP Release 1.4.1, see file PA-001004-00-02.zip
For XML documents related to IP Phone SIP Release 1.4.2, see file PA-001004-00-03.zip
For XML documents related to IP Phone SIP Release 2.0.1, see file PA-001007-00-00.zip
For XML documents related to IP Phone SIP Release 2.0.2, see file PA-001007-00-01.zip

11275
XML-API.txt

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
Copyright (c) 2006 Aastra Telecom US, Inc.
Copyright (c) 2007 Aastra Telecom US, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without

View File

@ -1,48 +1,26 @@
<?
###################################################################################################
# Copyright (c) 2006 Aastra Telecom US, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of Aastra Telecom US, Inc. may not be used to endorse or promote
# products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY AASTRA TELECOM US, INC. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL AASTRA TELECOM US, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###################################################################################################
# Asterisk Call Forward for Aastra SIP Phones R1.4.1 or better
#####################################################################
# Asterisk Call Forward for Aastra SIP Phones R2.1.0 or better
#
# php source code
###################################################################################################
# Provided by Aastra Telecom Ltd 2007
#
# @user extension
# @action '' or check
# @key identification of the key used for the function
#####################################################################
include (dirname(__FILE__)."/phpagi/misc.php");
include (dirname(__FILE__)."/phpagi/phpagi-asmanager.php");
###################################################################################################
#####################################################################
# Aastra_decode_HTTP_header
#
# Returns an array
# 0 Phone Type
# 1 Phone MAC Address
# 2 Phone firmware version
###################################################################################################
#####################################################################
function Aastra_decode_HTTP_header()
{
@ -64,153 +42,151 @@ else
return($value);
}
###################################################################################################
# Global parameters
$Server = "http://$SERVER_ADDR".$_SERVER['SCRIPT_NAME'];
function Aastra_manage_cf($user,$action,$value)
{
# Connect to AGI
$cf="";
$as = new AGI_AsteriskManager();
$res = $as->connect();
# Depending on action
switch($action)
{
case 'cancel':
$res = $as->Command('database del CF '.$user);
break;
case 'set':
$res = $as->Command('database put CF '.$user.' '.$value);
$cf=$value;
break;
default:
#GET CFWD
$res = $as->Command('database get CF '.$user);
$line=split("\n", $res['data']);
$data=split(" ", $line[0]);
if($data[0]=="Value:") $cf=$data[1];
if($cf=="")
{
$data=split(" ", $line[1]);
if($data[0]=="Value:") $cf=$data[1];
}
break;
}
# Disconnect properly
$as->disconnect();
return($cf);
}
#####################################################################
# Global parameters
$Server = "http://".$_SERVER['SERVER_ADDR'].$_SERVER['SCRIPT_NAME'];
# Retrieve parameters
$user=$_GET['user'];
$action=$_GET['action'];
$value=$_GET['value'];
$key=$_GET['key'];
# Get header info
$header=Aastra_decode_HTTP_header();
# Connect to AGI
$as = new AGI_AsteriskManager();
$res = $as->connect();
#GET CFWD
$res = $as->Command('database get CF '.$user);
$line=split("\n", $res['data']);
$data=split(" ", $line[0]);
if($data[0]=="Value:") $cf=$data[1];
if($cf=="")
# Depending on action
switch($action)
{
$data=split(" ", $line[1]);
if($data[0]=="Value:") $cf=$data[1];
}
# change CF status
if(isset($action))
{
if($action=="cancel")
{
$res = $as->Command('database del CF '.$user);
$output = "<AastraIPPhoneExecute>\n";
case 'cancel':
case 'set':
case 'check':
$cf=Aastra_manage_cf($user,$action,$value);
$output = "<AastraIPPhoneExecute triggerDestroyOnExit=\"yes\">\n";
$output .= "<ExecuteItem URI=\"".$Server."?action=msg&amp;user=".$user."\"/>\n";
switch($header[0])
if($cf=='') $output .= "<ExecuteItem URI=\"Led: ".$key."=off\"/>\n";
else $output .= "<ExecuteItem URI=\"Led: ".$key."=on\"/>\n";
if($action!='check')
{
case "Aastra9112i":
case "Aastra9133i":
break;
default:
$output .= "<ExecuteItem URI=\"".$Server."?user=".$user."\"/>\n";
break;
switch($header[0])
{
case "Aastra53i":
break;
default:
$output .= "<ExecuteItem URI=\"".$Server."?user=".$user."&amp;key=".$key."\"/>\n";
break;
}
}
$output .= "</AastraIPPhoneExecute>\n";
}
break;
if($action=="set")
{
$res = $as->Command('database put CF '.$user.' '.$value);
$output = "<AastraIPPhoneExecute>\n";
$output .= "<ExecuteItem URI=\"".$Server."?action=msg&amp;user=".$user."\"/>\n";
switch($header[0])
{
case "Aastra9112i":
case "Aastra9133i":
break;
default:
$output .= "<ExecuteItem URI=\"".$Server."?user=".$user."\"/>\n";
break;
}
$output .= "</AastraIPPhoneExecute>\n";
}
if($action=="change")
{
case 'change':
$cf=Aastra_manage_cf($user,$action,$value);
$output = "<AastraIPPhoneInputScreen type=\"number\" destroyOnExit=\"yes\">\n";
$output .= "<Title>Call Forward</Title>\n";
$output .= "<Prompt>Enter destination</Prompt>\n";
$output .= "<URL>".$Server."?user=$user&amp;action=set</URL>\n";
$output .= "<URL>".$Server."?user=$user&amp;action=set&amp;key=$key</URL>\n";
$output .= "<Parameter>value</Parameter>\n";
$output .= "<Default></Default>\n";
$output .= "<Default>$cf</Default>\n";
$output .= "</AastraIPPhoneInputScreen>\n";
}
break;
if($action=="msg")
{
$output = "<AastraIPPhoneStatus Beep=\"yes\">\n";
case 'msg':
$cf=Aastra_manage_cf($user,$action,$value);
$output = "<AastraIPPhoneStatus>\n";
$output .= "<Session>CFDND</Session>\n";
if ($cf=="") $output .= "<Message index=\"1\"></Message>\n";
else $output .= "<Message index=\"1\">CFWD activated</Message>\n";
$output .= "</AastraIPPhoneStatus>\n";
}
# Disconnect properly
$as->disconnect();
header("Content-Type: text/xml");
header("Content-Length: ".strlen($output));
echo $output;
exit;
}
# Disconnect properly
$as->disconnect();
# Setup header type
header("Content-Type: text/xml");
switch($header[0])
{
case "Aastra9112i":
case "Aastra9133i":
$output = "<AastraIPPhoneTextMenu destroyOnExit=\"yes\">\n";
if($cf=="") $output .= "<Title>CFWD deactivated</Title>\n";
else $output .= "<Title>CFWD set (".$cf.")</Title>\n";
if($cf!="")
{
$output .= "<MenuItem>\n";
$output .= "<Prompt>Cancel</Prompt>\n";
$output .= "<URI>$Server/cfwd.php?action=cancel&amp;user=$user</URI>\n";
$output .= "</MenuItem>\n";
}
$output .= "<MenuItem>\n";
$output .= "<Prompt>Change</Prompt>\n";
$output .= "<URI>$Server/cfwd.php?action=change&amp;user=$user</URI>\n";
$output .= "</MenuItem>\n";
$output .= "</AastraIPPhoneTextMenu>\n";
break;
default:
$output = "<AastraIPPhoneTextScreen destroyOnExit=\"yes\">\n";
$output .= "<Title>Call Forward for $user</Title>\n";
if ($cf=="") $output .= "<Text>Call Forward is currently deactivated.</Text>\n";
else $output .= "<Text>Call Forward is currently set to $cf.</Text>\n";
$output .= "<SoftKey index=\"1\">\n";
$output .= "<Label>Change</Label>\n";
$output .= "<URI>$Server/cfwd.php?action=change&amp;user=$user</URI>\n";
$output .= "</SoftKey>\n";
if($cf!="")
$cf=Aastra_manage_cf($user,$action,$value);
switch($header[0])
{
$output .= "<SoftKey index=\"2\">\n";
$output .= "<Label>Cancel</Label>\n";
$output .= "<URI>$Server/cfwd.php?action=cancel&amp;user=$user</URI>\n";
$output .= "</SoftKey>\n";
case "Aastra53i":
$output = "<AastraIPPhoneTextMenu destroyOnExit=\"yes\">\n";
if($cf=="") $output .= "<Title>CFWD deactivated</Title>\n";
else $output .= "<Title>CFWD set (".$cf.")</Title>\n";
if($cf!="")
{
$output .= "<MenuItem>\n";
$output .= "<Prompt>Cancel</Prompt>\n";
$output .= "<URI>$Server/cfwd.php?action=cancel&amp;user=$user&amp;key=$key</URI>\n";
$output .= "</MenuItem>\n";
}
$output .= "<MenuItem>\n";
$output .= "<Prompt>Change</Prompt>\n";
$output .= "<URI>$Server/cfwd.php?action=change&amp;user=$user&amp;key=$key</URI>\n";
$output .= "</MenuItem>\n";
$output .= "</AastraIPPhoneTextMenu>\n";
break;
default:
$output = "<AastraIPPhoneTextScreen destroyOnExit=\"yes\">\n";
$output .= "<Title>Call Forward for $user</Title>\n";
if ($cf=="") $output .= "<Text>Call Forward is currently deactivated.</Text>\n";
else $output .= "<Text>Call Forward is currently set to $cf.</Text>\n";
$output .= "<SoftKey index=\"1\">\n";
$output .= "<Label>Change</Label>\n";
$output .= "<URI>$Server/cfwd.php?action=change&amp;user=$user&amp;key=$key</URI>\n";
$output .= "</SoftKey>\n";
if($cf!="")
{
$output .= "<SoftKey index=\"2\">\n";
$output .= "<Label>Cancel</Label>\n";
$output .= "<URI>$Server/cfwd.php?action=cancel&amp;user=$user&amp;key=$key</URI>\n";
$output .= "</SoftKey>\n";
}
$output .= "<SoftKey index=\"6\">\n";
$output .= "<Label>Done</Label>\n";
$output .= "<URI>SoftKey:Exit</URI>\n";
$output .= "</SoftKey>\n";
$output .= "</AastraIPPhoneTextScreen>\n";
break;
}
$output .= "<SoftKey index=\"6\">\n";
$output .= "<Label>Done</Label>\n";
$output .= "<URI>SoftKey:Exit</URI>\n";
$output .= "</SoftKey>\n";
$output .= "</AastraIPPhoneTextScreen>\n";
break;
}
header("Content-Type: text/xml");
header("Content-Length: ".strlen($output));
echo $output;
exit;
?>

View File

@ -1,35 +1,9 @@
<?
###################################################################################################
# Copyright (c) 2006 Aastra Telecom US, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of Aastra Telecom US, Inc. may not be used to endorse or promote
# products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY AASTRA TELECOM US, INC. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL AASTRA TELECOM US, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###################################################################################################
# Asterisk Directory for Aastra SIP Phones R1.4.1 or better
#####################################################################
# Asterisk Directory for Aastra SIP Phones R2.0.0 or better
#
# php source code
# Provided by Aastra Telecom Ltd 2007
#
# Parses
# - SIP users
@ -37,13 +11,33 @@
#
# Warning
# Location of Asterisk config files is set to "/etc/asterisk"
###################################################################################################
#####################################################################
function Aastra_decode_HTTP_header()
{
$user_agent=$_SERVER["HTTP_USER_AGENT"];
if(stristr($user_agent,"Aastra"))
{
$value=preg_split("/ MAC:/",$user_agent);
$fin=preg_split("/ /",$value[1]);
$value[1]=preg_replace("/\-/","",$fin[0]);
$value[2]=preg_replace("/V:/","",$fin[1]);
}
else
{
$value[0]="MSIE";
$value[1]="NA";
$value[2]="NA";
}
return($value);
}
# Location of asterisk config files
$location = "/etc/asterisk/";
# Global Variables
$Server = "http://$SERVER_ADDR".$_SERVER['SCRIPT_NAME'];
$Server = "http://".$_SERVER['SERVER_ADDR'].$_SERVER['SCRIPT_NAME'];
# Init number of records
$index=0;
@ -56,8 +50,8 @@ while ($v=current($sip_array))
{
$temp=$v['callerid'];
$len=strlen($temp);
$callerid=substr($temp,0,$len-(strlen(strrchr($temp, '<')))-1);
$directory[] = "<Prompt>". $callerid."</Prompt>\n"."<URI>".key($sip_array)."</URI>\n"."<Selection>". key($sip_array)."&amp;name=".$callerid."</Selection>\n";
$callerid=substr($temp,0,$len-(strlen(strrchr($temp, '<'))));
$directory[] = "<Prompt>". $callerid."</Prompt>\n"."<URI>Dial:".key($sip_array)."</URI>\n"."<Selection>".key($sip_array)."</Selection>\n"."<Dial>".key($sip_array)."</Dial>\n";
$index++;
}
next($sip_array);
@ -69,7 +63,7 @@ while($v=current($iax_array))
{
if(isset($v['name']))
{
$directory[]="<Prompt>".$v['name']."</Prompt>\n"."<URI>".key($iax_array)."</URI>\n";
$directory[]="<Prompt>".$v['name']."</Prompt>\n"."<URI>Dial:".key($iax_array)."</URI>\n"."<Dial>".key($iax_array)."</Dial>\n";
$index++;
}
next($iax_array);
@ -78,9 +72,21 @@ while($v=current($iax_array))
# Sort Directory
sort($directory);
# Get header info
$header=Aastra_decode_HTTP_header();
switch($header[0])
{
case 'Aastra53i':
$MaxLines=13;
break;
default:
$MaxLines=15;
break;
}
# Retrieve last page
$last=intval($index/15);
if(($index-$last*15) != 0) $last++;
$last=intval($index/$MaxLines);
if(($index-$last*$MaxLines) != 0) $last++;
# Retrieve current page
$page=$_GET['page'];
@ -92,7 +98,7 @@ $output .= "<Title>Directory ($page/$last)</Title>\n";
$index=1;
foreach ($directory as $v)
{
if(($index>=(($page-1)*15+1)) and ($index<=$page*15))
if(($index>=(($page-1)*$MaxLines+1)) and ($index<=$page*$MaxLines))
{
$output .= "<MenuItem>\n";
$output .= $v;
@ -101,37 +107,62 @@ foreach ($directory as $v)
$index++;
}
# Dial button
$output .= "<SoftKey index=\"1\">\n";
$output .= "<Label>Dial</Label>\n";
$output .= "<URI>SoftKey:Dial</URI>\n";
$output .= "</SoftKey>\n";
# Next button
if($page!=$last)
# Depending on the phone
switch($header[0])
{
$next=$page+1;
$output .= "<SoftKey index=\"5\">\n";
$output .= "<Label>Next</Label>\n";
$output .= "<URI>$Server?page=$next</URI>\n";
$output .= "</SoftKey>\n";
}
case 'Aastra53i':
# Previous button as a menu
if($page!=1)
{
$previous=$page-1;
$output .= "<MenuItem>\n";
$output .= "<Prompt>Previous</Prompt>\n"."<URI>".$Server."?page=".$previous."</URI>\n";
$output .= "</MenuItem>\n";
}
# Next button as a menu
if($page!=$last)
{
$next=$page+1;
$output .= "<MenuItem>\n";
$output .= "<Prompt>Next</Prompt>\n";
$output .= "<URI>".$Server."?page=".$next."</URI>\n";
$output .= "</MenuItem>\n";
}
break;
default:
# Dial button
$output .= "<SoftKey index=\"1\">\n";
$output .= "<Label>Dial</Label>\n";
$output .= "<URI>SoftKey:Select</URI>\n";
$output .= "</SoftKey>\n";
# Previous button
if($page!=1)
{
$previous=$page-1;
$output .= "<SoftKey index=\"2\">\n";
$output .= "<Label>Previous</Label>\n";
$output .= "<URI>$Server?page=$previous</URI>\n";
$output .= "</SoftKey>\n";
}
# Next button
if($page!=$last)
{
$next=$page+1;
$output .= "<SoftKey index=\"5\">\n";
$output .= "<Label>Next</Label>\n";
$output .= "<URI>$Server?page=$next</URI>\n";
$output .= "</SoftKey>\n";
}
# Exit Button
$output .= "<SoftKey index=\"6\">\n";
$output .= "<Label>Exit</Label>\n";
$output .= "<URI>SoftKey:Exit</URI>\n";
$output .= "</SoftKey>\n";
# Previous button
if($page!=1)
{
$previous=$page-1;
$output .= "<SoftKey index=\"2\">\n";
$output .= "<Label>Previous</Label>\n";
$output .= "<URI>$Server?page=$previous</URI>\n";
$output .= "</SoftKey>\n";
}
# Exit Button
$output .= "<SoftKey index=\"6\">\n";
$output .= "<Label>Exit</Label>\n";
$output .= "<URI>SoftKey:Exit</URI>\n";
$output .= "</SoftKey>\n";
break;
}
# End of the object
$output .= "</AastraIPPhoneTextMenu>\n";

View File

@ -1,35 +1,13 @@
<?
###################################################################################################
# Copyright (c) 2006 Aastra Telecom US, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of Aastra Telecom US, Inc. may not be used to endorse or promote
# products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY AASTRA TELECOM US, INC. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL AASTRA TELECOM US, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###################################################################################################
# Asterisk DND for Aastra SIP Phones R1.4.1 or better
#####################################################################
# Asterisk DND for Aastra SIP Phones R2.0.0 or better
#
# php source code
# Provided by Aastra Telecom Ltd 2006
#
# @user=extension
# @action=change or check
# @key identification of the key used for the function
#####################################################################
include (dirname(__FILE__)."/phpagi/misc.php");
@ -64,16 +42,55 @@ else
return($value);
}
function Aastra_manage_dnd($user,$action)
{
# Connect to AGI
$as = new AGI_AsteriskManager();
$res = $as->connect();
#DND GET
$res = $as->Command('database get DND '.$user);
$line=split("\n", $res['data']);
$value=split(" ", $line[0]);
if($value[1]=="YES") $dnd=1;
if($dnd==0)
{
$value=split(" ", $line[1]);
if($value[1]=="YES") $dnd=1;
}
if($action=='change')
{
# change DND status
if($dnd==0)
{
$res = $as->Command('database put DND '.$user.' YES');
$dnd=1;
}
else
{
$res = $as->Command('database del DND '.$user);
$dnd=0;
}
}
# Disconnect properly
$as->disconnect();
return($dnd);
}
#####################################################################
# Global parameters
#####################################################################
$Server = "http://$SERVER_ADDR".$_SERVER['SCRIPT_NAME'];
$Server = "http://".$_SERVER['SERVER_ADDR'].$_SERVER['SCRIPT_NAME'];
$dnd=0;
# Retrieve parameters
$user=$_GET['user'];
$action=$_GET['action'];
$status=$_GET['status'];
$key=$_GET['key'];
# Force default action
if($action=="") $action="change";
@ -81,92 +98,52 @@ if($action=="") $action="change";
# Get header info
$header=Aastra_decode_HTTP_header();
# Get current value only if action is change or update
if(($action=="change") || ($action=="update"))
{
# Connect to AGI
$as = new AGI_AsteriskManager();
$res = $as->connect();
#DND GET
$res = $as->Command('database get DND '.$user);
$line=split("\n", $res['data']);
$value=split(" ", $line[0]);
if($value[1]=="YES") $dnd=1;
if($dnd==0)
{
$value=split(" ", $line[1]);
if($value[1]=="YES") $dnd=1;
}
# CHANGE CURRENT VALUE
if($action=="change")
{
# change DND status
if($dnd==0)
{
$res = $as->Command('database put DND '.$user.' YES');
$dnd=1;
}
else
{
$res = $as->Command('database del DND '.$user);
$dnd=0;
}
}
# Disconnect properly
$as->disconnect();
}
# Setup header type
header("Content-Type: text/xml");
# Update action
if($action=="update")
# Depending on action
switch($action)
{
$output = "<AastraIPPhoneExecute>\n";
$output .= "<ExecuteItem URI=\"".$Server."?action=msg&amp;status=".$status."\"/>\n";
$output .= "</AastraIPPhoneExecute>\n";
}
case 'display':
$output = "<AastraIPPhoneFormattedTextScreen destroyOnExit=\"yes\" Timeout=\"2\">\n";
$output .= "<Line/>\n";
$output .= "<Line/>\n";
if ($status==1) $output .= "<Line Size=\"double\" Align=\"center\">DND activated</Line>\n";
else $output .= "<Line Size=\"double\" Align=\"center\">DND deactivated</Line>\n";
$output .= "<SoftKey index=\"6\">\n";
$output .= "<Label> </Label>\n";
$output .= "<URI>SoftKey:Exit</URI>\n";
$output .= "</SoftKey>\n";
$output .= "</AastraIPPhoneFormattedTextScreen>\n";
break;
# Update message
if($action=="msg")
{
$output = "<AastraIPPhoneStatus Beep=\"yes\">\n";
$output .= "<Session>CFDND12345</Session>\n";
if ($status==1) $output .= "<Message index=\"0\">DND activated</Message>\n";
else $output .= "<Message index=\"0\"></Message>\n";
$output .= "</AastraIPPhoneStatus>\n";
}
case 'msg':
$output = "<AastraIPPhoneStatus>\n";
$output .= "<Session>CFDND</Session>\n";
if ($status==1) $output .= "<Message index=\"0\">DND activated</Message>\n";
else $output .= "<Message index=\"0\"></Message>\n";
$output .= "</AastraIPPhoneStatus>\n";
break;
# Action=change
if($action=="change")
{
switch($header[0])
{
case "Aastra9112i":
case "Aastra9133i":
$output = "<AastraIPPhoneStatus Beep=\"yes\">\n";
$output .= "<Session>CFDND12345</Session>\n";
if ($dnd==1) $output .= "<Message index=\"0\">DND activated</Message>\n";
else $output .= "<Message index=\"0\"></Message>\n";
$output .= "</AastraIPPhoneStatus>\n";
break;
default:
$output = "<AastraIPPhoneTextScreen destroyOnExit=\"yes\">\n";
$output .= "<Title></Title>\n";
if ($dnd==0) $output .= "<Text>DND deactivated.</Text>\n";
else $output .= "<Text>DND activated.</Text>\n";
$output .= "<SoftKey index=\"6\">\n";
$output .= "<Label>Done</Label>\n";
$output .= "<URI>".$Server."?action=update&amp;status=".$dnd."</URI>\n";
$output .= "</SoftKey>\n";
$output .= "</AastraIPPhoneTextScreen>\n";
break;
}
}
case 'change':
case 'check':
$dnd=Aastra_manage_dnd($user,$action);
$output = "<AastraIPPhoneExecute>\n";
$output .= "<ExecuteItem URI=\"".$Server."?action=msg&amp;status=".$dnd."\"/>\n";
if ($dnd==1) $output .= "<ExecuteItem URI=\"Led: ".$key."=on\"/>\n";
else $output .= "<ExecuteItem URI=\"Led: ".$key."=off\"/>\n";
switch($header[0])
{
case "Aastra53i":
break;
default:
if($action=='change') $output .= "<ExecuteItem URI=\"".$Server."?action=display&amp;status=".$dnd."\"/>\n";
break;
}
$output .= "</AastraIPPhoneExecute>\n";
break;
}
header("Content-Length: ".strlen($output));
echo $output;

View File

@ -0,0 +1,37 @@
<?
#############################################################################
# Asterisk Register - Update DND and CFWD status
#
# Aastra SIP Phones 2.1.0 or better
#
# Copyright 2006 Aastra Telecom Ltd
#
# script.php?user=XXX&dndkey=YYY&cfkey=ZZZ
# XXX is the extension of the phone on the platform
# YYY is the number of the dynamic dnd key
# ZZZ is the number of the dynamic cfwd key
#
#############################################################################
#####################################################################
# Global parameters
$Server = "http://".$_SERVER['SERVER_ADDR'].$_SERVER['SCRIPT_NAME'];
$Server = substr($Server,0,(strlen($Server)-strlen(strrchr($Server, "/"))+1));
# Retrieve parameters
$user=$_GET['user'];
$dndkey=$_GET['dndkey'];
$cfkey=$_GET['cfkey'];
# Update DND and CFWD
$output = "<AastraIPPhoneExecute>\n";
$output .= "<ExecuteItem URI=\"".$Server."dnd.php?action=check&amp;user=".$user."&amp;key=".$dndkey."\"/>\n";
$output .= "<ExecuteItem URI=\"".$Server."cfwd.php?action=check&amp;user=".$user."&amp;key=".$cfkey."\"/>\n";
$output .= "</AastraIPPhoneExecute>\n";
# Return object
header("Content-Type: text/xml");
header("Content-Length: ".strlen($output));
echo $output;
exit;
?>

View File

@ -1,62 +1,58 @@
<?php
###################################################################################################
# Copyright (c) 2006 Aastra Telecom US, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of Aastra Telecom US, Inc. may not be used to endorse or promote
# products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY AASTRA TELECOM US, INC. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL AASTRA TELECOM US, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###################################################################################################
# Aastra XML API Classes - AastraIPPhone
# Copyright Aastra Telecom 2007
#
# AastraIPPhone is the root class for all the Aastra XML objects.
#
# Public methods
# setTitle(Title) to setup the title of an object
# setTitle(Title) to setup the title of an object (optional)
# setTitleWrap() to set the title to be wrapped on 2 lines (optional)
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
# setDestroyOnExit() to set DestroyonExit parameter to 'yes', 'no' by default (optional)
# setBeep() to enable a notification beep with the object (optional)
# setRefresh(timeout,URL) to add Refresh parameters to the object (optional)
# addSoftkey(index,label,uri) to add custom soktkeys to the object (optional)
# setLockIn() to set the Lock-in tag to 'yes' (optional)
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional)
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
# addSoftkey(index,label,uri,icon_index) to add custom soktkeys to the object (optional)
# addIcon(index,icon) to add custom icons to the object (optional)
# generate() to return the object content
# output() to display the object
#
###################################################################################################
require_once('AastraIPPhoneSoftkeyEntry.class.php');
require_once('AastraIPPhoneIconEntry.class.php');
class AastraIPPhone {
var $_entries;
var $_softkeys;
var $_title;
var $_icons;
var $_title='';
var $_title_wrap='';
var $_destroyOnExit='';
var $_cancelAction='';
var $_refreshTimeout=0;
var $_refreshURL='';
var $_beep='';
var $_lockin='';
var $_timeout=0;
var $_allowAnswer='';
function AastraIPPhone()
{
$this->_entries = array();
$this->_softkeys = array();
$this->_icons = array();
$this->_title = '';
$this->_destroyOnExit='';
$this->_refreshTimeout=0;
$this->_refreshURL='';
$this->_beep='';
$this->_lockin='';
$this->_timeout=0;
$this->_allowAnswer='';
}
function setTitle($title)
@ -64,6 +60,11 @@ class AastraIPPhone {
$this->_title = $title;
}
function setTitleWrap()
{
$this->_title_wrap = "yes";
}
function setRefresh($timeout,$URL)
{
$this->_refreshTimeout = $timeout;
@ -80,6 +81,27 @@ class AastraIPPhone {
$this->_destroyOnExit='yes';
}
function setCancelAction($cancelAction)
{
$this->_cancelAction=$cancelAction;
}
function setLockIn()
{
$this->_lockin='yes';
}
function setTimeout($timeout)
{
$this->_timeout=$timeout;
}
function setAllowAnswer()
{
$this->_allowAnswer='yes';
}
function output()
{
header("Content-type: text/xml");
@ -89,9 +111,21 @@ class AastraIPPhone {
echo($output);
}
function addSoftkey($index, $label, $uri)
function generate()
{
$this->_softkeys[] = new AastraIPPhoneSoftkeyEntry($index, $label, $uri);
$output=$this->render();
return($output);
}
function addSoftkey($index, $label, $uri, $icon=NULL)
{
$this->_softkeys[] = new AastraIPPhoneSoftkeyEntry($index, $this->escape($label), $this->escape($uri), $icon);
}
function addIcon($index, $icon)
{
$this->_icons[] = new AastraIPPhoneIconEntry($index, $icon);
}
function escape($string)

View File

@ -0,0 +1,58 @@
<?php
########################################################################################################
# Aastra XML API Classes - AastraIPPhoneConfiguration
# Copyright Aastra Telecom 2007
#
# AastraIPPhoneConfiguration object.
#
# Public methods
#
# Inherited from AastraIPPhone
# output() to display the object
# generate() to return the object content
# setBeep() to enable a notification beep with the object (optional)
#
# Specific to the object
# addEntry(parameter,value) to add a configuration change.
# setTriggerDestroyOnExit() to set the triggerDestroyOnExit tag to
# "yes" (optional)
#
# Example
# require_once('AastraIPPhoneConfiguration.class.php');
# $configuration = new AastraIPPhoneConfiguration();
# $configuration->addEntry('softkey1 label','Test');
# $configuration->addEntry('softkey1 type','xml');
# $configuration->setTriggerDestroyOnExit();
# $configuration->setBeep();
# $configuration->output();
#
########################################################################################################
require_once('AastraIPPhone.class.php');
require_once('AastraIPPhoneConfigurationEntry.class.php');
class AastraIPPhoneConfiguration extends AastraIPPhone {
function addEntry($parameter, $value)
{
$this->_entries[] = new AastraIPPhoneConfigurationEntry($parameter, $value);
}
function setTriggerDestroyOnExit()
{
$this->_triggerDestroyOnExit="yes";
}
function render()
{
$out = "<AastraIPPhoneConfiguration";
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
if($this->_triggerDestroyOnExit=='yes') $out .= " triggerDestroyOnExit=\"yes\"";
$out .= ">\n";
foreach ($this->_entries as $entry) $out .= $entry->render();
$out .= "</AastraIPPhoneConfiguration>\n";
return($out);
}
}
?>

View File

@ -0,0 +1,41 @@
<?php
################################################################################
# Aastra XML API Classes - AastraIPPhoneConfigurationEntry
# Copyright Aastra Telecom 2007
#
# Internal class for AastraIPPhoneConfiguration object.
################################################################################
class AastraIPPhoneConfigurationEntry extends AastraIPPhone {
var $_parameter;
var $_value;
function AastraIPPhoneConfigurationEntry($parameter, $value)
{
$this->setParameter($parameter);
$this->setValue($value);
}
function setParameter($parameter)
{
$this->_parameter = $parameter;
}
function setValue($value)
{
$this->_value = $value;
}
function render()
{
$parameter = $this->escape($this->_parameter);
$value = $this->escape($this->_value);
$xml = "<ConfigurationItem>\n";
$xml .= "<Parameter>".$parameter."</Parameter>\n";
$xml .= "<Value>".$value."</Value>\n";
$xml .= "</ConfigurationItem>\n";
return($xml);
}
}
?>

View File

@ -1,49 +1,30 @@
<?
##################################################################################################
# Copyright (c) 2006 Aastra Telecom US, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of Aastra Telecom US, Inc. may not be used to endorse or promote
# products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY AASTRA TELECOM US, INC. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL AASTRA TELECOM US, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###################################################################################################
########################################################################################################
# Aastra XML API Classes - AastraIPPhoneDirectory
# Copyright Aastra Telecom 2007
#
# AastraIPPhoneDirectory object.
#
# Public methods
#
# Inherited from AastraIPPhone
# setTitle(Title) to setup the title of an object
# setTitle(Title) to setup the title of an object (optional)
# setTitleWrap() to set the title to be wrapped on 2 lines (optional)
# setDestroyOnExit() to set DestroyonExit parameter to 'yes', 'no' by default (optional)
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
# setBeep() to enable a notification beep with the object (optional)
# addSoftkey(index,label,uri) to add custom softkeys to the object (optional)
# setLockIn() to set the Lock-in tag to 'yes' (optional)
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
# addSoftkey(index,label,uri,icon_index) to add custom softkeys to the object (optional)
# addIcon(index,icon) to add custom icons to the object (optional)
# setRefresh(timeout,URL) to add Refresh parameters to the object (optional)
# generate() to return the object content
# output() to display the object
#
# Specific to the object
# setNext(next) to set URI of the next page, optional
# setPrevious(previous) to set URI of the previous page, optional
# setNext(next) to set URI of the next page (optional)
# setPrevious(previous) to set URI of the previous page (optional)
# addEntry(name,phone) to add an element in the list to be displayed, at least one is needed.
# natsortbyname() to order the list
#
@ -57,8 +38,8 @@
# $directory->addEntry('John Doe', '200');
# $directory->addEntry('Jane Doe', '201');
# $directory->natsortByName();
# $directory->addSoftkey('1','Label 1','http://myserver.com/script.php?action=1');
# $directory->addSoftkey('6','Exit','SoftKey:Exit');
# $directory->addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1');
# $directory->addSoftkey('6', 'Exit', 'SoftKey:Exit');
# $directory->output();
#
########################################################################################################
@ -100,17 +81,37 @@ class AastraIPPhoneDirectory extends AastraIPPhone {
function render()
{
$title = $this->escape($this->_title);
$next = $this->escape($this->_next);
$previous = $this->escape($this->_previous);
$out = '';
$out .= "<AastraIPPhoneDirectory";
if($previous!="") $out .= " previous=\"$previous\"";
if($next!="") $out .= " next=\"$next\"";
if($this->_previous!="")
{
$previous = $this->escape($this->_previous);
$out .= " previous=\"$previous\"";
}
if($this->_next!="")
{
$next = $this->escape($this->_next);
$out .= " next=\"$next\"";
}
if($this->_destroyOnExit == 'yes') $out .= " destroyOnExit=\"yes\"";
if($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
if($this->_cancelAction != "")
{
$cancelAction = $this->escape($this->_cancelAction);
$out .= " cancelAction=\"{$cancelAction}\"";
}
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
if($this->_lockin=='yes') $out .= " LockIn=\"yes\"";
if($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
$out .= ">\n";
$out .= "<Title>{$title}</Title>\n";
if ($this->_title!='')
{
$title = $this->escape($this->_title);
$out .= "<Title";
if ($this->_title_wrap=='yes') $out .= " wrap=\"yes\"";
$out .= ">".$title."</Title>\n";
}
$index=0;
foreach ($this->_entries as $entry) {
if($index<15) $out .= $entry->render();

View File

@ -1,33 +1,8 @@
<?php
###################################################################################################
# Copyright (c) 2006 Aastra Telecom US, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of Aastra Telecom US, Inc. may not be used to endorse or promote
# products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY AASTRA TELECOM US, INC. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL AASTRA TELECOM US, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###################################################################################################
########################################################################################################
# Aastra XML API Classes - AastraIPPhoneDirectoryEntry
# Copyright Aastra Telecom 2007
#
# Internal class for AastraIPPhoneDirectory object.
########################################################################################################

View File

@ -1,44 +1,21 @@
<?php
###################################################################################################
# Copyright (c) 2006 Aastra Telecom US, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of Aastra Telecom US, Inc. may not be used to endorse or promote
# products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY AASTRA TELECOM US, INC. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL AASTRA TELECOM US, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
########################################################################################################
# Aastra XML API Classes - AastraIPPhoneExecute
# Copyright Aastra Telecom 2007
#
# AastraIPPhoneTextMenu object.
# AastraIPPhoneExecute object.
#
# Public methods
#
# Inherited from AastraIPPhone
# output() to display the object
# generate() to return the object content
# setBeep() to enable a notification beep with the object (optional)
#
# Specific to the object
# addEntry(url) to add an action to be executed.
# setTriggerDestroyOnExit() to set the triggerDestroyOnExit tag to "yes" (optional)
# addEntry(url,interruptCall) to add an action to be executed.
#
# Example
# require_once('AastraIPPhoneExecute.class.php');
@ -53,10 +30,17 @@ require_once('AastraIPPhone.class.php');
require_once('AastraIPPhoneExecuteEntry.class.php');
class AastraIPPhoneExecute extends AastraIPPhone {
function addEntry($url)
var $_defaultIndex="";
var $_triggerDestroyOnExit="";
function addEntry($url,$interruptCall=NULL)
{
$this->_entries[] = new AastraIPPhoneExecuteEntry($url);
$this->_entries[] = new AastraIPPhoneExecuteEntry($url,$interruptCall);
}
function setTriggerDestroyOnExit()
{
$this->_triggerDestroyOnExit="yes";
}
function render()
@ -64,6 +48,7 @@ class AastraIPPhoneExecute extends AastraIPPhone {
$title = $this->escape($this->_title);
$out = "<AastraIPPhoneExecute";
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
if($this->_triggerDestroyOnExit=='yes') $out .= " triggerDestroyOnExit=\"yes\"";
$out .= ">\n";
foreach ($this->_entries as $entry) $out .= $entry->render();
$out .= "</AastraIPPhoneExecute>\n";

View File

@ -1,50 +1,28 @@
<?php
###################################################################################################
# Copyright (c) 2006 Aastra Telecom US, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of Aastra Telecom US, Inc. may not be used to endorse or promote
# products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY AASTRA TELECOM US, INC. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL AASTRA TELECOM US, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###################################################################################################
################################################################################
# Aastra XML API Classes - AastraIPPhoneExecuteEntry
# Aastra 480i Firmware 1.4.1 or better
# Copyright Aastra Telecom 2007
#
# Internal class for AastraIPPhoneExecute object.
################################################################################
class AastraIPPhoneExecuteEntry extends AastraIPPhone {
var $_url;
var $_interruptCall;
function AastraIPPhoneExecuteEntry($url)
function AastraIPPhoneExecuteEntry($url,$interruptCall)
{
$this->_url=$url;
$this->_url = $url;
$this->_interruptCall = $interruptCall;
}
function render()
{
$url = $this->escape($this->_url);
$xml = "<ExecuteItem URI=\"".$url."\"/>\n";
$xml = "<ExecuteItem URI=\"".$url."\"";
if ($this->_interruptCall=='no') $xml .= " interuptCall=\"no\"";
$xml .= "/>\n";
return($xml);
}
}

View File

@ -0,0 +1,113 @@
<?
########################################################################################################
# Aastra XML API Classes - AastraIPFormattedPhoneTextScreen
# Copyright Aastra Telecom 2007
#
# AastraIPPhoneFormattedTextScreen object.
#
# Public methods
#
# Inherited from AastraIPPhone
# setDestroyOnExit() to set DestroyonExit parameter to 'yes', 'no' by default (optional)
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
# setBeep() to enable a notification beep with the object (optional)
# setLockIn() to set the Lock-in tag to 'yes' (optional)
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional)
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
# addSoftkey(index, label, uri) to add custom softkeys to the object (optional)
# addIcon(index,icon) to add custom icons to the object (optional)
# setRefresh(timeout,URL) to add Refresh parameters to the object (optional)
# generate() to return the object content
# output() to display the object
#
# Specific to the object
# addLine(text,size,align) to add a formatted line
# setScrollStart(height) to define the beginning of the scrolling section and its height
# setScrollEnd() to define the end of the scrolling section
# setDoneAction(uri) to set the URI to be called when the user selects the default "Done" key (optional)
#
# Example
# require_once('AastraIPPhoneFormattedTextScreen.class.php');
# $ftext = new AastraIPPhoneFormattedTextScreen();
# $ftext->setDestroyOnExit();
# $ftext->addLine('Formatted Screen','double','center');
# $ftext->setScrollStart('2');
# $ftext->addLine('Scrolled text1');
# $ftext->addLine('Scrolled text2');
# $ftext->addLine('Scrolled text3');
# $ftext->addLine('Scrolled text4');
# $ftext->addLine('Scrolled text5');
# $ftext->setScrollEnd();
# $ftext->addLine('Footer',NULL,'center');
# $ftext->addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1','1');
# $ftext->addSoftkey('6', 'Exit', 'SoftKey:Exit');
# $ftext->addIcon('1', 'Icon:Envelope');
# $ftext->output();
#
########################################################################################################
require_once('AastraIPPhone.class.php');
require_once('AastraIPPhoneFormattedTextScreenEntry.class.php');
class AastraIPPhoneFormattedTextScreen extends AastraIPPhone {
var $_doneAction="";
function addLine($text, $size=NULL, $align=NULL)
{
$this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry($text, $size, $align, 'normal');
}
function setScrollStart($height)
{
$this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry(NULL, $height, NULL, 'scrollstart');
}
function setScrollEnd()
{
$this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry(NULL, NULL, NULL, 'scrollend');
}
function setDoneAction($uri)
{
$this->_doneAction = $uri;
}
function render()
{
$out = '';
$out .= "<AastraIPPhoneFormattedTextScreen";
if($this->_destroyOnExit == 'yes') $out .= " destroyOnExit=\"yes\"";
if($this->_cancelAction != "")
{
$cancelAction = $this->escape($this->_cancelAction);
$out .= " cancelAction=\"{$cancelAction}\"";
}
if($this->_doneAction != "")
{
$doneAction = $this->escape($this->_doneAction);
$out .= " doneAction=\"{$doneAction}\"";
}
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
if($this->_lockin=='yes') $out .= " LockIn=\"yes\"";
if($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
if($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
$out .= ">\n";
foreach ($this->_entries as $entry) $out .= $entry->render();
foreach ($this->_softkeys as $softkey) $out .= $softkey->render();
$IconList=0;
foreach ($this->_icons as $icon)
{
if($IconList==0)
{
$out .= "<IconList>\n";
$IconList=1;
}
$out .= $icon->render();
}
if($IconList!=0) $out .= "</IconList>\n";
$out .= "</AastraIPPhoneFormattedTextScreen>\n";
return $out;
}
}
?>

View File

@ -0,0 +1,45 @@
<?php
################################################################################
# Aastra XML API Classes - AastraIPPhoneFormattedTextScreenEntry
# Copyright Aastra Telecom 2007
#
# Internal class for AastraIPPhoneFormattedTextScreen object.
################################################################################
class AastraIPPhoneFormattedTextScreenEntry extends AastraIPPhone {
var $_text;
var $_size;
var $_align;
var $_type;
function AastraIPPhoneFormattedTextScreenEntry($text, $size, $align, $type)
{
$this->_text=$text;
$this->_size=$size;
$this->_align=$align;
$this->_type=$type;
}
function render()
{
switch($this->_type)
{
case "normal":
$xml = "<Line";
if($this->_size!=NULL) $xml .= " Size=\"{$this->_size}\"";
if($this->_align!=NULL) $xml .= " Align=\"{$this->_align}\"";
$xml .= ">";
$xml .= $this->escape($this->_text)."</Line>\n";
break;
case "scrollstart":
$xml = "<Scroll Height=\"{$this->_size}\">\n";
break;
case "scrollend":
$xml = "</Scroll>\n";
break;
}
return($xml);
}
}
?>

View File

@ -0,0 +1,28 @@
<?php
################################################################################
# Aastra XML API Classes - AastraIPIconEntry
# Copyright Aastra Telecom 2007
#
# Internal class for AastraIPPhone object.
################################################################################
class AastraIPPhoneIconEntry {
var $_index;
var $_icon;
function AastraIPPhoneIconEntry($index, $icon)
{
$this->_index=$index;
$this->_icon=$icon;
}
function render()
{
$index = $this->_index;
$icon = $this->_icon;
$xml = "<Icon index=\"{$index}\">{$icon}</Icon>\n";
return($xml);
}
}
?>

View File

@ -0,0 +1,125 @@
<?php
########################################################################################################
# Aastra XML API Classes - AastraIPPhoneImageMenu
# Copyright Aastra Telecom 2007
#
# AastraIPPhoneImageMenu object.
#
# Public methods
#
# Inherited from AastraIPPhone
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
# setBeep() to enable a notification beep with the object (optional)
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
# setLockIn() to set the Lock-in tag to 'yes' (optional)
# addSoftkey(index,label,uri,icon_index) to add custom softkeys to the object (optional)
# setRefresh(timeout,URL) to add Refresh parameters to the object (optional)
# generate() to return the object content
# output() to display the object
#
# Specific to the object
# setImage(image)to define the image to be displayed
# setAlignment(vertical,horizontal) to define image alignment
# setSize(height,width) to define image size
# setURIBase(uriBase) to define the base URI for the selections
# addURI(key,uri) to add a selection key with its URI
#
# Example
# require_once('AastraIPPhoneImageMenu.class.php');
# $imagem = new AastraIPPhoneImageMenu();
# $imagem->setDestroyOnExit();
# $imagem->setSize(40,144);
# $imagem->setImage('fffffffc02fffffffee4ffffbfffc05fffe7ff7a7ffffffffeffeebd7fffffea6bcfffffe796f3feff6fa289f0a86f4866fa20df42414595dd0134f8037ed1637f0e2522b2dd003b6eb936f05fffbd4f4107bba6eb0080e93715000010b754001281271408c640252081b1b22500013c5c66201368004e04467520dc11067152b82094d418e100247205805494780105002601530020131400020a05c91088b002b08c21c0000c200000001fe800000000000000001c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020041000004008300000ff08500000000c900000000710000000000000001401400000140140000014014000001401400000140140000000000000007c0ff00000c30880000081088000008108800000c30700000062000000000003f000001e02000000330200000021000000003301e000001e0330000000021000003f033000002001e0000020000000000001e000c03fc33003c013021007c02101201f00330ff03f001e000039000003e039001e00103f003300101f8021003007c03303f003c01e000000c00001e001c03f033007802002100f002002103e000001203c401702003cc0290ff039c02902101fc02b000007c03f01a003c020039018c0ff02d03c402102703c400001203ec01e000026402b0000264029000026c029000027c01a0000338000000033800000003100000000300000000030003f00003fc03000003fc02000003fc020000030001f0000300000000030001e000030002b000030002900003fc02900003fc01a00003f00000000310030000031c01e000031f003000033f81e00003f383000001e081e000008c003000003c01e00000fc03000001f000000003d001a0000390039000039002d00003f002700000f8012000007c000000001c0000000004000000000000000000000000000');
# $imagem->addURI('1','http://myserver.com?choice=1');
# $imagem->addURI('2','http://myserver.com?Choice=2');
# $imagem->addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1','1');
# $imagem->addSoftkey('6', 'Exit', 'SoftKey:Exit');
# $imagem->addIcon('1', 'Icon:Envelope');
# $imagem->addIcon('2', 'FFFF0000FFFF0000');
# $imagem->output();
#
########################################################################################################
require_once('AastraIPPhone.class.php');
require_once('AastraIPPhoneImageMenuEntry.class.php');
class AastraIPPhoneImageMenu extends AastraIPPhone {
var $_image;
var $_verticalAlign=NULL;
var $_horizontalAlign=NULL;
var $_height=NULL;
var $_width=NULL;
var $_uriBase=NULL;
function setImage($image)
{
$this->_image = $image;
}
function setAlignment($vertical=NULL,$horizontal=NULL)
{
$this->_verticalAlign = $vertical;
$this->_horizontalAlign = $horizontal;
}
function setSize($height,$width)
{
$this->_height = $height;
$this->_width = $width;
}
function setURIBase($uriBase)
{
$this->_uriBase = $uriBase;
}
function addURI($key, $uri)
{
$this->_entries[] = new AastraIPPhoneImageMenuEntry($key, $uri);
}
function render()
{
$title = $this->escape($this->_title);
$out = "<AastraIPPhoneImageMenu";
if ($this->_destroyOnExit=='yes') $out .= " destroyOnExit=\"yes\"";
if($this->_cancelAction != "")
{
$cancelAction = $this->escape($this->_cancelAction);
$out .= " cancelAction=\"{$cancelAction}\"";
}
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
if($this->_lockin=='yes') $out .= " LockIn=\"yes\"";
if($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
if($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
$out .= ">\n";
$out .= "<Image";
if($this->_verticalAlign!=NULL) $out .= " verticalAlign=\"{$this->_verticalAlign}\"";
if($this->_horizontalAlign!=NULL) $out .= " horizontalAlign=\"{$this->_horizontalAlign}\"";
if($this->_height!=NULL) $out .= " height=\"{$this->_height}\"";
if($this->_width!=NULL) $out .= " width=\"{$this->_width}\"";
$out .= ">{$this->_image}</Image>\n";
$out .= "<URIList";
$uriBase = $this->escape($this->_uriBase);
if($uriBase!=NULL) $out .= " base=\"{$uriBase}\"";
$out .= ">\n";
foreach ($this->_entries as $entry) $out .= $entry->render();
$out .= "</URIList>\n";
foreach ($this->_softkeys as $softkey) $out .= $softkey->render();
$IconList=0;
foreach ($this->_icons as $icon)
{
if($IconList==0)
{
$out .= "<IconList>\n";
$IconList=1;
}
$out .= $icon->render();
}
if($IconList!=0) $out .= "</IconList>\n";
$out .= "</AastraIPPhoneImageMenu>\n";
return($out);
}
}
?>

View File

@ -0,0 +1,28 @@
<?php
################################################################################
# Aastra XML API Classes - AastraIPPhoneImageMenuEntry
# Copyright Aastra Telecom 2007
#
# Internal class for AastraIPPhoneImageMenu object.
################################################################################
class AastraIPPhoneImageMenuEntry extends AastraIPPhone {
var $_key;
var $_uri;
function AastraIPPhoneImageMenuEntry($key, $uri)
{
$this->_key=$key;
$this->_uri=$uri;
}
function render()
{
$key = $this->_key;
$uri = $this->escape($this->_uri);
$xml = "<URI key=\"{$key}\">{$uri}</URI>\n";
return($xml);
}
}
?>

View File

@ -0,0 +1,101 @@
<?
########################################################################################################
# Aastra XML API Classes - AastraIPPhoneImageScreen
# Copyright Aastra Telecom 2007
#
# AastraIPPhoneImageScreen object.
#
# Public methods
#
# Inherited from AastraIPPhone
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
# setBeep() to enable a notification beep with the object (optional)
# setLockIn() to set the Lock-in tag to 'yes' (optional)
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
# addSoftkey(index,label,uri,icon_index) to add custom softkeys to the object (optional)
# addIcon(index,icon) to add custom icons to the object (optional)
# setRefresh(timeout,URL) to add Refresh parameters to the object (optional)
# generate() to return the object content
# output() to display the object
#
# Specific to the object
# setImage(image)to define the image to be displayed
# setAlignment(vertical,horizontal) to define image alignment
# setSize(height,width) to define image size
#
# Example
# require_once('AastraIPPhoneImageScreen.class.php');
# $images = new AastraIPPhoneImageScreen();
# $images->setDestroyOnExit();
# $images->setSize(40,40);
# $images->setImage('fffffffc02fffffffee4ffffbfffc05fffe7ff7a7ffffffffeffeebd7fffffea6bcfffffe796f3feff6fa289f0a86f4866fa20df42414595dd0134f8037ed1637f0e2522b2dd003b6eb936f05fffbd4f4107bba6eb0080e93715000010b754001281271408c640252081b1b22500013c5c66201368004e04467520dc11067152b82094d418e100247205805494780105002601530020931400020ac5c91088b0f2b08c21c07d0c2006009fdfe81f80efe0107fe0fb1c3ffff8ffc3fffef8f7febffbfcf87ffbff64');
# $images->addSoftkey('1', 'Mail', 'http://myserver.com/script.php?action=1','1');
# $images->addSoftkey('6', 'Exit', 'SoftKey:Exit');
# $images->addIcon('1', 'Icon:Envelope');
# $images->output();
#
########################################################################################################
require_once('AastraIPPhone.class.php');
class AastraIPPhoneImageScreen extends AastraIPPhone {
var $_image;
var $_verticalAlign=NULL;
var $_horizontalAlign=NULL;
var $_height=NULL;
var $_width=NULL;
function setImage($image)
{
$this->_image = $image;
}
function setAlignment($vertical=NULL,$horizontal=NULL)
{
$this->_verticalAlign = $vertical;
$this->_horizontalAlign = $horizontal;
}
function setSize($height,$width)
{
$this->_height = $height;
$this->_width = $width;
}
function render()
{
$out = "<AastraIPPhoneImageScreen";
if($this->_destroyOnExit == 'yes') $out .= " destroyOnExit=\"yes\"";
if($this->_cancelAction != "")
{
$cancelAction = $this->escape($this->_cancelAction);
$out .= " cancelAction=\"{$cancelAction}\"";
}
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
if($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
if($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
$out .= ">\n";
$out .= "<Image";
if($this->_verticalAlign!=NULL) $out .= " verticalAlign=\"{$this->_verticalAlign}\"";
if($this->_horizontalAlign!=NULL) $out .= " horizontalAlign=\"{$this->_horizontalAlign}\"";
if($this->_height!=NULL) $out .= " height=\"{$this->_height}\"";
if($this->_width!=NULL) $out .= " width=\"{$this->_width}\"";
$out .= ">{$this->_image}</Image>\n";
foreach ($this->_softkeys as $softkey) $out .= $softkey->render();
$IconList=0;
foreach ($this->_icons as $icon)
{
if($IconList==0)
{
$out .= "<IconList>\n";
$IconList=1;
}
$out .= $icon->render();
}
if($IconList!=0) $out .= "</IconList>\n";
$out .= "</AastraIPPhoneImageScreen>\n";
return $out;
}
}
?>

View File

@ -1,48 +1,30 @@
<?
###################################################################################################
# Copyright (c) 2006 Aastra Telecom US, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of Aastra Telecom US, Inc. may not be used to endorse or promote
# products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY AASTRA TELECOM US, INC. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL AASTRA TELECOM US, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###################################################################################################
########################################################################################################
# Aastra XML API Classes - AastraIPPhoneInputScreen
# Copyright Aastra Telecom 2007
#
# AastraIPPhoneInputScreen object.
#
# Public methods
#
# Inherited from AastraIPPhone
# setTitle(Title) to setup the title of an object
# setTitle(Title) to setup the title of an object (optional)
# setTitleWrap() to set the title to be wrapped on 2 lines (optional)
# setDestroyOnExit() to set DestroyonExit parameter to 'yes', 'no' by default (optional)
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
# setBeep() to enable a notification beep with the object (optional)
# addSoftkey(index,label,uri) to add custom softkeys to the object (optional)
# setLockIn() to set the Lock-in tag to 'yes' (optional)
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional)
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
# addSoftkey(index,label,uri,icon_index) to add custom softkeys to the object (optional)
# addIcon(index,icon) to add custom icons to the object (optional)
# generate() to return the object content
# output() to display the object
#
# Specific to the object
# setURL() to set the URL to called after the input
# setType(type) to set type of input ('IP', 'string'or 'number'), 'string'by default
# Specific to the object - Single Input
# setURL(url) to set the URL to called after the input
# setType(type) to set type of input ('IP', 'string'or 'number'), 'string' by default
# setDefault(default) to set default value for the input (optional)
# setParameter(param) to set the parameter name to be parsed after the input
# setPassword() to set the Password parameter to 'yes', 'no' by default (optional)
@ -50,7 +32,26 @@
# setEditable() is now replaced by setNotEditable but kept for compatibility reasons (optional)
# setPrompt(prompt) to set the prompt to be displayed for the input.
#
# Example
# Specific to the object - Multiple Inputs
# setURL(url) to set the URL to called after the input
# setType(type) to set the default type of input ('IP', 'string'or 'number'), 'string' by default
# setDefault(default) to set default default value for the input (optional)
# setParameter(param) to set the default parameter name to be parsed after the input
# setPassword() to set the default Password parameter to 'yes', 'no' by default (optional)
# setNotEditable() to set the default editable parameter to 'no', 'yes' by default (optional)
# setEditable() is now replaced by setNotEditable but kept for compatibility reasons (optional)
# setPrompt(prompt) to set the default prompt to be displayed for the input.
# setDefaultIndex(index) to define the field index the object will use to start (optional) default is 1
# setDisplayMode(display) to define the aspect of the display, normal/condensed (optional) default is normal.
# addField(type) to add an input field and setting its type (IP, string, number, dateUS, timeUS,dateInt, timeInt or empty) if the type is an empty string then the type is inherited from the main object.
# setFieldPassword(password) to set the password mode for the input field ('yes', no'), overrides the value set by setPassword for the field
# setFieldEditable(editable) to set the input field editable mode ('yes', no'), overrides the value set by setEditable or setNotEditable for the field
# setFieldParameter(parameter) to set the parameter name to be parsed after the global input, overrides the value set by setParameter for the field
# setFieldPrompt(prompt)to set the prompt to be displayed for the input field, overrides the value set by setPrompt for the field
# setFieldDefault(default) to set default value for the input field, overrides the value set by setDefault for the field
# addFieldSoftkey(index,label,uri,icon) to add custom softkeys to the input field, overrides the softkeys set by addSoftkey.
#
# Example 1 - Single Input
# require_once('AastraIPPhoneInputScreen.class.php');
# $input = new AastraIPPhoneInputScreen();
# $input->setTitle('Title');
@ -59,16 +60,33 @@
# $input->setType('string');
# $input->setURL('http://myserver.com/script.php');
# $input->setPassword();
# $input->setDefault('');
# $input->setDestroyOnExit();
# $input->setNotEditable();
# $input->addSoftkey('1','Label 1','http://myserver.com/script.php?action=1');
# $input->addSoftkey('6','Exit','SoftKey:Exit');
# $input->setDefault('Default');
# $input->output();
#
# Example 2 - Multiple Inputs
# require_once('AastraIPPhoneInputScreen.class.php');
# $input = new AastraIPPhoneInputScreen();
# $input->setTitle('Example 2');
# $input->setDisplayMode('condensed');
# $input->setURL('http://myserver.com/script.php');
# $input->setDestroyOnExit();
# $input->addSoftkey('5', 'Done', 'SoftKey:Submit');
# $input->addField('string');
# $input->setFieldPrompt('Username:');
# $input->setFieldParameter('user');
# $input->addFieldSoftkey('3', 'ABC', 'SoftKey:ChangeMode');
# $input->addField('number');
# $input->setFieldPassword('yes');
# $input->setFieldPrompt('Pass:');
# $input->setFieldParameter('passwd');
# $input->output();
#
########################################################################################################
require_once('AastraIPPhone.class.php');
require_once('AastraIPPhoneInputScreenEntry.class.php');
require_once('AastraIPPhoneSoftkeyEntry.class.php');
class AastraIPPhoneInputScreen extends AastraIPPhone {
var $_url;
@ -78,7 +96,9 @@ class AastraIPPhoneInputScreen extends AastraIPPhone {
var $_editable='';
var $_default='';
var $_password='';
var $_defaultindex='';
var $_displaymode='';
function setURL($url)
{
$this->_url=$url;
@ -118,24 +138,103 @@ class AastraIPPhoneInputScreen extends AastraIPPhone {
$this->_prompt=$prompt;
}
function setDefaultIndex($index)
{
$this->_defaultindex=$index;
}
function setDisplayMode($display)
{
$this->_displaymode=$display;
}
function addField($type='')
{
$this->_entries[] = new AastraIPPhoneInputScreenEntry($type);
end($this->_entries);
}
function setFieldType($type)
{
$this->_entries[key($this->_entries)]->_type=$type;
}
function setFieldPassword($password='yes')
{
$this->_entries[key($this->_entries)]->_password=$password;
}
function setFieldEditable($editable='yes')
{
$this->_entries[key($this->_entries)]->_editable=$editable;
}
function setFieldParameter($parameter)
{
$this->_entries[key($this->_entries)]->_parameter=$parameter;
}
function setFieldPrompt($prompt)
{
$this->_entries[key($this->_entries)]->_prompt=$this->escape($prompt);
}
function setFieldDefault($default)
{
$this->_entries[key($this->_entries)]->_default=$default;
}
function addFieldSoftkey($index, $label, $uri, $icon=NULL)
{
$this->_entries[key($this->_entries)]->_softkeys[] = new AastraIPPhoneSoftkeyEntry($index, $this->escape($label), $this->escape($uri), $icon);
}
function render()
{
$title = $this->escape($this->_title);
$prompt = $this->escape($this->_prompt);
$url = $this->escape($this->_url);
$out = '';
$out .= "<AastraIPPhoneInputScreen type=\"$this->_type\"";
if($this->_password == 'yes') $out .= " password=\"yes\"";
if($this->_destroyOnExit == 'yes') $out .= " destroyOnExit=\"yes\"";
if($this->_editable == 'no') $out .= " editable=\"no\"";
if($this->_cancelAction != "")
{
$cancelAction = $this->escape($this->_cancelAction);
$out .= " cancelAction=\"{$cancelAction}\"";
}
if($this->_editable=='no') $out .= " editable=\"no\"";
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
if($this->_defaultindex!='') $out .= " defaultIndex=\"".$this->_defaultindex."\"";
if($this->_displaymode!='') $out .= " displayMode=\"".$this->_displaymode."\"";
if($this->_lockin=='yes') $out .= " LockIn=\"yes\"";
if($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
if($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
$out .= ">\n";
$out .= "<Title>{$title}</Title>\n";
$out .= "<Prompt>{$prompt}</Prompt>\n";
if ($this->_title!='')
{
$title = $this->escape($this->_title);
$out .= "<Title";
if ($this->_title_wrap=='yes') $out .= " wrap=\"yes\"";
$out .= ">".$title."</Title>\n";
}
if($this->_prompt != '') $out .= "<Prompt>{$prompt}</Prompt>\n";
$out .= "<URL>{$url}</URL>\n";
$out .= "<Parameter>{$this->_parameter}</Parameter>\n";
if($this->_parameter != '') $out .= "<Parameter>{$this->_parameter}</Parameter>\n";
$out .= "<Default>{$this->_default}</Default>\n";
foreach ($this->_entries as $entry) $out .= $entry->render();
foreach ($this->_softkeys as $softkey) $out .= $softkey->render();
$IconList=0;
foreach ($this->_icons as $icon)
{
if($IconList==0)
{
$out .= "<IconList>\n";
$IconList=1;
}
$out .= $icon->render();
}
if($IconList!=0) $out .= "</IconList>\n";
$out .= "</AastraIPPhoneInputScreen>\n";
return $out;
}

View File

@ -0,0 +1,40 @@
<?php
################################################################################
# Aastra XML API Classes - AastraIPPhoneInputScreenEntry
# Copyright Aastra Telecom 2007
#
# Internal class for AastraIPPhoneInputScreen object.
################################################################################
class AastraIPPhoneInputScreenEntry {
var $_type='';
var $_password='';
var $_editable='';
var $_parameter='';
var $_prompt='';
var $_default='';
var $_softkeys;
function AastraIPPhoneInputScreenEntry($type)
{
$this->_type = $type;
$this->_softkeys = array();
}
function render()
{
$xml = "<InputField";
if($this->_type != '') $xml .= " type=\"".$this->_type."\"";
if($this->_password != '') $xml .= " password=\"".$this->_password."\"";
if($this->_editable != '') $xml .= " editable=\"".$this->_editable."\"";
$xml .= ">\n";
if($this->_prompt != '') $xml .= "<Prompt>".$this->_prompt."</Prompt>\n";
if($this->_parameter != '') $xml .= "<Parameter>".$this->_parameter."</Parameter>\n";
if($this->_default != '') $xml .= "<Default>".$this->_default."</Default>\n";
foreach ($this->_softkeys as $softkey) $xml .= $softkey->render();
$xml .= "</InputField>\n";
return($xml);
}
}
?>

View File

@ -1,56 +1,34 @@
<?php
###################################################################################################
# Copyright (c) 2006 Aastra Telecom US, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of Aastra Telecom US, Inc. may not be used to endorse or promote
# products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY AASTRA TELECOM US, INC. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL AASTRA TELECOM US, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###################################################################################################
# Aastra XML API Classes - AastraIPSoftkeyEntry
# Aastra 480i Firmware 1.4.1 or better
################################################################################
# Aastra XML API Classes - AastraIPPhoneSoftkeyEntry
# Copyright Aastra Telecom 2007
#
# Internal class for AastraIPPhone object.
################################################################################
class AastraIPPhoneSoftkeyEntry extends AastraIPPhone {
class AastraIPPhoneSoftkeyEntry {
var $_index;
var $_label;
var $_uri;
var $_icon;
function AastraIPPhoneSoftkeyEntry($index, $label, $uri)
function AastraIPPhoneSoftkeyEntry($index, $label, $uri, $icon)
{
$this->_index=$index;
$this->_label=$label;
$this->_uri=$uri;
$this->_index = $index;
$this->_label = $label;
$this->_uri = $uri;
$this->_icon = $icon;
}
function render()
{
$index = $this->_index;
$uri = $this->escape($this->_uri);
$label = $this->escape($this->_label);
$xml = "<SoftKey index=\"$index\">\n<Label>{$label}</Label>\n<URI>{$uri}</URI>\n</SoftKey>\n";
$xml = "<SoftKey index=\"".$this->_index."\"";
if($this->_icon!=NULL) $xml.= " icon=\"".$this->_icon."\"";
$xml .= ">\n";
$xml .= "<Label>".$this->_label."</Label>\n";
$xml .= "<URI>".$this->_uri."</URI>\n";
$xml .= "</SoftKey>\n";
return($xml);
}
}

View File

@ -1,33 +1,8 @@
<?php
###################################################################################################
# Copyright (c) 2006 Aastra Telecom US, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of Aastra Telecom US, Inc. may not be used to endorse or promote
# products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY AASTRA TELECOM US, INC. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL AASTRA TELECOM US, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###################################################################################################
########################################################################################################
# Aastra XML API Classes - AastraIPPhoneStatus
# Copyright Aastra Telecom 2007
#
# AastraIPPhoneStatus object.
#
@ -35,11 +10,15 @@
#
# Inherited from AastraIPPhone
# output() to display the object
# generate() to return the object content
# setBeep() to enable a notification beep with the object (optional)
#
# Specific to the object
# setSession(session) to setup the session ID
# addEntry(index,message,type,timeout) to add a message to be displayed on the idle screen.
# setTriggerDestroyOnExit() to set the triggerDestroyOnExit tag to
# "yes" (optional)
# addEntry(index,message,type,timeout) to add a message to be displayed
# on the idle screen.
#
# Example
# require_once('AastraIPPhoneStatus.class.php');
@ -57,12 +36,18 @@ require_once('AastraIPPhoneStatusEntry.class.php');
class AastraIPPhoneStatus extends AastraIPPhone {
var $_session;
var $_triggerDestroyOnExit="";
function setSession($session)
{
$this->_session=$session;
}
function setTriggerDestroyOnExit()
{
$this->_triggerDestroyOnExit="yes";
}
function addEntry($index, $message, $type='', $timeout=NULL)
{
$this->_entries[] = new AastraIPPhoneStatusEntry($index, $message, $type, $timeout);
@ -73,6 +58,7 @@ class AastraIPPhoneStatus extends AastraIPPhone {
$session = $this->escape($this->_session);
$out = "<AastraIPPhoneStatus";
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
if($this->_triggerDestroyOnExit=='yes') $out .= " triggerDestroyOnExit=\"yes\"";
$out .= ">\n";
$out .= "<Session>".$session."</Session>\n";
foreach ($this->_entries as $entry) $out .= $entry->render();

View File

@ -1,57 +1,53 @@
<?php
##################################################################################################
# Copyright (c) 2006 Aastra Telecom US, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of Aastra Telecom US, Inc. may not be used to endorse or promote
# products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY AASTRA TELECOM US, INC. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL AASTRA TELECOM US, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
##################################################################################################
################################################################################
# Aastra XML API Classes - AastraIPPhoneStatusEntry
# Aastra 480i Firmware 1.4.1 or better
# Copyright Aastra Telecom 2007
#
# Internal class for AastraIPPhoneStatus object.
##################################################################################################
################################################################################
class AastraIPPhoneStatusEntry extends AastraIPPhone {
var $_index;
var $_message;
var $_type='';
var $_timeout=NULL;
var $_timeout=0;
function AastraIPPhoneStatusEntry($index, $message, $type, $timeout)
function AastraIPPhoneStatusEntry($index, $message, $type='', $timeout=NULL)
{
$this->_index=$index;
$this->_message=$message;
$this->_type=$type;
$this->_timeout=$timeout;
$this->setIndex($index);
$this->setMessage($message);
$this->setType($type);
$this->setTimeout($timeout);
}
function setIndex($index)
{
$this->_index = $index;
}
function setMessage($message)
{
$this->_message = $message;
}
function setType($type)
{
$this->_type = $type;
}
function setTimeout($timeout)
{
$this->_timeout = $timeout;
}
function render()
{
$index = $this->escape($this->_index);
$message = $this->escape($this->_message);
$type = $this->_type;
$type = $this->escape($this->_type);
$timeout = $this->_timeout;
$xml = "<Message index=\"{$index}\"";
if ($type!='')

View File

@ -1,68 +1,67 @@
<?php
###################################################################################################
# Copyright (c) 2007 Aastra Telecom US, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of Aastra Telecom US, Inc. may not be used to endorse or promote
# products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY AASTRA TELECOM US, INC. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL AASTRA TELECOM US, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###################################################################################################
########################################################################################################
# Aastra XML API Classes - AastraIPPhoneTextMenu
# Copyright Aastra Telecom 2007
#
# AastraIPPhoneTextMenu object.
#
# Public methods
#
# Inherited from AastraIPPhone
# setTitle(Title) to setup the title of an object
# setTitle(Title) to setup the title of an object (optional)
# setTitleWrap() to set the title to be wrapped on 2 lines (optional)
# setDestroyOnExit() to set DestroyOnExit parameter to "yes" (optional)
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
# setBeep() to enable a notification beep with the object (optional)
# addSoftkey(index,label,uri) to add custom softkeys to the object (optional)
# setLockIn() to set the Lock-in tag to 'yes' (optional)
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional)
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
# addSoftkey(index,label,uri,icon_index) to add custom softkeys to the object (optional)
# addIcon(index,icon) to add custom icons to the object (optional)
# setRefresh(timeout,URL) to add Refresh parameters to the object (optional)
# generate() to return the object content
# output() to display the object
#
# Specific to the object
# setDestroyOnExit() to set DestroyOnExit parameter to "yes", optional
# setDefaultIndex(index) to set the default selection in the list (optional)
# setStyle(style) to set the style of the list numbered/none/radio (optional)
# addEntry(name,url,selection) to add an element in the list to be displayed, at
# addEntry(name,url,selection,icon,dial) to add an element in the list to be displayed, at
# least one is needed.
# natsortbyname() to order the list
#
# Example
# require_once('AastraIPPhoneTextMenu.class.php');
# $menu = new AastraIPPhoneTextMenu();
# $menu->setTitle('Title');
# $menu->setDestroyOnExit();
# $menu->setDefaultIndex();
# $menu->addEntry('Choice 2', 'http://myserver.com/script.php?choice=2','');
# $menu->addEntry('Choice 1', 'http://myserver.com/script.php?choice=1','');
# $menu->addEntry('Choice 3', 'http://myserver.com/script.php?choice=3','');
# $menu->natsortByName();
# $menu->addSoftkey('1','Label 1','http://myserver.com/script.php?action=1');
# $menu->addSoftkey('6','Exit','SoftKey:Exit');
# $menu->output();
# Example 1
# require_once('AastraIPPhoneTextMenu.class.php');
# $menu = new AastraIPPhoneTextMenu();
# $menu->setTitle('Title');
# $menu->setDestroyOnExit();
# $menu->setDeFaultIndex('3');
# $menu->addEntry('Choice 2', 'http://myserver.com/script.php?choice=2', 'Value=2');
# $menu->addEntry('Choice 1', 'http://myserver.com/script.php?choice=1', 'Value=1');
# $menu->addEntry('Choice 3', 'http://myserver.com/script.php?choice=3', 'Value=3');
# $menu->natsortByName();
# $menu->addSoftkey('1', 'My Select', 'http://myserver.com/script.php?action=1');
# $menu->addSoftkey('6', 'Exit', 'SoftKey:Exit');
# $menu->output();
#
####################################################################################################
# Example 2
# require_once('AastraIPPhoneTextMenu.class.php');
# $menu = new AastraIPPhoneTextMenu();
# $menu->setTitle('Title');
# $menu->setDestroyOnExit();
# $menu->setDeFaultIndex('2');
# $menu->addEntry('Choice 2', 'http://myserver.com/script.php?choice=2', 'Value=2','1');
# $menu->addEntry('Choice 1', 'http://myserver.com/script.php?choice=1', 'Value=1','2');
# $menu->addEntry('Choice 3', 'http://myserver.com/script.php?choice=3', 'Value=3','3');
# $menu->natsortByName();
# $menu->addSoftkey('1', 'My Select', 'http://myserver.com/script.php?action=1');
# $menu->addSoftkey('6', 'Exit', 'SoftKey:Exit');
# $menu->addIcon('1', 'Icon:PhoneOnHook');
# $menu->addIcon('2', 'Icon:PhoneOffHook');
# $menu->addIcon('3', 'Icon:PhoneRinging');
# $menu->output();
#
########################################################################################################
require_once('AastraIPPhone.class.php');
require_once('AastraIPPhoneTextMenuEntry.class.php');
@ -70,7 +69,7 @@ require_once('AastraIPPhoneTextMenuEntry.class.php');
class AastraIPPhoneTextMenu extends AastraIPPhone {
var $_defaultIndex="";
var $_style="";
function setDefaultIndex($defaultIndex)
{
$this->_defaultIndex = $defaultIndex;
@ -81,9 +80,9 @@ class AastraIPPhoneTextMenu extends AastraIPPhone {
$this->_style = $style;
}
function addEntry($name, $url, $selection=NULL)
function addEntry($name, $url, $selection=NULL, $icon=NULL, $dial=NULL)
{
$this->_entries[] = new AastraIPPhoneTextMenuEntry($name, $url, $selection);
$this->_entries[] = new AastraIPPhoneTextMenuEntry($name, $url, $selection, $icon, $dial);
}
function natsortByName()
@ -101,20 +100,44 @@ class AastraIPPhoneTextMenu extends AastraIPPhone {
function render()
{
$title = $this->escape($this->_title);
$out = "<AastraIPPhoneTextMenu ";
if ($this->_destroyOnExit=='yes') $out .= "destroyOnExit=\"yes\" ";
if($this->_cancelAction != "")
{
$cancelAction = $this->escape($this->_cancelAction);
$out .= " cancelAction=\"{$cancelAction}\"";
}
if ($this->_defaultIndex!="") $out .= "defaultIndex=\"{$this->_defaultIndex}\"";
if ($this->_style!='') $out .= " style=\"{$this->_style}\"";
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
if ($this->_beep=='yes') $out .= " Beep=\"yes\"";
if ($this->_lockin=='yes') $out .= " LockIn=\"yes\"";
if($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
if ($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
$out .= ">\n";
$out .= "<Title>".$title."</Title>\n";
if ($this->_title!='')
{
$title = $this->escape($this->_title);
$out .= "<Title";
if ($this->_title_wrap=='yes') $out .= " wrap=\"yes\"";
$out .= ">".$title."</Title>\n";
}
$index=0;
foreach ($this->_entries as $entry) {
if($index<15) $out .= $entry->render();
$index++;
}
foreach ($this->_softkeys as $softkey) $out .= $softkey->render();
$IconList=0;
foreach ($this->_icons as $icon)
{
if($IconList==0)
{
$out .= "<IconList>\n";
$IconList=1;
}
$out .= $icon->render();
}
if($IconList!=0) $out .= "</IconList>\n";
$out .= "</AastraIPPhoneTextMenu>\n";
return($out);
}

View File

@ -1,48 +1,26 @@
<?php
###################################################################################################
# Copyright (c) 2006 Aastra Telecom US, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of Aastra Telecom US, Inc. may not be used to endorse or promote
# products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY AASTRA TELECOM US, INC. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL AASTRA TELECOM US, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###################################################################################################
# Aastra XML API Classes - AastraIPTextMenuEntry
# Aastra 480i Firmware 1.4.1 or better
################################################################################
# Aastra XML API Classes - AastraIPPhoneTextMenuEntry
# Copyright Aastra Telecom 2007
#
# Internal class for AastraIPPhoneTextMenu object.
###################################################################################################
################################################################################
class AastraIPPhoneTextMenuEntry extends AastraIPPhone {
var $_name;
var $_url;
var $_selection;
var $_icon;
var $_dial;
function AastraIPPhoneTextMenuEntry($name, $url, $selection)
function AastraIPPhoneTextMenuEntry($name, $url, $selection, $icon, $dial)
{
$this->_name=$name;
$this->_url=$url;
$this->_selection=$selection;
$this->_icon=$icon;
$this->_dial=$dial;
}
function getName()
@ -55,8 +33,12 @@ class AastraIPPhoneTextMenuEntry extends AastraIPPhone {
$name = $this->escape($this->_name);
$url = $this->escape($this->_url);
$selection = $this->escape($this->_selection);
$xml = "<MenuItem>\n<Prompt>{$name}</Prompt>\n<URI>{$url}</URI>\n";
$icon=$this->_icon;
$xml = "<MenuItem";
if($icon!=NULL) $xml .= " icon=\"{$icon}\"";
$xml .= ">\n<Prompt>{$name}</Prompt>\n<URI>{$url}</URI>\n";
if($selection!=NULL) $xml .= "<Selection>{$selection}</Selection>\n";
if($this->_dial!=NULL) $xml .= "<Dial>{$this->_dial}</Dial>\n";
$xml .= "</MenuItem>\n";
return($xml);
}

View File

@ -1,48 +1,31 @@
<?
###################################################################################################
# Copyright (c) 2006 Aastra Telecom US, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of Aastra Telecom US, Inc. may not be used to endorse or promote
# products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY AASTRA TELECOM US, INC. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL AASTRA TELECOM US, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###################################################################################################
########################################################################################################
# Aastra XML API Classes - AastraIPPhoneTextScreen
# Copyright Aastra Telecom 2007
#
# AastraIPPhoneTextScreen object.
#
# Public methods
#
# Inherited from AastraIPPhone
# setTitle(Title) to setup the title of an object
# setTitle(Title) to setup the title of an object (optional)
# setTitleWrap() to set the title to be wrapped on 2 lines (optional)
# setDestroyOnExit() to set DestroyonExit parameter to 'yes', 'no' by default (optional)
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
# setBeep() to enable a notification beep with the object (optional)
# addSoftkey(index, label, uri) to add custom softkeys to the object (optional)
# setLockIn() to set the Lock-in tag to 'yes' (optional)
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional)
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
# addSoftkey(index,label,uri,iconindex) to add custom softkeys to the object (optional)
# addIcon(index,icon) to add custom icons to the object (optional)
# setRefresh(timeout,URL) to add Refresh parameters to the object (optional)
# generate() to return the object content
# output() to display the object
#
# Specific to the object
# setText(text) to set the text to be displayed.
# setDoneAction(uri) to set the URI to be called when the user selects the default "Done" key (optional)
#
# Example
# require_once('AastraIPPhoneTextScreen.class.php');
@ -50,22 +33,29 @@
# $text->setTitle('Title');
# $text->setText('Text to be displayed.');
# $text->setDestroyOnExit();
# $text->addSoftkey('1','Label 1','http://myserver.com/script.php?action=1');
# $text->addSoftkey('6','Exit','SoftKey:Exit');
# $text->addSoftkey('1', 'Mail', 'http://myserver.com/script.php?action=1','1');
# $text->addSoftkey('6', 'Exit', 'SoftKey:Exit');
# $text->addIcon('1', 'Icon:Envelope');
# $text->output();
#
###################################################################################################
########################################################################################################
require_once('AastraIPPhone.class.php');
class AastraIPPhoneTextScreen extends AastraIPPhone {
var $_text;
var $_doneAction="";
function setText($text)
{
$this->_text = $text;
}
function setDoneAction($uri)
{
$this->_doneAction = $uri;
}
function render()
{
$title = $this->escape($this->_title);
@ -73,11 +63,39 @@ class AastraIPPhoneTextScreen extends AastraIPPhone {
$out = '';
$out .= "<AastraIPPhoneTextScreen";
if($this->_destroyOnExit == 'yes') $out .= " destroyOnExit=\"yes\"";
if($this->_cancelAction != "")
{
$cancelAction = $this->escape($this->_cancelAction);
$out .= " cancelAction=\"{$cancelAction}\"";
}
if($this->_doneAction != "")
{
$doneAction = $this->escape($this->_doneAction);
$out .= " doneAction=\"{$doneAction}\"";
}
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
if($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
$out .= ">\n";
$out .= "<Title>{$title}</Title>\n";
if ($this->_title!='')
{
$title = $this->escape($this->_title);
$out .= "<Title";
if ($this->_title_wrap=='yes') $out .= " wrap=\"yes\"";
$out .= ">".$title."</Title>\n";
}
$out .= "<Text>{$text}</Text>\n";
foreach ($this->_softkeys as $softkey) $out .= $softkey->render();
$IconList=0;
foreach ($this->_icons as $icon)
{
if($IconList==0)
{
$out .= "<IconList>\n";
$IconList=1;
}
$out .= $icon->render();
}
if($IconList!=0) $out .= "</IconList>\n";
$out .= "</AastraIPPhoneTextScreen>\n";
return $out;
}

View File

@ -1,4 +1,4 @@
Copyright (c) 2006 Aastra Telecom US, Inc.
Copyright (c) 2007 Aastra Telecom US, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without

View File

@ -1,51 +1,75 @@
<?php
###################################################################################################
# Copyright (c) 2007 Aastra Telecom US, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of Aastra Telecom US, Inc. may not be used to endorse or promote
# products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY AASTRA TELECOM US, INC. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL AASTRA TELECOM US, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###################################################################################################
##########################################################
# Sample php applications using the Aastra XML API Classes
# Aastra SIP Phones Firmware 1.4.2 or better
# Aastra SIP Phones Firmware 2.1.0 or better
# Copyright Aastra Telecom 2007
#
# @param type, type of XML object to display
# type=textmenu AastraIPPhoneTextMenu
# type=textmenu1 AastraIPPhoneTextMenu
# type=textmenu2 AastraIPPhoneTextMenu
# type=textmenu3 AastraIPPhoneTextMenu
# type=textscreen AastraIPPhoneTextScreen
# type=directory AastraIPPhoneDirectory
# type=input AastraIPPhoneInputScreen
# type=inputscreen1 AastraIPPhoneInputScreen
# type=inputscreen2 AastraIPPhoneInputScreen
# type=inputscreen3 AastraIPPhoneInputScreen
# type=inputscreen4 AastraIPPhoneInputScreen
# type=status AastraIPPhoneStatus
# type=execute AastraIPPhoneExecute
# type=configuration AastraIPPhoneConfiguration
# type=imagescreen AastraIPPhoneImageScreen
# type=imagemenu AastraIPPhoneImageMenu
# type=formattedtextscreen AastraIPPhoneFormattedTextScreen
#
# If type is not set, the list of all the XML objects is displayed
#
##########################################################
##########################################################
# Aastra_decode_HTTP_header
#
# Returns an array
# 'model' Phone Type
# 'mac' Phone MAC Address
# 'firmware' Phone firmware version
# 'ip' Phone Remote IP address
# 'language' Phone Language
# 'module'[x] Expension Modules
#
function Aastra_decode_HTTP_header()
{
# User Agent
$user_agent=$_SERVER["HTTP_USER_AGENT"];
if(stristr($user_agent,"Aastra"))
{
$value=preg_split("/ MAC:/",$user_agent);
$fin=preg_split("/ /",$value[1]);
$value[1]=preg_replace("/\-/","",$fin[0]);
$value[2]=preg_replace("/V:/","",$fin[1]);
}
else
{
$value[0]="MSIE";
$value[1]="NA";
$value[2]="NA";
}
# Create array
$array=array('model'=>$value[0],'mac'=>$value[1],'firmware'=>$value[2]);
return($array);
}
##########################################################
# Retrieve type parameter
$type=$_GET['type'];
# Global parameters
$XML_SERVER = "http://$SERVER_ADDR".$_SERVER['SCRIPT_NAME'];
$XML_SERVER = "http://".$_SERVER['SERVER_ADDR'].$_SERVER['SCRIPT_NAME'];
# Get UA information
$header=Aastra_decode_HTTP_header();
# Display the object
switch($type)
@ -55,13 +79,25 @@ switch($type)
$menu = new AastraIPPhoneTextMenu();
$menu->setTitle('Sample Applications');
$menu->setDestroyOnExit();
$menu->addEntry('Configuration', $XML_SERVER.'?type=configuration');
$menu->addEntry('TextMenu1', $XML_SERVER.'?type=textmenu1');
$menu->addEntry('TextMenu2', $XML_SERVER.'?type=textmenu2');
$menu->addEntry('TextScreen', $XML_SERVER.'?type=textscreen');
$menu->addEntry('Directory', $XML_SERVER.'?type=directory');
$menu->addEntry('InputScreen', $XML_SERVER.'?type=inputscreen');
$menu->addEntry('InputScreen1', $XML_SERVER.'?type=inputscreen1');
$menu->addEntry('InputScreen2', $XML_SERVER.'?type=inputscreen2');
$menu->addEntry('Status', $XML_SERVER.'?type=status');
$menu->addEntry('Execute', $XML_SERVER.'?type=execute');
if($header['model']!="Aastra53i")
{
$menu->addEntry('ImageScreen', $XML_SERVER.'?type=imagescreen');
$menu->addEntry('ImageMenu', $XML_SERVER.'?type=imagemenu');
$menu->addEntry('InputScreen3', $XML_SERVER.'?type=inputscreen3');
$menu->addEntry('InputScreen4', $XML_SERVER.'?type=inputscreen4');
$menu->addEntry('InputScreen5', $XML_SERVER.'?type=inputscreen5');
$menu->addEntry('Directory', $XML_SERVER.'?type=directory');
}
$menu->addEntry('FTextScreen1', $XML_SERVER.'?type=formattedtextscreen1');
$menu->addEntry('FTextScreen2', $XML_SERVER.'?type=formattedtextscreen2');
$menu->natsortByName();
$menu->output();
break;
@ -69,14 +105,22 @@ switch($type)
case 'textmenu1':
require_once('AastraIPPhoneTextMenu.class.php');
$menu = new AastraIPPhoneTextMenu();
$menu->setTitle('Title');
$menu->setTitle('Title this is a pretty long title');
$menu->setTitleWrap();
$menu->setDestroyOnExit();
$menu->setDeFaultIndex('3');
$menu->addEntry('Choice 2', 'http://myserver.com/script.php?choice=2', 'Value=2');
$menu->setStyle('radio');
$menu->addEntry('Choice 2', 'http://myserver.com/script.php?choice=2', 'Value=2','','12345');
$menu->addEntry('Choice 1', 'http://myserver.com/script.php?choice=1', 'Value=1');
$menu->addEntry('Choice 3', 'http://myserver.com/script.php?choice=3', 'Value=3');
$menu->addEntry('Choice 4', 'http://myserver.com/script.php?choice=4', 'Value=4');
$menu->addEntry('Choice 5', 'http://myserver.com/script.php?choice=5', 'Value=5');
$menu->addEntry('Choice 6', 'http://myserver.com/script.php?choice=6', 'Value=6');
$menu->addEntry('Choice 7', 'http://myserver.com/script.php?choice=7', 'Value=7');
$menu->natsortByName();
$menu->addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1');
$menu->addSoftkey('1', 'My Select', 'http://myserver.com/script.php?action=1');
$menu->addSoftkey('2', 'My Dial', 'SoftKey:Dial2');
$menu->addSoftkey('4', 'Back', $XML_SERVER);
$menu->addSoftkey('6', 'Exit', 'SoftKey:Exit');
$menu->output();
break;
@ -86,13 +130,32 @@ switch($type)
$menu = new AastraIPPhoneTextMenu();
$menu->setTitle('Title');
$menu->setDestroyOnExit();
$menu->setDeFaultIndex('3');
$menu->setStyle('none');
$menu->addEntry('Choice 2', 'http://myserver.com/script.php?choice=2', 'Value=2');
$menu->addEntry('Choice 1', 'http://myserver.com/script.php?choice=1', 'Value=1');
$menu->setDeFaultIndex('2');
$menu->addEntry('Choice 2', 'http://myserver.com/script.php?choice=2', 'Value=2','1');
$menu->addEntry('Choice 1', 'http://myserver.com/script.php?choice=1', 'Value=1','2');
$menu->addEntry('Choice 3', 'http://myserver.com/script.php?choice=3', 'Value=3','3');
$menu->natsortByName();
$menu->addSoftkey('1', 'My Select', 'http://myserver.com/script.php?action=1');
$menu->addSoftkey('4', 'Back', $XML_SERVER);
$menu->addSoftkey('6', 'Exit', 'SoftKey:Exit');
$menu->addIcon('1', 'Icon:PhoneOnHook');
$menu->addIcon('2', 'Icon:PhoneOffHook');
$menu->addIcon('3', 'Icon:PhoneRinging');
$menu->output();
break;
case 'textmenu3':
require_once('AastraIPPhoneTextMenu.class.php');
$menu = new AastraIPPhoneTextMenu();
$menu->setTitle('Title');
$menu->setDestroyOnExit();
$menu->addEntry('Choice 1', 'Dial:12345', 'Value=1', '', '6789');
$menu->addEntry('Choice 2', 'http://myserver.com/script.php?choice=2', 'Value=2','','12345');
$menu->addEntry('Choice 3', 'http://myserver.com/script.php?choice=3', 'Value=3');
$menu->natsortByName();
$menu->addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1');
$menu->addSoftkey('1', 'Select', 'SoftKey:Select');
$menu->addSoftkey('2', 'Dial', 'SoftKey:Dial');
$menu->addSoftkey('3', 'Dial2', 'SoftKey:Dial2');
$menu->addSoftkey('4', 'Back', $XML_SERVER);
$menu->addSoftkey('6', 'Exit', 'SoftKey:Exit');
$menu->output();
break;
@ -101,26 +164,96 @@ switch($type)
require_once('AastraIPPhoneTextScreen.class.php');
$text = new AastraIPPhoneTextScreen();
$text->setTitle('Title');
$text->setText('Text to be displayed.');
$text->setDestroyOnExit();
$text->addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1');
$text->setText('The screen object can be implemented similar to the firmware info screen.');
$text->setDestroyOnExit();
$text->addSoftkey('1', 'Mail', 'http://myserver.com/script.php?action=1','1');
$text->addSoftkey('4', 'Back', $XML_SERVER);
$text->addSoftkey('6', 'Exit', 'SoftKey:Exit');
$text->addIcon('1', 'Icon:Envelope');
$text->output();
break;
case 'inputscreen':
case 'inputscreen1':
require_once('AastraIPPhoneInputScreen.class.php');
$input = new AastraIPPhoneInputScreen();
$input->setTitle('Title');
$input->setPrompt('Enter your password');
$input->setPrompt('Enter date');
$input->setParameter('param');
$input->setType('string');
$input->setURL('http://myserver.com/script.php');
$input->setURL('http://myserver.com/script.php?test=1');
$input->setPassword();
$input->setDestroyOnExit();
$input->setDefault('Default');
$input->addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1');
$input->setDefault('');
$input->setCancelAction($XML_SERVER);
$input->output();
break;
case 'inputscreen2':
require_once('AastraIPPhoneInputScreen.class.php');
$input = new AastraIPPhoneInputScreen();
$input->setTitle('Title');
$input->setPrompt('Enter the date');
$input->setParameter('param');
$input->setType('dateUS');
$input->setURL('http://myserver.com/script.php');
$input->setDestroyOnExit();
$input->setCancelAction($XML_SERVER);
$input->output();
break;
case 'inputscreen3':
require_once('AastraIPPhoneInputScreen.class.php');
$input = new AastraIPPhoneInputScreen();
$input->setTitle('Title');
$input->setPrompt('Enter email address');
$input->setParameter('email');
$input->setType('string');
$input->setURL('http://myserver.com/script.php');
$input->addSoftkey('1', 'Backspace', 'SoftKey:BackSpace');
$input->addSoftkey('2', 'Symbols', 'SoftKey:SymbolList="@."');
$input->addSoftkey('5', 'Done', 'SoftKey:Submit');
$input->addSoftkey('6', 'Exit', 'SoftKey:Exit');
$input->setDestroyOnExit();
$input->output();
break;
case 'inputscreen4':
require_once('AastraIPPhoneInputScreen.class.php');
$input = new AastraIPPhoneInputScreen();
$input->setTitle('Restricted application');
$input->setDisplayMode('condensed');
$input->setURL($XML_SERVER);
$input->setDestroyOnExit();
$input->addSoftkey('5', 'Done', 'SoftKey:Submit');
$input->addSoftkey('6', 'Exit', 'SoftKey:Exit');
$input->addField();
$input->setFieldType('empty');
$input->addField('string');
$input->setFieldType('string');
$input->setFieldPrompt('Username:');
$input->setFieldParameter('user');
$input->addFieldSoftkey('3', 'ABC', 'SoftKey:ChangeMode');
$input->addField('number');
$input->setFieldPassword('yes');
$input->setFieldPrompt('Password:');
$input->setFieldParameter('password');
$input->output();
break;
case 'inputscreen5':
require_once('AastraIPPhoneInputScreen.class.php');
$input = new AastraIPPhoneInputScreen();
$input->setTitle('Date and Time');
$input->setURL('http://myserver.com/script.php');
$input->setDestroyOnExit();
$input->addSoftkey('5', 'Done', 'SoftKey:Submit');
$input->addSoftkey('6', 'Exit', 'SoftKey:Exit');
$input->addField('dateUS');
$input->setFieldPrompt('Enter Date');
$input->setFieldParameter('date');
$input->addField('timeUS');
$input->setFieldPrompt('Enter Time');
$input->setFieldParameter('time');
$input->output();
break;
@ -135,6 +268,7 @@ switch($type)
$directory->addEntry('Jane Doe', '201');
$directory->natsortByName();
$directory->addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1');
$directory->addSoftkey('4', 'Back', $XML_SERVER);
$directory->addSoftkey('6', 'Exit', 'SoftKey:Exit');
$directory->output();
break;
@ -152,9 +286,91 @@ switch($type)
case 'execute':
require_once('AastraIPPhoneExecute.class.php');
$execute = new AastraIPPhoneExecute();
$execute->setTriggerDestroyOnExit();
$execute->addEntry('http://myserver.com/script.php?choice=2');
$execute->addEntry('Command: Reset');
$execute->addEntry('Command: FastReboot');
$execute->addEntry('Led: softkey1=on');
$execute->addEntry('Dial:7001','no');
$execute->output();
break;
case 'configuration':
require_once('AastraIPPhoneConfiguration.class.php');
$configuration = new AastraIPPhoneConfiguration();
$configuration->addEntry('softkey1 label','Test');
$configuration->addEntry('softkey1 type','xml');
$configuration->setTriggerDestroyOnExit();
$configuration->setBeep();
$configuration->output();
break;
case 'formattedtextscreen1':
require_once('AastraIPPhoneFormattedTextScreen.class.php');
$ftext = new AastraIPPhoneFormattedTextScreen();
$ftext->setDestroyOnExit();
if($header['model']!="Aastra53i") $ftext->addLine('Formatted Screen','double','center');
$ftext->setScrollStart('2');
$ftext->addLine('Scrolled text1');
$ftext->addLine('Scrolled text2');
$ftext->addLine('Scrolled text3','double');
$ftext->addLine('Scrolled text4');
$ftext->addLine('Scrolled text5');
$ftext->setScrollEnd();
$ftext->addLine('Footer',NULL,'center');
$ftext->addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1','1');
$ftext->addSoftkey('4', 'Back', $XML_SERVER);
$ftext->addSoftkey('6', 'Exit', 'SoftKey:Exit');
$ftext->addIcon('1', 'Icon:Envelope');
$ftext->output();
break;
case 'formattedtextscreen2':
require_once('AastraIPPhoneFormattedTextScreen.class.php');
$ftext = new AastraIPPhoneFormattedTextScreen();
$ftext->setDestroyOnExit();
$ftext->addLine('Line 1');
$ftext->addLine('Line 2');
$ftext->addLine('Line 3');
$ftext->addLine('Line 4');
$ftext->addLine('Line 5');
$ftext->addLine('Line 6');
$ftext->addSoftkey('1', 'Softkey 1', 'SoftKey:Exit');
$ftext->addSoftkey('2', 'Softkey 2', 'SoftKey:Exit');
$ftext->addSoftkey('3', 'Softkey 3', 'SoftKey:Exit');
$ftext->addSoftkey('4', 'Softkey 4', 'SoftKey:Exit');
$ftext->addSoftkey('5', 'Softkey 5', 'SoftKey:Exit');
$ftext->addSoftkey('6', 'Softkey 6', 'SoftKey:Exit');
$ftext->output();
break;
case 'imagescreen':
require_once('AastraIPPhoneImageScreen.class.php');
$images = new AastraIPPhoneImageScreen();
$images->setDestroyOnExit();
$images->setSize(40,144);
$images->setImage('fffffffc02fffffffee4ffffbfffc05fffe7ff7a7ffffffffeffeebd7fffffea6bcfffffe796f3feff6fa289f0a86f4866fa20df42414595dd0134f8037ed1637f0e2522b2dd003b6eb936f05fffbd4f4107bba6eb0080e93715000010b754001281271408c640252081b1b22500013c5c66201368004e04467520dc11067152b82094d418e100247205805494780105002601530020931400020ac5c91088b0f2b08c21c07d0c2006009fdfe81f80efe0107fe0fb1c3ffff8ffc3fffef8f7febffbfcf87ffbff64');
$images->addSoftkey('1', 'Mail', 'http://myserver.com/script.php?action=1','1');
$images->addSoftkey('4', 'Back', $XML_SERVER);
$images->addSoftkey('6', 'Exit', 'SoftKey:Exit',2);
$images->addIcon('1', 'Icon:Envelope');
$images->output();
break;
case 'imagemenu':
require_once('AastraIPPhoneImageMenu.class.php');
$imagem = new AastraIPPhoneImageMenu();
$imagem->setDestroyOnExit();
$imagem->setSize(40,144);
$imagem->setImage('fffffffc02fffffffee4ffffbfffc05fffe7ff7a7ffffffffeffeebd7fffffea6bcfffffe796f3feff6fa289f0a86f4866fa20df42414595dd0134f8037ed1637f0e2522b2dd003b6eb936f05fffbd4f4107bba6eb0080e93715000010b754001281271408c640252081b1b22500013c5c66201368004e04467520dc11067152b82094d418e100247205805494780105002601530020131400020a05c91088b002b08c21c0000c200000001fe800000000000000001c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020041000004008300000ff08500000000c900000000710000000000000001401400000140140000014014000001401400000140140000000000000007c0ff00000c30880000081088000008108800000c30700000062000000000003f000001e02000000330200000021000000003301e000001e0330000000021000003f033000002001e0000020000000000001e000c03fc33003c013021007c02101201f00330ff03f001e000039000003e039001e00103f003300101f8021003007c03303f003c01e000000c00001e001c03f033007802002100f002002103e000001203c401702003cc0290ff039c02902101fc02b000007c03f01a003c020039018c0ff02d03c402102703c400001203ec01e000026402b0000264029000026c029000027c01a0000338000000033800000003100000000300000000030003f00003fc03000003fc02000003fc020000030001f0000300000000030001e000030002b000030002900003fc02900003fc01a00003f00000000310030000031c01e000031f003000033f81e00003f383000001e081e000008c003000003c01e00000fc03000001f000000003d001a0000390039000039002d00003f002700000f8012000007c000000001c0000000004000000000000000000000000000');
$imagem->addURI('1','http://myserver.com?choice=1');
$imagem->addURI('2','http://myserver.com?Choice=2');
$imagem->addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1','1');
$imagem->addSoftkey('4', 'Back', $XML_SERVER);
$imagem->addSoftkey('6', 'Exit', 'SoftKey:Exit');
$imagem->addIcon('1', 'Icon:Envelope');
$imagem->addIcon('2', 'FFFF0000FFFF0000');
$imagem->output();
break;
}
?>

View File

@ -0,0 +1,15 @@
# SIP Lines
sip line1 auth name: $$AA_SIPAUTHNAME_AA$$
sip line1 password: $$AA_SIPSECRET_AA$$
sip line1 user name: $$AA_SIPUSERNAME_AA$$
sip line1 display name: $$AA_SIPCALLERID_AA$$
sip line1 screen name: $$AA_SIPCALLERID_AA$$
sip line1 proxy ip: $$AA_PROXY_SERVER_AA$$
sip line1 proxy port: 5060
sip line1 registrar ip: $$AA_REGISTRAR_SERVER_AA$$
sip line1 registrar port: 5060
sip line1 vmail: *98
sip line1 mode: 0
# Action URI
action uri startup:

View File

@ -0,0 +1,15 @@
# SIP Lines
sip line1 auth name: $$AA_SIPAUTHNAME_AA$$
sip line1 password: $$AA_SIPSECRET_AA$$
sip line1 user name: $$AA_SIPUSERNAME_AA$$
sip line1 display name: $$AA_SIPCALLERID_AA$$
sip line1 screen name: $$AA_SIPCALLERID_AA$$
sip line1 proxy ip: $$AA_PROXY_SERVER_AA$$
sip line1 proxy port: 5060
sip line1 registrar ip: $$AA_REGISTRAR_SERVER_AA$$
sip line1 registrar port: 5060
sip line1 vmail: *98
sip line1 mode: 0
# Action URI
action uri startup:

View File

@ -0,0 +1,15 @@
# SIP Lines
sip line1 auth name: $$AA_SIPAUTHNAME_AA$$
sip line1 password: $$AA_SIPSECRET_AA$$
sip line1 user name: $$AA_SIPUSERNAME_AA$$
sip line1 display name: $$AA_SIPCALLERID_AA$$
sip line1 screen name: $$AA_SIPCALLERID_AA$$
sip line1 proxy ip: $$AA_PROXY_SERVER_AA$$
sip line1 proxy port: 5060
sip line1 registrar ip: $$AA_REGISTRAR_SERVER_AA$$
sip line1 registrar port: 5060
sip line1 vmail: *98
sip line1 mode: 0
# Action URI
action uri startup:

View File

@ -0,0 +1,15 @@
# SIP Lines
sip line1 auth name: $$AA_SIPAUTHNAME_AA$$
sip line1 password: $$AA_SIPSECRET_AA$$
sip line1 user name: $$AA_SIPUSERNAME_AA$$
sip line1 display name: $$AA_SIPCALLERID_AA$$
sip line1 screen name: $$AA_SIPCALLERID_AA$$
sip line1 proxy ip: $$AA_PROXY_SERVER_AA$$
sip line1 proxy port: 5060
sip line1 registrar ip: $$AA_REGISTRAR_SERVER_AA$$
sip line1 registrar port: 5060
sip line1 vmail: *98
sip line1 mode: 0
# Action URI
action uri startup:

View File

@ -0,0 +1,35 @@
#!/bin/sh
# To put on /usr/local/sbin
echo ""
echo "--------------------------------------------------------------"
echo "Creating a default config file for Aastra phones"
echo "--------------------------------------------------------------"
echo ""
echo "Creating /tftpboot/aastra.cfg..."
echo ""
IFCONFIG=`which ifconfig 2>/dev/null||echo /sbin/ifconfig`
IPADDR=`$IFCONFIG eth0|gawk '/inet addr/{print $2}'|gawk -F: '{print $2}'`
cat > /tftpboot/aastra.cfg <<EOF
# Setup DHCP mode
dhcp: 1
# Setup TFTP server address
tftp server: $IPADDR
# Time server
time server disabled: 0
time server1: pool.ntp.org
# Startup URI
action uri startup: http://$IPADDR/xml/startup/startup.php
EOF
chmod 666 /tftpboot/aastra.cfg
echo "Created /tftpboot/aastra.cfg using $IPADDR for the proxy. If the"
echo "IP address of your Asterisk system changes run this script again and reboot."
echo "Reboot your Aastra phones by disconnectiong the power to the phone."
echo ""

View File

@ -0,0 +1,450 @@
<?php
#
# WVMail - Web based Voicemail for Asterisk (http://asterisk.org)
# (C) 2002 Siggi Langauf
#
# Backend access functions
#
###########################################################################
/**
* Get MySQL config from voicemail.conf
*
* @return array('user'=>'username', 'pass'=>'password', 'host'=>'hostname', 'name'=>'database name')
*
*/
function get_mysql_config() {
global $voicemailconf;
$lines = @file($voicemailconf);
$section = NULL;
foreach ($lines as $line){
$line = rtrim($line);
if (preg_match("/^\s*\[([a-z]*)\]\s*$/i", $line, $m)){
$section = $m[1];
continue;
}
if ($section == "general"
&& preg_match("/^(db[a-z]*)\s*=\s*([\w\W]*)$/",$line, $m)) {
if ($m[1] == "dbuser" ) {
$db['user'] = $m[2];
}
if ($m[1] == "dbpass" ) {
$db['pass'] = $m[2];
}
if ($m[1] == "dbhost" ) {
$db['host'] = $m[2];
}
if ($m[1] == "dbname" ) {
$db['name'] = $m[2];
}
}
if (isset($db) && count($db) == 4) {
break;
}
}
return $db;
}
/**
* Authenticate user
*
* @param $user is the user ID
* @param $password is the password given by user
*
* @return false if the password is wrong, otherwise:
* This users config string (typically: Realname, email)
*/
function verify_user($user, $password){
global $context, $voicemailconf, $backendtype;
if($backendtype == "mysql") {
$db=get_mysql_config();
$link = mysql_connect($db["host"], $db["user"], $db["pass"]) or die("DB connection failed ".mysql_error());
mysql_select_db($db["name"]) or die("DB selection failed ".mysql_error());
$query = "SELECT context,mailbox,PASSWORD
FROM users
WHERE context='".$context."'
AND mailbox='".$user."'
AND PASSWORD='".$password."'";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
if(mysql_num_rows($result) != '1') {
return false;
} else {
mysql_free_result($result);
mysql_close($link);
return true;
}
} else {
$lines = @file($voicemailconf);
$section = NULL;
foreach ($lines as $line){
$line = rtrim($line);
if (preg_match("/^\s*\[([a-z]*)\]\s*$/i", $line, $m)){
$section = $m[1];
}
if ($section == $context
&& preg_match("/^([0-9]*)\s*=>?\s*([0-9]*)\s*,(.*)$/",$line, $m)) {
if ($m[1] == $user && $m[2] == $password){
return $m[3];
}
}
}
}
return false;
}
/**
* get list of mailboxes for given user
*/
function get_mailboxes($user){
global $boxbase, $dirMode;
$boxes = array();
$dir = "$boxbase/$user";
/* handle case where user exists but mailbox doesn't
app_voicemail creates them on 1st access, so should we */
if (!file_exists($dir)) {
umask("0000");
if(mkdir($dir, "2770")) {
if(mkdir("$dir/INBOX", "2770")) {
$boxes[] = "INBOX";
}
}
/* exit early, there won't be any other dir's */
return $boxes;
}
if ($handle = @opendir($dir)) {
while (false !== ($file = @readdir($handle))) {
if ($file{0}!= '.' && @is_dir("$boxbase/$user/$file")){
$boxes[] = $file;
}
}
}
return $boxes;
}
/**
* get message info for all messages in a given mailbox
*
* @param $user the user id
* @param $mailbox the mailbox
* @return an array of message info arrays
*/
function get_messages($user, $mailbox){
global $boxbase, $dirMode;
$messages = array();
$dir = "$boxbase/$user/$mailbox";
if ($handle = @opendir($dir)) {
/* This is the correct way to loop over the directory. */
while (false !== ($file = @readdir($handle))) {
if (preg_match("/^(msg(.*))\.txt$/",$file, $m)){
$info = array();
$info['txtfile'] = "$dir/$file";
$info['playname'] = "$dir/".$m[1];
$info['id'] = $m[2];
$info['folder'] = $mailbox;
if ($lines = @file($info['txtfile'])){
foreach ($lines as $line){
if (preg_match("/^([a-z]*)=(.*)$/", rtrim($line), $m)){
# this should give us the following info parameters:
# origmailbox, context, exten, priority, callerchan, callerid,
# origdate, origtime, duration
$info[$m[1]] = $m[2];
}
}
$messages[] = $info;
}
}
}
}
return $messages;
}
/**
* delete a given message
*
* @param $user the user id
* @param $mailbox the mailbox
* @param $message id of the message you want to delete
*
* @return true if deleted, false on errors
*/
function delete_message($user, $mailbox, $message){
global $boxbase;
$dir = "$boxbase/$user/$mailbox";
$deleted = false;
if ($handle = @opendir($dir)) {
while (false !== ($file = @readdir($handle))) {
if (preg_match("/^msg$message/",$file, $m)){
if(@unlink("$dir/$file")){
$deleted = true;
}
}
}
}
if($mailbox == "INBOX") {
update_mwi($user);
}
return $deleted;
}
/**
* play a file to given phone via the vmailbridge.agi script
*
* @param $extension is the extension to play to
* @param $file is the file to play (extension omitted, * playfile convention)
* @param $initiate if true (default), the voice connection is initiated
* (ie. the phone called) if it is not already open
* if set to false, the file is just enqueued while the call will have
* to be initiated manually.
* @return false if there is no voice connection, true otherwise
*/
function send_file($extension, $file, $initiate=true){
global $callspooldir, $vmbridgedir, $vmbridge_channel, $vmbridge_extension;
$status_file = $vmbridgedir."/$extension.current";
$request_file = $vmbridgedir."/$extension";
$talking = true; //assume connected phone
if (! @file_exists($status_file)){ //no phone connected, yet
if (!$initiate){
$talking = false;
}
else {//initiate call
list($usec, $sec) = explode(' ', microtime());
$t = (float)$sec + (float)$usec;
$callspool_file = "$callspooldir/$extension.$t.call";
$callrequest = 'Channel: ';
$callrequest.= str_replace('@extension@', $extension, $vmbridge_channel);
$callrequest.= "\nCallerid: $extension\n"
. "Context: default\n"
. "Extension: $vmbridge_extension\n"
. "Priority: 1\n";
umask("0000");
if (!$handle = @fopen($callspool_file, 'w')){
print("unable to open file $callspool_file");
exit;
}
fwrite($handle, $callrequest);
fclose($handle);
}
}
// write request to the request file read by vmbridge.agi
if (!$handle = @fopen($request_file, 'w')){
print("unable to open file $request_file");
exit(1);
}
fwrite($handle, $file);
fclose($handle);
return $talking;
}
/**
* close the vmailbridge (if any) to this extension
*
* @param $extension is the extension to close
*/
function close_bridge($extension){
global $vmbridgedir;
$status_file = $vmbridgedir."/$extension.current";
$request_file = $vmbridgedir."/$extension";
if (@file_exists($status_file)){ //bridge is open
// write request to the request file read by vmbridge.agi
if (!$handle = @fopen($request_file, 'w')){
print("unable to open $request_file");
exit(1);
}
fwrite($handle, "vm-goodbye");
fclose($handle);
}
}
/**
* update MWI
*
* @param $user
*/
function update_mwi($user) {
global $context, $updateMWI;
if(!$updateMWI) {
return true;
}
$call_context = "voicemail"; //not actually used
@system("../bin/ccm-mwi ".$call_context." ".$user."@".$context." ".count(get_messages($user, "INBOX")), $result);
return $result;
}
/**
* save to folder
*
* @param $user
* @param $message
* @param $srcFolder
* @param $dstFolder
*/
function save_to_folder($user, $message, $srcFolder, $dstFolder) {
global $MAXMSG, $boxbase, $dirMode;
$srcPath = $boxbase.'/'.$user.'/'.$srcFolder;
$dstPath = $boxbase.'/'.$user.'/'.$dstFolder;
umask("0000");
if(!@file_exists($dstPath)){
if(!@mkdir($dstPath, $dirMode)) {
return false;
}
}
for($i=0; $i <= $MAXMSG; $i++) {
$dstMessage = sprintf("msg%04d", $i);
if(!@file_exists($dstPath.'/'.$dstMessage.'.txt') ) {
break;
}
}
if($i >= $MAXMSG) {
return false; // folder is full
}
// copy files
foreach(array("wav","WAV","gsm","txt") as $extension) {
$src = $srcPath.'/msg'.$message.".".$extension;
$dst = $dstPath.'/'.$dstMessage.".".$extension;
if(@file_exists($src))if(!@copy($src, $dst)) {
return false;
}
}
return true;
}
/**
* move to folder
*
* @param $user
* @param $message
* @param $srcFolder
* @param $dstFolder
*/
function move_to_folder($user, $message, $srcFolder, $dstFolder)
{
global $MAXMSG, $boxbase, $dirMode;
$srcPath = $boxbase.'/'.$user.'/'.$srcFolder;
$dstPath = $boxbase.'/'.$user.'/'.$dstFolder;
umask("0000");
if(!@file_exists($dstPath))
{
if(!@mkdir($dstPath, $dirMode)) return false;
}
for($i=0; $i <= $MAXMSG; $i++)
{
$dstMessage = sprintf("msg%04d", $i);
if(!@file_exists($dstPath.'/'.$dstMessage.'.txt') ) break;
// folder is full
if($i >= $MAXMSG) return false;
}
// move files
foreach(array("wav","WAV","gsm","txt") as $extension)
{
$src = $srcPath.'/msg'.$message.".".$extension;
$dst = $dstPath.'/'.$dstMessage.".".$extension;
if(@file_exists($src))
{
if(!@copy($src, $dst)) return false;
else @unlink($src);
}
}
return true;
}
/**
* mark as read
*
* @param $user
* @param $message
* @param $srcFolder
* @param $dstFolder
*/
function mark_as_read($user, $message, $srcFolder, $dstFolder)
{
global $MAXMSG, $boxbase, $dirMode;
$srcPath = $boxbase.'/'.$user.'/'.$srcFolder;
$dstPath = $boxbase.'/'.$user.'/'.$dstFolder;
umask("0000");
if(!@file_exists($dstPath))
{
if(!@mkdir($dstPath, $dirMode)) return ("");
}
for($i=0; $i <= $MAXMSG; $i++)
{
$dstMessage = sprintf("msg%04d", $i);
$msg_id = sprintf("%04d", $i);
if(!@file_exists($dstPath.'/'.$dstMessage.'.txt') ) break;
// folder is full
if($i >= $MAXMSG) return ("");
}
// move files
foreach(array("wav","WAV","gsm","txt") as $extension)
{
$src = $srcPath.'/msg'.$message.".".$extension;
$dst = $dstPath.'/'.$dstMessage.".".$extension;
if(@file_exists($src))
{
if(!@copy($src, $dst)) return ("");
else @unlink($src);
}
}
return $msg_id;
}
?>

View File

@ -0,0 +1,76 @@
<?php
#
# XMLMail - Web based Voicemail for Asterisk (http://asterisk.org)
#
# Copyright 2003 Siggi Langauf
#
# Config options
#
###########################################################################
# Application Name
$appName = "Voice Mail";
# complete path to asterisk's voicemail.conf
$voicemailconf = '/etc/asterisk/voicemail.conf';
# backend type (mysql|text)
$backendtype = "text";
# asterisk's voicemail spool directory
$vboxspool = '/var/spool/asterisk/voicemail';
$context = 'default';
$boxbase = "$vboxspool/$context";
$MAXMSG = "99";
$fileMode = "0660";
$dirMode = "2770";
# CCM MWI integration
$mwiOnExt = "6901";
$mwiOffExt = "6902";
$updateMWI = false; // should we updated MWI from the html/xml frontends
##
## parameters for the "vmailbridge.agi" script
##
# spool directory. vmailbridge.agi will look here for commands
$vmbridgedir = '/var/spool/asterisk/vmbridge';
# vmailbridge_channel will be called by asterisk, if no vmailbridge.agi is
# connected for this extension, yet. The vmailbridge.agi script must be
# available via the given $vmailbridge_extension
$vmbridge_gateway = '171.16.96.63';
$vmbridge_channel = 'OH323/h323:@extension@@'.$vmbridge_gateway;
$vmbridge_extension = '5550000';
# Asterisk's spool directory for outgoing .calls
# The PHP user must have write permissions to this dir.
$callspooldir = '/var/spool/asterisk/outgoing';
# IP address of the web server
# If you use name based virtual hosts, you'll need the server name instead...
$this_server_IP = $_SERVER['SERVER_ADDR'];
# config URL for this service (will be displayed as a hint to user)
# also, your CCM does most likely not support HTTPS ;-)
$userconfig_URL = "http://172.16.96.63/CCMUSER/";
#$language = 'de';
$language = 'en';
# Possible folders - taken from asterisk/apps/app_voicemail.c:mbox
$folderNames = array(
"INBOX",
"Old",
"Work",
"Family",
"Friends",
"Cust1",
"Cust2",
"Cust3",
"Cust4",
"Cust5",
);
?>

View File

@ -0,0 +1,303 @@
<?php
#
# Startup.php
# Sample script for self configuration with Digium/Asterisk platform.
# Copyright Aastra Telecom 2007
#
#
# Includes
#
require_once('include/config.inc.php');
include_once('include/backend.inc.php');
#
# Aastra_decode_HTTP_header
#
# Returns an array
# 0 Phone Type
# 1 Phone MAC Address
# 2 Phone firmware version
# 3 IP address
#
function Aastra_decode_HTTP_header()
{
$user_agent=$_SERVER["HTTP_USER_AGENT"];
if(stristr($user_agent,"Aastra"))
{
$value=preg_split("/ MAC:/",$user_agent);
$fin=preg_split("/ /",$value[1]);
$value[1]=preg_replace("/\-/","",$fin[0]);
$value[2]=preg_replace("/V:/","",$fin[1]);
}
else
{
$value[0]="MSIE";
$value[1]="NA";
$value[2]="NA";
}
$value[3]=$_SERVER["REMOTE_ADDR"];
return($value);
}
#
# lookup_config_file(extension)
#
# Returns 1 if extension already in use
#
function lookup_config_file($extension)
{
$config="startup.cfg";
# Init return
$return=0;
# Read config file
$array = @parse_ini_file($config, true);
# Test MAC address
if($array[$extension]['mac']!="") $return=1;
return($return);
}
#
# update_config_file(extension,mac,ip,model)
#
# Update the config file with the new extension
#
function update_config_file($extension,$mac,$ip,$model)
{
$config="startup.cfg";
# Read config file
$array = @parse_ini_file($config, true);
if($array==NULL) $array=array();
# Update value
$array[$extension]['mac']=$mac;
$array[$extension]['ip']=$ip;
$array[$extension]['model']=$model;
# Update config file
reset($array);
$handle = @fopen($config, "w");
if($handle)
{
while ($v = current($array))
{
fputs($handle,"[".key($array)."]"."\n");
fputs($handle,"mac=".$v['mac']."\n");
fputs($handle,"ip=".$v['ip']."\n");
fputs($handle,"model=".$v['model']."\n\n");
next($array);
}
fclose($handle);
}
}
#
# create_mac(extension,mac,username,secret,callerid,model,version)
#
# Creates the MAC.cfg file for the user.
#
function create_mac($mac,$extension,$username,$secret,$callerid,$model,$version)
{
Global $AA_PROXY_SERVER,$AA_REGISTRAR_SERVER;
$value=preg_split("/ /",$callerid);
$result=$value[0]." ".$value[1];
$result=preg_replace("/</","(",$result);
$result=preg_replace("/>/",")",$result);
# Prepare replace strings
$search=array('/\$\$AA_SIPAUTHNAME_AA\$\$/','/\$\$AA_SIPSECRET_AA\$\$/','/\$\$AA_SIPUSERNAME_AA\$\$/','/\$\$AA_SIPCALLERID_AA\$\$/','/\$\$AA_PROXY_SERVER_AA\$\$/','/\$\$AA_REGISTRAR_SERVER_AA\$\$/');
$replace=array($username,$secret,$extension,$result,$AA_PROXY_SERVER,$AA_REGISTRAR_SERVER);
$read = @fopen($model.".cfg", "r");
if($read)
{
$write = @fopen("/tftpboot/".$mac.".cfg", "w");
if($write)
{
# Create file header
while($line=fgets($read,200))
{
$line = preg_replace($search, $replace, $line);
fputs($write,$line);
}
fputs($write,"\n");
fclose($write);
}
fclose($read);
}
}
##########################################
# GLOBAL VARIABLES
$XML_SERVER = "http://".$_SERVER['SERVER_ADDR'].$_SERVER['SCRIPT_NAME'];
$AA_PROXY_SERVER = $_SERVER['SERVER_ADDR'];
$AA_REGISTRAR_SERVER = $_SERVER['SERVER_ADDR'];
$location = "/etc/asterisk/";
##########################################
# Retrieve parameters
$extension=$_GET["extension"];
$password=$_GET["password"];
$action=$_GET["action"];
$step=$_GET["step"];
# Set content type
header("Content-Type: text/xml");
if($action=="countdown")
{
# Display Reboot message
$output = "<AastraIPPhoneTextScreen destroyOnExit=\"yes\">\n";
$output .= "<Title>Reboot needed</Title>\n";
$output .= "<Text>Your phone will reboot in ".$step." seconds.</Text>\n";
$step--;
$output .= "</AastraIPPhoneTextScreen>\n";
header("Content-Type: text/xml");
header("Content-Length: ".strlen($output));
if($step==0) header("Refresh: 1; url=".$XML_SERVER."?action=reboot");
else header("Refresh: 1; url=".$XML_SERVER."?action=countdown&step=".$step);
echo $output;
exit;
}
if($action=="reboot")
{
$output = "<AastraIPPhoneExecute>\n";
$output .= "<ExecuteItem URI=\"Command: Reset\"/>\n";
$output .= "</AastraIPPhoneExecute>\n";
header("Content-Length: ".strlen($output));
echo $output;
exit;
}
# Input Extension
if ($extension=="")
{
$output = "<AastraIPPhoneInputScreen type=\"number\" LockIn=\"yes\">\n";
$output .= "<Title>Initial startup</Title>\n";
$output .= "<Prompt>Enter Extension</Prompt>\n";
$output .= "<URL>$XML_SERVER</URL>\n";
$output .= "<Parameter>extension</Parameter>\n";
$output .= "<Default></Default>\n";
$output .= "</AastraIPPhoneInputScreen>\n";
header("Content-Length: ".strlen($output));
echo $output;
exit;
}
# Input Password
if ($password=="")
{
$output = "<AastraIPPhoneInputScreen type=\"number\" password=\"yes\" LockIn=\"yes\" destroyOnExit=\"yes\">\n";
$output .= "<Title>Initial startup</Title>\n";
$output .= "<Prompt>Enter Password</Prompt>\n";
$output .= "<URL>$XML_SERVER?extension=$extension</URL>\n";
$output .= "<Parameter>password</Parameter>\n";
$output .= "<Default></Default>\n";
$output .= "</AastraIPPhoneInputScreen>\n";
header("Content-Length: ".strlen($output));
echo $output;
exit;
}
# IF authentication failed
if (!$userinfo = verify_user($extension, $password))
{
# Display error
$output = "<AastraIPPhoneTextScreen LockIn=\"yes\" destroyOnExit=\"yes\">\n";
$output .= "<Title>Authentication failed</Title>\n";
$output .= "<Text>Wrong user and password.</Text>\n";
$output .= "</AastraIPPhoneTextScreen>\n";
header("Content-Type: text/xml");
header("Content-Length: ".strlen($output));
echo $output;
exit;
}
# IF already configured
if(lookup_config_file($extension)==1)
{
# Display error
$output = "<AastraIPPhoneTextScreen LockIn=\"yes\" destroyOnExit=\"yes\">\n";
$output .= "<Title>Error</Title>\n";
$output .= "<Text>Extension already in use.</Text>\n";
$output .= "</AastraIPPhoneTextScreen>\n";
header("Content-Type: text/xml");
header("Content-Length: ".strlen($output));
echo $output;
exit;
}
# Get all the user data
$sip_array = parse_ini_file($location."sip_additional.conf", true);
# If user not found
if ($sip_array[$extension]==NULL)
{
# Display error
$output = "<AastraIPPhoneTextScreen LockIn=\"yes\" destroyOnExit=\"yes\">\n";
$output .= "<Title>Internal error</Title>\n";
$output .= "<Text>Extension is not provisioned.</Text>\n";
$output .= "</AastraIPPhoneTextScreen>\n";
header("Content-Type: text/xml");
header("Content-Length: ".strlen($output));
echo $output;
exit;
}
else
{
# Collect data
$username=$sip_array[$extension]['username'];
$secret=$sip_array[$extension]['secret'];
$callerid=$sip_array[$extension]['callerid'];
}
# Get MAC address and type of phone
$value=Aastra_decode_HTTP_header();
# Create mac.cfg
create_mac($value[1],$extension,$username,$secret,$callerid,$value[0],$value[2]);
# Update config file
update_config_file($extension,$value[1],$value[3],$value[0]);
# Create Reboot screen
$output = "<AastraIPPhoneTextScreen destroyOnExit=\"yes\">\n";
switch($value[0])
{
case "Aastra53i":
$output = "<AastraIPPhoneTextScreen>\n";
$output .= "<Title>REBOOT</Title>\n";
$output .= "<Text>Reboot</Text>\n";
$output .= "</AastraIPPhoneTextScreen>\n";
header("Refresh: 1; url=".$XML_SERVER."?action=reboot");
break;
default:
$output = "<AastraIPPhoneTextScreen>\n";
$output .= "<Title>Reboot needed</Title>\n";
$output .= "<Text>Your phone will reboot in 5 seconds.</Text>\n";
$output .= "</AastraIPPhoneTextScreen>\n";
header("Refresh: 1; url=".$XML_SERVER."?action=countdown&step=4");
break;
}
# Display XML Object
header("Content-Type: text/xml");
header("Content-Length: ".strlen($output));
echo $output;
exit;
?>