MySIPSwitch Community Forums Forum Index MySIPSwitch Community Forums
SIP Switch is an online call management application, allowing you using multiple SIP providers services with one piece of hardware. Manage all your calls on the fly: hang up, transfer, forward ...
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Google Voice Dial Out
Goto page Previous  1, 2, 3, 4, 5 ... 23, 24, 25  Next
 
Post new topic   Reply to topic    MySIPSwitch Community Forums Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
jay235



Joined: 12 Aug 2009
Posts: 21

PostPosted: Wed Aug 12, 2009 7:58 pm    Post subject: Reply with quote

Code:

# 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.
Back to top
View user's profile Send private message
guduri



Joined: 09 Jun 2009
Posts: 82
Location: Ann Arbor, MI

PostPosted: Wed Aug 12, 2009 8:07 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
jay235



Joined: 12 Aug 2009
Posts: 21

PostPosted: Wed Aug 12, 2009 8:14 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
venk25



Joined: 16 Dec 2007
Posts: 74

PostPosted: Wed Aug 12, 2009 8:33 pm    Post subject: Remote Server Returned an error: (500) Internal Server error Reply with quote

I get the following error message:

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

Code:
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.
Back to top
View user's profile Send private message
MikeTelis



Joined: 30 Jul 2008
Posts: 746

PostPosted: Wed Aug 12, 2009 8:37 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
MikeTelis



Joined: 30 Jul 2008
Posts: 746

PostPosted: Wed Aug 12, 2009 8:46 pm    Post subject: Reply with quote

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

Code:
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 Sad

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!
Back to top
View user's profile Send private message
djon



Joined: 10 Jun 2009
Posts: 45

PostPosted: Wed Aug 12, 2009 8:47 pm    Post subject: Reply with quote

jay235 wrote:
Code:

# 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:
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
Back to top
View user's profile Send private message
gvtricks



Joined: 12 Aug 2009
Posts: 76

PostPosted: Wed Aug 12, 2009 9:06 pm    Post subject: Reply with quote

I have Chang every thing Still dont work:

Code:
#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
Back to top
View user's profile Send private message
gvtricks



Joined: 12 Aug 2009
Posts: 76

PostPosted: Wed Aug 12, 2009 9:26 pm    Post subject: Reply with quote

Never mind I got it to work with XLite.

Thanks anyway
Back to top
View user's profile Send private message
fixup77



Joined: 27 Jan 2008
Posts: 71

PostPosted: Wed Aug 12, 2009 10:09 pm    Post subject: Reply with quote

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:

#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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    MySIPSwitch Community Forums Forum Index -> Feature Requests All times are GMT
Goto page Previous  1, 2, 3, 4, 5 ... 23, 24, 25  Next
Page 4 of 25

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Related websites: My SIP Switch , Blueface : VoIP , VoIP forum

Powered by phpBB