Posting my configuration that allows Freeswitch open source PBX to use my OBi202 as a proxy to Google Voice:
Freeswitch / Obihai 202 / Google Voice Integration for Free Calling
Obi Assumptions:
• Obihai 202 is being used as the proxy between Freeswitch and Google Voice
• SP1 and SP2 are already in use for other connections
• Google Voice has been configured on SP3
• SP4 is being used as the Proxy for Freeeswitch
Freeswitch Assumptions
• Google Voice will be used for outbound calling only
• Freeswitch and Obi device are in the same subnet
• Freeswitch has been installed on Linux from packages rather than compiled, so configuration files are under the /etc directory. I see no reason this cannot also work with a windows implementation of Freeswitch but that has not been tested here
• These instructions do not cover FusionPBX, although there is no reason that FusionPBX cannot be configured similarly
Thanks to AZRobert on the Obihai forums for this base configuration. It worked out of the box when dialing from a soft phone, but needed additional configuration to work with Freeswitch. It has been edited to match my Service Provider allocations and changed to use port 5080 for integration with Freeswitch:
OBi200:
Service Providers -> ITSP Profile D SIP -> ProxyServer: 127.0.0.1
Service Providers -> ITSP Profile D SIP -> X_SpoofCallerID: Checked
Voice Services -> SP4 Service -> AuthUserName: OBi200
Voice Services -> SP4 Service -> AuthPassword: OBi200PW
Voice Services -> SP4 Service -> X_RegisterEnable: Unchecked
Voice Services -> SP4 Service -> X_ServProvProfile: D
Voice Services -> SP4 Service -> X_Proxy: Checked
Voice Services -> SP4 Service -> X_InboundCallRoute:
{OBi200>(Msp1):sp3}
The above will route outbound calls to SP3
Voice Services-> SP3 Service-> X_InboundCallRoute: ph,sp4(OBi200@local_client)
OBi200 = UserId of IP phone
IP Phone:
Proxy: 192.168.1.100 (IP address of the OBi200)
Proxy Port: 5080 (X_UserAgentPort of OBi200 SP4 trunk)
UserID: OBi200
Password: OBi200PW
Again, this worked when using a soft phone. However, when attempting to dial from Freeswitch, I received a "486 Busy Here" response from the Obi. The 486 response is fixed by adding one more setting to the ITSP Profile D General form. See next step.
Additional OBI Configuration:
Service Providers → ITSP Profile D General → URL: IP Address of Freeswitch
Freeswitch Configuration:
Gateway located in /etc/freeswtich/sip_profiles/external/00_obi200.xml
<include>
<gateway name="obi200">
<param name="username" value="OBi200"/>
<param name="password" value="OBi200PW"/>
<param name="proxy" value="192.168.1.100:5080"/>
<param name="expire-seconds" value="600"/>
<param name="register" value="false"/>
<param name="retry-seconds" value="30"/>
</gateway>
</include>
Note port 5080 again matching the Freeswitch external SIP profile port.
Dial Plan Entry located in '/etc/freeswitch/dialplan/default/00_outbound.xml
<include>
<extension name="Obi200 outgoing call">
<condition field="destination_number" expression="^9(\d{10})$">
<action application="set" data="effective_caller_id_number=OBi200"/>
<action application="answer"/>
<action application="log" data="Dialing VIA OBi200/Google Voice: Outgoing Call"/>
<action application="bridge" data="{codec_string='PCMU'}sofia/gateway/obi200/$1"/>
</condition>
</extension>
</include>
• Match a prefix 9 followed by a 10 digit national number. Customize to your needs.
• Set effective_caller_id_number to the auth_user_name on SP4 of the Obi or you will receive a 486 busy response.
• Send a friendly log message
• Bridge the call. I've enforced PCMU to avoid any ambiguity in codec usage, but it may not be required to make calls.