Linux Guides & Reviews
RSS icon Home icon
  • Yate Server: Free Google Voice Calling

    Posted on June 1st, 2011 admin 17 comments

    This post details how to setup yate as a google voice sip server. Please feel free to post any questions you have in the comments section.

    Installation

    Use one of the respositories, or install from source. Download links are available here.

    Figure out where all of the configuration files are located. They should either be in /etc/yate, or /usr/local/etc/yate, depending on what you installed from. The rest of these instructions will describe the necessary modifications to each specified file.

    regfile.conf

    This file sets the username and password you will use to login using your sip software client, or ATA. Add the following to the end of the file, replacing ‘mysipusername’ with the username you want to use, and ‘mysippassword’ with the password you want to use:

    [mysipusername]
    password=mysippassword

    accfile.conf

    This file contains your gtalk username and password. Add the following to the end of the file, replacing ‘mygvusername’ with your password, and ‘mygvpassword’ with your password.

    [GoogleVoice]
    enabled=yes
    protocol=jabber
    username=mygvusername
    domain=gmail.com
    password=mygvpassword
    options=allowplainauth

    yate.conf

    You need to enable a module for gtalk to work properly.  Add the following to the end of the postload file (so that part of the file should look like the following:

    [postload]
    ; Put a line in this section for each shared library that you want to load
    ;  after all Yate modules
    ; Each line has to be of the form:
    ;   /path/to/the/library.so=boolean
    ; You should specify the full path to the library. Extension is operating
    ;  system specific - usually .so for *NIX systems and .dll for Windows
    ${modulepath}/client/jabberclient${modsuffix}=yes

    yjinglechan.conf

    You need to change the jingle channel so it runs in client mode instead of server mode. Remove the ‘;’ from the beginning of the:

    ;servermode=

    line, and change it to:

    servermode=no

    also uncomment the following two lines and change them to:

    stanza_timeout=10000
    ping_interval=100000

    regexroute.conf

    This file describes how incoming and outgoing calls are handled. We need to route incoming calls (from gtalk / google voice) to our sip phone. Add the following to the end of the ‘[contexts]‘ section to route incoming calls, replacing ‘mysipusername’ with the sipusername you set above in the regfile.conf file:

    ${in_line}GoogleVoice=;called=mysipusername;jingle_version=0;jingle_flags=noping;dtmfmethod=rfc2833

    Next add the following to the ‘[default]‘ section to route outgoing calls through google voice. The first line needs to be right below the ‘[default]‘ section header. This blocks unauthenticated users from making calls:

    ${username}^$=-;error=noauth
    ^\([1-9][0-9][0-9][0-9][0-9][0-9][0-9]\)$=jingle/513\[email protected];line=GoogleVoice;ojingle_version=0;ojingle_flags=noping;redirectcount=5;checkcalled=false;dtmfmethod=rfc2833
    ^\([1-9][0-9][0-9][1-9][0-9][0-9][0-9][0-9][0-9][0-9]\)$=jingle/1\[email protected];line=GoogleVoice;ojingle_version=0;ojingle_flags=noping;redirectcount=5;checkcalled=false;dtmfmethod=rfc2833
    ^\(1[1-9][0-9][0-9][1-9][0-9][0-9][0-9][0-9][0-9][0-9]\)$=jingle/\[email protected];line=GoogleVoice;ojingle_version=0;ojingle_flags=noping;redirectcount=5;checkcalled=false;dtmfmethod=rfc2833
    ^\(+1[1-9][0-9][0-9][1-9][0-9][0-9][0-9][0-9][0-9][0-9]\)$=jingle/\[email protected];line=GoogleVoice;ojingle_version=0;ojingle_flags=noping;redirectcount=5;checkcalled=false;dtmfmethod=rfc2833

    Notes

    I attempted to install from this repository, but yate gave me some error about jabberclient.yate (from /usr/lib/yate/…), so I installed from source.

    edit: I fixed this by compiling, and then copying ~/yate/modules/client/jabberclient.yate to /usr/lib/yate/client/

    All installation options are shown here.

    Updates

    A developer on the Yate mailing list helped me out, and made a script that automatically presses 1 on incoming calls to accept the call.  Here’s how to enable it:

    extmodule.conf

    [scripts]
    postanm_dtmf.php=

    regexroute.conf

    [extra]
    call.answered=10
    
    [call.answered]
    ${peerid}^jingle/=;postanm_dtmf=true;postanm_dtmf_text=1;postanm_dtmf_delay=2

    This script is not included in the newest version of yate (it’s in the trunk version). If you installed from the repositories, install ‘yate-scripts’, and then download the following file: http://voip.null.ro/svn/yate/trunk/share/scripts/postanm_dtmf.php, and save it to ‘/usr/share/yate/scripts’ (or wherever the scripts are located for your system).

    Current Issues:

    I am having some issues getting call working in the newest version of yate (4.0.0 1). Here’s my tracking of the issue, and possible solutions:

    1. Outgoing calls silent ~30% of the time:
      Tried setting “timeout=0″ in yrtpchan.conf, which appears to at least temporarily be working.
    2. Incoming calls not working.
    3. First few seconds of outgoing call audio missed.