# SmartCall **Repository Path**: gdzWork/SmartCall ## Basic Information - **Project Name**: SmartCall - **Description**: 融合传统呼叫中心与大模型能力,打造新一代 AI 客服呼叫中心。 项目基于 Java 17、Spring Boot 3+ 开发。 🔝🔝如果本项目对你有帮助,欢迎点个 Star,并关注后续更新。 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: https://qidiangk.com - **GVP Project**: No ## Statistics - **Stars**: 609 - **Forks**: 190 - **Created**: 2026-06-30 - **Last Updated**: 2026-11-27 ## Categories & Tags **Categories**: erp **Tags**: 呼叫中心, AI客服, Java, 人工智能, 大模型 ## README
An AI-powered customer service contact center — bringing intelligence to every call
Add a dependency and declare one Bean to bring AI voice calling to your Spring Boot application.
Embed it in a monolith or a microservice.
Website · Documentation · Live Demo · 中文
--- ## Introduction **SmartCall** is an easy-to-integrate, open-source AI voice calling framework. Add the dependency, configure telephony and model services, and declare one Bean to bring AI conversations to your Spring Boot application. Use it for customer service, phone inquiries, and follow-up calls. Embed it in an existing monolith or microservice and keep your business systems. The framework handles telephony, sessions, and model interaction so you can focus on conversation design and business logic. ## Capabilities - **Simple integration**: Spring Boot auto-configuration and one session configuration Bean for incoming calls. - **Natural conversations**: Streaming ASR → LLM → TTS, interruptions, false interruption recovery, and idle prompts, with optional echo cancellation and LLM / TTS pre-generation. - **Per-call customization**: Configure models, voices, instructions, and greetings independently for each call to suit customer service, inquiries, and follow-ups. - **Flexible models**: Combine Model Studio, DeepSeek, Alibaba Cloud NLS, Doubao TTS, and OpenAI-compatible LLM adapters across providers; add custom adapters or connect self-hosted services using compatible protocols. - **Inbound and outbound**: Answer, dial, and hang up calls; transfer to a queue or a specific destination, with optional AI conversation resumption afterward. - **Business extensions**: Connect orders, tickets, knowledge bases, and other business APIs through tools and turn interceptors so conversations can take action. - **Conversation records**: Receive turn text, audio, and interruption status through the recording interface for storage and further analysis. - **Flexible deployment**: Docker Compose scripts start the example and its dependencies with one command after setup; embed the framework in monoliths, microservices, or multiple instances. ## Architecture ```mermaid flowchart TB subgraph App["Your Spring Boot application · monolith / microservice"] Config["One session configuration Bean"] --> SmartCall["SmartCall · sessions and call control"] Business["Business APIs / tools / turn records"] <--> SmartCall end Phone["Phone / SIP extension"] <-->|"SIP / RTP"| Asterisk["Asterisk"] Asterisk <-->|"FastAGI / AMI · call control"| SmartCall Asterisk <-->|"SIP / RTP · audio"| SIP["LiveKit SIP"] SIP <--> LiveKit["LiveKit Server"] LiveKit <-->|"Realtime audio"| Agent["Python Agent"] SmartCall -->|"Rooms / dispatch"| LiveKit SmartCall <-->|"WebSocket · configuration / events / tools"| Agent Agent <--> Models["ASR → LLM → TTS · combine or extend"] SmartCall -.->|"Optional"| Redis["Redis · session directory / remote commands"] ``` This shows the built-in Python Agent pipeline: Spring Boot handles call control and business orchestration, while audio travels through Asterisk, LiveKit SIP, and LiveKit to the Agent. Redis is optional for the framework's cross-instance routing. ## Quick start ### Start the example with one command The [`script`](script) directory provides Docker Compose configuration. Prepare **Java 21, Maven, Docker, and Docker Compose**, then follow these steps to build, start, and verify the example. **1. Configure models and connections** Copy the environment template from the repository root: ```bash cp script/.env.example script/.env ``` - Fill in the ASR, LLM, and TTS endpoints and credentials in [`DemoConfig.java`](smart-demo/src/main/java/com/smart/demo/config/DemoConfig.java), using models and voices enabled for your account. - Set `external_signaling_address` and `external_media_address` in [`pjsip.conf`](script/config/asterisk/pjsip.conf) to the deployment machine's IP reachable by your softphone. - For an all-container deployment, set the AGI address in [`extensions.conf`](script/config/asterisk/extensions.conf) to `agi://smart-call:4573/realtime.agi`. Keep the template defaults for addresses and credentials in `script/.env`; see the [documentation](https://qidiangk.com/docs) for custom settings. **2. Build the application images** Run from the repository root. The project's Jib plugin builds the Java image, and the Dockerfile builds the Python Agent image. Image tags match the Compose configuration. ```bash mvn -pl smart-demo -am clean package jib:dockerBuild -DskipTests docker build -t smart/smart-agent:2.0.0 ./smart-voice-agent ``` **3. Start services** ```bash cd script docker compose up -d docker compose ps ``` **4. Verify inbound and outbound calls** **Inbound**: Register a SIP softphone with the deployment machine on `5060/UDP`, using username `1001`, password `1001@123`, and `ulaw` / `alaw`. Once registered, dial any numeric destination with at least two digits, such as `1000` or `12345`, to start an AI conversation. No matching destination extension needs to be created. **Outbound**: End the inbound test and keep extension `1001` registered and idle. Request the example outbound endpoint from the deployment machine: ```bash curl -X POST http://127.0.0.1:9999/api/calls/outbound -H "Content-Type: application/json" -d '{"number":"1001"}' ``` A normal response is HTTP `202`, containing `callId` and `submission`; `ACCEPTED` means the call was submitted. Answer the softphone when it rings to talk to the AI. For remote requests, replace `127.0.0.1` with the deployment machine's IP. The current [`OutboundCallController`](smart-demo/src/main/java/com/smart/demo/controller/OutboundCallController.java) builds `PJSIP/{number}@1001`, so this request calls back the test extension. To call real external numbers, replace the trailing `1001` with a configured SIP trunk name, rebuild the example image, and pass the destination as `number`. **Logs**: Read `smart-call` logs in the host's bind-mounted `script/logs/aicc/` directory (container path `/smart/boot/logs/`). For `smart-agent` console logs, run from `script`: ```bash docker compose logs -f smart-agent ``` See the [documentation](https://qidiangk.com/docs) for further usage and configuration. ### Integrate into an existing application Requirements: **Java 21 and Spring Boot 3.5.8**. Add the dependency, configure services, and declare one Bean. **1. Add the dependency** Run `mvn -pl smart-voice-realtime -am install -DskipTests` from the repository root, then add the dependency to your Spring Boot project: ```xml
Scan with WeChat · Click the image to view the original
SmartCall — Empowering every call with AI