I need some help please. I looked through this thread - viewtopic.php?f=6&t=6282&start=30, but adding +1 did not work for me.
Please can someone help me get GV callback working again.
Thanks!
Here is my dial plan:
Code: Select all
if sys.In # If incoming call...
if sys.IsAvailable() then # if online
WP_key = 'd08e0820e8eef3b14976fb172960d98c' ###### EDIT THIS LINE WITH White Pages API key
CNAM = {
'416xxxxxxx' => "My Cell",
'647xxxxxxx' => 'Spouse'
}
if sys.In ..
name = req.Header.from.FromURI.User.to_s
name = ('1' + name) if name =~ /^[2-9]\d\d[2-9]\d{6}$/
name.sub!(/^011/,'')
if !(cname = CNAM[name]) && name =~ /^1([2-9]\d\d[2-9]\d{6})/
url = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%3D'http%3A%2F%2Fapi.whitepages.com%2Freverse_phone%2F1.0%2F%3Fphone%3D#{$1}%3Bapi_key%3D#{WP_key}'%20and%20itemPath%3D'wp.listings.listing'&format=json"
if js = sys.WebGet(url,4).to_s
if !(js =~ /"businessname":"([^"]+)"/ && cname = $1)
if !(js =~ /"displayname":"([^"]+)"/ && cname = $1)
cname = %w(city state).collect {|x| js =~ /"#{x}":"([^"]+)"/; $1}.join(', ')
end
end
end
end
name.sub!(/^1/,'')
sys.Log("Caller's number: '#{name}'"); sys.Log("Caller's name = '#{cname}'") if cname
# sys.SetFromHeader(formatNum(cname || name), nil, nil)
sys.SetFromHeader(cname || name, nil, nil)
# Forward call to bindings. Change FromURI when forwarding to
# @local, or else Bria won't find contact in its phonebook!
sys.Dial("#{sys.Username}@local[fu=#{name}]") #####HARDCODE XXXXXXXXXX as FORWARD NUMBER
# sys.Dial("#{sys.Username}@local[fu=#{name}]&XXXXXXXXXX@freephoneline[fu=#{name}]&XXXXXXXXXX@freephoneline[fu=#{name}]"
########or you can perform a normal follwme by adding the seconds at the end#####
sys.Dial("#{sys.Username}@local[fu=#{name}],20")
# sys.Dial("FOLLOWNUMBER2@freephoneline[fu=#{name}],10") #HARDCODE A NUMBER IF U WANT TO USE THIS
# sys.Dial("FOLLOWNUMBER3#freephoneline[fu=#{name}],10") #HARDCODE A NUMBER IF U WANT TO USE THIS
#######
sys.Respond(480, "#{sys.Username} Not available")
sys.Respond(480, "#{sys.Username} Not online") # switch to voice mail
end
else # if phone is not online.
sys.Dial("HARDCODE@freephoneline") #####HARDCODE FORWARD NUMBER
sys.Respond(480, "#{sys.Username} Not available")
end
else # Outbound call ...
GV_USER = 'xxxxxxxxxx@gmail.com' ###### your GV e-mail address (user@gmail.com)
GV_PASS = 'xxxxxxxxxxxxx' ###### my GV password
CB_NUMBER = '+1650xxxxxxx' ####### your number that google voice forwards to
sys.Log "** Call from #{req.Header.From} to #{req.URI.User} **"
case req.URI.User
#when /^1/ then sys.GoogleVoiceCall(GV_USER, GV_PASS, CB_NUMBER,"#{req.URI.User}") #GV Call Via Callback
when /^1/ then sys.GoogleVoiceCall(GV_USER, GV_PASS, CB_NUMBER, "#{req.URI.user}", ".*", 1)
####
#when /^1/ then sys.GoogleVoiceCall(GV_USER,GV_PASS,CB_NUMBER,"#{r eq.URI.User},".*",1") #Direct GV Call NoCallbackl
####
when /^411/ then sys.Dial("18004664411@freephoneline")
#when /
else
sys.Dial("#{req.URI.User}@freephoneline")
end
end
Code: Select all
DialPlan 15:49:28:144 sip1(3280): New call from udp:99.244.129.49:5060 successfully authenticated by digest.
DialPlan 15:49:28:175 sip1(3280): Using dialplan xxxx for Out call to sip:1416xxxxx@sipsorcery.com.
NewCall 15:49:28:191 sip1(3280): Executing script dial plan for call to 1416xxxxxxx.
DialPlan 15:49:28:269 sip1(3280): ** Call from "xxxx" <sip:xxxx@sipsorcery.com>;tag=6547fa661fac358ao0 to 14165775430 **
DialPlan 15:49:28:269 sip1(3280): SDP on GoogleVoiceCall call had public IP not mangled, RTP socket 99.244.129.49:16386.
DialPlan 15:49:28:269 sip1(3280): UAS call progressing with Ringing.
DialPlan 15:49:28:269 sip1(3280): Logging into google.com for xxxxxx@gmail.com.
DialPlan 15:49:28:409 sip1(3280): Google Voice pre-login page loaded successfully.
DialPlan 15:49:28:409 sip1(3280): GALX key ndUjf_nPgrE successfully retrieved.
DialPlan 15:49:30:936 sip1(3280): Google Voice home page loaded successfully.
DialPlan 15:49:30:983 sip1(3280): Call key M9xQ3k0hzjGxA87ooFIYma5MoWs= successfully retrieved for xxxxx@gmail.com, proceeding with callback.
DialPlan 15:49:30:983 sip1(4608): SIP Proxy setting application server for next call to user xxxx as udp:67.222.131.147:5070.
DialPlan 15:49:31:717 sip1(3280): Google Voice Call to 1416xxxxx initiated, callback #+1650xxxxx, phone type 1, timeout 30s.
NATKeepAlive 15:49:38:191 sip1(4392): Requesting NAT keep-alive from proxy socket udp:67.222.131.147:5060 to udp:99.244.129.49:5060.
NATKeepAlive 15:49:48:300 sip1(4392): Requesting NAT keep-alive from proxy socket udp:67.222.131.147:5060 to udp:99.244.129.49:5060.
NATKeepAlive 15:49:58:362 sip1(4392): Requesting NAT keep-alive from proxy socket udp:67.222.131.147:5060 to udp:99.244.129.49:5060.
DialPlan 15:50:01:731 sip1(3280): Google Voice Call timed out waiting for callback.
DialPlan 15:50:01:856 sip1(3280): Google Voice Call to 1416xxxxxxx was successfully cancelled.
DialPlan 15:50:01:856 sip1(3280): Dialplan cleanup for xxxxxx.
DialPlan 15:50:01:872 sip1(3280): Dial plan execution completed without answering and with no last failure status.
DialPlan 15:50:01:872 sip1(3280): Call failed with a failure status of TemporarilyUnavailable and .
DialPlan 15:50:01:872 sip1(3280): UAS call failed with a response status of 480.