Sipdroid 1.3.x Primer [updated 2010-02-26]

Search This thread

jashsu

Senior Member
Nov 15, 2008
1,849
20
sipdlogo.png

Sipdroid 1.3.x Primer



Introduction

This document is a basic guide to getting Sipdroid 1.3.x set up on a typical Android phone in conjunction with Google Voice and Gizmo5/SIPPhone. As the Sipdroid software as well as GV/Gizmo5 are constantly in flux, at times this document may contain some factual errors due to obsoletion. I will try my best to not get lazy and keep it updated, but be forewarned.

The previous version of this primer was written for Sipdroid 0.9.4 and incrementally updated. After a few months without updates, it became terribly obsolete, and instead of going through it to make fixes, I decided to leave it as-is and write a new version with more of an emphasis on Gizmo5/SIPPhone (hereforth "Gizmo5") and Google Voice. Note that at the time of this writing, the Gizmo5 service has been acquired by Google and is not currently accepting new users. It is predicted that Google will relaunch Gizmo5 as a rebranded component in Google Voice, at which time it is likely this primer will become outdated. Until then, enjoy!



Overview of Sipdroid + Gizmo5 + GV

I'm assuming that most of you have an idea of what SIP is and what it can do but i'll do a brief overview so we are all on the same page before we get into the details and instructions. Those of you who just want the meat of the primer can skip to the next section.

SIP is a signalling protocol that allows two or more clients to signal to each other their intent to perform some sort of communication. Commonly the communication is voice over IP ("VOIP"). With the right client software, SIP can be used for initiating a video call, but in our primer we will only cover voice. There are just a few elements in a SIP system. There is client software (what you install on your device), SIP providers (the servers your client software connects to), and there may also be providers that reroute your call into other networks (e.g. into Skype or into the public switched telephony network).

In our primer, Sipdroid is the SIP client which you install on your phone and interact with. Gizmo5 is the SIP provider that Sipdroid will connect to. Gizmo5 will also act as a call-out service (allowing you to call to the public switched telephony network (hereforth "PSTN"). Google Voice is an additional service which will provide you with a DID, a direct inward dialing number. A DID is basically a phone number that someone on the PSTN can dial with a regular telephone that can then be routed to a VOIP call. With all these ingredients, you can therefore create a setup whereby you can: 1) Make and receive calls to other SIP clients for free from your Android phone and 2) Make low cost calls to any number in the world and receive calls for free from anywhere in the world from anyone who calls your US Google Voice number. So let's get started...



Setting Up Gizmo5 and Google Voice

The first thing you will need to do is set up Gizmo5 and Google Voice. Unfortunately, at the time of writing (2010-02-26) Gizmo5 is closed to new members and Google Voice is still invite-only. The only way to get a Gizmo5 account if you do not already have one is to find someone who already has one and convince him/her to let you have or use it. There are many ways to receive an invitation to Google Voice. The standard method would be to request an invitation from Google and wait. Alternately, current users of Google Voice may also have up to 3 invitations they can pass out. You may search some internet forums (such as xda) to find people offering GV invitations. Anecdotally, running the Google Voice app built into the Google Nexus One will also activate GV for you if it is not already activated on your Google account. If you cannot acquire a GV invitation/activation, you can still use Gizmo5 with other DID services like ipkall. If you cannot get a Gizmo5 account then you will have to find another SIP provider. In either case, simply skip the relevant steps in the primer.

Now then, your first order of business is at Gizmo5. Log into https://my.gizmo5.com/ and make a note of your SIP number. Also turn off the voicemail service. We want Google Voice to perform voicemail for us, so we have to make sure that Gizmo5's voicemail isn't going to kick in before Google Voice's voicemail.
sdp_gz.png
Next, open Google Voice. I'm going to assume that you have already set it up and created a Google Voice (DID) number. If you chose to use your own number when you initially set up Google Voice, go and choose a Google Voice number now. Remember that your first GV number is free; changing your GV number afterward will cost USD$10. Now then, click on "Settings" in the upper right corner, then click on the "Add another phone" link.
sdp_gv1.png
Enter a name for this phone (e.g. "Gizmo") and the number you copied down from the Gizmo5 page earlier. Choose "Gizmo" as the Phone Type. When you're done, click Save. Note that in order to verify the number is yours, Google Voice will call it and ask you to enter a two digit verification code. You can either perform this step by being logged into Gizmocall (Gizmo5's flash-based browser SIP client) or doing it on your phone after you have set up Sipdroid (further below).
sdp_gv2.png
You may also want to make a few changes to some other Google Voice settings as a matter of preference. Here are some useful ones. Voicemail forwarding will send your transcribed Google Voice voicemails to your gmail/email in realtime. SMS forwarding will do the same thing for Google Voice SMSes. Turning off Call Presentation will get your caller on the line with you directly instead of going through the GV call presentation menu. Since it already takes additional time for a SIP call to be connected, this can help you get your call connected before the other party hangs up. Displaying your Google Voice number as the origin for SMS will help your friends identify you by your GV number.
sdp_gv3.png


