Stopped fridayfun

Id: 01K2QKZFGPV5RDEFCYA7KZCZ55 https://fn-01k2qkzf-fridayfun.fn.svaml.net node Updated 3d ago
Documentation
Updated Aug 15, 2025 at 11:18 PM using Sinch AI

Function Documentation

Overview

The fridayfun Sinch Voice function is a simple, multilingual interactive voice response (IVR) system designed to greet callers, let them choose their preferred language (English or German), and then ask a fun Yes/No question. Based on the caller’s response, the system provides a friendly, localized message and ends the call. If the caller makes an invalid selection or does not respond, the system guides them to try again, ensuring a smooth and accessible experience.

This function is ideal for businesses wanting to engage callers with a light, interactive experience, demonstrate IVR capabilities, or collect simple feedback in multiple languages.


Caller Experience

  1. Call Initiation:
    The caller dials the company’s Sinch number.

  2. Language Selection:
    The system greets the caller and asks them to select a language:

    • "Press 1 for English"
    • "Press 2 for Deutsch"
  3. Main Menu (Yes/No Question):
    In the chosen language, the caller hears a welcome message and is asked:

    • English: "Welcome to [Company]! Press 1 for Yes, or press 2 for No."
    • German: "Willkommen bei [Company]! Drücken Sie 1 für Ja oder 2 für Nein."
  4. Caller Response:

    • If the caller presses 1:
      • English: "Great! You selected Yes. Thank you for calling. Goodbye!"
      • German: "Großartig! Sie haben Ja gewählt. Vielen Dank für Ihren Anruf. Auf Wiederhören!"
    • If the caller presses 2:
      • English: "Okay, you selected No. Thank you for calling. Goodbye!"
      • German: "Okay, Sie haben Nein gewählt. Vielen Dank für Ihren Anruf. Auf Wiederhören!"
  5. Invalid Input or Timeout:

    • If the caller presses an invalid key or does not respond, the system says:
      • English: "Invalid selection. Please try again."
      • German: "Ungültige Auswahl. Bitte versuchen Sie es erneut."
    • The language selection menu is repeated.
  6. Call End:
    After a valid Yes/No response, the system says goodbye and hangs up.


Key Features

  • Multilingual IVR: Supports both English and German, allowing callers to interact in their preferred language.
  • Simple Yes/No Interaction: Engages callers with a straightforward question, making the experience quick and easy.
  • Error Handling and Guidance: Detects invalid inputs or timeouts and helps callers retry, reducing frustration and drop-offs.
  • Customizable Branding: Uses a configurable company name for a personalized greeting.
  • Demo-Ready Template: Serves as a template for building more advanced IVR flows.

Integration Points

  • Configuration Utility: Reads the company name from environment variables or configuration for dynamic branding.
  • Menu Templates: Uses shared menu-building utilities for consistent menu creation.
  • No External APIs or Databases: This function does not connect to external systems, making it lightweight and easy to deploy.

Error Handling

  • Invalid Input: If the caller presses an unrecognized key, the system plays an error message in both languages and restarts the language selection menu.
  • Timeouts: If the caller does not respond within 5 seconds, the menu is repeated up to two times before returning to the language selection.
  • Retries: The system allows up to two repeats for the main menu before returning to the language selection, ensuring callers are not stuck.
  • Graceful Hangup: After a valid Yes/No response, the system always says goodbye before ending the call.

Technical Notes

  • SVAML Patterns: Uses .runMenu() for menu prompts, .say() for voice output, and .hangup() for call termination.
  • Menu Logic: Language selection and main menu are built using reusable menu templates and builders.
  • Localization: All prompts and error messages are localized based on the caller’s language choice.
  • Stateless Design: No persistent storage or session data is used beyond the current call context.
  • Logging: Call events and user selections are logged for analytics and debugging.
  • DICE Handler: Handles call disconnect events for logging and cleanup, but does not affect the caller experience.

Call Flow Diagram

