Rate this page:

Dasha AI

Learn how to use Dasha AI with Voximplant to automate customer conversations within a call center environment.

Dasha is a conversational-AI-as-a-service platform that lets you embed realistic voice and text conversational capabilities into your apps or products.

Dasha side

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.

  1. Join the Dasha Community. You get your API key here automatically.
  2. Open VSCode and install the Dasha Studio Extension from the extension store. You get all the DSL syntax highlighting and a GUI interface for debugging your conversation flow.
  3. Run npm i -g "@dasha.ai/cli@latest" to install the latest Dasha CLI.

Use the incoming tester app to test incoming calls and the outgoing tester app to test outgoing calls.

Voximplant side

  1. Log in to your Voximplant account or create an account if you do not have one.
  2. Create a Voximplant application.
  3. Purchase a phone number in the Numbers section of the control panel.
  4. Go to your applications and click on the app you created. Click on NumbersAvailable and Attach. This number is used as a caller ID.

Outbound calls

  1. Go to ScenariosCreate scenario, name the scenario, and click the “plus” button. Then paste the following code in the scenario:
Outbound calls scenario

Outbound calls scenario

This is the scenario that runs when you set everything up. On an incoming SIP call from Dasha, the phone number that you want to call is passed to the callPSTN method. This is how you connect two calls. Once the call is answered, Dasha starts the conversation. If you want to handle incoming 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.

  1. Go to the Users section and create a new user. Remember the username and password; you need them for Dasha's config in the next step.

  2. Click on Routing in the left-hand menu. Create a new rule (leave the pattern as default) and attach your scenario to this rule.

  3. Connect your SIP trunk with Dasha's via this command:

dasha sip create-outgoing --server <ip_or_dns_of_server:port> [--domain <domain_name>] [--ask-password] --account <accountName> --transport [tcp|udp] <config_name>
  • accountName is the username you created in the Voximplant panel;

  • ip_or_dns_of_server:port is the name of your Voximplant app;

  • config_name is the name of the config to use in the next step.

For example:

dasha sip create-outgoing --server exampleApp.exampleAcc.n4.voximplant.com --account exampleUsername --ask-password vox_outgoing

password: enter_your_password_here

Inbound calls

  1. Connect your SIP trunk with Dasha's via this command:
dasha sip create-incoming --application-name <your_app_name> <config_name>
  • your_app_name is your Voximplant application name;

  • config_name is the name of the config to use later.

    For example:

dasha sip create-incoming --application-name exampleApp vox_incoming

This command gives you a Dasha’s SIP URI to call. For example, sip:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx@sip.us.dasha.ai

To see the URI, write dasha sip list-incoming. Put it in your Voximplant scenario instead of "your_SIP_URI".

  1. Create a scenario inside the app by pressing a plus icon and paste this code in there:
Inbound calls scenario

Inbound calls scenario

This is the scenario that runs when you set everything up. Use the callSIP method to make a call to your SIP URI. On an incoming SIP call from Voximplant, the SIP URI that you want to call is passed to the callSIP method. This is how you connect two call legs. Once the call is answered, Dasha starts 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.

  1. Click on Routing in the left-hand menu. Create a new rule (leave the pattern as default) and attach your scenario to this rule.

Testing

Copy URL

The setup is ready, now you need a local app or backend to run the Voximplant scenario with Dasha.

Outbound calls

  1. 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-outgoing command.
  2. In the outgoing.dashaapp file, change the name field so it matches your config name.
  3. Run 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.

Inbound calls

  1. Open up your VS Code with the Dasha project open.
  2. In the package.json file, replace the name field with your config name. To see all the available configs, run the dasha sip list-incoming command. In the incoming.dashaapp file, change the name field so that it matches your config name.
  3. To test the integration, run npm i from your folder.
  4. Run node main.js. Now you can call the phone number that you purchased earlier. You can track application deployment in the console.

Congrats, you have successfully connected your Voximplant app to Dasha conversational AI. You can call anyone in the world now.