Aastra 57i FW 2.5.3 XML TextMenu crash

vincent

Joined
Mar 5, 2010
Messages
6
Likes
0
Points
0
#1
Hi All,

First off all, I would like to say I really like the Aastra SIP Phones! Good job guys and girls from Aastra! Oh, and I really like elastix too ;)

I don't know if this is the right forum for this kind of question, but I saw some Aastra people replying, so I will just try my luck.

I deployed elastix as a VOIP server in our office, and every employee has a Aastra 57i phone. We also have a MusicPlayerDeamon (MPD) server, so now I am writing a MPD client for the Aastra 57i phone, with playlist and library support and everything. It was almost finished until I updated my phone firmware from 2.5.0 to 2.5.3, strange things started to happen :blink:

Some directories in the library started to crash the phone. The directories are shown in a XML TextMenu. When I feed the attached XML to my phone with firmware 2.5.3, it stops responding, the watchdog kicks in and reboots the phone. With firmware 2.5.0 everything was fine. When I shorten the MenuItem titles, because they go offscreen anyway, or put less items in the menu, the phone doesn't crash. So it seems to be some sort of nasty memory leak. :eek:hmy:

P.S. Im also really curious when the new Aastra XML scripts for firmware 2.5.3 will be available? :)

Thanks in advance. http://forum.elastix.org/old_files/57icrash_xml.txt
 

vincent

Joined
Mar 5, 2010
Messages
6
Likes
0
Points
0
#2

aastra1

Joined
Mar 5, 2009
Messages
46
Likes
0
Points
0
#3
Hi Vincent,

Happy to hear that you like the phones and our XML API.

Your XML makes the phone crash (I know it should not) because the XML document cannot exceed 10kb and you are sending 10568 bytes. There is a way to reduce the size of a TextMenu by using the "base" tag in the menuItem tag. As the callback uri you are using is almost the same for all your choices you can set base to the common piece and have only the differences in the URIs.

When you write
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<AastraIPPhoneTextMenu destroyOnExit="yes" style="none">
<Title>MPD Library</Title>
<MenuItem icon="1">
<Prompt>..</Prompt>
<URI>https://192.168.4.3/aastra/asterisk/mpd.php?user=13&curdir=House, Techno, Electronic/538 Dance Smash 2009 Volume 1 2009 DivXNL-Team</URI>
<Selection>House, Techno, Electronic</Selection>
</MenuItem>
<MenuItem>
<Prompt>01 - Kid Cudi vs Crookers - Day 'N' Night.mp3</Prompt>
<URI>https://192.168.4.3/aastra/asterisk/mpd.php?user=13&curdir=House, Techno, Electronic/538 Dance Smash 2009 Volume 1 2009 DivXNL-Team</URI>
<Selection>House, Techno, Electronic/538 Dance Smash 2009 Volume 1 2009 DivXNL-Team/01 - Kid Cudi vs Crookers - Day 'N' Night.mp3</Selection>
</MenuItem>
<MenuItem>
<Prompt>02 - Lady GaGa - Just Dance.mp3</Prompt>
<URI>https://192.168.4.3/aastra/asterisk/mpd.php?user=13&curdir=House, Techno, Electronic/538 Dance Smash 2009 Volume 1 2009 DivXNL-Team</URI>
<Selection>House, Techno, Electronic/538 Dance Smash 2009 Volume 1 2009 DivXNL-Team/02 - Lady GaGa - Just Dance.mp3</Selection>
</MenuItem>
This can be reduced to
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<AastraIPPhoneTextMenu destroyOnExit="yes" style="none">
<Title>MPD Library</Title>
<MenuItem icon="1" base="https://192.168.4.3/aastra/asterisk/mpd.php?user=13">
<Prompt>..</Prompt>
<URI>&curdir=House, Techno, Electronic/538 Dance Smash 2009 Volume 1 2009 DivXNL-Team</URI><Selection>House, Techno, Electronic</Selection>
</MenuItem>
<MenuItem>
<Prompt>01 - Kid Cudi vs Crookers - Day 'N' Night.mp3</Prompt>
<URI>&curdir=House, Techno, Electronic/538 Dance Smash 2009 Volume 1 2009 DivXNL-Team</URI>
<Selection>House, Techno, Electronic/538 Dance Smash 2009 Volume 1 2009 DivXNL-Team/01 - Kid Cudi vs Crookers - Day 'N' Night.mp3</Selection>
</MenuItem>
<MenuItem>
<Prompt>02 - Lady GaGa - Just Dance.mp3</Prompt>
<URI>&curdir=House, Techno, Electronic/538 Dance Smash 2009 Volume 1 2009 DivXNL-Team</URI>
<Selection>House, Techno, Electronic/538 Dance Smash 2009 Volume 1 2009 DivXNL-Team/02 - Lady GaGa - Just Dance.mp3</Selection>
</MenuItem>
...
If you use the php SDK, look at the documentation there is a method to set and reset the "base" attribute. Using it will significantly reduce the size of your XML.

Also, you should be careful with the content of the selection tag as well as the uri, if the title includes an "&" it will be interpreted as a parameter delimiter by your script and you will have issues, you should try to use a unique index instead that is always the best way, it is dangerous to use uncontrolled strings in URIs... my 2 cents.

The new XML scripts (2.5.3) are almost completed we are just adding some last minute features to match what has been added in freePBX 2.7.0, be patient the beta is around the corner.

Hope this helps.

Regards

aastra1
 

vincent

Joined
Mar 5, 2010
Messages
6
Likes
0
Points
0
#4
Hi Aastra1,

Thanks for the fast awnser! If you think my library implementation is ugly, you'r right, it is :lol: This is just an Alpha testing 0.01 version for own use only :)

I use id's for the playlist and everything, but due to the nature of the MPD classes I am using, it is difficult to use id's in the library. I am currently looking for a way to encode the directory names to something url friendly.

I am using the PHP SDK (it is very well documented, thanks for that B) ) and the PHP classes, I will take a look at the Base attribute. Good to know the crash is caused by the 10kb limit, now I know what is the cause, I can prevent the phone from crashing :)

Thanks for your help.
 

vincent

Joined
Mar 5, 2010
Messages
6
Likes
0
Points
0
#5
Hi,

I now encode directory and filenames with buildin php urlencode(), but there seems to be a max length for urls the Aastra phones will handle? :(

<MenuItem>
<Prompt>04 - David Guetta & Chris</Prompt>
<URI>https://elastix/aastra/asterisk/mpd.php?user=26</URI>
<Selection>
House%2C+Techno%2C+Electronic%2F538+Dance+Smash+2009+Volume+1+2009+DivXNL-Team%2F04+-+David+Guetta+%26+Chris+Willis+-+Everytime+We+Touch.mp3
</Selection>
</MenuItem>
The request done by the phone is:

192.168.4.253 - - [17/Mar/2010:10:44:18 +0100] "GET /aastra/asterisk/mpd.php?user=26&curdir=House%2C+Techno%2C+Electronic%2F538+Dance+Smash+2009+Volume+1+2009+DivXNL-Team&action=library_add&selection=House%2C+Techno%2C+Electronic%2F538+Dance+Smash+2009+Volume+1+2009+DivXNL-Team%2F04+-+ HTTP/1.0" 200 462 "-" "Aastra57i MAC:00-08-5D-23-31-7E V:2.5.3.18-SIP"
Thanks for your answer.
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,901
Messages
130,885
Members
17,561
Latest member
marouen
Top