Using CSipSimple With OBi – Direct Calling Method - Version 1

(1/6) > >>

ianobi:
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   8)

GregoryZ:
Hey Ianobi,

Here we go ....


EDIT:  I have this working, but there is No Audio in either direction.  I'm searching for an answer.

-G

ianobi:
Hi GregoryZ,

Are you testing with your cell phone connected via wifi? This setup works fine for me over wifi, but 3G is unreliable at best. I'm guessing 4G would be fine, but I have no way of testing that.

Are you testing from a remote wifi site (café/hotel etc) or from your home wifi? Calling from remote sites definitely needs this:

Service Providers -> ITSP Profile A -> SIP -> X_DiscoverPublicAddress: Checked

For me this setting works for remote and home wifi. However, for some router / OBi combinations it may cause a problem if you are testing using your home wifi as the OBi then needs internal ip addresses. If testing from home wifi try:

Service Providers -> ITSP Profile A -> SIP -> X_DiscoverPublicAddress: Unchecked

While a call is in progress (even with no audio) have a look at Status > Call Status. Clues can be gained from looking at Peer RTP Address and the various RTP readings showing rx and tx.

Best get this sorted soon - you will appreciate all the free phone calls when you are staying in that five-star hotel in the South of France   :D




GregoryZ:
Since You're Inviting, I guess You're Paying.  So, I guess I'm heading to France!   :o  However, we do have work to do before I can pack.   :P

Sorry I didn't get back to you yesterday, I ended up working, dang it!

All of my testing are via WiFI.

Here is what I've got going on for now.

Using Obi100 for testing setup, I've setup two methods on my Android Phone.
1) From this Post
2) From this Post: http://www.obitalk.com/forum/index.php?topic=4647.msg30415#msg30415

Using the Second method, I'm now getting One Way Audio if I UNCHECK X_DiscoverPublicAddress.

However, using Method 1, it doesn't give me Audio at all.

I've also tested this by calling from another WiFi network.  Results, No Audio.

I'm using port 5075.  In my Router, I have the port going to the OBI100.  Port 5060 is forwarded to my OBi200.

As for the Call Status, Using method #2, it looks like this:

Call 1             

Terminal 1   Terminal 2
Terminal ID   SP2   GoogleVoice1
State   connected   connected
Peer Name   Android   
Peer Number   4291964   13162043291
Start Time   08:34:37   08:34:37
Duration   00:00:08   00:00:20
Direction   Inbound   Outbound
Peer RTP Address   85.17.186.6:52052   173.194.79.127:19305(relay)
Local RTP Address   192.168.0.6:16806   192.168.0.6:7138
RTP Transport   UDP   UDP
Audio Codec   tx=G711U; rx=G711U (bridged)   tx=G711U; rx=G711U (bridged)
RTP Packetization (ms)   tx=20; rx=20 (bridged)   tx=20; rx=20 (bridged)
RTP Packet Count   tx=423; rx=11   tx=11; rx=452
RTP Byte Count   tx=72756; rx=1892   tx=1892; rx=77744

Calls using method #1 look like this:

Call 1             

Terminal 1   Terminal 2
Terminal ID   SP2   GoogleVoice1
State   ringing   connected
Peer Name   Android   
Peer Number   5555551212   13162043291
Start Time   08:36:48   08:36:48
Duration   00:00:30   00:00:30
Direction   Inbound   Outbound
Peer RTP Address   0.0.0.0:0   173.194.79.127:19305(relay)
Local RTP Address   192.168.0.6:16810   192.168.0.6:18918
RTP Transport   UDP   UDP
Audio Codec   tx=G711U; rx=G711U (bridged)   tx=G711U; rx=G711U (bridged)
RTP Packetization (ms)   tx=0; rx=0 (bridged)   tx=20; rx=0 (bridged)
RTP Packet Count   tx=0; rx=0   tx=0; rx=494
RTP Byte Count   tx=0; rx=0   tx=0; rx=84968

Also, using method 1, The call never shows "Connected" on the phone, and I get a 408 error on the Android.

System Status on the OBi100 shows SP2: Register Failed: 501 Not Implemented (server=127.0.0.1:5075; retry in 6s)(ALG=???)

But again, I'm connecting and get the one way Audio via method 2.   HMMM.....


Enough Info for ya?   :)
-G

ianobi:
No easy answers, but some points:

Method 2 (non-direct via sip2sip)

Peer RTP Address   85.17.186.6:52052    173.194.79.127:19305(relay)
Local RTP Address   192.168.0.6:16806   192.168.0.6:7138
RTP Transport   UDP   UDP
Audio Codec   tx=G711U; rx=G711U (bridged)   tx=G711U; rx=G711U (bridged)
RTP Packetization (ms)   tx=20; rx=20 (bridged)   tx=20; rx=20 (bridged)
RTP Packet Count   tx=423; rx=11   tx=11; rx=452
RTP Byte Count   tx=72756; rx=1892   tx=1892; rx=77744

All this looks ok. 85.17.186.6 is the sip2sip address so you are connected ok incoming, although if testing from your home wifi I would expect your OBi to resolve this as a local ip address. 173.194.79.127 is the GV address so outgoing is ok. The RTP lines show audio being transmitted and received. I wonder if you have a problem between your cell phone and sip2sip? It might be worth setting up the same sip2sip account on CSipSimple, but without the  filters, so you can call sip2sip test numbers and prove that link works. 4444 is their echo test.


Method 1 does seem to have a problem:

Peer RTP Address   0.0.0.0:0   173.194.79.127:19305(relay)

If you are testing using home wifi, then I would expect to see a Peer Address incoming  of 192.168.xx.xx, that is a local ip address that your cell phone is using to connect to your home wifi router. Has sp2 got a SIP provider with register enabled on it? Did you try this using method 1:
Service Providers -> ITSP Profile B -> SIP -> X_DiscoverPublicAddress: Unchecked


I can't think of many more variables to change. We may both need a holiday by the time we get this working   :)

Others feel free to join in here if you have tried this set up with any comments.



Navigation

[0] Message Index

[#] Next page