Outbound Trunk — Easytrunk

Plivo can be used as an outbound trunk to make calls from your soft switch like FreeSWITCH or Asterisk.

Sign up for a Plivo account

When you sign up with Plivo, we give you a free trial account and free credits to experiment with and learn about our services. You can add a number to your account to start testing the full range of our Voice and SMS service features.

Follow these steps to get a free trial account:

  1. Sign up with your work email address.
  2. Check your inbox for an activation email message from Plivo. Click on the link in the message to activate your account.
  3. Enter your mobile number to complete the phone verification step.

Set up your Plivo application

We’ve deployed a custom trunking application for you to get started. You’ll have to create a Plivo application and link it to your Plivo number.

  1. Navigate to the Voice Application page on the Plivo console.

  2. Click on Add New Application to create a new application.

  3. Enter the following URL in the Primary Answer URL field and set the Answer Method to GET. Replace {auth} with an auth string which you’ll send us on the SIP INVITE. For now let’s assume AUTH=plivo

    http://easytrunk.plivo.com/response/sip/route/?AUTH={auth}

    Create Application

  4. Check the Public URI checkbox, then click Create Application to save the application.

  5. Make a note of your application SIP URI. You soft switch should send calls to this URI.

    Application SIP URI

Forward calls from your soft switch

You can now forward calls to the application SIP URI with the following custom SIP headers.

X-PH-auth={auth}

X-PH-destination={destination}

X-PH-clid={clid}

X-PH-dial_music={dial_music}
  • Replace {auth} with the auth string you added to the application Answer URL.

  • Replace {destination} with the destination mobile or landline number.

  • (Optional) Replace {clid} with a valid number to be used as the caller ID.

  • (Optional) Replace {dial_music} with “real,” which will play the real ringtone of the called party.