Stopped marketingdemo

Id: 01K2MT74XQYT886D2M8HSZBNZY https://fn-01k2mt74-marketingdemo.fn.svaml.net node Updated 3d ago
Documentation
Updated Aug 14, 2025 at 5:32 PM using Sinch AI

Function Documentation

Overview

The marketingdemo function is a bilingual (English/Spanish) interactive voice response (IVR) system designed to greet callers, let them choose their preferred language, and then present a simple Yes/No menu in that language. The function demonstrates how businesses can offer a friendly, accessible, and inclusive caller experience by supporting multiple languages and clear menu navigation. It is ideal for companies wanting to showcase or prototype a multilingual IVR, ensuring callers feel welcomed and understood from the first interaction.

Caller Experience

  1. Call Initiation: When a caller dials the company’s Sinch number, they are greeted with a welcome message in both English and Spanish:
    “Welcome to [Company Name]! For English, press 1. Para español, oprima 2.”

  2. Language Selection:

    • If the caller presses 1, the system continues in English.
    • If the caller presses 2, the system continues in Spanish.
    • If the caller does not respond or presses an invalid key, the menu is repeated up to two times.
  3. Main Menu (in Chosen Language):

    • English: “Thank you for calling [Company Name]! Press 1 for Yes, or press 2 for No.”
    • Spanish: “Gracias por llamar a [Company Name]! Oprima 1 para Sí, o oprima 2 para No.”
    • The menu is repeated if there is no input or an invalid key is pressed.
  4. Response Handling:

    • If the caller presses 1 (Yes), they hear a positive confirmation and a polite goodbye in their chosen language.
    • If the caller presses 2 (No), they hear an acknowledgment and a polite goodbye in their chosen language.
    • The call then ends.
  5. Error Handling:

    • If the caller enters an invalid option at any menu, they are informed of the invalid selection and returned to the language selection menu for another attempt.

Key Features

  • Bilingual IVR: Supports both English and Spanish, making the system accessible to a wider audience.
  • Dynamic Menus: Menus and prompts are tailored to the caller’s language choice, improving clarity and user satisfaction.
  • Simple Navigation: Clear Yes/No options reduce confusion and speed up the caller’s journey.
  • Error and Timeout Handling: Invalid or missing inputs are managed gracefully, ensuring callers are not left confused or stuck.
  • Customizable Branding: The company name is dynamically inserted into prompts, allowing easy adaptation for different businesses.

Integration Points

  • Configuration Utility: Uses a universal config utility to fetch the company name and other variables, making branding and settings easy to manage.
  • Menu Builder Utility: Relies on helper functions to construct menus and prompts, ensuring consistency and maintainability.
  • No External APIs or Databases: This function does not connect to external systems, making it simple and self-contained.

Error Handling

  • Invalid Input: If a caller presses an unrecognized key, they are informed and returned to the language selection menu.
  • Timeouts: If the caller does not respond within the set time (8 seconds for language, 5 seconds for main menu), the prompt is repeated. After the maximum number of repeats, the call flow returns to the language selection.
  • Retries: Both language and main menus allow for repeated attempts, reducing the chance of caller frustration.
  • Graceful Exit: All valid paths end with a polite goodbye and a clean call hangup.

Technical Notes

  • SVAML Patterns: Uses .runMenu() for menu presentation, .say() for voice output, and .hangup() for ending calls.
  • Callback Handling: Implements handlers for ICE (incoming call), PIE (input received), and DICE (call disconnect) events.
  • Menu Logic: Menu options are mapped to return values (e.g., english, yes_english), which are used to determine the next step in the flow.
  • No Persistent Storage: The function does not store caller data or session information.
  • Logging: Call events and user selections are logged for analytics and debugging.

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]:::default --> B[Play Welcome and Language Menu]:::voiceOutput
    B --> C{Language Choice}:::inputCollection
    C -->|Press 1| D[Play Main Menu English]:::voiceOutput
    C -->|Press 2| E[Play Main Menu Spanish]:::voiceOutput
    C -->|Invalid or Timeout| F[Invalid Language Selection]:::errorHandling
    F --> B
    D --> G{Main Menu Choice English}:::inputCollection
    G -->|Press 1| H[Say Yes Confirmation English]:::voiceOutput
    G -->|Press 2| I[Say No Confirmation English]:::voiceOutput
    G -->|Invalid or Timeout| J[Invalid Main Menu English]:::errorHandling
    J --> B
    H --> K[Say Goodbye English]:::voiceOutput
    I --> K
    K --> L[Hangup Call]:::callControl
    E --> M{Main Menu Choice Spanish}:::inputCollection
    M -->|Press 1| N[Say Yes Confirmation Spanish]:::voiceOutput
    M -->|Press 2| O[Say No Confirmation Spanish]:::voiceOutput
    M -->|Invalid or Timeout| P[Invalid Main Menu Spanish]:::errorHandling
    P --> B
    N --> Q[Say Goodbye Spanish]:::voiceOutput
    O --> Q
    Q --> L

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/14/2025, 10:26:39 AM using Sinch AI

Quick Stats (30 days)
Requests:
0
Response:
0 ms
Error Rate:
0%
Memory:
0 MB
Billing Metrics
Current Month
Requests 0
Cost $0.000000
Last 30 Days
Requests 0
Cost $0.000000
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 Sinch Aug 14, 2025
SALES_NUMBER +15551234567 Aug 14, 2025
SINCH_API_KEY 0bcf2128-91fb-448a-93eb-aafdb17be371 Aug 14, 2025
SINCH_PROJECT_ID 31196b37-7298-4269-b920-c978825799ac Aug 14, 2025
SINCH_VOICE_APPLICATION_KEY af742efa-2432-4f8d-bcba-b57a9abb0892 Aug 14, 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 14, 2025
SINCH_VOICE_APPLICATION_SECRET
••••••••
Aug 14, 2025
Configuration Management