Outbound Data Action Function - Intercepting and Changing Outbound CallerID and Call Data on the Fly


The Outbound Data Action Function allows you to programatically change the default state/configuration of an outbound Spoke call, right as the call is about to be placed.

When you set up Spoke, you set up company defaults for items such as call recording, the CallerIDs customers see when your team make calls, etc. Outbound Data Actions allow you to change this default behavior on a call-by-call basis.

Here are some examples of what you can do with Outbound Data Actions:

  • You may have call recording turned on for the entire company, but when the CEO makes a call, you may want for turn call recording off.
  • When your Customer Support team makes a call to a premium customer, you want the customer to see your premium support line number calling.  Rather than having to rely on your team knowing who is a premium customer and manually selecting the right CallerID before they call, you can intercept their call and ensure the right number is selected.
  • When a user attempts to make a call to a country you know they should not be calling, you can block the call from being made for that user but allow the call to go through for others.

Here's how it Outbound Data Actions work:

  1. User A in Spoke dials a phone number

  2. The Spoke Outbound Data Action calls some custom code that you have written, and says to your code: "Spoke User A is about to call this customer number, and we plan on presenting this CallerID (ANI) to the Customer."

  3. Your code can then either: A) let that call go ahead as planned, or B) ask Spoke to:
    1. use this CallerID instead
    2. turn call recording off/on
    3. block this call

How to enable Outbound Data Actions

  1. Login to your Spoke Account Portal.
  2. Go to the Other menu, select Developers and click on the Data Actions tab.
  3. Enter the URL to your custom call application
  4. Spoke will give you a signing secret to secure the data transmission


Outbound Data Actions Request Payload

This is the Request Payload that Spoke will send to your application.

callId: "2cfbbb00-xxx-xxx-xxxxx-55298652b209",
vendorCallId: "CAddc9b14xxxxxxxxxx42b30339f52",
callerId: "+1717xxxx2396",
contactNumber: "+642xxxx500",
contactId: "AAA-123455"
contactEmail: "test@demo.ph"
userId: "37b4e9c0-xxxx-11ec-xxxxx-8ddf61f10dd4"
userEmail: "test+spokefunctions@spoke.ph"
userExtension: 1234
callerID The CallerID (number) that Spoke is proposing to show to the customer for this call
contactNumber The phone number being called
contactID If you have your CRM connected to Spoke, this will be your CRMs ID field for the contact
contactEmail If you have your CRM connected to Spoke or you have uploaded contact records, this will be the email of the contact being called
userID This is the internal UserID of the Spoke Phone user who is placing the call
userExtension This is the email address of the Spoke Phone user who is placing the call

Data Actions Response Payload

This is the response payload options that your application can send back to Spoke. If you do not send back a response, Spoke will proceed with the call as planned. You can send back one or both of these parameters.

"callerId": "+15551234567",
"dialPermission": "allowed",
callerID This is the CallerID you would like Spoke to use. This must be in a valid e164 format.

If you wish the call to proceed, either do not set this parameter, or pass back allowed

To block this call from taking place, pass back blocked

How to write a custom app that responds to Spoke's outbound calls

Your development team or systems integration partner writes a custom app that does your decision logic. This app logic can be simple (e.g. don't allow anyone but theses five Spoke users to call Fiji), to more complex apps that connect to your CRM to lookup customers to make decisions.

A good place to start is to use Twilio Serverless Functions as your application environment.


Tags: CallerID, ANI, Outbound Data Action

Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.