1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Asterisk + Google Voice + TomatoUSB, The Easy Way

Discussion in 'Tomato Firmware' started by lancethepants, Jul 27, 2013.

  1. lancethepants

    lancethepants Network Guru Member

    After many past failed attempts, I've finally got a good working asterisk + google voice setup on my router, and I thought I'd share it with you guys.
    This is using the latest version of asterisk, as of writing. Currently the latest tomatoware sports Asterisk 11.7.0

    1. Go to lancethepants.com/files , navigate to the Tomatoware section, and download the latest version.
    I've also uploaded releases on github. They should be much faster.
    https://github.com/lancethepants/tomatoware/releases

    2. Place the compressed file in a clean /opt directory, which should be a USB key setup as if to install optware or entware. Extract the file in /opt.


    We then need to update the configs with your google login information


    3. Edit xmpp.conf with your google username and secret (password).
    Code:
    location:
    /opt/etc/asterisk/xmpp.conf
    


    4. Run 'asterisk' in the cli to start the asterisk.
    Code:
    asterisk
    

    Once you've started asterisk, you can monitor it running using the following code. The 'v's are for more verbosity.
    Code:
    asterisk -rvvv
    


    5. Connect with your choice of sip client or device on your local network.
    Code:
    username: 200
    password: password
    
    Hopefully at this point, you will be able to make and receive calls using your google voice phone numbers. I'm running asterisk on my RT-N16, and it uses 20% cpu when in a call.



    If you want to access your sip server from over the internet. Use the following iptables rules.
    Code:
    Administration -> Scripts -> Firewall
    
    iptables -A  INPUT -p udp --dport 5060 -j ACCEPT
    iptables -A  INPUT -p udp --dport 10000:12000 -j ACCEPT
    


    I've also created the following file.
    Code:
    /opt/etc/config/asterisk.wanup
    
    This SHOULD automatically start asterisk when you start or reboot your router. If not, you can place the previous code in
    Code:
    Administration -> Scripts -> Wan Up
    


    You can edit the sip client password in sip.conf. sip.conf has many options, you may want to adjust nat if your client is behind nat and not on the same network as your router.
    Code:
    location:
    /opt/etc/asterisk/sip.conf
    

    Take care if you want to change the username. Changing the username will require you to make several changes in the following locations.
    Code:
    /opt/etc/asterisk/extensions.conf
    /opt/etc/asterisk/sip.conf
    




    My base for getting this going was using "Tomatoware".
    https://github.com/lancethepants/tomatoware

    Tomatoware is a little project of mine based on the entware toolchain. Tomatoware provides a minimal native compiling environment for tomato firmware supported routers.

    Using Tomatoware, I compiled directly on the router all the necessary asterisk dependencies, and then asterisk itself. Sometimes the ability to compile directly on the router is much more simpler that setting up a cross-compile environment. Plus, many packages need patches to be cross-compiled, and it can be a pain in general.

    Compiling natively on the router will take a great deal longer to achieve. The router's cpu is nowhere close to an x86/x64 computer. Asterisk and its dependencies probably took 8+ hours to compile, but was worth it in the end.

    Tomatoware is a good alternative if you want to compile something not currently available through optware/entware, or to compile the latest version of something, or compile your own code to run on your router.
     
    Last edited: Jan 30, 2014
  2. quihong

    quihong Serious Server Member

    Wow!! Thanks. I need to check out tomatoware!
     
  3. Rich Schmidt

    Rich Schmidt Reformed Router Member

    Awesome work!
    I loaded this after struggling with trying to get it to work on my own for a few hours.

    This worked with the instructions provided on an Asus RT-N16 running Shibby Tomato 112 and a CIsco SPA303.

    One caveat that I haven't had time to look at yet is that the dial tone timeout is ~6 seconds if you don't hit a button to dial after picking up the receiver.

    Incoming and outgoing calls do work via google voice! :)

    Since this is all new to me, I need to figure out a way to get the tftp-hpa and nano packages installed.
    The "ipkg" method won't work for me and I'm not sure if I should install it on top of this, or ask to have a version created with it included. I'd like to use CIsco 7940s as I have 2 of them. Any recommendations in getting tftp-hpa installed are welcome.

    I'm using a Cisco SPA303 at the moment in a test environment.

    Did I say this is awesome!

    Thank you Thank you Thank you.

    RIch
     
  4. lancethepants

    lancethepants Network Guru Member

    Run the following commands 1 by 1 at the command line on your router, to compile and install those two packages. I've test these out already, and should work for you.


    Code:
    mkdir /opt/nano
    cd /opt/nano
    wget http://www.nano-editor.org/dist/v2.2/nano-2.2.6.tar.gz
    tar zxvf nano-2.2.6.tar.gz
    cd nano-2.2.6
    ./configure --prefix=/opt CPPFLAGS="-I/opt/include/ncurses"
    make
    make install
    

    Code:
    mkdir /opt/tftp
    cd /opt/tftp
    wget https://www.kernel.org/pub/software/network/tftp/tftp-hpa/tftp-hpa-5.2.tar.gz
    tar zxvf tftp-hpa-5.2.tar.gz
    cd tftp-hpa-5.2
    ./configure --prefix=/opt
    make
    make install
    
    It is theoretically possible to install entware on top of this.
    (Entware, NOT Optware. Entware is much better anyway.)
    Entware uses the 'opkg' command, NOT 'ipkg'. Optware or 'ipkg' will be totally incompatible with Tomatoware.
    I believe for the most part, most all the libraries should be binary compatible with entware, since they both use the same toolchain, but there's no guarantee.
    Many of the libraries in Tomatoware are newer than Entware.
    I've tried it once before, and everything I installed seemed to work in harmony with Tomatoware. It's probable and likely that not all things will work, and may break each other.

    If however those are the only two packages you need, I highly recommend you just compile them. They do not even take that long to compile.
     
  5. Malakai

    Malakai Serious Server Member

    Nice how-to!

    I have a question thought:

    Shouldn't you change the default port of the sip server to something maybe a little less common?
    I'm interested in opening my sip access to the internet but as I am a little paranoid (I know I am) I would like to restrict the number of open port on my router so I wanted to know if all the range of 10000:12000 should be opened? I was thinking to limit that to something like 10000:10500 and maybe even change that if it's not mandatory to something like 8569:9785.

    And a second thing: What if asterisk crashes during a call or maybe terminates itself with no apparent reason? Shouldn't it be a script that restarts the daemon in case of a crash? I'm using for the moment this script that I call every minute (I know I'm being paranoic again :)) from the scheduler, but maybe there is a better way to do it:

    Code:
    #!/bin/bash
    
    
    PROGRAM=”asterisk”
    
    # varible checks to see if $PROGRAM is running.
    
    APPCHK=$(ps | grep -c $PROGRAM)
    
    #==================================================================
    
    # The ‘if’ statement below checks to see if the process is running
    # with the ‘ps’ command.  If the value is returned as a ’1′ then
    # the process will be safely restarted.
    
    if [ $APPCHK = '1' ];
    
    then
    
    asterisk -vvv
    
    fi
    
    exit
     
  6. rainlake

    rainlake Reformed Router Member

    asterisk's google voice support is very poor. try YATE. it's very stable.
     
  7. Malakai

    Malakai Serious Server Member

    Didn't found YATE in optware, and I don't have the knowledge to install it on the router in another way, but it sounds like a nice piece of sotfware as I've seen that it can have presence SIP IM and even jabber support (IM), something that I miss in Asterisk (don't know if it's possible or maybe I just didn't look enough on the internet).
     
    Last edited: Sep 6, 2013
  8. lancethepants

    lancethepants Network Guru Member

    This is very possible. Yate looks to be an open source project, so it can be compiled to run on the router.
    If you're using the download I provide, you could actually compile yate right on the router, so long as you've already compiled its dependencies also.
    Just make sure to always pass '--prefix=/opt' to 'configure'.

    So far google voice with asterisk has run pretty solid for me. I've got a couple different lines working in tandem. Everyone notes how clear my voice is when using my sip phone.
    I actually used pbxes.org for google voice sip before setting this up myself. They use asterisk, and provided me with solid service for a couple years.
    My biggest issue was figuring out configs, but has been smooth sailing since. I haven't used Yate, but something I may take a look at. Always looking for the next best thing.

    As far as stability goes, I haven't seen ram usage rise above 30MB memory usage for the entire system on my RT-N16. Hasn't crashed so far yet either.
    I use the entware toolchain, which I have found to much more stabily than TomatoUSB's or optware's.

    Edit: Doing some research, it looks like asterisk 10 was the google voice failure. Google Voice worked in 1.8, and also in current builds 11 - 11.5. Skipped a generation. I think I'd prefer to stay with LTS releases anyway.

    FYI, my latest Tomatoware, v0.4 with Asterisk, bumped asterisk to 11.5.1.


    edit:

    Code:
    For yate.
    
    ./configure --prefix=/opt --with-zlib=/opt --with-openssl=/opt CFLAGS="-muclibc"
    make
    make install
    
     
    Last edited: Sep 7, 2013
  9. rainlake

    rainlake Reformed Router Member

  10. Rich Schmidt

    Rich Schmidt Reformed Router Member

    Lance,

    Which tomato build are you using?

    I had this installed on the Shibby build of Tomato and it worked...but...
    In it's default configuration, music on hold crashes asterisk.

    I think it's an issue with missing core sound modules in the tomato build.

    I tried adding them, but have been unsuccessful...

    I'm still trying to figure out what is wrong and why music on hold doesn't work.

    Rich
     
  11. lancethepants

    lancethepants Network Guru Member

    Interesting, I just set up music on hold a week or two ago without any issue.
    I'm actually not that big of an asterisk guru, I only learned just enough to get this to work, but will help where I can.

    I'm using a Toastman's firmware, on an Asus RT-N16. I wouldn't suspect, however, that running Shibby's would be an issue.

    You didn't mention what kind of sound file you tried for this. In the asterisk documentation they heavily recommend using wav files for music on hold. Their reasoning is that they require less cpu power to play, compared to mp3s. I actually don't think that my asterisk compilation will work with mp3s. I beleive the format_mp3.so module is required, which is not included. Wav playback is built into asterisk.

    I only made one change in musiconhold.conf I created a folder for music on hold, and changed the directory to an absolute path.
    Code:
    directory=/opt/etc/asterisk/moh
    
    I then grabbed a music file. Googled how to convert it to wav. It must be mono, and 8000Hz sample rate. Called it moh1.wav, and stuck it in /opt/etc/asterisk/moh.

    I've uploaded my music file to the Tomatoware folder on my site. You can give it a try, and see if it works for you.

    That's my guess to getting things to work. Let me know what you've tried, and if this works for you.

    Edit: Saw your other post. I'm not sure what other issues you could come across since you're running optware's asterisk. Last I looked they use 1.8.x, whereas I'm using 11.5.1.
     
    Last edited: Sep 16, 2013
  12. Rich Schmidt

    Rich Schmidt Reformed Router Member

    Hi Lance,

    I'll give it another try this week.

    I'll keep you posted.

    Rich
     
  13. noyp

    noyp Network Guru Member

    hi lance,
    thanks for this latest version of asterisk, btw can you upload opt.tgz to some file sharing site coz i only got 10KB/s speed direct from your server.

    nevermind i finally got hold of it.

    regards,
     
    Last edited: Sep 21, 2013
  14. devlin016

    devlin016 Addicted to LI Member

    It would be awesome if your could make a tutorial on how to do this from a existing /opt/ directory as some people cant start fresh.
     
  15. kthaddock

    kthaddock Network Guru Member


    nvm
     
  16. lancethepants

    lancethepants Network Guru Member

    I'm not exactly sure what you mean, but I'm guessing you're talking about an existing optware/entware installation.

    The secret sauce of my asterisk setup are my working config files. You may be able extract the configs from my download, and then apply them to optware/entware versions of asterisk. AFAIK, I think both optware and entware use asterisk 1.8, whereas I use the newer 11.5. So I'm not sure if the configs will work directly from mine to theirs, haven't tried it. But is should get you close if not there I would think.

    The configs are located in
    Code:
    /opt/etc/asterisk
    
    Please be more descriptive in your question if I have not answered it.
     
  17. noyp

    noyp Network Guru Member

    i can confirm that this asterisk version 11.5.1 fixes the blind transfer crashing issues presently in entware builds.
     
  18. Malakai

    Malakai Serious Server Member

    I have a working asterisk installation on my router (RT-N16) with one sip internal account and 2 sip numbers (from 2 providers), and I have a little issue (I think that NAT problem).

    When I am connected to my wlan ap and authenticate to asterisk I can call and people can call me without any issue (some echo now and then but nothing too annoying). Then, to have access from Internet (through my wan connection) I have paste in Administration -> Scripts -> Firewall as explained by lancethepants:

    Code:
    iptables -A  INPUT -p udp --dport 5060 -j ACCEPT
    iptables -A  INPUT -p udp --dport 10000:12000 -j ACCEPT
    I can connect and place calls or be called, so everything seems to work. But when I answer (or the other one answers) I can't hear anything, but he/she can hear me. The sound doesn't seem to pass from that person to me, but in the other direction (from me to that person) the sounds pass. What could be the problem? Should I open some other ports?
     
  19. lancethepants

    lancethepants Network Guru Member

    This is what I did before when I paid for sip service, and was behind nat.

    Advanced -> Conntrack/Netfilter -> Tracking / NAT Helpers, and disable Sip.

    On my sip phones, I set them up to use Stun servers. This seemed to work the best for me.

    You may need to mess with sip.conf and use either externip or externhost if you have dynamic ip.
     
  20. noyp

    noyp Network Guru Member

    hi,
    try adding this in your internal sip device config "canreinvite=no" located in sip.conf. works for me when i had a one way audio issues. it is usually a nat issue.

    regards,
    noyp
     
  21. Malakai

    Malakai Serious Server Member

    That worked, thanks! In the sip.conf I added:

    Code:
    qualify=yes
    nat=yes
    externhost=xxx.dyndns.com
    externrefresh=120
    localnet=192.168.1.0/255.255.255.0
     
  22. Jau-Ling Chou

    Jau-Ling Chou Serious Server Member

    Hey Lance,

    Firstly, thank you very much for the packaged turn-key asterisk solution! I ran it on my N66U last night, and was able to get it working. I'm an asterisk n00b though, so now I'm trying to figure out the number parsing exten stuff (like how to allow '+1' dialing from my SIP client).

    I saw you released a v0.5 + asterisk tarball since your first post in this thread. Is it mostly TomatoWare updates, or also tweaks to asterisk?
     
  23. lancethepants

    lancethepants Network Guru Member

    v0.6 currently is the latest. Though not explicitly stated, it does include asterisk. v0.6 does update asterisk to the latest, 11.6.0, no other tweaks to asterisk other than using the latest version. If you do want to update to the latest tomatoware, you can backup the /opt/etc/asterisk folder, and simply copy it back over once you've installed the latest tomatoware.

    You can look at my commits in the git repo for other changes. Sorry I haven't kept a comprehensive changelog anywhere.
    https://github.com/lancethepants/tomatoware
     
    Jau-Ling Chou likes this.
  24. lancethepants

    lancethepants Network Guru Member

    I've released v0.6 of Tomatoware. Along with several minor updates to all packages, this version allows co-existence with optware/entware.

    Since optware/entware mount to /opt, I have two other versions that can either mount to /mmc or /jffs. /mmc seems to be common in all firmwares. While originally created for use with mounted sd cards, since it hardly receives any use I find it the most convenient to mount tomatoware to /mmc. /jffs is also possible, but it CANNOT be used when you have enabled /jffs in the firmware. I use /jffs to mount the unused flash space of the router, so I use /mmc instead.

    If you want to use optware/entware and tomatoware side-by-side, your hard drive needs to have enough partitions, which may require you to re-partition your drive.

    The following link should be helpful to partition your drive while it is connected to your router.

    http://www.linksysinfo.org/index.php?threads/creating-ext3-swap-partitions-on-tomato.48655/
    My current partitions looks like this.

    1. Swap
    2. Tomatoware
    3. Optware

    I like to use the fstab method for mounting disks in the tomatousb link.

    http://tomatousb.org/tut:how-to-set-up-nas-optware-etc-for-total-noobs

    Here is what /etc/fstab looks like for me.

    Code:
    LABEL=SWAP none swap sw 0 0
    LABEL=TOMATOWARE /mmc ext3 rw,noatime 1 1
    LABEL=OPTWARE /opt ext3 rw,noatime 1 1
    
    If you mount to /mmc, copy /mmc/etc/profile to /opt/etc/profile, overwriting entware's For some reason tomato executes /jffs/etc/profile and /opt/etc/profile, but has not been setup to run /mmc/etc/profile. Maybe I can get the devs to change this. The firmware does look at jffs, mmc, and opt for their etc/config for .fire and .wanup files, so I think it would be appropriate to add /mmc to run it's 'profile'
     
    Jau-Ling Chou likes this.
  25. Jau-Ling Chou

    Jau-Ling Chou Serious Server Member

    Wow, I just found out KPN, my mobile provider, is blocking port 5060! Blatant disregard for net neurtality (I'm in the EU).

    Lance, do you have tcpdump in TomatoWare? I couldn't find it in v0.6.
     
  26. lancethepants

    lancethepants Network Guru Member

    I have a static binary available for download here. Probably the easiest way to get it.
    http://lancethepants.com/files

    Using tomatoware, you could also compile it. Tomatoware includes libpcap, a dependency of tcpdump.

    Code:
    mkdir /opt/tcpdump && cd /opt/tcpdump
    wget http://www.tcpdump.org/release/tcpdump-4.4.0.tar.gz
    tar zxvf tcpdump-4.4.0.tar.gz
    cd tcpdump-4.4.0
    ./configure --prefix=/opt
    make
    make install
    
     
    Jau-Ling Chou likes this.
  27. lancethepants

    lancethepants Network Guru Member

    I've just uploaded a new version of Tomatoware, v0.7. This brings asterisk to the latest version, 11.7.0. Also various other package updates for Tomatoware.
    Enjoy :)
     
  28. yujin777

    yujin777 Reformed Router Member

    It would be great if you included chan_dongle and SILK or OPUS codec in to new version of Tomatoware.
    I'm using ASUS-RT-N15U as home GMS2VOIP getaway with 4 Huawei E1550 modems. For good sound quality over 3G network - the best choise is SILK or OPUS codec.
    I should compile chan_dongle and SILK manually, and when im upgrading Tomatoware i should recompile it - its too long....
     
  29. lancethepants

    lancethepants Network Guru Member

    chan_dongle has been added. Give me some feedback on codec_silk when you get a chance.
     
  30. lancethepants

    lancethepants Network Guru Member

    Jau-Ling Chou likes this.
  31. Attila Szabo

    Attila Szabo Reformed Router Member

    I tried it out, but likely because I use /mmc, I got a segmentation fault error. Please could you make it for mmc?
     
  32. lancethepants

    lancethepants Network Guru Member

  33. Attila Szabo

    Attila Szabo Reformed Router Member

    I have used it (mmc.tgz), the problem is not that.
     
  34. Attila Szabo

    Attila Szabo Reformed Router Member

    Which version of chan_dongle did you use at compiling?

    I tried to compile it, but I always get an error at make.

    The error is the following:
    at_response.c: In function 'start_pbx':
    at_response.c:854:16: error: dereferencing pointer to incomplete type
    at_response.c:861:10: error: dereferencing pointer to incomplete type
    at_response.c: In function 'at_response_clcc':
    at_response.c:923:23: error: dereferencing pointer to incomplete type
    Makefile:65: recipe for target 'at_response.o' failed
    make: *** [at_response.o] Error 1

    Could you help me with the compilation?
     
  35. lancethepants

    lancethepants Network Guru Member

    Future releases of Tomatoware will have the asterisk dongle module included, and already exists in git. In the mean time, this is what I ran to compile dongle on the router itself.

    Code:
    cd /mmc
    git clone https://github.com/jstasiak/asterisk-chan-dongle.git
    cd asterisk-chan-dongle
    git checkout asterisk11
    aclocal #(You need to edit aclocal & autom4te to point to correct path to perl)
    autoconf
    automake -a #(You need to edit automake to point to correct path to perl)
    sed -i 's,\/opt\/local,\/mmc,g' ./configure
    ./configure --prefix=/mmc
    make
    make install
    
     
    Last edited: Feb 8, 2014
  36. Attila Szabo

    Attila Szabo Reformed Router Member

    Thanks, I tried, the first error is the following:
    -sh: aclocal: not found

    Where is the "aclocal"? I use your mmc.tgz.
    Second error:
    /mmc/bin/autoconf: exec: line 502: /mmc/bin/autom4te: not found

    It does not find autom4te, where is autom4te?
     
  37. lancethepants

    lancethepants Network Guru Member

    aclocal autom4te and autoconf are all located in /mmc/bin. You need to open them and modify the beginning so they have the correct path to perl. /mmc/bin/perl

    Tomato creates a symlink that works with /opt for perl, but for /mmc we need to edit this. I'll try to have this automatically fixed in future releases.
     
  38. Attila Szabo

    Attila Szabo Reformed Router Member

    Now I used your opt.tgz file, this file was mounted to /opt.
    I tried compile the chan_dongle, but I got another error at make:

    root@tomato:/opt/src/asterisk-chan-dongle# make
    gcc -g -O2 -O6 -I. -D_GNU_SOURCE -I/opt/src/asterisk-11.7.0/include/ -DHAVE_CONFIG_H -fvisibility=hidden -fPIC -Wall -Wextra -MD -MT app.o -MF .app.o.d -MP -o app.o -c app.c
    In file included from app.c:21:0:
    /opt/src/asterisk-11.7.0/include/asterisk/version.h:1:2: error: #error "Do not include 'asterisk/version.h'; use 'asterisk/ast_version.h' instead."
    app.c: In function 'app_status_exec':
    app.c:37:2: warning: missing initializer [-Wmissing-field-initializers]
    app.c:37:2: warning: (near initialization for 'args.resource') [-Wmissing-field-initializers]
    app.c: In function 'app_send_sms_exec':
    app.c:82:2: warning: missing initializer [-Wmissing-field-initializers]
    app.c:82:2: warning: (near initialization for 'args.device') [-Wmissing-field-initializers]
    app.c: In function 'app_register':
    app.c:162:3: warning: passing argument 2 of 'ast_register_application2' from incompatible pointer type [enabled by default]
    /opt/src/asterisk-11.7.0/include/asterisk/module.h:458:5: note: expected 'int (*)(struct ast_channel *, const char *)' but argument is of type 'int (*)(struct ast_channel *, void *)'
    Makefile:65: recipe for target 'app.o' failed
    make: *** [app.o] Error 1

    I downloaded the asterisk source too, and made configure --with-asterisk=/path_to_source/asterisk.h like described in http://wiki.e1550.mobi

    Could you check what the problem is?
     
  39. Attila Szabo

    Attila Szabo Reformed Router Member

    Now I used your chan_dongle-opt.so file, the asterisk has no problem, but the OS (Tomato) does not recognize my USB dongle. What do I need for it? My USB dongle is HUAWEI E169 and theoretically supported.
     
  40. lancethepants

    lancethepants Network Guru Member

    I personally don't use the Chan dongle myself. Maybe someone who does can post and help.
     
  41. ShinichiYao

    ShinichiYao Reformed Router Member

    If I don't re-partition my USB disk, just mount an existing directory on the entware partition to /mmc, Will this work?

    Code:
    mount --bind /opt/tomatoware /mmc
     
    Last edited: Feb 19, 2014
  42. lancethepants

    lancethepants Network Guru Member

    I don't see why that wouldn't work. You may want to script something up, perhaps with .autorun in /opt to automatically mount /mmc once /opt mounts. Kind of weird because /mmc has to wait to mount until /opt would. Let me know if you get that to work. I personally would prefer to partition my drive, maybe this would be a pain for you though, if you have a working setup.
     
  43. ShinichiYao

    ShinichiYao Reformed Router Member

    I can't find /mmc in my Tomato, so I use /jffs instead. It works good for me now.
     
  44. ShinichiYao

    ShinichiYao Reformed Router Member

    And another thing, what's this paragraph doing in extensions.conf?
    Code:
    #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/205&SIP/204,20,D(:1))
    
     
  45. lancethepants

    lancethepants Network Guru Member

    Looks like some left over experimentation when trying to play around with google voice. Callerid experimenting. Will try and remember to move it in the next release to make things more readable.
     
  46. ShinichiYao

    ShinichiYao Reformed Router Member

    Hi Lance,
    I'm using voicemail of Asterisk and I found that the timestamp of the message always at UTC time, even I reconfig the voicemail.conf to set tz to my local timezone. Any ideas what should I do to fix this?
     
  47. lancethepants

    lancethepants Network Guru Member

    Last edited: Feb 27, 2014
  48. ShinichiYao

    ShinichiYao Reformed Router Member

    Thank you for replying me soooo quickly. I'll try this later this night.

    Your Tomatoware is pretty awesome by the way!
     
  49. lancethepants

    lancethepants Network Guru Member

    Thanks! I've glad you've found it helpful.
     
  50. ShinichiYao

    ShinichiYao Reformed Router Member

    My Tomatoware prefix is /jffs, I've tried copy /jffs/etc/zoneinfo/Asia/Shanghai to these locations below
    Code:
    /jffs/etc/localtime/
    /jffs/etc/localtime/Asia/
    /opt/etc/localtime/
    /opt/etc/localtime/Asia/
    But still no luck to make it right.

    My voicemail.conf
    Code:
    [general]
    format=wav
    serveremail=asterisk
    attach=yes
    skipms=3000
    maxsilence=10
    silencethreshold=128
    maxlogins=3
    sendvoicemail=yes
    
    [zonemessages]
    SH=Asia/Shanghai|'vm-received' Q P I 'letters/dot' M
    
    [default]
    6000 => pass,Local,6000@home,,tz=SH
    
     
  51. lancethepants

    lancethepants Network Guru Member

    Sorry, maybe I wasn't clear enough. Essentially you need to copy over your timezone (Shanghai) to /jffs/etc, and then rename it to 'localtime', or symlink '/jffs/etc/localtime' to your correct timezone. Make sure you've wiped out any /jffs/etc/localtime folder or file, then use one of the following

    Code:
    ln -s /jffs/etc/zoneinfo/Asia/Shanghai /jffs/etc/localtime
    
    Code:
    cp /jffs/etc/zoneinfo/Asia/Shanghai /jffs/etc/localtime
    
     
    Last edited: Feb 27, 2014
  52. ShinichiYao

    ShinichiYao Reformed Router Member

    Still record message at UTC time... Anyway, thank you for your help!
     
  53. lancethepants

    lancethepants Network Guru Member

    hmmm, It works for me on incoming and outgoing calls.
    /jffs/var/log/asterisk/cdr-csv/Master.csv
    Can you check to see if incoming and outgoing calls are in the correct timezone?

    It seems as if voicemail may act a little differently with regards to timezones compared to the rest of the system.
    Take a look at the thread below. It sounds like it has to be set on a per extension/mailbox. This could make sense since it's possible people from different timezones can connect to one server.
    When I used to use pbxes.org for google voice, they always sent me the wrong timezone info.
    See if the 2nd post is helpful.
    http://www.freepbx.org/forum/voicemail-timezone-configuration
     
  54. ShinichiYao

    ShinichiYao Reformed Router Member

    Yes, I'v tried that. The timezone of Master.csv is correct (2014-2-28 19:52).
    But voicemail's timezone still UTC (Fri Feb 28 11:52:49 AM UTC 2014).
    Code:
    Tomato-N66*CLI> voicemail show zones
    Zone            Timezone             Message Format
    
    SH              Asia/Shanghai        'vm-received' Q P I 'letters/dot' M
    Timezone of voicemail also shows correct
    Code:
    Tomato-N66*CLI> voicemail show users
    Context    Mbox  User                      Zone       NewMsg
    default    6000  Local                     SH              0
    1 voicemail users configured.
     
  55. lancethepants

    lancethepants Network Guru Member

    Jau-Ling Chou and ShinichiYao like this.
  56. ShinichiYao

    ShinichiYao Reformed Router Member

    Is there any way to reduce the size of tomatoware if I only use asterisk?
     
  57. lancethepants

    lancethepants Network Guru Member

    This post is in response to this question, but is directed to all users of Tomatoware.

    Tomatoware's primary purpose it to create a native compiling environment for routers. I happen to include Asterisk and a handful of other packages because I personally find them useful. Others coincidentally have found that having the latest stable release of Asterisk without removed features also useful. Ironically I think most have found Tomatoware most useful for its inclusion of Asterisk rather than its original intended purpose.

    My first release of Tomatoware with Asterisk in fact was to showcase the capability of Tomatoware. Asterisk in that first release was actually compiled on a router using Tomatoware's compiling capability. I didn't intend to continue releasing Tomatoware with Asterisk, but really just wanted to demonstrate what users could do on their own using this project. I wanted to show that you don't need to be dependent on a package maintainer to provide 'x' for you; you can just compile it yourself using this tool.

    Package Maintainers do a lot, but they have the same 24 hour days we do, and so they can't always get to everyone's requests. Tomatoware serves to be a supplement to what isn't available in a package manager. That's why in my recent versions I've also provided builds that can mount to /mmc and /jffs. I actually use both entware and tomatoware side-by-side to get the best of both worlds. (ie, Compile the latest version of nginx, and use it with entware's php and mysql).

    Asterisk happens to be a fairly large project to compile (though not near the largest I've compiled). It also seems to have several (so far) unfulfilled requests in a package manger (They have a lot they maintain, so you really can't blame them). And like I said, I personally find it useful. For those reasons I have kept it in my project.

    The source is freely available. Feel free to fork it and modify it in any way you see fit.
    https://github.com/lancethepants/tomatoware

    tl;dr
    Yes this is possible, but you'll have to do it yourself.
     
    Last edited: Mar 7, 2014
  58. Jau-Ling Chou

    Jau-Ling Chou Serious Server Member

    Hey Lance,

    This might be slightly off-topic (please point me in the right direction if it is).

    With Google shutting down XMPP on May 15th of this year, are there alternative methods in Asterisk to keep the SIP component working post-shutdown?
     
  59. lancethepants

    lancethepants Network Guru Member


    This thread is dedicated to google voice + asterisk + tomato, so a perfect place for discussion.

    I honestly haven't yet considered what I'm going to do once May 15th arrives. I prefer using my sip phone to my cell phone when I'm home, because the call quality is so clear. Other people have even mentioned how clear I sound when in a call.
    I really liked how xmpp worked too, because you have a direct line to google voice. When I use google voice on my cell phone, it goes through my cell provider (republic wireless, which is also sip based), and then to google voice.
    Post May 15th, I think the only solution if you want to continue to use your google voice number, will be via 3rd party sip provider. You'll probably have to sign up for a voip service, then forward your calls to that phone number.
    Many places will allow you to spoof your google voice for outgoing calls. Incoming calls then would go through google voice + sip provider. Outgoing calls only through sip provider, with spoofed outbound number.

    Before I created Tomatoware, I actually was paying (~$5/month) for a voip service with google voice integration. I figured I'd save some money and have my router take care of it.

    This site had a pretty good article on the subject, and names some places with decent prices.
    http://tech.iprock.com/?p=10372

    I'm sure there's ways to do this totally free, using Ipkall with sipsorcery or something of the likes. It's all very hacky I think, but may work fine.
    It stinks that it won't be as easy or convenient anymore.
    Mostly I think google doesn't like others monetizing and selling services that piggy back on their free stuff. I'd even be willing to pay google for api access, rather than some voip provider, but I think that is highly unlikely.
     
  60. potatoh

    potatoh Network Newbie Member

    HI,lance
    can you add the asterisk-gui into your Project
    in my tomtoUAB @ linksys E4200,I have tried to install your project, but without success,
    Maybe you can make to facilitate the installation of a.Ipk file
    thanks
     
  61. Sigmaz

    Sigmaz Network Newbie Member

    I would be thrilled if you could implement the FreePBX 2.8-9 interface.. I have been trying myself following the cobbled together directions at NSLU2 but the article is so old and not very well detailed.
     
  62. lancethepants

    lancethepants Network Guru Member

    hmmm... looks a bit complicated. Looks like you also need a web server, php, mysql. Using php and nginx from a raf or shibby build could simplify the process a bit, or you can get them from entware.

    Despite what I said a few posts up, I'm thinking of splitting asterisk from tomatoware into it's own project. They really have independent goals. I'll consider giving this a try, probably once I put tomatoware and asterisk under the knife. It would be a guide to set it up, because entware already has the other parts to accomplish this, I wouldn't package those things in whatever I call the future asterisk only project, asteriskware?
     
  63. lancethepants

    lancethepants Network Guru Member

    Comcast was being stupid slow and unresonsive last night, so double posted :(
     
    Last edited: Aug 19, 2014
  64. Sigmaz

    Sigmaz Network Newbie Member

    FYI I am running shibby on my RT-N66U

    I have been administering * on several boxes across the world including a couple of Raspberry-Pi's and the key to easy management has always been the 2nd or third party GUI's. PBXIAF is in my opinion the ultimate payload but FreePBX would definitely be a leap over the old dated Asterisk-GUI that I'm struggling with now.
    I'm not savvy enough to come up with my own solutions but I certainly have enough time to waste trying to implement someone else's.
    I think splitting the project is a fine idea but the value of asterisk on one of these devices would be greatly increased if the administration layer was improved. Add that and an easy to deploy package and you've captured another audience entirely.
    I actually installed Tomato and Tomatoware because of the problems I was experiencing with getting asterisk running on Entware. There were just too many packages to install too many broken dependencies.
    I can't imagine how daunting it must be for someone who's never done it before!
    I'm sure there are plenty who travel down the after market firmware path and see * in the packages list and get excited only to be discouraged by lack luster documentation and daunting configurations.

    I know I'd love to see progress on this field and I know plenty who would be equally pleased.
    keep up the good work.. so far Tomatoware has been a pleasure to work with.

    I actually used it to compile a DAHDI driver for a Sangoma U100 USB FXO port.
    didn't work but it tried like the dickens.
     
  65. lancethepants

    lancethepants Network Guru Member

    Well 3 months since their supposed shut-down, and google voice is still working for me. Maybe it could be shut down any minute, but I'm still enjoying using it for the time being.
     
    Jau-Ling Chou likes this.
  66. Jau-Ling Chou

    Jau-Ling Chou Serious Server Member

    Sweet, thanks for the update!

    I stopped using Asterisk on my RT-N66U (running Shibby) for a while, mainly because I couldnt figure how to get my Android smartphone to connect on wifi (from home or elsewhere) or mobile when I'm on the move. All the setup dox seem to give instructions for one or the other, but not both. Can anyone offer any advice? I've downloaded the latest mipsel-soft-opt.tgz, and I'm stoked to try to get this to work again. I live in Europe, and it would be awesome to be able to keep in contact with my US based contacts for basically free!
     

Share This Page