Ordering of extensions

Hi all,

Would just like to open by saying how great FOP2 is. Our company have purchased and deployed multiple licenses and have not encountered any difficulties with it so far.

The latest one we have been setting up and demoing for a customer however did raise an interesting query.

Is it possible to order the buttons in an arbitrary manner? I have tried reordering the extensions in the following way in the config:
[SIP/100]
type=extension
label=Alan 
extension=100 
context=extensions 


[SIP/102]
type=extension
label=Bob 
extension=102 
context=extensions 


[SIP/101]
type=extension
label=Charlie 
extension=101 
context=extensions

I was hoping that this order would be preserved but it appears to order the extensions numerically.

Ultimately, we would like to order extensions alphabetically by their labels.

I couldn't see any information in the docs[/url:35g6acjt] regarding this.

Am I overlooking something or is this not possible without a feature request?

Thanks in advance.

Comments

  • Hello,

    If you do a manual configuration, the extension order is preserved (first come, first served basis). So, the sample that you posted must work (unless you still have the #exec line at the end that overwrites your button configuration and instead used the output from the executed script).

    So, in the case of using auto configuration for freepbx, you can play with button order by tweaking at the autoconfiguration scripts themselves. For buttons the script is autoconfig-buttons-freepbx.sh, it is kind of a complex script because it checks for fop2admin module or not, and if you are on user and device mode or not, and uses different mysql queries to get button configuration for each case. If you look at the first big mysql query (fop2admin, non user and device mode) you can change the order by clause to be

    ORDER BY type,label

    instead of

    ORDER BY type,(exten+0)

    Best regards,
  • Hi Nicolas,

    Thanks for your prompt response. You pointed me in the correct direction regarding your FIFO ordering.

    I managed to get it sorted - we are using an included configuration file rather than a script such as your freepbx bash script.

    My problem was that I was simply restarting fop2 and not refreshing the fop2 web page. I incorrectly assumed that the button layout would update but understandably the DOM content doesn't change until a page refresh.

    Thanks ever so much for your help.
Sign In or Register to comment.