sdp_gv4.png
Setting Up Sipdroid

Now that Gizmo5 and GV are set up, you need to set up Sipdroid. On your Android phone's browser, visit http://code.google.com/p/sipdroid/ and tap the link under Featured downloads. When your download is complete, tap the download and select install. If your phone does not have Unknown source installation enabled, it will prompt you to enable this. (It is the Settings>Applications>Unknown Sources checkbox).
sdp_01.png
sdp_03.png
Open Sipdroid now. Sipdroid's main screen is not very descriptive at first glance. Press the menu button, then tap Settings. The settings menu is divided into six categories. We will move through them one by one.
sdp_05.png
sdp_06.png
Tap SIP Account Settings. Under Authorization Username enter your Gizmo5 username or SIP number. Under Password enter your Gizmo5 password. Under Server enter proxy01.sipphone.com. Finally change the Protocol to TCP. (Hint: If you encounter problems connecting with TCP you can use UDP, but it will cut your battery life significantly.)
sdp_07.png
Press the back button then tap Call Options. Check off the network types you wish Sipdroid to connect with. In my example I checked off WLAN, 3G and EDGE. Change the Preferred Call Type to Phone.
sdp_08.png
sdp_09.png
Press the back button then tap Advanced Options. Set the Earpiece Gain to High (Hint: The correct value for this setting may be a matter of personal preference and phone model. Higher settings may cause the other end to hear echo, so do some experimentation.) Check off Use STUN Server. Under STUN Server name enter stun01.sipphone.com. Note that if you experience trouble sending or receiving calls, you may want to try turning STUN off.
sdp_10.png
sdp_11.png
Press the back button then tap Audio Codecs. Tap alaw (64kbit) and select Never.
sdp_12.png
sdp_13.png
At this point your Sipdroid should be completely set up. You should have noticed by now that there is now a persistent colored dot indicator in your notification bar. It has three possible states: green to indicate that Sipdroid is connected and operational, yellow to indicate that it is in the process of connecting, and red to indicate that it is not connected and has encountered problems. If your indicator is stuck on yellow or red go back and review that all the settings have been properly set. If it is still unresolved, your 3G and/or wifi network may be blocking SIP traffic. Contact the appropriate network administrator for further assistance.

As long as Sipdroid is active when you shut down or reboot your phone, it will automatically startup and connect when the phone is booted. To turn off Sipdroid, simply press menu from the Sipdroid main screen and tap the Exit option. The colored dot indicator icon should disappear.



Make Test Calls

We will make three types of test calls. First, we will call another SIP device using its SIP address. A SIP address take the form of sip:user@domain or simply user@domain. To make a SIP call, enter the SIP address in the form of user@domain into the entry bar of the Sipdroid main screen and press the return key. For this test we will use echo@proxy01.sipphone.com, which is an automated number run by Gizmo5 for the purpose of testing SIP setups. When the call connects you should see a call indicator in the notification bar, colored emerald to differentiate it from a standard voice call.
sdp_14.png
sdp_15.png
sdp_16.png
After a brief message you will hear Gizmo5's echo test, which will echo back whatever you say. You can use this test to gauge the quality of your SIP connection as well as the latency. If you are connecting over 3G, the latency will be moderate, and the latency over EDGE will be even higher. When you are satisfied with the test, press the back button or drag the green border square down to end the call. Note that pressing the End call button will not end the call. Keep this in mind!

Next, we will make a call to the same service, but instead of using its SIP address, we will use its SIP number. Some SIP users may have both a SIP address and a SIP number, while others may have only one or the other. To call a SIP number, you will need to open your dialer. Press the green call button on your phone or start the Dialer app from the launcher. Enter 17474743246+ (to enter a plus sign, long press the 0 key). Tap the number to dial it. Again you should notice the emerald colored call indicator and hear the Gizmo5 echo test service. Hang up by pressing the back button or dragging the square down.
sdp_17.png
sdp_18.png
The + you entered at the end of the number indicates to Sipdroid that you want to make this call using SIP instead of using your standard cellular voice connection (which would use up minutes in accordance with your cellular plan terms). If you accidentally omit the + sign, the call will be attempted as a regular cellular call.

Finally, let's try making a call to a real PSTN phone number. Gizmo5 provides free outbound calling for toll free numbers in the United States (e.g. "1-800 numbers"). From the Android dialer, enter 18005558355+ and tap to call the number using SIP. You should hear Microsoft's Tell Me service, which provides a variety of useful information over the phone. When you are satisfied, hang up the call by pressing the back button or dragging the square down. Another useful automated 800 number is 18004664411+, which you may recognize as the GOOG411 directory service. In order to make a direct call to a non-toll-free number, you will have to deposit some credit into your Gizmo5 account (hint: There is a workaround for making free calls to US numbers which I will cover further down.)
 
Last edited:

jashsu

Senior Member
Nov 15, 2008
1,849
20
Calling Numbers in Your Contact List

Instead of manually entering the number into the dialer, you can call numbers in your contact list using SIP. Note that if the number is not a toll-free number you will need credit in your Gizmo5 account. In your contact list, tap the desired contact to bring up the details. For each phone number the contact has, you will have both a Call and a Text option. In order to perform the call with SIP, tap the Text option. A menu will pop up with three options (possibly more if you have third party SMS apps or the official GV app installed)-- Messaging, Phone Call, and Sipdroid. Select Sipdroid and Sipdroid should perform the call.

sdp_19.png
sdp_20.png



The Relationship Between Gizmo5, GV, and the PSTN

This section should help you understand the relationships between Gizmo5, GV, and the PSTN. Let's assume you have a friend who, like you, has a SIP setup using Sipdroid, Gizmo5 and GV. In your contact info for him/her, you have your friend's actual cellular number, GV number, and SIP number.

If you tap on your friend's cellular number...
...and choose the Phone Call option, the call will be connected on both ends using cellular voice. No one will be using SIP, and both people will have cellular minutes deducted.

...and choose the Sipdroid option, the call will be connected on your end using SIP to Gizmo5, which will then route it out to the PSTN and connect to your friend via cellular voice. Your friend will have cell minutes deducted, and you will have Gizmo5 credits deducted.
If you tap on your friend's Google Voice number...
...and choose the Phone Call option, the call will be connected on your end using cellular voice, which will route it over the PSTN to Google Voice, which forwards the call to your friend's Gizmo5 and then via SIP onto his/her phone. Your friend will receive the call for free, and you will have cellular minutes deducted.

...and choose the Sipdroid option, the call will be connected on your end using SIP to Gizmo5, which will then route it out via PSTN to GV, which will then route it using SIP to your friend's Gizmo5. Your friend will receive the call for free, and you will have Gizmo5 credits deducted.
If you tap on your friend's SIP number...
...and choose the Phone Call option, the call will not connect and neither side will be billed.

...and choose the Sipdroid option, the call will be connected on both ends using SIP. The entire call will occur over SIP and thus neither side will have cellular minutes or Gizmo5 credits deducted.​



Extra Credit: Free Outbound Calling Via Google Voice

I mentioned earlier that it is possible to make some non-toll-free outbound calls using Google Voice. Google Voice provides free outbound calling to any number within the United States and Canada. This is possible to do with SIP, but the service requires Google Voice to perform the dialing. Normally when performed in the official Google Voice app, this process is transparent. However, the official GV app does not support SIP dialing. In order to perform the call then, you must open the Google Voice webpage in your Android browser and perform a callback. Scroll to the bottom of the webpage, enter the number you wish to call, and click Call. If all is working properly, your phone should receive a SIP call. Answer this call and the number you called should be connected on the other end shortly.

sdp_21.png
sdp_22.png
sdp_23.png
 
Sep 21, 2009
5
0
Thank you so much for this complete guide and I've several questions here.

1.My sipdroid works well with UDP but doesn't work with TCP, any solution?

2.Registration does not complete every time. what does "503 Service Unavailable" mean?

3. Sipdroid will receive call back when I preform a call on my laptop in the google voice page, but never receive call back when I use google voice webpage. Why is it?

4. Is there any app for android can let me making google voice phone calls with gizmo5 service? I've tried guava, gv, google voice but none of these works. I guess its my fault but I just don't know how to solve it.
 

jashsu

Senior Member
Nov 15, 2008
1,849
20
Thank you so much for this complete guide and I've several questions here.

1.My sipdroid works well with UDP but doesn't work with TCP, any solution?
What is your SIP provider/proxy? Not all SIP providers have proxy servers configured to work with TCP. One option for getting TCP to work with a SIP provider that doesn't yet support TCP is to route through pbxes.org

3. Sipdroid will receive call back when I preform a call on my laptop in the google voice page, but never receive call back when I use google voice webpage. Why is it?
I don't understand your question. Can you rephrase it?

4. Is there any app for android can let me making google voice phone calls with gizmo5 service? I've tried guava, gv, google voice but none of these works. I guess its my fault but I just don't know how to solve it.
Currently you have to use the callback if you want to perform a call through Google Voice.
 

surfshadow

Member
Nov 10, 2009
10
0
Hey man, awesome updated post! But when I set everything up, I am not able to receive calls over 3g data when my screen blacks out (i am assuming that my 3g data is turned off when screen is blacked out as well?) - I can only receive calls when the screen is active. Do you know how to fix this? TIA!
 

jashsu

Senior Member
Nov 15, 2008
1,849
20
Hey man, awesome updated post! But when I set everything up, I am not able to receive calls over 3g data when my screen blacks out (i am assuming that my 3g data is turned off when screen is blacked out as well?) - I can only receive calls when the screen is active. Do you know how to fix this? TIA!
What version of Sipdroid are you using? And which version of Android is your phone running? Your 3G data connection should remain active if both of those versions are fairly update. For the record I am using Sipdroid 1.3.14 on Android 1.6 for the above guide.
 

surfshadow

Member
Nov 10, 2009
10
0
Everything is up to date like yours. I am using sipdroid 1.3.14 and running it on my Mytouch 3G (Android 1.6). Not sure if 3g connection drop is the sole issue because the green dot is always there - but even with the green dot present, it won't receive calls when i leave my phone idle for few minutes.
 

indybull

New member
Sep 26, 2009
3
0
similar problem as lemoncoffeetea

Awesome post! Thank you.

I have very similar problem as lemoncoffeetea.

Sipdroid will receive call back when I preform a call on my laptop in the google voice page, but never receive call back when I use google voice webpage in my android phone.

In addition, the registration seems not very stable. Sometime the light turns to green, other time become red. When it is red, it either comes out (Timeout), or (503 errors).

Any insight on this?

Thank you very much!
 

Gary13579

Retired Moderator
Nov 14, 2008
524
69
Hey jashsu, awesome guide! This may not be the best place to post this but I've been having problems with sipdroid.

Specifically, any WiFi power saving mode seems to fail. I have Android's wifi sleeping set to never, and then if I check the "Let sipdroid control wifi power" box, sipdroid disconnects after the screen turns off, as well as the phone disconnecting from WiFi.

I believe this is probably related: http://code.google.com/p/sipdroid/wiki/NewStandbyTechnique

I'm guessing Gizmo5 doesn't support VoIP over TCP, so the phone needs to wake up often to keep the UDP connection alive? Appreciate any comments :)
 

jashsu

Senior Member
Nov 15, 2008
1,849
20
I'm guessing Gizmo5 doesn't support VoIP over TCP, so the phone needs to wake up often to keep the UDP connection alive? Appreciate any comments :)
It definitely does, as I am connected to Gizmo5 using TCP right now.

edit: by the way, yes I do notice that setting WiFi to "Always on while plugged in" seems to have no effect. Strange. I'll look into it.
 
Last edited:

indybull

New member
Sep 26, 2009
3
0
1. Both TCP and UDP seem both work fine.
2. I cannot use the STUN server. If I do, I cannot hear sound from echo test.
3. (most importantly) my connection to Gismo service through Sipdroid doesn't seem to be very stable. The connection turns RED very frequently - this happens almost everytime I open GV app, or google voice mobile website. (I don't know why)
 

