kod-temp
Version:
Workano Communications SDK
18 lines (17 loc) • 550 B
JavaScript
export default ((client, baseUrl) => ({
action: (action, args = {}) => client.post(`${baseUrl}/action/${action}`, args),
getAors: async (endpoint) => {
try {
const rawEvents = await client.post(`${baseUrl}/action/PJSIPShowEndpoint`, {
Endpoint: endpoint,
}) || [];
if (!rawEvents) {
return [];
}
return rawEvents.filter((event) => event.Event === 'ContactStatusDetail');
}
catch {
return [];
}
},
}));