Closed GoogleCodeExporter closed 9 years ago
I just want to say, this is of no true importance.
The only reason I brought this up was because my out-of-state relatives were
not
happy with being charged long distance to call me, so, using a few of my other
Gmail
accounts, I acquired numbers in their area codes so they could use them to call
me.
But, everytime I would call them it would show my home area code, which costs
them
long distance since they like to call me back based on my number that I called
from,
and I got those other numbers so they could use them instead of my main one.
There is probably some way to use the GoogleVoiceCall function in SIPSorcery to
pass
along details for another Google Account, but I haven't yet figured it out.
Original comment by XANAVi...@gmail.com
on 27 Feb 2010 at 6:26
It's not a big deal, but you'll have to write a bit of your own code. A good
starting
point is:
http://www.mysipswitch.com/forum/viewtopic.php?t=1678
You'll need to create "account descriptors" for each of your GV accounts and
then
pass this descriptor as a parameter to gvcall. Well, it's easier to explain by
example:
HomeAccount = [
['me1@gmail.com','pass1','1747xxxxxxx','.*',7,15],
]
Area303 = [
['me1@gmail.com','pass1','1747xxxxxxx','.*',7,15],
]
Area212 = [
['me2@gmail.com','pass2','1747xxxxxxx','.*',7,15],
]
def gvcall(num,descriptor,acnt)
a = descriptor[acnt % descriptor.length] # fetch params
sys.GoogleVoiceCall(*((a[0,3] << num) + a[3,10])) # insert number as 4th param
end
Of course, each descriptor may contain more than 1 entry (if you have several
callback numbers for this particular GV account). Then you pick descriptor
corresponding to callee's area code and pass it to gvcall, like that:
r = Time.now.to_i
case num
when /^1303/
2.times { |x| gvcall num, Area303, r + x }
when /^1212/
2.times { |x| gvcall num, Area212, r + x }
else
2.times { |x| gvcall num, HomeAccount, r + x }
end
Original comment by mte...@gmail.com
on 27 Feb 2010 at 3:47
[deleted comment]
None of my accounts currently have any more than 1 callback number right now.
So, what I would put in my dialplan code is:
Doing it this way, would I have to change the way I enter phone numbers to
include
the area code and the 1 at the beginning, or can I still do 7-digit dialing to
reach
numbers in my HomeAreaCode?
Or does the other unchanged parts of the dialplan do what they normally do and
modify
numbers to do that for me?
HomeAreaCode = [
['me1@gmail.com','pass1','1747xxxxxxx','.*',7,15],
]
606AreaCode = [
['me2@gmail.com','pass2','1747xxxxxxx','.*',7,15],
]
615AreaCode = [
['me3@gmail.com','pass3','1747xxxxxxx','.*',7,15],
]
864AreaCode = [
['me4@gmail.com','pass4','1747xxxxxxx','.*',7,15],
]
---------------------------------
I can't tell if this part needs to be modified, though.
def gvcall(num,descriptor,acnt)
a = descriptor[acnt % descriptor.length] # fetch params
sys.GoogleVoiceCall(*((a[0,3] << num) + a[3,10])) # insert number as 4th param
end
----------------------------------
I'm not sure where to place this.
Or whether it should stay the same.
r = Time.now.to_i
And this will go in the section along with the SIPBroker code (as in right
after
it), right?
case num
when /^1606/
2.times { |x| gvcall num, 606AreaCode, r + x }
when /^1615/
2.times { |x| gvcall num, 615AreaCode, r + x }
when /^1864/
2.times { |x| gvcall num, 864AreaCode, r + x }
else
2.times { |x| gvcall num, HomeAreaCode, r + x }
end
Of course I haven't yet put any of this in (I wanted to finalize it here first).
Original comment by XANAVi...@gmail.com
on 1 Mar 2010 at 1:48
> Doing it this way, would I have to change the way I enter phone numbers to
> include the area code and the 1 at the beginning, or can I still do 7-digit
> dialing to reach numbers in my HomeAreaCode?
We convert dialed numbers into international (ENUM) format: country code
followed by
area code and then phone number. Example: 12125551212. The code above deals
with
converted (normalized, ENUM-formatted, whatever you call it) numbers.
Therefore, in no way the changes will affect your dialing rules. You dial
7-digit
number, we convert it to "1 + home_area_code + number" and then we dial it
using your
HomeAccount credentials.
That was a simple question. The other questions... I'm not sure what to do.
Judging
by the way you're trying to modify the code (606AreaCode is illegal identified,
Ruby
constant names must begin with uppercase letter, like in AreaCode_606), your
knowledge of the language is very limited. You can't write code unless you know
the
language. So, either I should write the code for you or send you to the books.
I don't mind writing the code but I'm afraid it would contradict with the
purpose of
this site. It's to give people jump-start (copy/paste and go!). You're asking
for
something more complicated.
And yet, there are many variations. You have 1 callback number per account, the
others may have several. You're looking for 1:1 relations between area codes
and GV
accounts while some may want to use, say, their GV number in 347 area code to
call
all NY numbers (area codes 212, 718, 347, 646, 516). It's impossible to
implement all
this and yet keep the code simple to configure.
May I suggest that you read the Ruby docs?
Original comment by mte...@gmail.com
on 1 Mar 2010 at 3:38
Of course my knowledge of Ruby is limited... I've not been working with it for
a long
time (I only started shortly after I received the invite to Google Voice,
around the
end of December of last year).
Unlike you, I have hardly any experience.
I'm not asking for the code to be written for me.
As to those display names, I wasn't planning to put them in in exactly that way
that
I wrote them (as that would defeat my purpose of "finalizing" them here).
There is no need to take the display names (Identified name, Ruby Constant
name,
ect.) as being exactly like the finished product.
I know you typed more than I have responded to, but some of it I just don't
know what
to say back.
Original comment by XANAVi...@gmail.com
on 1 Mar 2010 at 4:43
@mtelis
Do you know where I can find the detailed description of the RUBY Dial Plan
syntax
on line? I need to learn more.
Thanks,
Original comment by victor...@gmail.com
on 5 Mar 2010 at 9:15
There is a help page on SS website:
http://www.sipsorcery.com/help/dialplans
You can also read this topic (it's an old one, from MySIPSwitch times:
http://www.mysipswitch.com/forum/viewtopic.php?t=399
And of course, you can refer to dialplan helper C# code.
Original comment by mte...@gmail.com
on 6 Mar 2010 at 5:21
Original comment by mte...@gmail.com
on 24 Mar 2010 at 8:01
Original comment by easter...@gmail.com
on 26 Mar 2010 at 2:43
Original issue reported on code.google.com by
XANAVi...@gmail.com
on 27 Feb 2010 at 6:15