找回密码
 注册

QQ登录

只需一步,快速开始

查看: 725|回复: 1

FreeSwitch - Google Voice

[复制链接]
发表于 2011-11-17 10:15:59 | 显示全部楼层 |阅读模式
本帖最后由 Test 于 2011-11-17 10:23 编辑

Contents [[url=]hide[/url]]
Make Free Outgoing Calls to USA/Canada using Google Voice

Google recently launched free voice calling to USA/CANADA phones right from Gmail. Tony opened the doors for this to work from any SIP client, using FreeSWITCH.

NOTE: This was added on Wednesday afternoon, Sept 1. You are best off doing a make current to get your FreeSWITCH install up-to-date.

Get yourself a new Gmail account (or pick an existing one) for use with FreeSWITCH
a) Go to www.gmail.com and Signup
b) Login to Gmail, and agree to try the new calling feature in the chat section (** This only seems to work from US region for now)

Setup FreeSWITCH - Dingaling to work with your Gmail account

Install FreeSWITCH with mod_dingaling enabled and enable it to load at runtime in Modules.conf.xml. Note that GNUTLS is required for this and that builds made available do not support it, so in order to make mod_dingaling work (with GV) you'll need to compile Freeswitch on your own.
In your installation directory, put the following text in your freeswitch/conf/jingle_profiles/client.xml:
  1. <include>
  2.   <profile type="client">
  3.     <param name="name" value="gtalk"/>
  4.     <param name="login" value="GV-ACCOUNT-NAME@gmail.com/talk"/>
  5.     <param name="password" value="MY-PASSWORD"/>
  6.     <param name="server" value="talk.google.com"/>
  7.     <param name="dialplan" value="XML"/>
  8.     <param name="context" value="public"/>
  9.     <param name="message" value="Hello from Freeswitch!"/>
  10.     <param name="rtp-ip" value="${bind_server_ip}"/>
  11.     <param name="ext-rtp-ip" value="${external_rtp_ip}"/>
  12.     <param name="auto-login" value="true"/>
  13.     <!-- SASL "plain" or "md5? -->
  14.     <param name="sasl" value="plain"/>
  15.     <!-- Enable TLS or not -->
  16.     <param name="tls" value="true"/>
  17.     <!-- disable to trade async for more calls -->
  18.     <param name="use-rtp-timer" value="true"/>
  19.     <param name="rtp-timer-name" value="none"/>
  20.     <!-- default extension -->
  21.     <param name="exten" value="2001"/>
  22.     <param name="vad" value="both"/>
  23.     <param name="candidate-acl" value="wan.auto"/>                       
  24.     <param name="local-network-acl" value="localnet.auto"/>
  25.   </profile>
  26. </include>
复制代码



Run your FreeSWITCH and start calling USA & Canada for free - Phone Number Format ( 1XXXXXXXXXX )  

Example dialplan
  1. <extension name="gvoice_out">
  2.    <condition field="destination_number" expression="^50(1\d{10})$">
  3.      <action application="set" data="hangup_after_bridge=true"/>
  4.      <action application="bridge" data="dingaling/gtalk/+$1@voice.google.com"/>
  5.    </condition>
  6. </extension>
复制代码


Note - You will need to match gtalk above with your dingaling profile name.
To support each user in your system Call out using a separate GV account you can do the following, instead:
  1.   <extension name="gvoice_out">
  2.   <condition field="destination_number"  expression="^1(\d{10})$">
  3.     <action application="set" data="hangup_after_bridge=true"/>
  4.     <action application="ring_ready"/>
  5.     <action application="bridge" data="dingaling/gv${user_name}/+1$1@voice.google.com"/>
  6.   </condition>
复制代码


This assumes that you name each of your GV profiles  like so gv1000 where 1000 is the username of a registered in directory user.

Outbound Caller ID
It seems that if you have a Google Voice account already set up then the outbound caller ID is your Google Voice phone number. (It is for me.)
  • If you have a different scenario please document it here.
Update (There is a setting inside GV, you can choose to pass through your GV number or incoming number. For Incoming!)


Problems?

