[asterisk-gui] How to call custom Macros with Astersk GUI 2.0 ?

Pari Nannapaneni pari at digium.com
Fri Oct 17 10:03:56 CDT 2008


Hi David,

fixed as suggested in method 2

check out branches/2.0 -r3961 or above
thanks for bringing up the issue,

Pari


----- Original Message -----
From: "David Kerr" <David at Kerr.net>
To: "bkruse" <bkruse at digium.com>, "Asterisk GUI project discussion" <asterisk-gui at lists.digium.com>
Sent: Sunday, October 5, 2008 2:44:40 PM GMT -06:00 US/Canada Central
Subject: Re: [asterisk-gui] How to call custom Macros with Astersk GUI 2.0 ?

I'm not very interested in creating a custom GUI just for myself. I would rather see bugs fixed so that I could use the GUI. Take the example cited above... adding "context=xxxx" into queues.conf 

There are a couple of approaches to fixing this. 

1) Modify the GUI to add the ability to specify a context for a queue. This would be a fairly easy fix, but very specific to context=.... it would not address any other statements that might be added through the file editor. 

2) Or, you could get to the heart of the problem and fix the GUI so that it doesn't blast away user edits. The route of the problem is this sequence of calls in queues.html 
var x = new listOfActions('queues.conf'); 
x.new_action('delcat', cat, '', ''); 
x.new_action('newcat', cat, '', ''); // create new context 
x.new_action('append', cat, 'fullname', ASTGUI.getFieldValue(DOM_edit_label)); 
x.new_action('append', cat, 'strategy', ASTGUI.getFieldValue(DOM_edit_strategy)); 
x.new_action('append', cat, 'timeout', ASTGUI.getFieldValue(DOM_edit_timeout)); 
x.new_action('append', cat, 'wrapuptime', ASTGUI.getFieldValue(DOM_edit_wrapuptime)); 
x.new_action('append', cat, 'autofill', ASTGUI.getFieldValue(DOM_edit_autofill)); 
x.new_action('append', cat, 'autopause', ASTGUI.getFieldValue(DOM_edit_autopause)); 
x.new_action('append', cat, 'joinempty', ASTGUI.getFieldValue(DOM_edit_joinempty)); 
x.new_action('append', cat, 'leavewhenempty', ASTGUI.getFieldValue(DOM_edit_leavewhenempty)); 
x.new_action('append', cat, 'reportholdtime', ASTGUI.getFieldValue(DOM_edit_reportholdtime)); 
x.new_action('append', cat, 'maxlen', ASTGUI.getFieldValue(DOM_edit_maxlen)); 
x.new_action('append', cat, 'musicclass', ASTGUI.getFieldValue(DOM_edit_musicclass)); 

See how it starts with 'delcat'... that deletes everything in the category, then it creates a new one then appends all the settings entered in the GUI. Now I have not tested anything, but it would seam possible to check whether the "cat" already exists. If not then create it, else don't. Then use the 'update' parameter on new_action rather than 'append'. 

In either case, It would be better implemented in the master source. I suppose I could take a stab at coding a fix (but I'm not a javascript programmer, but fast learner) and then give it to you for consideration. 

Regards 
David 




More information about the asterisk-gui mailing list