Action

Action

{
    "id": "<string>>",
    "next_id": "<string>>",
    "type": "<string>>",
    "option": {
        ...
    },
    "tm_execute": "<string>>"
}
  • id: Action’s id.

  • next_id: Action’s next id. If it sets empty, just move on to the next action in the action array.

  • type: Action’s type. See detail here.

  • option: Action’s option.

Type

type

Description

agent_call

Deprecated. Use the connect instead. Creates a call to the agent and connect.

amd

Answering machine detection.

answer

Answer the call.

beep

Play the beep sound.

branch

Branch gets the variable then execute the correspond action. For example. gets the dtmf input saved variable and jump to the action.

call

Starts a new independent outgoing call with a given flow.

chatbot_talk

Starts a talk with chatbot.

condition_call_digits

Deprecated. Use the condition_variable instead. Condition check(call’s digits).

condition_call_status

Deprecated. Use the condition_variable instead. Condition check(call’s status).

condition_datetime

Condition check(time)

condition_variable

Condition check(variable).

confbridge_join

Join to the confbridge.

conference_join

Join to the conference.

connect

Creates a new call to the destinations and connects to them.

conversation_send

Send a message to the conversation.

digits_receive

Receive the digits(dtmfs).

digits_send

Send the digits(dtmfs).

echo

Echo to stream.

external_media_start

Start the external media.

external_media_stop

Stop the external media.

fetch

Fetch the actions from endpoint.

fetch_flow

Fetch the actions from the exist flow.

goto

Goto.

hangup

Hangup the call.

hangup_relay

Hangs up the call with the same reason of the given reference id.

message_send

Send a message.

play

Play the file of the given urls.

queue_join

Join to the queue.

recording_start

Start the record of the given call.

recording_stop

Stop the record of the given call.

sleep

Sleep.

stop

Stop the flow.

stream_echo

Echo the steam.

talk

Generate audio from the given text(ssml or plain text) and play it.

transcribe_start

Start transcribe the call

transcribe_stop

Stop transcribe the call

transcribe_recording

Transcribe the recording and send it to webhook.

variable_set

Sets the variable.

webhook_send

Send a webhook.

Agent Call

Calling the agent. The agent may have various types of addresses or phone numbers, such as a desk phone, mobile phone, or softphone application.

Parameters

{
    "type": "agent_call",
    "option": {
        "agent_id": "<string>"
    }
}
  • agent_id: target agent id.

Example

{
    "type": "agent_call",
    "option": {
        "agent_id": "eb1ac5c0-ff63-47e2-bcdb-5da9c336eb4b"
    }
}

AMD

Answering machine detection.

Parameters

{
    "type": "amd",
    "option": {
        "machine_handle": "<string>",
        "async": <boolean>
    }
}
  • machine_handle: hangup,delay,continue if the machine answered a call. See detail here.

  • async: if it’s false, the call flow will be stop until amd done.

Machine handle

Type

Description

hangup

Hangup the call.

continue

Continue the call.

Example

{
    "type": "amd",
    "option": {
        "machine_handle": "hangup",
        "sync": true
    }
}

Answer

Answer the call

Parameters

{
    "type": "answer"
}

Example

{
    "type": "answer"
}

Beep

Make a beep sound.

Parameters

{
    "type": "beep"
}

Example

{
    "type": "beep"
}

Branch

Branch the flow. It gets the variable from the activeflow and move the activeflow cursor to the selected target id.

Parameters

{
    "type": "branch",
    "option": {
        "variable": "<string>",
        "default_target_id": "<string>",
        "target_ids": {
            "<string>": <string>,
        }
    }
}
  • variable: Target variable. If this value is empty, default target variable will be selected. Available variables are listed here. default: voipbin.call.digits

  • default_target_id: action id for default selection. This will be generated automatically by the given default_index.

  • target_ids: set of input digit and target id fair. This will be generated automatically by the given target_indexes.

Example

{
    "type": "branch",
    "option": {
        "default_target_id": "ed9705ca-c524-11ec-a3fb-8feb7731ad45",
        "target_ids": {
            "1": "c3eb8e62-c524-11ec-94c5-abafec8af561",
            "2": "dc87123e-c524-11ec-89c6-5fb18da14034",
            "3": "e70fb030-c524-11ec-b657-ebec72f097ef"
        }
    }
}

