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 1

Started by ianobi, June 28, 2013, 07:31:50 AM

Previous topic - Next topic

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

#1
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
OBi100, OBi110, OBi200, OBi202

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
OBi100, OBi110, OBi200, OBi202

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.




GregoryZ

I created a new account in CSipSimple, using a built in wizard.  Then tested it.

I call the number, and hear a Beep.  Then I get nothin'. 

So, I'm guessing it FAILED!  >:(

So, let me work on that issue, and see where it takes me.

Thanks for getting my head in a "Basic Starting Point" direction.  ;D

-G
OBi100, OBi110, OBi200, OBi202

ianobi

I think "beep" is normal for 4444. Just talk after the beep it should echo back.

GregoryZ

LOL!

Yeah, I figured it was normal.  But, no Echo.

I quickly set up an old Sipgate account.  I get the Echo back on that system.
I tested two of my CC accounts, and I get two way audio on them too.
Just not on Sip2Sip.

I'm still working on it.
OBi100, OBi110, OBi200, OBi202

ianobi

#8
I think there's a danger of confusion here for anyone reading this (including me) about what we are trying to do. There are two methods here:

Direct: CSipSimple > OBi
This is dealt with in this thread.

Indirect : CSipSimple > sip2sip > OBi
This is dealt with in thread http://www.obitalk.com/forum/index.php?topic=4647.msg30415#msg30415

GregoryZ

Ok.

For those who are following this ....

I've got the calls routing the way they should, using this Direct Method.

However, the voice quality is giving me fits!   I had it set up where I was getting One Way Audio, when calling from the Android, to another phone.  But tests today, there is no Audio at all.

I'm thinking that it is more of a Codec problem now.  I'm sure I have all of the required ports forwarded on my Router to my OBi100.

CSipSimple Ver: 1.01.00 r2272

CSipSimple does not have the standard G711a.  I believe I read on the website's change log something about PCMU was it's equal. 

For those of you who have this working correctly, can you tell me what Codec(s) you have set up in CSipSimple, and the order you have them.

As a note, I installed CC's app, and called my CC number direct from my Android phone.  I was getting only One way Audio then too.   ???   

-G

OBi100, OBi110, OBi200, OBi202

ianobi

My codecs in CSipSimple are set as follows:

Settings > Media > Codec priority list per bandwidth: checked

Settings > Media > Connections bandwidth type > Band type for wifi: Fast

Settings > Media > Codecs > Fast: PCMU 8kHz, PCMA 8kHz, GSM 8 kHz (In that order from top – all others disabled).


My examples below use sp1, change to whichever spX you are using.

The other thing to be sure about with this direct method is that it does need to be "piggy-backed" on a real, working, registered SIP provider. This setting ensures that the OBi sends out its external ip address correctly:

Voice Services -> SP1 Service -> X_RegisterEnable: Checked


This setting ensures that you do not run out of sessions when incoming and outgoing etc all using the same sp at the same time:

Voice Services -> SP1 Service -> MaxSessions : 4


This setting seems to work well with my OBi / router combination, but it might be worth trying it both checked and unchecked with all other settings left as stated above:

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

If it makes no difference, then leave it checked.


When a call is in progress, have a look in Status > Call Status and check the incoming Peer RTP address. When audio fails with this setup this usually shows as blank or internal when it should show the external address of the wifi link that you are calling in from.


Texas

#11
A MUCH BETTER SOLUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Easier Too ! This is so simple a baby can do this.

Ok. I tried and tried and tried to use the ObiTALK Android app and it SUCKS! (Apple app work ok). So, here is the good news!

I have an OBi100:

- SP1 = GoogleVoice
- SP2 = Callcentric SIP (100% FREE! Free callcentric number and FREE USA DID)
- Auto Attendant turned ON with default values

OBJECTIVE: If specific callcentric users OR anyone (your choice) calls our callcentric number which comes in on SP2 they get our Auto Attendant and can make a free USA phone call.
 
SOLUTION:
IF you put under Voice Services, SP2 Service, X_InboundCallRoute={1777xxxxxxx|1777xxxxxxx>:aa},{ph}    THEN the specified 1777xxxxxxx number/s goes to AA and your DONE !!!!! All other calls rings our phone. AA takes over and completes the call as desired. OBiTALK NOT USED OR ENABLED. OBi services on their web site NOT USED. EVERYTHING CONTROLLED BY YOUR OBi device.

Using cSIPsimple app works PERFECTLY on ALL Android and Apple devices. THE CALLS ARE ALWAYS 100% FREE. No DID number needed. Anyone in the entire world can call your OBi device and make free USA phone calls.

