Welcome! Log In Create A New Profile

Advanced

Minimum implementation of Asterisk for Google Voice?

Posted by twinclouds 
Re: Minimum implementation of Asterisk for Google Voice?
August 20, 2011 11:25PM
If you have compiled the Asterisk in the first place, e.g., as I shown in here: http://forums.plugpbx.org/index.php/topic,247.0.html, the fix is very easy. You simply edit the chan_gtalk.c file to replace the line
(redirect = iks_find_cdata(traversenodes, "redirect")) &&
with the line
(redirect = iks_find_cdata(traversenodes, "sta:redirect")) &&
and recompile.
twinclouds Wrote:
-------------------------------------------------------
> If you have compiled the Asterisk in the first
> place, e.g., as I shown in here:
> http://forums.plugpbx.org/index.php/topic,247.0.ht
> ml, the fix is very easy. You simply edit the
> chan_gtalk.c file to replace the line
>
> (redirect = iks_find_cdata(traversenodes,
> "redirect")) &&
>
> with the line
>
> (redirect = iks_find_cdata(traversenodes,
> "sta:redirect")) &&
>
> and recompile.

Yes; I followed the link you posted above originally to initially compile and install asterisk.

So, to recompile, is it simply:

# ./configure
# make
# make install

?

Any need to invoke "make clean?"

What directory should I be in when I compile -- the directory that contains the chan_gtalk.c file?

Do I need to save my .conf files before I compile so they are not overwritten, or is that even an issue?

After I followed your "install asterisk" instructions, I followed the "install FreePBX" instructions in the link that you provided. Does the fact that I have FreePBX installed change anything?

Thanks!
Re: Minimum implementation of Asterisk for Google Voice?
August 21, 2011 10:40PM
Brian G. Wrote:
-------------------------------------------------------
> twinclouds Wrote:
> --------------------------------------------------
> -----
> > If you have compiled the Asterisk in the first
> > place, e.g., as I shown in here:
> >
> http://forums.plugpbx.org/index.php/topic,247.0.ht
>
> > ml, the fix is very easy. You simply edit the
> > chan_gtalk.c file to replace the line
> >
> > (redirect = iks_find_cdata(traversenodes,
> > "redirect")) &&
> >
> > with the line
> >
> > (redirect = iks_find_cdata(traversenodes,
> > "sta:redirect")) &&
> >
> > and recompile.
>
> Yes; I followed the link you posted above
> originally to initially compile and install
> asterisk.
>
> So, to recompile, is it simply:
>
> # ./configure
> # make
> # make install
>
> ?
>
> Any need to invoke "make clean?"
>
> What directory should I be in when I compile --
> the directory that contains the chan_gtalk.c
> file?
>
> Do I need to save my .conf files before I compile
> so they are not overwritten, or is that even an
> issue?
>
> After I followed your "install asterisk"
> instructions, I followed the "install FreePBX"
> instructions in the link that you provided. Does
> the fact that I have FreePBX installed change
> anything?
>
> Thanks!

If you kept the original directory (/usr/src/asterisk****), then just go to this directory, edit the file chan_gtalk.c (vi channels/chan_gtalk.c), then, "make" and "make install", that will be enough. No need to do make clean and configure. Certainly, you need to restart asterisk (/etc/init.d/asterisk restart).
Re: Minimum implementation of Asterisk for Google Voice?
August 21, 2011 10:41PM
I compiled it from scratch initially. To make this change, I went to the directory I had initially had compiled asterisk in, and

(1) modified channels/chan_gtalk.c as described above
(2) did a "make"
As root:
(3) /etc/init.d/asterisk stop
(4) make install
(5) /etc/init.d/asterisk start

No need to do another ./configure as it has already been done prior to the initial build.
No need to re-make the changes to files that were made before the initial compile. (The changes should still be there.)
No need to do "make menuconfig" again if it was set up right the first time.

Good luck with it.
If possible for some of you, who successfully re-compiled with "sta:redirect" change, please upload chan_gtalk.so for asterisk 1.8.5.0 so that rest of us can have a quick fix by downloading it, and save the time to re-compile it from scratch.

