Chinese Calligraphy Wood Carving with CNC Machine

Introduction

Woodworking and Electronics/Computer gadgets are my two life-long hobbies.  Recently, I noticed that computer numerical control (CNC) machines for woodworking become quite popular and the low-end CNC machines become affordable for hobby uses.  To explore the possibility, I bought a CNC-3018 by SainSmart from Ebay.  It belongs to the mini CNC category but on the larger end.  The operation surface is about 280mm by 170mm.

Once I received the machine, I tried to figure out about how to use it.  Because my wife started learning Chinese Calligraphy two years ago, I thought it might be an interesting application to carve Chinese calligraphy on wood.

Since I could not find any reference, I have to learn how to do it myself.  After three months, I have generated a few of such carvings as shown in the figure at the end of this blog.  I showed these pieces of my work to a few friends and the people in my wife’s calligraphy study group.  Quite a few people are interested in how I did that.  Some of them are also want to learn how to do that themselves.  I thought that it could be helpful to others if I can put what I learned together for other people, so they can learn from my success and the mistakes that I made during the process.   This blog is a step-by-step guide produce wood carvings of Chinese calligraphy using a CNC machine.

Overall process

The process of generating Chinese calligraphy wood caving involves the following steps:

  1. Digitize the calligraphy to raster (bit-map) form and generate outlines of the calligraphy characters;
  2. Generate the computer code, called g-code, of the outlines to be used by the CNC;
  3. For wood carving with the characters above the wood surface, traditionally called “阳文”, generate the g-code for the CNC to remove the part of the wood surface where are no strikes of the calligraphic characters;
  4. Carve the character outlines onto wood surface using the g-code generated in step 2;
  5. Remove the parts of the wood surface with no characters strikes using the g-code generated from step 3;
  6. Manually clean-up and refine.

These steps are described in the paragraphs below in detail.  The whole process will become clearer.

Step I: Generating bit-map (raster) graphic presentation of calligraphy and pre-processing

Chinese calligraphy characters are commonly written on paper by using brushes.  They can be converted into digital form by taking a photo using a digital camera or by using a scanner.  It is desirable for characters to have clear outlines.  However, usually, due to brush marks, their outlines are not always clean.  Thus, some pre-processing must be done to clean up.  Moreover, if some brush strikes are too thin, it would be difficult to carve them on wood.  Thus, the thin strikes should be made thicker or deleted, as appropriate.  Figure 1 below shows such raster form of a calligraphy.

Figure1

Such generated digital representation of the calligraphy is usually in raster, or bit-map, form.  For further processing, the outlines of the strikes of calligraphic words are extracted.  The open-source software Inkscape can be used to extract such outlines from the calligraphy in bit-map format.  Inkscape can be downloaded online for free.

The procedure of generating the outlines from bit-mapped graphics can be found here.

The drawing of the generated calligraphic character outlines in Inkscape is saved in a DXF (Autocad Drawing eXchange Format) file with extension of .dxf.  The generated .dxf file can be opened with a number drawing programs for further processing.  I use Microsoft Visio for this purpose.

After it is opened by Visio, it should first be ungrouped.  Then, the drawing is scaled to the desired size and is further cleaned up.  Once all of the strikes/characters have clean outlines, in order to define the wood cutting area and for alignment purpose, a rectangular box with line width of ¼ pt is added.  The outline drawing generated from the calligraphy in Figure 1 is shown in Figure 2.

Figure 2

The drawing is then saved in the DXF format.  The resulting .dxf file is used to generate a g-code file, which can be used by the CNC machine to cut the outlines onto the wood board to be used.

The Visio drawing is also saved for create the contours around the calligraphic characters as to be discussed below.

Step II: Generating g-code of the character outlines

The open-source program dfx2gcode is used to convert the .dxf file containing the outlines to g-code.  The conversion process is quite straightforward.  However, there are a few things need to pay attention.

First, the program in its current form, assumes that the measurement unit in the .dxf file is in inch.  Thus, during editing, the measurement unit must also set to be inch, even though the other parameters are defined in millimeters.

Second, it is necessary to set the cutting depth per pass and number of passes and feed rates in Option/Configuration/Machine config submenu.  Since it would be desirable for the outlines cut on the wood as thin as possible, a 20 degree/0.1 mm V Shape CNC bit is used.  As the tip of the bits is quite thin, it is easy to break.  Thus, the cutting parameters need to be set conservatively.  When the cutting depth is set to be 1.2mm, two or three passes, each of which is 0.6 or 0.4 mm are used.  Moreover, the feed speed is set to between 100 to 200 mm/minute.

To start converting, in the file menu, click the item open and open the .dxf file to be converted.  Then in the export menu, do “optimize paths” and “export shapes.”  A file with extension .ngc containing the g-code will be generated after a short time.  The generated .ngc file is going to be used for cutting the calligraphic character outlines as to be discussed later.

Step III Generation of Visio drawing for surface cleaning

For wood carving with the calligraphic characters on top of the wood surface, traditionally called “阳文”, it is necessary remove the part of the wood surfaces, with a depth of about 1 mm (1.2mm in my carvings), where there are no character strikes.  To do so, the first step is to define the contour around these character strikes.

To reduce the CNC carving time, it is desirable to use bits what can take out as much wood surfaces as possible at a time, i.e., using a bit with a larger size.  On the other hand, the bits cannot be too large in order to follow the character contour as close as possible.  To satisfy both considerations, CNC bits with 2mm to 3mm diameter with a “fish tail” tip, which can generate flat wood surface after cutting, can be used.

In this operation, the key step is to generate a contour around the characters.  The CNC bit will first cut the wood along the contour.  The contour should be close to the character outlines but the bit will at most touch the outlines but not cut the wood inside the outlines.  In other words, the distance between the line of the contour and the closest outline should be at close to, but larger than the radius of the CNC bit.

To generate such a contour, we change the line width of the outlines of the Visio file created previously to be slightly larger than the bit diameter.  For example, for a 3mm bit, the line width of the outline can be selected to be equal to or larger than 9 pt.  It is because each pt is equal to 1/72 inch.  9 pt is equal 1/8 inch, i.e., 3.175mm.  To be safe, the line width should be chosen to be slightly lager, e.g., 10 – 11 pt due to the possible inaccuracy of the CNC machine.  However, the rectangular box is remaining with ¼ pt lines.  Such generated Visio file is saved in .jpg form.  Inkscape is used to generate the outline of the bit map in the .jpg file such generated.  This new outline after deleting the irrelevant parts is used as the contour.

