NO JOY aastra prf doesn't push all the keys

gregc

Guru
Joined
Sep 8, 2008
Messages
433
Reaction score
3
My prf file includes topsoftkey1 data (among all the other config data) but when the phone is reset, logout/login, or the apply_prf utility is used, the topsoftkey1 data doesn't get applied. The resulting mac.cfg file is missing it entirely.

It affects most phones, but not all of them. There is nothing special about the phones it works on or doesn't. They are all 57i's and are all part of the same prf group.

Any idea what would cause this?

-Greg
 
Okay... since I'm not able to find out why this is happening, can I just use sed to add the lines to the mac.cfg files? I'm not familiar enough with sed to know how to do it though. I would need to add:


Code:
topsoftkey1 type:xml
topsoftkey1 label:Day/Night
topsoftkey1 value:http://$$AA_XML_SERVER_AA$$/$$AA_XMLDIRECTORY_AA$$/asterisk/daynight.phpuser=$$SIPUSERNAME$$&index=1

I would ideally like to add the lines following the line:

Code:
# System Softkeys



-Greg
 
Worked some more on this and am able to reproduce the issue and have somewhat tracked it down. I just don't know how to fix the problem.

Default demo prf:
Code:
topsoftkey1 type:services
topsoftkey1 label:Services

topsoftkey2 type:xml
topsoftkey2 label:Parking
topsoftkey2 value:http://$$AA_XML_SERVER_AA$$/$$AA_XMLDIRECTORY_AA$$/asterisk/park.php?user=$$SIPUSERNAME$$&linestate=$$LINESTATE$$

topsoftkey3 type:xml
topsoftkey3 label:Speed Dial
topsoftkey3 value:http://$$AA_XML_SERVER_AA$$/$$AA_XMLDIRECTORY_AA$$/directory/speed.php?user=$$SIPUSERNAME$$

topsoftkey4 type:xml
topsoftkey4 label:Presence
topsoftkey4 value:http://$$AA_XML_SERVER_AA$$/$$AA_XMLDIRECTORY_AA$$/asterisk/away.php?user=$$SIPUSERNAME$$

topsoftkey5 type:xml
topsoftkey5 label:Day/Night
topsoftkey5 value:http://$$AA_XML_SERVER_AA$$/$$AA_XMLDIRECTORY_AA$$/asterisk/daynight.php?user=$$SIPUSERNAME$$

topsoftkey6 type:icom
topsoftkey6 label:Icom

My custom prf:
Code:
topsoftkey1 type:xml
topsoftkey1 label:Day/Night
topsoftkey1 value:http://$$AA_XML_SERVER_AA$$/$$AA_XMLDIRECTORY_AA$$/asterisk/daynight.php?user=$$SIPUSERNAME$$

topsoftkey2 type:xml
topsoftkey2 label:Extensions
topsoftkey2 value:http://$$AA_XML_SERVER_AA$$/$$AA_XMLDIRECTORY_AA$$/asterisk/directory.php?user=$$SIPUSERNAME$$

topsoftkey3 type:xml
topsoftkey3 label:Phonebook
topsoftkey3 value:http://$$AA_XML_SERVER_AA$$/$$AA_XMLDIRECTORY_AA$$/asterisk/phonebook.php

topsoftkey4 type:speeddial
topsoftkey4 label:Call PU
topsoftkey4 value:*8

topsoftkey5 type:xml
topsoftkey5 label:Q-Agent
topsoftkey5 value:http://$$AA_XML_SERVER_AA$$/$$AA_XMLDIRECTORY_AA$$/asterisk/agent.php?agent=$$SIPUSERNAME$$
topsoftkey5 states:idle

Changing the demo prf one line at a time, it works fine right up until I change out the Presence key. I don't use Presence, so the key doesn't show up anyways.

So, I went and looked at the startup.php to see what was going on:
Code:
	# Process day/night keys
	foreach($array_config as $key=>$value) 
		{
		if(strstr($value,'daynight.php'))
			{
			$pieces=explode(' ',$key);
			if(stristr($pieces[0],'expmod')) $appli=$pieces[0].' '.$pieces[1];
			else $appli=$pieces[0];
			$url=parse_url($value);
			parse_str($url['query'],$parse);
			if($parse['index']!='') $index=$parse['index'];
			else $index='';
			if(!Aastra_is_daynight_appli_allowed_Asterisk($username,$index))
				{
				unset($array_config[$appli.' type']);
				unset($array_config[$appli.' label']);
				unset($array_config[$appli.' value']);
				unset($array_config[$appli.' states']);
				}
			}
		}

So, there it is right there removing my daynight config info. I don't know why it behaves as it does. I tried changing the daynight.php to daynight1.php and that does work. The prf propagates to the mac.cfg file fine. But the button doesn't use the BLF light so not a feasible fix.

Here is a work around that does work. I made a file with:
Code:
topsoftkey1 type:xml
topsoftkey1 label:Day/Night
topsoftkey1 value:http://192.168.0.210/aastra/asterisk/daynight.php?user=$$SIPUSERNAME$$&index=0

and a script with:
Code:
#!/bin/bash

for f in 000*.cfg ; do
 cat daynightfix >> $f
done

This fixes my problem in our situation as each person in the office has their own phone. However, if someone were to logout then log back in, the mac.cfg file for that phone would need to have the lines added back to it.

Ideally, I would like to have the startup script work.

-Greg
 

Members online

No members online now.

Forum statistics

Threads
26,687
Messages
174,411
Members
20,257
Latest member
Dempan
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top