Method: Nexmo::Voice#create

Defined in:
lib/nexmo/voice.rb

#create(params) ⇒ Response

Create an outbound Call.

Examples:

response = client.voice.create({
  to: [{type: 'phone', number: '14843331234'}],
  from: {type: 'phone', number: '14843335555'},
  answer_url: ['https://example.com/answer']
})

Parameters:

  • params (Hash)

Options Hash (params):

  • :to (required, Array<Hash>)

    Connect to a Phone (PSTN) number, SIP Endpoint, Websocket, or VBC extension.

  • :from (required, Hash)

    Connect to a Phone (PSTN) number.

  • :ncco (Array<String>)

    The Nexmo Call Control Object to use for this call. Required unless :answer_url is provided.

  • :answer_url (Array<String>)

    The webhook endpoint where you provide the Nexmo Call Control Object that governs this call. Required unless :ncco is provided.

  • :answer_method (String)

    The HTTP method used to send event information to answer_url.

  • :event_url (required, Array<String>)

    The webhook endpoint where call progress events are sent to.

  • :event_method (String)

    The HTTP method used to send event information to event_url.

  • :machine_detection (String)

    Configure the behavior when Nexmo detects that the call is answered by voicemail.

  • :length_timer (Integer)

    Set the number of seconds that elapse before Nexmo hangs up after the call state changes to in_progress.

  • :ringing_timer (Integer)

    Set the number of seconds that elapse before Nexmo hangs up after the call state changes to ringing.

Returns:

See Also:



57
58
59
# File 'lib/nexmo/voice.rb', line 57

def create(params)
  request('/v1/calls', params: params, type: Post)
end