AtEx v0.20.21 AtEx.Gateway.Voice.MakeCall View Source
This module holds the implementation for the HTTP Gateway that runs calls against the Africas Talking Voice API endpoints to make an outbound call
Link to this section 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
Link to this section Types
Link to this type
option()
View Sourceoption() :: {:method, Tesla.Env.method()} | {:url, Tesla.Env.url()} | {:query, Tesla.Env.query()} | {:headers, Tesla.Env.headers()} | {:body, Tesla.Env.body()} | {:opts, Tesla.Env.opts()}
Link to this section 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
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