GoogleVoiceCall -> SIP proxy

Catalog of dial plans
jvwelzen
Posts: 716
Joined: Thu Sep 11, 2008 1:56 pm

Post by jvwelzen » Mon Jan 04, 2010 7:15 pm

My idea was

When I forward my phone to a US number than the dialplan should detect that it should go to google voice

But when I forward my phone to a dutch mobile number then the dialplan should detect that it should go to provider1 or provider2

and the last if I would forward to another local user then it should detect that it should go to local

should it be possible to overide the num with the forwarding number

then detect on wich provider the forwardnumber should be dialed on

en then something like this

callswitch(num"&#{req.URI.User}@local")

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

Post by MikeTelis » Mon Jan 04, 2010 9:32 pm

I think this question is more appropriate for my other thread:

Flexible table-controlled dialplan, optimized for US, GV

but since you posted it here, I'll respond here.

Please take a look at the following lines in inbound call processing section of my dialplan:

Code: Select all

    if sys.IsAvailable()                              # If my ATA is registered 
      callswitch("#{sys.Username}@local[fu=#{name}]") # forward all incoming calls to it 
    elsif (8..23) === t.hour                          # else forward calls to my home 
      sys.Log("#{sys.Username} is not online, forwarding call to home number...") 
      callswitch("0",35)                              # Note that '0' is in my speed dial list 
    end
As you can see, I use callswitch("0",35) to forward incoming call to my home landline phone if my IP phone is offline and the call arrived between 8am and 11pm.

Callswitch method is the answer to your question. It takes care of everything, it will find '0' in speed dial table and replace it with my home phone number and automatically select VoIP provider from VSPtab. Thus, if I ever change my home phone number, I will only need to change corresponding entry in speed dial table. If I find a better provider for calling landline numbers in my home city, I will only have to change VSPtab. I don't need to change the code itself :) And if I decide to call my mobile number instead of home number, I'll only need to add corresponding entry to speed dial or use the number as a literal parameter of callswitch, like this: callswitch("+1 212 555-1212").

Of course, all this has nothing to do with the subject of this thread.

jvwelzen
Posts: 716
Joined: Thu Sep 11, 2008 1:56 pm

Post by jvwelzen » Thu Jan 07, 2010 4:58 pm

That does not solve my problem

I have a website where you can insert your forwarding number in a form

So If someone would enter a number I don't know the number and so I can only route it to my default provider and not automaticly trough google or other provider

I would really like to have a forward function where you can let 2 phones ring when you are called on your voip

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

Post by MikeTelis » Thu Jan 07, 2010 6:28 pm

Well, then you're in the right thread.

Indeed, you'll have to convert GoogleVoiceCall into SIP proxy, that's the only way (at the moment) to multi-forward (forward to 2 or more destinations simultaneously).

Then you'll have to write your own code for forwarding. Use selectVSP to pick the right provider for every forwarding number (except @local, of course) and then build dial string for sys.Dial by joining all destination string with '&'.

jvwelzen
Posts: 716
Joined: Thu Sep 11, 2008 1:56 pm

Post by jvwelzen » Sat Jan 09, 2010 4:14 pm

Hi Mike

I think I have your Google Sip Proxy working

when I call from outside my voip network to sip:number.GV_Call@sip.huizenwireless.nl the dialplan starts en calls to google

But the problem that I have when I try it internal I get the message that the local sip account could not be found

Any idea how to solve this

Another question would there not be a security isiue

If I would call for example sip:12026422987.GV_Call@sipsorcery.com

I wil be using your google acount (I tryed it but think you have disabled the sip account)

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

Post by MikeTelis » Sat Jan 09, 2010 4:58 pm

Security is a problem, that's why I verify requesting user's name before proceeding with the call.

As to your 1st question, I guess that you misconfigured Domains in my dialplan.

jvwelzen
Posts: 716
Joined: Thu Sep 11, 2008 1:56 pm

Post by jvwelzen » Sat Jan 09, 2010 5:29 pm

Domains seems ok

It could be my local version

jvwelzen
Posts: 716
Joined: Thu Sep 11, 2008 1:56 pm

Post by jvwelzen » Sun Jan 10, 2010 12:52 pm

Today I was thesting your script on sipsorcery.com

But receive error

** Error: can't convert String into Fixnum

But cannot find where the problem should be at

Edit :

Already found the problem

Strange that the local version does not behave the same like the online version of SS

jvwelzen
Posts: 716
Joined: Thu Sep 11, 2008 1:56 pm

Post by jvwelzen » Thu Jan 14, 2010 6:50 pm

MikeTelis wrote:gvtricks,

the problem with this approach is that your SIP phone (or softphone) rings for 5 seconds only, then it stops ringing and the call gets forwarded to your cell phone. 5 seconds is quite a short time and most of the time it's not enough to grab IP phone and answer the call on it.

If you converted GoogleVoice into a proxy you could make both IP phone and cell phone ring at the same time and the chances you answer incoming call on IP phone and don't waste cell phone minutes are much higher.
Hi Mike

I finally got your Google Voice -> Proxy working with some help from jainpj

But ringing both my ata and google number is not working

If I forward it to my ata and my google number

My google number doesn't ring until my ata has stopped ringing

Any tips or is this the way it is

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

Post by MikeTelis » Sat Jan 23, 2010 4:46 pm

Multi-forwarding works with sipsorcery.com. Maybe it's the local version, or you used '|' (failover) instead of '&' (multi-forward). Anyway, I'd check the console first.

Post Reply