@gibme/stir-shaken
v20.0.1
Published
STIR/SHAKEN CallerID Attestation & Call Signing
Downloads
107
Maintainers
Readme
STIR/SHAKEN CallerID Attestation & Call Signing
Features
generateIdentityHeader()method used for generating theIdentityheader using the supplied parameters.AGIStirShakenServerclass that creates an Asterisk AGI server instance that will attest to and sign calls automatically- Auto formats caller ID and called numbers into E.164 format when signing
Documentation
https://gibme-npm.github.io/stir-shaken/
Sample Signing
import { generateIdentityHeader } from '@gibme/stir-shaken';
const header = generateIdentityHeader(
'5678675309', // caller id
'8004444444', // called number
'8935da48-d9d5-4fff-ae99-2753bb9b034b', // the unique call ID
'C', // the attestation level
'https://my.domain/certificate.pem', // the publicly accessible URL with the STI certificate
'<private_key_for_certificate>' // the certificate private key
);Simple Server
import { AGIStirShakenServer } from '@gibme/stir-shaken';
(async () => {
const server = new AGIStirShakenServer({
port: 9000,
certificatePath: './certificate.pem',
privateKeyPath: './privatekey.pem',
publicCertificateURL: 'https://my.domain/certificate.pem',
attestationProvider: callerId => {
// do some checks and return an attestation level
return 'C';
},
logger: entry => {
console.log(entry);
}
});
await server.start();
})()