Specifications
PA-001011-03-04 Aastra July 2014
209
$post .= "Content-Type: text/xml\r\n";
$post .= "Content-Length: ".strlen($xml)."\r\n\r\n";
$fp = @fsockopen ( $phone, 80, $errno, $errstr, 5);
if($fp)
{
fputs($fp, $post.$xml);
flush();
fclose($fp);
}
}
##############################
$xml = "<AastraIPPhoneTextScreen>\n";
$xml .= "<Title>Push test</Title>\n";
$xml .= "<Text>This is a test for pushing a screen to a phone. It
is a way to demonstrate that we can push XML objects to an Aastra
Phone.</Text>\n";
$xml .= "</AastraIPPhoneTextScreen>\n";
push2phone("192.168.0.112","192.168.0.150",$xml);
?>
Sample perl source code
Below is a sample perl source code that sends an XML object to an Aastra phone. In this example,
the phone is located at 192.168.0.150.
#!c:/perl/bin/Perl.exe
# Create a user agent object
use LWP::UserAgent;
use LWP::ConnCache;
use HTTP::Request::Common;
my $ua = LWP::UserAgent->new(agent => 'Mozilla/4.0 (compatible;
MSIE 5.5; Windows 98)');
$ua->conn_cache(LWP::ConnCache->new());
$ua->request(
POST 'http://192.168.0.150'
,Content_Type => 'application/x-www-form-urlencoded'
,Content => 'xml=<AastraIPPhoneTextScreen><Title>Push
test</Title><Text>This is a test for pushing a screen to a phone.
It is a way to demonstrate that we can push XML objects to an
Aastra Phone.</Text></AastraIPPhoneTextScreen>');
Notes:
To accept a pushed page the “XML Push Server List” phone parameter must be
configured with the list of the HTTP servers allowed pushing a page.
When a page is pushed to the phone the MWI lamp blinks to indicate a new message
to the phone.
When a XML object is pushed to the phone, the phone acts like a Web server listening to TCP port
80, which means that if the phone is behind a NAT and the server on the other side of the NAT,
which is a typical configuration for a remote user, the port 80 must be forwarded to the IP phone at
the router level.