Aastra XML, unleash the power of Asterisk and Aastra phones (includes video)

So you got a brand spanking new Aastra 5xi phone that you want to connect to your Asterisk PBX. Implementing XML on your phones opens up a whole world of possibilities. I'll show you how to do it.

These have all been tested on my Aastra 57i phone. It should work on the 55i as well. I am not sure what will work on other phones. Some things will and some things won't.

This guide assumes you have already followed my install guide. This should work on trixbox and pbxinaflash as well but I haven't tested it.  Most of the files, reference documentation etc. are located in the Aastra XML development guide v2.2. They seem to have removed the visual voicemail application in this latest guide. Have no fear, I have included the script and instructions here.

I may create my own RPM but for now I will show you how to set it up manually so you can get a better idea what is going on.

cd /var/www/html

Copy over the xml files and untar.
wget http://www.powerpbx.org/aastra_xml_2.2.0.tar.gz
tar zxvf aastra_xml_2.2.0.tar.gz
chmod 770 -R /var/www/html/aastra

chown -vR asterisk.asterisk /var/www/html/aastra

mkdir /var/cache/aastra
chown asterisk.aserisk /var/cache/aastra
chmod 770 /var/cache/aastra


readme.txt shows how to configure the phones which I will elaborate on below.
copy/paste /var/www/html/aastra/include/phpagi/phpagi.example.conf to /etc/asterisk
rename it phpagi.conf. If you already have a phpagi.conf file then combine the contents of both.
edit it and put in your server hostname and manager.conf username/password. Done!

All scripts currently working great here on CentOS 5.1/Asterisk1.4/FPBX 2.4


As per readme.txt file, add the following information to the aastra.cfg or MAC.cfg file.  This is obviously tailored to the 57i as the other phones don't have top softkeys so you will have to alter those entries.

#aastra.cfg or MAC.cfg

# XML services
xml application URI: http://xxx.xxx.xxx.xxx/aastra/menu.php?source=all
xml application post list: xxx.xxx.xxx.xxx
xml application title: XML Applications
# Action URI
action uri registered: http://xxx.xxx.xxx.xxx/aastra/register.php?user=$$SIPUSERNAME$$&dndkey=softkey5&cfkey=softkey4

action uri incoming: http://xxx.xxx.xxx.xxx/aastra/incoming.php?number=$$REMOTENUMBER$$&name=$$INCOMINGNAME$$&user=$$SIPUSERNAME$$

action uri onhook: http://xxx.xxx.xxx.xxx/aastra/onhook.php?number=$$REMOTENUMBER$$&name=$$INCOMINGNAME$$&user=$$SIPUSERNAME$$

# Softkeys
topsoftkey1 type: xml
topsoftkey1 label: Day/Night
topsoftkey1 value: http://xxx.xxx.xxx.xxx/aastra/daynight.php?user=$$SIPUSERNAME$$&key=topsoftkey1&daynight_index=1

topsoftkey2 type: xml
topsoftkey2 label: Park Lot
topsoftkey2 value: http://xxx.xxx.xxx.xxx/aastra/park.php
topsoftkey2 states: idle

topsoftkey4 type: speeddial
topsoftkey4 label: Icom
topsoftkey4 value: *80+
topsoftkey4 line: 1

topsoftkey5 type: speeddial
topsoftkey5 label: Park
topsoftkey5 value: "#70"
topsoftkey5 line: 5

softkey1 type: xml
softkey1 label: Directory
softkey1 value: http://xxx.xxx.xxx.xxx/aastra/directory.php
softkey1 states: idle connected

softkey2 type: xml
softkey2 label: Voice Mail
softkey2 value: http://xxx.xxx.xxx.xxx/aastra/vmail.php?ext=$$SIPUSERNAME$$&user=$$SIPUSERNAME$$
softkey2 states: idle

softkey3 type: xml
softkey3 label: Speed Dial
softkey3 value: http://xxx.xxx.xxx.xxx/aastra/speed.php
softkey3 states: idle connected