During the process, the size of the drawing may change.  In order for the contour to align with the outline generated previously, the rectangular box together with the rest of the contour is scaled to be the same size as the corresponding rectangular box in the outline drawing.

To remove the wood surface outside (and inside in some cases) of the contour, we added parallel line in the area between the contour and the boundary defined by the rectangular box.  The distance between two of adjacent parallel lines should be less than the diameter of the CNC bit.  For example, if we use a 3mm or 1/8 inch bits for clean the area, the distance may be chosen to be equal to 2.5mm.  Such a Visio drawing is shown in Figure 3(a).  Figure 3(b) shows the relative positions/alignment of the outlines and the contours.

Figure 3a

Figure 3b

 

The Visio drawing is saved in DXF format and used to generate the g-code for the surface cleaning.

Step IV Surface cleaning g-code generation

The Visio drawing described above is used to generate the surface cleaning g-code.  The same software: dxf2gcode is used.  The procedure is the same as the generation of the g-code for outline cutting.  However, since the CNC bit used in this case is stronger, the setting can be more aggressive.  For example, in the machine setting section, we can use two passes, each of which is at 0.6mm, for cutting.  The feed speed can be 300mm/min to 400mm/min or even fast.  Single pass cutting of 1.2mm may also be feasible.

Step V Carving onto wood by CNC machine

The g-code generated in Subsection II is first fed to the CNC machine with the V-shape bit installed.  Even though we have very conservative cutting parameters, the operation is usually completed pretty fast.  In most cases, it would be less than one hour.  Then the g-code generated in the Subsection IV is used to cleaning the wood surface after the CNC bit is changed.  Because of the large area involved, the time to perform this operation is usually quite long.  It is likely to take a couple to a few hours.

Step VI Manual cleaning

After CNC operations are completed, it is often necessary to perform fine clean-up manually using carving knifes.  Such clean-ups are mainly in two areas.  First there will some gap between the outline cutting and the contour cutting.  Secondly, because the large diameter of the CNC bit for clean up, some area between the outlines of the strikes may not be taken out during surface clean-up.  However, in most case, this manual task is not very much involved if the CNC machine does its job correctly.  The carved calligraphy using the above procedure is shown below.

20181003_134029

Remarks

The SainSmart 3018 CNC did a good job.  I would expect similar mini CNCs of different brand should behave similarly.  However, I feel any CNC smaller than the 3018 CNC is probably too small for this purpose.

I later bought another CNC machine: the CNC3040.  I feel this one is more convenient because larger surface area.  Moreover, I also feel its precision is better than CNC3018.  However, CNC3040 is about twice as expensive as CNC3018, $450 vs. $200-250, but you get what you paid for.

Among the CNC3018 machines, I feel the CNC3018-Pro is the best based on my testing on its smaller version and other reviews.  It is available online such as from Sainsmart, which is also available on Amazon.  Amazon also carries similar products of other brands.

I tried different wood materials for calligraphy carving.  My favorite is soft maple.  It has fine texture and relatively strong.  As a result, there is not much a problem for thin broken strikes.  In addition, it is somewhat hard but not too hard.

I also tried Poplar and different types of plywood.  Poplar is softer, easier to cut, and usable as long as there are no thin and long strikes.  Among different plywood, my favorite is Baltic Birch plywood.  Similar to the case of poplar, it is usable as long as there are no thin and long strikes.

Below are a few photos of what I did previously using the approach described above.

20180828_132811

zqbx

20181001_180024

 

 

 

 

 

 

How to make and receive calls using Google Voice without XMPP (May 2018 Revision)

Note:  Due to the recent changes in Google Voice implementation, the call back approach may not working reliably.  I am looking into its alternatives and will present them on this blog site.

I.    Introduction

In Spring 2014, I wrote the original blog post “How to make and receive calls using Google Voice without XMPP” as it was likely Google was going to drop XMPP protocol in May 2014.   The post attracted a lot of interest at that time.  It received over 5000 visits.  However, since Google eventually did not abandon XMPP, the blog was not very useful anymore.

Recently, it was announced that Google is going to drop XMPP from Google Voice on June 17, 2018 and it looks more likely to happen this time.  People have started looking into the possibility of using Google Voice without XMPP again [1][2].

Due to the renewed interest, I tried the method described in my previous blog.  It was found that the original approach still works after some necessary updates based on what described in [1].  The difference between my installation and that described in [1] and [2] is that mine is based on plain Debian/Ubuntu while theirs are build on top of Freepbx.  The approach implemented in plain Linux may be less flexible and versatile than the ones based on Freepbx.  However, it should function fine.  Moreover, the description in this revised blog uses a steps-by-step approach, which should be easier to follow if you want to try it out from ground zero.

The platform of my implementation utilizes Linux (Debian/Ubuntu) operating system.  You can use a stand-alone small ARM based box, such as Raspberry Pi or a similar one, or on an online virtual personal server (VPS).  I tried both.  and they all work pretty well.  The ARM box I used is an Orange Pi PC, although the procedure described below should be valid without modification for any similar ARM Debian box.  It also works on a VPS with some minor changes that I will state later.

To keep the implementation effort to be minimal, only the basic system with call-out and incoming call functionalities are implemented.  With some knowledge of Asterisk, the system functionalities can be expanded as much as you like.

Now, let us begin!

II.    The step-by-step guide of setting up an Asterisk PBX with GV callback.

A.    Get a DID number

To make Google Voice work without XMPP, you will need a telephone number to receive calls, i.e. a DID (Direct Inward Dialing) route.   There may be different ways to obtain DID numbers.  However, the most viable solution is to apply a free DID number from CallCentric.com.  What you need to do are as follows:

  1. Register an account on the CallCentric website.  It is straight forward and free.
  2. Once you confirmed on your email and the account is active, you will be assigned a Callcentric number in the form of 1777XXXXXXX.  You can find the number once you login under the Dashboard subtab.   Note: This number is your SIP user name to be denoted as [sipusername] but is different from your Callcentric website login user name.
  3. Under the Receive Calls Tab, request a free phone number by clicking the “get a number” button.
  4. In the left most column, filling the necessary information and click the Lookup button to go to next page.
  5. Select an area code, click “Order Now” button, and continue on next a few steps, an number will be assigned to you.  Once this step is done, you can find the number under Dashboard/DID number section.  Note that all of the DID number have the area codes in the NY state.  However, any of these will work for this purpose with no difference.  We will denote the 10 digit DID number by [didnumber] below.
  6. Click the edit button at the left of the item “Reference/Phone Password (SIP Password)” to specify the SIP Password, denoted as [sippassword] below.