If you have lag or latency on your call of a second or more, try adding this to the jingle profile for that account:
<param name="rtp-timer-name" value="none"/>
(as per http://freeswitch-users.2379917.n2.nabble.com/FIXED-Latency-on-Google-Voice-GTalk-td5741999.html)
or <param name="use-rtp-timer" value="false"/>

And the do a reload mod_dingaling

If you get the following message "We could not complete your call, please try again."   Google has stoppedaccepting calls from you for a bit.
The other thing we have noticed is you won't get ring back on calling some numbers.
One minor issue is sometimes I heard robot-like sounds when dialing direct Google Voice call using FreeSWITCH dingaling channels

http://wiki.freeswitch.org/wiki/Google_Voice


 楼主| 发表于 2011-11-17 10:16:41 | 显示全部楼层

Receiving Calls From Google Voice

本帖最后由 Test 于 2011-11-17 10:30 编辑

Receiving Calls From Google Voice

FreeSWITCH and mod_dingaling now allow you to receive incoming Google Voice calls. You must have a Google Voice account to receive incoming DID calls.
mod_dingaling can also receive calls from Gmail users that click on an available Chat user, followed by the "Voice calling" button, and finally the "Call computer" button.
Follow these steps in FreeSWITCH:
  • Update to latest FreeSWITCH git as of Friday afternoon, September 3, 2010.
  • Modify your jingle profile as follows:
    • Uncomment this line: <param name="candidate-acl" value="wan.auto"/>
    • Edit the lines for dialplan, context, and extension as needed
Log into Google Voice:
  • Click on Settings > Phones
  • Uncheck all phones
  • Check Google Chat
  • Log out of gmail ( Or turn off chat at the bottom of the gmail page)
A sample jingle client file:
  1. <profile type="client">                                            
  2.    <param name="name" value="mercutioviz"/>                                
  3.    <param name="login" value="mercutio.viz@gmail.com/talk"/>                              
  4.    <param name="password" value="foobar"/>                           
  5.    <param name="dialplan" value="XML"/>                           
  6.    <param name="context" value="public"/>                             
  7.    <param name="message" value="Thanks GOOG!"/>               
  8.    <param name="rtp-ip" value="${bind_server_ip}"/>                              
  9.    <param name="auto-login" value="true"/>                          
  10.    <param name="sasl" value="plain"/>                                
  11.    <param name="server" value="talk.google.com"/>                              
  12.    <param name="tls" value="true"/>                                 
  13.    <param name="use-rtp-timer" value="true"/>                       
  14.    <param name="exten" value="1002"/>                              
  15.    <param name="vad" value="both"/>                                 
  16.    <param name="candidate-acl" value="wan.auto"/>                       
  17.    <param name="local-network-acl" value="localnet.auto"/>
  18. </profile>
复制代码

ATTENTION: message param must be set to something - it will be the message shown to folks trying to chat with your account.NOTE: If you are making a copy of "client.xml" be sure to change this line:<param name="name" value="$${xmpp_client_profile}"/>The "name" here is the name of your profile - it is used in the dialstring when making outbound calls.
Make a call to your Google Voice number. Your phone should ring. (The above file is for a phone registered as user 1002.) Answer and talk! If you have call screening turned on then you can do the usual press 1 to accept and press 2 to send to voicemail.
It seems that receiving of calls Fully doesn't work unless you have call screening Enabled, so please enable it.To automatically press 1 to accept, when you pick up your phone you need to change your dialplan.Put the following in your dialplan (same context as the receiving extension):
  1.   <extension name="google_in" continue="true">
  2.      <condition field="caller_id_name" expression="^(Google Voice)$" >
  3.          <action application="log" data="Google Voice Call Incoming" />
  4.          <action application="set" data="execute_on_answer=send_dtmf 1"/>
  5.      </condition>
  6.    </extension>
复制代码

NOTES:
  • You must be logged out of gmail (or turn off chat) to receive calls via FreeSWITCH/dingaling, otherwise GV will send the call to your gmail client
  • You must uncheck all other phones in your forwards to section. (I could not get dingaling to work simultaneously with ringing another phone.)

Test Notes
I tested this configure, it seems that the followings are not working. (internet---FW(openwrt)--FS--sip phone)
1. Normal PSTN--call--GV#--forwarded to Gmail---FS--sip phone, doesn't work.
Another user reports that (1) works even if from time to time it goes to voice mail.
2. Computer(other's gmail account)--Call Phone option---GV#--forwarded go Gmail---FS---sip phone, doesn't work.


What works
1. Computer--call-Gmail-computer--FS--sip phone , works
2. Dial PSTN with Gmail/GV, works.
Also, "external-rtp-ip" with numeric value must be used for incoming call from "Gmail call computer". This setting is not necessary for calling out.
Another user reports that this is working with external-rtp-ip from the normal FS stun process.

See Also
http://wiki.freeswitch.org/wiki/Google_Voice

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|BC Morning Website ( Best Deal Inc. 001 )

GMT-8, 2026-5-28 12:13 , Processed in 0.018767 second(s), 16 queries .

Supported by Weloment Group X3.5

© 2008-2026 Best Deal Online

快速回复 返回顶部 返回列表