Sort Operator Panel Alphabetically

Hi,

One of my clients wants to know if it is possible to sort the Operator Panel alphabetically. So instead of the extension numbers in numeric order, it should sort the names rather.

Is this possible?

I appreciate the help.

Thanks
Francois

The code that does this is in the file:

retrieve_op_conf_from_mysql.pl which is usually in the directory:

/var/lib/asterisk/bin

You can modify the code to alphabetize in there. There are a couple of drawbacks: 1) if you can’t program it can be difficult and 2) upgrades to FreePBX will overwrite it.

But it can be done.

Thanks, I will try it.

I checked the code. Any idea what i need to change? :stuck_out_tongue:

I found the edit line here:

sort the extensions
if (defined($sortoption) && ($sortoption eq “lastname”)) {
@extensionlist=sort by_lastname @extensionlist;
} else {
@extensionlist=sort {$a->[1] cmp $b->[1]}(@extensionlist);

Anybody knows what a - z sort options might be?

It looks like there’s already an option to sort by last name, it’s just a matter of finding where that option is defined.

This might be helpful to you:

http://perldoc.perl.org/functions/sort.html

HTH.

Read the code for a bit and you’ll figure it out. It defines sortoption by reading it from a config file at the top. Which will tell you which config file and exact option name it is called.

It is also clearly documented in the config file when you look for it.

look for FOPSORT=extension

You can change it to

FOPSORT=lastname

Regards,
Dave.