Call

Make a new outbound call in a new context.

_images/flow_action_call.png

Parameters

{
    "type": "call",
    "option": {
        "source": {
            ...
        },
        "destinations": [
            {
                ...
            },
            ...
        ],
        "flow_id": "<string>"
        "actions": [
            {
                ...
            }
        ],
        "chained": <boolean>,
        "early_execution": <boolean>
    }
}
  • source: Source address. See detail here.

  • destinations: Array of destination addresses. See detail here.

  • flow_id: Call’s flow id. If this not set, will use the actions array.

  • actions: Array of actions. If the flow_id not set, the call flow will be created with this actions.

  • chained: If it sets to true, created calls will be hungup when the master call is hangup. Default false.

  • early_execution: It it sets to true, the voipbin will execute the flow when then call is ringing.

Example

{
    "id": "e34ab97a-c53a-4eb4-aebf-36767a528f00",
    "next_id": "00000000-0000-0000-0000-000000000000",
    "type": "call",
    "option": {
        "source": {
            "type": "tel",
            "target": "+821100000001"
        },
        "destinations": [
            {
                "type": "tel",
                "target": "+821100000002"
            }
        ],
        "actions": [
            {
                "type": "talk",
                "option": {
                    "text": "hello, this is test message.",
                    "gender": "female",
                    "language": "en-US"
                }
            }
        ],
        "chained": false
    }
}

Chatbot Talk

Start the chatbot talk.

Parameters

{
    "type": "chatbot_talk",
    "option": {
        "chatbot_id": "<string>",
        "gender": "<string>",
        "language": "<string>",
        "duration": <number>
    }
}
  • chatbot_id: Chatbot id.

  • gender: Voice gender. male/female/neutral

  • language: Specifies the language. BCP47 format.

  • duration: Duration. Seconds.

Confbridge Join

Join to the confbridge.

Parameters

{
    "type": "confbridge_join",
    "option": {
        "confbridge_id": "<string>"
    }
}
  • confbridge_id: Target confbridge id.

Condition Call Digits

Deprecated. Use the condition_variable instead. Check the condition of received digits. If the conditions are met, the system proceeds to the next action. If the conditions are not met, the voipbin directs the call to a false_target_id for further processing.

Parameters

{
    "type": "condition_call_digits",
    "option": {
        "length": <number>,
        "key": "<string>",
        "false_target_id": "<string>"
    }
}
  • length: match digits length.

  • key: match digits contain.

  • false_target_id: action id for false condition.

Example

{
    "type": "condition_call_digits",
    "option": {
        "length": 10,
        "false_target_id": "e3e50e6c-9c8b-11ec-8031-0384a8fcd1e2"
    }
}

Condition Call Status

Deprecated. Use the condition_variable instead. Check the condition of call’s status. It checks the call’s status and if it matched with condition then move to the next action. If not, move to the false_target_id.

Parameters

{
    "type": "condition_call_status",
    "option": {
        "status": <number>,
        "false_target_id": "<string>"
    }
}
  • status: match call’s status. See detail here.

  • false_target_id: action id for false condition.

Example

{
    "type": "condition_call_status",
    "option": {
        "status": "progressing,
        "false_target_id": "e3e50e6c-9c8b-11ec-8031-0384a8fcd1e2"
    }
}

Condition Datetime

Check the condition of the time. It checks the current time(UTC) and if it matched with condition then move to the next action. If not, move to the false_target_id.

Parameters

{
    "type": "condition_datetime",
    "option": {
        "condition": <number>,

        "minute": <number>,
        "hour": <number>,
        "day": <number>,
        "month": <number>,
        "weekdays": [
            <number>,
            ...
        ],


        "false_target_id": "<string>"
    }
}
  • condition: Match condition. One of “==”, “!=”, “>”, “>=”, “<”, “<=”.

  • minute: Minutes. -1 for all minutes.

  • hour: Hour. -1 for all hours.

  • day: Day. -1 for all days.

  • month: Month. 0 for all months.

  • weekdays: List of weekdays. Sunday: 0, Monday: 1, Tuesday: 2, Wednesday: 3, Thursday: 4, Friday: 5, Saturday: 6

  • false_target_id: action id for false condition.

