These methods can help monitor the quality of the agents' work and availability.

1. The method for monitoring the online SIP accounts.

Required parameters for the request:

Node.js request example:

const https = require('https');
const config = {
host: 'api.ringostat.net',
path: '/sipstatus/online',
method: 'GET',
headers: {
'Auth-key': 'unique_auth_key_string'
}
};
const callback = response => {
let result = Buffer.alloc(0);
response.on('data', chunk => {
result = Buffer.concat([ result, chunk ]);
});
response.on('end', () => {
//handle response
});
};
const request = https.request(config, callback);
request.end();

Axios.js request example:

axios({
url: 'https://api.ringostat.net/sipstatus/online',
method: 'GET',
headers: {
'Auth-key': 'unique_auth_key_string'
}
}).then(response => {
//handle response
}).catch(error => {
//handle error
})

_cURL request example:

curl "https://api.ringostat.net/sipstatus/online" \
-H "Auth-key: unique_auth_key_string"

The result:

[
"supportrngst_manager1",
"supportrngst_manager2",
"supportrngst_manager3",
"supportrngst_manager4",
"supportrngst_manager5",
"supportrngst_manager6",
"supportrngst_manager7"
]

2. The method for monitoring the SIP account which participated in the call.

Required parameters for the request:

Node.js request example:

const https = require('https');
const config = {
host: 'api.ringostat.net',
path: '/sipstatus/speaking',
method: 'GET',
headers: {
'Auth-key': 'unique_auth_key_string'
}
};
const callback = response => {
let result = Buffer.alloc(0);
response.on('data', chunk => {
result = Buffer.concat([ result, chunk ]);
});
response.on('end', () => {
//handle response
});
};
const request = https.request(config, callback);
request.end();

Axios.js request example:

axios({
url: 'https://api.ringostat.net/sipstatus/speaking',
method: 'GET',
headers: {
'Content-Type': 'application/json; charset=utf-8',
'Auth-key': 'unique_auth_key_string'
}
}).then(response => {
//handle response
}).catch(error => {
//handle error
})

_cURL request example:

curl "https://api.ringostat.net/sipstatus/speaking" \
-H "Auth-key: unique_auth_key_string"

The result:

[
"supportrngst_manager2",
"supportrngst_manager4",
"supportrngst_manager5",
"supportrngst_manager7"
]

Did this answer your question?