Class: Adhearsion::VoIP::Asterisk::ConfigFileGenerators::Voicemail::RecordingDefinition

Inherits:
AsteriskConfigGenerator show all
Defined in:
lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb

Constant Summary

Constants inherited from AsteriskConfigGenerator

AsteriskConfigGenerator::SECTION_TITLE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AsteriskConfigGenerator

create_sanitary_hash_from, #to_sanitary_hash, warning_message

Constructor Details

#initializeRecordingDefinition

Returns a new instance of RecordingDefinition.



211
212
213
214
# File 'lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb', line 211

def initialize
  @properties = {}
  super
end

Instance Attribute Details

#propertiesObject (readonly)

Returns the value of attribute properties.



210
211
212
# File 'lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb', line 210

def properties
  @properties
end

Instance Method Details

#allowed_length(seconds) ⇒ Object



220
221
222
223
224
225
226
227
228
229
230
# File 'lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb', line 220

def allowed_length(seconds)
  case seconds
    when Fixnum
      int :maxmessage => "value"
    when Range
      int :minmessage => seconds.first
      int :maxmessage => seconds.last
    else
      raise ArgumentError, "Argument must be a Fixnum or Range!"
  end
end

#format(symbol) ⇒ Object



216
217
218
# File 'lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb', line 216

def format(symbol)
  one_of [:gsm, :wav49, :wav], :format => symbol
end

#maximum_silence(seconds) ⇒ Object



232
233
234
# File 'lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb', line 232

def maximum_silence(seconds)
  int :maxsilence => seconds
end