generateIdentityHeader()
method used for generating the Identity
header using the supplied parameters.AGIStirShakenServer
class that creates an Asterisk AGI server instance that will attest to and sign calls automaticallyhttps://gibme-npm.github.io/stir-shaken/
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
);
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();
})()