Class: Signatures::Voicemail

Inherits:
Object
  • Object
show all
Defined in:
lib/signatures/voicemail.rb

Class Method Summary collapse

Class Method Details

.process(data) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/signatures/voicemail.rb', line 3

def self.process data
  # Look for voice mail by detecting the 1000hz BEEP
  # If the call length was too short to catch the beep,
  # this signature can fail. For non-US numbers, the beep
  # is often a different frequency entirely.
  if(data[:fcnt][1000] >= 1.0)
    return 'voicemail'
  end

  # Look for voicemail by detecting a peak frequency of
  # 1000hz. Not as accurate, but thats why this is in
  # the fallback script.
  if(data[:maxf] > 995 and data[:maxf] < 1005)
    return 'voicemail'
  end
end