lib/tropo-webapi-ruby/tropo-webapi-ruby.rb
def call(params={}, &block)
      if block_given?
        create_nested_hash('call', params)
        instance_exec(&block)
        @response[:tropo] << @nested_hash
        @nested_hash = nil
        @nested_name = nil
      else
        hash = build_action('call', params)
        @response[:tropo] << hash
      end
      render_response if @building.nil?
    end
##
# Prompts initiates a new call. May only be used when no call is active.
#
# @overload call(params)
#   @param [Hash] params the options to create a call action request with.
#   @option params [required, String] :name this is the key used to identify the result of an operation, so you can differentiate between multiple results
#   @option params [required, String or Array] :to the destination of the call, may be a phone number, SMS number or IM address
#   @option params [optional, String] :from the phone number or IM address the call will come from
#   @option params [optional, String] :network which network the call will be initiated with, such as SMS
#   @option params [optional, String] :channel the channel the call will be initiated over, may be TEXT or VOICE
#   @option params [optional, Float] :timeout (30) the amount of time, in seconds, to wait for a response before moving on
#   @option params [optional, Boolean] :answerOnMedia (false) if true, the call will be concisdered answered and audio will being playing as soon as media is received (ringing, busy, etc)
#   @option params [optional, Hash] :headers A set of key/values to apply as customer SIP headers to the outgoing call
#   @option params [optional, Boolean or Hash] :machineDetection (false) determines if a call is coming from machine or human
#   @option params [optional, Boolean] :required (true) determines whether Tropo should move on to the next verb - if true, Tropo will only move on if the current operation completed
#   @option params [optional, String or Array] :allowSignals allows you to assign a signal to call which can be used with REST to interrupt the function 
#   @option params [optional, String] :voice ""(undefined) sets the voice in a call; all prompt action within the call will inherit the same voice defined here
#   @option params [optional, String] :callbackUrl Configures a URL for a webhook for CDRs to be sent at the completion of the call.
#   @option params [optional, String] :promptLogSecurity Controls whether Tropo logs the text to speech string used by the method.
#   @option params [optional, String] :label Set by you, an arbitrary label for this call. The label you set will appear in your CDR, allowing you to track a CDR by a string you define.
# @overload call(params, &block)
#   @param [Hash] params the options to create an call action request with.
#   @param [Block] takes a block so that you may trigger actions, such as a say, on a specific event
#   @option params [required, String] :name this is the key used to identify the result of an operation, so you can differentiate between multiple results
#   @option params [required, String or Array] :to the destination of the call, may be a phone number, SMS number or IM address
#   @option params [optional, String] :from the phone number or IM address the call will come from
#   @option params [optional, String] :network which network the call will be initiated with, such as SMS
#   @option params [optional, String] :channel (voice) the channel the call will be initiated over, may be TEXT or VOICE
#   @option params [optional, Float] :timeout (30) the amount of time, in seconds, to wait for a response before moving on
#   @option params [optional, Boolean] :answerOnMedia (false) if true, the call will be concisdered answered and audio will being playing as soon as media is received (ringing, busy, etc)
#   @option params [optional, Hash] :headers A set of key/values to apply as customer SIP headers to the outgoing call
#   @option params [optional, Boolean or Hash] :machineDetection (false) determines if a call is coming from machine or human
#   @option params [optional, Boolean] :required (true) determines whether Tropo should move on to the next verb - if true, Tropo will only move on if the current operation completed
#   @option params [optional, String or Array] :allowSignals allows you to assign a signal to call which can be used with REST to interrupt the function 
#   @option params [optional, String] :voice ""(undefined) sets the voice in a call; all prompt action within the call will inherit the same voice defined here
#   @option params [optional, String] :callbackUrl Configures a URL for a webhook for CDRs to be sent at the completion of the call.
#   @option params [optional, String] :promptLogSecurity Controls whether Tropo logs the text to speech string used by the method.
#   @option params [optional, String] :label Set by you, an arbitrary label for this call. The label you set will appear in your CDR, allowing you to track a CDR by a string you define.
# @return [String, nil] the JSON string to be passed back to Tropo or nil
#   if the method has been called from inside a block
Prompts initiates a new call. May only be used when no call is active.
Prompts initiates a new call . May only be used when no call is active .
def call(params={}, &block)
      if block_given?
        create_nested_hash('call', params)
        instance_exec(&block)
        @response[:tropo] << @nested_hash
        @nested_hash = nil
        @nested_name = nil
      else
        hash = build_action('call', params)
        @response[:tropo] << hash
      end
      render_response if @building.nil?
    end
