Amp and USB Chargers

This is a good article that explains how USB charging works. Basically, avoid cheap chargers. For any reasonably good charger, the amperage of the charger doesn’t really matter so long as it exceeds what the device requires; that is, use a charger with at least 0.5 Amp if the device requires 0.5 Amp (what the original charger uses). Thus, it’s OK to use my 2 Amp chargers on most of my mobile device so things charge faster!

Google Voice on Asterisk with an Auto-attendant and free calls

I’ve heard about Asterisk for some time now since using VoIP services such as Google Voice, Gizmo5, Sipgate and Skype. Most of these services allow you to receive unlimited phone calls for free; you just need to register the service using a sip client, such as Ekiga on Linux, telephone on Mac OS X, sipdroid on an Android phone with unlimited data. The only “fancy” thing I did with these services was receive Google Voice calls on Gizmo5 and using the voicemail feature for parents in my local youth group to leave messages (so I don’t have to release my personal phone number or talk to them…I am a busy person).

Before I continue, I just want to say that I really like Google Voice as a service. You get a free phone number that you can forward to different phones, including the VoIP provider Gizmo5. The voicemail transcription is just awesome; I even set my personal cell phone to use GV as it’s default voicemail application over the network provider’s. If you use an Android phone, you get the GV app that let’s you read voicemails and text messages, send text messages and call using the GV phone number. Most recently, you can even receive and call any US number for free!

I recently wanted to set up an auto-attendant with GV so my youth group’s main phone number could be routed to the specified person when parents need to speak with us; I really don’t like to give out our personal phone numbers, not because we don’t want to talk to parents, but because they still call you (thinking you’re in charge) when other volunteers have taken over your position at the group.

Searching for “free auto-attendant” or the likes yielded a few services. I checked out Phonebooth but it didn’t really do what I wanted to or is very limited; either that or I didn’t know how to set it up. I remembered Asterisk and finally looked more into it.

According to Wikipedia), Asterisk is an open source PBX (Private Branch Exchange). It’s called Asterisk (*) because once the original author wrote a program to connect a computer to the telephone system, he realized anything could be done with the program. Hence asterisk meaning anything.

I will now outline how to set up Google Voice to receive and forward calls with Asterisk, along with playing messages for the caller to hear. This is what I want to have for my youth group. Note figuring out this entire process was hard because I am not familiar with phone systems and networking. The folks from #asterisk on freenode was very helpful. Before I start, let me mention that the free book on asterisk is the definitive guide on learning this stuff. Reading the Dialplan section is a must for learning how to handle calls (play message, forward, etc). Debugging is a must when seeking help in the irc channel, forum, or mailing list.

Install Asterisk on a Linux system

I will provide instructions for how to install the plain Asterisk version, not AsteriskNow or the many derived products. You can install it using apt-get on Debian/Ubuntu, but we’ll need version 1.8 to get Google Voice working with Asterisk without going through another VoIP provider. I’ll install it from the 1.8 branch of the svn version:

sudo apt-get install libiksemel-dev libssl-dev libncurses5 g++ libxml2-dev
svn co http://svn.digium.com/svn/asterisk/branches/1.8
cd 1.8
./configure
make
sudo make install
sudo make samples

This will install asterisk. Be default, Asterisk needs to be run under the root user. sudo asterisk would start it. sudo asterisk -r will connect to a CLI on the current machine with asterisk running. sudo asterisk -c will start Asterisk and go directly into the CLI.

Google Voice setup

Edit the following files in /etc/asterisk/.

jabber.conf and replace gmail.address with yours, and tnttspJabber with what you want to call this connection:

[general]
debug=yes
autoprune=no
autoregister=yes

[tnttspJabber]
type=client
serverhost=talk.google.com
username=gmail.address/gmail ;; either will work
;;username=gmail.address/Talk
secret=password
port=5222
usetls=yes
usesasl=yes
statusmessage="I am an asterisk server." ;required
timeout=100

gtalk.conf:

[general]
;;context=default ;; you can specify here too
allowguest=yes
bindaddr=0.0.0.0

[guest]
context=tnttsp ;; context in extensions.conf
disallow=all
allow=ulaw
connection=tnttspJabber ;; refer to the connection name in [ ] in jabber.conf

This will make asterisk connect to GV via the jabber protocol. It is as if you are logged into gtalk in gmail, where you can send and receive phone calls.

