/dev/random Nonsense Ensured

12Aug/116

Free Calling with Google Voice and Asterisk

asteriskgvoice

I've been playing with Asterisk and Google Voice for the better part of a year now, and just recently was finally able to get it all working the way I wanted it to. When Google started letting you make phone calls using Voice from Gmail, they opened up the ability to make phone calls over gtalk, their XMPP/Jabber based IM/Voice/Video service. When I heard that, I thought it would be a piece of cake to get Voice working with Asterisk's Jabber/Jingle channel... nope! In fact, Voice didn't start working with Asterisk until 1.8.1 which is what I was waiting to finally become stable enough to use. Then after a few more problems with Asterisk breaking support for my Cisco 7960 (SIP) which was finally fixed in 1.8.4.4. Now that you've heard my life story, here's how I got that working.

Prerequisites

  • A modern Linux box, I'm running OpenSUSE 11.4 Kernel 2.6.37.1
  • Asterisk 1.8.1.1 or newer, I'm running 1.8.4.4 (to get support for my Cisco 7960 SIP)
  • Some sort of VoIP phone connected to your Asterisk box, soft or hard

Google Voice Setup

You need to, of course, have a Google account, with Voice enabled, and Gmail calling turned on as well.  Once you have that setup, make sure that you change the Chat setting from the default of "Automatically allow people that I communicate with often to chat with me and see when I'm online" to the second option of "Only allow people that I've explicitly approved to chat with me and see when I'm online."

Asterisk Setup

On the Asterisk side, things aren't quite as easy.  You'll want to make sure you have at least the chan_gtalk and the res_jabber modules compiled and installed before proceeding or else none of this will work.  I of course needed things like chan_sip as well to work with my Cisco 7960.  In your Asterisk configuration directory (usually /etc/asterisk) you'll need these conf files to look at least like this:

/etc/asterisk/gtalk.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[general]
context=local                   ; Context to dump call into
bindaddr=10.8.2.5               ; Address to bind to
;externip=1.2.3.4               ; Set your external ip if you are behind a NAT.
;stunaddr=mystunserver.com      ; Get your external ip from a STUN server.
                                ; Note, if the STUN query is successful, this will
                                ; replace any value placed in externip;
allowguest=yes                  ; Allow calls from people not in list of peers

[guest]                         ; special account for options on guest account
disallow=all
allow=ulaw
context=local
connection=asterisk

/etc/asterisk/jabber.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
[general]
debug=no                                ; Enable debugging (disabled by default).
autoprune=no                            ; Auto remove users from buddy list. Depending on your
                                        ; setup (ie, using your personal Gtalk account for a test)
                                        ; you might lose your contacts list. Default is 'no'.
autoregister=yes                        ; Auto register users from buddy list.
;collection_nodes=yes                   ; Enable support for XEP-0248 for use with
                                        ; distributed device state.  Default is 'no'.
;pubsub_autocreate=yes                  ; Whether or not the PubSub server supports/is using
                                        ; auto-create for nodes.  If it is, we have to
                                        ; explicitly pre-create nodes before publishing them.
                                        ; Default is 'no'.
;auth_policy=accept                     ; Auto accept users' subscription requests (default).
                                        ; Set to deny for auto denial.
[asterisk]
type=client                             ; Client or Component connection
serverhost=talk.google.com              ; Route to server for example, talk.google.com
;pubsub_node=pubsub.astjab.org          ; Node to use for publishing events via PubSub
username=butters08@gmail.com/Talk       ; Username with optional resource. (must be /Talk for Voice)
secret=XXXXXXXXXXXXXXXX                 ; Google Password
;priority=1                             ; Resource priority
port=5222                               ; Port to use defaults to 5222
usetls=yes                              ; Use tls or not
usesasl=yes                             ; Use sasl or not
;buddy=mogorman@astjab.org              ; Manual addition of buddy to list.
                                        ; For distributed events, these buddies are
                                        ; automatically added in the whitelist as
                                        ; 'owners' of the node(s).
