View Source AtEx.Gateway.Voice.MakeCall (AtEx v0.20.23)

This module holds the implementation for the HTTP Gateway that runs calls against the Africas Talking Voice API endpoints to make an outbound call

Summary

Functions

This function makes a POST request to make a call via the Africa's talking call endpoint, this function accepts a map of parameters. sent

Process results from calling the gateway

Functions

@spec call(map()) :: {:ok, term()} | {:error, term()}

This function makes a POST request to make a call via the Africa's talking call endpoint, this function accepts a map of parameters. sent

Parameters

attrs: - a map containing:

  • from - your Africa’s Talking phone number (in international format i.e. +XXXYYYYYY)
  • to - A comma separated string of recipients’ phone numbers.
  • clientRequestId - (optional) Variable sent to your Events Callback URL that can be used to tag the call

Example

iex> AtEx.Gateway.Voice.MakeCall.call(%{
...>   to: "+254728907896",
...>   from: "+254728900922",
...> })
{:ok, 
  %{
      "entries" => [
      %{
          "phoneNumber" => "+254728907896",
          "sessionId" => "ATVId_cb29c2b9fc27983827afc00786c4f9ea",
          "status" => "Queued"
      }
      ],
      "errorMessage" => "None"
  }}

Process results from calling the gateway