Hello all,
Does Asterisk support playing the multiple files with dynamic variable play.
Problem Statement:
During IVR call we play voice file like “Press-one-to-continue-in-english”
for multiple files we combine the files with delimiter ^
file1^file2
Requirement is to play the file with some dynamic variable
Example “today-is” + “25112024”
so i want resultant to be today is 25th november 2024
Another example is “Press one for account number ending with 1234”
here 1234 will be dynamic but it should speak these files when we use speech input
Grammer commands are:
static getGrammarCommand(data) {
const { speechGrammar, lang, profileName, file } = data;
// we have keypad input and peech input for digit input, option input ad amount input.
// we define the grammar in double quotes and after that we define the options for it.
// we have defined "\\\"builtin:grammar/digits,builtin:dtmf/digits,builtin:grammar/ccexpdate\\\",
// because it is considered as "builtin:grammar/digits,builtin:dtmf/digits,builtin:grammar/ccexpdate" at asterisk server
switch (speechGrammar) {
case SpeechInputUtil.SPEECH_INPUT.ASR_DIGIT_GRAMMAR:
return `"\\\"builtin:grammar/digits,builtin:dtmf/digits,builtin:grammar/ccexpdate\\\",spl=${lang}-US&nit=10000&t=50000&b=1&dttc=#&sint=5000&p=${profileName}&f=${file}&plt=0"`;
case SpeechInputUtil.SPEECH_INPUT.ASR_ALPHA_NUM_GRAMMAR:
return `"builtin:grammar/alphanum_lc",spl=${lang}-US&nit=10000&t=50000&sva=0.8&b=1&dttc=#&sint=5000&p=${profileName}&f=${file}&plt=0`;
case SpeechInputUtil.SPEECH_INPUT.ASR_CURRENCY_GRAMMAR:
return `"\\\"builtin:dtmf/currency,builtin:grammar/currency\\\",spl=${lang}-US&nit=10000&t=50000&b=1&dttc=#&sint=5000&p=${profileName}&f=${file}&plt=0"`;
case SpeechInputUtil.SPEECH_INPUT.ASR_OPTIONS_GRAMMAR:
return `"\\\"builtin:grammar/digits,builtin:dtmf/digits,/etc/asterisk/grammar/dtmf_pound.xml,/etc/asterisk/grammar/${lang}-US/options.xml\\\",spl=${lang}-US&nit=10000&t=50000&sva=0.6&b=1&sint=5000&p=${profileName}&f=${file}&plt=0"`;
default:
//do nothing
return "";
}
}
Here f paramter takes file in the format file1^file2^file3