Thank you very much.
Thanks for the assist and pointers, guys. I'll do the recompile, and if possible try to upload the resulting file as requested above. But someone may beat me to it as I'll be off-line for a spell starting today...
Re: Minimum implementation of Asterisk for Google Voice?
August 22, 2011 09:40AM
dchen4649 Wrote:
-------------------------------------------------------
> If possible for some of you, who successfully
> re-compiled with "sta:redirect" change, please
> upload chan_gtalk.so for asterisk 1.8.5.0 so that
> rest of us can have a quick fix by downloading it,
> and save the time to re-compile it from scratch.
>
> Thank you very much.
Attachments:
open | download - chan_gtalk.so (708.7 KB)
restamp Wrote:
-------------------------------------------------------
> I compiled it from scratch initially. To make
> this change, I went to the directory I had
> initially had compiled asterisk in, and
>
> (1) modified channels/chan_gtalk.c as described
> above
> (2) did a "make"
> As root:
> (3) /etc/init.d/asterisk stop
> (4) make install
> (5) /etc/init.d/asterisk start
>
> No need to do another ./configure as it has
> already been done prior to the initial build.
> No need to re-make the changes to files that were
> made before the initial compile. (The changes
> should still be there.)
> No need to do "make menuconfig" again if it was
> set up right the first time.
>
> Good luck with it.

Thanks! But, no joy. No problem at all with editing the chan_gtalk.c file. The recompile (make) seemed to go off without a hitch, and the installation (make install) similarly appeared to work. I restarted Asterisk, but GV outbound calls didn't work. I then rebooted the Dockstar, but again the GV outbound calls didn't work. Same symptom as before: Calling party hears rings, but called party is not reached. FreePBX system status lights up like a Christmas tree indicating active calls and channels, but nothing ever actually reached the called party.

I'm going to hazard a guess that the fix did not work for me because the version of Asterisk on the Dockstar is the one (1.8.2.3) that was available when I first followed Twinclouds' excellent tutorial back in March. Based on some of what I have read in the PIAF forum, I'm not sure the "sta:" fix works for Asterisk versions 1.8.3 and previous.

Thus, I come hat-in-hand to you gurus for a bit of guidance on how to update Asterisk on my Dockstar to the current level: 1.8.5.whatever. I have never done that before. Prior to the GV meltdown I was in a "if it ain't broke, don't fix it" mindset. Well it still works fine, except for the GV piece.

Do I essentially follow the original Twinclouds directions all over again, pulling down the current Asterisk version into a new subdirectory? My existing, working (except for the GV) system is complete with many tweaks, VM-to-Email mods, etc. Am I essentially starting over; am I required to locate and re install/ re patch everything that I have done over the last 5 months? Can I save my config files? Are there shortcuts? Bah. :)
Re: Minimum implementation of Asterisk for Google Voice?
August 22, 2011 03:25PM
The fix did not work because Google changed the nodename once again -- this time back to what it was originally.

See: https://issues.asterisk.org/jira/browse/ASTERISK-18301

Apparently, the Asterisk folks need a more robust solution, and they are working on it. In the meantime, I've changed the chan_gtalk.c file back to what it was before. If this happens again, I'll hack the file to take this particular argument from the Asterisk environment, which will at least get me back in business with a simple restart, without the need to recompile.

It's unclear if Google is trying to thwart Asterisk users or is just testing some changes. I suspect the it is the latter.
Re: Minimum implementation of Asterisk for Google Voice?
August 22, 2011 03:27PM
Let me try this again. For some reason, my original post is being adjudicated to be spam. I'll keep it short: Google Voice has changed the chan_gtalk.c argument back to what it was before. See:

https://issues.asterisk.org/jira/browse/ASTERISK-18301

So, you'll need to recompile again, until the Asterisk folks find a better workaround.
Amazing.

Well, at least now that I know (thanks to you guys) how to recompile, I simply went back into the "chan_gtalk.c" file, deleted the "sta:" that I had added, recompiled yet again to revert things to where they were, rebooted the Dockstar and restarted Asterisk.

GV outbound is working.

As Ward Mundy put it: "cat and mouse?"
Re: Minimum implementation of Asterisk for Google Voice?
August 23, 2011 09:54PM
Brian G Wrote:
-------------------------------------------------------
> Amazing.
>
> Well, at least now that I know (thanks to you
> guys) how to recompile, I simply went back into
> the "chan_gtalk.c" file, deleted the "sta:" that I
> had added, recompiled yet again to revert things
> to where they were, rebooted the Dockstar and
> restarted Asterisk.
>
> GV outbound is working.
>
> As Ward Mundy put it: "cat and mouse?"

For anyone who recompiled with the new "patch", we need to roll back to the original code now (remove sta: before redirect). The easiest way is to use checkinstall to create a deb file for different versions. I kept the old asterisk*.deb file generated by checkinstall for the original version. After rolling back to the original version using dpkg -i command, GV works again. It is bad for GV doing this. Hope GV not playing this kind of game again.



Edited 1 time(s). Last edit at 08/23/2011 10:11PM by davidnewton.
Hi,

