View Source TwiML (TwiML v0.6.0)

Generate complex TwiML documents for Twilio in an elegant Elixir way.

Note

Please refer to the official TwiML documentation to verify that the TwiML verb actually supports content or the given attributes.

Examples

Say something:

iex> TwiML.say("Hello") |> TwiML.to_xml()
"""
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say>Hello</Say>
</Response>\
"""

Say 2 things, one after the other:

iex> TwiML.say("Hello") |> TwiML.say("world") |> TwiML.to_xml()
"""
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say>Hello</Say>
  <Say>world</Say>
</Response>\
"""

Say something in another voice:

iex> TwiML.say("Hello", voice: "woman") |> TwiML.to_xml()
"""
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say voice="woman">Hello</Say>
</Response>\
"""

Leaving the content empty for a TwiML verb, will create a TwiML element that has no body:

iex> TwiML.hangup() |> TwiML.to_xml()
"""
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Hangup/>
</Response>\
"""

You can embed TwiML tags into other tags using the into_* function:

iex> TwiML.say("Lets say this inside the gather")
...> |> TwiML.into_gather(language: "en-US", input: "speech")
...> |> TwiML.to_xml()
"""
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Gather language="en-US" input="speech">
    <Say>Lets say this inside the gather</Say>
  </Gather>
</Response>\
"""

If you have multiple TwiML tags you want to embed, that works too:

iex> TwiML.say("Hi")
...> |> TwiML.say("We cool?")
...> |> TwiML.into_gather(language: "en-US", input: "speech", hints: "yes, no")
...> |> TwiML.to_xml()
"""
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Gather language="en-US" input="speech" hints="yes, no">
    <Say>Hi</Say>
    <Say>We cool?</Say>
  </Gather>
</Response>\
"""

It is also possible to just include a few of the preceding tags into the body of another element. The 1 decides that we want to only put the last element into the Dial element's body:

iex> TwiML.say("Calling Yodel")
...> |> TwiML.number("+1 415-483-0400")
...> |> TwiML.into_dial(1)
...> |> TwiML.to_xml()
"""
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say>Calling Yodel</Say>
  <Dial>
    <Number>+1 415-483-0400</Number>
  </Dial>
</Response>\
"""

The into_* functions can take the number of preceding tags, attributes or both as arguments:

iex> TwiML.identity("venkman")
...> |> TwiML.into_client(1)
...> |> TwiML.identity("stantz")
...> |> TwiML.into_client(1, method: "GET")
...> |> TwiML.into_dial(caller: "+1 415-483-0400")
...> |> TwiML.to_xml()
"""
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Dial caller="+1 415-483-0400">
    <Client>
      <Identity>venkman</Identity>
    </Client>
    <Client method="GET">
      <Identity>stantz</Identity>
    </Client>
  </Dial>
</Response>\
"""

Multiple calls to into_* functions allow building complex nested TwiML structures without losing readability in the code due to nested function calls:

iex> TwiML.identity("venkman")
...> |> TwiML.parameter(name: "first_name", value: "Peter")
...> |> TwiML.parameter(name: "last_name", value: "Venkman")
...> |> TwiML.into_client(3)
...> |> TwiML.into_dial(1)
...> |> TwiML.to_xml()
"""
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Dial>
    <Client>
      <Identity>venkman</Identity>
      <Parameter name="first_name" value="Peter"/>
      <Parameter name="last_name" value="Venkman"/>
    </Client>
  </Dial>
</Response>\
"""

Attributes can be provided both as snake_case or camelCase, but the latter is preferred as the code looks more Elixir-like.

iex> TwiML.dial("+1 415-483-0400", recordingStatusCallback: "https://example.org", recording_status_callback_method: "POST")
...> |> TwiML.to_xml()
"""
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Dial recordingStatusCallback="https://example.org" recordingStatusCallbackMethod="POST">+1 415-483-0400</Dial>
</Response>\
"""

Safe binary strings, IO Data or CDATA are supported as well. Make sure to only mark actually safe data as safe!

iex> TwiML.say({:safe, "<tag>Hello World</tag>"})
...> |> TwiML.to_xml()
"""
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say><tag>Hello World</tag></Say>
</Response>\
"""

iex> TwiML.say({:iodata, [104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]})
...> |> TwiML.to_xml()
"""
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say>hello world</Say>
</Response>\
"""

iex> TwiML.say({:cdata, "<Hello>\\<World>"})
...> |> TwiML.to_xml()
"""
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say><![CDATA[<Hello>\\<World>]]></Say>
</Response>\
"""

This also works with attributes:

iex> TwiML.say({:safe, "<tag>Hello World</tag>"}, voice: "Polly.Joanna")
...> |> TwiML.to_xml()
"""
<?xml version="1.0" encoding="UTF-8\"?>
<Response>
  <Say voice="Polly.Joanna"><tag>Hello World</tag></Say>
</Response>\
"""

iex> TwiML.say({:iodata, [104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]}, voice: "Polly.Joanna")
...> |> TwiML.to_xml()
"""
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say voice="Polly.Joanna">hello world</Say>
</Response>\
"""

iex> TwiML.say({:cdata, "<Hello>\\<World>"}, voice: "Polly.Joanna")
...> |> TwiML.to_xml()
"""
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say voice="Polly.Joanna"><![CDATA[<Hello>\\<World>]]></Say>
</Response>\
"""

Comments can help with debugging (yes, they are somewhat ugly, until xml_builder properly supports them):

iex> TwiML.comment("Blocked because of insufficient funds")
...> |> TwiML.reject()
...> |> TwiML.to_xml()
"""
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <!-->Blocked because of insufficient funds</!-->
  <Reject/>
</Response>\
"""

And can also be chained:

iex> TwiML.say("Sorry, calls are currently unavailable")
...> |> TwiML.comment("Blocked because of insufficient funds")
...> |> TwiML.reject()
...> |> TwiML.to_xml()
"""
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say>Sorry, calls are currently unavailable</Say>
  <!-->Blocked because of insufficient funds</!-->
  <Reject/>
</Response>\
"""

Attributes with a value of nil are excluded from the generated TwiML:

iex> TwiML.gather(input: "dtmf", finish_on_key: "", num_digits: nil)
...> |> TwiML.to_xml()
"""
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Gather input="dtmf" finishOnKey=""/>
</Response>\
"""

Summary

Types

Content which can be used within a TwiML verb. Refer to the XmlBuilder documentation for more information.

t()

