First Fishing Trip
Out with Poppop Kirk for Lavi’s first fishing trip. First time on a boat and first time with a pole in the water. Such a fun time!
Out with Poppop Kirk for Lavi’s first fishing trip. First time on a boat and first time with a pole in the water. Such a fun time!
After my monthly billing for my Internet and Phone service rose $25 dollars in one month, sending my fees for Internet and phone from $75 to $98, I decided that it was time to buckle down and work on something that I had been thinking about for a long time. Zero dollar per year phone service including long distance. The goal was building a highly functioning personal VOIP environment to entirely replace my traditional land line phone service and include complete integration with Google Voice. My monthly fees were pulled back down to a more manageable $60 dollars for Internet and a purely basic local only phone line with no frills because the bundled package was still cheaper than just Internet. More for less go figure. My phone feature frills are handled elsewhere now.
What I’ve ended up with is Asterisk configured as my PBX, all extensions are currently SIP VOIP users, with registered trunks to Gizmo5 for each Google Voice account I want to integrate. Google Voice dialing can be done straight from the client/phone which means there is no need to initiate the call manually from the Google Voice webpage. I just assign a unique extension per account and within the dial plan call the script gvoice provided by pygooglevoice using System() to complete the call. More details on that later.
Inspired by an article I read here there was enough detail to get things started. There are many limitations to the details described in that article but I’ve been able to work through most of them over the past week and I think I’ve made some excellent improvements. Two things that I was able to improve on are your outgoing calls do not depend on Gizmo’s 3 minutes free/outgoing minutes charges and dialing directly from the web is no longer high jacked by a potentially non-existent parked line on incoming calls from your Google account.
I will make the assumption here that you already have Asterisk installed, you’ve configured pygooglevoice to be usable on the asterisk server and that you have a Google Voice account. There are many other posts out there on the Internet that cover getting asterisk up and running. When I began to install my asterisk environment I tried to use FreePBX but really felt as though it was in my way. I could never get things working using it. I’m sure that it has it’s place and works well, most other posts about configuring asterisk and out of the box Linux PBX distributions use it, but it was not working for me. Not understanding yet what it took to make asterisk work probably was the main issue with not being able to use it. Instead I just wrote the config files for asterisk manually. The two most important configuration files in this discussion are extensions.conf (where the dial plans and dirty stuff goes on) and sip.conf (user accounts, SIP registrations and sip configuration).
There are two important configurations to get asterisk off the ground. User accounts for SIP users and Dial plans defined for system extensions. The first is created in the file sip.conf and the later in extensions.conf. Things to keep in mind here that come in handy later are setting useful context and defining your user sections [phone1], [GizmoUser1] etc..
Let’s set up the basics. Two sip accounts and extensions to allow them to be dialed.
sip.conf
[1111]
type=friend
context=from-internal
host=dynamic
secret=URPASSWORD
callerid=User1 <1111>
canreinvite=yes
dtmfmode=auto
disallow=all
allow=ulaw
;allow=ilbc
callingpres=allowed_passed_screen
[2222]
type=friend
context=from-internal
nat=yes
host=dynamic
secret=URPASSWORD
callerid=User2 <2222>
canreinvite=yes
dtmfmode=auto
disallow=all
allow=ulaw
;allow=ilbc
callingpres=allowed_passed_screen
extension.conf – notice that above we defined these accounts within the context=from-internal so extensions must be associated with that context.
[from-internal] exten => 1111,1,Dial(SIP/1111,120,t) exten => 1111,n,Macro(fastbusy) exten => 2222,1,Dial(SIP/2222,120,t) exten => 2222,n,Macro(fastbusy)
Next we define how we’re are going to go about communicating with Gizmo5 (sipphone.com). This happens in sip.conf in two places.
First we register with the network. The key here is that if you have multiple accounts that you are registering make sure to define their context with /CONTEXT at the end of the register entry. This allows you to uniquely identify incoming calls from the separate accounts later in extensions.conf.
register => 1747XXXXXXX:PASSWORD@proxy01.sipphone.com/GizmoAct1
register => 1747XXXXXXX:PASSWORD@proxy01.sipphone.com/GizmoAct2
Next we define a sip user for each account. Again notice here the context is set as from-google this is important for all incoming calls coming from these accounts when we configure the dial plans.
It would make sense here to name them in a way that tie to the register entries. i.e. GizmoUser1 <-> GizmoAct1
[GizmoUser1] type=friend context=from-google disallow=all allow=ulaw ;allow=ilbc dtmfmode=rfc2833 host=proxy01.sipphone.com fromdomain=proxy01.sipphone.com insecure=port,invite ;qualify=yes fromuser=1747XXXXXXX authuser=1747XXXXXXX username=1747XXXXXXX secret=PASSWORD canreinvite=yes [GizmoUser2] type=friend context=from-google disallow=all allow=ulaw ;allow=ilbc dtmfmode=rfc2833 host=proxy01.sipphone.com fromdomain=proxy01.sipphone.com insecure=port,invite ;qualify=yes fromuser=1747XXXXXXX authuser=1747XXXXXXX username=1747XXXXXXX secret=PASSWORD canreinvite=yes
Alright back to extensions.conf, here are the good bits in my opinion.
Set some global variables for the various accounts, some bits and pieces regarding where you’re going to park calls while the gvoice script goes and does it’s thing, account information so it’s easily reused and anything else that seems exciting.
[globals] ; LOCAL CONFIGURATION MYGOO-ACCTNAME=mygoogle@gmail.com MYGOO-ACCTPASS=PASSWORD MYGOO-GVNUM= MYGOO-RINGBACK=1747XXXXXXX ; Gizmo DID MYGOO-ISPARK=0 MYGOO-CALLPARK=705 OTHERGOO-ACCTNAME=othergoogle@gmail.com OTHERGOO-ACCTPASS=PASSWORD OTHERGOO-GVNUM= OTHERGOO-RINGBACK=1747XXXXXXX OTHERGOO-ISPARK=0 OTHERGOO-CALLPARK=706
Create a unique dial extension for your accounts so that the outgoing is associated with the right Google Voice account.
[GizmoAct1-google-out]
exten => _8.,1,Dial(local/${EXTEN:1}@GizmoAct1-google-voice,300)
[GizmoAct2-google-out]
exten => _9.,1,Dial(local/${EXTEN:1}@GizmoAct2-google-voice,300)
Define what happens when the call is made. Here we initiate the call to @GizmoAct1-google-voice, play back a message, poke Google Voice using the gvoice script to us call back and park the call. I set a global variable here, ISPARK, to indicate that this call was generated from my SIP client and parked. This helps fix an issue with the other dial plan examples that I found where the ability to initiate calls from the web would break and treat every incoming call from Google Voice the same and try to attach it to an existing parked call even if that parked call did not exist. You see later that I check for the ISPARK flag.
[GizmoAct1-google-voice]
exten => _X.,1,Wait(5)
exten => _X.,n,Playback(wait-moment)
exten => _X.,n,System(gvoice -e ${MYGOO-ACCTNAME} -p ${MYGOO-ACCTPASS} call ${EXTEN} ${MYGOO-RINGBACK})
exten => _X.,n,Set(GLOBAL(MYGOO-ISPARK)=1)
exten => _X.,n,Set(PARKINGEXTEN=${MYGOO-CALLPARK})
exten => _X.,n,Park()
exten => _X.,n,Hangup
[GizmoAct2-google-voice]
exten => _X.,1,Wait(5)
exten => _X.,n,Playback(wait-moment)
exten => _X.,n,System(gvoice -e ${OTHERGOO-ACCTNAME} -p ${OTHERGOO-ACCTPASS} call ${EXTEN} ${OTHERGOO-RINGBACK})
exten => _X.,n,Set(GLOBAL(OTHERGOO-ISPARK)=1)
exten => _X.,n,Set(PARKINGEXTEN=${OTHERGOO-CALLPARK})
exten => _X.,n,Park()
exten => _X.,n,Hangup
Once that happens and your original call is parked you should hear the wonderful hold music you configured for your asterisk environment. gvoice has fired, logs into Google Voice and has initiated the call back to your Gizmo DID which immediately comes back into your own PBX. Otherwise, someone has called your Google Voice number and you are receiving the incoming call or you’ve started a call from the web. So we have to figure out what to do with the incoming call. These calls come in via the from-google context.
[from-google]
include => from-internal
exten => GizmoAct1,1,Wait(1)
exten => GizmoAct1,n,Set(GVNUM=${MYGOO-GVNUM})
exten => GizmoAct1,n,NoOp(**CALLERID: ${CALLERID(number)})
; does the call come from our Google voice caller id and is there a parked call
*** line breaks here for blog readability ***
exten => GizmoAct1,n,
GotoIf($[$["${CALLERID(number)}"="${MYGOO-GVNUM}"]
& $["${MYGOO-ISPARK}" = "1"]]?gopark:direct)
*** line breaks here for blog readability ***
exten => GizmoAct1,n(gopark),Set(GLOBAL(MYGOO-ISPARK)=0)
exten => GizmoAct1,n(gopark),ParkedCall(${MYGOO-CALLPARK})
; otherwise it's a direct call.
exten => GizmoAct1,n(direct),Dial(SIP/2222,120,t)
exten => GizmoAct1,n(direct),Goto(GizmoAct1-next-${DIALSTATUS},1)
; first line is unavailable try the next extension
exten => GizmoAct1-next-CHANUNAVAIL,1,Dial(SIP/2222,120,t)
exten => GizmoAct1-next-.,n,NoOp
exten => GizmoAct2,1,Wait(1)
exten => GizmoAct2,n,Set(GVNUM=${OTHERGOO-GVNUM})
exten => GizmoAct2,n,NoOp(**CALLERID: ${CALLERID(number)})
*** line breaks here for blog readability ***
exten => GizmoAct2,n,
GotoIf($[$["${CALLERID(number)}"="${OTHERGOO-GVNUM}"]
& $["${OTHERGOO-ISPARK}" = "1"]]?gopark:direct)
*** line breaks here for blog readability ***
exten => GizmoAct2,n(gopark),Set(GLOBAL(OTHERGOO-ISPARK)=0)
exten => GizmoAct2,n(gopark),ParkedCall(${OTHERGOO-CALLPARK})
exten => GizmoAct2,n(direct),Dial(SIP/1111,120,t)
And there you have it.
Here are full examples of sip.conf and extensions.conf which should pull it all together.
You’ll notice there is a dial plan and extension in there called GizmoAct1-land-google-callback which is an example of dialing a phone number from a SIP extension that rings back to an existing land line outside of your asterisk network. This allows for an existing phone line to be included into your PBX without having to configure it as a zap device. When you read the configuration it should make sense and it works well, dial from SIP line and walk away, rings back to land line which you answer and the call connects, SIP line hangs itself up.
rinse, repeat, serve hot with a double shot of espresso.
Fun was had by one and all at Holden’s 4th Brithday Party this weekend. Thanks to Brian and Andrea for hosting a prehistoric party!
I just wanted to take a moment to wish everyone a Happy New Year! All the best to everyone who might read this and everyone else that I know who won’t. I wish each and every one of you luck and good life in the coming year. It’s destinted to be a doosy but hopfully the world around us will benifit from what’s coming around the corner.
For me there will be another member of our family this year, the first one will start school, work will be more consistantly busy than previous years, which I hope that will prove enough not to have it just disappear all of a sudden, and I’m sure there will be my share of unknown surprises. Here’s to riding my bike more often, working on more personal technological projects to make myself smarter, and having a blast adventuring with my family. Here is a toast to you in what the new year brings to your plate. And here’s a toast to the World, good luck with that one, you’ve got your work cut out for you.
Happy New Year to You! Here comes 2009!
Today was awesome so I had to get outside. And I don’t know what possessed me other than the enjoyment of self imposed pain by extreme physical activity on beautiful days but I ran 4.78 miles. Seriously going to feel this one tomorrow as my 215 (lost 2lbs this week) body isn’t what you would call an ideal runners frame.
Here’s a map of my run. Great access to some fun locations right off campus here at Mentor Graphics. Memorial Park is great for both running and Mountain Biking (when it dries up some more) it’s right down by the river and there is a nice small stand of trees with great trails so it makes you feel like you get out in the forest.
So here’s for more sunny days! And here’s to more 5 mile runs!! DID I MENTION HOW MUCH I HATE RUNNING! But I did it and do it and will probably subject myself to the horror again.
So now I can post videos much faster than before as well. I can upload directly to YouTube from my mobile phone by mms. So it looks like were making things even easier still. I could have probably started doing all of this a little earlier but you know how it goes sometimes. Let’s stay in the current moment and not dwell in the past. Yes, I know most of the time things here are the past even if I’m writing about something happening in the present. By the time anyone reads it it’s in the past.. but that’s nit picking.
So on with the show. Two videos of Lavi (of course). He is definitely the easiest thing for me to document here and you know that’s good for the family!! My vow is to provide something other than Lavi at times just so you don’t get entirely bored.
This first is Lavi’s first experience with trudging through huge mud puddles. I hope this happens again and again for a long time.
And this displays Lavi’s beautiful singing voice…
So there we go. A couple of posts right in a row to get caught up on some Lavi. For those who are interested keep an eye on the right side of this site at the my flickr stream where you’ll see more frequent image updates than might get posted here as blog entries. And now you can check out my YouTube Channel for more video media.
It’s going to be a Sunny weekend here in Portland. Can’t wait to see what kind of trouble we can get into. More time in the forest I hope.
Alright, after a long lame streak for updates of my life and interesting things involved in that life I’ve made some moves to motivate myself to do it and some easier ways to post content. I’m “all up in the tubes” as they say..
Anyway, last Sunday was adventure day for me, Lavi and Nellie. We caught a break in the rain showers and headed into Forest Park for some exploring. We had a great time most of the first part of Leif Erikson Trail is uphill from where we started but Lavi does a great job trudging up and up.
One of the most entertaining and interesting things to see was when I realized that Lavi was following Nellie around and mimicking her own exploration. At one point Nellie went up to a tree and Lavi was hanging back about a foot behind her. She smelled the tree and then moved on and he walked right up to the same tree put his nose to the bark and sniffed. Then he proceeded to move on the exact path Nellie did when she left the tree. I thought that was awesome.
Also, I saw a woodpecker. I heard it off the side of the trail and was able to scan the forest and locate it’s position.. Nice pecker. So lets see how it goes from here shall we…
That about sums it up. I’m freaking tired. Busy days abound but life is cruzing along nicely. Going to have to knock out our taxes this week and the trash needs to go out tonight.
Anyway, hi. Lots of talk amping the neighborhood about outdoor activities. Looks like everyone has the spring fevers!
I still have them. They exists. There will be something interesting here sometime. Really. I mean, I’m not just saying that. I believe it within myself.