Example

{
    "type": "condition_datetime",
    "option": {
        "condition": ">=,
        "minute": 0
        "hour": 8,
        "day": -1,
        "month": 0,
        "weekdays": [],
        "false_target_id": "d08582ee-1b3d-11ed-a43e-9379f27c3f7f"
    }
}

Condition Variable

Check the condition of the given variable. It checks the call’s status and if it matched with condition then move to the next action. If not, move to the false_target_id.

Parameters

{
    "type": "condition_variable",
    "option": {
        "condition": "<string>",
        "variable": "<string>",
        "value_type": "<string>",
        "value_string": "<string>",
        "value_number": <number>,
        "value_length": <number>,
        "false_target_id": "<string>"
    }
}
  • condition: Match condition. One of “==”, “!=”, “>”, “>=”, “<”, “<=”.

  • variable: Target variable. See detail here.

  • value_type: Type of value. string/number/length.

  • value_string: Value. Valid only if the value_type is string.

  • value_number: * value_string: Value. Valid only if the value_type is number.

  • value_length: * value_string: Value. Valid only if the value_type is length.

  • false_target_id: action id for false condition.

Example

{
    "type": "condition_variable",
    "option": {
        "condition": "==",
        "variable": "voipbin.call.source.target",
        "value_type": "string",
        "value_string": "+821100000001",
        "false_target_id": "fb2f4e2a-b030-11ed-bddb-976af892f5a3"
    }
}

Conference Join

Join to the conference

Parameters

{
    "type": "conference_join",
    "option": {
        "conference_id": "<string>"
    }
}
  • conference_id: Conference’s id to join.

Example

{
    "type": "conference_join",
    "option": {
        "conference_id": "367e0e7a-3a8c-11eb-bb08-f3c3f059cfbe"
    }
}

Connect

Originate to the other destination(s) and connect to them each other.

Parameters

{
    "type": "connect",
    "option": {
        "source": {...},
        "destinations": [
            ...
        ],
        "early_media": <boolean>,
        "relay_reason": <boolean>
    }
}
  • source: Source address. See detail here.

  • destinations: Array of destination addresses. See detail here.

  • early_media: Support early media.

  • relay_reason: relay the hangup reason to the master call.

Example

{
    "type": "connect",
    "option": {
        "source": {
            "type": "tel",
            "target": "+11111111111111"
        },
        "destinations": [
            {
                "type": "tel",
                "target": "+222222222222222"
            }
        ]
    }
}

Conversation send

Send the message to the conversation.

Parameters

{
    "type": "conversation_send",
    "option": {
        "conversation_id": "<string>",
        "text": "<string>",
        "sync": <boolean>
    }
}
  • conversation_id: Target conversation id.

  • text: Send text message.

  • sync: If this set to true, waits until this action done.

Example

{
    "type": "conversation_send",
    "option": {
        "conversation_id": "b5ef5e64-f7ca-11ec-bbe9-9f74186a2a72",
        "text": "hello world, this is test message.",
        "sync": false
    }
}

Digits Receive

Receives the digits for given duration or numbers.

Parameters

{
    "type": "digits_receive",
    "option": {
        "duration": <number>,
        "length": <number>,
        "key": "<string>"
    }
}
  • duration: The duration allows you to set the limit (in ms) that VoIPBIN will wait for the endpoint to press another digit or say another word before it continue to the next action.

  • length: You can set the number of DTMFs you expect. An optional limit to the number of DTMF events that should be gathered before continuing to the next action. By default, this is set to 1, so any key will trigger the next step. If EndKey is set and MaxNumKeys is unset, no limit for the number of keys that will be gathered will be imposed. It is possible for less keys to be gathered if the EndKey is pressed or the timeout being reached.

  • key: If set, determines which DTMF triggers the next step. The finish_on_key will be included in the resulting variable. If not set, no key will trigger the next action.

Example

{
    "type": "digits_receive",
    "option": {
        "duration": 10000,
        "length": 3,
        "key": "#"
    }
}

Digits Send

Sends the digits with given duration and interval.

Parameters