A TwiML document contains one or more TwiML verbs. These verbs can have attributes and can wrap nested TwiML verbs.

TwiML Verbs

Generates an empty <Application> verb.

Generates a <Application> verb.

Appends or generates a <Application> verb.

Appends a <Application> verb with attributes.

Generates an empty <Autopilot> verb.

Generates a <Autopilot> verb.

Appends or generates a <Autopilot> verb.

Appends a <Autopilot> verb with attributes.

Generates an empty <Client> verb.

Generates a <Client> verb.

Appends or generates a <Client> verb.

Appends a <Client> verb with attributes.

Generates an empty <Conference> verb.

Generates a <Conference> verb.

Appends or generates a <Conference> verb.

Appends a <Conference> verb with attributes.

Generates an empty <Connect> verb.

Generates a <Connect> verb.

Appends or generates a <Connect> verb.

Appends a <Connect> verb with attributes.

Generates an empty <Dial> verb.

Generates a <Dial> verb.

Appends or generates a <Dial> verb.

Appends a <Dial> verb with attributes.

Generates an empty <Enqueue> verb.

Generates a <Enqueue> verb.

Appends or generates a <Enqueue> verb.

Appends a <Enqueue> verb with attributes.

Generates an empty <Gather> verb.

Generates a <Gather> verb.

Appends or generates a <Gather> verb.

Appends a <Gather> verb with attributes.

Generates an empty <Hangup> verb.

Generates a <Hangup> verb.

Appends or generates a <Hangup> verb.

Appends a <Hangup> verb with attributes.

Generates an empty <Identity> verb.

Generates a <Identity> verb.

Appends or generates a <Identity> verb.

Appends a <Identity> verb with attributes.

Wraps preceding TwiML verbs in a <Application> verb.

Wraps preceding TwiML verbs in a <Application> verb with attributes.

Wraps preceding TwiML verbs in a <Autopilot> verb.

Wraps preceding TwiML verbs in a <Autopilot> verb with attributes.

Wraps preceding TwiML verbs in a <Client> verb.

Wraps preceding TwiML verbs in a <Client> verb with attributes.

Wraps preceding TwiML verbs in a <Conference> verb.

Wraps preceding TwiML verbs in a <Conference> verb with attributes.

Wraps preceding TwiML verbs in a <Connect> verb.

Wraps preceding TwiML verbs in a <Connect> verb with attributes.

Wraps preceding TwiML verbs in a <Dial> verb.

Wraps preceding TwiML verbs in a <Dial> verb with attributes.

Wraps preceding TwiML verbs in a <Enqueue> verb.

Wraps preceding TwiML verbs in a <Enqueue> verb with attributes.

Wraps preceding TwiML verbs in a <Gather> verb.

Wraps preceding TwiML verbs in a <Gather> verb with attributes.

Wraps preceding TwiML verbs in a <Hangup> verb.

Wraps preceding TwiML verbs in a <Hangup> verb with attributes.

Wraps preceding TwiML verbs in a <Identity> verb.

Wraps preceding TwiML verbs in a <Identity> verb with attributes.

Wraps preceding TwiML verbs in a <Leave> verb.

Wraps preceding TwiML verbs in a <Leave> verb with attributes.

Wraps preceding TwiML verbs in a <Number> verb.

Wraps preceding TwiML verbs in a <Number> verb with attributes.

Wraps preceding TwiML verbs in a <Parameter> verb.

Wraps preceding TwiML verbs in a <Parameter> verb with attributes.

Wraps preceding TwiML verbs in a <Pause> verb.

Wraps preceding TwiML verbs in a <Pause> verb with attributes.

Wraps preceding TwiML verbs in a <Pay> verb.

Wraps preceding TwiML verbs in a <Pay> verb with attributes.

Wraps preceding TwiML verbs in a <Play> verb.

Wraps preceding TwiML verbs in a <Play> verb with attributes.

Wraps preceding TwiML verbs in a <Prompt> verb.

Wraps preceding TwiML verbs in a <Prompt> verb with attributes.

Wraps preceding TwiML verbs in a <Queue> verb.

Wraps preceding TwiML verbs in a <Queue> verb with attributes.

Wraps preceding TwiML verbs in a <Record> verb.

Wraps preceding TwiML verbs in a <Record> verb with attributes.

Wraps preceding TwiML verbs in a <Redirect> verb.

Wraps preceding TwiML verbs in a <Redirect> verb with attributes.

Wraps preceding TwiML verbs in a <Refer> verb.

Wraps preceding TwiML verbs in a <Refer> verb with attributes.

Wraps preceding TwiML verbs in a <Reject> verb.

Wraps preceding TwiML verbs in a <Reject> verb with attributes.

Wraps preceding TwiML verbs in a <Say> verb.

Wraps preceding TwiML verbs in a <Say> verb with attributes.

Wraps preceding TwiML verbs in a <Sim> verb.

Wraps preceding TwiML verbs in a <Sim> verb with attributes.

Wraps preceding TwiML verbs in a <Sip> verb.

Wraps preceding TwiML verbs in a <Sip> verb with attributes.

Wraps preceding TwiML verbs in a <Siprec> verb.

Wraps preceding TwiML verbs in a <Siprec> verb with attributes.

Wraps preceding TwiML verbs in a <Stream> verb.

Wraps preceding TwiML verbs in a <Stream> verb with attributes.

Wraps preceding TwiML verbs in a <VirtualAgent> verb.

Wraps preceding TwiML verbs in a <VirtualAgent> verb with attributes.

Generates an empty <Leave> verb.

Generates a <Leave> verb.

Appends or generates a <Leave> verb.

Appends a <Leave> verb with attributes.

Generates an empty <Number> verb.

Generates a <Number> verb.

Appends or generates a <Number> verb.

Appends a <Number> verb with attributes.

Generates an empty <Parameter> verb.

Generates a <Parameter> verb.

Appends or generates a <Parameter> verb.

Appends a <Parameter> verb with attributes.

Generates an empty <Pause> verb.

Generates a <Pause> verb.

Appends or generates a <Pause> verb.

Appends a <Pause> verb with attributes.

Generates an empty <Pay> verb.

Generates a <Pay> verb.

Appends or generates a <Pay> verb.

Appends a <Pay> verb with attributes.

Generates an empty <Play> verb.

Generates a <Play> verb.

Appends or generates a <Play> verb.

Appends a <Play> verb with attributes.

Generates an empty <Prompt> verb.

Generates a <Prompt> verb.

