AtEx v0.20.21 AtEx.Gateway.Voice.CallTransfer View Source

This module has the call transfer functionality of AfricasTalking it allows you to transfer your call to another number by making a HTTP POST request to the Africas Talking voice endpoints.

Link to this section Summary

Functions

Process results from calling the gateway

This function makes a POST request to transfer a call to another number in the Africa's talking call endpoint, this function accepts a map of parameters. sent

Link to this section Types

Link to this type

option()

View Source
option() ::
  {: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

Process results from calling the gateway

Link to this function

transfer(attrs)

View Source
transfer(map()) :: {:ok, term()} | {:error, term()}

This function makes a POST request to transfer a call to another number in the Africa's talking call endpoint, this function accepts a map of parameters. sent

Parameters

attrs: - a map containing:

  • sessionId - Session Id of the ongoing call, it must have two legs
  • phoneNumber - Phone Number to transfer the call to.
  • callLeg - (optional) Call leg to transfer the call to either caller or callee(Defaults to callee)
  • holdMusicUrl - (optional) The url of the media file to be played when the user is on hold. Don’t forget to start with http://

Example

iex> AtEx.Gateway.Voice.CallTransfer.transfer(%{
...>   sessionId: "ATVId_47ef478e918923e7b2d0921ebd5b66a6",
...>   phoneNumber: "+254728900922",
...> })
{:ok, %{"callTransferResponse" => %{"errorMessage" => "None", "status" => "Success"}}}