Serverless TwiML
Functions
Customer logic stays out of the media server. A Function returns TwiML or a canonical command. Invoke it the way Studio would on Gather action.
Runtime
ZHinboundmenu000000000000000001
inbound-menu
exports.handler = (event) => {
const d = event.Digits || "0";
if (d === "1") return "<Response><Say>Connecting you to dispatch.</Say><Dial><Sip>sip:pbx.aether.co.il:5061</Sip></Dial></Response>";
if (d === "2") return "<Response><Say>Leave a message after the tone.</Say><Record maxLength=\"30\"/></Response>";
return "<Response><Say>Shalom. Press 1 for dispatch.</Say><Redirect>/ivr/menu</Redirect></Response>";
};