Appends or generates a <Prompt> verb.

Appends a <Prompt> verb with attributes.

Generates an empty <Queue> verb.

Generates a <Queue> verb.

Appends or generates a <Queue> verb.

Appends a <Queue> verb with attributes.

Generates an empty <Record> verb.

Generates a <Record> verb.

Appends or generates a <Record> verb.

Appends a <Record> verb with attributes.

Generates an empty <Redirect> verb.

Generates a <Redirect> verb.

Appends or generates a <Redirect> verb.

Appends a <Redirect> verb with attributes.

Generates an empty <Refer> verb.

Generates a <Refer> verb.

Appends or generates a <Refer> verb.

Appends a <Refer> verb with attributes.

Generates an empty <Reject> verb.

Generates a <Reject> verb.

Appends or generates a <Reject> verb.

Appends a <Reject> verb with attributes.

Generates an empty <Say> verb.

Generates a <Say> verb.

Appends or generates a <Say> verb.

Appends a <Say> verb with attributes.

Generates an empty <Sim> verb.

Generates a <Sim> verb.

Appends or generates a <Sim> verb.

Appends a <Sim> verb with attributes.

Generates an empty <Sip> verb.

Generates a <Sip> verb.

Appends or generates a <Sip> verb.

Appends a <Sip> verb with attributes.

Generates an empty <Siprec> verb.

Generates a <Siprec> verb.

Appends or generates a <Siprec> verb.

Appends a <Siprec> verb with attributes.

Generates an empty <Stream> verb.

Generates a <Stream> verb.

Appends or generates a <Stream> verb.

Appends a <Stream> verb with attributes.

Generates an empty <VirtualAgent> verb.

Generates a <VirtualAgent> verb.

Appends or generates a <VirtualAgent> verb.

Appends a <VirtualAgent> verb with attributes.

Functions

Generates a comment.

Appends a comment to the TwiML.

Generates a XML document from the provided verbs and arguments. For the supported opts, please refer to the documentation of XmlBuilder.generate/2.

Types

@type content() ::
  binary() | {:safe, binary()} | {:cdata, binary()} | {:iodata, binary()}

Content which can be used within a TwiML verb. Refer to the XmlBuilder documentation for more information.

@type t() :: [{atom(), keyword(), content() | t()}]

A TwiML document contains one or more TwiML verbs. These verbs can have attributes and can wrap nested TwiML verbs.

TwiML Verbs

@spec application() :: t()

Generates an empty <Application> verb.

@spec application(content() | keyword() | t()) :: t()

Generates a <Application> verb.

There are three supported usages:

  • Wraps arg in <Application> if it's TwiML.content/0.
  • Creates an empty <Application> with attributes for arg as a keyword list.
  • Appends an empty <Application> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

application(verbs_or_content, content_or_attrs)

View Source
@spec application(t(), keyword() | content()) :: t()
@spec application(
  content(),
  keyword()
) :: t()

Appends or generates a <Application> verb.

There are two supported usages:

  • Appends <Application> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Application> with attributes if content_or_attrs is a keyword list.
Link to this function

application(verbs, content, attrs)

View Source
@spec application(t(), content(), keyword()) :: t()

Appends a <Application> verb with attributes.

Adds a <Application> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec autopilot() :: t()

Generates an empty <Autopilot> verb.

@spec autopilot(content() | keyword() | t()) :: t()

Generates a <Autopilot> verb.

There are three supported usages:

  • Wraps arg in <Autopilot> if it's TwiML.content/0.
  • Creates an empty <Autopilot> with attributes for arg as a keyword list.
  • Appends an empty <Autopilot> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

autopilot(verbs_or_content, content_or_attrs)

View Source
@spec autopilot(t(), keyword() | content()) :: t()
@spec autopilot(
  content(),
  keyword()
) :: t()

Appends or generates a <Autopilot> verb.

There are two supported usages:

  • Appends <Autopilot> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Autopilot> with attributes if content_or_attrs is a keyword list.
Link to this function

autopilot(verbs, content, attrs)

View Source
@spec autopilot(t(), content(), keyword()) :: t()

Appends a <Autopilot> verb with attributes.

Adds a <Autopilot> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec client() :: t()

Generates an empty <Client> verb.

@spec client(content() | keyword() | t()) :: t()

Generates a <Client> verb.

There are three supported usages:

  • Wraps arg in <Client> if it's TwiML.content/0.
  • Creates an empty <Client> with attributes for arg as a keyword list.
  • Appends an empty <Client> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

client(verbs_or_content, content_or_attrs)

View Source
@spec client(t(), keyword() | content()) :: t()
@spec client(
  content(),
  keyword()
) :: t()

Appends or generates a <Client> verb.

There are two supported usages:

  • Appends <Client> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Client> with attributes if content_or_attrs is a keyword list.
Link to this function

client(verbs, content, attrs)

View Source
@spec client(t(), content(), keyword()) :: t()

Appends a <Client> verb with attributes.

Adds a <Client> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec conference() :: t()

Generates an empty <Conference> verb.

@spec conference(content() | keyword() | t()) :: t()

Generates a <Conference> verb.

There are three supported usages:

  • Wraps arg in <Conference> if it's TwiML.content/0.
  • Creates an empty <Conference> with attributes for arg as a keyword list.
  • Appends an empty <Conference> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

conference(verbs_or_content, content_or_attrs)

View Source
@spec conference(t(), keyword() | content()) :: t()
@spec conference(
  content(),
  keyword()
) :: t()

Appends or generates a <Conference> verb.

There are two supported usages:

  • Appends <Conference> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Conference> with attributes if content_or_attrs is a keyword list.
Link to this function

conference(verbs, content, attrs)

View Source
@spec conference(t(), content(), keyword()) :: t()

Appends a <Conference> verb with attributes.

Adds a <Conference> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec connect() :: t()

Generates an empty <Connect> verb.

@spec connect(content() | keyword() | t()) :: t()

Generates a <Connect> verb.

There are three supported usages:

  • Wraps arg in <Connect> if it's TwiML.content/0.
  • Creates an empty <Connect> with attributes for arg as a keyword list.
  • Appends an empty <Connect> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

connect(verbs_or_content, content_or_attrs)

View Source
@spec connect(t(), keyword() | content()) :: t()
@spec connect(
  content(),
  keyword()
) :: t()

Appends or generates a <Connect> verb.

There are two supported usages:

  • Appends <Connect> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Connect> with attributes if content_or_attrs is a keyword list.
