Configuring inbound calls with SIP
Overview
Prerequisites
- Dasha CLI
$ npm install --global "@dasha.ai/cli"
- You have to be logged into your account using Dasha CLI:
$ dasha account login
- Your application (or example app from this tutorial)
- Access to SIP Provider or your PBX, for example you can use Twilio
Configuring on Dasha side
$ dasha sip create-inbound --application-name <your_app_name> <config_name>
For this example
$ dasha sip create-inbound --application-name sip sip-inbound-calls
<your_app_name>
name of your app (you can find it in .dashaapp file), in this examplesip
<config_name>
unique name of your configuration, for exampleoffice-pbx
The output of this command will show you the auto-generated sip URI, for example sip:c23151ed-2bdd-41ee-9f7a-54af8a611a36@sip.us.dasha.ai.
Configuration with Twilio SIP Trunking
- Buy a phone number https://www.twilio.com/console/phone-numbers/search
- Create sip trunk https://www.twilio.com/console/sip-trunking/trunks
- Go to tab
Numbers
- Press a
plus
button to assign the phone number to sip trunk - Go to tab
Origination
- Press a
plus
button near toOrigination URI
and writeOrigination SIP URI
with an URI you got from Dasha CLI - Start your app (
node main.js
) - Call the phone number (1) using your cell phone
Example output
Dasha SDK allows you to print self diagnostics information on starting your app, here you can see application deployment and registration process
We've called Twilio phone number from phone number 19733588889
, and here you can see information, that was passed by Dasha about this call
And here we can see dialogue output context with success
variable.
- When
success
istrue
- user and dasha can hear each other - When
success
isfalse
- something went wrong