%%{init: {
  "theme": "base",
  "themeVariables": {
    "primaryColor": "#F5F5F5",
    "primaryTextColor": "#000000",
    "primaryBorderColor": "#666666",
    "lineColor": "#1565C0",
    "secondaryColor": "#E8F5E8",
    "tertiaryColor": "#FFF3E0",
    "background": "#FFFFFF",
    "mainBkg": "#F5F5F5",
    "secondaryBorderColor": "#28A745",
    "tertiaryBorderColor": "#FF9800",
    "primaryColorLight": "#F5F5F5",
    "edgeLabelBackground": "#FFFFFF",
    "nodeTextColor": "#000000"
  },
  "flowchart": {
    "curve": "linear"
  }
}}%%
graph TD
    A[Incoming Call] --> B[Play Language Menu]:::voiceOutput
    B --> C{Language Choice}:::inputCollection
    C -->|Press 1| D[Set English]:::businessLogic
    C -->|Press 2| E[Set German]:::businessLogic
    C -->|Invalid| F[Invalid Selection]:::errorHandling
    C -->|Timeout| F
    F --> B

    D --> G[Play Main Menu English]:::voiceOutput
    E --> H[Play Main Menu German]:::voiceOutput

    G --> I{Yes No Choice English}:::inputCollection
    H --> J{Yes No Choice German}:::inputCollection

    I -->|Press 1| K[Say Yes English]:::voiceOutput
    I -->|Press 2| L[Say No English]:::voiceOutput
    I -->|Invalid| M[Invalid Selection]:::errorHandling
    I -->|Timeout| M
    M --> B

    J -->|Press 1| N[Say Yes German]:::voiceOutput
    J -->|Press 2| O[Say No German]:::voiceOutput
    J -->|Invalid| P[Invalid Selection]:::errorHandling
    J -->|Timeout| P
    P --> B

    K --> Q[Say Goodbye English]:::voiceOutput
    L --> Q
    N --> R[Say Goodbye German]:::voiceOutput
    O --> R

    Q --> S[Hangup Call]:::callControl
    R --> S

classDef voiceOutput fill:#E8F5E8,stroke:#28A745,stroke-width:2px,color:#000000
classDef callControl fill:#E3F2FD,stroke:#3089F0,stroke-width:2px,color:#000000  
classDef inputCollection fill:#FFF3E0,stroke:#FF9800,stroke-width:2px,color:#000000
classDef businessLogic fill:#F3E5F5,stroke:#9C27B0,stroke-width:2px,color:#000000
classDef errorHandling fill:#FFEBEE,stroke:#F44336,stroke-width:2px,color:#000000
classDef recording fill:#E0F2F1,stroke:#00695C,stroke-width:2px,color:#000000
classDef default fill:#F5F5F5,stroke:#666666,stroke-width:2px,color:#000000

Documentation generated on 8/15/2025, 3:19:10 PM using Sinch AI

Quick Stats (30 days)
Requests:
7
Response:
1 ms
Error Rate:
0%
Memory:
14 MB
Billing Metrics
Current Month
Requests 7
Cost $0.000001
Last 30 Days
Requests 7
Cost $0.000001
Live
Loading requests...

Please wait while we fetch your function requests.

Performance Metrics

Detailed analytics and trends for your function

Performance Summary
-
Total Requests
-
Avg Response Time
-
Avg CPU Time
-
Avg Memory
-
Error Rate
-
Total Billable Time
Response Times
Request Volume
Error Rates
CPU Usage (Billable Time)

Function Settings

Environment Variables 5
Name Value Created
COMPANY_NAME Cool as company Aug 15, 2025
SALES_NUMBER +15551234567 Aug 15, 2025
SINCH_API_KEY 0bcf2128-91fb-448a-93eb-aafdb17be371 Aug 15, 2025
SINCH_PROJECT_ID 31196b37-7298-4269-b920-c978825799ac Aug 15, 2025
SINCH_VOICE_APPLICATION_KEY af742efa-2432-4f8d-bcba-b57a9abb0892 Aug 15, 2025
Secrets 2
Secret values are hidden by default for security. Click the button to reveal values. These secrets are available to your function via environment variables.
Name Value Created
SINCH_API_SECRET
••••••••
Aug 15, 2025
SINCH_VOICE_APPLICATION_SECRET
••••••••
Aug 15, 2025
Configuration Management