Revised: 4/11/2011
I've got the Obi 110 working with FreePBX and Google Voice. Using this set-up, I can dial calls from a PBX phone normally, and have them routed to either the Line Port or Google Voice. By default, these instructions will route ordinary calls (seven digit, ten digit, and eleven digit calls) to Google Voice and 911 calls to the line port. Optionally, users can dial 81 to force calls to the Line Port, or 85 to force calls to Google Voice. You can easily modify these instructions to meet your needs.
My thanks to MichiganTelephoneBlog, to Obi Tech Support, and to FreePBX's page on configuring the SPA3102, all of which I used in order to develop these instructions.
Here's my set-up:
Obi 110 Web Interface Settings
System Management – Auto Provisioning
Method: Disable
To Use Google Voice to Place and Receive Calls (If you aren't going to use Google Voice, skip down to the "To Use the Line Port" section)
ITSP Profile A- General-
Name: Google Voice
Signaling Protocol: Google Voice
X_UseFixedDurationRFC2833DTMF: Checked
SP1 Service- SIP Credentials
X_InboundCallRoute: SP2(2120000000) (Replace 2120000000 with your Google Voice #)
AuthUserName:
yourgmailaddress@gmail.comAuthPassword: YourGmailPassword
To Use the Line Port to Place and Receive Calls
Service Providers – ITSP Profile B – SIP
Proxy Server: 192.168.1.50 (REPLACE 192.168.1.50 WITH YOUR PBX IP ADDRESS)
RegisterExpires=300
X_SpoofCallerID: Checked
X_AccessList: 192.168.1.50 (REPLACE 192.168.1.50 WITH YOUR PBX IP ADDRESS)
Voice Services – SP2 Service
X-ServProvProfile: B
X_CodecProfile: B
X_InboundCallRoute: (You have two choices here)
To route all outgoing calls from your FreePBX to the Phone Line port, use this:
LI
If you'd like to be able to be able to easily select between both Google Voice and the phone port, you can use this:
{>(<85:>xx.):sp1}, {>(<81:>x.):li}
This parameter will route calls that begin with 85 to Google Voice, and will strip the 85 off the number before sending the call to Google Voice. All calls that start with 81 will go to the phone line, and the 81 will be stripped off. If you are going to use this method, you'll need to set up your outbound routes and trunks so that numbers are always prefixed. I'll discuss that below.
X_KeepAliveEnable: Checked
SIP Credentials:
AuthUserName: OBITRUNK1 (DO NOT MAKE THE USERNAME THE SAME AS YOUR PHONE NUMBER!!)
AutPassword: PASSWORD (Replace PASSWORD with a password of your choice)
URI: OBITRUNK1@192.168.1.50 (Replace 192.168.1.50 with your PBX Address)
Physical Interfaces – Line Port
InboundCallRoute: SP2(2125551212) (Replace 2125551212 with your phone number)
RingDelay: 3500 (0 if you don't have Caller ID, longer if you sometimes get no Caller ID on incoming calls)
DialDigitOnTime: 100 (you can lower this to get calls to go out faster)
DialDigitOffTime: 100 (you can lower this to get calls to go out faster)
SilenceTimeThreshold: 600 (you can change this if you want Obi to disconnect calls quicker after xx seconds of silence)
FreePBX/Trixbox Configuration
Trunk Configuration:
Trunk Description: OBITrunk1
Outbound Caller ID: 2125551212 (Replace 2125551212 with the phone number of the line plugged into your OBI 110)
CID Options: Allow Any CID
Maximum Channels: 2
(for now, use 2. If Obi patches the firmware, you may be able to delete this. If the Line port is in use, Obi sends an asterisk friendly response that tells Asterisk that the channel is in use and Asterisk will try another route. However, if Google Voice is busy (which happens after 2 outbound calls), Obi appears to still send 486/Line Busy, and Asterisk delivers a busy signal. If they change the Google Voice busy issue to make it work as the Phone Port does, then you could leave this blank).
Dialed Number Manipulation Rules:
81911+911|
81911+81911|
8512125555555+85911| (replace 2125555555 with your local police department #)
8518005558355+411|
8118005558355+81411|
8518005558355+85411|
85+|1XXXXXXXXXX
851+|XXXXXXXXXX
851212+|XXXXXXX
811+81|XXXXXXXXXX
811212+81|XXXXXXX
851+85|XXXXXXXXXX
851212+85|XXXXXXX
Replace 212 in the above examples with your area code.
The above is where all the call routing happens. If you chose to configure X_InboundCallRoute for SP2 as {>(<85:>xx.):sp1},{>(<81:>x.):li} instead of LI, then your FreePBX needs to prefix every dialed number with either 81 (to indicate that the call will go to the Line Port) or 85 (to indicate that the call is going out on Google Voice's service. The routes above do so. If you chose to go with LI only, you can use a more traditional set of Dialed Number Manipulation Rules instead of these.
The first three lines in the rules above handle 911 calls. A call to 911 without a prefix gets converted to 81911, which Obi then sends to the Line port. A call to 81911 doesn't get changed at all (you could actually remove this line, but I left it in for completeness). A call to 85911 gets changed to your local police department number and sent on Google Voice.
The next three lines handle 411 calls in a similar fashion, except by sending them to TELL ME. You can substitute your own Free 411 service if you prefer.
The next three lines handle calls that are dialed without a prefix, by adding 85 to them so that Obi will send the calls out on the Google Voice line. If you prefer these calls to go out on the Phone port, change 85 to 81 in these lines.
The next two lines handle calls that are dialed with an 81 prefix, but without the 1 or without the area code. The 1 or 1+Area Code are added and then the call is passed on to the Obi with an 81 prefix to indicate that the call is going out on the Line Port. And the final two lines handle calls that are dialed with an 85 prefix in the same way.
Trunk Name: OBITRUNK1
Note: This must match AuthUserName and words before @ in URI in OBI device. DON'T USE TEN DIGIT # here, or inbound calls from that number to other trunks will fail.
Peer Details:
username=OBITRUNK1 (must match Trunk Name, above)
type=friend
secret=PASSWORD (replace PASSWORD with your selected password)
disallow=all
allow=ulaw
qualify=yes
host=dynamic
dtmfmode=rfc2833
canreinvite=no
FreePBX Inbound Routes:
DID Number: 2125551212 (Replace 2125551212 with the phone number of the line attached to the Line Port). Have it route wherever you want
DID Number: 2120000000 (Replace 2120000000 with your Google Voice Number).
Have it route wherever you want
Set-up your outbound routes as follows:
Route Name: Emergency
Dial Patterns:
911
Trunk Sequence: ObiTrunk1
Route Name: X11
Dial Patterns
N11
Trunk Sequence: ObiTrunk1
Route Name: 81DialsOBITRUNK1
Music On Hold? None
Dial Patterns:
811NXXNXXXXXX
81NXXNXXXXXX
81NXXXXXX
81X11
81011.
81
Trunk Sequence: ObiTrunk1
Route Name: 85DialsGoogleVoice
Music On Hold? None
Dial Patterns:
851NXXNXXXXXX
85NXXNXXXXXX
85NXXXXXX
85X11
85011.
Trunk Sequence: ObiTrunk1
Route Name: Normal
Music On Hold? None
Dial Patterns:
1NXXNXXXXXX
NXXNXXXXXX
NXXXXXX
X11
011.
Trunk Sequence: Obitrunk1
Note: I've broken down the outbound routes into separate parts because I often choose to send 911 calls, 411 calls, etc. to different trunks. If you only use an OBI device and no others, you could easily combine some of these into a single outbound route. Also, if you choose to use the LI setting for X_InboundCallRoute, then you can greatly simplify the outbound routes used in FreePBX.