Callback using GoogleVoice

New features you'd like see on SIP Sorcery
Post Reply
davidnewton
Posts: 179
Joined: Thu Aug 27, 2009 3:00 am

Callback using GoogleVoice

Post by davidnewton » Fri Oct 09, 2009 10:07 pm

I am not sure if this request is useful for many people. Here is my case: I have a DID from voip.ms which charges 1.5cents/min for incoming calls (higher than outgoing calls 1c/min). So I would like to reject the calls to this DID and call back. The following code in the in dial plan works well. It first hangs up the original call, and then call both legs after 10 sec. The ideal way is to use GoogleVoice call for the callback purpose. But the current version of GoogleVoiceCall is for outgoing calls and matches the GV number and the called number. There is no way to hang up the orginal call. I found out that the earliest version of GoogleVoiceCall can do this: hang up the original call and use GoogleVoice to call both legs. I am wondering if the hangup parameter is still in GoogleVoiceCall or not, or if it is possible to bring it back in the end as optional paramter? Thanks a lot.

Code: Select all

if sys.In then
  calledHost = req.Header.From.FromURI.Host.to_s    #ip address 
  case calledHost 
  when /^(209.62.1.2)/     #use call back for DID from voip.ms
      sys.Log("Call back from #{sys.Username}@local to #{req.Header.From.FromURI.User}@voip_ms")      
      sys.Callback("#{sys.Username}@local", "#{req.Header.From.FromURI.User}@voip_ms",10)    
  else
       sys.Dial("#{req.URI.User}@local",30) 
  end 
else
#outgoing plan
end

MikeTelis
Posts: 1582
Joined: Wed Jul 30, 2008 6:48 am

Post by MikeTelis » Sat Oct 10, 2009 4:28 am

David,

I haven't tried it this way, but hope it will work. Give it a try:

GoogleVoiceCall -> SIP proxy

Post Reply