Last week I bought a second Dockstar (first one runs Squeeze OK, thanks to Jeff) which I'd like to dedicate to playing with Asterisk at home, more out of curiosity/education than need...
I know close to nothing about telephony and VOIP and, despite having read lots of pages about Asterisk and Dockstar with Asterisk, I still have no clear picture of the **hardware** setup I would need. The Asterisk site mostly speaks of Digium add-in cards in traditional PC (well, fair enough, that's where they make money too) but that doesn't help with the Dosckstar that is slot-mess and various other sites about Dockstar/Pogopugs/... speak of setting up Asterisk but not of the hardware side.

What I've got today in terms of hardware :
- a modem/router connected to the public switched telephone network wall plug (ADSL RJ11)
- the dockstar connected to the modem/router (ethernet RJ45),
- a DECT phone connected in parallel to the public switched telephone network wall plug (ADSL RJ11)
- a PC (normally switched off, needs to much power) that connects to the Dockstar thru SSH
I'll probably get a couple cheap VOIP phones (like second-hand Cisco CP-524G, Cisco 7911G, Thomson ST2020 or 2030, Siemens A580 IP, ...) at some point in time.

If anyone currently running Asterisk on the Dockstar could give me some hint about required (cheap) hardware setup around the Dockstar and the connections, I would very much appreciate.

BTW, if it makes a difference, I'm in Europe, not in the US.
Re: Minimum implementation of Asterisk for Google Voice?
August 29, 2011 08:45AM
Once you have have asterisk running you need a VOIP handset. This can be software running on your PC, a dedicated hardware VOIP telephone, or an adapter that converts a regular phone for VOIP use.

I have a regular wireless phone (Uniden PowerMax 5.8ghz + several handsets) and use a VOIP adapter (Linksys PAP-2T) that sits between the telephone and the network. The adapter I use supports two lines/handsets but I use only one.

With this set up there is no computer required other than the dockstar to handler the asterisk/GV part.

telephone --> PAP2T --> network switch --> dockstar --> router/firewall --> google/internet

Regards

PG
Peter,

Thanks for your answer. In the diagram telephone --> PAP2T --> network switch --> dockstar --> router/firewall --> google/internet what I don't get (I must be thick) is how to connect theses things together.

For each device, if I mark its connectors like this : (connector in) device name (connector out)

telephone (RJ11) --> (RJ11) PAP2T (RJ45) --> (RJ45) network switch (RJ45) --> (RJ45) dockstar (RJ45) --> (RJ45) router/firewall (RJ11) --> (RJ11) wall plug/internet
Well, there are no 2xRJ45 plugs on the Dockstar so the connections can't be "serial" as in the diagram.

My current setup :
- Wall plug (2xRJ11 in parallel) goes into
--> (RJ11 n°1) analog phone
--> (RJ11 n°2) modem/Router (4xRJ45)

-- modem/Router (4xRJ45)
---> (RJ45 n° 1) -> (RJ45) Dockstar 1
---> (RJ45 n° 2) -> (RJ45) Dockstar 2
---> (RJ45 n° 3) -> (RJ45) IP webcam
---> (RJ45 n° 4) -> (RJ45) hub (16xRJ45)

A soft phone is out as I don't have a keyboard and screen on the Dockstar. I can get second-hand VOIP phones cheaper than a PAP2T so if the VOIP phones can be connected to the switch, I might go this route and leave the analog phone in parallel on the wall plug. Just need to figure how to connect the switch.
Re: Minimum implementation of Asterisk for Google Voice?
August 29, 2011 11:08AM
Data flow is:
telephone --> PAP2T --> network switch --> dockstar --> router/firewall --> google/internet

Connectivity - everything (apart from the telephone) connects to the switch using ethernet...

switch <--RJ45--> PAP2T <--RJ11--> telephone
switch <--RJ45--> Dockstar
switch <--RJ45--> router/firewall <--RJ45--> cable model <--coax--> outside world


I have a separate switch - most people will just use the built-in switch ports on their wireless router

Regards

PG



Edited 1 time(s). Last edit at 08/29/2011 11:08AM by petergunn.
Peter,

Thank you very much, it's now clear for me.
Just bricked Dockstar n°2 so installing asterisk will take longer than planned :-(
I followed this excellent guide and set up my asterisk server. It works great for calling and receiving US calls. But i got busy tone for calling international numbers. Is there any way to make it work? Thanks
Re: Minimum implementation of Asterisk for Google Voice?
September 10, 2011 09:16PM
MD Wrote:
-------------------------------------------------------
> I followed this excellent guide and set up my
> asterisk server. It works great for calling and
> receiving US calls. But i got busy tone for
> calling international numbers. Is there any way to
> make it work? Thanks


This setup can not make international calls unless: you have third-party voip providers (such as voip.ms, callwithus.com etc) paid account, or you have credit in your GV account. GV can make free calls to Canada, not other countries.
Re: Minimum implementation of Asterisk for Google Voice?
September 10, 2011 09:44PM
Please also make sure that the dial plans in the Asterisk and ATA adapter (if you use one) including international dialing rules.
twinclouds Wrote:
-------------------------------------------------------
> Please also make sure that the dial plans in the
> Asterisk and ATA adapter (if you use one)
> including international dialing rules.

Thanks for the reply. I do have the credit in GV. I just do not know how to how to add the dial plans in the asterisk and ATA to include the international dialing rules.
Re: Minimum implementation of Asterisk for Google Voice?
September 11, 2011 12:13AM
For Asterisk, the relevant section of my dial plan in the extensions.conf looks like this:
[talk-numeric-outbound]
exten => _NXXNXXXXXX,1,Set(CALLERID(dnid)=1${CALLERID(dnid)})
exten => _NXXNXXXXXX,n,Goto(1${EXTEN},1)
exten => _1NXXNXXXXXX,1,Dial(Gtalk/gtalk_account/${EXTEN}@voice.google.com)
exten => _+1NXXNXXXXXX,1,Dial(Gtalk/gtalk_account/${EXTEN}@voice.google.com)
exten => _01186X.,1,Dial(Gtalk/gtalk_account/${EXTEN}@voice.google.com)
Note: This dial plan is adapted from Mario's .conf files (http://www.arctangent.net/~superm1/gv_configs/extensions.conf). 01186X. is for dialing telephones in China from US. You may need to change them for your home country and destination countries. You can also use 011X. if you dial from US to multiple countries.

For ATA, add an entry |011x.|, where |'s are the separators between entries, in the dial plan. Again, it is for US dialing. If you need more information about the dial plan for linksys ATAs, you can find here: http://www.jmgtechnology.com.au/spa_3102_guide.pdf.

Well, if we are talking about gtalk, it is from US anyway, I guess.



Edited 1 time(s). Last edit at 09/11/2011 12:15AM by twinclouds.
Thank you so much! It worked after adding a line into the extensions.conf
exten => _011X.,1,Dial(Gtalk/gtalk_account/${EXTEN}@voice.google.com)

I did not do anything in the ATA dialplan. I just used {x+}.

By the way, I wonder how to make the voicemail back on. I hope it can ring for not more than 15 seconds, and then if the phone is not answered, it goes to the voicemail in GV. How to set it up?
Re: Minimum implementation of Asterisk for Google Voice?
September 11, 2011 11:37AM
I am glad it works now. I only use it for dial out so didn't set up the voice mail. Maybe others can help.
I figured out how to bring the GV voicemail back after googling. just change the "Answer(), Wait(2), SendDTMF(1)" code to
exten => yourusername@gmail.com, n, Dial(sip/101, 20, D(:1))

I have another question: how to dial into my asterisk phone using sip instead of GV number? eg. my asterisk user is 1001 and the host server address something.dyndns.org. I tried to dial sip:1001@something.dyndns.org from another sip phone (registered with iptel.org), but it returned with "Declined" error.
Re: Minimum implementation of Asterisk for Google Voice?
September 17, 2011 04:29AM
Can some kind soul cook a deb and post it here :) Merci!

+LT
I wonder if someone can help me get this working. I've got asterisk 1.8 installed on my Asus RT-N16 router using optoware. Asterisk is up and running and I'm able to log into the console. I've copied the .conf files over and updated them per the guide in this thread (changed username and password, etc.). I have a Linksys PAP2T with settings changed from the defaults per the guide. But the problem is that the PAP2 will just not connect. In the Info Screen, the Registration State for both Line 1 and Line 2 says "Can't connect to login server". I have done a lot of searching and I can't seem to figure out where the issue is. Is there some sort of log on the PAP2 or on Asterisk? I'm not sure how to diagnose the problem. Any help would be greatly appreciated.
Re: Minimum implementation of Asterisk for Google Voice?
October 08, 2011 12:49PM
@theminor, have you tried a softphone yet?
Very good suggestion. I tried a softphone and was unable to connect that way as well. This tells me the issue is in my Asterisk and not in my PAP2. Any suggestions as to how to diagnose the problem? Under var/log/asterisk, there are 3 directories, but all are empty. When I start the asterisk console (asterisk -vvvr), it starts up and appears to be running fine, although every so often it displays the following lines:

-- Remote UNIX connection
-- Remote UNIX connection disconnected

I don't know if that means anything. I'm going to try to keep poking around but if anyone has suggestions as to how to diagnose the problem, I'd appreciate it.
Re: Minimum implementation of Asterisk for Google Voice?
October 09, 2011 07:38PM
When you are in asterisk -rvvv and try to use soft phone to log in, do you see any response? Please also try to do one "sip show peers". Is you extension that you try to login listed? If not you should check sip.conf.
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: