I wandered over here from the IPT forum because my initial query has changed somewhat.
I need to run an EEM script which will collect the output of show call active voice brief with the appropriate pipes such as PID: and dur 00:30: where I am looking for the call leg id and the duration of the call and when found, string them together.
The flow would look like this:
show call active voice brief | PID:100|dur 00:30:
1A31 : 4294 186160660ms.1 +20 pid:100 Answer 073333333 connected
dur 00:30:57 tx:1725/275682 rx:1984/300436
1A38 : 4301 186176310ms.1 +17410 pid:200 Originate 033333333 active
dur 00:30:01 tx:1228/196480 rx:2093/334880
Then somehow, which I am still trying to do, parse the output into a variable and string the two lines each containing PID and dur into one, then a regexp to extract the call leg id into a variable and clear the call. This would work on a loop until the variable was empty.
Edit: I just thought of something... I will also get calls that are of a shorter duration than 00:30 because of the PID being 100? That is what lack of sleep does to you. Any better ideas of doing it.
Much easier. This EEM policy should do what you want. It is untested as I do not have a voice setup.
The script is self-contained. It's a proof of concept. If you run it, it should provide you with correct results given the static input. The point is, if you plug in the algorithm into another script (which sets the output variable to the actual content to parse) it will do the right thing.