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)'
}
]
}
]
}
};
}
... View more