# qrelate

> Pipeline Correlation Module for HSP CDRs

Latest version **1.0.9** (published 2018-05-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install qrelate
pnpm add qrelate
yarn add qrelate
bun add qrelate
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2018-05-21 |
| First published | 2018-04-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 12 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Lorenzo Mangani |
| Maintainers | lmangani |

## Links

- npm: https://www.npmjs.com/package/qrelate
- Repository: https://github.com/QXIP/qrelate
- Homepage: https://github.com/QXIP/qrelate#readme
- Issues: https://github.com/QXIP/qrelate/issues
- npm.io page: https://npm.io/package/qrelate

## Dependencies (2)

- [safe-regex](https://npm.io/package/safe-regex.md) ^1.1.0
- [record-cache](https://npm.io/package/record-cache.md) ^1.1.0

## Recent versions

- 1.0.9 (latest) — 2018-05-21
- 1.0.6 — 2018-05-20
- 1.0.4 — 2018-05-06
- 1.0.2 — 2018-04-10
- 1.0.0 — 2018-04-09

## 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

---
_Source: https://npm.io/package/qrelate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
