Skip to content

Instantly share code, notes, and snippets.

@dtolb
Created March 21, 2016 17:51
Show Gist options
  • Save dtolb/16590bd44c44273f4b86 to your computer and use it in GitHub Desktop.
Save dtolb/16590bd44c44273f4b86 to your computer and use it in GitHub Desktop.
call

Classes

CallResponse : Object
Call

CallResponse : Object

Kind: global class
Properties

Name Type Default Description
id String The unique ID of the call.
direction String Call direction: values are 'in' for an incoming call, 'out' for an outgoing call
from String The phone number or SIP address that made the call. Phone numbers are in E.164 format (e.g. +15555555555) -or- SIP addresses (e.g. [email protected]).
to String The phone number or SIP address that received the call. Phone numbers are in E.164 format (e.g. +15555555555) -or- SIP addresses (e.g. [email protected]).
state String The call state. Described below, values are 'started' 'rejected' 'active' 'completed' 'transferring'
startTime String Date when the call was created. Timestamp follows the ISO8601 format.
activeTime String Date when the call was answered. Timestamp follows the ISO8601 format.
endTime String Date when the call ended. Timestamp follows the ISO8601 format.
callTimeout Number Determine how long should the platform wait for call answer before timing out in seconds
callbackUrl String The server URL where the call events related to the call will be sent.
callbackHttpMethod String Determine if the callback event should be sent via HTTP GET or HTTP POST. Values are 'get' or 'post' Default is 'post'
callbackTimeout Number Determine how long should the platform wait for callbackUrl's response before timing out (milliseconds).
fallbackUrl String The server URL used to send the call events if the request to callbackUrl fails.
chargeableDuration Number The number of seconds the call will be billed for.
transferTo String Phone number or SIP address that the call is going to be transferred to.
transferCallerId String This is the caller id that will be used when the call is transferred. This parameter is only considered in transfer state.
whisperAudio String Audio to be played to the caller that the call will be transferred to.
bridgeId String The id of the bridge where the call will be added.
bridge String The URL of the bridge, if any, that contains the call.
conferenceId String The id of the conference where the call will be added. This property is required if you want to add this call to a conference.
conference String The complete URL of the conference resource the call is associated with.
events String The URL to retrieve the events related to the call.
recordingEnabled String false Indicates if the call should be recorded after being created. Set to 'true' to enable. Default is 'false'
recordingFileFormat String wav The file format of the recorded call. Supported values are 'wav' (default) and 'mp3'.
recordingMaxDuration Number 3600 Indicates the maximum duration of call recording in seconds. Default value is 1 hour.
transcriptionEnabled Boolean Whether all the recordings for this call should be be automatically transcribed. tag Any string, it will be included in the callback events of the call.
page Number 0 Used for pagination to indicate the page requested for querying a list of calls. If no value is specified the default is 0.
size Number 25 Used for pagination to indicate the size of each page requested for querying a list of calls. If no value is specified the default value is 25 (maximum value 1000).
sipHeaders Object Map of Sip headers prefixed by "X-". Up to 5 headers can be sent per call. Max length for header and value is 256 characters.

Call

Kind: global class

new Call(client)

Voice call

Param Type Description
client Object Catapult client

call.create(params, [callback]) ⇒ CallResponse

Create a new voice call

Kind: instance method of Call
Returns: CallResponse - A promise for the newly created call

Param Type Description
params Object Parameters for creating a new call
params.from String A Bandwidth phone number on your account the call should come from (must be in E.164 format, like +19195551212).
params.to String The number to call (must be either an E.164 formated number, like +19195551212, or a valid SIP URI, like sip:[email protected]).
[params.callTimeout] Number Determine how long should the platform wait for] call answer before timing out in seconds.
[params.callbackUrl] String The full server URL where the call events related to the Call will be sent to.
[params.callbackTimeout] Number Determine how long should the platform wait for callbackUrl's response before timing out in milliseconds.
[params.callbackHttpMethod] String Determine if the callback event should be sent via HTTP GET or HTTP POST. Values are "GET" or "POST" (if not set the default is POST).
[params.fallbackUrl] String The full server URL used to send the callback event if the request to callbackUrl fails.
[params.bridgeId] String The id of the bridge where the call will be added.
[params.conferenceId] String Id of the conference where the call will be added. This property is required if you want to add this call to a conference.
[params.recordingEnabled] String Indicates if the call should be recorded after being created. Set to "true" to enable. Default is "false".
[params.recordingMaxDuration] String Indicates the maximum duration of call recording in seconds. Default value is 1 hour.
[params.transcriptionEnabled] String Whether all the recordings for this call is going to be automatically transcribed.
[params.tag] String A string that will be included in the callback events of the call.
[params.sipHeaders] Object Map of Sip headers prefixed by "X-". Up to 5 headers can be sent per call.
[callback] function Callback with the newly created call

call.get(callId, callback) ⇒ Promise

Gets information about an active or completed call.

Kind: instance method of Call
Returns: Promise - A promise for the call information

Param Type Description
callId String The ID of the call to get
callback function A callback with the call information

call.list(params, callback) ⇒ Promise

Gets a list of active and historic calls you made or received.

Kind: instance method of Call
Returns: Promise - A promise for the list of calls

Param Type Default Description
params Object Query parameters for listing calls
[params.bridgeId] String The id of the bridge for querying a list of calls history (pagination does not apply).
[params.conferenceId] String The id of the conference for querying a list of calls history
[params.from] String The number to filter calls that came from (must be either an E.164 formated number,like +19195551212, or a valid SIP URI, like sip:[email protected]).
[params.to] String The number to filter calls that was called to (must be either an E.164 formated number,like +19195551212, or a valid SIP URI, like sip:[email protected]).
[params.page] Number 0 Used for pagination to indicate the page requested for querying a list of calls. If no value is specified the default is 0.
[params.size] Number 25 Used for pagination to indicate the size of each page requested for querying a list of calls. If no value is specified the default value is 25 (maximum value 1000).
callback function A callback with the list of calls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment