Outgoing Calls Not Executing (Google Voice)

Support zone
Post Reply
Shaf77
Posts: 74
Joined: Sat Feb 20, 2010 11:54 am

Outgoing Calls Not Executing (Google Voice)

Post by Shaf77 » Wed Apr 06, 2016 2:03 pm

Hello,

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
My log from sipsorcery when trying to call.

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.

Aaron
Site Admin
Posts: 4652
Joined: Thu Jul 12, 2007 12:13 am

Re: Outgoing Calls Not Executing (Google Voice)

Post by Aaron » Thu Apr 07, 2016 10:50 am

I don't have an answer sorry but just posting to say the +1 fix didn't work for my test Google Voice account either.

I suspect there is something funny up with my GV account as when I try to add a new incoming number I always get an error irrespective of which area code or city I choose.

If you've got the patience to try it you could try setting up a new GV account and see if that makes any difference (I haven't tried this, mainly because I'm in Australia and it's a pain to keep GV thinking I'm in the US, and I only use the account for test calls).

yanngoyan
Posts: 2
Joined: Thu Apr 07, 2016 1:17 pm

Re: Outgoing Calls Not Executing (Google Voice)

Post by yanngoyan » Thu Apr 07, 2016 1:22 pm

The +1 fix didn't work for me too.

markhaas
Posts: 20
Joined: Wed Jun 01, 2011 10:05 am

Re: Outgoing Calls Not Executing (Google Voice)

Post by markhaas » Sat Apr 09, 2016 5:57 pm

I'm having the same problem. Was working before. Don't know when it stopped, but it's not working now. Argh.

Update: Just found the other GV thread, and adding the + to the callback number fixed it!

yanngoyan
Posts: 2
Joined: Thu Apr 07, 2016 1:17 pm

Re: Outgoing Calls Not Executing (Google Voice)

Post by yanngoyan » Sun Apr 10, 2016 4:11 am

What dial plan do you use that adding the + to the callback number fixed this problem?

markhaas
Posts: 20
Joined: Wed Jun 01, 2011 10:05 am

Re: Outgoing Calls Not Executing (Google Voice)

Post by markhaas » Sun Apr 10, 2016 8:10 am

I'm using a very old dial plan, one of the originals from Mike Telis:

Code: Select all

# Copyright(c) 2010 Mike Telis

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.


AREA_CODE = 'xxx'                  # my area code
GV_USER   = 'asdfghj@gmail.com'   # my GV e-mail address
GV_PASS   = 'ppppppppp'             # my GV password
CB_NUMBER = '+12345678900'          # my 11-digit number (only one)

SPEED_DIAL = {                    # my speed dial numbers
 '1'   => '11111111111',          # 
 '2'   => '12222222222',          # 
 '411' => '18004664411',         # Google 411
}

begin
   sys.Log "** Call from #{req.Header.From} to #{req.URI.User} **"

 if sys.Out                   # if outbound call
   num = req.URI.User.to_s        # Get a string copy of the number to dial

   num = SPEED_DIAL[num] || num   # Substitute with speed dial entry, if any

   case num
     when /@/ then sys.Dial num   # URI dialing
     when /^[2-9]\d{6}$/          # Local call, 7-digit number
       num = '1'+ AREA_CODE + num # prefix it with country and area code
     when /^[01]?([2-9]\d{9})/    # US number with or without country code
       num = '1' + $1             # add country code and truncate number to 10-digit
     when /^(011|00|\+)(\d{10,})/ # international number
       num = '+' + $2             # GoogleVoiceCall works with '+' prefix only


     else sys.Respond 603, 'Wrong number, check & dial again'
   end

   sys.Log "Calling #{num} via Google Voice"
   sys.GoogleVoiceCall GV_USER, GV_PASS, CB_NUMBER, num, '.*', CB_NUMBER =~ /^1747/ ? 7 : 1, 30

 else          # sys.Out
   sys.Dial "#{sys.Username}@local"
 end

rescue
 sys.Log("** Error: " + $!) unless $!.to_s =~ /Thread was being aborted./
end

Post Reply