case req.URI.User
when /^911$/ then
sys.GoogleVoiceCall("myid@gmail.com","mypassword","mygizmonumber","mycellphone", ".*", 7, 20)
when /^1\d{10}$/ then
sys.Log("calling USA #{req.URI.User}");
sys.GoogleVoiceCall("myid@gmail.com","mypassword","mygizmonumber","#{req.URI.User}",".*",7, 15);
when /^[2-9]\d{2}[2-9]\d{6}$/ then
sys.Log("calling US 1#{req.URI.User}");
#gizmo number used as forwarding number under google account, and register here on sipsorcery
sys.GoogleVoiceCall("myid@gmail.com","mypassword","mygizmonumber","#{req.URI.User}",".*",7, 15);
else
sys.Log("calling international #{req.URI.User}");
sys.Dial("nonoh");
end
I spent a lot of time trying to setup and understand the dial plan. The key is that the callback number (mygizmo number here) needs to be setup on GV as a forwarding phone. If you are not using gizmo, than change the phone type value from 7 to 1. nonoh is a provider you define in Sip Providers page.
Use the console page to monitor the execution of your plan. You should at least see the system executes the outbound dial plan before trying to work on the detail logics.