This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'httpclient' | |
Google_Login = 'googlename' | |
Google_Password = 'password' | |
PRE_LOGIN_URL = "https://www.google.com/accounts/ServiceLogin" | |
LOGIN_URL = "https://www.google.com/accounts/ServiceLoginAuth" | |
VOICE_HOME_URL = "https://www.google.com/voice" | |
clnt = HTTPClient.new(:agent_name => "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hash; alias :+ :merge; end; Home,Mobile,Work,Gizmo = 1,2,3,7 | |
# **** My classes. DO NOT EDIT from here ********************************* # | |
class VSP | |
@vsptab = {} | |
def self.tab; @vsptab; end | |
attr_reader :fmt, :name, :repeat, :tmo | |
def initialize *args | |
attrib = args.pop | |
args << attrib and attrib = {} unless attrib.class == Hash | |
@pfx, @fmt, @name = args |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ************************** C O U N T C A L L S ************************ | |
def countCalls acnts, tmo=20 | |
rexp = acnts.values.map {|x| /<sip\:#{Regexp.escape(x)}>/i} | |
now = Time.now.getutc | |
counter = Array.new(rexp.length,0) | |
sys.GetCurrentCalls.each do |call| | |
user = call.LocalUserField | |
rexp.each_with_index {|r,i| counter[i] += 1 if user =~ r and (now - call.Inserted.DateTime.ToLocalTime).to_i < (tmo * 60) } | |
end |