Skip to content
Leon Rowland edited this page May 26, 2014 · 2 revisions

Status

A Status object is the ability to send Messages to the Aastra phones display. For example, notifying of an error in your application?

Lets make that!

Usage

First we make a new Status. A status requires a special name that your messages will be grouped under. This is important for when you may want to remove messages from the Phones idle display.

use Clearvox\Aastra\XML\Status\Status;

$status = new Status('session-name');

We can set options on this object including if it should Beep or wether it should trigger a destroyOnExit on an existing XML object.

$status
    ->beep()
    ->triggerDestroyOnExit();

Message

A message is what to send to the phones idle screen. Lets tell the user that something is wrong with their website.

use Clearvox\Aastra\XML\Status\Message;

$message = new Message('Something is wrong!');

On the 6739i a Message can have a URI component. This is what is called when you press the message on the screen. For now we wont set anything for that.

Lets add the message to Status object now

$status->addMessage($message);

Thats it!

Full Example

use Clearvox\Aastra\XML\Status\Status;
use Clearvox\Aastra\XML\Status\Message;

// Make the Status Object
$status = new Status('alert-system');

// Make the first Message
$firstMessage = new Message('Something is wrong!');

// Add Message to Status
$status->addMessage($firstMessage);

$xml = new DOMDocument();
$xml->appendChild($xml->importNode($status->generate(), true));

header('Content-Type:text/xml');
echo $xml->saveXML();
exit;

Official XML Toolkit

Aastra XML Doc (04/2014)

Clone this wiki locally