jashsu

Senior Member
Nov 15, 2008
1,849
20
In addition, the registration seems not very stable. Sometime the light turns to green, other time become red. When it is red, it either comes out (Timeout), or (503 errors).

Any insight on this?

Thank you very much!
indybull, lemoncoffeetea: I also occasionally will have periods where I cannot seem to log in for some reason. Only remedy in those situations seems to be turning Sipdroid completely off for a while. It may be that when an account performs too many flaky reconnects to Gizmo5 in a specific period of time, Gizmo5 will temporarily block that ip or username from attempting any more logins. This is just a guess.
 

Gary13579

Retired Moderator
Nov 14, 2008
524
69
Oh and I forgot to mention, you should include a quick guide to using KNY's GV application. It takes a bit to setup properly, but it can be used to automate calling with gv/sipdroid, without having to mess around with the browser.
 

indybull

New member
Sep 26, 2009
3
0
Oh and I forgot to mention, you should include a quick guide to using KNY's GV application. It takes a bit to setup properly, but it can be used to automate calling with gv/sipdroid, without having to mess around with the browser.

Can you provide a link to "KNY's GV app"? I have only tried Evan Charlton's GV app, and it doesn't seem to work.
 

surfshadow

Member
Nov 10, 2009
10
0
Going back to my issue, and similar problem as Gary's - I am not able to use TCP as my connection will just time out after a short period of time (or only shows yellow dot constantly). Additionally, if I enable STUN , I am able to register properly, but I am not able to receive calls most of the time - even after I just turn on sipdroid and start using it without letting my phone go to sleep.

So the only settings that work for me is UDP without STUN -> but phone will stop receiving calls if phone is idle for a few minutes. :( Any suggestions would be highly appreciative! Thanks.
 

jashsu

Senior Member
Nov 15, 2008
1,849
20
So the only settings that work for me is UDP without STUN -> but phone will stop receiving calls if phone is idle for a few minutes. :( Any suggestions would be highly appreciative! Thanks.
Hmm okay. I've made a notation to try toggling the STUN setting for setups that are not working well. By the way, TCP is, I believe, only used to wake the phone up (since TCP sockets time out in 30-60 mins, whereas UDP will time out in 30-60 sec). I think once the phone is actually woken the call is still carried over UDP.
 

Gary13579

Retired Moderator
Nov 14, 2008
524
69
Sorry, I didn't want to risk spelling Evan's last name so I just used KNY :). Sucks he stopped updating it, I poked around on his VCS and it looks like it's undergoing some restructuring, so maybe he will update it again?

And haha I'm an idiot, I haven't tried Control WiFi Power with TCP. It gets incredibly annoying having 4 hours of battery life while the phone is idle due to WiFi.

Placing calls seems to work, and it doesn't drop the connections when the phone is idle, but receiving a call from GV seems to fail. Changing it back to UDP and I get the call. Switching it back to TCP and it fails again.

Edit: using Ekiga with GV/Gizmo, I immediately receive the call. sipdroid is for sure not playing with gizmo5 that well. Looking at my Missed call logs, I've received a few calls that my phone never picked up.

Maybe you could use Gizmo5 to forward the SIP call to a PBXes account, and everything would still be free, but more reliable due to sipdroid/pbxes support?
 
Last edited:

surfshadow

Member
Nov 10, 2009
10
0
You know what, I actually just set up a pbxes account late last night. It seems to be working so far even when using with TCP. This is pretty awesome, going to test it out throughout the day. I avoided pbxes before because it seemed too complicated, but I just setup like inbound route and so far it seems to work! So Gizmo5 --> pbxes --> sipdroid seems to be the trick. Gonna test it out more today, but I left phone on overnight with app running and called google voice number as soon as I woke up and it "woke" my phone and I was able to receive the call after phone being idle for several hours in this case (something I wouldn't be able to do from Gizmo5 --> Sipdroid)!!!

I don't think I need outbound routing in pbxes since I'll just use my phone browser to initiate the call through google voice. Right? Thanks!
 
Last edited:

jea7587

New member
Nov 16, 2009
1
0
surfshadow,

We you mind posting a few details on how you set up Gizmo5 --> pbxes --> sipdroid? I don't really understand pbxes. I think you are onto something with that routing path.

Thanks