News:

On Tuesday September 6th the forum will be down for maintenance from 9:30 PM to 11:59 PM PDT

Main Menu

Using CSipSimple With OBi – Direct Calling Method – Version 2

Started by ianobi, September 02, 2014, 08:09:37 AM

Previous topic - Next topic

ianobi

This is a method of using CSipSimple to directly call your OBi and use single-stage dialling to use the OBi's trunks to place calls. I'm assuming that you are using a dynamic dns public ip address to access your router. (If you have a fixed public ip address, then there are easier methods.) You need a spare spX for this method – this example uses ITSP Profile B and sp2; its UserAgentPort is 5071. The CSipSimple account has a CName "mob2obi" and CallerID "12345678".

OBi setup:

Service Providers -> ITSP Profile B -> SIP -> ProxyServer : 127.0.0.1
Service Providers -> ITSP Profile B -> SIP -> X_SpoofCallerID : checked
Service Providers -> ITSP Profile B -> SIP -> X_DiscoverPublicAddress: Checked
Service Providers -> ITSP Profile B -> General -> DigitMap (typical example):
(1xxxxxxxxxx|<1>[2-9]xxxxxxxxx|xx.S3|[^*#]@@.'@'@@.)

Voice Services -> SP2 Service -> Enable : (checked)
Voice Services -> SP2 Service -> X_ServProvProfile : B
Voice Services -> SP2 Service -> X_RegisterEnable : (unchecked)
Voice Services -> SP2 Service -> X_KeepAliveEnable: checked
Voice Services -> SP2 Service -> X_KeepAliveExpires: 60
Voice Services -> SP2 Service -> X_KeepAliveServer: stun.ideasip.com (or your choice)
Voice Services -> SP2 Service -> X_KeepAliveServerPort: 3478 (default)
Voice Services -> SP2 Service -> X_KeepAliveMsgType: stun
Voice Services -> SP2 Service -> X_UserAgentPort : 5071
Voice Services -> SP2 Service -> AuthUserName : 6789 (Anything, but not blank)
Voice Services -> SP2 Service -> CallerIDName : Whatever
Voice Services -> SP2 Service -> MaxSessions : 4
Voice Services -> SP2 Service -> X_InboundCallRoute (typical example):
{(12345678)>(Msp1):sp1},{(12345678)>**0:aa},{(12345678)>0:ph}

The X_KeepAlive settings will ensure that the OBi uses its public ip address as its SIP contact when you call in remotely. These settings may well be useful for other methods of direct ip calling.

The UserAgentPort does need to be forwarded in your router. Some routers may reject the incoming call on the basis that it appears to be unsolicited traffic.

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. For this example Insert "mob2obi<sip:12345678@127.0.0.1>"
4. Allow contact rewrite: uncheck.
5. Proxy URI – insert your dynamic dns plus UserAgentPort, such as "sip:my.dns.com:5071"
6. Leave all other account settings at default.

CSipSimple > Settings > Network > Resolve DNS SRV: checked
CSipSimple > Settings > Network > Enable STUN: checked
CSipSimple > Settings > Network > Incoming and Outgoing Calls – check relevant boxes. WiFi should be checked by default, add 3G if you wish to try it.

CSipSimple > Settings > Media – Set up codecs depending on which are supported by the voip providers you are likely to call. The OBi will act as a bridge, so it's a question of matching CSipSimple with your voip service providers, except for direct calls to the OBi (**0 for aa and 0 for phone), where you need to match your OBi. It's a good idea to try some of the less bandwidth hungry codecs such as ILBC, GSM and G729. G729 costs a few $ and comes as an app that auto integrates with CSipSimple.

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".

Now you should be good to go. It works for me reliably from free wifi hot spots, so have a wander around the local coffee shops and cafes and try it   :)



hwittenb

Always good to have "how to's" like this.

Interesting find about sending the Keep Alive message to a stun server and the resulting OBi's choice of using an external ip address in the sip signalling in the call response.  Obihai's logic on when to use a local network address or an external ip address is certainly an undocumented mystery. 

For receiving direct ip calls what about forwarding the UserAgentPort in your router to the OBi?  The incoming sip invite for the call would be unsolicited and potentially discarded by the router.

ianobi

QuoteInteresting find about sending the Keep Alive message to a stun server and the resulting OBi's choice of using an external ip address in the sip signalling in the call response.  Obihai's logic on when to use a local network address or an external ip address is certainly an undocumented mystery. 

You, me, azrobert and others have been investigating this mystery for a long time! It was actually a very old post involving Oleg and Obihai Support that gave me the idea to try this. It seems to work very reliably.


QuoteFor receiving direct ip calls what about forwarding the UserAgentPort in your router to the OBi?  The incoming sip invite for the call would be unsolicited and potentially discarded by the router.

Good point. I was assuming that all required ports would be forwarded. As you say, this is particularly important for unsolicited calls. I will add a note to the main post.

azrobert

Here is my version:

CSipSimple Setup:
Add a new account.
Select the BASIC wizard
Account name = OBixxx
User = OBixxx
Server = xx.xx.xx.xx:5061        (Your Public IP address and SP2 port#)
Password = password
SAVE

If you are registering to an OBi2xx with X_Proxy enabled, stop here.
If you are not registering, continue

Press and hold on the account name.
When a new screen appears, select "Choose Wizard".
Select Expert.
Select your account again.
Select Registration URI and blank it out, then ok.
SAVE

OBi Setup:
Service Providers -> ITSP Profile B -> General -> X_SymmetricRTPEnable: Checked

If this trunk is registered to a provider, stop here
If it's not registered to a provider continue

Service Providers -> ITSP Profile X -> SIP
X_PublicIPAddress: xx.xx.xx.xx   (Your public IP address)

Finished

This setup was tested at 3 different hotspots. I do not have a data plan, so it was not tested on a cell network.

I did not provide X_InboundCallRoute code. You can get that from previous posts. You also need to use port forwarding.


HH235

Can someone explain what this means:
"If you are registering to an OBi2xx with X_Proxy enabled"

I tried the ObiOn app with my android phone and it keeps crashing.  It seems to work ok with my iPad.
So I'd like to get this to work with my Android.

thanks.

azrobert

The OBi2xx can act as a proxy and you can register a device to the trunk defined as the proxy.
This is how to define a trunk as a proxy:
Service Providers -> ITSP Profile D -> SIP -> ProxyServer : 127.0.0.1
Service Providers -> ITSP Profile D -> SIP -> X_Proxy:  Checked
Service Providers -> ITSP Profile D -> SIP -> X_SpoofCallerID : Checked
Voice Services -> SP4 Service -> AuthUserName : OBi20x
Voice Services -> SP4 Service -> AuthPassword: password
Voice Services -> SP4 Service -> X_ServProvProfile : D

If you are using a trunk just defined as SIP and not a proxy, you need to configure CSipSimple to call without registration.

KDA740