see my dial plan
思芦
2010-05-05 17:45:05
( reads)
dial plan for my handset at sipsorcery
#Ruby
sys.Trace = false
AREA_CODE = 'xxx' # my area code
sys.Log("call from #{req.Header.From.FromURI.ToString()} to #{req.URI.User}.")
# Logic
if sys.In then
if sys.IsAvailable() then
sys.Dial("#{sys.Username}@local",30)
sys.Respond(480, "#{sys.Username} Not available")
else
sys.Dial("myhandset@local",30)
sys.Respond(480, "#{sys.Username} Not available")
end
else
case req.URI.User
when /^01$/ then sys.Dial("myhome@local",30) # dial my handset
else
sys.GoogleVoiceCall("GVname", "GVpass", "sipgate#", "#{req.URI.user}",".*",1)
end
end
similar for dialplan of my home phone