Risto, I promise to do so!
Thanks again for your generous help, and for this amazing piece of software. -- Jim Van Meggelen ClearlyCore Inc +14166396001 ________________________________ From: Risto Vaarandi <risto.vaara...@gmail.com> Sent: Friday, April 1, 2022 06:50 To: Jim Van Meggelen Cc: simple-evcorr-users Subject: Re: [Simple-evcorr-users] Parsing Asterisk log files for downstream reporting - so far so good! hi Jim, it is great to hear that the rule example was useful! As for supporting the project, the best way of doing it is to post interesting questions to the mailing list :) The discussions in the mailing list will be helpful for all the subscribers, and will also provide new ideas for further development of SEC. kind regards, risto Risto, > > I tried that out and it looks to be doing what it should! > > Thank you so much for generously taking your time to help me with this. > I'm still trying to wrap my head around how contexts and descriptions and > such connect it all together, but I am learning! > > Is there some way I can support the project by way of thanks? > > Warm regards and thanks again. Aitäh! > > Jim > > -- > Jim Van Meggelen > ClearlyCore Inc. > > > > +1-416-639-6001 (DID) > +1-877-253-2716 (Canada) > +1-866-644-7729 (USA) > +1-416-425-6111 x6001 > jim.vanmegge...@clearlycore.com > http://www.clearlycore.com > > > *Asterisk: The Definitive GuideFIFTH EDITION NOW AVAILABLE TO DOWNLOAD:* > https://cdn.oreillystatic.com/pdf/Asterisk_The_Definitive_Guide.pdf > > ------------------------------ > > *From: *"Risto Vaarandi" <risto.vaara...@gmail.com> > *To: *"Jim Van Meggelen" <jim.vanmegge...@clearlycore.com> > *Cc: *"simple-evcorr-users" <simple-evcorr-users@lists.sourceforge.net> > *Sent: *Thursday, 31 March, 2022 12:50:46 > *Subject: *Re: [Simple-evcorr-users] Parsing Asterisk log files for > downstream reporting - so far so good! > > hi Jim, > > if you want to match the "ActivationHelp" event and react to the earliest > "User entered" event, provided that these events share the same caller ID, > you could use the following rule: > > type=PAIR > desc=IVR caller $4 offered activation or statement inquiry > ptype=RegExp > action= write - $4 activation or statement inquiry offered > pattern=^.*\[(20[234][0-9]-[0-9]{2}-[0-3][0-9])-([0-2][0-9]:[0-5][0-9]:[0-5][0-9]).*VERBOSE\[([0-9]{3,6})\]\[(C-[0-9a-f]{8})\].*Executing > \[(.+)\@(ivr-welcome:[0-9]{1,3})\] (.+)\(\"([A-Z]{3,10})\/(.+)\", > \"ActivationHelp,prompts.* > ptype2=regexp > rem=pattern2=^.*\[(20[234][0-9]-[0-9]{2}-[0-3][0-9])-([0-2][0-9]:[0-5][0-9]:[0-5][0-9]).*VERBOSE\[([0-9]{3,6})\]\[(C-[0-9a-f]{8})\].* > app_read.c: User entered '?(nothing|[0-9]*)'?.* > pattern2=^.*\[(20[234][0-9]-[0-9]{2}-[0-3][0-9])-([0-2][0-9]:[0-5][0-9]:[0-5][0-9]).*VERBOSE\[([0-9]{3,6})\]\[($4)\].* > app_read.c: User entered '?(nothing|[0-9]*)'?.* > desc2=Flexiti IVR - caller selection at activation or statement inquiry > action2=assign %p flexity; \ > assign %i -ivr ; \ > write %p%i.csv $1,$2,$4,,,,,,,,,$5 ; closef %p%i.csv ; \ > write - $4 ACTIVATION_STATEMENT %p %i $1 User entered: $5 > window=10800 > > Let me also explain the changes I have made in the original version: > > 1) in the 'pattern' field, I have replaced "flexity-ivr-welcome" with > "ivr-welcome", so that the example events would be properly matched. Also, > I have set %p in the 'action2' field, since this variable was originally > used without a value. > > 2) the 'desc' field of the rule has been set to the string 'IVR caller $4 > offered activation or statement inquiry'. Since the value of the 'desc' > field determines the ID of the event correlation operation, the presence of > the $4 variable (corresponds to the caller ID) in the 'desc' field ensures > that the rule will start a separate Pair operation for each distinct caller > ID. That will prevent situations where there is only one operation that > mistakenly reacts to "ActivationHelp" and "User entered" events for > different caller ID's. > > 3) in the 'pattern2' field, "\[(C-[0-9a-f]{8})\]" has been replaced with > "\[($4)\]". The use of $4 variable in 'pattern2' field allows for narrowing > the regular expression match to the particular caller ID you are expecting > to see. For instance, after seeing the event > > [2022-02-08-06:18:01:] VERBOSE[24858][C-00004037] pbx.c: Executing > [8005551234@ivr-welcome:34] Read("SIP/CHANNELNAME-000138ac", > "ActivationHelp,prompts/902&prompts/063,1,,,15,") in new stack > > the Pair operation is started which expects another event matching the > following regular expression (note that $4 has been replaced with the > caller ID from the previous event): > > ^.*\[(20[234][0-9]-[0-9]{2}-[0-3][0-9])-([0-2][0-9]:[0-5][0-9]:[0-5][0-9]).*VERBOSE\[([0-9]{3,6})\]\[(C\-00004037)\].* > app_read.c: User entered '?(nothing|[0-9]*)'?.* > > Without this modification to 'pattern2', the regular expression would > match the "User entered" event for *any* caller ID (that is probably not > what you want). > > 4) I have also set the "window" parameter to 3 hours (10800 seconds) -- if > for some reason you would never be seeing "User entered" event for the > given caller ID, the Pair operation will not exist forever but will rather > time out after 3 hours. > > 5) If there is a chance of not seeing the "User entered event", you can > also utilize the following Single rule after the Pair rule for terminating > the hanging Pair operation when the call is ended: > > type=Single > ptype=RegExp > pattern=^.*\[(20[234][0-9]-[0-9]{2}-[0-3][0-9])-([0-2][0-9]:[0-5][0-9]:[0-5][0-9]).*VERBOSE\[([0-9]{3,6})\]\[(C-[0-9a-f]{8})\].*pbx\.c: > Spawn extension \(.*\) exited non-zero on.* > desc=End of call for caller $4 > action=reset -1 IVR caller $4 offered activation or statement inquiry > > Note that the first parameter of the 'reset' action (-1) indicates that an > event correlation operation started by the previous rule (i.e., the Pair > rule) has to be terminated. And the second parameter "IVR caller $4 offered > activation or statement inquiry" provides the ID of this operation (in > other words, whenever a call with some ID has ended, we will be terminating > the Pair operation for this call ID). Also, if this Pair operation does not > exist for the given call ID (maybe because the ActivationHelp event was > never seen for this particular call), the 'reset' action is a no-op. > > However, if you are absolutely confident that the "User entered" event > always occurs after "ActivationHelp", you don't need the above Single rule. > > Does this solution work for you? I hope I understood the problem > description correctly, and if there are any other questions or something > that needs improvement, feel free to ask. > > kind regards, > risto > > > Risto, >> >> Absolutely. >> >> The following pattern should catch it: >> >> ^.*\[(20[234][0-9]-[0-9]{2}-[0-3][0-9])-([0-2][0-9]:[0-5][0-9]:[0-5][0-9]).*VERBOSE\[([0-9]{3,6})\]\[(C-[0-9a-f]{8})\].* >> pbx.c: Spawn extension \(.*\) exited non-zero on.* >> >> >> Here's a few lines leading up to it (interesting because here is a Read() >> operation where the caller does not make a choice but instead hangs up >> while the system is waiting for a response): >> >> [2022-02-08-06:21:22:] VERBOSE[24858][C-00004037] pbx.c: Executing >> [8005551234@ivr-MainMenu:45] Read("SIP/CHANNELNAME-000138ac", >> "BalanceRepeatPressed,prompts/004h&prompts/004i&prompts/043,1,,,15") in new >> stack >> [2022-02-08-06:21:22:] VERBOSE[24858][C-00004037] app_read.c: Accepting a >> maximum of 1 digits. >> [2022-02-08-06:21:22:] VERBOSE[24858][C-00004037] file.c: >> <SIP/CHANNELNAME-000138ac> Playing 'prompts/004h.slin' (language 'en') >> [2022-02-08-06:21:25:] VERBOSE[24858][C-00004037] file.c: >> <SIP/CHANNELNAME-000138ac> Playing 'prompts/004i.slin' (language 'en') >> [2022-02-08-06:21:28:] VERBOSE[24858][C-00004037] file.c: >> <SIP/CHANNELNAME-000138ac> Playing 'prompts/043.slin' (language 'en') >> [2022-02-08-06:21:33:] VERBOSE[24858][C-00004037] app_read.c: User >> disconnected >> [2022-02-08-06:21:33:] VERBOSE[24858][C-00004037] pbx.c: Executing >> [h@ivr-MainMenu:1] NoOp("SIP/CHANNELNAME-000138ac", "Hangup handler >> GlobalCallCount=0 CHANNELNAME=0 ") in new stack >> [2022-02-08-06:21:33:] VERBOSE[24858][C-00004037] pbx.c: Executing >> [h@ivr-MainMenu:2] NoOp("SIP/CHANNELNAME-000138ac", "SurveyType is ") in >> new stack >> [2022-02-08-06:21:33:] VERBOSE[24858][C-00004037] pbx.c: Executing >> [h@ivr-MainMenu:3] ExecIf("SIP/CHANNELNAME-000138ac", "1?Hangup()") in >> new stack >> *[2022-02-08-06:21:33:] VERBOSE[24858][C-00004037] pbx.c: Spawn extension >> (ivr-MainMenu, h, 3) exited non-zero on 'SIP/CHANNELNAME-000138ac'* >> >> >> >> -- >> Jim Van Meggelen >> ClearlyCore Inc. >> >> >> >> +1-416-639-6001 (DID) >> +1-877-253-2716 (Canada) >> +1-866-644-7729 (USA) >> +1-416-425-6111 x6001 >> jim.vanmegge...@clearlycore.com >> http://www.clearlycore.com >> >> >> *Asterisk: The Definitive GuideFIFTH EDITION NOW AVAILABLE TO DOWNLOAD:* >> https://cdn.oreillystatic.com/pdf/Asterisk_The_Definitive_Guide.pdf >> > >
_______________________________________________ Simple-evcorr-users mailing list Simple-evcorr-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users