New user: Help to set up SS

Catalog of dial plans
fabiopy
Posts: 28
Joined: Fri Jul 23, 2010 11:45 pm

New user: Help to set up SS

Post by fabiopy » Sat Jul 24, 2010 10:23 pm

Hello,

I just fit in the description of SS explanation of "who will use SS". Today I have several DIDs, several accounts with SIP gateways and a SIP Provider for outbound calls, all interconnected to GV. If I understand correctly, SS can help centralize this under one control.

I have some insight on SIP reached through experimenting. I would like to explain my current "map" and the one I wish to achieve with SS. The help I am requesting is two fold: 1)To confirm I correctly understand the way SS works and 2)help getting the correct configuration and scripts to make it function as I do not understand ruby.

CURRENT MAP
(Please note I do not live in the US and my SIP map is based in US DIDs to receive calls from my friends and family with US numbers and an outbound SIP Provider wich is Actionvoip, to make calls to PSTN)

1-I have 3 DIDs from IPKALL that ring in: a)home in my Dlink with SIP, b)fring in my cel c)nimbuzz desktop in my PC (that I use as my office inbound number)

2-The IPKALL numbers are forwarded to 3 accounts in Iptel.org (a sip gateway). I can log on to Iptel and receives calls made to my DID. Iptel also forwards outbound call starting with "00" or "+" to an outbound SIP Provider that you configure in it (in my case is Actionvoip). When you dial without the mentioned prefixes, your calls are made within SIP world (not sure if the expression is correct but I take it is understandable) so I can call other SIP accounts (not PSTN phones) via Iptel.org (and of course other SIP networks can call me dialing myuser@iptel.org)

3-I have one GV number that forwards calls to my 3 DIDs ( and occasionally a US cel phone when I travel) filtering calls and where to ring based on times and callers (basic configuration in GV)

4-Actionvoip does not make free calls to US and Canada, so to make use of GV free calls to US feature, I need to log in and use the interface in GV.

MAP OF WHAT I WOULD LIKE TO ACHIEVE WITH SIPSORCERY


A-Along the account created when signing up, I would need to create other 2 account in the SIP ACCOUNTS section, so I could log in from my 3 devices mentioned in topic 1 under CURRENT MAP. I would stop using Iptel and will forward the IPKALL numbers to each of the 3 SS accounts and then log from the devices directly into SS, each in one separate account.

B-In the SIP PROVIDERS section I would enter credentials of my outbound Sip Provider which is Actionvoip (here I am not sure wether I have to tick the "register" button, but I guess it would be fairly simple to confirm based on trial and error). I understand that this SIP Provider can be used by any of the 3 sip accounts in SS.

C-The DIAL PLANS is where I could not go through, not only for not quite understanding the Ruby code, but also because I have some doubts of how Dial Plans and SS itself works when placing calls. My idea of the basic features are:

C1- The outbound calls starting with 00 or + would be forwarded to Actionvoip (from all sip accounts in SS)

C2- To make use of the GV call back feature for free US calls, numbers starting with "1" (or any other special character or format. Maybe "00"and for the outbound to actionvoip only use the "+") will initiate the request to GV for the callback. Here I am not sure if GV can pinpoint which sip account from SS is making the request, so that the call back number to use to connect the call is the number associated with that sip account. What I mean is: if I call from my cel using fring associated with SS sip account, how GV will know which of my phones to ring in the callback? Is this possible?

C3-I am not sure if SS acts like Iptel, in the way that calls not starting with the characters that would forward them via the SIP PROVIDER, will generate an actual call via SS to the SIP network. Example: to call users of sip numbers in Voxalot, Gizmo, Iptel, etc. dialing something like user@sipgate.com.

I saw the examples of simple and complex dial plans, but really could not understand many thing in them. I see there are options with Gizmo or Sipgate for the GV callback, but is it not possible to initiate the request to GV from SS and assign the callback number to use based on the sip account I am calling from or a special character at the beginning (one for each sip account) without Gizmo or Sipgate?

I really could not figure out how to modify those example for the "map" I would like to set, explained above (this is, if I correctly got how SS works and I am not missing something).

RESUMING:


-Are assumptions of how SS works and the planned map correct? If not I would appreciate the explanation of what is incorrect in my assumptions and how it actually works.

-Is it possible to supply a code for the dialing plan I intend?

Help will be apreciated. Thanks in advance.

F

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

Re: New user: Help to set up SS

Post by MikeTelis » Mon Jul 26, 2010 3:19 am