GREAT STUFF !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  

PS. Other SIP apps like Media5 phone (use to be my favorite but no more) and 3CX and many others have serious problems (especially the android apps). The call completes and voice works but is disconnected after a few seconds. MUST USE cSIPsimple !

Shale

Quote from: Texas on October 30, 2013, 12:55:13 PM
Anyone in the entire world can call your OBi device and make free USA phone calls.

This is the problem you were trying to "solve"?

Riyas

Hello,

I am trying to follow your method. But I am stuck during Csipsimple configuration.

My CSipSimple account caller is : riya
My useragentport is 5586

in account ID, I've entered Riya<sip:riya@127.0.0.1>
Proxy uri is sip:domainname:5586

But I am not able to place a call. When I click on Riya, I get an error message : Error during registration - Not implemented"

I don't know what's wrong with my configuration ?

Thanks for your help.

ianobi

Riyas,

Check that you have set up the CSipSimple local account correctly:

QuoteIn 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 settings at default.
No filters are required.

If you cell phone has any sort of wifi connection, then clicking on the local account name should show instantly as "registered". Of course, it's not really registered to anything unless you count the local machine "127.0.0.1".

Riyas

Hello,

It's working now. But I have only one way audio. They can hear me but I can't hear them. The port has been correctly forwarded. I have the same issue with wifi and 4G.

ianobi

Riyas,

Have a read through reply #10. Are you piggy backed on another SIP provider?

Speech depends on RTP. Are all the necessary RTP ports forwarded in your router? You might wish to put your OBI in the DMZ of your router for testing purposes as this opens all ports.

atng9

Hi,

I have this "Direct calling"  csipsimpe-obi working fine with two way audio when I use the wifi at home.
However, when I test with wifi from another location than home, I have only one way audio; people I called can hear me but I can not hear them.

Also, I tried the "indirect" csipsimple-sip2sip-obi successfully.  I got two way audio for wifi from home and outside of my home as well.

I would like to get help from you to solve my only non-working scenario "Direct calling" using wifi OUTSIDE of my home.  I noticed in this particular case my peer RTP does NOT get the external IP:

Number of Active Calls: 1
Call 1 Terminal 1 Terminal 2
Terminal ID SP2 GoogleVoice1
State connected connected
Peer Name AtObi
Peer Number atobi 9541234567
Start Time 22:20:09 22:20:09
Duration 00:00:03 00:00:14
Direction Inbound Outbound
Peer RTP Address 10.0.0.2:4002 74.125.39.11:19305(relay)
Local RTP Address 10.101.0.67:16812 10.101.0.67:6758
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=198; rx=199 tx=198; rx=214
RTP Byte Count tx=34056; rx=34148 tx=34056; rx=36808

Thank you in advance

ianobi

atng9 – welcome to the forum.

This is most likely caused by your OBi not giving out its external ip address in the SIP call set up messages. If you are "piggy-backed" on a registered SIP provider, then this is normally enough to solve the problem.

If you have a static external ip address, then you can tell your OBi to use it by setting:

Service Providers > ITSP Profile X > SIP > X_PublicIPAddress

and uncheck:

Service Providers > ITSP Profile X > SIP > X_DiscoverPublicAddress

There's more info on this subject – try a forum search using "X_PublicIPAddress". azrobert and hwittenb have contributed a lot of info on how to try and control which ip address an OBi will give out.

Personally, I prefer the indirect method as it allows for making outgoing calls reliably from your cell phone via sip2sip/OBi and also allows calls coming into your OBi to be diverted to your cell phone via sip2sip.


atng9

ianobi,

Thank you for your quick reply to my request.  Actually, I am already "piggy-backed" on a registered SIP with Callcentric (IP-Freedom along with DID - Free Phone Number).

I don't have a static external IP address.  However, I am using ddns service for my router's dynamic IP, and I used my ddns domaine without problem to access my Obi from csipsimple.  In my Obi110 I have:

- Service Providers > ITSP Profile X > SIP > X_PublicIPAddress (EMPTY)
- Service Providers > ITSP Profile X > SIP > X_DiscoverPublicAddress (CHECKED)

I am glad that your preference is the indirect method because it works fine for me too.  But I am experimenting this direct method, thinking that could give me some advantages such as:
- Better latency (I beleive having read this somewhere)
- Not dependent on another provider (Sip2sip) up-and-down-time

I will follow your advice by reading more on "X_PublicIPAddress".  Hoping this will bring me some lights to solve my issue.

Thank you