This is a less complex way of using CSipSimple to directly call your OBi and use single-stage dialling to use the OBi's trunks to place calls. Thanks go to azrobert for some of the ideas used here. Also, thanks go to hwittenb for his research and excellent explanations of how OBi devices use internal / external ip addresses in SIP headers.
You need a fixed ip for your router or a dynamic ddns type address. At the OBi end I used sp1 for incoming calls, my UserAgentPort is 5070. This setup is "piggy-backed" on an existing registered SIP account voip provider (Must be SIP not GV). In this example the X_InboundCallRoute is based on an OBi110 with sp1 as its PrimaryLine:
Service Providers -> ITSP Profile A -> SIP -> X_DiscoverPublicAddress: Checked
Service Providers -> ITSP Profile A -> General -> DigitMap (typical example):
(1xxxxxxxxxx|<1>[2-9]xxxxxxxxx|011xx.|xx.|(Mipd)|[^*#]@@.'@'@@.)
Voice Services -> SP1 Service -> X_RegisterEnable: Checked
Voice Services -> SP1 Service -> MaxSessions : 4
Voice Services > SP1 Service > X_InboundCallRoute (typical example):
{(Mcot)>(Msp1),(Mcot)>(<**1:>(Msp1)):sp1},{(Mcot)>(<**2:>(Msp2)):sp2},{(Mcot)>(<**8:>(Mli)):li},{(Mcot)>(<**9:>(Mpp)):pp},{(Mcot)>**0:aa},{(Mcot)>0:ph},{ph}
User Defined DigitMap "cot" should contain the CSipSimple account CallerID
In CSipSimple set up an account to call without registration:
1. Create a Local account – it just requires an account name.
2. Long press on the account name > Choose wizard > Expert.
3. Long press on the account name > Modify account. Expert will prompt you for Account id. Insert "DisplayName<sip:CallerID@127.0.0.1>"
4. Proxy URI – insert details such as "sip:my.ddns.com:5070"
5. Leave all other account settings at default.
No filters are required.
CSipSimple > Settings > Network > Enable STUN: checked
Now, if you only have one CSipSimple account, you can dial from the CSipSimple dial pad as if you are on your home phone. Alternatively, if you have checked "Dialer integration", then you can dial from the native android dial pad and use your normal contacts. In this case, when you press the dial button, you will be asked to select the account to use – "CSipSimple account name" or " Use mobile".
Incoming calls to your mobile can be achieved in various ways:
1. Let callers dial your cell phone number – good where I live as caller pays 100% of the call
2. Get your DID to divert to your cell phone number after a delay of say 15 seconds – that is divert on no answer controlled by your voip provider.
3. Divert to your CSipSimple app. For this you will need to set up a voip provider using CSipSimple. Most choose a sip2sip account as they are free and seem to be good quality. If you do this, then remember to check the "Resolve DNS SRV" box in CSipSimple settings. Also you will need to modify the InboundCallRoute of the spX your DID is registered to. I'm going to show this as being all done on the same sp1 as above:
Voice Services > SP1 Service > X_InboundCallRoute (typical example):
{(Mcot)>(Msp1),(Mcot)>(<**1:>(Msp1)):sp1},{(Mcot)>(<**2:>(Msp2)):sp2},{(Mcot)>(<**8:>(Mli)):li},{(Mcot)>(<**9:>(Mpp)):pp},{(Mcot)>**0:aa},{(Mcot)>0:ph},{ph,sp1(12345678@sip2sip.info;d=15)}
This rule {ph,sp1(12345678@sip2sip.info;d=15)} rings your house phones as normal, then after 15 seconds also calls your sip2sip account registered on your CSipSimple app. I have ignored the "Oleg Method" in this example for clarity.
I have purposely used sp1 for all the various functions in this example. I have stress tested it on an OBi110 by making calls from CSipSimple using single-stage dialling through the OBi110 at the same time as there was an existing call ongoing between the house phone and the DID on sp1. All worked fine
Testing was all done using wifi. Testing this got me some exercise walking around my local area finding free wifi access