Incoming calls from the PSTN Line to the phone connected to OBi #2 isn't a problem. Outgoing calls from the phone connected to OBi #2 to the PSTN Line isn't as easy. The only solution I came up with is to have OBi #2 hot dial the Auto Attendant in OBi #1 in order to place an outgoing call.
After revisiting this, I just discovered that Obihai apparently decided to quietly support SIP/PSTN, SIP/SIP, SIP/GV, GV/PSTN, etc. gateway calling after all. I had previously been told this would not be supported in the current product. This simplifies the problem and makes the whole process totally transparent.
Don't register the OBi's on the OBiTALK Web Portal.
Starting from Factory Defaults...
1. Disable Auto Provisioning in each OBi:
System Management -> Auto Provisioning -> ITSP Provisioning -> Method : Disabled
System Management -> Auto Provisioning -> OBiTALK Provisioning -> Method : Disabled
2. Enable SIP in each OBi (SP2/ITSP Profile B):
Service Providers -> ITSP Profile B -> SIP -> ProxyServer : 127.0.0.1
Voice Services -> SP2 Service -> AuthUserName : (put anything here)
Voice Services -> SP2 Service -> X_RegisterEnable : (unchecked)
Voice Services -> SP2 Service -> X_ServProvProfile : B
3. Set Voice Gateway 1 in each OBi to point to the other OBi:
Voice Services -> Gateways and Trunk Groups -> Voice Gateway1
Name : OBi
AccessNumber : SP2(w.x.y.z:5061)
where w.x.y.z is the IP address of the other OBi.
4. Set the LINE Port in OBi #1 to bridge incoming calls to OBi #2:
Physical Interfaces -> LINE Port -> InboundCallRoute : {vg1,ph}
Remove ,ph if you don't want the phone connected to OBi #1 to ring on incoming calls.
5. Set the SP2 Service in OBi #1 to bridge incoming calls to the LINE Port:
Voice Services -> SP2 Service -> X_InboundCallRoute : {>(Mli):li}
6. Set the PHONE Port in OBi #2 to bridge calls to OBi #1:
Physical Interfaces -> PHONE Port -> OutboundCallRoute:
{([1-9]x?*(Mpli)):pp},{(<#:>|911):li},{**0:aa},{***:aa2},{(<**1:>(Msp1)):sp1},
{(<**2:>(Msp2)):sp2},{(<**8:>(Mli)):li},{(<**9:>(Mpp)):pp},{(Mpli):vg1}