[Asterisk-Users] Changes to manager outputs - A discussion
Asterisk
asterisk at dotr.com
Tue Jan 11 15:57:09 MST 2005
I am currently writing a prototype agent monitoring system, which (as
most others in question) simply monitors the output from the event
system, and displays the relevant information. I would hope to donate
this back to the community once it works properly :)
However, I feel that it would be more useful for the manager output to
be tab delimited, one record per line:
i.e. instead of
Event: Agents
Agent: 6038
Name: A User
Status: AGENT_LOGGEDOFF
LoggedInChan: n/a
LoggedInTime: 0
TalkingTo: n/a
Event: Agents
Agent: 6039
Name: An Other
Status: AGENT_LOGGEDOFF
LoggedInChan: n/a
LoggedInTime: 0
TalkingTo: n/a
I would prefer to see the following format:
Event~tAgents~t1~t6038~tA User~tAGENT_LOGGEDOFF~tn/a~t0~tn/a
Event~tAgents~t1~t6039~tAn Other~tAGENT_LOGGEDOFF~tn/a~t0~tn/a
Where ~t is a tab character, and the layout starts
Type~tName~tVersion~tData
Version is the version number of the data layout for the Agents Event.
For version 1 we have
AgentNum/Name/Status/LoggedinChan/LoggedinTime/Talkingto
This allows us to add further fields to the record as and when required
and not break any existing code in the field.
In my mind, (yes, a small one compared to the giants walking around
here) There are several advantages in this method:
a) Parsing one line of data per record is in order of magnitude easier
to code.
b) As mentioned, further fields can be added at any time without
breaking code
c) output can be exported directly into spreadsheets
d) It is very easy to skip records that you are not interested in - If
field 2 is not "Agents" then ignore
In order not to break existing code, we could provide a flag or setting
to determine which output format to use: further more we could slowly
update all of the manager events until they are all available in old and
new formats.
I know that perhaps I've talked a load of BS - I would appreciate it if
people could comment on this before I head up a blind alley. I feel that
it would be more useful and easier for us as developers if there were a
common event manager layout, rather than a fixed number of lines per
action type / event type, and one that follows a more common data /
record layout.
Please feel free to comment / flame whatever.
exten => 999,n,GetFlameSuit(MaxStrength)
exten => 999,n,WearFlameSuit(MaxStrength)
exten => 999,n,HoldBreathAndWaitToBeFlamedBigTime()
Julian.
More information about the asterisk-users
mailing list