Do you have Sipsorcery account? Now that new accounts have been disabled this discussion doesn't make much sense unless you already have SS account...

rbos
Posts: 16
Joined: Tue Sep 01, 2009 5:12 pm

Re: New user: Help to set up SS

Post by rbos » Fri Jul 30, 2010 4:31 pm

You should be able to do everything you want to do with SS. The "Use Cases" section of the BB has examples of dialplans. They will be confusing to you, but if you read through a number of them you will eventually get the idea. Find one that most closely matches what you want to do and play around with it.

If you don't already have an account, no problem, you can "win" one on ebay. Its not very expensive and the money goes towards keeping the server running.

fabiopy
Posts: 28
Joined: Fri Jul 23, 2010 11:45 pm

Re: New user: Help to set up SS

Post by fabiopy » Fri Jul 30, 2010 9:10 pm

Hello,

I do have an account at SS.

I understand the basics of SIP and have been reading through the posts and examples, but really did not get the hold for Ruby.

I know what I am asking is wishful thinking, but maybe somebody can help configure the dial plans and links to my accounts based on the map explained above. Hope is the last to be lost...

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

Re: New user: Help to set up SS

Post by MikeTelis » Sat Jul 31, 2010 2:36 am

Here I am not sure if GV can pinpoint which sip account from SS is making the request, so that the call back number to use to connect the call is the number associated with that sip account. What I mean is: if I call from my cel using fring associated with SS sip account, how GV will know which of my phones to ring in the callback?
Here is how sys.GoogleVoiceCall works:

1. Login to your Google Voice account using provided credentials (GV username and password).
2. Initiate outbound call (as if you clicked on the "Call" button on GV webpage) using provided callback number.
3. Wait for callback.
4. Bind your outbound call and callback together (so that you can talk to called number).

Let's explore #3 above in detail. How does sys.GoogleVoiceCall tell the callback from regular incoming calls? First, the callback should arrive within specified time frame (see time-out parameter), for example, within 30 seconds after you issued sys.GoogleVoiceCall. Second, caller ID of incoming call is tested against the "match" parameter of sys.GoogleVoiceCall (typically it's '.*' -- accept any caller ID). And 3rd, sys.GoogleVoiceCall looks for incoming call by your SS login name. That is, the callback may arrive to any of your SIP accounts, not only to the one which issued sys.GoogleVoiceCall.

Considering the above, probably you don't need separate SIP accounts for your ATA, Fring and Nimbuzz. The only reason to use separate accounts is that you want to call between accounts (from ATA to Fring, for example)... or may be, you want to implement different routing for incoming calls (say, calls are routed to ATA during the day and to Nimbuzz and Fring after work hours). If it's not the case -- you only need one SIP account and probably you don't need that many callback numbers for your GV (one is enough, or two if you want some kind of "backup").

There is yet another factor. Calling between Sipsorcery SIP accounts works good as long as the bindings (ATAs and/or Softphones registered to these accounts) have different external IP. That is, if you have ATA registered at home and Nimbuzz running in the office, calling between them shouldn't be a problem. However, if both are sitting behind the same router (and have the same external IP), you are in trouble! Typically the phone will ring but you won't get any audio.

So, do you think you'll need separate SIP accounts for your ATA/softphones?

fabiopy
Posts: 28
Joined: Fri Jul 23, 2010 11:45 pm

Re: New user: Help to set up SS

Post by fabiopy » Sat Jul 31, 2010 4:24 pm

Let's explore #3 above in detail. How does sys.GoogleVoiceCall tell the callback from regular incoming calls? First, the callback should arrive within specified time frame (see time-out parameter), for example, within 30 seconds after you issued sys.GoogleVoiceCall. Second, caller ID of incoming call is tested against the "match" parameter of sys.GoogleVoiceCall (typically it's '.*' -- accept any caller ID). And 3rd, sys.GoogleVoiceCall looks for incoming call by your SS login name. That is, the callback may arrive to any of your SIP accounts, not only to the one which issued sys.GoogleVoiceCall.

Considering the above, probably you don't need separate SIP accounts for your ATA, Fring and Nimbuzz. The only reason to use separate accounts is that you want to call between accounts (from ATA to Fring, for example)... or may be, you want to implement different routing for incoming calls (say, calls are routed to ATA during the day and to Nimbuzz and Fring after work hours). If it's not the case -- you only need one SIP account and probably you don't need that many callback numbers for your GV (one is enough, or two if you want some kind of "backup").

