Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support sip_parent_callid #12

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 12
- name: Install Docker Compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
- run: npm install
- run: npm run jslint
- run: npm test
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const schemas = {
from: Influx.FieldType.STRING,
to: Influx.FieldType.STRING,
sip_callid: Influx.FieldType.STRING,
sip_parent_callid: Influx.FieldType.STRING,
sip_status: Influx.FieldType.INTEGER,
duration: Influx.FieldType.INTEGER,
terminated_at: Influx.FieldType.INTEGER,
Expand Down Expand Up @@ -734,7 +735,7 @@ module.exports = (logger, opts) => {
if (typeof opts === 'string') opts = {host: opts};
assert(opts.host);

const cdrClient = new Influx.InfluxDB({database: 'cdrs', schemas: schemas.cdr, ...opts});
const cdrClient = new Influx.InfluxDB({database: 'cdrs', schemas: schemas.cdrs, ...opts});
const alertClient = new Influx.InfluxDB({database: 'alerts', schemas: schemas.alerts, ...opts});
const callCountClient = new Influx.InfluxDB({database: 'call_counts', schemas: schemas.call_counts, ...opts});
const callCountSPClient = new Influx.InfluxDB({database: 'sp_call_counts', schemas: schemas.sp_call_counts, ...opts});
Expand Down
3 changes: 3 additions & 0 deletions test/unit-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ test('write timeseries data', async(t) => {
from: 'me',
to: 'you',
sip_callid: 'foo@127.0.0.1',
sip_parent_callid: 'foo2@127.0.0.1',
answered: true,
duration: 22,
attempted_at: new Date(Date.now() - (3600 * 1000)),
Expand All @@ -41,6 +42,7 @@ test('write timeseries data', async(t) => {
from: 'me2',
to: 'you2',
sip_callid: 'foo@127.0.0.1',
sip_parent_callid: 'foo2@127.0.0.1',
answered: false,
duration: 20,
attempted_at: new Date(Date.now() - (7200 * 1000)),
Expand All @@ -61,6 +63,7 @@ test('write timeseries data', async(t) => {
result = await queryCdrs({account_sid: 'xxxx', page: 1, page_size:25});
//console.log(JSON.stringify(result));
t.ok(result.data.length === 1, 'queried cdrs by account sid');
t.ok(result.data[0].sip_parent_callid === 'foo2@127.0.0.1', 'sip_parent_callid successfully added');

result = await queryCdrs({account_sid: 'xxxx', filter: 'a', page: 1, page_size:25});
t.ok(result.data.length === 0, 'queried cdrs by from');
Expand Down
Loading