Configuring inbound calls with SIP
Overview
This article will show you how to accept the call from your SIP Provider or IP PBX.
Prerequisites
- Dasha CLI
npm i -g @dasha.ai/cli
- You have to be logged into your account using Dasha CLI:
dasha account create <your_desired_account_name> --api-key <your_dasha_apikey> dasha account use <your_desired_account_name>
- 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
- Your application will receive
startingJob
notification withincomingData
argument filled with sip call information such as user name (SIP From User), that has initialized call
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
Found a mistake? Email us, and we'll send you a free t-shirt!