Voiceflow PartnersVPVoiceflow Partners
Powered by
Samuel WarrieS
Voiceflow Partners•4mo ago•
8 replies
Samuel Warrie

DTMF struggles

❓Voice
hey guys i have been trying to implement DTMf functionality for my voice agent but it seems to not work .

I got some tips from this developer call with nico,CallSense

Any help will be much appreciated,

here is the second havascript block,// Ensure tmpCode exists
tmpCode = tmpCode spoken.includes("1")) tmpCode += "1";
if (spoken.includes("two") spoken.includes("3")) tmpCode += "3";
if (spoken.includes("four") spoken.includes("5")) tmpCode += "5";
if (spoken.includes("six") spoken.includes("7")) tmpCode += "7";
if (spoken.includes("eight") spoken.includes("9")) tmpCode += "9";

}

// 2️⃣ User PRESSED a DTMF key
else if (last_event.type === "dtmf" && last_event.data) {

const digit = String(last_event.data);

if (!isNaN(digit)) {
tmpCode += digit;
}

}

// 3️⃣ Not speech & not DTMF → reset
else {
tmpCode = "";
throw "invalid";
}


// 4️⃣ When user enters 4 digits → verify
if (tmpCode.length === 4) {

if (tmpCode === randomCode) {
tmpCode = "";
return "Verified";

} else {
tmpCode = "";
return "Wrong code";
}
}

// 5️⃣ Return nothing until 4 digits
return;
image.png
image.png
Voiceflow Partners banner
Voiceflow PartnersJoin
Exclusive community for Voiceflow Solutions Providers & Content Creators.
13,076Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements
Recent Announcements
jacklyn

# Let your agents search the web 🔎 Hey everyone! We just released the web search tool for the agent step! Your agents can now automatically search the web for information, letting your agent supplement the LLM's knowledge and the data in its knowledge base with live, up-to-date information. Plus.... * You can restrict searches to specific domains, so your agent only searches sites that you own * This is a tool, so you remain in control of when the agent searches the web * Results are automatically summarized in a way that your agent can automatically understand Under the hood, we're using OpenAI's web search API. Give it a try, and let us know what you think! https://docs.voiceflow.com/changelog/native-web-search-tool

jacklyn · 4mo ago

jacklyn

jacklynbiggin's Thread

jacklyn · 4mo ago

hurt-tomato

connor_maclean's Thread

hurt-tomato · 4mo ago

Similar Threads

DTMF Struggles!
GREGGGREG / ❓┃ask-a-question
6mo ago
Help with DTMF prompting
Clecornu08CClecornu08 / ❓┃ask-a-question
7mo ago
DTMF Timeout follow default path
sacred-roseSsacred-rose / ❓┃ask-a-question
9mo ago
dtmf not in api send message
kmilo9319Kkmilo9319 / ❓┃ask-a-question
4mo ago