The dialplan, the configuration in extensions.conf, is what we tell asterisk to do when a call is received from a channel or what to do when digits are pressed in a call. Please read it in the book.

A basic hello world example and the ability to dial out in extensions.conf:

[general]
[globals]

[tnttsp]
exten => s,1,Answer()
;;exten => s,n,Wait(10)
exten => s,n,Wait(1)
exten => s,n,SendDTMF(1) ;;needed for google voice; otherwise, only call to computer in gmail will work and not calls made to google voice
exten => s,n,Playback(hello-world)

;; call
exten => _1NXXNXXXXXX,1,Dial(Gtalk/tnttspJabber/+${EXTEN}@voice.google.com)

Some references for this setup are here, here (look in comments), here, and here (look in comments).

Note that to dial out, you need to use something like an AMI script or be in Asterisk. I have not yet figured out how to connect a sip client to asterisk to be able to dial out because I am not that savvy with networking. Sip client and asterisk needs to be directly connected to each other, and having the host and/or client behind firewalls make things complicated.

For wav files to be played using Playback() or Background(), make sure

  1. File paths do not include the extensions, such as .wav. For example, /home/username/sound/mysound not /home/username/sound/mysound.wav.
  2. Wav files need to be mono and 8000 Hz. Use the following script to convert them:
#! /bin/bash

## http://wiki.kolmisoft.com/index.php/Convert_WAV_file_to_Asterisk_playable_format
## http://www.voip-info.org/index.php?content_id=3339
for file in "$@"
do
mv $file ORG$file
sox ORG$file -r 8000 -c1 -s $file rate -ql
done

I have not tested mp3 files.

Send and receive your phone’s SMS through Instant Messages

I read this post and found out about TalkMyPhone, an Android app that let’s you send and receive SMS messages from any instant messaging program such as Pidgin via the jabber protocol.

It comes in handy as I don’t like having a long conversation via SMS when a computer is in front of me; I can multi-task on the computer like I usually do without having to take my hands off the computer keyboard.

My setup is as follows:

  1. Register for an account on jabber.
  2. Make sure that this account is friend’s with my gmail gtalk account; done by IM’ing the gmail account from this web app (didn’t work in Pidgin).
  3. On my computer, sign on to the jabber account from 1, eg, through Pidgin.
  4. In TalkMyPhone’s settings, set to notify the address from 1. Leave the default setting of unchecked “Use a different account” (the phone’s google talk account will communicate with the account from 1).

I really like it, but I have a feeling it will eat up battery pretty fast. Since I’m in front of the computer, just keep the usb port plugged in for charging. Enjoy!

Perfect VoIP combo: Google Voice + Gizmo

So I’ve had my google voice telephone number for quite a while now, but i haven’t used it much since there is no good google voice app for my windows mobile phone. i’m still waiting for sprint to release the new android-based samsung phone. i’m sure google voie would go VERY well with the google voice service.

One thing i HAVE been using google voice with is to get an official phone number for my church youth group. it makes us look a lot more professional now that we have an often-updated website, domain-based email addresses, and a phone #. it’s great in that the number will be permanent, even when the administration changes: just change the forwarded #. however, my primary phone, which is a mobile phone, is already linked to my personal google voice account. although i mentioned that i haven’t really used it much yet, i’m sure it’s only a matter of time before i roll out my personal google voice #.

what do i do with my the church youth group #? forward it to my Gizmo #. Gizmo is a VoIP service that is QUITE similar to skype. I’m sure skype is more popular, but a lot of parts of Gizmo is open source. Best thing is google voice supports it. Went over to the Gizmo site and signed up for an account. Configured google voice to work with Gizmo (One gizmo account actually works with multiple google voice accounts, so both my personal google voice # and my church youth group # are being forwarded to my gizmo account). There is a an open source VoIP app for Mac OS X that is very small and simple called Telephone. I’m using that as my Gizmo client on my laptop.

Some useful links: http://www.google.com/support/forum/p/voice/thread?tid=16817c950860c1fb&hl=en http://linux.com/archive/feature/138506 https://my.gizmo5.com http://code.google.com/p/telephone/wiki/ProvidersTested#Google_Voice http://code.google.com/p/telephone/wiki/PreconfigureForYourUsers

some things i still would like is to have SMS to be free with gizmo and google voice.