[GUIDE] Free VOIP calls w/ iLBC codec

Search This thread

acegolfer

Senior Member
Jun 2, 2008
776
221
UPDATE: This may not work any more because Google said that they will cut off the Google Talk XMPP on 5/15/2014, which PBXES relies on.


This guide is not about how to make free calls. It's about how to make free calls using iLBC codec so that you can make reliable calls over 3g connection. If you only want the instructions, then skip to part V.

(edited) I have changed my VoIP set up to PIAF on AWS EC2. See my signature.

I. BACKGROUND

There are several known methods to make free VoIP (internet) calls over 3g. I'll briefly discuss each to explain why there's no perfect solution. I'm not claiming my solution is perfect, either. You have to try them out and find out yourself what works for you.

1. Groove IP app

codec: PCMU (aka G711u, uncompressed signal used by PSTN and Google Voice, only good for fast/reliable wifi connection)
pros: simple setup, works well on wifi. If you use VoIP only on wifi, this is for you.
cons: echo. The voice quality is terrible on mobile data (3g) connection.

2. talkatone app

codec: speex for standard quality
pros: easy setup, good quality on 3g using speex .
cons: doesn't integrate well with android

3. Vonage mobile app

codec: G729(?) when making regular calls. iSAC when calling a Vonage member.
pros: G729 provides an excellent quality even on 3g.
cons: can't receive calls and doesn't integrate with Android. You need to input 10 digit number to make a call, unless the number is in your contacts.