def call ( params = { } , & block ) if block_given? create_nested_hash ( 'call' , params ) instance_exec ( & block ) @response [ :tropo ] << @nested_hash @nested_hash = nil @nested_name = nil else hash = build_action ( 'call' , params ) @response [ :tropo ] << hash end render_response if @building . nil? end
Prompts initiates a new call.
Prompts initiates a new call .
the JSON string to be passed back to Tropo or nil if the method has been called from inside a block
the JSON string to be passed back to Tropo or nil if the method has been called from inside a block
String, nil
params
block
overload
call(params) @param [Hash] params the options to create a call action request with. @option params [required, String] :name this is the key used to identify the result of an operation, so you can differentiate between multiple results @option params [required, String or Array] :to the destination of the call, may be a phone number, SMS number or IM address @option params [optional, String] :from the phone number or IM address the call will come from @option params [optional, String] :network which network the call will be initiated with, such as SMS @option params [optional, String] :channel the channel the call will be initiated over, may be TEXT or VOICE @option params [optional, Float] :timeout (30) the amount of time, in seconds, to wait for a response before moving on @option params [optional, Boolean] :answerOnMedia (false) if true, the call will be concisdered answered and audio will being playing as soon as media is received (ringing, busy, etc) @option params [optional, Hash] :headers A set of key/values to apply as customer SIP headers to the outgoing call @option params [optional, Boolean or Hash] :machineDetection (false) determines if a call is coming from machine or human @option params [optional, Boolean] :required (true) determines whether Tropo should move on to the next verb - if true, Tropo will only move on if the current operation completed @option params [optional, String or Array] :allowSignals allows you to assign a signal to call which can be used with REST to interrupt the function @option params [optional, String] :voice ""(undefined) sets the voice in a call; all prompt action within the call will inherit the same voice defined here @option params [optional, String] :callbackUrl Configures a URL for a webhook for CDRs to be sent at the completion of the call. @option params [optional, String] :promptLogSecurity Controls whether Tropo logs the text to speech string used by the method. @option params [optional, String] :label Set by you, an arbitrary label for this call. The label you set will appear in your CDR, allowing you to track a CDR by a string you define.
call ( params ) @param [ Hash ] params the options to create a call action request with . @option params [ required String ] : name this is the key used to identify the result of an operation so you can differentiate between multiple results @option params [ required String or Array ] : to the destination of the call may be a phone number SMS number or IM address @option params [ optional String ] : from the phone number or IM address the call will come from @option params [ optional String ] : network which network the call will be initiated with such as SMS @option params [ optional String ] : channel the channel the call will be initiated over may be TEXT or VOICE @option params [ optional Float ] : timeout ( 30 ) the amount of time in seconds to wait for a response before moving on @option params [ optional Boolean ] : answerOnMedia ( false ) if true the call will be concisdered answered and audio will being playing as soon as media is received ( ringing busy etc ) @option params [ optional Hash ] : headers A set of key / values to apply as customer SIP headers to the outgoing call @option params [ optional Boolean or Hash ] : machineDetection ( false ) determines if a call is coming from machine or human @option params [ optional Boolean ] : required ( true ) determines whether Tropo should move on to the next verb - if true Tropo will only move on if the current operation completed @option params [ optional String or Array ] : allowSignals allows you to assign a signal to call which can be used with REST to interrupt the function @option params [ optional String ] : voice " " ( undefined ) sets the voice in a call ; all prompt action within the call will inherit the same voice defined here @option params [ optional String ] : callbackUrl Configures a URL for a webhook for CDRs to be sent at the completion of the call . @option params [ optional String ] : promptLogSecurity Controls whether Tropo logs the text to speech string used by the method . @option params [ optional String ] : label Set by you an arbitrary label for this call . The label you set will appear in your CDR allowing you to track a CDR by a string you define .
overload
call(params, █) @param [Hash] params the options to create an call action request with. @param [Block] takes a block so that you may trigger actions, such as a say, on a specific event @option params [required, String] :name this is the key used to identify the result of an operation, so you can differentiate between multiple results @option params [required, String or Array] :to the destination of the call, may be a phone number, SMS number or IM address @option params [optional, String] :from the phone number or IM address the call will come from @option params [optional, String] :network which network the call will be initiated with, such as SMS @option params [optional, String] :channel (voice) the channel the call will be initiated over, may be TEXT or VOICE @option params [optional, Float] :timeout (30) the amount of time, in seconds, to wait for a response before moving on @option params [optional, Boolean] :answerOnMedia (false) if true, the call will be concisdered answered and audio will being playing as soon as media is received (ringing, busy, etc) @option params [optional, Hash] :headers A set of key/values to apply as customer SIP headers to the outgoing call @option params [optional, Boolean or Hash] :machineDetection (false) determines if a call is coming from machine or human @option params [optional, Boolean] :required (true) determines whether Tropo should move on to the next verb - if true, Tropo will only move on if the current operation completed @option params [optional, String or Array] :allowSignals allows you to assign a signal to call which can be used with REST to interrupt the function @option params [optional, String] :voice ""(undefined) sets the voice in a call; all prompt action within the call will inherit the same voice defined here @option params [optional, String] :callbackUrl Configures a URL for a webhook for CDRs to be sent at the completion of the call. @option params [optional, String] :promptLogSecurity Controls whether Tropo logs the text to speech string used by the method. @option params [optional, String] :label Set by you, an arbitrary label for this call. The label you set will appear in your CDR, allowing you to track a CDR by a string you define.
call ( params █ ) @param [ Hash ] params the options to create an call action request with . @param [ Block ] takes a block so that you may trigger actions such as a say on a specific event @option params [ required String ] : name this is the key used to identify the result of an operation so you can differentiate between multiple results @option params [ required String or Array ] : to the destination of the call may be a phone number SMS number or IM address @option params [ optional String ] : from the phone number or IM address the call will come from @option params [ optional String ] : network which network the call will be initiated with such as SMS @option params [ optional String ] : channel ( voice ) the channel the call will be initiated over may be TEXT or VOICE @option params [ optional Float ] : timeout ( 30 ) the amount of time in seconds to wait for a response before moving on @option params [ optional Boolean ] : answerOnMedia ( false ) if true the call will be concisdered answered and audio will being playing as soon as media is received ( ringing busy etc ) @option params [ optional Hash ] : headers A set of key / values to apply as customer SIP headers to the outgoing call @option params [ optional Boolean or Hash ] : machineDetection ( false ) determines if a call is coming from machine or human @option params [ optional Boolean ] : required ( true ) determines whether Tropo should move on to the next verb - if true Tropo will only move on if the current operation completed @option params [ optional String or Array ] : allowSignals allows you to assign a signal to call which can be used with REST to interrupt the function @option params [ optional String ] : voice " " ( undefined ) sets the voice in a call ; all prompt action within the call will inherit the same voice defined here @option params [ optional String ] : callbackUrl Configures a URL for a webhook for CDRs to be sent at the completion of the call . @option params [ optional String ] : promptLogSecurity Controls whether Tropo logs the text to speech string used by the method . @option params [ optional String ] : label Set by you an arbitrary label for this call . The label you set will appear in your CDR allowing you to track a CDR by a string you define .