Gather({ action: `${functionurl}?step=processdata&encryptedcarddigits=${encryptedcarddigits}`, method: 'post', input: 'dtmf', timeout: 10, numdigits: 4, }); gather.say('please enter your unique 4 digit identification number'); return gather } const processgathereddata = async (twiml, encryptedcarddigits, encryptedpindigits, dummy_url) => { // make request to "dummy" api endpoint - example decrypt function try { const apiresponse = await axios({ method: 'post', url: dummy_url, data: { encryptedcarddigits, encryptedpindigits } }) twiml.
Say(`thank you. Your account number is singapore mobile number list ${apiresponse.data.account} and your balance is ${apiresponse.data.balance}`) } catch (e) { twiml.say(`we were not able to locate you in our system. Goodbye.`) } return twiml } set its visibility to “protected” as it will be called from twilio and protected with the x-twilio-signature header . When implementing this solution in production, you will need to replace the decryption variable "dummyapi" with the url of your backend service.
Const dummyapi = `https://${context.domain_name}/decrypt-gather` how does encryption work? Start by importing the functions created in the previous step with the following line: javascript copy the code const aes = require(runtime.getfunctions()['aes'].path) then set your secret key by retrieving it from the environment variable : secret_key = context.aes_secret the important thing is that all sensitive information is protected by the encrypt function .
javascript copy the code const
-
- Posts: 19
- Joined: Sun Dec 22, 2024 4:29 am