Now you have all the DID information that you need to continue.

B.    Setup Asterisk and preliminary configuration

In your platform, either it be a Debian box or a VPS running Debian or Ubuntu, you need first to install Asterisk.  You can do so by different methods although the easiest way is probably using the Asterisk package come with the Linux distribution.  To install it use this approach, you simply SSH into your Linux box or VPS and do the following under the Linux # prompt:

apt-get update
apt-get upgrade
apt-get install asterisk

After Asterisk is installed, replacing two default Asterisk conf files, sip.conf and extensions.conf in the /etc/asterisk/ directory with the examples of the files given in the appendices.  You will need to insert your own DID and SIP credentials into the proper place inside these two files.  The Asterisk PBX is set as to have three extensions: 201, 202 and 203.  Any SIP phone, which can be a softphone or a hardware ATA (Analog Telephone Adapter) connected with a regular phone, registered with one of the extensions can make or receive calls.  If there are incoming calls to your GV number or the DID number, the SIP phones registered will ring until one of them is picked up.

In the sip.conf file, there is a register statement and a section [DID] related to the DID.  It is necessary to make sure the DID/SIP credentials obtained from CallCentric.com is filled into the proper places in the register statement and the DID section.

Once all these are done, restart the Asterisk by doing a “service asterisk restart” in an SSH terminal connected to the Debian box.  Then, type “asterisk –rvvv” to get to its CLI interface.  Inside the CLI interface, type “sip show registry” and hit return.  It should show you that your SIP service is registered.  You can also do a “sip show peers” to see if the SIP phone is properly registered.

If everything looks normal, you can make a call from another phone to CallCentric’s DID.  Your SIP phone registered to Asterisk should ring and can be picked up to talk to the caller’s phone.

C.    Set up Google Voice (GV) and callback number.

  1. Go to www.gmail.com and create a gmail account with gvusername and gvpassword.
  2.  Once the gmail account is established, go to www.google.com/voice and apply for a new GV number (gvnumber), if you don’t have one already.
  3. In www.google.com/voice webpage click the three vertical dots on the upper left corner and then click Legacy Google Voice.
  4. Click at the gear symbol on the right and select settings.
  5. In the Settings menu, disable call screening in the Calls submenu.  Note that you need enable voicemail in order to have call screening disabled.
  6.  In the Phone submenu click on “add a phone” botton and use the [didnumber] that you got from Callcentric as this number.  Google will try to verify that you have this number.  Request them to call this DID number instead of sending SMS, and you will need to have a SIP phone connected to the Asterisk server as described above to receive the call.  Verify the number with GV.  The DID number [didnumber] is your GV call back number.
  7. Make a call to the assigned gvnumber, your SIP phone connected to Asterisk server should ring and can receive the call.

D.    Install Python and pygooglevoice

Based on the information given in [1], you can do the following to install pygooglevoice under the Linux prompt on the terminal connected to the Debian box:

cd /root
apt-get -y install mercurial
apt-get -y install python-pip
pip install distribute --upgrade
easy_install -U setuptools
easy_install simplejson
wget https://www.dslreports.com/r0/download/2354351~587bc8e1b0f7c34f1e3536cb3a55473a/pygooglevoice.tar.gz
tar xfz /root/pygooglevoice.tar.gz
cd /root/pygooglevoice
python setup.py install
cp /root/pygooglevoice/bin/gvoice /usr/bin/
cd /root

After pygooglevoice is installed, it can used to make a test phone call by entering:

gvoice -b -e [gvusername]@gmail.com -p [gvpassword]call ${EXTEN} +1[didnumber] 1 

Note it is done at the Linux prompt, not the Asterisk CLI.   If successful, you can use the SIP phone connected to the Asterisk server picking up the call.

In a number of cases, I found that the first attempt for making such a call may not work.  It is because GV may determined that the call is from an unknown device and would reject it.   In such cases, you need to first check the security setting of the gmail account used to make sure that login from less secure devices is allowed.  Secondly, using your PC browser to open the link

https://accounts.google.com/DisplayUnlockCaptcha

with the same gmail account logged in, and click the “Continue” button to allow access.

After performing these two steps, you should be able to make phone call using the gvoice command.  However, sometimes, you may need to repeat the second step until you can make the call successfully.

E.    Final Steps

Once the call using pygooglevoice from Debian is successful, you only need to fill [gvusername], [gvpassword] and [didnumber] the proper credentials in the lines of

System(gvoice -b -e [gvusername]@gmail.com -p [gvpassword] call ${EXTEN} +1[didnumber] 1 &)

and

System(gvoice -b -e [gvusername]@gmail.com -p [gvpassword] cancel &)

in file extensions.conf.  Then, you can make a call from the SIP phone connected to the Asterisk server and it should work.

A final note, if you decided to install the Asterisk on an VPS, you need to add two lines:


