Thursday, 28 February 2019

Originate a call with text to speech message

I use the Asterisk-Manager package for NodeJs

https://www.npmjs.com/package/asterisk-manager

and have a tape announcement as a text which must be translated via text to speech. When I try to call an outgoing phone number how can I setup the text to speech variable and the recipient? An example would be

ami.action({
    'action': 'originate',
    '??? phonenumber ???': '12345',
    '??? text to be spoken ???': 'Hello, this is a tape announcement'
  }, (err, res) => {
    if (err) {
        throw err;
    }

    console.log('everything was fine');
  });


Edit:

I know that FreePbx is used for administration. As far as I know there is a TTS module for the Asterisk engine.

I think I could go for this code

const { phoneNumber, announcement } = phoneInfo; // the required data

ami.action({
    channel: `SIP/${phoneNumber}`,
    application: 'SendText',
    data: announcement
}, (err, res) => {
    if (err) {
      throw err;
    }

    console.log(res);
});

and the engine would manage the data property



from Originate a call with text to speech message

No comments:

Post a Comment