Google Voice Dial Out

New features you'd like see on SIP Sorcery

Postby jay235 » Wed Aug 12, 2009 7:58 pm

Code: Select all
# Do your OUTGOING call processing customisations here.
   numbertocall = req.URI.User.to_str
   case numbertocall
      when /^500$/ then sys.GoogleVoiceCall("my@gmail.com","gv password","my sip number","#{numbertocall}")
      else sys.Dial("#{numbertocall}@sipgate")
   end
end
[/code]

I am trying to use this code, but it's not working for GV.

Any help appreciated.
jay235
 
Posts: 21
Joined: Wed Aug 12, 2009 2:15 pm

Postby guduri » Wed Aug 12, 2009 8:07 pm

jay235..... brilliant, that worked. I guess I need to read a ruby book instead of just making up code... Anyway why would ${dst} not work?
guduri
 
Posts: 87
Joined: Tue Jun 09, 2009 10:11 pm
Location: Ann Arbor, MI

Postby jay235 » Wed Aug 12, 2009 8:14 pm

guduri wrote:jay235..... brilliant, that worked. I guess I need to read a ruby book instead of just making up code... Anyway why would ${dst} not work?


guduri,

BTW, the credit goes to huibw who sent that to me.

So why is it not working for me? I am using a softphone but it fails for the when I dial using GV. i.e, if I dial 5004155551212 I get a call failed error.

What did you do to make this work?

Jay235
jay235
 
Posts: 21
Joined: Wed Aug 12, 2009 2:15 pm

Remote Server Returned an error: (500) Internal Server error

Postby venk25 » Wed Aug 12, 2009 8:33 pm

I get the following error message:

"Remote Server Returned an error: (500) Internal Server error."

Code: Select all
DialPlan 13:29:23:799: SDP on GoogleVoiceCall call had public IP not mangled, RTP socket <my_ip>:17424.
DialPlan 13:29:23:799: UAS call progressing with Ringing.
DialPlan 13:29:23:799: Logging into google.com for xxxxx@gmail.com.
DialPlan 13:29:24:580: Google Voice home page loaded successfully.
DialPlan 13:29:24:690: Call key ImlhHfwjq8bnsG743hTGee+gpGI= successfully retrieved for xxxxx@gmail.com, proceeding with callback.
DialPlan 13:29:24:752: Exception on GoogleVoiceCall. The remote server returned an error: (500) Internal Server Error.
DialPlan 13:29:25:252: Dial plan execution completed without answering and with no last failure status.
DialPlan 13:29:25:252: UAS call failed with a response status of 480.
venk25
 
Posts: 74
Joined: Sun Dec 16, 2007 3:33 pm

Postby MikeTelis » Wed Aug 12, 2009 8:37 pm

guduri,

your problem is here:

Google Voice Call to ${dst} forwarding to {mygizmonum} successfully initiated

It must be an error in your Ruby script. For some reason, substitution doesn't work (maybe you used single quotes instead of double quotes or "dst" and "mygizmonum" are undefined). If substitution worked, you'd see callee number in place of {dst} and your Gizmo number in lieu of mygizmonum.
MikeTelis
 
Posts: 998
Joined: Wed Jul 30, 2008 6:48 am

Postby MikeTelis » Wed Aug 12, 2009 8:46 pm

Weird, for some reason my girlfriend's getting 500 error:

Code: Select all
DialPlan 13:21:38:674: Logging into google.com for xxx@gmail.com.
DialPlan 13:21:40:721: Google Voice home page loaded successfully.
DialPlan 13:21:40:862: Call key bREqQkYYI1QcOX+OJ9cOUBtYFwQ= successfully retrieved for xxx@gmail.com, proceeding with callback.
DialPlan 13:21:41:315: Exception on GoogleVoiceCall. The remote server returned an error: (500) Internal Server Error.
DialPlan 13:21:41:330: There was an exception executing your dial plan script: exit
DialPlan 13:21:41:565: Dial plan execution completed without answering and had an execution error message of Dial plan exception.


while almost identical script works for me. The only difference between two scripts is GV e-mail, password and Gizmo callback number.

True, sometimes I'm getting the dreaded 500 error, too -- but it happens maybe once out of 10 calls. She has to place a successful call yet :(