;distribute_events=yes                  ; Whether or not to distribute events using
                                        ; this connection.  Default is 'no'.
status=away                             ; One of: chat, available, away, xaway, or dnd
statusmessage="I'm an Asterisk Server!" ; Have custom status message for Asterisk
timeout=100                             ; Timeout (in seconds) on the message stack, defaults to 5.
                                        ; Messages stored longer than this value will be deleted by Asterisk.
                                        ; This option applies to incoming messages only, which are intended to
                                        ; be processed by the JABBER_RECEIVE dialplan function.

/etc/asterisk/extensions.conf

Now obviously not all of this is required, this is just how I have my dial plan setup. To receive incoming calls from Voice you must have a exten => s,1,Answer() though as Voice doesn't say where it's coming from.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[general]
static=yes
writeprotect=yes
autofallthough=yes
clearglobalvars=no
priorityjumping=no

[local]
exten => s,1,Answer()
exten => s,n,Set(crazygooglecid=${CALLERID(name)}) ; Get rid of crazy Google incoming CID
exten => s,n,Set(stripcrazysuffix=${CUT(crazygooglecid,@,1)})
exten => s,n,Set(CALLERID(name)="${CURL(http://cnam.bulkCNAM.com/?id=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&did=${CALLERID(num)})}") ; Set Caller ID from bulkCNAM
exten => s,n,Wait(2)
exten => s,n,Dial(SIP/102&SIP/103,20,D(:1)) ; This sends the 1 after you answer, otherwise it'll fall back on Google Voice-mail
                                            ; It also dials my SIP phones (7960 and Android 2.3 Phone)

; Internal Calling
exten => _1XX,1,Dial(SIP/${EXTEN})
; External Calling
exten => _1XXXXXXXXXX,1,Dial(gtalk/asterisk/+${EXTEN}@voice.google.com)
exten => _XXXXXXXXXX,1,Dial(gtalk/asterisk/+1${EXTEN}@voice.google.com)

Final Thoughts

I know this isn't the most in depth guide on getting Asterisk working on your machine, but there are enough guides out there for that. Hope my article helped you get Voice working with Asterisk, happy calling!

References

12Mar/113

Android Home Screen

home2

I spent a fair amount of time setting up my current home screen.  I got the idea from this reddit post and followed this guide to start.  I made a lot of the icons myself, though some aren't mine.  Here's the images I used, feel free to do whatever with them.  You need Photoshop to make new ones and the Helvetica font, which I found by Googling "Helvetica filetype:zip", here it is.

 
 
 
 
 
 

Widgets / Applications

  • LauncherPro Plus v0.8.3
  • Beautiful Widgets
  • Desktop Visualizer

Images

Downloads

I'd be happy to answer any questions in the comments!

Filed under: Android, Linux 3 Comments
11Aug/104

Connecting to WMU’s Cisco VPN from Linux