{
    "type": "digits_send",
    "option": {
        "digits": "<string>",
        "duration": <number>,
        "interval": <number>
    }
}
  • digits: The digit string to send. Allowed set of characters: 0-9,A-D, #, ‘*’; with a maximum of 100 keys.

  • duration: The duration of DTMF tone per key in milliseconds. Allowed values: Between 100 and 1000.

  • interval: Interval between sending keys in milliseconds. Allowed values: Between 0 and 5000.

Example

{
    "type": "digits_send",
    "option": {
        "digits": "1234567890",
        "duration": 500,
        "interval": 500
    }
},

Echo

Echoing the call.

Parameters

{
    "type": "echo",
    "option": {
        "duration": <number>,
    }
}
  • duration: Echo duration. ms.

Example

{
    "type": "echo",
    "option": {
        "duration": 30000
    }
}

External Media Start

Start the external media.

Parameters

{
    "type": "external_media_start",
    "option": {
        "external_host": "<string>",
        "encapsulation": "<string>",
        "transport": "<string>",
        "connection_type": "<string>",
        "format": "<string>",
        "direction": "<string>",
        "data": "<string>"
    }
}
  • external_host: external media target host address.

  • encapsulation: encapsulation. default: rtp.

  • transport: transport. default: udp.

  • connection_type: connection type. default: client

  • format: format default: ulaw

  • direction: Direction. default: both.

  • data: Data. Reserved.

External Media Stop

Stop the external media.

Parameters

{
    "type": "external_media_stop",
}

Fetch

Fetch the next flow from the remote.

Parameters

{
    "type": "fetch",
    "option": {
        "event_url": "<string>",
        "event_method": "<string>"
    }
}
  • event_url: The url for flow fetching.

  • event_method: The method for flow fetching.

Example

{
    "type": "fetch".
    "option": {
        "event_method": "POST",
        "event_url": "https://webhook.site/e47c9b40-662c-4d20-a288-6777360fa211"
    }
}

Fetch Flow

Fetch the next flow from the existed flow.

Parameters

{
    "type": "fetch_flow",
    "option": {
        "flow_id": "<string>"
    }
}
  • flow_id: The id of flow.

Example

{
    "type": "fetch_flow".
    "option": {
        "flow_id": "212a32a8-9529-11ec-8bf0-8b89df407b6e"
    }
}

Goto

Move the action execution.

Parameters

{
    "type": "goto",
    "option": {
        "target_id": "<string>",
        "loop_count": <integer>
    }
}
  • target_id: action id for move target.

  • loop_count: The number of loop.

Example

{
    "type": "goto",
    "option": {
        "target_id": "ca4ddd74-9c8d-11ec-818d-d7cf1487e8df",
        "loop_count": 2
    }
}

Hangup

Hangup the call.

Parameters

{
    "type": "hangup"
}

Example

{
    "type": "hangup"
}

Hangup Relay

Hangup the call and relay the hangup cause to the reference id.

Parameters

{
    "type": "Hangup_relay"
    "option": {
        "reference_id": "<string>"
    }
}

Example

{
    "type": "hangup_relay",
    "option": {
        "reference_id": "b8573f30-b031-11ed-ac05-3bc9a62e64c3"
    }
}

Message send

Send a message.

Parameters

{
    "type": "message_send",
    "option": {
        "source": {
            ...
        },
        "destinations": [
            {
                ...
            },
            ...
        ],
        "text": "<string>"
    }
}
  • source: Source address info. See detail here.

  • destinations: Array of destination addresses. See detail here.

  • text: Message’s text.

Play

Plays the linked file.

Parameters

{
    "type": "play",
    "option": {
        "stream_urls": [
            "<string>",
            ...
        ]
    }
}
  • stream_urls: Stream url array for media.

Example

{
    "type": "play",
    "option": {
        "stream_urls": [
            "https://github.com/pchero/asterisk-medias/raw/master/samples_codec/pcm_samples/example-mono_16bit_8khz_pcm.wav"
        ]
    }
}

Queue Join

Join to the queue.

Parameters

{
    "type": "queue_join",
    "option": {
        "queue_id": "<string>"
    }
}
  • queue_id: Target queue id.

Example

{
    "type": "queue_join",
    "option": {
        "queue_id": "99bf739a-932f-433c-b1bf-103d33d7e9bb"
    }
}

Recording Start

