#text-to-speech #verb #pro #jambonz

cal-jambonz

Jambonz Verbs

68 releases

Uses new Rust 2024

new 0.1.72 Apr 19, 2025
0.1.71 Apr 18, 2025
0.1.50 Mar 28, 2025

#139 in Audio

Download history 12/week @ 2025-03-15 2796/week @ 2025-03-22 933/week @ 2025-03-29 1523/week @ 2025-04-05 384/week @ 2025-04-12

5,653 downloads per month
Used in 5 crates (3 directly)

MIT license

185KB
5.5K SLoC

cal-jambonz-rust πŸš€

A Rust library for building applications that interact with the Jambonz communications platform.

πŸ“± Heads up! For implementing a complete Jambonz webhook server with Actix Web integration, check out our awesome companion project jambonz-actix-web - it's perfect for handling those webhooks like a pro!

Overview 🌟

This library provides a Rust implementation for creating and managing Jambonz applications. Jambonz is an open-source CPaaS (Communications Platform as a Service) that allows developers to build voice and messaging applications using a simple API. This library allows you to create Jambonz applications using type-safe Rust code, abstracting away the complexities of the underlying JSON webhook API.

Features ✨

  • πŸ›‘οΈ Type-safe implementation of Jambonz verbs and actions
  • πŸ”„ Simplified request/response handling for Jambonz webhooks
  • 🎯 Comprehensive support for Jambonz's feature set, including:
    • πŸ“ž Call control (answer, hangup)
    • 🎡 Media operations (play, pause, record)
    • πŸ—£οΈ Speech recognition and text-to-speech
    • πŸ‘₯ Conference management
    • πŸ”€ Call transfer and SIP integration
    • πŸ”’ Gather DTMF input
    • And more...

Requirements βœ…

  • Rust 1.70+
  • Actix Web ecosystem
  • Features from: actix-web, actix-ws, uuid, serde, futures, etc.

Installation πŸ“¦

Add this to your Cargo.toml:

[dependencies]
cal-jambonz-rust = "0.1.0"

Quick Start πŸƒβ€β™‚οΈ

Here's a simple example of using the library to create a basic IVR (Interactive Voice Response) application:

use cal_jambonz_rust::{JambonzResponse, verbs::*};
use cal_jambonz_rust::verbs::synthesizer::Synthesizer;

// Handle an incoming call webhook from Jambonz
fn handle_call_webhook(request_json: &str) {
    // Parse the incoming webhook data
    // (Implementation would depend on your web framework)
    
    // Build a response with Jambonz verbs
    let mut say = Say::new("Welcome to our service!".to_string());
    say.synthesize(Some(Synthesizer::default().voice("female").language("en-US")));
    
    let response = JambonzResponse::new()
        .add_verb(say);
            
    // Print the JSON response
    println!("{}", response.to_json().unwrap());
    
    // The JSON response would look something like:
    // {
    //   "verb": "say",
    //   "text": "Welcome to our service!",
    //   "synthesizer": {
    //     "voice": "female",
    //     "language": "en-US"
    //   },
    //   "loop": 1,
    //   "earlyMedia": false
    // }
}

Supported Jambonz Verbs 🎭

This library supports all standard Jambonz verbs including:

  • πŸ—£οΈ Say - Synthesize speech
  • 🎡 Play - Play an audio file
  • πŸ”’ Gather - Collect DTMF digits
  • πŸŽ™οΈ Record - Record the call
  • πŸ“ž Dial - Make an outbound call
  • πŸ‘₯ Conference - Create or join a conference
  • πŸ‘‹ Hangup - End the call
  • 🚫 Sip:decline - Decline an incoming call
  • 🚢 Leave - Leave a conference
  • πŸ”„ Transfer - Transfer the call
  • ⏸️ Pause - Pause execution
  • 🏷️ Tag - Add metadata to call events
  • βš™οΈ Config - Configure call parameters
  • πŸ”„ Enqueue - Place call in a queue
  • πŸ”„ Dequeue - Remove call from a queue

For detailed documentation on each verb and its options, please refer to the code documentation.

License πŸ“„

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing 🧱

PRs and issues are welcome. Whether it's bug fixes, new features, or documentation improvements β€” let's build together.

Acknowledgments πŸ™

  • Jambonz & Dave Horton, for providing a kick-ass open-source communications platform

TODO List πŸ“

Future enhancements planned for this library:

  • πŸ”„ Implement Jambonz REST API client for account management
  • ⚑ Add support for real-time call control
  • πŸ“š Create comprehensive documentation with more examples

Dependencies

~3–5MB
~92K SLoC