Configuring outbound calls with SIP

Overview

This article will show you how to send the call to your SIP Provider or IP PBX.

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

Configuration with Twilio SIP Trunking

  1. Buy a phone number https://www.twilio.com/console/phone-numbers/search
  2. Create sip trunk https://www.twilio.com/console/sip-trunking/trunks
  3. Go to tab Numbers
  4. Press a plus button to assign the phone number to sip trunk
  5. Go to tab Termination
  6. Write Termination URI, for example, my-dasha-app.pstn.twilio.com
  7. Add credentials for auth with username = phoneNumber you want to use, and some password

Configuring on Dasha side

$ dasha sip create-outbound --server <ip_or_dns_of_server:port> [--domain <domain_name>] [--ask-password] --account <accountName> --transport [tcp|udp] <config_name>

For this example

$ dasha sip create-outbound --server my-dasha-app.pstn.twilio.com --account +19733588889 --ask-password twilio password: enter_your_password_here

Where the password is the same, that was configured in Twilio, and the account same as Twilio phone number

Call to yourself with Dasha

  1. node main.js +1...
  2. Receive the call from Twilio

Example SIP Flow

Here you can see an example of SIP flow, captured on the Twilio side

SIP flow logs can be downloaded from https://www.twilio.com/console/sip-trunking/dashboard

Invite +1XXXXXXXXXX from +1YYYYYYYYYY, where

  • +1XXXXXXXXXX - phone number of user you are calling
  • +1YYYYYYYYYY - phone number for Dasha

Authentication request from Twilio

New invite with the authentication response

Phone ringing event

User picked-up the phone

Dasha is closing the connection and hangs-up the phone call