https://github.com/qxip/qrelate
Pipeline Correlation Module for paStash
https://github.com/qxip/qrelate
Last synced: 26 days ago
JSON representation
Pipeline Correlation Module for paStash
- Host: GitHub
- URL: https://github.com/qxip/qrelate
- Owner: QXIP
- Created: 2018-04-05T20:56:12.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-21T22:05:27.000Z (about 8 years ago)
- Last Synced: 2025-02-13T21:37:45.779Z (over 1 year ago)
- Language: JavaScript
- Homepage: http://hepic.tel
- Size: 18.6 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# qrelate
Short-Term memory pipeline correlation module
## About
This module was designed for [paStash](https://github.com/sipcapture/pastash) In-Line CDR correlation
## Setup
```
npm install --save qrelate
```
### Functions
* `key`: Key name to extract value from
* `suffix`: Extend with suffix
* `prefix`: Extend with prefix
* `regex`: Replace using regex
* `regex_match`: Match using regex
* `name`: Store using name
* `inject`: Inject header on correlation
* `score`: Score to assign for a match
### Parameters
* `maxSize`: max number of items in LRU
* `maxAge`: max age in ms for items in LRU
* `treshold`: correlation treshold score
* `uuid`: correlation identifier key
#### Usage
```javascript
const qrelate = require('qrelate');
// Set Cache
qrelate.params('maxSize',5000); // max number of items in LRU
qrelate.params('maxAge',5000); // max age of items in LRU
qrelate.params('threshold',99); // correlation threshold score
qrelate.params('uuid','uuid'); // correlation identifier key
// Set Vectors
const vectors = [
{ score: 100, key: 'callid', suffix: "_b2b-1" },
{ score: 100, key: 'correlation_id', name: 'callid', inject: 'x-cid' },
{ score: 50, key: 'ruri_user', regex: /^(00|\+)/ },
{ score: 50, key: 'from_user', regex: /^(00|\+)/ }
{ score: 50, key: 'to_user', name: "last8dig", regex_match: /.{8}$/ }
];
qrelate.vectors(vectors);
```
#### (C) 2018 QXIP BV