TNGBuffer CLI rules

Web based, multi-user, Telephone Management System with budget management and barring control

Moderators: Leon van Heerden, Lee Hendricks, Luanda_Junzi, Belinda Frick

TNGBuffer CLI rules

Postby Leon van Heerden » Thu Apr 16, 2015 1:23 pm

These are the CLI rules that can be used in the TNGBuffer util that captures rawdata from multiple PABXs.

The CLI rules can change call detail records. Each part of a call detail record is called a field. There are many fields (e.g. extension, number, username, trunk, etc.) in a record. Only some of them can be changed.

CLI rules consist of the following parts:
  1. Field to check
  2. Type of match
  3. Value1 to look for
  4. Action
  5. Value2
  6. Stop
  7. Direction

  1. Field to check - the field to be matched, a rule can only have one field. Values are:
    EXTENSION - match on extension
    NUMBER - match on number
    TRUNK - match on trunk
  2. Type of match - how the rule will find the records to change
    STARTS WITH - match if the field starts with value1
    ENDS WITH - match if the field ends with value1
    CONTAINS - match if the field contains value1
    DOES NOT CONTAIN - match if the field does not contain value1
    ALWAYS MATCH - rules with this type of match execute for every record
    LENGTH GREATER THAN - if the field length is greater than value1 - value1 is a number in the range 0 to 255
    LGT - short for LENGTH GREATER THAN
    LENGTH LESS THAN - if the field length is less than value1 - value1 is a number in the range 0 to 255
    LLT – short for LENGTH LESS THAN
  3. Value1 to look for - what is matched or not matched or the length, depending on the type of match
  4. Action what to do when the Value1 Matches
    IGNORE - makes no modifications - you can use ignore with action "STOP" set to "TRUE" to do nothing and stop other rules from processing.
    REPLACE WITH - replaces the matched value with value2.
    REPLACEWITH - same as "REPLACE WITH"
    REPLACEALL - replaces all occurrences of value1 with value2, usually used with match "CONTAINS" or "ALWAYS MATCH"
    REPLACEFIELD - replaces the entire field with value2.
    DELETE - removes the matched value (value2 is not used).
    DELETECOUNT - deletes x number of characters starting at the matched position. value2 is the number x.
    DELETEALL - clears the entire field (value2 is not used) - same as REPLACEFIELD with nothing in value2.
    DELETEBEFORE - deletes x characters before the match. Value2 is the number x. x can be larger than the number of characters before the match. For example, a rule to delete 8 characters before the hash from "01234#0215924033" would delete only the first 5 before the hash. Note that the # would be left in the field. DELETECOUNT is the corresponding DELETEAFTER action – use “DELETECOUNT” and not “DELETEAFTER”.
    ADD TO START - adds value2 in front of the field. Note that the matched position does not matter.
    ADD TO END - adds value2 after the field. Note that the matched position does not matter.
    DELETERECORD - instructs the software to delete this record. Usually the software will log this.
    REJECT - instructs the software to reject this record. Usually the software will log this.
    PREFIX - same as ADD TO START, but the value prefixed can be from a lookup table if value2 = "<lookup>". Value1 will be used as the key to the lookup, and the result from the lookup will be prefixed to the field.
  5. Value2 - what to use as replacement / add / count / prefix / suffix.
  6. Stop - if TRUE, when this rule matches, the rules after this will not process. Values can be:
    TRUE
    FALSE
  7. Direction - will only match records that have the matching direction. Values can be:
    INCOMING
    OUTGOING
    ANY


Examples

0=EXTENSION|STARTS WITH|27319293700|REPLACE WITH|0319293700|TRUE|ANY|
1=EXTENSION|STARTS WITH|319293700|REPLACE WITH|0319293700|TRUE|ANY|
2=Number|starts with|00|REPLACE|0|False|OUTGOING|
3=Extension|length less than|3|reject||False|ANY|
4=Extension|length greater than|5|reject||False|ANY|
5=Extension|starts with|*|reject||False|ANY|
6=Extension|starts with|0|reject||False|ANY|
----
Leon van Heerden
http://www.datatex.co.za
Leon van Heerden
 
Posts: 315
Joined: Fri Oct 29, 2010 11:21 am
Location: Cape Town

Re: TNGBuffer CLI rules

Postby John Richard Procter » Fri Aug 05, 2016 10:15 am

Please NOTE:
Remove checktes from the cron as it will start a duplicate copy of the application.
John Richard Procter
 
Posts: 552
Joined: Tue May 03, 2011 2:02 pm

Re: TNGBuffer CLI rules

Postby Leon van Heerden » Tue Jun 11, 2019 4:35 pm

Voipsweeper can also check the USERNAME field.
----
Leon van Heerden
http://www.datatex.co.za
Leon van Heerden
 
Posts: 315
Joined: Fri Oct 29, 2010 11:21 am
Location: Cape Town


Return to TNG

Who is online

Users browsing this forum: No registered users and 0 guests

cron