dial ***2 to forward incoming calls to your mobile
dial ***8xxxxxxxx to forward incoming to this number xxxxxxxx with ptel
dial ***9xxxxxxxx to forward incoming to this number xxxxxxxx with mynet
dial ***0 to return to no forward setting
place at the start of your outplan
Code: Select all
# if dialled *** store the number after it.
case req.URI.User.to_s
when /^\*\*\*([0-9]+)$/
sys.DBWrite("forwardto","#{$1}")
sys.Dial("early_music@iptel.org",8) # some music to say the number was stored.
sys.Respond(486, "Stored number") # plus a busy signal
end
# start of your normal outplan
Code: Select all
case sys.DBRead("forwardto").to_s
when '1'
sys.Dial("music@iptel.org") # forward to music only
sys.Respond(480, "Not Available")
when '2'
sys.Dial("04.....@ptel") # a preset for your mobile
sys.Respond(480, "Not Available")
when /^8([0-9]+)$/
sys.Dial("#{$1}@ptel") # will forward the call to the number after 8 on ptel
sys.Respond(480, "Not Available")
when /^9([0-9]+)$/
sys.Dial("#{$1}@mynet[fu=09xxxxxx]") # will forward the call to the number after 9 on mynet
sys.Respond(480, "Not Available")
end
sys.Dial("#{sys.Username}@local") # default if no matches above like ***0