softkey4 type: xml
softkey4 label: Call Fwd
softkey4 value: http://xxx.xxx.xxx.xxx/aastra/cfwd.php?user=$$SIPUSERNAME$$&key=softkey4
softkey4 states: idle

softkey5 type: xml
softkey5 label: DND
softkey5 value: http://xxx.xxx.xxx.xxx/aastra/dnd.php?user=$$SIPUSERNAME$$&key=softkey5
softkey5 states: idle

softkey6 type: callers
softkey6 label: Callers

softkey7 type: directory
softkey7 label: Contacts

softkey8 type: services
softkey8 label: Services

softkey9 type: speeddial
softkey9 label: Reminders
softkey9 value: 123
softkey9 line: 1

softkey10 type: xml
softkey10 label: Other Apps


Here is a video demonstration of the above example in action.  Sorry about the quality.
 

Sections: 

Comments

Those are some cool applications. Are those all GPL for anyone to use and if so where do I get the source. I really want the Day/Night Button. This is the one thing that I have really needed for my asterisk system.

Day/night and everthing else right here as per the procedure.
http://www.powerpbx.org/aastra_xml_2.2.0.tar.gz

It says in the daynight.php file that it is GPL.

My client has 6731i from another provider and needs to move them. The phones contiue to auto provision to the old provider. We have reloaded the firmware, reset the phone to factory default, and repointed the Config server to our server correctly. All is well off line, but when the WAN is accessed the phones auto provision back to the old provider. How do we stop this?

Did you erase local config?  It's not the same as reset to factory defaults which can cause confusion unfortunately.

Aastra resellers have access to a tool called Aastra Redirection.  Basically, a factory default phone will automatically contact the redirection server (rcs.aastra.com) and by mac address, the server will point the phone to a preset configuration server.  You may try contacting Aastra support to see if they can remove the MAC address from the old provider's account, or try this:

Redirection and Configuration Server (RCS) Bypass via Option 43
In Release 2.6, DHCP Option 43 support has been extended to include the ability to
bypass contacting Aastra's Redirection and Configuration Server (RCS), in addition to
the previous support of setting the configuration server to contact.

A new sub-option code 3 has been defined that uses a boolean value (true or false)
that controls whether or not the phone should contact the RCS after a factory default.
If this value is set to false, the RCS is not contacted. If it is set to true or is missing, then
the RCS is contacted as per previous releases. This can be used in conjunction with
the existing code 2 sub-option to set the configuration server.

Configuring RCS Bypass via Option 43 on a Linux DHCP Server
The following example illustrates how to configure RCS bypass via Option 43 on a
Linux DHCP server.

option space AastraIPPhone;
option AastraIPPhone.cfg-server-name code 02 = text;
option AastraIPPhone.contact-rcs code 03 = boolean;

Subnet 192.168.1.0 netmask 255.255.255.0 {

#The 6757i phones don't contact RCS but use the defined FTP server for configuration files.
class "vendor-class-57i" {
match if option vendor-classidentifier="AastraIPPhone57i";
vendor-option-space AastraIPPhone;
option AastraIPPhone.cfg-server-name
"ftp://username:password@10.10.10.1";
option AastraIPPhone.contact-rcs false;
}

#The 6757iCT phones do not contact the RCS.
class "vendor-class-57iCT" {
match if option vendor-classidentifier="
AastraIPPhone57iCT";
vendor-option-space AastraIPPhone;
option AastraIPPhone.contact-rcs false;}

}

Just a quick note for anyone running 480i phones. I bought a refurbished model to play with (only $109.00 - not bad). Of course you still have to add a template "Aastra480i.cfg" and give it appropriate permissions. Plugged the phone in and it asked for my extention (entered it and clicked ok) and then asked me for the voicemail password (entered it and clicked ok). Phone rebooted and picked up the newly created mac.cfg (which uses the Aastra480i.cfg for a template). Really simple and just works..... Truly plug and play I haven't tried a 9133i yet, but would imagine it to work. Thanks for the help with this !!! Will

That's good to know.  I have a 9133i but haven't tried it.  It has limited XML capablilties compared to the 480i so ??