Yes, I made sure that e-mail, password and Gizmo numbers are correct. And yes, if I initiated a call using Google Voice web page, everything worked (she'd received incoming call on her softphone logged into sipsorcery, answered the call and got thru to the callee).

Any ideas? Aaron, please help!
MikeTelis
 
Posts: 998
Joined: Wed Jul 30, 2008 6:48 am

Postby djon » Wed Aug 12, 2009 8:47 pm

jay235 wrote:
Code: Select all
# Do your OUTGOING call processing customisations here.
   numbertocall = req.URI.User.to_str
   case numbertocall
      when /^500$/ then sys.GoogleVoiceCall("my@gmail.com","gv password","my sip number","#{numbertocall}")
      else sys.Dial("#{numbertocall}@sipgate")
   end
end
[/code]

I am trying to use this code, but it's not working for GV.

Any help appreciated.

When you dial 5004155551212, your dial plan have no way of removing the 500 portion so the number is not a valid US number.
My implementation. For GV numbers I dial country code and check for "1" so your example would be 14155551212. I don't think their is any need to initialize another variable -numbertocall
Code: Select all
case req.URI.User.to_s 
  when /^\*9/ then sys.Dial("${dst:2}@F9") 
  when /^1/ then sys.GoogleVoiceCall("me@gmail.com", "password", "17470001111", "req.URI.User.to_s") 
else 
   sys.Log("== NO-Match Call with default VSOP ") 
   sys.Dial("VOIPo") 
end
djon
 
Posts: 58
Joined: Wed Jun 10, 2009 10:29 am

Postby gvtricks » Wed Aug 12, 2009 9:06 pm

I have Chang every thing Still dont work:

Code: Select all
#Ruby # OUT
sys.Trace = true
sys.Log("*****************************************************\t")
sys.Log("*             OUTBOUND CALL FROM RUBY DIALPLAN                  *\t")
sys.Log("*****************************************************\t")
sys.Log(" Received-URI:#{req.URI.User}\t URI-Length:#{req.URI.User.Length}\t")
sys.Log(" URI-Host:#{req.URI.Host}\t")
sys.Log(" From:#{req.Header.From.FromURI.User}\t Name:#{req.Header.From.FromName}\t")
sys.Log(" Incoming-Call:#{sys.In().ToString()}\t Outgoing-Call:#{sys.Out().ToString()}\t")
sys.Log(" ATA-Online:#{sys.IsAvailable("MY_SS_User_name", "sipsorcery.com").ToString()}\t")

# Do your OUTGOING call processing customisations here.
case req.URI.User.to_s
  when /^\*9/ then sys.Dial("${dst:2}@F9")
  when /^1/ then sys.GoogleVoiceCall("GV_Use_Namer@gmail.com", "My_GV_password", "17475551212" "req.URI.User.to_s")
else
   sys.Log("== NO-Match Call with default VSOP ")
   sys.Dial("VOIPo")
end



Plese Help

Thank you
gvtricks
 
Posts: 80
Joined: Wed Aug 12, 2009 2:48 pm

Postby gvtricks » Wed Aug 12, 2009 9:26 pm

Never mind I got it to work with XLite.

Thanks anyway
gvtricks
 
Posts: 80
Joined: Wed Aug 12, 2009 2:48 pm

Postby fixup77 » Wed Aug 12, 2009 10:09 pm

OK, here is this GV out in a nutshell:

1) In your Google Voice, let it forward to Gizmo5 (1747xxxxxxx).

2) Register to SipSorcery.com

Create a new SIP account. Add your Gizmo5 to SIP Provider (in this example, the name is "Gizmo5"), make sure you see it is registered.

3) Register your PAP2 to sipsorcery.com

In sipsorcery website, make sure you see your ATA is registered. Its dialplan must allow 1xxx-xxx-xxxx dials. You must use stun (such as stun.xten.com), NAT Mapping and NAT keep alive.

4) Add a dialplan.

This is the key part. Copy and paste this code to the default dialplan in sipsorcery. If you use a different name than Gizmo5, changed it all. Of course you need to put in your GV account, password and gizmo5 #. That's it, nothing else to change at least for now.

Make a call to your GV # from a cellphone and talk for a minute to make sure this setup works for incoming calls. Also go to your GV account and place a successful web call to this phone.

Now dial 19093900003 (echo service) from your phone (ATA), you should be connected beautifully.

Code: Select all
#Ruby
# Dial Plan Generated by Rubyzard v0.1
# If you need help, please post in our forum
# http://www.mysipswitch.com

# SIP tracing : true or false
sys.Trace = false

sys.Log("call from #{req.Header.From.FromURI.ToString()} to #{req.URI.User}.")

if sys.In then
# Do your INCOMING call processing customisations here.
    if sys.IsAvailable() then
       sys.Dial("#{sys.Username}@local",30)
       sys.Dial("Enter Number@Gizmo5",30)
       sys.Respond(480, "#{sys.Username} Not available")
    else
       sys.Dial("Enter Number@Gizmo5",30)
       sys.Respond(480, "#{sys.Username} Not available")
    end

else
  # Do your OUTGOING call processing customisations here.
    case req.URI.User
       #when /^1/ then sys.Dial("Gizmo5")
   when /^1/ then sys.GoogleVoiceCall("you@gmail.com","password","1747XXXXXXX","#{req.URI.User}")
       else sys.Dial("Gizmo5")
    end

end
Last edited by fixup77 on Thu Aug 13, 2009 7:02 am, edited 3 times in total.
fixup77
 
Posts: 71
Joined: Sun Jan 27, 2008 1:56 am

PreviousNext

Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 0 guests