Link to this function

connect(verbs, content, attrs)

View Source
@spec connect(t(), content(), keyword()) :: t()

Appends a <Connect> verb with attributes.

Adds a <Connect> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec dial() :: t()

Generates an empty <Dial> verb.

@spec dial(content() | keyword() | t()) :: t()

Generates a <Dial> verb.

There are three supported usages:

  • Wraps arg in <Dial> if it's TwiML.content/0.
  • Creates an empty <Dial> with attributes for arg as a keyword list.
  • Appends an empty <Dial> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

dial(verbs_or_content, content_or_attrs)

View Source
@spec dial(t(), keyword() | content()) :: t()
@spec dial(
  content(),
  keyword()
) :: t()

Appends or generates a <Dial> verb.

There are two supported usages:

  • Appends <Dial> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Dial> with attributes if content_or_attrs is a keyword list.
Link to this function

dial(verbs, content, attrs)

View Source
@spec dial(t(), content(), keyword()) :: t()

Appends a <Dial> verb with attributes.

Adds a <Dial> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec enqueue() :: t()

Generates an empty <Enqueue> verb.

@spec enqueue(content() | keyword() | t()) :: t()

Generates a <Enqueue> verb.

There are three supported usages:

  • Wraps arg in <Enqueue> if it's TwiML.content/0.
  • Creates an empty <Enqueue> with attributes for arg as a keyword list.
  • Appends an empty <Enqueue> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

enqueue(verbs_or_content, content_or_attrs)

View Source
@spec enqueue(t(), keyword() | content()) :: t()
@spec enqueue(
  content(),
  keyword()
) :: t()

Appends or generates a <Enqueue> verb.

There are two supported usages:

  • Appends <Enqueue> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Enqueue> with attributes if content_or_attrs is a keyword list.
Link to this function

enqueue(verbs, content, attrs)

View Source
@spec enqueue(t(), content(), keyword()) :: t()

Appends a <Enqueue> verb with attributes.

Adds a <Enqueue> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec gather() :: t()

Generates an empty <Gather> verb.

@spec gather(content() | keyword() | t()) :: t()

Generates a <Gather> verb.

There are three supported usages:

  • Wraps arg in <Gather> if it's TwiML.content/0.
  • Creates an empty <Gather> with attributes for arg as a keyword list.
  • Appends an empty <Gather> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

gather(verbs_or_content, content_or_attrs)

View Source
@spec gather(t(), keyword() | content()) :: t()
@spec gather(
  content(),
  keyword()
) :: t()

Appends or generates a <Gather> verb.

There are two supported usages:

  • Appends <Gather> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Gather> with attributes if content_or_attrs is a keyword list.
Link to this function

gather(verbs, content, attrs)

View Source
@spec gather(t(), content(), keyword()) :: t()

Appends a <Gather> verb with attributes.

Adds a <Gather> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec hangup() :: t()

Generates an empty <Hangup> verb.

@spec hangup(content() | keyword() | t()) :: t()

Generates a <Hangup> verb.

There are three supported usages:

  • Wraps arg in <Hangup> if it's TwiML.content/0.
  • Creates an empty <Hangup> with attributes for arg as a keyword list.
  • Appends an empty <Hangup> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

hangup(verbs_or_content, content_or_attrs)

View Source
@spec hangup(t(), keyword() | content()) :: t()
@spec hangup(
  content(),
  keyword()
) :: t()

Appends or generates a <Hangup> verb.

There are two supported usages:

  • Appends <Hangup> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Hangup> with attributes if content_or_attrs is a keyword list.
Link to this function

hangup(verbs, content, attrs)

View Source
@spec hangup(t(), content(), keyword()) :: t()

Appends a <Hangup> verb with attributes.

Adds a <Hangup> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec identity() :: t()

Generates an empty <Identity> verb.

@spec identity(content() | keyword() | t()) :: t()

Generates a <Identity> verb.

There are three supported usages:

  • Wraps arg in <Identity> if it's TwiML.content/0.
  • Creates an empty <Identity> with attributes for arg as a keyword list.
  • Appends an empty <Identity> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

identity(verbs_or_content, content_or_attrs)

View Source
@spec identity(t(), keyword() | content()) :: t()
@spec identity(
  content(),
  keyword()
) :: t()

Appends or generates a <Identity> verb.

There are two supported usages:

  • Appends <Identity> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Identity> with attributes if content_or_attrs is a keyword list.
Link to this function

identity(verbs, content, attrs)

View Source
@spec identity(t(), content(), keyword()) :: t()

Appends a <Identity> verb with attributes.

Adds a <Identity> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

Link to this function

