Francois's picture

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


__________________


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

The code that does this is

KodaK's picture

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.

Francois's picture

Thanks, I will try it.


I checked the code. Any idea

Francois's picture

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


I found the edit line here:

Francois's picture

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?


Sort Option is in /etc/amportal.conf

davepearson1628's picture

look for FOPSORT=extension

You can change it to

FOPSORT=lastname

Regards,
Dave.


It looks like there's

KodaK's picture

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

fskrotzki's picture

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.