There is yet another factor. Calling between Sipsorcery SIP accounts works good as long as the bindings (ATAs and/or Softphones registered to these accounts) have different external IP. That is, if you have ATA registered at home and Nimbuzz running in the office, calling between them shouldn't be a problem. However, if both are sitting behind the same router (and have the same external IP), you are in trouble! Typically the phone will ring but you won't get any audio.
Thanks for your reply.

ATA and Nimbuzz ring my GV number at scheduled times (working hours to Nimbuzz and rest of day to ATA. Fring in my cel rings all day, so I could pick up call to office from Nimbuzz and fring and at home from ATA or fring. I do undertsand I cannot call SS to SS when behind the same router.

If I were to use a single SIP, how GV will know to which number to forward the callback?. What I am not sure is if for the callback, the rules of scheduled ring also apply (working hours to nimbuzz/fring and rest of day to ATA/fring). If so, then I understand I can use a single SIP. I assumed that in the dialing plan you needed to give GV instructions of to which number to callback, that is why I considered separate SIPs.

Also, if I change the plan to a sigle SIP, can I connect the 3 devices (and may increase in future) to the same SIP account in SS?

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

Re: New user: Help to set up SS

Post by MikeTelis » Sat Jul 31, 2010 6:48 pm

if I change the plan to a sigle SIP, can I connect the 3 devices (and may increase in future) to the same SIP account in SS?
You can register 3 (and more) devices to the same SIP account in SS. However, you can't control which one (of those 3 devices) to call: incoming ring to this SIP account will ring all registered devices.

Thus, if you want to control which device to ring at what time, you need to create separate SIP accounts.

My Flexible table-controlled dialplan, Version 2 will cover all your needs.

Create 3 SIP accounts, let's call them main, sub1 and sub2. In fact, the "main" account is already created, its name is the same as your SS login, so you only need to add sub1 and sub2. All three accounts will use the same dialplan, for both "In" and "Out".

Your IPKall numbers should forward incoming calls to main@sip.sipsorcery.com, sub1@sip.sipsorcery.com, sub2@sip.sipsorcery.com. Let's forget about incoming calls from ActionVoip for now; we can always add them later :)

Define SIP accounts as follows:

Code: Select all

Credentials  = { :usr => 'myname', :pwd => 'password' }  # Your Google Voice login and password

GVaccount = [
  Credentials + { :cb => '(206) xxx-xxxx' },  # Your IPKall-1 DID number
  Credentials + { :cb => '(253) xxx-xxxx' },  # Your IPKall-2 DID number
  Credentials + { :cb => '(425) xxx-xxxx' },  # Your IPKall-3 DID number
]

# SIP accounts

ActionVoip = VSP.new '#0', '00 ${EXTEN}@ActionVoip', 'Action VoIP'

GVoice     = GV.new  '#1', nil, 'Google Voice', 
                     :account => GVaccount,  :repeat => 2, :rand => true

             VSP.new '**', 'DisableSafeGuards'     # Disable safeguards prefix is **
Now you need selectVSP method. Here it is:

Code: Select all

# ********************  s e l e c t   V S P  *******************************

def selectVSP    # VoIP provider selection

  case @num
    when /(^1([2-9]\d\d)[2-9]\d{6})/                 # North America
      @num = $1                                      # Truncate to 11 digits
      case $2                                        # check area code
        when "800", "866", "877", "888"              # toll free numbers...
          route_to GVoice, "USA toll-free", false    # call from GV number, disable ENUM search
        else
          route_to GVoice, "North America"           # all other destinations within US & Canada
      end

      route_to ActionVoip, nil, false     # If GV call failed, try one more time with ActionVoip

  else
    rejectCall(603,"Number's too short, check & dial again") if @num.length < 10
    route_to ActionVoip
  end
end
Outbound calls will work as follows:

1. When you call to North America, it will call from your GV number (even if you're calling to toll-free number, I deliberately disabled ENUM search). GV will select one of your IPKall numbers for callback at random, no matter which device you used to place the call (ATA, Fring, or Nimbuzz); if call fails, it will try again using next number for callback. If all attempts to connect via GV failed, it will try one more time with ActionVoip.

2. When you call to any other destination, the call will be routed via ActionVoip. Dialplan will automatically add 00 prefix before the number.

3. You can force VSP selection by dialing #0 or #1 before the number.

What about incoming calls? They should start working properly right away. You may want to add WP_key if you need CNAM (Caller's Name lookup).

You may also want to change to_ENUM method. Right now it's adapted for US/Canada dialing. If you live in Europe, you may want to use 0 for long-distance (00 for international calling is already supported).

beaver
Posts: 241
Joined: Tue Feb 09, 2010 5:32 am
Location: Beaverton USA (PST, GMT - 8)

Re: New user: Help to set up SS

Post by beaver » Sat Jul 31, 2010 9:47 pm

fabiopy wrote: 1-I have 3 DIDs from IPKALL that ring in...
2-The IPKALL numbers are forwarded to 3 accounts in Iptel.org (a sip gateway)....
Just curious, how do you select your IPKall numbers?

I would choose them from three different area-code (a 360-, a 253- and a 425- ). In case, one of three is down (IPKall number has a problem occasionally), you could still have access via other two numbers.
Also, it's well-known, most of IPKall numbers are simply termintors, won't offer CID feature.
But there are certain numbers, (360-215-xxxx, 360-717-xxxx, ...) from small PSTN stations, these specific IPKall numbers will display CID correctly. Since IPKall number is free, you can keep applying until you obtain such numbers (you need to test them one-by-one, discard the ones you dislike). Once you have one of these numbers, your input dial-plan could be simply. that's very helpful, especially when you are new.
You can develop complex dial-plans when you get initial success. Dial plan examples by Mike are available within the forums.

fabiopy
Posts: 28
Joined: Fri Jul 23, 2010 11:45 pm

Re: New user: Help to set up SS

Post by fabiopy » Sat Jul 31, 2010 11:16 pm

Mike/Beaver

Thanks a lot.

As I mentioned, I am far away to even get close to your examples. I will need a lot of trial an error to understand the code and relationships.

Some questions/doubts, to put this to work:

IN THE SS INTERFACE
-When adding the 2 additional SIP accounts, there are various options such as: out and in dial plan (should I leave blank or place default as is in main?), keep alive (?), network ID, IP address ACL.

-When adding my actionvoip in the sip service should I check "register"? Register contact? Also there is advance settings. Is there anything to tweak there or just leave empty?

DIAL PLANS
When placing calls from my cell (fring) or from nimbuzz, I will be using data from my registered contacts (not dialing manually). In my current configuration calls starting with 00 or + are directed to actionvoip and when dialing from fring/nimbuzz all numbers start with + so I just choose the contact, but do not input the number manually (and at home via ATA I dial manually inserting 00 to connect via AV). I don't understand the code completely but I think this fact may conflict with the script.

-In the SS configurations when I place a call to a US number (starting in 1 and also in +1 that is?) a request will be placed to GV which will ring back my registered numbers in GV and if no one picks up, it will attempt via actionvoip (correct?)

-So to call other destinations, now SS will automatically add 00. What will happens when dialing with fring or nimbuzz when the number starts with + (even US numbers as explained above)?

-I also understand that when number of digits is lower than 10, it routes to actionvoip. What about numbers equal or larger than 10 (does this number of digits include the + that comes automatically in fring/nimbuzz) and are not US destination?

-For now I will only have one VSP (actionvoip). Will the dial plan automatically use it or I need to write the title of sip provider as it is written on the dialplan (i.e. ActionVoip instead as for instance actionvoip)?

HOW TO INPUT THE SCRIPT
-For the SIP accounts: I created sub 1 and sub 2 normally. How (and where) do I input the script you included for "Define the SIP accounts"?

-To make changes to your script and add the credentials, I should select all and paste to a word processor. The to include in the Dial Plan: a)do I need to write everything or is there a method to paste (I just get a box with the word "silverlight"on it and no way to paste.

-Should I include the whole text on the script (including titles? I take the # tells the program that it is a text string, explanatory for the user, but I need to ask)

-On "Define SIP accounts", The first line states the info for Credentials. Then for the lines of GVaccount I just need to place the word "Credentials"and not user and pass, correct?

IPKALL
Nice tip. I just took numbers assigned, but will check for the PSTN stations.

Again, many thanks for sharing experience. I am sorry to ask so many questions (I realize some of them are really very basic) but Ruby is just too new for me.

mnipp
Posts: 192
Joined: Sat Oct 03, 2009 9:48 am
Location: NSW Australia

Re: New user: Help to set up SS

Post by mnipp » Sat Jul 31, 2010 11:45 pm

Keyboard shortcuts work; use Ctrl-C to copy and Ctrl-V to paste.
Ctrl-A to 'select all' of the plan to copy.
billion 7404VGP
dialplan (<9*:*>[0-9*][0-9*].T<:@sipbroker>|[0-9*].T)

Post Reply