Learn how to use Dasha conversational AI with Voximplant to automate customer conversations within a call center environment.
Make sure you have node.js version 13+ and npm installed. You also need the latest version of Visual Studio Code running to edit and test the Dasha app.
- Join Dasha Community – you will get your API key here automatically.
- Open VSCode and install the Dasha Studio Extension from the extension store. You’ll get all the DSL syntax highlighting and a GUI interface for debugging your conversation flow.
npm i -g "@dasha.ai/cli@latest"to install the latest Dasha CLI.
- Log in to your Voximplant account or create an account if you don’t have one.
- Create a Voximplant application.
- Purchase a phone number in the Numbers section of the control panel.
- Go to your applications, click on the app you created. Click on Numbers > Available and Attach. This number will be used as a caller ID.
For outbound calls
- Go to Scenarios > Create scenario, name the scenario, and hit the “plus” sign. Then paste the following code in the scenario:
This is the scenario that will be run when we set everything up. On an incoming SIP call from Dasha, the phone number which we want to call is passed to the callPSTN method. This is how we connect two calls. Once the call is answered, Dasha will start the conversation. If you want to handle inbound calls to SIP, use your SIP URI as
callerid and replace the callPSTN method with callSIP. If you are using SIP Registrations on your PBX, you need to create a SIP Registration and use it instead of the SIP URI.
Go to the Users section and create a new user. Remember the username and password, they will be used for Dasha's config in the next step.
Click on Routing in the left-hand menu. Create a new rule (leave the pattern as default), and attach your scenario to this rule.
Connect your sip trunk with Dasha's using this command:
dasha sip create-outbound --server <ip_or_dns_of_server:port> [--domain <domain_name>] [--ask-password] --account <accountName> --transport [tcp|udp] <config_name>
accountNameis the username you created in the Voximplant panel;
ip_or_dns_of_server:portis the name of our Voximplant app;
config_nameis the name of the config we’ll use in the next step.
dasha sip create-outbound --server exampleApp.exampleAcc.n4.voximplant.com --account exampleUsername --ask-password vox_outbound password: enter_your_password_here
For inbound calls
- Connect your sip trunk with Dasha's using this command:
dasha sip create-inbound --application-name <your_app_name> <config_name>
your_app_nameis your Voximplant application name;
config_nameis the name of the config we’ll use later.
dasha sip create-inbound --application-name exampleApp vox_inbound
This command will give us a Dasha’s SIP URI to call. For example, sip:email@example.com
To see the URI, write
dasha sip list-inbound.
Let’s put it in our Voximplant scenario instead of "your_SIP_URI".
- Create a scenario inside the app by pressing a plus icon and paste this code in there:
This is the scenario that will be run when we set everything up. We use the callSIP method to make a call to our SIP URI. On an incoming SIP call from Voximplant, the SIP URI that we want to call is passed to the callSIP method. This is how we connect two call legs. Once the call is answered, Dasha will start a conversation.
If you are using SIP Registrations on your PBX, you need to create a SIP Registration and use it instead of the SIP URI.
- Click on Routing in the left-hand menu. Create a new rule (leave the pattern as default), and attach your scenario to this rule.
Get your backend in order and start calling
The setup is ready, now we need a local app or backend to run our Voximplant scenario using Dasha.
Placing outbound calls
- Open your VS Code Dasha conversational AI app project. Open the index.js file and replace configName in dasha.sip.Endpoint with your config name. Do the same with the name field in package.json. To see all the available configs, run the
dasha sip list-outboundcommand.
- In the outbound.dashaapp file, change the name field so it matches our config name.
node index.js <the number to call in international format e.g. 12223334455>. Now you can watch the application deployment and registration process in the console.
Taking inbound calls
- Open up your VS Code with the Dasha project open.
- In the package.json file, replace the name field with your config name. To see all the available configs, run the
dasha sip list-inboundcommand. In the inbound.dashaapp file, change the name field so that it matches your config name.
- To test the integration, run
npm ifrom your folder.
node main.js. Now you can call the phone number that you purchased earlier. You’ll be able to track application deployment in the console.
Congrats, you’ve successfully connected your Voximplant app to Dasha conversational AI. You can call anyone in the world now.