So if you're like me and you happen to use Linux instead of Windows or Mac OS X and you want to connect to Western's VPN (or any Cisco based VPN really, though I'll go though some Western specific steps) then I'm writing this for you.  For this guide I'll be assuming you're running Ubuntu 10.04 and using NetworkManager (although I'm pretty sure you can do this with just the Cisco VPN Linux Application vpnc).  Note some issues you might run into that I'll address at the end.  Anyways, here it goes.

1. Install network-manager-vpnc

Run this from a terminal

travis@bender:~$ sudo apt-get install network-manager-vpnc

2. Acquiring the WMU pcf file

So I decided it was probably not a good idea to post the pcf file on here because I don't want to stir up any problems by posting the "encrypted" (lol yeah, right) group password.  Anyways since you're already using Linux, this step isn't too hard.  Start by logging into GoWMU and then going to the VPN area and download the Student Mac client.  Now you should have the file vpnclient-darwin-4.9.01.0080-universal-k9.dmg somewhere.  I'll be working on it in my home directory.

Changed my mind since they took down the old VPN clients, although the Cisco VPN server is still running, here it is.

travis@bender:~$ mkdir vpnclient
travis@bender:~$ sudo mount -t hfsplus -o loop vpnclient-darwin-4.9.01.0080-universal-k9.dmg vpnclient/
travis@bender:~$ cp vpnclient/Profiles/WMUExternal.pcf .

Now you should have the pcf file in your homedir.

3. Configuring NetworkManager

Start by right clicking on NetworkManager and click "Edit Connections".  Then click the VPN tab and click "Import".network connectionsSelect the pcf file in your home directory and click open.  It should look like this (I blurred out the IP just in case).edit wmu vpnFill in the Username and set the User password if you want it saved.  Then click the IPv4 Settings and click then click Routes.  Then click "Use this connection only for resources on its network".routesClick OK and then Apply.  At that point it should work, if you have any problems let me know!

Tagged as: , , 4 Comments
22Jul/109

Why Root Your HTC Droid Incredible

So, you just rooted your droid and now your thinking to yourself "sweet, now what?"  Well here's a list of apps that require root that will make you wonder how you ever lived without in no particular order.

1. Wireless Tether

Wireless Tether

Wireless Tether

This is by far my favorite app.  It makes my phone into a mobile hotspot which is really hand when you're on the go.  This app took a bit of work to get working on the Incredible, but it isn't too hard.  To get it to work you'll need a terminal like ConnectBot.  Start up a local terminal and type:

su
mkdir /sdcard/android.tether
cat /system/etc/firmware/fw_bcm4329.bin > /sdcard/android.tether/fw_bcm4329.bin
Wireless Tether Market QR Code

Market QR Code

Then when you run Wireless Tether it should say it's loading that file in the log.  From there you can configure Security (WEP), although so far I haven't been able to get it work with WEP enabled, I just use Access-Control and approve all the clients individually.  It also supports tethering via Bluetooth but I haven't tried it.

Developer Website

2. Lamppu

Lamppu Market QR Code

Market QR Code

Lamppu Widget

Lamppu Widget

The Camera light on the back of the Incredible seems like it would make a great flash light right?  If you said yes, you are correct!  This was one of my most used features on my BlackBerry, but unfortunately HTC decided you don't get to do this and locked it down, but now that your Incredible is rooted, you can now make use of this!  This is where lamppu comes in, it gives you a widget to control the LED lights on the back of your phone.

3. ShootMe

ShootMe

ShootMe

ShootMe Market QR Code

Market QR Code

This is another program I used to use on my BlackBerry all the time that I enjoyed.  It lets you take screen shots of whatever your doing.  On the BlackBerry I had go to a menu and what not, but not this one it's even easier, just flick it to one side.  You can leave it running in the back ground for quick access anytime (surprisingly I haven't been taking random screen shots in my pocket) or quit when you're done for the moment.  I personally leave it running just in case I decide I want to take a quick screen shot.

_

_

_

_

4. Shark

Shark

Shark

Shark Market QR Code

Market QR Code

Shark is a pretty cool program if you're into packet sniffing and whatnot.  It's kind of like a light version of WireShark for PC, but with a much lighter interface.  It will let you dump a PCAP file that you can examine later, or I guess if you're really crafty, use it right on your phone.  It would be cool to be able to crack WEP keys right on your phone or sniff for unencrypted passwords going over 3G.  Let me know what you're able to do with this.

_

_

_

_

_

5. Webkey

WebKey

WebKey

Webkey Market QR Code

Market QR Code

This program I found just searching the Market for "root".  I've found it to be incredibly useful for when you need to type a lot and don't want to use the little keyboard.  Say, for example, you have a link on your computer that you want to open on your phone, well this software will let you control your phone from any web browser, and as you can see from the screen shot (below) you can go right to a webpage.  It also will do a GPS location pull and put the location on Google Maps for you.  Pretty useful if you lose your phone.  There's lots more you can do with it but I haven't played around with it too much.  One thing I haven't done is gotten it to work over 3G yet, that would make it 100x more useful in case you actually left your phone somewhere or it got stolen.

_

_

WebKey_Page

WebKey Page

There are a ton of other apps requiring root access, but no others that I thought worth mentioning unless you're changing the ROM on your phone on a regular basis for some reason.  I personally like the HTC ROM and don't plan to move away from it and since I have the Wireless Tether app, I have no real desire to move to 2.2 before HTC releases it for the Incredible.  Anyways, even if these apps don't appeal to you, you can feel good knowing your phone is yours and you have full access to do whatever you want to it, just as you should.  Happy rooting!

21Jul/100

Rooting the HTC Droid Incredible (the easy way)

So I've had my Droid Incredible for about a month now, and I have to say I'm very happy with it.  The 1ghz snapdragon processor is very responsive and the phone is really nice to use.  I upgraded to this phone from a RIM BlackBerry 8330 and anyone who's used one before will know how slow and clunky the phone / OS is, the difference is night and day.  Anyways I was perfectly happy with the phone without having root except for one feature; WiFi Tethering (also there were a few other features I wanted but could have lived without but are nice to have).  So here's the quick and easy way to root your Droid Incredible on Windows (it's also possible to do on Mac and Linux, I just happen to already be in Windows when I did this and didn't feel like rebooting).

Things you need before you start

  1. Droid Incredible w/ USB cable
  2. This USB driver (Windows)
  3. unrevoked3.1 for your OS

Now for the steps

  1. Enable USB Debugging Mode on your phone (Settings -> Applications -> Development)

    Android USB Debug Window

    Android USB Debug Window

  2. Connect your phone to your PC.  Now when I did this (I'm running Windows 7 Pro x64) it just said driver failed to install.  What I had to do was go to Start -> Devices and Printers then left click on Android Phone -> Properties then click the Hardware tab then click on HTC Android Phone USB Device then click Properties, then the Driver tab then click Update Driver  and from there tell it the location of the downloaded driver.  Let me know if you have to do something similar.
  3. Reboot into the HBOOT menu.  To do this power off the phone, then push POWER + VOL DOWN and you should end up in the HBOOT menu.

    HTC Droid Incredible HBOOT Screen

    HTC Droid Incredible HBOOT Screen

  4. The phone (still plugged into USB) should start installing new drivers for the boot menu, if it doesn't try unplugging and plugging the USB cord.
  5. Now that that is finished, run the reflash.exe file that you downloaded (the unrevoked 3.1 program).  It should say something like "Waiting for device..." so reboot your phone (making sure USB Debug Mode is still on) and it should  then take control of your device.  If all goes well at this point in a few minutes you should have a rooted Droid Incredible!

    Android Super User Screen

    The Android Super User Screen

More later on how to make use of your newly rooted Droid Incredible!  Happy rooting!

Edit: New Blog Post Why Root Your HTC Droid Incredible

13Oct/094

The New Direction

Just so everyone (and no one) knows, I am aware that nobody follows my blog, but that is alright, I thought I would at least explain my change in direction to the Internet ghosts.

The past few months have taught me a lot about life and one thing I've learned is that if you want to be happy, you can't follow politics, end of story.  So... I stopped.  I also learned that I need to slow down and enjoy life.  I was trying to be older than I was, but at the same time younger than I was.  And anyways, moral of the story is I am less concerned about what is going on around me and focusing instead on my studies and interest.  That will of course be reflected here (not that I ever update... but I might start updating more, who knows).  So expect to see more post about life, philosophy, and of course, Linux!

Filed under: Life, Linux 4 Comments
  • Twitter
  • Buzz
  • Tumblr
  • Facebook
  • LinkedIn
  • Digg
  • Picasa
  • Flickr
  • Panoramio
  • YouTube
  • Last.fm