into_application(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_application(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Application> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Application> if it's a keyword list.
  • Wraps all preceding verbs in <Application> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Application> if it's a positive integer.
Link to this function

into_application(verbs, last_n_elements, attrs)

View Source
@spec into_application(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Application> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Application> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Application> using attrs as attribute if it's a positive integer.
Link to this function

into_autopilot(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_autopilot(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Autopilot> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Autopilot> if it's a keyword list.
  • Wraps all preceding verbs in <Autopilot> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Autopilot> if it's a positive integer.
Link to this function

into_autopilot(verbs, last_n_elements, attrs)

View Source
@spec into_autopilot(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Autopilot> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Autopilot> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Autopilot> using attrs as attribute if it's a positive integer.
Link to this function

into_client(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_client(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Client> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Client> if it's a keyword list.
  • Wraps all preceding verbs in <Client> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Client> if it's a positive integer.
Link to this function

into_client(verbs, last_n_elements, attrs)

View Source
@spec into_client(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Client> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Client> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Client> using attrs as attribute if it's a positive integer.
Link to this function

into_conference(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_conference(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Conference> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Conference> if it's a keyword list.
  • Wraps all preceding verbs in <Conference> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Conference> if it's a positive integer.
Link to this function

into_conference(verbs, last_n_elements, attrs)

View Source
@spec into_conference(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Conference> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Conference> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Conference> using attrs as attribute if it's a positive integer.
Link to this function

into_connect(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_connect(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Connect> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Connect> if it's a keyword list.
  • Wraps all preceding verbs in <Connect> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Connect> if it's a positive integer.
Link to this function

into_connect(verbs, last_n_elements, attrs)

View Source
@spec into_connect(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Connect> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Connect> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Connect> using attrs as attribute if it's a positive integer.
Link to this function

into_dial(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_dial(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Dial> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Dial> if it's a keyword list.
  • Wraps all preceding verbs in <Dial> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Dial> if it's a positive integer.
Link to this function

into_dial(verbs, last_n_elements, attrs)

View Source
@spec into_dial(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Dial> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Dial> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Dial> using attrs as attribute if it's a positive integer.
Link to this function

into_enqueue(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_enqueue(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Enqueue> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Enqueue> if it's a keyword list.
  • Wraps all preceding verbs in <Enqueue> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Enqueue> if it's a positive integer.
Link to this function

into_enqueue(verbs, last_n_elements, attrs)

View Source
@spec into_enqueue(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Enqueue> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Enqueue> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Enqueue> using attrs as attribute if it's a positive integer.
Link to this function

into_gather(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_gather(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Gather> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Gather> if it's a keyword list.
  • Wraps all preceding verbs in <Gather> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Gather> if it's a positive integer.
Link to this function

into_gather(verbs, last_n_elements, attrs)

View Source
@spec into_gather(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Gather> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Gather> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Gather> using attrs as attribute if it's a positive integer.
Link to this function

into_hangup(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_hangup(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Hangup> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Hangup> if it's a keyword list.
  • Wraps all preceding verbs in <Hangup> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Hangup> if it's a positive integer.
Link to this function

into_hangup(verbs, last_n_elements, attrs)

View Source
@spec into_hangup(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Hangup> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Hangup> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Hangup> using attrs as attribute if it's a positive integer.
Link to this function

into_identity(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_identity(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Identity> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Identity> if it's a keyword list.
  • Wraps all preceding verbs in <Identity> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Identity> if it's a positive integer.
Link to this function

into_identity(verbs, last_n_elements, attrs)

View Source
@spec into_identity(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Identity> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Identity> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Identity> using attrs as attribute if it's a positive integer.
Link to this function

into_leave(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_leave(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Leave> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Leave> if it's a keyword list.
  • Wraps all preceding verbs in <Leave> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Leave> if it's a positive integer.
Link to this function

into_leave(verbs, last_n_elements, attrs)

View Source
@spec into_leave(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Leave> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Leave> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Leave> using attrs as attribute if it's a positive integer.
Link to this function

into_number(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_number(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Number> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Number> if it's a keyword list.
  • Wraps all preceding verbs in <Number> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Number> if it's a positive integer.
Link to this function

into_number(verbs, last_n_elements, attrs)

View Source
@spec into_number(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Number> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Number> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Number> using attrs as attribute if it's a positive integer.
Link to this function

into_parameter(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_parameter(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Parameter> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Parameter> if it's a keyword list.
  • Wraps all preceding verbs in <Parameter> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Parameter> if it's a positive integer.
Link to this function

into_parameter(verbs, last_n_elements, attrs)

View Source
@spec into_parameter(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Parameter> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Parameter> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Parameter> using attrs as attribute if it's a positive integer.
Link to this function

into_pause(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_pause(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Pause> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Pause> if it's a keyword list.
  • Wraps all preceding verbs in <Pause> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Pause> if it's a positive integer.
Link to this function

into_pause(verbs, last_n_elements, attrs)

View Source
@spec into_pause(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Pause> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Pause> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Pause> using attrs as attribute if it's a positive integer.
Link to this function

into_pay(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_pay(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Pay> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Pay> if it's a keyword list.
  • Wraps all preceding verbs in <Pay> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Pay> if it's a positive integer.
Link to this function

into_pay(verbs, last_n_elements, attrs)

View Source
@spec into_pay(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Pay> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Pay> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Pay> using attrs as attribute if it's a positive integer.
Link to this function

into_play(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_play(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Play> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Play> if it's a keyword list.
  • Wraps all preceding verbs in <Play> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Play> if it's a positive integer.
Link to this function

into_play(verbs, last_n_elements, attrs)

View Source
@spec into_play(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Play> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Play> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Play> using attrs as attribute if it's a positive integer.
Link to this function

into_prompt(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_prompt(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Prompt> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Prompt> if it's a keyword list.
  • Wraps all preceding verbs in <Prompt> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Prompt> if it's a positive integer.
Link to this function

into_prompt(verbs, last_n_elements, attrs)

View Source
@spec into_prompt(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Prompt> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Prompt> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Prompt> using attrs as attribute if it's a positive integer.
Link to this function

into_queue(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_queue(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Queue> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Queue> if it's a keyword list.
  • Wraps all preceding verbs in <Queue> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Queue> if it's a positive integer.
Link to this function

into_queue(verbs, last_n_elements, attrs)

View Source
@spec into_queue(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Queue> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Queue> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Queue> using attrs as attribute if it's a positive integer.
Link to this function

into_record(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_record(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Record> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Record> if it's a keyword list.
  • Wraps all preceding verbs in <Record> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Record> if it's a positive integer.
Link to this function

into_record(verbs, last_n_elements, attrs)

View Source
@spec into_record(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Record> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Record> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Record> using attrs as attribute if it's a positive integer.
Link to this function

into_redirect(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_redirect(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Redirect> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Redirect> if it's a keyword list.
  • Wraps all preceding verbs in <Redirect> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Redirect> if it's a positive integer.
Link to this function

into_redirect(verbs, last_n_elements, attrs)

View Source
@spec into_redirect(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Redirect> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Redirect> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Redirect> using attrs as attribute if it's a positive integer.
Link to this function

into_refer(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_refer(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Refer> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Refer> if it's a keyword list.
  • Wraps all preceding verbs in <Refer> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Refer> if it's a positive integer.
Link to this function

into_refer(verbs, last_n_elements, attrs)

View Source
@spec into_refer(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Refer> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Refer> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Refer> using attrs as attribute if it's a positive integer.
Link to this function

into_reject(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_reject(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Reject> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Reject> if it's a keyword list.
  • Wraps all preceding verbs in <Reject> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Reject> if it's a positive integer.
Link to this function

into_reject(verbs, last_n_elements, attrs)

View Source
@spec into_reject(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Reject> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Reject> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Reject> using attrs as attribute if it's a positive integer.
Link to this function

into_say(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_say(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Say> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Say> if it's a keyword list.
  • Wraps all preceding verbs in <Say> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Say> if it's a positive integer.
Link to this function

into_say(verbs, last_n_elements, attrs)

View Source
@spec into_say(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Say> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Say> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Say> using attrs as attribute if it's a positive integer.
Link to this function

into_sim(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_sim(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Sim> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Sim> if it's a keyword list.
  • Wraps all preceding verbs in <Sim> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Sim> if it's a positive integer.
Link to this function

into_sim(verbs, last_n_elements, attrs)

View Source
@spec into_sim(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Sim> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Sim> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Sim> using attrs as attribute if it's a positive integer.
Link to this function

into_sip(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_sip(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Sip> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Sip> if it's a keyword list.
  • Wraps all preceding verbs in <Sip> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Sip> if it's a positive integer.
Link to this function

into_sip(verbs, last_n_elements, attrs)

View Source
@spec into_sip(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Sip> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Sip> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Sip> using attrs as attribute if it's a positive integer.
Link to this function

into_siprec(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_siprec(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Siprec> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Siprec> if it's a keyword list.
  • Wraps all preceding verbs in <Siprec> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Siprec> if it's a positive integer.
Link to this function

into_siprec(verbs, last_n_elements, attrs)

View Source
@spec into_siprec(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Siprec> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Siprec> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Siprec> using attrs as attribute if it's a positive integer.
Link to this function

into_stream(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_stream(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <Stream> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <Stream> if it's a keyword list.
  • Wraps all preceding verbs in <Stream> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <Stream> if it's a positive integer.
Link to this function

into_stream(verbs, last_n_elements, attrs)

View Source
@spec into_stream(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <Stream> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <Stream> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <Stream> using attrs as attribute if it's a positive integer.
Link to this function

into_virtual_agent(verbs, attrs_or_last_n_elements \\ :all)

View Source
@spec into_virtual_agent(t(), keyword() | :all | pos_integer()) :: t()

Wraps preceding TwiML verbs in a <VirtualAgent> verb.

There are three supported usages:

  • Uses attrs_or_last_n_elements as attributes to wrap all preceding verbs in <VirtualAgent> if it's a keyword list.
  • Wraps all preceding verbs in <VirtualAgent> if attrs_or_last_n_elements is :all.
  • Encloses the last attrs_or_last_n_elements verbs in <VirtualAgent> if it's a positive integer.
Link to this function

into_virtual_agent(verbs, last_n_elements, attrs)

View Source
@spec into_virtual_agent(t(), :all | pos_integer(), keyword()) :: t()

Wraps preceding TwiML verbs in a <VirtualAgent> verb with attributes.

There are three supported usages:

  • Wraps all preceding verbs in <VirtualAgent> using attrs as attributes if last_n_elements is :all.
  • Encloses the last last_n_elements verbs in <VirtualAgent> using attrs as attribute if it's a positive integer.
@spec leave() :: t()

Generates an empty <Leave> verb.

@spec leave(content() | keyword() | t()) :: t()

Generates a <Leave> verb.

There are three supported usages:

  • Wraps arg in <Leave> if it's TwiML.content/0.
  • Creates an empty <Leave> with attributes for arg as a keyword list.
  • Appends an empty <Leave> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

leave(verbs_or_content, content_or_attrs)

View Source
@spec leave(t(), keyword() | content()) :: t()
@spec leave(
  content(),
  keyword()
) :: t()

Appends or generates a <Leave> verb.

There are two supported usages:

  • Appends <Leave> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Leave> with attributes if content_or_attrs is a keyword list.
Link to this function

leave(verbs, content, attrs)

View Source
@spec leave(t(), content(), keyword()) :: t()

Appends a <Leave> verb with attributes.

Adds a <Leave> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec number() :: t()

Generates an empty <Number> verb.

@spec number(content() | keyword() | t()) :: t()

Generates a <Number> verb.

There are three supported usages:

  • Wraps arg in <Number> if it's TwiML.content/0.
  • Creates an empty <Number> with attributes for arg as a keyword list.
  • Appends an empty <Number> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

number(verbs_or_content, content_or_attrs)

View Source
@spec number(t(), keyword() | content()) :: t()
@spec number(
  content(),
  keyword()
) :: t()

Appends or generates a <Number> verb.

There are two supported usages:

  • Appends <Number> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Number> with attributes if content_or_attrs is a keyword list.
Link to this function

number(verbs, content, attrs)

View Source
@spec number(t(), content(), keyword()) :: t()

Appends a <Number> verb with attributes.

Adds a <Number> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec parameter() :: t()

Generates an empty <Parameter> verb.

@spec parameter(content() | keyword() | t()) :: t()

Generates a <Parameter> verb.

There are three supported usages:

  • Wraps arg in <Parameter> if it's TwiML.content/0.
  • Creates an empty <Parameter> with attributes for arg as a keyword list.
  • Appends an empty <Parameter> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

parameter(verbs_or_content, content_or_attrs)

View Source
@spec parameter(t(), keyword() | content()) :: t()
@spec parameter(
  content(),
  keyword()
) :: t()

Appends or generates a <Parameter> verb.

There are two supported usages:

  • Appends <Parameter> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Parameter> with attributes if content_or_attrs is a keyword list.
Link to this function

parameter(verbs, content, attrs)

View Source
@spec parameter(t(), content(), keyword()) :: t()

Appends a <Parameter> verb with attributes.

Adds a <Parameter> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec pause() :: t()

Generates an empty <Pause> verb.

@spec pause(content() | keyword() | t()) :: t()

Generates a <Pause> verb.

There are three supported usages:

  • Wraps arg in <Pause> if it's TwiML.content/0.
  • Creates an empty <Pause> with attributes for arg as a keyword list.
  • Appends an empty <Pause> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

pause(verbs_or_content, content_or_attrs)

View Source
@spec pause(t(), keyword() | content()) :: t()
@spec pause(
  content(),
  keyword()
) :: t()

Appends or generates a <Pause> verb.

There are two supported usages:

  • Appends <Pause> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Pause> with attributes if content_or_attrs is a keyword list.
Link to this function

pause(verbs, content, attrs)

View Source
@spec pause(t(), content(), keyword()) :: t()

Appends a <Pause> verb with attributes.

Adds a <Pause> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec pay() :: t()

Generates an empty <Pay> verb.

@spec pay(content() | keyword() | t()) :: t()

Generates a <Pay> verb.

There are three supported usages:

  • Wraps arg in <Pay> if it's TwiML.content/0.
  • Creates an empty <Pay> with attributes for arg as a keyword list.
  • Appends an empty <Pay> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

pay(verbs_or_content, content_or_attrs)

View Source
@spec pay(t(), keyword() | content()) :: t()
@spec pay(
  content(),
  keyword()
) :: t()

Appends or generates a <Pay> verb.

There are two supported usages:

  • Appends <Pay> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Pay> with attributes if content_or_attrs is a keyword list.
Link to this function

pay(verbs, content, attrs)

View Source
@spec pay(t(), content(), keyword()) :: t()

Appends a <Pay> verb with attributes.

Adds a <Pay> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec play() :: t()

Generates an empty <Play> verb.

@spec play(content() | keyword() | t()) :: t()

Generates a <Play> verb.

There are three supported usages:

  • Wraps arg in <Play> if it's TwiML.content/0.
  • Creates an empty <Play> with attributes for arg as a keyword list.
  • Appends an empty <Play> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

play(verbs_or_content, content_or_attrs)

View Source
@spec play(t(), keyword() | content()) :: t()
@spec play(
  content(),
  keyword()
) :: t()

Appends or generates a <Play> verb.

There are two supported usages:

  • Appends <Play> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Play> with attributes if content_or_attrs is a keyword list.
Link to this function

play(verbs, content, attrs)

View Source
@spec play(t(), content(), keyword()) :: t()

Appends a <Play> verb with attributes.

Adds a <Play> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec prompt() :: t()

Generates an empty <Prompt> verb.

@spec prompt(content() | keyword() | t()) :: t()

Generates a <Prompt> verb.

There are three supported usages:

  • Wraps arg in <Prompt> if it's TwiML.content/0.
  • Creates an empty <Prompt> with attributes for arg as a keyword list.
  • Appends an empty <Prompt> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

prompt(verbs_or_content, content_or_attrs)

View Source
@spec prompt(t(), keyword() | content()) :: t()
@spec prompt(
  content(),
  keyword()
) :: t()

Appends or generates a <Prompt> verb.

There are two supported usages:

  • Appends <Prompt> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Prompt> with attributes if content_or_attrs is a keyword list.
Link to this function

prompt(verbs, content, attrs)

View Source
@spec prompt(t(), content(), keyword()) :: t()

Appends a <Prompt> verb with attributes.

Adds a <Prompt> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec queue() :: t()

Generates an empty <Queue> verb.

@spec queue(content() | keyword() | t()) :: t()

Generates a <Queue> verb.

There are three supported usages:

  • Wraps arg in <Queue> if it's TwiML.content/0.
  • Creates an empty <Queue> with attributes for arg as a keyword list.
  • Appends an empty <Queue> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

queue(verbs_or_content, content_or_attrs)

View Source
@spec queue(t(), keyword() | content()) :: t()
@spec queue(
  content(),
  keyword()
) :: t()

Appends or generates a <Queue> verb.

There are two supported usages:

  • Appends <Queue> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Queue> with attributes if content_or_attrs is a keyword list.
Link to this function

queue(verbs, content, attrs)

View Source
@spec queue(t(), content(), keyword()) :: t()

Appends a <Queue> verb with attributes.

Adds a <Queue> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec record() :: t()

Generates an empty <Record> verb.

@spec record(content() | keyword() | t()) :: t()

Generates a <Record> verb.

There are three supported usages:

  • Wraps arg in <Record> if it's TwiML.content/0.
  • Creates an empty <Record> with attributes for arg as a keyword list.
  • Appends an empty <Record> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

record(verbs_or_content, content_or_attrs)

View Source
@spec record(t(), keyword() | content()) :: t()
@spec record(
  content(),
  keyword()
) :: t()

Appends or generates a <Record> verb.

There are two supported usages:

  • Appends <Record> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Record> with attributes if content_or_attrs is a keyword list.
Link to this function

record(verbs, content, attrs)

View Source
@spec record(t(), content(), keyword()) :: t()

Appends a <Record> verb with attributes.

Adds a <Record> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec redirect() :: t()

Generates an empty <Redirect> verb.

@spec redirect(content() | keyword() | t()) :: t()

Generates a <Redirect> verb.

There are three supported usages:

  • Wraps arg in <Redirect> if it's TwiML.content/0.
  • Creates an empty <Redirect> with attributes for arg as a keyword list.
  • Appends an empty <Redirect> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

redirect(verbs_or_content, content_or_attrs)

View Source
@spec redirect(t(), keyword() | content()) :: t()
@spec redirect(
  content(),
  keyword()
) :: t()

Appends or generates a <Redirect> verb.

There are two supported usages:

  • Appends <Redirect> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Redirect> with attributes if content_or_attrs is a keyword list.
Link to this function

redirect(verbs, content, attrs)

View Source
@spec redirect(t(), content(), keyword()) :: t()

Appends a <Redirect> verb with attributes.

Adds a <Redirect> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec refer() :: t()

Generates an empty <Refer> verb.

@spec refer(content() | keyword() | t()) :: t()

Generates a <Refer> verb.

There are three supported usages:

  • Wraps arg in <Refer> if it's TwiML.content/0.
  • Creates an empty <Refer> with attributes for arg as a keyword list.
  • Appends an empty <Refer> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

refer(verbs_or_content, content_or_attrs)

View Source
@spec refer(t(), keyword() | content()) :: t()
@spec refer(
  content(),
  keyword()
) :: t()

Appends or generates a <Refer> verb.

There are two supported usages:

  • Appends <Refer> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Refer> with attributes if content_or_attrs is a keyword list.
Link to this function

refer(verbs, content, attrs)

View Source
@spec refer(t(), content(), keyword()) :: t()

Appends a <Refer> verb with attributes.

Adds a <Refer> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec reject() :: t()

Generates an empty <Reject> verb.

@spec reject(content() | keyword() | t()) :: t()

Generates a <Reject> verb.

There are three supported usages:

  • Wraps arg in <Reject> if it's TwiML.content/0.
  • Creates an empty <Reject> with attributes for arg as a keyword list.
  • Appends an empty <Reject> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

reject(verbs_or_content, content_or_attrs)

View Source
@spec reject(t(), keyword() | content()) :: t()
@spec reject(
  content(),
  keyword()
) :: t()

Appends or generates a <Reject> verb.

There are two supported usages:

  • Appends <Reject> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Reject> with attributes if content_or_attrs is a keyword list.
Link to this function

reject(verbs, content, attrs)

View Source
@spec reject(t(), content(), keyword()) :: t()

Appends a <Reject> verb with attributes.

Adds a <Reject> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec say() :: t()

Generates an empty <Say> verb.

@spec say(content() | keyword() | t()) :: t()

Generates a <Say> verb.

There are three supported usages:

  • Wraps arg in <Say> if it's TwiML.content/0.
  • Creates an empty <Say> with attributes for arg as a keyword list.
  • Appends an empty <Say> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

say(verbs_or_content, content_or_attrs)

View Source
@spec say(t(), keyword() | content()) :: t()
@spec say(
  content(),
  keyword()
) :: t()

Appends or generates a <Say> verb.

There are two supported usages:

  • Appends <Say> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Say> with attributes if content_or_attrs is a keyword list.
Link to this function

say(verbs, content, attrs)

View Source
@spec say(t(), content(), keyword()) :: t()

Appends a <Say> verb with attributes.

Adds a <Say> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec sim() :: t()

Generates an empty <Sim> verb.

@spec sim(content() | keyword() | t()) :: t()

Generates a <Sim> verb.

There are three supported usages:

  • Wraps arg in <Sim> if it's TwiML.content/0.
  • Creates an empty <Sim> with attributes for arg as a keyword list.
  • Appends an empty <Sim> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

sim(verbs_or_content, content_or_attrs)

View Source
@spec sim(t(), keyword() | content()) :: t()
@spec sim(
  content(),
  keyword()
) :: t()

Appends or generates a <Sim> verb.

There are two supported usages:

  • Appends <Sim> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Sim> with attributes if content_or_attrs is a keyword list.
Link to this function

sim(verbs, content, attrs)

View Source
@spec sim(t(), content(), keyword()) :: t()

Appends a <Sim> verb with attributes.

Adds a <Sim> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec sip() :: t()

Generates an empty <Sip> verb.

@spec sip(content() | keyword() | t()) :: t()

Generates a <Sip> verb.

There are three supported usages:

  • Wraps arg in <Sip> if it's TwiML.content/0.
  • Creates an empty <Sip> with attributes for arg as a keyword list.
  • Appends an empty <Sip> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

sip(verbs_or_content, content_or_attrs)

View Source
@spec sip(t(), keyword() | content()) :: t()
@spec sip(
  content(),
  keyword()
) :: t()

Appends or generates a <Sip> verb.

There are two supported usages:

  • Appends <Sip> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Sip> with attributes if content_or_attrs is a keyword list.
Link to this function

sip(verbs, content, attrs)

View Source
@spec sip(t(), content(), keyword()) :: t()

Appends a <Sip> verb with attributes.

Adds a <Sip> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec siprec() :: t()

Generates an empty <Siprec> verb.

@spec siprec(content() | keyword() | t()) :: t()

Generates a <Siprec> verb.

There are three supported usages:

  • Wraps arg in <Siprec> if it's TwiML.content/0.
  • Creates an empty <Siprec> with attributes for arg as a keyword list.
  • Appends an empty <Siprec> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

siprec(verbs_or_content, content_or_attrs)

View Source
@spec siprec(t(), keyword() | content()) :: t()
@spec siprec(
  content(),
  keyword()
) :: t()

Appends or generates a <Siprec> verb.

There are two supported usages:

  • Appends <Siprec> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Siprec> with attributes if content_or_attrs is a keyword list.
Link to this function

siprec(verbs, content, attrs)

View Source
@spec siprec(t(), content(), keyword()) :: t()

Appends a <Siprec> verb with attributes.

Adds a <Siprec> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec stream() :: t()

Generates an empty <Stream> verb.

@spec stream(content() | keyword() | t()) :: t()

Generates a <Stream> verb.

There are three supported usages:

  • Wraps arg in <Stream> if it's TwiML.content/0.
  • Creates an empty <Stream> with attributes for arg as a keyword list.
  • Appends an empty <Stream> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

stream(verbs_or_content, content_or_attrs)

View Source
@spec stream(t(), keyword() | content()) :: t()
@spec stream(
  content(),
  keyword()
) :: t()

Appends or generates a <Stream> verb.

There are two supported usages:

  • Appends <Stream> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <Stream> with attributes if content_or_attrs is a keyword list.
Link to this function

stream(verbs, content, attrs)

View Source
@spec stream(t(), content(), keyword()) :: t()

Appends a <Stream> verb with attributes.

Adds a <Stream> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

@spec virtual_agent() :: t()

Generates an empty <VirtualAgent> verb.

@spec virtual_agent(content() | keyword() | t()) :: t()

Generates a <VirtualAgent> verb.

There are three supported usages:

  • Wraps arg in <VirtualAgent> if it's TwiML.content/0.
  • Creates an empty <VirtualAgent> with attributes for arg as a keyword list.
  • Appends an empty <VirtualAgent> to arg if it's TwiML.t/0, enabling verb chaining (refer to Examples).
Link to this function

virtual_agent(verbs_or_content, content_or_attrs)

View Source
@spec virtual_agent(t(), keyword() | content()) :: t()
@spec virtual_agent(
  content(),
  keyword()
) :: t()

Appends or generates a <VirtualAgent> verb.

There are two supported usages:

  • Appends <VirtualAgent> to verbs_or_content if it's TwiML.t/0, enabling verb chaining (see Examples). This verb wraps content_or_attrs if it's TwiML.content/0, or includes attributes if content_or_attrs is a keyword list.
  • Generates <VirtualAgent> with attributes if content_or_attrs is a keyword list.
Link to this function

virtual_agent(verbs, content, attrs)

View Source
@spec virtual_agent(t(), content(), keyword()) :: t()

Appends a <VirtualAgent> verb with attributes.

Adds a <VirtualAgent> verb to verbs using attrs as attributes, facilitating verb chaining (see Examples).

Functions

Generates a comment.

Examples

iex> TwiML.comment("Blocked because of insufficient funds")
...> |> TwiML.to_xml(format: :none)
~s(<?xml version="1.0" encoding="UTF-8"?><Response><!-->Blocked because of insufficient funds</!--></Response>)

Appends a comment to the TwiML.

Examples

iex> TwiML.reject() |> TwiML.comment("Blocked because of insufficient funds") |> TwiML.to_xml(format: :none)
~s(<?xml version="1.0" encoding="UTF-8"?><Response><Reject/><!-->Blocked because of insufficient funds</!--></Response>)
Link to this function

to_xml(verbs, opts \\ [])

View Source

Generates a XML document from the provided verbs and arguments. For the supported opts, please refer to the documentation of XmlBuilder.generate/2.

Examples

iex> TwiML.say("Hello world")
...> |> TwiML.to_xml(format: :none)
~s(<?xml version="1.0" encoding="UTF-8"?><Response><Say>Hello world</Say></Response>)