09-10-2024 08:37 AM
09-10-2024 08:44 AM
Hi beaver,
It depends on what behavior you want to happen. You could have a say instruction with some other action, such as hanging up, or placing the call on hold or something like that. Otherwise if you want another choice to be presented, you could have another submenu, which could have its own prompt with TTS and present more choices.
This tutorial uses our Java SDK to create an IVR, but the principles are the same and should explain how to set up submenus or other actions.
Please let me know if you have any other questions.
Thanks!
09-10-2024 08:51 AM
I would like a simple say instruction before hang up, I'm juste not sur how to trigger the instruction if the callee, in that case, press 2. I'll take a look at the Java exemple if I find anything.
09-10-2024 08:58 AM - edited 09-10-2024 08:59 AM
So essentially what you do is set up another SVAML object with the say instruction you want and the hangup action, then you call that SVAML object as the return action.
You need to handle the incoming menu result PIE and map it to the action you want to take. This example uses Javascript:
function handleMenuResult(menuResult){
switch (menuResult){
case 'sip':
return sipResponse();
case 'non-sip':
return nonSipResponse();
default:
return defaultResponse();
}
}
function humanResponse(){
return {
action: {
name: 'runMenu',
barge: false,
menus: [
{ id: 'main',
mainPrompt: '#tts[Hi, you awesome person! Press 1 if you have performed this tutorial using a sip infrastructure. Press 2 if you have not used a sip infrastructure. Press any other digit to end this call.]',
repeatPrompt: '#tts[Again, simply press 1 if you have used sip, press 2 if you have not, or press any other digit to end this call.]',
repeats: 2,
options: [
{
dtmf: 1,
action: 'return(sip)'
},
{
dtmf: 2,
action: 'return(non-sip)'
}
]
}
]
}
};
}