# Dial Plan Generated by Rubyzard v0.1
# If you need help, please post in our forum
# http://www.mysipswitch.com
# SIP tracing : true or false
sys.Trace = false
sys.Log("call from #{req.Header.From.FromURI.ToString()} to #{req.URI.User}.")
if sys.In then
# Do your INCOMING call processing customisations here.
if sys.IsAvailable()
sys.Dial("#{sys.Username}@local",30)
#sys.Respond(480, "#{sys.Username} Not available")
else
sys.Respond(480, "#{sys.Username} Not available")
end
else
# Do your OUTGOING call processing customisations here.
GV_email = "xxxx@yahoo.com"
GV_pwd = "xxxx"
GV_nbr = "xxxxx"
SIPnum = "1747xxxx"
ac = "xxx" # area code
case req.URI.User
when /^[1]?(50001|9000)$/ then sys.Dial("#{GV_nbr}@Future-Nine") # GV Voicemail
when /^[1]?(976|900|809)\d{7}$/
sys.Log("Calls to #{req.URI.User} not allowed")