Aastra XML scripts for Trixbox
The Aastra XML scripts RPM is now available from the trixbox yum server.
The release notes are below.
run
yum install aastra-xml-scripts
to get the package
Best regards
Kieran
Aastra Telecom XML scripts for Trixbox
Version 1.0
All files in this distribution are Copyright 2007 Aastra Telecom Ltd unless otherwise specified.
The scripts are only intended to illustrate the functionality available
using XML with the range of Aastra Telecom IP phones and come with no warranty.
See License.txt for License Agreement information.
Table of Contents
-----------------
1. Installing the Aastra XML scripts RPM
2. XML script features
Voice Mail - vmail.php
DND Server Side (do not disturb) - dnd.php
Call forward Server Side - cfwd.php
Directory of phones registered on trixbox - directory.php
SugarCRM directory - sugarCRM.php
Call Park - park.php
3. Sample configuration files
1. Installing the Aastra Telecom XML scripts RPM.
-------------------------------------------------
Download and install the rpm from trixbox.org using yum:
yum install aastra-xml-scripts
Alternatively receive the update using the trixbox package manager.
2. XML script features
----------------------
Voice Mail
++++++++++
The visual voice mail feature displays the current voice messages currently stored by Comedian Mail.
The User has the ability to delete, view the details or play the message using the XML browser.
DND Server Side
+++++++++++++++
The User can set and unset the do not disturb feature on the server using softkeys on the phone.
When DND is set server side, the call is never presented to the Phone
Call forward Server Side
++++++++++++++++++++++++
The User can set and unset call forwarding on the server using softkeys on the phone.
When CFWD is set server side, the call is never presented to the Phone
Directory
+++++++++
The Directory feature lists all the users currently registered on the trixbox.
Selecting a member from the directory will call that extension.
SugarCRM Directory
++++++++++++++++++
The SugarCRM directory feature allows a search of the contacts stored in the SugarCRM database.
Call Park
+++++++++
The Call Park feature lists all calls currently in the parking lot. Selecting the
call in parking lot will retrieve the call.
Call Park must be correctly set up on both the server and phone to use this feature.
Action URI scripts
++++++++++++++++++
In addition the action URI scripts onhook.php and register.php are used to enhance the
functionality of the other scripts.
3.Sample Configuration Files
----------------------------
Sample configuration file for Aastra 480i and 480i CT
-----------------------------------------------------
XXXXXXXXXXXXX is the IP address or the name of your Trixbox # Action URI action uri registered: http://XXXXXXXXXXXXX/aastra/register.php?user=$$SIPUSERNAME$$&dndkey=4 action uri incoming: http://XXXXXXXXXXXXX/aastra/incoming.php?number=$$REMOTENUMBER$$&name=$$INCOMINGNAME$$&user=$$SIPUSERNAME$$ action uri onhook: http://XXXXXXXXXXXXX/aastra/onhook.php?number=$$REMOTENUMBER$$&name=$$INCOMINGNAME$$&user=$$SIPUSERNAME$$ # System Softkeys softkey1 type: xml softkey1 label: Directory softkey1 value: <a href="http://XXXXXXXXXXXXX/aastra/directory.php" title="http://XXXXXXXXXXXXX/aastra/directory.php">http://XXXXXXXXXXXXX/aastra/directory.php</a> softkey1 states: idle connected softkey2 type: xml softkey2 label: Contacts softkey2 value: <a href="http://XXXXXXXXXXXXX/aastra/sugarCRM.php" title="http://XXXXXXXXXXXXX/aastra/sugarCRM.php">http://XXXXXXXXXXXXX/aastra/sugarCRM.php</a> softkey2 states: idle connected softkey3 type: xml softkey3 label: Call Fwd softkey3 value: http://XXXXXXXXXXXXX/aastra/cfwd.php?user=$$SIPUSERNAME$$ softkey3 states: idle softkey4 type: xml softkey4 label: DND ON softkey4 value: http://XXXXXXXXXXXXX/aastra/dnd.php?user=$$SIPUSERNAME$$&key=4 softkey4 states: idle softkey5 type: xml softkey5 label: Parkd Calls softkey5 value: <a href="http://XXXXXXXXXXXXX/aastra/park.php" title="http://XXXXXXXXXXXXX/aastra/park.php">http://XXXXXXXXXXXXX/aastra/park.php</a> softkey5 states: idle softkey6 type: xml softkey6 label: Voice Mail softkey6 value: http://XXXXXXXXXXXXX/aastra/vmail.php?ext=$$SIPUSERNAME$$ softkey6 states: idle Sample configuration file for Aastra 9133i ---------------------------------------------------- XXXXXXXXXXXXX is the IP address or the name of your Trixbox # Action URI action uri registered: http://XXXXXXXXXXXXX/aastra/register.php?user=$$SIPUSERNAME$$ action uri incoming: http://XXXXXXXXXXXXX/aastra/incoming.php?number=$$REMOTENUMBER$$&name=$$INCOMINGNAME$$&user=$$SIPUSERNAME$$ action uri onhook: http://XXXXXXXXXXXXX/aastra/onhook.php?number=$$REMOTENUMBER$$&name=$$INCOMINGNAME$$&user=$$SIPUSERNAME$$ # System Softkeys prgkey1 type: xml prgkey1 value: http://XXXXXXXXXXXXX/aastra/cfwd.php?user=$$SIPUSERNAME$$ prgkey2 type: xml prgkey2 value: http://XXXXXXXXXXXXX/aastra/dnd.php?user=$$SIPUSERNAME$$&key=4
One issue: if the phone can not resolve an address (say, for example, you put the wrong IP in the config scripts -- oops) the phone becomes unresponsive while it tries. I'd like the hangup key to act as an "escape" key in this case. Can that be forwarded to the firmware guys?
Anyway, these scripts are awesome. Not only are the out of the box examples usable, I can really see the potential for expansion here, thanks again.
I'm envisioning a "mode" change button on the receptionist phones, that'll help me out quite a bit. If I write something like that I'll be sure to post it on the wiki.
The scripts are really closely tied to how a Trixbox system is setup, so they probably wouldn't work out of the box with another setup. So there is currently no intention to distribute these particular scripts separately. Of course, if there is enough demand that can always change.
That being said, you can always download the RPM manually from here and use the standard RPM commands to extract the files where you want them.
What exactly are you looking for? There are a number of generic example scripts available in the XML Development Guide.
----
Gareth
I'd like to extend the DND script a bit and have it either turn on the message light or have it flash at a difference cadence than you would see for voice mail. maybe have it on steady and turn off for half a second every five seconds or something like that.
Anyway, is there a provision for controlling the lights in this manner through the xml facilities?
Also, while I'm blathering: is there a java (or other) 480i simulator/emulator I can use on my laptop so I can screw around with this stuff at home?
Anyway, is there a provision for controlling the lights in this manner through the xml facilities?
Not in the current release, although the next release for the 5i Series phones will add the ability to set the LEDs next to XML keys.
is there a java (or other) 480i simulator/emulator
Unfortunately not
----
Gareth
Try 1.4.2 Beta - we want your feedback
Thanks for all your work on this. I have tried out the voicemail function and the call park function. The voicemail exceeded my expectations. The call park works as advertised. Not quite what I was looking for with the call park but I am not even sure how I would explain what I would like to do with the call park.
Hopefully looking at these scripts will give me some ideas to make some of my own to expand our system.
Thanks again
In the vmail app, is there any way to delete the message during playback?
If you can't delete during playback your only option is to hit "done", which takes you back to the main phone screen making you have to log back into the voice mail app if you want to go back and delete the message.
I've found a work around where you can hit the hangup key to go back, but I'd like to learn how to add a menu item "back" instead, otherwise users will be confused.
Thanks.
ok so I was playing around as we only have 9133i phones.
If you point a browser at any of these it gives you a error page:
This XML application works better when using an Aastra IP phone, not a web browser.
See here for instructions and information.
Copyright Aastra Telecom 2006.
and here goes to http://65.205.71.13/
Where you can select free xml scripts among many other things. So several comments.
1. if you select downloads you can'd download anything.
2. FAQ is all english questions but french answers.
3. same for half the items listed under products.
That's not French, that's Latin used for filler in the typeseting (and now web-template) industry. The text is taken from Cicero's "The Extremes of Good and Evil," ca 45 BC. It has been used since the 1500s as example text. I know too much trivia.
I think that page is just a dummy they set up just for us (I'm going by the old trixbox favorite.ico,) so it's not entirely functional.
what you have found is some error handling from our script writer - aastra1! The link is just a place holder for some of his own scripts, not the official aastra website, but still some useful scripts.
basically the script checks for the User agent that calls it, and if that is a web browser you get the web page and link mentioned above. If you want to run it from a browser, you can modify the script to allow that user agent. I will leave the modification of the script as an exercise for the reader :-)
In the readme for these scripts, we state that they are meant as example scripts with no warranty; for you to modify to your needs.
Cheers
Kieran
I had this working then reloaded my box and now when I use the sugar xml on the aastra 480 phones it is adding a 9 to the outbound number before it even leaves the phone.
I think it is sugar doing this but not sure, it never even makes it to asterisk as the 9 doesn't match my aastra dial plan.
Any ideas where the 9 is coming from? I just can't find it.
Thanks,
Chris
Aastra guys....
Any chance that the PHP source located at http://65.205.71.13/ would be released as well? I'm very interested in adding some of that functionality to my customer's phones but it would need to be modified based on location.
As well, I had to slightly modify the vmail.php script to work correctly on our 480i phones since pressing "Done" after listening to a voice message or deleting a voice message would return you to the phone's home screen.
Thanks for opening up these xml interfaces and posting code. Great additions!
Sure, and here I figured it was just me having this problem. Here are the changes I made to /var/www/html/aastra/vmail.php (very simple so I didn't create a patch):
Let me know if this isn't clear.
-----------------------------------------------------
Around line 144
if($action=="delete")
{
# Decode current Message
sscanf($msg,"%4s-%s",$msg_id,$msg_folder);
# Delete message
if (delete_message($user, $msg_folder, $msg_id))
{
$action=$origin;
if($origin=="zoom")
{
if($target!="") $msg=$target;
else $action="list";
}
#START MY CHANGE
else
{
$action="list";
}
#END MY CHANGE
}
else
{
$object = new AastraIPPhoneTextScreen();
$object->setDestroyOnExit();
$object->setTitle('Error Message');
$object->setText('An error occured while deleting the message.');
$object->output();
exit;
}
}
-----------------------------------------------------
Around line 400
{
$text="Message left by ".$cid." on ".$date." at ".$time.". Duration is ".$duration.".";
$object = new AastraIPPhoneTextScreen();
$object->setTitle("Message ".$msg);
$object->setText($text);
#START MY CHANGE
$action="zoom";
#END MY CHANGE
}
$object->setDestroyOnExit();
The dialing plan for the SugarCRM directory is configured in the sugarCRM.ini file. The parameters are:
- country code (1 for US/Canada)
- long distance which is the long distance prefix to be added (1 for the US)
- international which is the international prefix to be added (011 for the US)
- outgoing which is th outgoing prefix to be added for an outgoing call (9 by default)
So if you want to get rid of the 9 as the outgoing prefix just blank the value in the sugarCRM.ini file.
Aastra1
We will release very soon some of the XML applications we demonstrate at 65.205.71.13 such as the RSS feed reader and some other cool stuff. Stay tuned!
Now regarding the voicemail application, when you play the message the application generates an auto-answer call to the phone which disrupts the XML application, so to stay in the application we use the action uri incoming to display the enveloppe of the message and to go back to the application you need to hang up the call and trigger the on-hook action uri. This is why pressing "Done" when you are playing the message does not change anything.
Aastra1
Aastra1,
Thanks, that's great news! It'll save me a ton of time to add new toys, that's for sure. Looking forward to that.
I understand the incoming action uri purpose but I changed the script just so it showed the play, delete, etc buttons on the screen after the message was played so the user could go back, play the message again, etc. If only the done button was on the screen it just went to the main screen which our users were frustrated with.
Regards,
Greg
I'm not running trixbox yet, but I plan on switching to it in a few months (when I get my new server).
In the mean time, I installed the rpm on my asterisk box and am playing with the voicemail part of it. Everything seems to work fine until I press "Play" to play a message. The phone goes back to the original 'status' screen and shows "Loading Page..." on the last line. It does this for ~30 seconds. Then the phone answers the incoming call (and beeps twice), brings up the "play screen", and then disconnects without actually playing anything. I modified vmail.php to write out the $res array (from the $as->originate() call) and I got 2 entries:
Error
Originate failed
Looking over the asterisk logfile, I don't see what it could be. Here are (what I believe to be) the relevant lines:
Apr 15 21:28:55 DEBUG[2251] manager.c: Manager received command 'Originate'
Apr 15 21:28:55 DEBUG[2251] chan_sip.c: Allocating new SIP dialog for (No Call-ID) - INVITE (With RTP)
Apr 15 21:28:55 DEBUG[2251] chan_sip.c: Setting NAT on RTP to 0
Apr 15 21:28:55 DEBUG[2251] chan_sip.c: Outgoing Call for 1095
Apr 15 21:28:56 DEBUG[2143] chan_sip.c: (Provisional) Stopping retransmission (but retaining packet) on '7de86b1f26c0754a7951fcfc3d69f2b4@192.168.222.254' Request 102: Found
Apr 15 21:29:08 DEBUG[2143] chan_sip.c: Auto destroying call '06c42a336fce36b551ca310071227bdb@192.168.222.254'
Apr 15 21:29:25 DEBUG[2251] pbx.c: Function result is '"VoiceMail" <0000>'
[...]
Apr 15 21:29:25 DEBUG[2251] pbx.c: Function result is 'NO ANSWER'
If I run a wget passing the same string that the phone sent to the webserver, everything works as expected (the phone immediately answers and plays the message), here's the same basic lines from the logfile:
Apr 15 21:34:16 DEBUG[2326] manager.c: Manager received command 'Originate'
Apr 15 21:34:16 DEBUG[2326] chan_sip.c: Allocating new SIP dialog for (No Call-ID) - INVITE (With RTP)
Apr 15 21:34:16 DEBUG[2326] chan_sip.c: Setting NAT on RTP to 0
Apr 15 21:34:16 DEBUG[2326] chan_sip.c: Outgoing Call for 1095
Apr 15 21:34:17 DEBUG[2143] chan_sip.c: (Provisional) Stopping retransmission (but retaining packet) on '0f3761c0063aa89867761b6250c3cb21@192.168.222.254' Request 102: Found
Apr 15 21:34:17 DEBUG[2143] chan_sip.c: Acked pending invite 102
Apr 15 21:34:17 DEBUG[2143] chan_sip.c: Stopping retransmission on '0f3761c0063aa89867761b6250c3cb21@192.168.222.254' of Request 102: Match Found
Apr 15 21:34:17 DEBUG[2143] chan_sip.c: build_route: Contact hop:
Apr 15 21:34:17 VERBOSE[2326] logger.c: > Channel SIP/1095-009d50a0 was answered.
any ideas?
...dave
The DND script is create for activating/deactivating Server Side DND, which is a great help to our logging and parsing of those logs. As for the problems with it. Many of us have our Aastra endpoints (which i love) checking our servers nightly for updates etc. The problem somes in if they're set to server side DND when they restart, they lose the DND Activated indication on the screen, leaving the phone looking like it's ready to take calls, when in fact DND will prevent any from coming to it. How can I get the phone to check the server side DND status and cough up the correct screen message if DND is on?
Also, reiterating the earlier issue of the key# in the script not changing the key value. Solved it cosmetically by making the button just say DND, but it IS still an issue with the script.
I finally got a chance to play with this on my 9133i phone. Too bad the voicemail app isn't supported but I guess the 9133i display is too small.
Anyways, I read the Aastra XML documentation. For the programmable buttons I see the benefit in that the display show "DND deactivated" and "CFW deactivated" text
I am at a loss as to what the action URI's are doing that actually changes anything for everything else. The documentation just says it is executing a "GET" on that event but what is it getting? It looks like it is retrieving phone numbers but how does that differ from what I normally see on my phone. I still see the incoming and outgoing number plus any CID text with or without this script.
Just in lay mans terms, what is this actually doing on a 9133i phone that enhances it's function besides the indication of what happens when I press a speed dial button.
Crimson13,
You have probably missed one part of the configuration for the XML scripts we have published. As the CFWD and DND are lost after a reboot you need to set up an action uri registered that will be called each time the phone registers (which is done right after a reboot) to sync up the phone and the server side.
The configuration is
action uri registered: http://XXXXXXXXXXXXX/aastra/register.php?user=$$SIPUSERNAME$$&dndkey=4 where dndkey is the softkey number where the DND script is called.
By adding this simple configuration parameter the DND and CFWD will be back to what they were before the phone rebooted.
Regards
Aastra1
I have a client that has setup a number of call queues. The Caller ID name is prefixed with NAME: . When incoming calls come into a call queue, the aastra 480i phones display 'page error'. I am assuming it has something to do with the name prefix, because normal calls do not have this problem.
We are running trixbox 2.2, asterisk 1.2.18, and the latest version of your scripts and the latest aastara phone firmware.
Thanks! BTW, are the new scripts out yet?
Had the scripts working on my Trix 2.0 system, since then upgraded to Trix 2.2 and moved the system to a different server.
Now lots of "Loading page..." and "Cannot display..." but that's about it. If I try to access the scripts in a regular browser they all come up with their little "you shouldn't be accessing this in a web browser" warning so they seem to be in the right place, and accessible.
The only other "clue" i have is that in the httpd error log I see a "Failed to login." which corresponds with every time a script tries to fire.
Tried uninstalling the rpm and reinstalling but still no go. I'm sure this is something simple that I've forgotten to configure/reconfigure in all of the moving and upgrades, but I'm drawing a blank.
Any suggestions?
Cheers,
>>>>> Mike <<<<<
I also have these "Loading page...." things here... they appear right after I have
pressed the "Good bye"-Button and they lock up my phone for about 2 minutes...
after that the "Loading page..." disappears and eveything works again...
That's really annoying... :-(
Does anybody have a workaround for that already?
480i with newest FW from US-Website running here along with TB 2.2
Best regards,
Christian
Thanks for your reply :-)
What exactly do you mean with "extra spaces"? You mean the XML-Link in the Phone-Setup?
I've checked that, the line ends with the last character, so trailing spaces at the end...
Hm... I really have to get this "bug" solved as I can't use the phone for about 2 minutes after a call ;-) That's really annoying *g*
Thanks for any help!
Best regards,
Christian
I've used the Aastra examples (thanks guys : ) to hack together a script to monitor multiple voicemail boxes. I'm currently using it at a clients site with 12 handsets without any problems.
I configure the VM boxes to monitor in the extensions setup, and assign the php app to the first softkey labeled "Voicemial". The MWI flashes when any monitored box receives a message and the envelope displays with a count of the total new messages in all mailboxes. Pressing the "Voicemail" button shows a list of the Voicemail boxes for that extension with a new/old message count.
e.g.
Personal 1/0
Sales 2/4
Support 4/0
You can select a mailbox with the cursor and press a softkey labeled "Listen" to access that mailbox. The action for each mailbox is to dial *98"VM number". So the next think you hear is Alison saying "Password".
I'm not a programmer and this is a nasty hack, but if anyone can use this or would like to clean it up or develop it further I'll happily add a few comments to the code and share it.
Dave.
This would be greatly appreciated. I know of 2 different systems right away that I could deploy this at.
Thanks,
-Mike Donato
mdonato@sitetechllc.com
Please note this is written for Aastra 480i phones only
Get it here: http://www.hds.uk.net/multivmail.tar.gz
I'd appreciate some feedback.
Thanks,
Dave.
You can grab the rpm without using yum from here:
http://yum.trixbox.org/centos/4/RPMS/repodata/repoview/aastra-xml...
The scripts are all installed in /var/www/html/aastra/
check the install part of RPM becasue it sets up some permissions.
Current the RPM method is the only way of getting the scripts.
Kieran
I'm also getting timout issues with some of the scripts. Like the directory one and the Parked calls.
The log file reveals: "Failed to login"
The ip address is correct and the scripts are hitting the server. The weather script works fine as well.
Any idea how to fix this?
The community now has a Day/Night button XML application for all Aastra phones thanks to the financial support of alexis and dwright154 through the bounty system. It links in with FreePBX's Day/Night control and includes LED indicators for Night mode, as well as screen indicators.
See:
http://www.trixbox.org/forums/vendor-moderated-forums/aastra-endp...
I'm running on version 2.4.2 and all of these are working fine so far except for the play component of the vmail.php. I get the same basic behavior as djalden did where it locks up for 30 seconds with Loading page, then rings the phone and hangs up immediately. It appears to be failing in the phpagi interface. Is there some additional setup of manager credientials that need to be done for these scripts that isn't part of the default setup?
Other than that so far these have been great scripts!!!
markh
P.S. Once we get this licked, I'll need some help modifying the recordings saving script so this can properly parse the config files so we can have a complete end-to-end solution with the Aastra phones!!
====================================================
Mark A. Holm
InfoArch, Inc. Cell: (503) 750-9741
7456 SW Baseline, PMB#123. Office: (503) 943-3202
Hillsboro, OR 97123 ...
Initial problem with playback was solved by a reload. I had been working with several other new subsystems and one of them apparently broke my setup. After a reload these are all working fine so far, except for Call Forward. I'll work more on that tomorrow. Also, if I could have some help I would like to integrate the move-recordings script with the voicemail.php script. It can see the recordings, but cannot retreive them.
markh
I really like these scripts but I too am having the same problems as others when you hit play from the Voicemail script. I get loading page for about 30 seconds then one ring and a hangup. The voicemail never plays. Has anyone come up with a fix for this? I am not sure what oneobserve means by a reload. Does this mean rebooting Trix or re-installing the Aastra scripts from scratch?
We have another thread that says that these scripts will be available for 2.4.2 next month (March) from Aastra. Mine worked for a bit and then went back to the "Loading" behavior, so they weren't truly fixed There was enough idiosyncrasies with the vmail script when it was working (such as start over after listening to a message) that I just reprogrammed the key back to *97. I still need a working call forward button though, so I'll wait for the new scripts for that.
What I meant by a reload was I reformatted and reloaded trixbox from scratch. I had this on an experimentation server and had experimented with to many things...
I posted a fix in the other thread for the "Loading" problem. And I've seen a number of people complaining about having to start over after listening to a message. Make sure you have the Action URI url's entered into your configuration. They will dump you back into the voicemail menu after listening to a message.
I am running a 57i with the visual voicemail app. I installed the apps through the trixbox repository. I am also running the parking app, but with no issues. The voicemail app will allow me to login, view all messages, and then listen to only one. After playback completes, I am back at the home screen with no option to delete or otherwise handle the message I just listened to, and no way to listen to other messages in the box other than to start from scratch.
Is this how it is designed or do I have something configured incorrectly? I saw a patch of sorts posted earlier in this thread, but that patch keeps the app from running at all on the phone. Ideas or pointers anyone?
Nuts. Pulled it from nerdvittles and the navigation is much improved with previous / next buttons, etc.... BUT, I can't get the messages to actually play now. I get a brief, "Loading..." and then nothing. I can see the difference in the playback code between the two, but do not know enough to fix it. I can only think that the nerdvittles script is designed for their pbxinaflash and their playback code was written for the Asterisk 1.4 branch. Unfortunately, my production server uses 1.2. Can anyone help me with this please?
No, it exhibits the behavior I described originally where a message will playback, but then the app exits without any kind of option to either delete the message, move it to a folder, or play the next one. I can hack the nerdvittles script to exhibit the same behavior by pasting over the playback AGI section, but I was really hoping for something a little more elegant to use and maybe sell to clients.

Member Since:
2006-11-07