Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a way to push out button labels? 1

Status
Not open for further replies.

DevanteWeary

Systems Engineer
Jan 24, 2022
27
0
1
US
Hey guys,

CM 8.1.3.1 here.

Normally I edit the ####_96xxdata.txt file and have the user manual restore the backup file.

However, there's got to be a better way!
Is there a way to have the user do it or even myself that doesn't require directly doing it on the phone or through a text file?

I have a bunch of sidecars I have to do and that doesn't sound enjoyable!

Thanks for any advice.
 
SIP...

Couldn't/shouldn't the phone be setup to create the backup file in the first place?

Or is the problem that they want to save the time have the labels they want without having to manually enter them on the phone?
 
OH dang, all our phones are H.323. :<

All our phones create the backup files.
It's just I'm wondering if there's a more... I don't know... UI way? to edit these labels other than editing the text file and reloading that.
 
But what's the problem - what's missing from the backup that you have to go add manually?
 
Well for instance, if I add a sidecar and put some bridged appearances on it (or now probably Team buttons thanks to you!), it will just show extensions instead of names.

So I have to manually add "SBMLABEL01=John S" and so on, know what I mean?

I tried change system-parameters special-applications and option SA8928 - Display Names on Bridged Appearance Lines but it didn't change anything even when I tested it on a new bridged appearance, and besides I'll probably put using Team buttons from now on.

So I was just looking for a more modern way to do it, or even have the user do it somehow without pressing numbers over and over for each letter ha!
 
The H.323 backup file is just a text file that the 9600 series (and others) use to store all their settings. The file can be manually edited to set new data, such as button labels.
Unlike the J-series phones that can have their labels set via System Manager, the H.323 sets can only have buttons relabeled on the phone itself or by rewriting the backup file.

Roger the Phone Guy - - had some scripts that would do something like that. Basically, he automated editing the phone's backup file to relabel the phone's button module labels. It was a pretty slick process. Here's the video:
 
Here's a generic data file for the 9600 that contains some basic settings for your reading enjoyment. I don't have one with button labels, however.
Code:
English/Metric Units=0
LOGTDFORMAT=128
Redial=0
Edit Dialing=1
Go to Phone Screen on Calling=0
Go to Phone Screen on Ringing=1
Call Timer=1
Visual Alerting=0
History Active=1
Log Bridged Calls=1
Audio Path=1
Personalized Ring=0
Handset AGC=0
Headset AGC=0
Speaker AGC=0
Error Tone=1
Button Clicks=0
Text Size=1
Contacts Pairing=0
Voice Initiated Dialing=1
Voice Dialing Help Counter=0
Personalized Ring Value=9
Go to Phone Screen on Answer=0
Phone Screen Width=1
Voice Initiated Dialing Language=
 
kyle, the config file looks like what ZeroZeroOne posted, except mine have the labels I added.

Such as
Code:
SBMLABEL01=Lead
SBMLABEL02=Admin

etc...

Hey ZeroZeroOne, thanks so much that sounds nice!
Unfortunately, looks like his site is down. :<
 
Oh? ... sigh. That's unfortunate. Roger had some cool ideas and tricks.
 
So...

A backup file has only has SBMLABEL01=Lead if there is a manual entry for the label. You don't have SBMLABEL01 in the backup file if the user never entered anything, is that right?

Do you have System Manager?
 
Hey kyle, yes you're right... the SBMLABELs is always manual.
I have to enter those and they are not in the backup file by default.

And yep, we have System Manager, although we use Site Administrator almost exclusively just because that's what we're used to. But we get into System Manager sometimes.
 
OK, but you have a backup file named 1111_96xxdata.txt for extension 1111

And if 1111 has a team button or brdg-appr of 2222 and that is specifically on a button module, you want 1111_96xxdata.txt to have a line at the end that says SBMLABEL01=John S if station 2222 is named John Smith.

That's what you want, right?

Do you have root on SMGR?

Are the station names in CM "Smith, John" or "John Smith"?
 
Yeah exactly right!

What are you cooking up? haha

Our names in CM are Last, First so "Smith, John".
And yeah we have root for SMGR!
 
OK, so I'm going on vacation for 2 weeks and the Mrs will kill me if I work at all. So here's the quick and dirty with suggested improvements at the end.

Pretend 1111 has a team or brdg of 2222

2 db queries

First: return 1111,2222,10 - that would mean 1111 has either a brdg or a team for 2222 on button 11 of their module
*I'm only looking at button modules and they start counting at 0. The first button on module 2 = button 24
*also, I'm lazy and in a hurry. It only works on a 4 digit dial plan.
Second: return extensions, names

So you'd run this in your SMGR as root:

Code:
mgmtia -t -A -f ./all.sql  > allTeamAndBrdgOnModules.txt
mgmtia -t -A -f ./names.sql > names.txt

The contents of allTeamAndBrdgOnModules.sql
Code:
SELECT
ipt_extension.extension,
ipt_expmodule_button.data2,
ipt_expmodule_button.number
FROM
ipt_extension
INNER JOIN ipt_station
ON ipt_extension.id = ipt_station.extension_id
INNER JOIN ipt_expmodule_button
ON ipt_station.id = ipt_expmodule_button.station_id
WHERE ipt_expmodule_button.type = 'team' or ipt_expmodule_button.type = 'brdg-appr';

and names.sql

Code:
SELECT
ipt_station.name,
ipt_extension.extension
FROM
ipt_extension
INNER JOIN ipt_station
ON ipt_extension.id = ipt_station.extension_id

then run script.sh

Code:
#!/bin/bash
input="/home/smgradmin/scripts/allTeamAndBrdgOnModules.txt"
while read line; do
user=`echo $line | sed 's/|.*//g'`
buttonnumber=`echo $line | sed 's/.*|//'`
realbutnum=`expr $buttonnumber + 1` 
otheruser=`echo $line | cut -c6- | sed 's/|.*//g'`
lastname=`cat names.txt|grep $otheruser|sed 's/|.*//g' |sed 's/,.*//'`
initial=`cat names.txt|grep $otheruser|sed 's/|.*//g'|sed 's/.*, //' |cut -c1-1`
if [[ "$realbutnum" < 10 ]]
then
  echo SBMLABEL0$realbutnum=$initial $lastname
else 
 echo SBMLABEL$realbutnum=$initial $lastname
fi
#echo $realbutnum
done < "$input"

That will print

Code:
root >sh script.sh 
SBMLABEL01=D Paul
SBMLABEL01=D Paul
SBMLABEL01=C 034
SBMLABEL2=C 034
SBMLABEL25=D Hyde
SBMLABEL26=D Hyde

Something's wrong with my bash script cause I'd expect SMBLABEL2=C 034 to be SMBLABEL02, but it works for SMBLABEL01

So what you really want is:
-Something that runs all the time
-Something that updates the label if it changes - like if 1111 has button 1 and 2 for 2222 and 3333 and for some reason you flipped that to be 3333 and 2222, the script should update it.

So I'd do something like grep SMBLABEL01 from $user_96xxdata.txt
If it the button label doesn't exist, echo the line to the end of $user_96xxdata.txt
If the button label is as it should be, leave it alone.
If the button label was there and changed, use sed to swap the new one we pulled from the SMGR db to overwrite the one in $user_96xxdata.txt

See ya in a couple of weeks. :p
 
Hey kyle555!

I got so busy completely forgot I asked about this, when I was the most excited to see what you had cooking. I was just sitting here and it donned on me!

Let me look into this and see if I can test it out and I'll report back.

And thank you so much for putting this together. I'll message soon!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top