4. Google Voice/pbxes/sipdroid (http://xdaforums.com/showthread.php?t=1791957)

codec: lots of options based on connection type
pros: excellent battery life (http://code.google.com/p/sipdroid/wiki/NewStandbyTechnique), If you choose speex codec for 3g, then call quality is pretty good on 3g.
cons: must unlock the screen before answering the call. doesn't support better codecs such as iLBC/G729.

5. simonics GV gateway https://simonics.com/gvgw/ + sip client of your choice

codec: PCMU
pros: simpler setup than pbxes, some ppl claim it's more reliable.
cons: limited codec support. no multiple registrations

6. Setting up your own asterisk server (http://enjoytechnology.info/)

pros: everything is configurable
cons: requires a 24/7 running server

I have been primarily using #4 setup but wasn't satisfied with the call quality on 3g so I was about to do #6. But I found a way to tweak #4 to use iLBC codec and greatly improved the call quality on 3g.


II. CODEC COMPARISONS

The call quality basically depends on (1) the codec that your phone uses and (2) the network throughput. Unfortunately, there's no perfect solution because of trade-offs.

PCMU (64kbps) is the uncompressed signal that is transmitted at PSTN. So it will give you the best quality as long as your network throughput supports it. This is the preferred codec for wifi connection. However, 3g network cannot consistently sustain 64kbps and will suffer from packet loss resulting in jitter. This explains why Groove IP works best on wifi but not over 3g.

At the other end of the spectrum is GSM codec (8kbps). It's designed in 1990 for wireless communication over 2g. It's the most compressed signal, which is used by your regular GSM providers (AT&T, Tmo). These wireless providers allocate sufficient capacity on voice calls so your voice calls will suffer little jitter. However, the call quality is inferior to PCMU codec.

There are many codecs in between. For example, Sipdroid and talktatone can use speex, which requires low bandwidth. These apps can send the same signal twice to compensate for packet loss.

The 2 codecs that haven't been used widely in commercial apps are G729 and iLBC. These 2 codecs require low bandwidth (<15kbps) but have algorithm to interpolate loss packets. It is suggested these 2 codecs are ideal codec for 3g connection. Here are some readings comparing G729 vs iLBC.

http://blogs.elastix.org/en/2009/11/...cs-in-elastix/
http://forums.whirlpool.net.au/archive/1413041

In short, both are excellent codecs for 3g. iLBC has a better quality but requires more CPU power, which Nexus 4 can easily handle. My setup relies on iLBC.


III. SETUP

My setup is an extension to #4 method above. It involves 4 free resources.

1. Google Voice (same phone number for in/out calls and free outbound calls using gtalk)
2. callcentric (VoIP provider for free inbound calls)
3. pbxes (PBX that manages in/out calls)
4. csipsimple (android VOIP app that supports iLBC)


Once set up properly, here's how the incoming and outgoing calls will work.

1. Incoming GV calls
Someone calls your GV number. GV forwards the call to callcentric. Pbxes intercepts the call and rings your phone. Your phone displays caller ID (CID) properly.

2. Outgoing GV calls
You place a call in your phone dialer. Pbxes calls the number using gtalk trunk. The recipient will see your GV number as CID.


IV. BENEFITS

What are the benefits of my setup?

1. Completely free in/out calls. You don't even give out any CC information. All I'm paying is 30/m for Tmobile's 100 min, unlimited data prepaid plan.
2. Excellent call quality even on 3g using iLBC codec. I often get better call quality than Tmo's GSM.
3. Keeping the same number for in/out calls.
4. Full Android integration.
5. Battery life. Only requires 1 SIP registration to pbxes using TCP port. Battery stat screenshots after 10 hours are attached here: http://xdaforums.com/showpost.php?p=35889479&postcount=91


V. INSTRUCTIONS

Are you still with me? Then follow these steps.

#1. Get a fast phone that can handle iLBC codec. FYI, a 2-yr old Galaxy S has the sufficient CPU power for iLBC.

#2. Get an unlimited fast data plan such as Tmobile's $30 prepaid plan. http://prepaid-phones.t-mobile.com/monthly-4g-plans

#3. Install and set up Google Voice app on your phone. Without GV, you can't open a free pbxes account in #4.

#4. Install Sipdroid to create a pbxes account.
When Sipdroid opens, it will detect whether you have GV app installed. If so, it will give you an option to open a free pbxes account linked with Google Voice. Create the pbxes account. In case Gmail flags for an attempted login, allow pbxes to gain access. Once you create the pbxes account, make test calls in and out using Sipdroid. Some ISPs may block you from using VoIP so make sure you can make calls before the next step. As of now, sipdroid doesn't support iLBC codec so we will be using other sip clients for making calls.

#5. Log in to pbxes.org and click "personal data".
Fill out all the blanks. Doesn't need to be correct. If you skip this step, pbxes has been known to remove the account later. While you are doing it, I recommend changing the pbxes login password that you used in step #4 to something else. In addition, pick a data center (server) closest to you to lower latency. If you have registration issues, change to a different server. FYI, I had registration issues with www7 (Miami) server.

#6. Open a free phone number (DID) account at callcentric.com.
You can only get a NY area code number but it doesn't matter because you will be giving out your GV number to your friends. All incoming calls to callcentric (including GV forwarded calls) will be free. You can decline E911 service to stay completely free. Callcentric supports efficient codecs such as G.729 and iLBC. We will be relying on iLBC. The outgoing calls are not free but we will be using GV to make free outbound calls.

Next, we have to link pbxes with callcentric so that pbxes can receive GV forwarded calls to callcentric. There are two ways to do this. (If you are wondering why we are using callcentric instead of gtalk, it's because pbxes has issues with iLBC for gtalk incoming calls. Callcentric handles iLBC better so we are piggybacking it.)

#7a. Callcentric call forwarding to pbxes.
Log in to callcentric.com. Go to preferences>DID forwarding. Input your name@pbxes.org in the box and save. AFAIK, callcentric doesn't charge call forwarding to a SIP address (our method). However, it does to a regular phone number.

Alternatively,

#7b. Have pbxes intercept the calls to callcentric.
Log in to pbxes.org. Click add trunk, select SIP trunk and input callcentric credentials. (user name starts with your callcentric 1777 number.) Select "audio bypass" to pass-through callcentric's iLBC signal to the phone. See the attachment for what my setup looks like.

Here's a tutorial on adding trunks: http://www4.pbxes.com/wiki/index.php/Getting_Started

#8. Add extension(s) in pbxes.
Log in pbxes.org. Click extensions. If you followed step #4, you should see extension "Sipdroid-200." You can add new ones or modify extension 200. Change the password to something that you can easily remember. This will be the password you will use to register your phone to pbxes in the next step. Finally, select "audio bypass."

#9. Install nightly version csipsimple app from http://nightlies.csipsimple.com/trunk/. The play store version crashed with iLBC.
First, add the pbxes account. If you are new to VoIP, use the wizard for pbxes. User name should be yourgoogleID-200, where 200 is the extension you used in #8. The password is what you changed to in #8. (I recommended you change the password in #8 so that you don't use your gmail password everywhere.)
Do not add callcentric account because having 2 registrations drains battery faster. If you followed the steps above, you will still be able to receive callcentric calls from your pbxes account.
I prefer csipsimple because it is has lots of options to configure. But it can be too overwhelming to some people. If you can't get it to work, then try other sip clients such as media5-fone.

#10. Let's change csipsimple for better call quality.
First, in settings/media/codecs, select iLBC as the only codec for 3g connection. If you have a strong wifi connection, then select PCMU for wifi connection.
(optional) If you experience looping when making calls, set up filters appropriately. I set up mine such that all calls will be made by pbxes except for 911.

#11. Google Voice (from webpage)
Add callcentric DID number (not the 1777 number). All the GV forwarded calls to callcentric will be forwarded to pbxes and ring csipsimple on your phone.
Uncheck Google chat so that pbxes only receives callcentric forwarded calls. FYI, GV doesn't support iLBC codec natively.
(optional) uncheck Tmo mobile number, if you are completely satisfied with this setup. If GV is forwarding to your cell, then your cell will be ringing twice and you may accidentally answer the cell phone using your minutes.

#12. (optional) Test in/out calls.
I use these numbers to test the audio quality.
*43 (pbxes echo test)
(909) 390-0003 (PSTN echo test)
(408) 647-4636 (record/playback)
Note that during a call in csipsimple, you can click the settings button in the lower right corner to change the in/out volumes and enable/disable echo cancellation.

You should also test incoming call quality using Google Voice call back. This is where I had the most troubleshooting. My incoming call quality was awful until I found callcentric trick.

I have tested this setup in many different scenarios including in a car running at 45 mph and very happy with the results. Of course, YMMV depending on how good your 3g connection is.


VI. LIMITATIONS

What are the drawbacks?

1. latency (audio delay). iLBC codec makes CPU interpolate to make up for loss packets. This is why the call quality is better than other codecs over 3g. However, the disadvantage is it increases audio lag. I'm experiencing a 0.5s lag one way on 3g. This is not too bad considering a cell>GV>cell call has a similar latency (http://www.howardforums.com/showthread.php/1621673-Voice-Latency-Test-Results, couldn't find a more recent test result)

2. Once a caller calls your GV number, it takes 5-6 seconds for your phone to ring. This is a limitation of PSTN and GV forwarding not VOIP. On the other hand, if a caller calls my cell number directly, it rings in 4-5 seconds. So all the call routing through caller>Google Voice>callcentric>pbxes>phone will add 1 extra second for your phone to ring compared with caller>phone.

3. Pbxes with gtalk trunk will make your Google chat status show as "online and available" all the time. Your friends may think you are online when you are actually not. Another side effect is you won't be able to answer GV calls from PC gmail any more. I haven't found any workaround to fix this other than creating a new google voice account.

4. Nexus 4 VoIP issues. It has been reported that several hardware mic functions (echo/noise cancellation) are disabled for N4 VoIP. http://code.google.com/p/android/issues/detail?id=41626 OTOH, echo cancellation is enabled in Galaxy Nexus. You can mitigate the issue with adjusting the media settings in sip client. But if you are in a noisy area, the mic is going to pick up all the noise. Consider using the headset.

VII. TIPS/TRICKS

1. If your family/friends know how to internet call, then it's best to give out your SIP address; googleID@pbxes.org. Then the call will go out fast and the phone quality will be the best because you are not using PSTN at all. If both caller and recipient are using the same pbxes server, then pbxes is the only node between the two. For example, when my wife with the same setup calls me @pbxes, my phone rings in less than 2 seconds and the call quality is the best.

2. Create multiple extensions (300, 400, etc) in pbxes.
I have 3 devices registered to pbxes simultaneously: my cell phone, my tablet and the ATA for my home POTS phone. When I receive a GV call, all 3 devices ring simultaneously. And I can call any other extension independently by entering its 3 digit extension number.

3. Try other sip clients
I suggested csipsimple because it's open source and free despite being an unstable nightly version. You should try out other apps because they may perform better for you. For example, when I use media5-fone (free w/ ads, $5 to remove ads), the audio latency improved but it consumed a little more battery.

4. Battery improvement
My Nexus 4 easily lasts 16 hours w/ 3+ hour screen time. There are several things you can do to improve battery life. Use TCP only in client to communicate with pbxes.org. If you use csipsimple, you need to change the account settings. First, use the wizard to switch to expert mode. Then you will see "transport" option in the account settings. Select TCP. Another thing you can do to improve battery life is to experiment with larger keep alive intervals.

5. Use a different gmail account for your GV number
If you are uncomfortable with giving out your gmail password (even the app specific one) to pbxes, then transfer your GV number to another gmail account. http://support.google.com/voice/bin/static.py?hl=en&ts=1378507&page=ts.cs The whole process took less than 30 minutes. Once done, you don't need to create a new pbxes account. Just log in pbxes.org, go to Trunk>Gtalk and make the necessary changes. If done properly, you can make calls out again instantly. If you are using GV app, then you need to add the new account.

6. Delayed GV call forwarding
You can set up pbxes such that it rings your cell phone if you don't answer the internet call in X seconds. See
http://xdaforums.com/showpost.php?p=36041116&postcount=196


VIII. Troubleshooting

1. This guide is definitely not simple. Lots of things can go wrong. If you want help, then provide as much information as possible. Posting a screenshot of pbxes call monitor log will be a good start.
2. If csipsimple doesn't work, try other sip clients such as media5-fone. If you can't make a call with media5 either, then you know at least it's not csip's fault.
3. If you suspect pbxes malfunctioning, change the datacenter (server) from pbxes.org.
 

Attachments

  • 3-b.jpg
    3-b.jpg
    36.2 KB · Views: 8,256
Last edited:

post-mortem

Senior Member
Oct 4, 2012
2,156
775
Since you've done so much testing, maybe you could include some more information on how your setup works. Like, how many seconds does it ring? How about voicemail? Any issues if you enter/leave your home (i.e., wifi area) during a call, etc.
 

plee3

Senior Member
Dec 8, 2011
66
31
Samsung Galaxy Watch 4
I would like to test this setup. Can you give more details and examples for steps 3-b and 3-c in creating the trunk and inbound routing on pbxes.org?

Thanks again for any help that you can provide!

plee3
 

marty331

Senior Member
Jun 29, 2011
829
249
Dallas, TX
I'm very untested in this as well. Why not just port my number to the $30/mn plan. Then use gv from my PC to make calls or from groveip on my N4?

Sent from my Nexus 7 using xda premium
 

acegolfer

Senior Member
Jun 2, 2008
776
221
I would like to test this setup. Can you give more details and examples for steps 3-b and 3-c in creating the trunk and inbound routing on pbxes.org?

Thanks again for any help that you can provide!

plee3

If you have never changed settings in pbxes, then this guide may be helpful.

http://lucas719.info/function/free_phone

If I get a chance in the future, I might update the OP with more instructions for those who have never used pbxes before.

I'm very untested in this as well. Why not just port my number to the $30/mn plan. Then use gv from my PC to make calls or from groveip on my N4?

Sent from my Nexus 7 using xda premium

Because grooveIP uses PCMU and PCMA codecs, which won't work reliably on 3g mobile data. The biggest advantage of my setup is iLBC codec, arguably the best codecs for 3g mobile connection. Another great codec for 3g is G729 but I haven't found an integrated way to use G729 for free.

How about audio delay? Mine is noticeable using Google voice and the carrier.


Sent from my Nexus 4 using Tapatalk 2

Latency, or delay, is inherent to all VOIP calls. To mitigate the delay, pick a server closest to you in settings from pbxes website.

Since you've done so much testing, maybe you could include some more information on how your setup works. Like, how many seconds does it ring? How about voicemail? Any issues if you enter/leave your home (i.e., wifi area) during a call, etc.

GV calls forwarded to pbxes ring about 17 seconds. This is well documented in another XDA thread.
I rely solely on GV voicemail.
When you leave wifi, you lose registration to SIP server.
 

acegolfer

Senior Member
Jun 2, 2008
776
221
I passed 2 tests today.

1. I can have a pretty good conversation while driving at 45 mph. I haven't had a chance to test on highways yet.
2. My wife is satisfied with the set up on her N4.

In addition, I found media5-fone app has less latency than csipsimple. However, you have to pay to remove the ads and it consumes more battery even w/ TCP connection.
 
  • Like
Reactions: pcorlatan and plee3

plee3

Senior Member
Dec 8, 2011
66
31
Samsung Galaxy Watch 4
I passed 2 tests today.

1. I can have a pretty good conversation while driving at 45 mph. I haven't had a chance to test on highways yet.
2. My wife is satisfied with the set up on her N4.

In addition, I found media5-fone app has less latency than csipsimple. However, you have to pay to remove the ads and it consumes more battery even w/ TCP connection.

Good news. Have you tried Bluetooth with media5-fone? I am having some issues using Bluetooth with csipsimple and am looking for another SIP client other than sipdroid.

Thanks... plee3
 

acegolfer

Senior Member
Jun 2, 2008
776
221
Good news. Have you tried Bluetooth with media5-fone? I am having some issues using Bluetooth with csipsimple and am looking for another SIP client other than sipdroid.

Thanks... plee3

I have not tried Bluetooth with N4. In fact, I don't know where my BT headsets are.

FYI, media5 is a free app with ads. It costs $5 to remove ads.
 

quarksurfer

Member
Sep 4, 2012
36
1
www.sugarlab3D.com
I would like to test this setup. Can you give more details and examples for steps 3-b and 3-c in creating the trunk and inbound routing on pbxes.org? plee3
Seconded!
Thanks for sharing all these details, if I knew more about the pbxes setup, I might give this a shot. Any chance you'd share screenshots of your pbxes setup? I've tried modifying mine before, but never successfully.
 

acegolfer

Senior Member
Jun 2, 2008
776
221
Seconded!
Thanks for sharing all these details, if I knew more about the pbxes setup, I might give this a shot. Any chance you'd share screenshots of your pbxes setup? I've tried modifying mine before, but never successfully.

3-b. Add a trunk using callcentric SIP credentials in pbxes. Log in to pbxes.org, click add trunk, select SIP trunk and input callcentric credentials. (user name starts with 1777 number.)

http://www4.pbxes.com/wiki/index.php/Getting_Started

3-c. Add an inbound route for callcentric trunk. This will pull any calls to callcentric and route them to N4. (OTOH, if you try to push the call from callcentric end, it will not be free.)

3-d. Select "audio bypass" in both callcentric trunk and extensions. pbxes will pass-through the calls from callcentric to N4 so that you can use iLBC codec. (pbxes claims to support iLBC but when I answer gtalk calls, there's no sound. That's why we need callcentric for incoming calls.)

This is what my pbxes looks like for 3-b and 3-c.
 

Attachments

  • 3-b.jpg
    3-b.jpg
    36.2 KB · Views: 1,068
  • 3-c.jpg
    3-c.jpg
    26.2 KB · Views: 1,044

ogrillion

Senior Member
Jun 8, 2008
588
123
Just wanted to say I followed your guide and it appears to be working great.

Only issue I had was pbxe was sending calls to Google voice and call centric and my T-Mobile number. So I had a bunch of voice mails lol.

Think its all figured out now though. Incoming I have just call centric and out going to Google talk.

*edit

Just had a question, sure I am just being paranoid. But how secure is this setup? Like on the phone giving my social etc can someone listen in?

Also I am getting voice mail notificaion all of a sudden. Can't clear it and Google voice / tmobile show no new mail. Any idea?

Sent from my Nexus 4 using xda app-developers app
 
Last edited:

acegolfer

Senior Member
Jun 2, 2008
776
221
Thanks for the info, but the free version does not support Bluetooth (you need to upgrade to the paid version to enable Bluetooth).

Thanks again... plee3

Ic. I didn't pay $5 to get the full media5 version. The little latency in csipsimple didn't bother me in real life settings.
 

acegolfer

Senior Member
Jun 2, 2008
776
221
How about vonage? free calls to numbers in the US

I heard good things about vonage app so I tested vonage on 3g a few days ago. The call quality of vonage was similar to my setup but it had more latency. I believe vonage is using either G729 or iLBC codec but the server is farther than my pbxes server. YMMV.

However, I found a bigger problem with vonage. I couldn't get it integrated with android. This means you need to open the vonage app and type in the 10 digit phone number to make a call. This won't work well when I'm on the fly, which is when I need vonage the most.

Just wanted to say I followed your guide and it appears to be working great.

Only issue I had was pbxe was sending calls to Google voice and call centric and my T-Mobile number. So I had a bunch of voice mails lol.

Think its all figured out now though. Incoming I have just call centric and out going to Google talk.

*edit

Just had a question, sure I am just being paranoid. But how secure is this setup? Like on the phone giving my social etc can someone listen in?

Also I am getting voice mail notificaion all of a sudden. Can't clear it and Google voice / tmobile show no new mail. Any idea?

Sent from my Nexus 4 using xda app-developers app

Not too sure about VOIP security. I'm relying on 3 services: GV/callcentric/pbxes so there could be a loose end. For example, I heard that Google "hears" everything. But any wireless company does the same.

I'm guessing you have a voice mail in pbxes because you said it's not GV or Tmo. To clear it, call pbxes voice mail by dialing *97.

In addition, I found csipsimple has a wrong voice mail input for pbxes. Here's how to change it, if you want to long press "1" to access pbxes voice mail or want to change it to GV voicemail number.

http://code.google.com/p/csipsimple/wiki/FAQ
 

acegolfer

Senior Member
Jun 2, 2008
776
221
In OP, I recommended pulling rather than pushing to avoid callcentric call forwarding charges. But I may have been wrong about it.

http://www.callcentric.com/features/unlimited_sip_uri_calling

If call forward to SIP URI is free, then callcentric can push the GV calls instead of pbxes pulling GV calls.

1. log in to callcentric.com
2. go to preferences>DID forwarding
3. locate the number that you added to Google Voice. click edit.
4. enter your pbxes SIP URI such as "googleid@pbxes.org" and save.

I have made several test calls but don't see callcentric (which doesn't have my CC infor) is billing anything.

Why pushing (compared with pulling)?

1. It's faster. Once the phone call is placed, It takes 1 second less for your phone to ring. In my testing, the total time is now about 5 seconds, which is still slow because GV relies on PSTN. OTOH, if a phone call is made directly to @pbxes.org SIP, then it takes 2 seconds to ring. I have convinced my wife to call me using SIP URI.

2. It's more reliable. Pulling requires pbxes to register callcentric and intercept the calls.

3. It's simpler. You can skip steps 3-b and 3-c, which seem to be the confusing part.
 

ogrillion

Senior Member
Jun 8, 2008
588
123
I can't imagine they could bill you even if they wanted too without any kind of credit card info. I didn't even put a real name or address so I don't know.. lol.. But it does let me put in any number I want to forward too, I didn't actually try calling though because I am afraid of a bill. I imagine it would say something like this call can't be completed please add credit or whatever.

Its funny I followed your guide, doing all this reading.. for no real reason since i get like 3 calls a month.. Fun learning experience anyway.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 62
    UPDATE: This may not work any more because Google said that they will cut off the Google Talk XMPP on 5/15/2014, which PBXES relies on.


    This guide is not about how to make free calls. It's about how to make free calls using iLBC codec so that you can make reliable calls over 3g connection. If you only want the instructions, then skip to part V.

    (edited) I have changed my VoIP set up to PIAF on AWS EC2. See my signature.

    I. BACKGROUND

    There are several known methods to make free VoIP (internet) calls over 3g. I'll briefly discuss each to explain why there's no perfect solution. I'm not claiming my solution is perfect, either. You have to try them out and find out yourself what works for you.

    1. Groove IP app

    codec: PCMU (aka G711u, uncompressed signal used by PSTN and Google Voice, only good for fast/reliable wifi connection)
    pros: simple setup, works well on wifi. If you use VoIP only on wifi, this is for you.
    cons: echo. The voice quality is terrible on mobile data (3g) connection.

    2. talkatone app

    codec: speex for standard quality
    pros: easy setup, good quality on 3g using speex .
    cons: doesn't integrate well with android

    3. Vonage mobile app

    codec: G729(?) when making regular calls. iSAC when calling a Vonage member.
    pros: G729 provides an excellent quality even on 3g.
    cons: can't receive calls and doesn't integrate with Android. You need to input 10 digit number to make a call, unless the number is in your contacts.

    4. Google Voice/pbxes/sipdroid (http://xdaforums.com/showthread.php?t=1791957)

    codec: lots of options based on connection type
    pros: excellent battery life (http://code.google.com/p/sipdroid/wiki/NewStandbyTechnique), If you choose speex codec for 3g, then call quality is pretty good on 3g.
    cons: must unlock the screen before answering the call. doesn't support better codecs such as iLBC/G729.

    5. simonics GV gateway https://simonics.com/gvgw/ + sip client of your choice

    codec: PCMU
    pros: simpler setup than pbxes, some ppl claim it's more reliable.
    cons: limited codec support. no multiple registrations

    6. Setting up your own asterisk server (http://enjoytechnology.info/)

    pros: everything is configurable
    cons: requires a 24/7 running server

    I have been primarily using #4 setup but wasn't satisfied with the call quality on 3g so I was about to do #6. But I found a way to tweak #4 to use iLBC codec and greatly improved the call quality on 3g.


    II. CODEC COMPARISONS

    The call quality basically depends on (1) the codec that your phone uses and (2) the network throughput. Unfortunately, there's no perfect solution because of trade-offs.

    PCMU (64kbps) is the uncompressed signal that is transmitted at PSTN. So it will give you the best quality as long as your network throughput supports it. This is the preferred codec for wifi connection. However, 3g network cannot consistently sustain 64kbps and will suffer from packet loss resulting in jitter. This explains why Groove IP works best on wifi but not over 3g.

    At the other end of the spectrum is GSM codec (8kbps). It's designed in 1990 for wireless communication over 2g. It's the most compressed signal, which is used by your regular GSM providers (AT&T, Tmo). These wireless providers allocate sufficient capacity on voice calls so your voice calls will suffer little jitter. However, the call quality is inferior to PCMU codec.

    There are many codecs in between. For example, Sipdroid and talktatone can use speex, which requires low bandwidth. These apps can send the same signal twice to compensate for packet loss.

    The 2 codecs that haven't been used widely in commercial apps are G729 and iLBC. These 2 codecs require low bandwidth (<15kbps) but have algorithm to interpolate loss packets. It is suggested these 2 codecs are ideal codec for 3g connection. Here are some readings comparing G729 vs iLBC.

    http://blogs.elastix.org/en/2009/11/...cs-in-elastix/
    http://forums.whirlpool.net.au/archive/1413041

    In short, both are excellent codecs for 3g. iLBC has a better quality but requires more CPU power, which Nexus 4 can easily handle. My setup relies on iLBC.


    III. SETUP

    My setup is an extension to #4 method above. It involves 4 free resources.

    1. Google Voice (same phone number for in/out calls and free outbound calls using gtalk)
    2. callcentric (VoIP provider for free inbound calls)
    3. pbxes (PBX that manages in/out calls)
    4. csipsimple (android VOIP app that supports iLBC)


    Once set up properly, here's how the incoming and outgoing calls will work.

    1. Incoming GV calls
    Someone calls your GV number. GV forwards the call to callcentric. Pbxes intercepts the call and rings your phone. Your phone displays caller ID (CID) properly.

    2. Outgoing GV calls
    You place a call in your phone dialer. Pbxes calls the number using gtalk trunk. The recipient will see your GV number as CID.


    IV. BENEFITS

    What are the benefits of my setup?

    1. Completely free in/out calls. You don't even give out any CC information. All I'm paying is 30/m for Tmobile's 100 min, unlimited data prepaid plan.
    2. Excellent call quality even on 3g using iLBC codec. I often get better call quality than Tmo's GSM.
    3. Keeping the same number for in/out calls.
    4. Full Android integration.
    5. Battery life. Only requires 1 SIP registration to pbxes using TCP port. Battery stat screenshots after 10 hours are attached here: http://xdaforums.com/showpost.php?p=35889479&postcount=91


    V. INSTRUCTIONS

    Are you still with me? Then follow these steps.

    #1. Get a fast phone that can handle iLBC codec. FYI, a 2-yr old Galaxy S has the sufficient CPU power for iLBC.

    #2. Get an unlimited fast data plan such as Tmobile's $30 prepaid plan. http://prepaid-phones.t-mobile.com/monthly-4g-plans

    #3. Install and set up Google Voice app on your phone. Without GV, you can't open a free pbxes account in #4.

    #4. Install Sipdroid to create a pbxes account.
    When Sipdroid opens, it will detect whether you have GV app installed. If so, it will give you an option to open a free pbxes account linked with Google Voice. Create the pbxes account. In case Gmail flags for an attempted login, allow pbxes to gain access. Once you create the pbxes account, make test calls in and out using Sipdroid. Some ISPs may block you from using VoIP so make sure you can make calls before the next step. As of now, sipdroid doesn't support iLBC codec so we will be using other sip clients for making calls.

    #5. Log in to pbxes.org and click "personal data".
    Fill out all the blanks. Doesn't need to be correct. If you skip this step, pbxes has been known to remove the account later. While you are doing it, I recommend changing the pbxes login password that you used in step #4 to something else. In addition, pick a data center (server) closest to you to lower latency. If you have registration issues, change to a different server. FYI, I had registration issues with www7 (Miami) server.

    #6. Open a free phone number (DID) account at callcentric.com.
    You can only get a NY area code number but it doesn't matter because you will be giving out your GV number to your friends. All incoming calls to callcentric (including GV forwarded calls) will be free. You can decline E911 service to stay completely free. Callcentric supports efficient codecs such as G.729 and iLBC. We will be relying on iLBC. The outgoing calls are not free but we will be using GV to make free outbound calls.

    Next, we have to link pbxes with callcentric so that pbxes can receive GV forwarded calls to callcentric. There are two ways to do this. (If you are wondering why we are using callcentric instead of gtalk, it's because pbxes has issues with iLBC for gtalk incoming calls. Callcentric handles iLBC better so we are piggybacking it.)

    #7a. Callcentric call forwarding to pbxes.
    Log in to callcentric.com. Go to preferences>DID forwarding. Input your name@pbxes.org in the box and save. AFAIK, callcentric doesn't charge call forwarding to a SIP address (our method). However, it does to a regular phone number.

    Alternatively,

    #7b. Have pbxes intercept the calls to callcentric.
    Log in to pbxes.org. Click add trunk, select SIP trunk and input callcentric credentials. (user name starts with your callcentric 1777 number.) Select "audio bypass" to pass-through callcentric's iLBC signal to the phone. See the attachment for what my setup looks like.

    Here's a tutorial on adding trunks: http://www4.pbxes.com/wiki/index.php/Getting_Started

    #8. Add extension(s) in pbxes.
    Log in pbxes.org. Click extensions. If you followed step #4, you should see extension "Sipdroid-200." You can add new ones or modify extension 200. Change the password to something that you can easily remember. This will be the password you will use to register your phone to pbxes in the next step. Finally, select "audio bypass."

    #9. Install nightly version csipsimple app from http://nightlies.csipsimple.com/trunk/. The play store version crashed with iLBC.
    First, add the pbxes account. If you are new to VoIP, use the wizard for pbxes. User name should be yourgoogleID-200, where 200 is the extension you used in #8. The password is what you changed to in #8. (I recommended you change the password in #8 so that you don't use your gmail password everywhere.)
    Do not add callcentric account because having 2 registrations drains battery faster. If you followed the steps above, you will still be able to receive callcentric calls from your pbxes account.
    I prefer csipsimple because it is has lots of options to configure. But it can be too overwhelming to some people. If you can't get it to work, then try other sip clients such as media5-fone.

    #10. Let's change csipsimple for better call quality.
    First, in settings/media/codecs, select iLBC as the only codec for 3g connection. If you have a strong wifi connection, then select PCMU for wifi connection.
    (optional) If you experience looping when making calls, set up filters appropriately. I set up mine such that all calls will be made by pbxes except for 911.

    #11. Google Voice (from webpage)
    Add callcentric DID number (not the 1777 number). All the GV forwarded calls to callcentric will be forwarded to pbxes and ring csipsimple on your phone.
    Uncheck Google chat so that pbxes only receives callcentric forwarded calls. FYI, GV doesn't support iLBC codec natively.
    (optional) uncheck Tmo mobile number, if you are completely satisfied with this setup. If GV is forwarding to your cell, then your cell will be ringing twice and you may accidentally answer the cell phone using your minutes.

    #12. (optional) Test in/out calls.
    I use these numbers to test the audio quality.
    *43 (pbxes echo test)
    (909) 390-0003 (PSTN echo test)
    (408) 647-4636 (record/playback)
    Note that during a call in csipsimple, you can click the settings button in the lower right corner to change the in/out volumes and enable/disable echo cancellation.

    You should also test incoming call quality using Google Voice call back. This is where I had the most troubleshooting. My incoming call quality was awful until I found callcentric trick.

    I have tested this setup in many different scenarios including in a car running at 45 mph and very happy with the results. Of course, YMMV depending on how good your 3g connection is.


    VI. LIMITATIONS

    What are the drawbacks?

    1. latency (audio delay). iLBC codec makes CPU interpolate to make up for loss packets. This is why the call quality is better than other codecs over 3g. However, the disadvantage is it increases audio lag. I'm experiencing a 0.5s lag one way on 3g. This is not too bad considering a cell>GV>cell call has a similar latency (http://www.howardforums.com/showthread.php/1621673-Voice-Latency-Test-Results, couldn't find a more recent test result)

    2. Once a caller calls your GV number, it takes 5-6 seconds for your phone to ring. This is a limitation of PSTN and GV forwarding not VOIP. On the other hand, if a caller calls my cell number directly, it rings in 4-5 seconds. So all the call routing through caller>Google Voice>callcentric>pbxes>phone will add 1 extra second for your phone to ring compared with caller>phone.

    3. Pbxes with gtalk trunk will make your Google chat status show as "online and available" all the time. Your friends may think you are online when you are actually not. Another side effect is you won't be able to answer GV calls from PC gmail any more. I haven't found any workaround to fix this other than creating a new google voice account.

    4. Nexus 4 VoIP issues. It has been reported that several hardware mic functions (echo/noise cancellation) are disabled for N4 VoIP. http://code.google.com/p/android/issues/detail?id=41626 OTOH, echo cancellation is enabled in Galaxy Nexus. You can mitigate the issue with adjusting the media settings in sip client. But if you are in a noisy area, the mic is going to pick up all the noise. Consider using the headset.

    VII. TIPS/TRICKS

    1. If your family/friends know how to internet call, then it's best to give out your SIP address; googleID@pbxes.org. Then the call will go out fast and the phone quality will be the best because you are not using PSTN at all. If both caller and recipient are using the same pbxes server, then pbxes is the only node between the two. For example, when my wife with the same setup calls me @pbxes, my phone rings in less than 2 seconds and the call quality is the best.

    2. Create multiple extensions (300, 400, etc) in pbxes.
    I have 3 devices registered to pbxes simultaneously: my cell phone, my tablet and the ATA for my home POTS phone. When I receive a GV call, all 3 devices ring simultaneously. And I can call any other extension independently by entering its 3 digit extension number.

    3. Try other sip clients
    I suggested csipsimple because it's open source and free despite being an unstable nightly version. You should try out other apps because they may perform better for you. For example, when I use media5-fone (free w/ ads, $5 to remove ads), the audio latency improved but it consumed a little more battery.

    4. Battery improvement
    My Nexus 4 easily lasts 16 hours w/ 3+ hour screen time. There are several things you can do to improve battery life. Use TCP only in client to communicate with pbxes.org. If you use csipsimple, you need to change the account settings. First, use the wizard to switch to expert mode. Then you will see "transport" option in the account settings. Select TCP. Another thing you can do to improve battery life is to experiment with larger keep alive intervals.

    5. Use a different gmail account for your GV number
    If you are uncomfortable with giving out your gmail password (even the app specific one) to pbxes, then transfer your GV number to another gmail account. http://support.google.com/voice/bin/static.py?hl=en&ts=1378507&page=ts.cs The whole process took less than 30 minutes. Once done, you don't need to create a new pbxes account. Just log in pbxes.org, go to Trunk>Gtalk and make the necessary changes. If done properly, you can make calls out again instantly. If you are using GV app, then you need to add the new account.

    6. Delayed GV call forwarding
    You can set up pbxes such that it rings your cell phone if you don't answer the internet call in X seconds. See
    http://xdaforums.com/showpost.php?p=36041116&postcount=196


    VIII. Troubleshooting

    1. This guide is definitely not simple. Lots of things can go wrong. If you want help, then provide as much information as possible. Posting a screenshot of pbxes call monitor log will be a good start.
    2. If csipsimple doesn't work, try other sip clients such as media5-fone. If you can't make a call with media5 either, then you know at least it's not csip's fault.
    3. If you suspect pbxes malfunctioning, change the datacenter (server) from pbxes.org.
    5
    Anyone know if this:

    http://www.androidpolice.com/2013/1...ng-down-all-3rd-party-voice-apps-in-may-2014/

    Breaks this setup? Does PBXes.org interface with gvoice via XMPP or a hangouts sessions?

    Even though I'm the OP of this thread, I hope 5/14/2014 comes fast because we will be able to use Hangouts app to make and receive GV calls without relying on 3rd party service.
    5
    In OP, I recommended pulling rather than pushing to avoid callcentric call forwarding charges. But I may have been wrong about it.

    http://www.callcentric.com/features/unlimited_sip_uri_calling

    If call forward to SIP URI is free, then callcentric can push the GV calls instead of pbxes pulling GV calls.

    1. log in to callcentric.com
    2. go to preferences>DID forwarding
    3. locate the number that you added to Google Voice. click edit.
    4. enter your pbxes SIP URI such as "googleid@pbxes.org" and save.

    I have made several test calls but don't see callcentric (which doesn't have my CC infor) is billing anything.

    Why pushing (compared with pulling)?

    1. It's faster. Once the phone call is placed, It takes 1 second less for your phone to ring. In my testing, the total time is now about 5 seconds, which is still slow because GV relies on PSTN. OTOH, if a phone call is made directly to @pbxes.org SIP, then it takes 2 seconds to ring. I have convinced my wife to call me using SIP URI.

    2. It's more reliable. Pulling requires pbxes to register callcentric and intercept the calls.

    3. It's simpler. You can skip steps 3-b and 3-c, which seem to be the confusing part.
    4
    As discussed in the last few posts, I think it's mostly because the TCP KA interval is set to 10 times the UDP KA interval

    I don't think so. On the latest CSipSimple nightly the default keep alive, or 'qualify', for UDP transport over mobile data is set to 40. I have adjusted mine to 60 seconds. The default keep alive for TCP transport over mobile data, from what I'm seeing, is set to 120. I don't think it's 10 times more, and I don't think using UDP over TCP translates into over 10 times better battery life, from real world use.

    To be honest, I'm connected remotely via CSipSimple 24/7, and when I'm on mobile data, for a majority of the day, CSipSimple may use 2% of battery life, and I can still receive all of my calls. Most of the time CSipSimple isn't listed under battery stats, and that's when I'm at work with WiFi enabled. I still receive anywhere from 4-5 hours of screen time on Franco kernel, and I always have an extension connected remotely.

    Honestly, all of the other VoIP clients I've used, except for Media5 phone, have been pretty bad. Especially when you compare them to CSipSimple. A properly configured CSipSimple client works very well. Pretty close to my expensive hardware VoIP phones. You need to play with the mic gain, and earpiece volume. I cannot stress this enough. There are some Cisco ATA devices at work, and I always need to adjust the mic gain, and earpiece volume to kill the echo (FXS input and output gain is the actual setting). Once they're adjusted correctly, they sound exactly how they should.

    Also, here is my guide for installing PBX in a flash. I recommend that you install PIAF Purple.
    4
    MacroDroid https://play.google.com/store/apps/details?id=com.arlosoft.macrodroid
    Very intuitive interface. Works fast and smooth.
    Free version has limits on actions/constraints.

    Here's two basic macros:

    1. Airplane Mode On
    Trigger - Wifi Connect (home AP)
    Action - Airplane Mode On (Keep Wifi On) <-- nice touch!
    Constraints - Not in Call

    2. Airplane Mode Off
    Trigger - Wifi Disconnect (home AP)
    Action - Airplane Mode Off
    Constraints - None


    I prefer determining location by using cell towers, which MacroDroid doesn't support. So I've re-installed Y5 Battery Saver to handle toggling wifi on/off. I'm sure there are better programs, but Y5 is lightweight and a known good for me. Leave the cell radio on for a while and walk around your home so Y5 can learn all the cell radios.