以下是最最典型和精簡的,大多數人不需要做打入的處理,可以略去。
#incoming call processing
#based on caller (CID)
case req.Header.From.FromURI.User
when /^1234567890/ then
sys.Dial("username@local")
sys.Respond(480, "#{sys.Username} Not available")
end
#based on callee
case req.URI.User
when /username/ then
sys.Dial("username@local")
sys.Respond(480, "#{sys.Username} Not available")
end
#outbound call processing
case req.URI.User
when /^1?\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d$/ then
sys.Google...
sys.Respond(480, "#{sys.Username} Not available")
when /^\\+\\d{3,}/,/^00\\d{3,}/,/^011\\d{3,}/ then
sys.Dial("VoipDiscount")
sys.Respond(480, "#{sys.Username} Not available")
else
sys.Respond(480, "#{sys.Username} Not available")
end