Starts the call recording.

Parameters

{
    "type": "recording_start"
    "option": {
        "format": "<string>",
        "end_of_silence": <integer>,
        "end_of_key": "<string>",
        "duration": <integer>,
        "beep_start": <boolean>
    }
}
  • format: Format to encode audio in. wav, mp3, ogg.

  • end_of_silence: Maximum duration of silence, in seconds. 0 for no limit.

  • end_of_key: DTMF input to terminate recording. none, any, *, #.

  • duration: Maximum duration of the recording, in seconds. 0 for no limit.

  • beep_start: Play beep when recording begins

Example

{
    "type": "recording_start",
    "option": {
        "format": "wav"
    }
}

Recording Stop

Stops the call recording.

Parameters

{
    "type": "recording_stop"
}

Example

{
    "type": "recording_stop"
}

Sleep

Sleep the call.

Parameters

{
    "type": "sleep",
    "option": {
        "duration": <number>
    }
}
  • duration: Sleep duration(ms).

Stream Echo

Echoing the RTP stream including the digits receive.

Parameters

{
    "type": "stream_echo",
    "option": {
        "duration": <number>
    }
}
  • duration: Echo duration. ms.

Example

{
    "type": "stream_echo"
    "option": {
        "duration": 10000
    }
}

Talk

Text to speech. SSML(https://www.w3.org/TR/speech-synthesis/) supported.

Parameters

{
    "type": "talk",
    "option": {
        "text": "<string>",
        "gender": "<string>",
        "language": "<string>",
        "digits_handle": "<string>"
    }
}
  • text: Text to speech. SSML(https://cloud.google.com/text-to-speech/docs/ssml) supported.

  • gender: male/female/neutral.

  • language: Specifies the language. The value may contain a lowercase, two-letter language code (for example, en), or the language code and uppercase country/region (for example, en-US).

  • digits_handle: See detail here.

Digits handle

Type

Description

next

If digits received in talk, move the action to the next.

Example

{
    "type": "talk",
    "option": {
        "text": "Hello. Welcome to voipbin. This is test message. Please enjoy the voipbin service. Thank you. Bye",
        "gender": "female",
        "language": "en-US"
    }
}

Transcribe recording

Transcribe the call’s recordings.

Parameters

{
    "type": "transcribe_recording"
    "option": {
        "language": "<string>"
    }
}
  • language: Specifies the language. BCP47 format.

Example

{
    "type": "transcribe_recording"
    "option": {
        "language": "en-US"
    }
}

Transcribe start

Start the STT(Speech to text) transcribe in realtime.

Parameters

{
    "type": "transcribe_start",
    "option": {
        "language": "<string>",
    }
}
  • language: Specifies the language. BCP47 format. The value may contain a lowercase, two-letter language code (for example, en), or the language code and uppercase country/region (for example, en-US).

Example

{
    "type": "transcribe_start",
    "option": {
        "language": "en-US",
    }
}

Transcribe stop

Stop the transcribe talk in realtime.

Parameters

{
    "type": "transcribe_stop"
}

Example

{
    "type": "transcribe_stop"
}

Variable Set

Stop the transcribe talk in realtime.

Parameters

{
    "type": "variable_set"
    "option": {
        "key": "<string>",
        "value": "<string>"
    }
}
  • key: Variable name.

  • value” Varialbe value.

Example

{
    "type": "variable_set"
    "option": {
        "key": "Provider name",
        "value": "voipbin"
    }
}

Webhook send

Send a webhook.

Parameters

{
    "type": "webhook_send"
    "option": {
        "sync": boolean,
        "uri": "<string>",
        "method": "<string>",
        "data_type": "<string>",
        "data": "<string>"
    }
}
  • sync: If this set to true, waits until this action done.

  • uri: Destination uri.

  • method: Send method. POST/GET/PUST/DELETE/…

  • data_type: Data’s type. application/json, …

  • data: Data string. Variable can be used.

Example

{
    "type": "webhook_send",
    "option": {
        "sync": true,
        "uri": "https://test.com",
        "method": "POST",
        "data_type": "application/json",
        "data": "{\"destination_number\": \"${voipbin.call.destination.target}\", \"source_number\": \"${voipbin.call.source.target}\"}"
    }
}