Snippet: Dial By Voice
This snippet will show you how to implement a dial phone number by voice application, prompting the caller to say a phone number, and then connecting to the spoken phone number, as recognized using ASR.
You will need a machine with Python installed, the SignalWire SDK, a provisioned SignalWire phone number, and optionaly Docker if you decide to run it in a container.
For this demo we will be using Python, but more languages may become available.
- SignalWire SDK
- SignalWire Phone Number
- Docker (Optional)
Methods and Endpoints
Endpoint: /dial-prompt Methods: GET OR POST Handles incoming LaML requests for provisioned phone number, and prompts user to say a number to call, and asks them if the wish to dial it. Speech Input: (Yes or No) If the number to dial can not be understood it will prompt again. Endpoint: /dial-verify Methods: GET OR POST Dials the number, after a successful Yes. is detected and verified from the user. If the user does not say Yes. they get a goodbye message.
Build and Run on Docker
Let's get started!
- Use our pre-built image from Docker Hub:
For Python: docker pull signalwire/snippets-dial-by-voice:python
- Or build your own image:
docker build -t snippets-dial-by-voice .
- Run your image:
docker run --publish 5000:5000 --env-file .env snippets-dial-by-voice
- The application will run on port 5000
Build and Run Natively
1. Replace environment variables 2. From command line run, python3 app.py
You can find more documentation on LaML, Relay, and all SignalWire APIs at:
If you need assistance or support with your SignalWire services please file a support ticket from your Dashboard.