externhost=[VPS' dynamic IP address]
localnet=[VPS' locanet address (xxx.xxx.xxx.0)]/255.255.255.0

in the [general] section of sip.conf to avoid the one way audio problem.

Good Luck!

III.    Acknowledgements and Disclaimers

First the acknowledgement: I am not a network/software/VOIP person.  All of what I did are based the knowledge that I gained from Googling and exchanging with other more experienced people.  Thus, nothing described in this note is invented by myself.  All the credit should go to the people who proposed this approach and worked out the details, specifically, the authors, commenters and contributors of the references [1,2] of this blog.  What I did is just to make sure all of details that I described are correct and to verify it indeed works.  I would appreciate to have your feedback and comments.  If you have any questions, please let me know also.  I will try to answer them as much as I can.

Now the disclaimer: As stated above, what I did is simply trying the GV callback approach designed and described by others.  It is experimental to say the most.  As we all know, whenever one goes online including performing VOIP activities, there are always security risks.  Thus, if you decide to follow what described in this blog, you should know the risks involved and you will be responsible for whatever action you are taken.  You will be responsible for any consequences of your actions. Another point is that we don’t know what Google is going to do after June 17.  Even though the set-up following the above descriptions works today, there’s no guarantee it will work at that time.  We just have to hope it will.

[1] RonR’s post in “Google Voice XMPP support will go away in June” on DSLReport Forum (https://www.dslreports.com/forum/r31938501-Google-Voice-XMPP-support-will-go-away-in-June).

[2] How to use Google Voice with FreePBX and Asterisk without using XMPP or buying new hardware, TechNotes. (https://tech.iprock.com/?p=21950)

IV.    Appendix

The configure files: sip.conf (source)
[general]
context=phone ; Default context for incoming calls
allowoverlap=no ; Disable overlap dialing support. (Default is yes)
bindport=5060 ; UDP Port to bind to (SIP standard port is 5060)
externrefresh=60
localnet=192.168.1.0/255.255.255.0
udpbindaddr=0.0.0.0; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes ; Enable DNS SRV lookups on outbound calls
canreinvite=no
dtmfmode = rfc2833
tcpenable=no
;directmedia=yes
register = [sipusername]:[sippassword]@callcentric.com:5060/[sipusername]
session-timers=refuse
disallow=all
allow=ulaw
allow=gsm

[201]
defaultuser=201
secret=[secret1]
type=peer
callerid="user1 "
host=dynamic
context=phone
outgoinglimit=1
incominglimit=1
canreinvite=no
nat=force_rport,comedia
qualify=yes

[202]
defaultuser=202
secret=[secret2]
type=peer
callerid="user2 "
host=dynamic
context=phone
outgoinglimit=1
incominglimit=1
canreinvite=no
nat=force_rport,comedia
qualify=yes

[203]
defaultuser=203
secret=[secret3]
type=peer
callerid="user3 "
host=dynamic
context=phone
outgoinglimit=1
incominglimit=1
canreinvite=no
nat=force_rport,comedia
qualify=yes

[DID]
context=sip
defaultuser=[sipusername]
type=peer
secret=[sippassword]
host=callcentric.com
fromdomain=callcentric.com
fromuser=[sipusername]
trustrpid = yes
sendrpid = yes
canreinvite = no
insecure=port,invite
nat=force_rport,comedia

extensions.conf (source)

[general]
static=no
writeprotect=no
autofallthrough=yes
clearglobalvars=yes
priorityjumping=no

[globals]
gtimeout=50 ; timeout value
; initialize
gvuser=10000

[sip]
exten = _[sipusername],1,ExecIf($[${gvuser}!=10000]?Bridge(${gvuser}):Dial(SIP/201&SIP/202&SIP/203,60,D(:1)))
exten = _[sipusername],n, Set(GLOBAL(gvuser)=10000)
exten = _[sipusername], n, Hangup()
[phone]
include = sip
include = gv-outbound
[gv-outbound]
exten = _NXXNXXXXXX,1,GoTo(1${EXTEN},1)
exten = _1NXXNXXXXXX,1,Answer
exten = _1NXXNXXXXXX,n,Set(GLOBAL(gvuser)=${CHANNEL})
exten = _1NXXNXXXXXX,n,System(gvoice -b -e [gvusername]@gmail.com -p [gvpassword] call ${EXTEN} +1[didnumber] 1 &)
exten = _1NXXNXXXXXX,n,Ringing
exten = _1NXXNXXXXXX,n,Wait(30)
exten = _X.,n,Noop(Never received callback from Google Voice on channel ${gvuser} . exiting)
exten = h,1,GotoIf($["${CHANNEL(state)}" = "Ring"]?:bridged)
exten = h,n,Noop(Hangup on channel ${gvuser})
exten = h,n,System(gvoice -b -e [gvusername]@gmail.com -p [gvpassword] cancel &)
exten = h,n, Set(GLOBAL(gvuser)=10000)
exten = h,n,Hangup()
exten = h,n(bridged),Noop(The channel has been bridged successfully)
exten = h,n, Set(GLOBAL(gvuser)=10000)

To be updated: “How to make and receive calls using Google Voice without XMPP”

The original post was published in 2014.  There were a lot of interest at that time.  However, since Google abandoned their original plan and decide to keep XMPP protocol running, this blog became irrelevant and lost interest for the readers.  However, after I came back from my oversea trip, I earned that Google again decided to abandon XMPP on June 15, 2018.

There has been a few new web publications/posts, such as [1], [2], that discuss how to perform such a task.  However, these are mainly based on using FreePBX.  Since my blog was based on plain Asterisk, it may be more suitable to certain readers.  Moreover, as people have been said about the original blog, it was very easy to follow and to setup very quickly.  Thus, I feel it may become of interest again this time and maybe it will be worth to revive it.  However, since then a few things has been changed and an update is necessary.

After checking my original blog post and others’, I found my original solution will still work with some minor modifications.  However, it would be easier to publish the updated version as a new blog rather just state the parts that are changed.  It should be done in a couple of days.  Stay tuned!

[1] RonR’s post in “Google Voice XMPP support will go away in June” on DSLReport Forum (https://www.dslreports.com/forum/r31938501-Google-Voice-XMPP-support-will-go-away-in-June).

[2] How to use Google Voice with FreePBX and Asterisk without using XMPP or buying new hardware, TechNotes. (https://tech.iprock.com/?p=21950)

Set up a Google Voice Telephone Server Based on Asterisk PBX in 15 minutes

Introduction

It has been 3 years since I wrote my previous blog on using Google Voice (GV) without XMPP.  The blog was quite popular.  It was visited by more than 20k users with more than 30k views.  Since then a lot of things has changed.  Google didn’t abandon XMPP.  Thus, the method that I described in the blog is no longer useful.  In addition, the Asterisk PBX implementation has evolved as well.  The long term supported version has migrated from version 1.8 to version 11 and now version 13.  Due these changes, it is actually much easier to set up a GV server than before.  With right hardware and software basic platform in place, it can be done in less than 15 minutes.  I though it might be useful to the interested readers to write another blog at this time.

The Asterisk PBX can be installed on any computer platforms.  Below we assume you are using a Linux box with Debian (Jessie) or Ubuntu (14.04 or later) as the operation system (OS) although any other Linux distributions or Windows OS will also work with some modifications.  As for hardware, it is probably preferable to use a low-power ARM box, such as the popular Raspberry Pi (RPi) box.  My favorite of such a box right now is Orange Pi One (OPiOne).  By using OPiOne, it is possible to build the entire system for less than 20 Dollars.

The step-by-step guide

1. Set up Google Voice (GV)

If you already have signed up for Google Voice, then skip the sub-steps below and go to step 2.

  • Go to www.gmail.com and create a gmail account with gvusername and gvpassword.
  • Once the gmail account is established, go to www.google.com/voice and apply for a new GV number (gvnumber), if you don’t have one already.
  • In www.google.com/voice webpage click at the gear symbol on the upper-right of the page and select settings.
  • In the Settings menu, disable call screening in the Calls submenu
  • In the Phone submenu, make sure Google chat box is checked.

2. Setting up Asterisk

Below, I assume your Linux box runs Debian Jessie or Ubuntu 14.04 or later.

  • SSH into and log on your Linux box, e.g., Raspberry Pi.
  • Do “apt-get update”
  • Do “apt-get install asterisk”

Asterisk 11 will be installed if your Linux box is running Debian Jessie or Ubuntu 14.04.  Under Ubuntu 16.04 or later, Asterisk 13 will be installed.  The configuration files shown below will work in either case.  Note that it will work with less problem if Asterisk or FreePBX has never been installed on this Linux box earlier.

3. Configuring Asterisk

  • For the basic calling, all need to be done is replacing four default Asterisk conf files, xmpp.conf, sip.conf, motif.conf and extensions.conf in the /etc/asterisk/ directory.  The examples of the files are given below.  You can save these example files and copy them into the directory directly or by using a utility such as WinSCP.  You may also open the default files by a text editor such as vim and paste text given to replace the original text.
  • All the changes need to be made in these four files are inserting your GV username and password in the proper fields in xmpp.conf, and modifying the passwords of the extensions in sip.conf.  The rest remains unchanged.
  • This Asterisk PBX is set as to have three extensions: 201, 202 and 203.  Any of your softphones or SIP phones registered with the extensions can make outgoing calls.  If there is an incoming call to your GV number, the phones registered with 201 and 203 will ring until one of them is picked up.  Of course, the settings can be changed and expended.
  • After replacing the original files with these four example files, restart the Asterisk by doing a “service asterisk restart”.  Then do “asterisk –rvvv” to get to the CLI interface.

4. Registering softphone or SIP phone and making a test call

  • Leave the CLI interface open and register your softphone with the Asterisk PBX by entering the ip address of the Linux box as the server ip address (Domain Name), and enter the extension number and its secret in the username and password (or equivalent) fields in the registration page of the softphone or SIP phone
  • On the CLI, type “sip show peers”  You will see the registration of your softphone or SIP phone.
  • Now you are ready to make a call.  The CLI will show you all the activities.  Hopefully, you will be able to make a successful a first call. :-).

Acknowledgements and Disclaimers

First the acknowledgement:

I am not a network/software/VOIP person.  All of what I did are based the knowledge that I gained from Googling and exchanging with other experienced people.  Thus, nothing described in this note is invented by myself.  All the credit should go to the people who proposed this methods and worked out the details.  What I did is just to make sure all of details that I described are correct and to verify it indeed works.  I would appreciate to have your feedback and comments.  If you have any questions, please let me know also.  I will try to answer them as much as I can.

Now the disclaimer:

As stated above, what I did is simply stating that described by others.  It is experimental to say the most.  As we all know, whenever one goes online including performing VOIP activities, there are always security risks.  Thus, if you decide to follow what described in this blog, you should know the risks involved and you will be responsible for whatever action you are taken.  You will be responsible for any consequences of your actions.

Appendix

The configure files:

sip.conf (sip-conf)

[general]
context=home
bindport=5060
callerid=Unknown
notifyringing=yes
notifyhold=yes
tos_sip=cs3
tos_audio=ef
tos_video=af41
alwaysauthreject=yes
disallow=all
allow=ulaw
allow=alaw
allow=gsm
callevents=no
jbenable=no
maxcallbitrate=384
maxexpiry=3600
minexpiry=60
notifyhold=yes
notifyringing=yes
registerattempts=0
registertimeout=20
rtpholdtimeout=300
rtpkeepalive=0
rtptimeout=30
srvlookup=no
t38pt_udptl=no
checkmwi=10
videosupport=no
canreinvite=no
allowguest=yes
defaultexpiry=120
g726nonstandard=no
nat=force_rport,comedia
;externhost=
externrefresh=120
;localnet=192.168.1.0/255.255.255.0

[201]
deny=0.0.0.0/0.0.0.0
secret = secret1 ;Change to you own password
dtmfmode = rfc2833
canreinvite=no
context = home
host = dynamic
trustrpid=yes
sendrpid=no
type = friend
nat=no
qualify=yes
qualifyfreq=60
transport=udp
encryption=no
callgroup=
pickupgroup=
dial=SIP/201
mailbox=201@home
permit=0.0.0.0/0.0.0.0
callerid = User1
callcounter=yes
faxdetect=no

[202]
deny=0.0.0.0/0.0.0.0
secret = secret2   ;change to your own password
dtmfmode = rfc2833
canreinvite=no
context = home
host = dynamic
trustrpid=yes
sendrpid=no
type = friend
nat=no
qualify=yes
qualifyfreq=60
transport=udp
encryption=no
callgroup=
pickupgroup=
dial=SIP/202
mailbox=202@home
permit=0.0.0.0/0.0.0.0
callerid = User2
callcounter=yes
faxdetect=no

[203]
deny=0.0.0.0/0.0.0.0
secret = secret3  ; change to your own password
dtmfmode = rfc2833
canreinvite=no
context = home
host = dynamic
trustrpid=yes
sendrpid=no
type = friend
nat=no
qualify=yes
qualifyfreq=60
transport=udp
encryption=no
callgroup=
pickupgroup=
dial=SIP/203
mailbox=203@home
permit=0.0.0.0/0.0.0.0
callerid = User3
callcounter=yes
faxdetect=no

extensions.conf (extensions-conf)

[general]

static = yes
writeprotect = no
clearglobalvars = yes

[home]
exten => 201,1,Dial(SIP/201,20)
exten => 202,1,Dial(SIP/202,20)
exten => 203,1,Dial(SIP/203,20)
; Other local extensions go here

; These Google Voice outbound calling with no extension prefix
exten => _NXXXXXX,1,Set(CALLERID(dnid)=1xxx${CALLERID(dnid)}) ; replace xxx with your area code

exten => _NXXXXXX,n,Goto(1xxx${EXTEN},1) ; replace xxx with your area code

exten => _NXXNXXXXXX,1,Set(CALLERID(dnid)=1${CALLERID(dnid)})
exten => _NXXNXXXXXX,n,Goto(1${EXTEN},1)
exten => _1NXXNXXXXXX,1,Dial(Motif/google/${EXTEN}@voice.google.com,,r)

[incoming-motif] // This is verbatim from the second link I showed above.
exten => s,1,NoOp()
same => n,Wait(1)
same => n,Set(crazygooglecid=${CALLERID(name)})
same => n,Set(stripcrazysuffix=${CUT(crazygooglecid,@,1)})
same => n,Set(CALLERID(all)=${stripcrazysuffix})
same => n,Dial(SIP/201&SIP/203,20,D(:1))

xmpp.conf (xmpp-conf)

[google]
type=client
serverhost=talk.google.com
username=gvusername@gmail.com ; enter your Google username
secret=gvpassword   ; enter your Google password
priority=25
port=5222
usetls=yes
usesasl=yes
status=available
statusmessage=Asterisk Phone
timeout=5

motif.conf (motif-conf)

[google]
context=incoming-motif
disallow=all
allow=ulaw
connection=google

A Low Cost Debian Platform

To implement Asterisk for GV calls, you need a Linux server to host it.  Recently, I noticed there there is a low cost ARM box on sale on Ebay, that suits very well as a Linux/Debian server.  The cost is only about $11.  The only relatively difficult part is to install Debian on it.  To do so, you need to follow the step by step instructions given in the excellent blog by Qui Hong.  There are a lot of steps but if you follow it carefully, you should succeed.  (However, there is always a possibility to brick the device.  So you have been warned!)

Once you have it set up with Debian working, you will have a home Linux server for less then $15 including the SD card cost.  It will be an excellent platform to run you home PBX or for other purposes.

How to make and receive calls using Google Voice without XMPP – Enhancements

Thanks you all for your interest in my original blog on the GV callback method without XMPP. I am glad that a few people have reported success stories. As long as you follow the steps faithfully, the rate of succeed should be quite high, as have been shown by these people.
However, the original glog has become too long with so many comments. I decided to start another blog on its enhancements as the sequel. In this one I will discuss what needed to use the basic GV callback set-up as fallback for other VOIP services or use other services as its fallback. In addition, I will also show how to handle more than one Callback trunks using different GV numbers.
It should be noted that even though all of the config file changes are tested working, they may not be extensive enough. If you find any issues and/or their solutions, please let me and others know.

I. Using GV callback as the fallback for other VOIP services. Below I use LocalPhone as an example but it should be applicable to other VOIP services with little modifications.
A. Changes in sip.conf:
Add a line in the [general section so it becomes

......
register => sipusername:sippassword@iptel.org:5060/253xxxxxxx
register => LPusername:LPpasswrd@localphone.com/LPusername
......

and add at the end of sip.conf:

[localphone]
type = peer
insecure = very
nat = no
canreinvite = no
authuser = LPusername
username = LPusername
fromuser = LPusername
fromdomain = localphone.com
secret = LPPassword

host = localphone.com
dtmfmode = rfc2833
context = localphone-in ;extensions.conf context for inbound calls
disallow = all
allow = ulaw
allow = alaw

(Note: In most cases, the usernames of LP or other VOIP services are numbers.)

B. Changes in extensions.conf
Add a section of [Localphone-in] before the section of [sip]

......
[localphone-in]
exten => LPusername,1,Dial(SIP/sipphone,60,tr) ; phone must be registered
exten => LPusername,2,Hangup
[sip]
......

Add two lines in the [gv-outbound] section so the relevant part becomes:

......
exten => _NXXNXXXXXX,1,GoTo(1${EXTEN},1)
exten => _1NXXNXXXXXX,1,Answer
same => n,Dial(SIP/${EXTEN}@localphone,30,tr)       ; Added for localphone
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?end) ; Added for localphone
same => n,Set(GLOBAL(gvuser)=${CHANNEL})
same => n,System(gvoice -e gvusername@gmail.com -p gvpassword call ${EXTEN} 1253xxxxxxx 1 &)
same => n,Ringing
same => n,Wait(30)
......

Note: The third and the fourth lines above are new. In addition, the “same => ” context is used for simply the code.

II. Using another VOIP service as the fallback for GV callback. Again LocalPhone is as an example.
Since the GV Callback is handled by the Python script, which is not integrated with Asterisk, Asterisk does not aware if it is successful or not. Thus, we set up time limit for the callback. If no incoming call is received with in the time period, we assume the call is failed and the call is going to the backup voip service. I found that 15 seconds is a good compromise.
A. Changes in sip.conf:
The same as in the first case.

B. Changes in extensions.conf
Add a section of [Localphone-in] before the section of [sip]

......
[localphone-in]
exten => LPusername,1,Dial(SIP/sipphone,60,tr) ; phone must be registered
exten => LPusername,2,Hangup
[sip]
......

Add two lines in the [gv-outbound] section after the line of exten => _1NXXNXXXXXX,n,Wait(30) so the relevant part becomes:

......
exten => _NXXNXXXXXX,1,GoTo(1${EXTEN},1)
exten => _1NXXNXXXXXX,1,Answer
same => n,Set(GLOBAL(gvuser)=${CHANNEL})
same => n,System(gvoice -e gvusername@gmail.com -p gvpassword call ${EXTEN} 1253xxxxxxx 1 &)
same => n,Ringing
same => n,Wait(15)

same => n,Dial(SIP/${EXTEN}@localphone,30,tr)       ; Added for localphone
same => n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?end) ; Added for localphone

......

Note1: The last two lines above are new.
Note2: Even though the above codes works, I am not sure I handled the context line in the [general] section of sip.conf correctly. As the comment shows, it should be the “Default context for incoming calls.” Thus, it is should be “context=sip” and in the extensions.conf file, the [sip] section should include localphone-in. Since it is working fine right now, I just leave it as is.
III. Handle two (or maybe more) GV numbers using the callback apporach in the same Asterisk implementation.

To handled two GV numbers using the call back approach we need to find a way to decide which of the GV number should be used when a call request is received. In my implementation, I use the caller’s extension as the criterion. Assume the extensions from 201 to 220 are implemented. I let a call made by any of the extensions between 201 and 210 to use the first GV number and any of the extensions between 211 and 220 to use the second GV number.
Other criterion may also be used but need to be tested.

A. Changes in sip.conf:
Add a line in the [general section so it becomes

......
register => sipusername:sippassword@iptel.org:5060/253xxxxxxx
register => sipusername1:sippassword1@iptel.org:5060/425xxxxxxx
......

and add at the end of sip.conf:

[DID1]
context=sip
defaultuser=sipusername1
type=peer
secret=sippassword1
host=iptel.org
fromdomain=iptel.org
fromuser=425xxxxxxx
trustrpid = yes
sendrpid = yes
canreinvite = no
insecure=port,invite
nat=yes

B. Changes in extensions.conf
Add two lines in the [sip]

[sip]
exten => _253XXXXXXX,1,ExecIf($[${gvuser}!="abc"}]?Bridge(${gvuser}):Dial(SIP/201&SIP/203,60,D(:1)))
same => n, Set(GLOBAL(gvuser)="abc")
same => n, Hangup()
exten => _425XXXXXXX,1,ExecIf($[${gvuser}!="abc"}]?Bridge(${gvuser}):Dial(SIP/211&SIP/213,60,D(:1)))
same => n, Set(GLOBAL(gvuser)="abc")
same => n, Hangup()

Change the line with “System(gvoice -e gvusername@gmail.com -p gvpassword call ${EXTEN} 1253xxxxxxx 1 &)” so the relevant part becomes:

......
exten => _NXXNXXXXXX,1,GoTo(1${EXTEN},1)
exten => _1NXXNXXXXXX,1,Answer
same => n,Set(GLOBAL(gvuser)=${CHANNEL})
same => n,ExecIf($[${CALLERID(num)}<210}]?System(gvoice -e gvusername@gmail.com -p gvpassword call ${EXTEN} 1253xxxxxxx 1 &):System(gvoice -e gvusername1@gmail.com -p gvpassword1 call ${EXTEN} 425xxxxxxx 1 &))
same => n,Ringing
same => n,Wait(20)
......

Acknowledgement: Some of the approaches are proposed by the reader of my previous blog and by the people on the Broadband-DSLReports/VOIP Tech Chat Forum. The credit for these modifications should go to relevant people

How to make and receive calls using Google Voice without XMPP

I.    Introduction

Around 2010, before Asterisk 1.8 and Gtalk, I did some work to set up calls using Google Voice with callback through a DID channel.  I didn’t touch it for quite some time because gtalk with XMPP works very well.  Since Google is going to drop XMPP protocol in May 2014, people started to looking into the old fashioned way again.  Following approaches described in this blog (http://tech.iprock.com/?p=9784) and others’ comments, especially from those by davidnewt, I did some experiments and the set-up is pretty stable now.  I think it will be worthwhile to share with people have the same interest.  Below, I will describe the steps-by-step implementation of such an approach and what I have learned in the process.

The platform that I prefer most is Dockstar, which is an ARM based box, running Debian.  However, since it is no longer widely available, I repeated the installation process using Raspberry Pi with a version of Debian Wheezy.   The installation process should work without modification on any Linux box running Debian Wheezy and Ubuntu 12.04 or later.  With some minor modification, the process is also applicable to any linux systems.  Generally speaking, the GV callback approach can be run for Asterisk running on any ARM and X86 based systems.

To keep the implementation effort to be minimal, I use only plain Asterisk without GUI.  Only the basic system with call-out and incoming call functionalities are implemented.  With some knowledge of Asterisk, the system functionalities can be expanded as much as you like.

Now, let the fun part begin!

II.    The step-by-step guide of setting up an Asterisk PBX with GV callback.

A.    Set up a DID route

There are different ways to have DID services.  I feel the most available and easiest way to set up a DID is to get a DID number from IPKall (http://phone.ipkall.com/) and point it to your registration of a SIP portel.  Among the SIP portels, I had good experience with IPTel (http://www.iptel.org/) and Linphone (http://www.linphone.org/eng/linphone/register-a-linphone-account.html).  All of them are free.  However, you can use any DID route that you prefer.  What you need to do are as follows:

  1. Register with a SIP portel of your choice.  Below I will use IPTel in the examples.  After registering, you will have a user name [sipusername], and a password [sippassword].  The web address of IPTel is iptel.org.
  2. At the IPKall web page, you can choose an area code, enter sipusername@iptel.org in SIP URI fields, provide a valid email address and choose a password [DIDpassword] for IPKall.
  3.  You will receive an email to inform the DID number assigned to you.  Below I will use 253xxxxxxx as the DID number.
  4. You can test the DID number by using a softphone and enter your SIP Portel registration information [sipusername, sippassword, iptel.org].  (You can use an ATA with a phone attached to it instead of using the softphone as well.)
  5. If the softphone shows you are registered, you can call the DID number from another phone.  If your soft phone rings and you can receive the call, your DID number is ready.

(Note, the IPKall number is free but you have to at least use it once a month.  Otherwise, your number will be taken away.)

B.    Set up Google Voice (GV) and callback number.

If you already have signed up for Google Voice that you want to use, then skip the next steps and go to step 2

  1. Go to www.gmail.com and create a gmail account with gvusername and gvpassword.
  2.  Once the gmail account is established, go to www.google.com/voice and apply for a new GV number (gvnumber), if you don’t have one already.
  3. In www.google.com/voice webpage click at the symbol on the right of the second line and select settings.
  4. In the Settings menu, disable call screening in the Calls submenu
  5.  In the Phone submenu click on “add a phone” and use the [didnumber] that you got from IPKall in step A.3 as the number you want.  Google will try to verify that you have the number so you will need to have a softphone, or ATA, connect to the SIP account that you registered in step A.1.  Verify the number with GV.  The DID number [253xxxxxxx] will be your GV call back number.

C.    Install Asterisk

I use Asterisk 1.8 and Raspberry as an example.  I have tried Asterisk 11 and everything appeared also work but I didn’t test extensively.  Asterisk 1.6 will probably also work but I haven’t tested it.  It should work on any Linux box running Debian Wheezy.  Other Linux distributions should also work but may need some modifications.

  1. SSH into and log on your Raspberry Pi.
  2.  apt-get update
  3. apt-get install asterisk

For Debian Wheezy, Asterisk 1.8 will be automatically installed and that’s it.

D.    Install Python and pygooglevoice

Do the following under the Linux # prompt:

cd /root
apt-get -f install python-setuptools
easy_install simplejson
wget http://pygooglevoice.googlecode.com/files/pygooglevoice-0.5.tar.gz
tar zxvf pygooglevoice-0.5.tar.gz
cd pygooglevoice-0.5
python setup.py install
sed -i 's|https://www.google.com/accounts/ServiceLoginAuth?service=grandcentral|https://accounts.google.com/ServiceLogin?service=grandcentral\&continue=https://www.google.com/voice|' /usr/local/lib/python2.7/dist-packages/googlevoice/settings.py
sed -i 's|      galx.*|      galx = re.search(r\"name=\\"GALX\\" type=\\"hidden\\"\\n *value=\\"(.+)\\"\", content).group(1)|' /usr/local/lib/python2.7/dist-packages/googlevoice/voice.py

Make a test call using Python at Linux prompt (not Asterisk):

# gvoice -e [gvusername@gmail.com] -p [gvpassword] call NXXNXXXXXX 253xxxxxxx 1

where NXXNXXXXXX is any US number.  You need to make sure the softphone or ATA is registered to the SIP account connected to the IPKall DID number and ready to receive the call.  If it rings, the phone at the other end will ring after you picking up the softphone.

E. Configure Asterisk

  1. For the basic calling, all need to be done is replacing two default Asterisk conf files, sip.conf and extensions.conf in the /etc/asterisk/ directory.  The examples of the files are given below.  Of course, you will need to insert your own GV and DID and SIP credentials into the proper place inside these two files.  The Asterisk PBX is set as to have three extensions: 201, 202 and 203.  Any of your softphones or SIP phones registered with the extensions can make outgoing calls.  If there are incoming calls to your GV number or the DID number, the phones registered with 201 and 203 will ring until one of them is picked up.
  2. In the sip.conf file, there is a register statement.  After replacing the original files with these two example files, restart the Asterisk by doing a “/etc/init.d/asterisk restart”.  Then do “asterisk –rvvv” to get to the CLI interface.  Inside the CLI interface, type “sip show registry” and hit the return.  It should show you that your SIP service is registered.
  3. Leave the CLI interface open and register your softphone with the Asterisk PBX and them make a call.  The CLI will show you all these activities.  Hopefully, you will be able to make a successful call after listen to a few seconds of music :-).
  4. In some Asterisk distributions, Music on hold functions may not installed correctly.  If you don’t here music after you dial a number and you really want to, please check the following:
    1. In the musiconhold.conf file, check the directory=… statement in the [default] section.  It is simply “directory=moh”, you may want to change it to “directory=/var/lib/asterisk/moh”.
    2. Look if there are music files in /var/lib/asterisk/moh directory with extensions of .gsm or .wav.  If there’s no files, you can get the files from here, or you can use your favorite music files.

Good luck!

III.    Acknowledgements and Disclaimers

First the acknowledgement:

I am not a network/software/VOIP person.  All of what I did are based the knowledge that I gained from Googling and exchanging with other more experienced people.  Thus, nothing described in this note is invented by myself.  All the credit should go to the people who proposed this approach and worked out the details, specifically, the authors, commenters and contributors of this blog mentioned previously.  What I did is just to make sure all of details that I described are correct and to verify it indeed works.  I would appreciate to have your feedback and comments.  If you have any questions, please let me know also.  I will try to answer them as much as I can.

Now the disclaimer:

As stated above, what I did is simply trying the GV callback approach designed and described by others.  It is experimental to say the most.  As we all know, whenever one goes online including performing VOIP activities, there are always security risks.  Thus, if you decide to follow what described in this blog, you should know the risks involved and you will be responsible for whatever action you are taken.  You will be responsible for any consequences of your actions.

Another point is that we don’t know what Google is going to do after May 15.  Even though the set-up following the above descriptions works today, there’s no guarantee it will work at that time.  We just have to hope it will.

IV.    Appendix

The configure files:

sip.conf (source)

[general]
context=phone                 ; Default context for incoming calls
allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
bindport=5060                  ; UDP Port to bind to (SIP standard port is 5060)
externrefresh=60
localnet=192.168.1.0/255.255.255.0
udpbindaddr=0.0.0.0             ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
canreinvite=no
dtmfmode = rfc2833
tcpenable=no
;directmedia=yes
register => sipusername:sippassword@iptel.org:5060/253xxxxxxx
session-timers=refuse
disallow=all
allow=ulaw
allow=gsm

[201]
defaultuser=201
secret=secret1
type=peer
callerid="user1 "
host=dynamic
context=phone
outgoinglimit=1
incominglimit=1
canreinvite=no
nat=yes
qualify=yes

[202]
defaultuser=202
secret=secret2
type=peer
callerid="user2 "
host=dynamic
context=phone
outgoinglimit=1
incominglimit=1
canreinvite=no
nat=yes
qualify=yes

[203]
defaultuser=203
secret=secret3
type=peer
callerid="user3 "
host=dynamic
context=phone
outgoinglimit=1
incominglimit=1
canreinvite=no
nat=yes
qualify=yes

[DID]
context=sip
defaultuser=sipusername
type=peer
secret=sippassword
host=iptel.org
fromdomain=iptel.org
fromuser=253xxxxxxx
trustrpid = yes
sendrpid = yes
canreinvite = no
insecure=port,invite
nat=yes

extensions.conf (source)

[general]
static=no
writeprotect=no
autofallthrough=yes
clearglobalvars=yes
priorityjumping=no

[globals]
gtimeout=50    ; timeout value
; initialize
gvuser=10000

[sip]
exten => _253xxxxxxx,1,ExecIf($[${gvuser}!=10000]?Bridge(${gvuser}):Dial(SIP/201&SIP/203,60,D(:1)))
exten => _253xxxxxxx,n, Set(GLOBAL(gvuser)=10000)
exten => _253xxxxxxx, n, Hangup()
[phone]
include => sip
include => gv-outbound
[gv-outbound]
exten => _NXXNXXXXXX,1,GoTo(1${EXTEN},1)
exten => _1NXXNXXXXXX,1,Answer
exten => _1NXXNXXXXXX,n,Set(GLOBAL(gvuser)=${CHANNEL})
exten => _1NXXNXXXXXX,n,System(gvoice -e gvusername@gmail.com -p gvpassword call ${EXTEN} 1253xxxxxxx 1 &)
exten => _1NXXNXXXXXX,n,Ringing
exten => _1NXXNXXXXXX,n,Wait(30)
exten => _X.,n,Noop(Never received callback from Google Voice on channel ${gvuser} . exiting)
exten => h,1,GotoIf($["${CHANNEL(state)}" = "Ring"]?:bridged)
exten => h,n,Noop(Hangup on channel ${gvuser})
exten => h,n,System(gvoice -e gvusername@gmail.com -p gvpassword cancel &)
exten => h,n, Set(GLOBAL(gvuser)=10000)
exten => h,n,Hangup()
exten => h,n(bridged),Noop(The channel has been bridged successfully)
exten => h,n, Set(GLOBAL(gvuser)=10000)

Introduction

I established this blog to share some of my hobby interests and experience with everybody who might be interested too.  My main focus to begin with will be in VOIP for home and Gardening.  More subjects may be included later on.  So stay tuned.