Android OS Forum banner
1 - 8 of 8 Posts

·
Registered
Joined
·
24 Posts
Discussion Starter · #1 ·
Let me preface this post with the obligatory "I Google'd the $#@! out of this before posting" disclaimer, haha.

I use Google Voice and PBXes.org to make nearly all of my calls from my Galaxy Nexus. I did use SIPdroid to set this up initially, but I hated its interface so much that I eventually set up PBXes to connect with the native Android Dialer using its SIP function.

This works well for the most part, and it allows you to change settings such as the use of TCP or UDP, the port, server, etc. However, it does not let you select the audio codec to be used when making these calls. I believe it uses the G711x (or something like it) codec by default, which is fairly data-intensive compared to the GSM, PCM, and speex codecs.

The SIPdroid app lets you select which codec to use when making calls, but the Android native dialer does not. I build from source every week or so, and noticed a few weeks ago on Gerrit that this was merged: http://gerrit.sudoservers.com/#/c/2747/ . The code refers to different PCM codecs, including an 8-bit one that I think would be less bandwidth-hungry. To my untrained eyes it looks like this commit added these codecs to the native VOIP/SIP client.

Is there any way to make the native SIP dialer use one of these faster/lighter codecs? I want to avoid using SIPdroid, CSIPsimple, or any other non-native solution if possible, but I also want calls to be fairly reliable on my 3G connection. If anyone knows of a way to edit these files to force the use of a certain codec by the native dialer please let me know.

James
 

·
Registered
Joined
·
4 Posts
I'd also like to know how to do this, and I'm shocked that the speex codec is not supported by the native dialer. g711.u (Ulaw) is the default codec, and is simply not usable while driving. GSM works well over 3g/4g on my GSM Galaxy Nexus over T-Mobile, but it sounds like you're talking through a tin can. g711.u is great over WiFI, but WiFI is not always available. Using the integrated SIP phone is much better than using CSipSimple and sipDroid. When CSipSimple works, it's great. Speex sounds great over 3g, but CSipSimple is very tempermental.
 

·
Premium Member
Joined
·
1,812 Posts
G.729 is the more common light weight protocol. But it is patent encumbered and typically requires some type of license for an app to use it. Thus, it's not common to see G.729 in an open source/free app.

I do a lot of VoIP with my business stuff, but I've only briefly messed with VoIP and Android. I know you want to use the built-in dialer, but if you can get one that supports G.729, I think it would be worth it.

Of course, you would also have to deal with the G.729 license issue on your PBXes.org system as well. Digium sells G.729 licenses for Asterisk at $10.00 per channel. I'm not sure what type of access you have on the pbxes.org account (you would need to be able to load the driver and license file from the command line.

Also, if you search a little bit, there are some 'free for testing purposes' pre-compiled g.729 drivers out there.

EDIT: G.729 and asterisk may not need an actual license, depending on what you are doing. If Asterisk is just bridging the channel, and passing the data through unchanged, then you can do that without a license. If asterisk has to do any transcoding or generation, then it would need the license (ie, voice-mail). So if you are just picking up calls and forwarding them to the phone, with no voice-mail, IVR, etc, you might be able to avoid a g.729 license on the asterisk server.
 

·
Registered
Joined
·
24 Posts
Discussion Starter · #4 ·
Thanks for the reply and advice, I'm actually running a Google Voice account through PBXes.org or I would try to roll my own server. Something that has actually helped the stock dialer to become more bearable is switching to UDP rather than TCP -- I guess UDP deals better with packet loss, so a semi-shoddy connection doesn't completely shut down a VOIP stream (whereas the same connection using TCP would get screwed over by any packet loss). Thanks again!
 

·
Registered
Joined
·
4 Posts
Thanks for the reply and advice, I'm actually running a Google Voice account through PBXes.org or I would try to roll my own server. Something that has actually helped the stock dialer to become more bearable is switching to UDP rather than TCP -- I guess UDP deals better with packet loss, so a semi-shoddy connection doesn't completely shut down a VOIP stream (whereas the same connection using TCP would get screwed over by any packet loss). Thanks again!
Sorry for bringing up such an old topic, but I figured I would help you out. I have made a lot of progress since my original post. With the right settings, CSipSimple is awesome, and actually sounds better than some hardware VoIP phones. If you decide to roll your own Asterisk server, I suggest you try using TCP transport for SIP signaling, the G729 codec for mobile data, and the G722 codec for WiFi. There is a huge difference between in battery consumption by using TCP over UDP, especially over WiFi. There is a ton of information here, and it covers how you can set up an Asterisk server with Google Voice, TCP transport, and the G729 codec. I've been using this since the end of September, and it's great.
 

·
Registered
Joined
·
1 Posts
Sorry for bringing up such an old topic, but I figured I would help you out. I have made a lot of progress since my original post. With the right settings, CSipSimple is awesome, and actually sounds better than some hardware VoIP phones. If you decide to roll your own Asterisk server, I suggest you try using TCP transport for SIP signaling, the G729 codec for mobile data, and the G722 codec for WiFi. There is a huge difference between in battery consumption by using TCP over UDP, especially over WiFi. There is a ton of information here, and it covers how you can set up an Asterisk server with Google Voice, TCP transport, and the G729 codec. I've been using this since the end of September, and it's great.
Hi.
This is exactly what I was looking for, but it seems that the website in the link does not work. Do you have another link or can you help me with the configuration of SIP TCP and Google Voice to Asterisk?
 

·
Premium Member
Joined
·
1,812 Posts
Just to add a little clarity here. You may want to use TCP for signaling, but definitely not for the voice stream. TCP is a 'guaranteed' delivery protocol. It requires an acknowledgement from the receiver. Thus, you increase the overhead/bandwidth, and slow down the delivery. UDP is just sent by the sender without any regard to its arrival at the destination. It's your best option for any streaming media. The receiving end will simply drop packets/information (ie, a small drop in the conversation, a few missed frames on a video, etc) for any parts of the stream that don't arrive within the timing windows necessary.

UDP will suffer quality issues on a bad connection, but may still work. TCP will simply shutdown on a bad connection, and cost you bandwidth on top of it. Might also make an otherwise acceptable connection completely unusable.
 
1 - 8 of 8 Posts
Top