NEW Try Zapier integration to connect Dasha instantly to thousands of the most popular apps!
How to connect jambonz with Dasha AI
Dave Horton, founder jambonz
5 minutes
Note from the editor: this is a repost of David Horton's article. jambonz is an open source CPaaS for communications service providers.
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 is a relatively new entry in the conversational AI space, albeit one with that is getting some nice press and brings some interesting capabilities, including such things as handling conversational digressions more easily and a nice VSCode plugin for creating applications using their declarative language.
When building contact center solutions using jambonz, integrating with Dasha is a breeze!
Dasha side
Make sure you have node.js version 13+ and npm installed. You will also want 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.
Run npm i -g "@dasha.ai/cli@latest" to install the latest Dasha CLI.
Run a dasha app
You’ll want to load up a Dasha conversational AI app. For the purposes of this tutorial, we will load up the simple inbound tester app that they provide.
$ git clone https://github.com/dasha-samples/dasha-sip-test \&& cd dasha-sip-test \&& npm installCloning into 'dasha-sip-test'...remote: Enumerating objects: 66, done.remote: Counting objects: 100% (66/66), done.remote: Compressing objects: 100% (51/51), done.remote: Total 66 (delta 27), reused 41 (delta 14), pack-reused 0Unpacking objects: 100% (66/66), done.added 204 packages, and audited 205 packages in 2s
Dasha integrates with voice systems over SIP. That makes it super simple to integrate with jambonz.
So the next thing we shall do is create a SIP endpoint on the hosted Dasha platform that we can send our calls to. We will create a unique SIP URL that routes to their platform and which on the Dasha side is linked to our application.
We used the dasha cli to create a SIP URI on the Dasha platform that we can send to. We specified an application name and a config name -- in this case, using sip-test-app for both.
We can also use the dasha cli to list the sip-inbound endpoint we have created:
We can see the data returned is an object keyed by the config name where the values are objects containing information about an individual SIP URI.
Note that in order for everything to link up properly on the Dasha side, the application-name you use in the dasha sip create-inbound command must match the value in the name field of your dashaappfile (which is found in app/app.dashaapp). If you want to change the name of the application, change it in the dashaappfile and create a new sip inbound URI using that same name, then restart your app.
Now all we need to do is start our Dasha app:
$ npm start in..skipping startup log messages here..Waiting for calls via SIPsip:5de44e6b-c0df-4532-b952-e4e4c5a5a9ec@sip.us.dasha.ai
Note that it again tells us the SIP URI Dasha has exposed for our application.
jambonz side
On the jambonz side, all we need to do is to dial an outbound call leg to that SIP URI provided. Let's whip up a jambonz app to do just that:
$ npx create-jambonz-app --scenario dial dasha-connectCreating a new jambonz app in /Users/dhorton/dasha/dasha-connectInstalling packages...
As with any jambonz Node.js app, we need to provide environment variables to reference our account sid and other details, so edit the ecosystem.config.js file accordingly, then start it
$ pm2 start ecosystem.config.js
Now that it's running, all we need to do is create an application in our jambonz portal for this webhook:
and then point a phone number to it:
That's it! Time to test by calling the number we assigned. This dasha sample app is quite simple so you will simply hear a woman's voice saying hello and then waiting for your response after which she will close out the conversation.
Of course, this simple Dasha app is only meant to provide an easy way to verify SIP connectivity, and you can now proceed to build out more sophisticated conversational AI apps using Dasha and connect them to your jambonz voice applications.