lib/tropo-webapi-ruby/tropo-webapi-ruby.rb
def message(params={}, &block)
      if block_given?
        @nested_hash = {:message => build_elements(params)}
        @nested_name = 'message'
        instance_exec(&block)
        has_params?(@nested_hash[:message], 'message', ['say', 'to', 'name'])
        @response[:tropo] << @nested_hash
        @nested_hash = nil
        @nested_name = nil
      else
        hash = build_action('message', params)
        @response[:tropo] << hash
      end
      render_response if @building.nil?
    end
##
# Message initiates a new message to a destination and then hangs up on that destination. Also takes a say method
# in order to deliver a message to that desintation and then hangup.
#
# @overload message(params)
#   @param [Hash] params the options to create a message 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, Object] :say determines what is played or sent to the caller
#   @option params [optional, String] :voice (allison) specifies the voice to be used when speaking text to a user
#   @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] :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, 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, String] :promptLogSecurity Controls whether Tropo logs the text to speech string used by the method. Possible values are "none" (the default) and "suppress", which disables output logging for this method. 
# @overload message(params, &block)
#   @param [Hash] params the options to create an message 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, Object] :say determines what is played or sent to the caller
#   @option params [optional, String] :voice (allison) specifies the voice to be used when speaking text to a user
#   @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] :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, 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, String] :promptLogSecurity Controls whether Tropo logs the text to speech string used by the method. Possible values are "none" (the default) and "suppress", which disables output logging for this method. 
# @return [String, nil] the JSON string to be passed back to Tropo or nil
#   if the method has been called from inside a block
Message initiates a new message to a destination and then hangs up on that destination. Also takes a say method
in order to deliver a message to that desintation and then hangup.
Message initiates a new message to a destination and then hangs up on that destination . Also takes a say method in order to deliver a message to that desintation and then hangup .
def message(params={}, &block)
      if block_given?
        @nested_hash = {:message => build_elements(params)}
        @nested_name = 'message'
        instance_exec(&block)
        has_params?(@nested_hash[:message], 'message', ['say', 'to', 'name'])
        @response[:tropo] << @nested_hash
        @nested_hash = nil
        @nested_name = nil
      else
        hash = build_action('message', params)
        @response[:tropo] << hash
      end
      render_response if @building.nil?
    end
def message ( params = { } , & block ) if block_given? @nested_hash = { :message => build_elements ( params ) } @nested_name = 'message' instance_exec ( & block ) has_params? ( @nested_hash [ :message ] , 'message' , [ 'say' , 'to' , 'name' ] ) @response [ :tropo ] << @nested_hash @nested_hash = nil @nested_name = nil else hash = build_action ( 'message' , params ) @response [ :tropo ] << hash end render_response if @building . nil? end
Message initiates a new message to a destination and then hangs up on that destination.
Message initiates a new message to a destination and then hangs up on that destination .
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
message(params) @param [Hash] params the options to create a message 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, Object] :say determines what is played or sent to the caller @option params [optional, String] :voice (allison) specifies the voice to be used when speaking text to a user @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] :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, 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, String] :promptLogSecurity Controls whether Tropo logs the text to speech string used by the method. Possible values are "none" (the default) and "suppress", which disables output logging for this method.
message ( params ) @param [ Hash ] params the options to create a message 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 Object ] : say determines what is played or sent to the caller @option params [ optional String ] : voice ( allison ) specifies the voice to be used when speaking text to a user @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 ] : 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 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 String ] : promptLogSecurity Controls whether Tropo logs the text to speech string used by the method . Possible values are " none " ( the default ) and " suppress " which disables output logging for this method .
overload
message(params, █) @param [Hash] params the options to create an message 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, Object] :say determines what is played or sent to the caller @option params [optional, String] :voice (allison) specifies the voice to be used when speaking text to a user @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] :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, 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, String] :promptLogSecurity Controls whether Tropo logs the text to speech string used by the method. Possible values are "none" (the default) and "suppress", which disables output logging for this method.
message ( params █ ) @param [ Hash ] params the options to create an message 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 Object ] : say determines what is played or sent to the caller @option params [ optional String ] : voice ( allison ) specifies the voice to be used when speaking text to a user @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 ] : 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 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 String ] : promptLogSecurity Controls whether Tropo logs the text to speech string used by the method . Possible values are " none " ( the default ) and " suppress " which disables output logging for this method .