Tutorial: How to install the DEVSTATE-mod

Discussion in 'General' started by Stinger81, Nov 24, 2008.

  1. Stinger81

    Oct 30, 2008
    Likes Received:
    Is there a need for a tutorial on how to install the DEVSTATE-mod?
    I have been searching on this forum, and couldn't find any tutorial on this.

    If anyone needs it, I could write it one of these days, as I have successfully installed it on our production server.


    To install the DEVSTATE-mod, you need to recompile Asterisk, even though you are only going to use the DEVSTATE-module.

    1) You need certain packages, install them with "yum install <package>", as far as they aren't yet installed:
    --> make
    --> gcc
    --> subversion

    2) Download the sources. There is only one version of the DEVSTATE-module, but many of Asterisk. Determine your Asterisk version (mine is 1.4.22) and download the sources with:
    --> Asterisk: wget http://downloads.digium.com/pub/asteris ... .22.tar.gz //Change version number according to your version.
    --> DEVSTATE: svn checkout http://svncommunity.digium.com/svn/russ ... state-1.4/

    3) Extract files and put everything in place:
    --> tar xvf asterisk-1.4.22.tar.gz
    --> cp func_devstate-1.4/func_devstate.c asterisk-1.4.22/funcs/
    --> cd asterisk-1.4.22

    4) Compile the sources:
    --> make clean
    --> ./configure
    --> make all

    5) Have a break, have a coffee... B) Now you should be able to find a file called "func_devstate.so" in the funcs directory. If not, than you will have to repeat step 4 and the break, but this time run "make menuselect" before you run "make all". You should be able to find something called "func_devstate" under option 6, dialplan functions. As for me, it automatically compiled for me, so I don't think you'll run into problemns, but just in case.

    6) Copy the module and restart Asterisk:
    --> cp funcs/func_devstate.so /usr/lib/asterisk/modules/
    --> service asterisk restart

    7) Test it:
    --> asterisk -r
    --> core show function DEVSTATE

    8) If you get an error saying that that function is not available, then add the line "USEDEVSTATE=true" to the end of /etc/amportal.conf and restart with:
    --> amportal restart
  2. tom@intersoft.net.au

    Jun 26, 2008
    Likes Received:
    I'd say there's definitely a need for a good how to.

    Or even better, to have it included in elastix 1.4...
  3. Stinger81

    Oct 30, 2008
    Likes Received:
    I don't have anything to say about 1.4, but a howto I can write.
    I'll post it in the OP.
  4. tom@intersoft.net.au

    Jun 26, 2008
    Likes Received:
    Thanks for the great howto, seems a lot easier than I was expecting.

    I was a little concerned about having to recompile asterisk, not having recompiled anything before... but it looks like you're actually compiling a copy of asterisk in a separate folder independant of the installed copy, and then just grabbing the func_devstate.so file out of it and putting it in to the 'installed' copy of asterisk... is that right?

    If so, would that mean that once I do that, I could use that same func_devstate.so file on other exastix installs without having to download, recompile, etc. every time?

    Assuming they're the the same version of asterisk of course.
  5. Stinger81

    Oct 30, 2008
    Likes Received:

    Asterisk has to be compiled in a separate forlder. At least, it's common practice to compile something in a separate folder and, once compiled, move it. So there you are right.

    You might want to be careful when copying the module between multiple boxes, especially when the distros are different. But as we are on the Elastix forum, i may assume that all your boxes are Elastix. Then, having the same version of the distro, it could be safe.
    But if you could spare a few minutes, then you may be happier with recompiling. It isn't that much work and it gives you some satisfaction when you realize you know the procedure by heart. (As I did after compiling the atl1 driver a couple dozen times. ;) )
  6. tom@intersoft.net.au

    Jun 26, 2008
    Likes Received:
    At the line:
    svn checkout http://svncommunity.digium.com/svn/russ ... state-1.4/

    I got an error message saying the folder couldn't be opened, on closer inspection it looks like digium have completely changed the folder structure of the svn system.

    I did find several copies of func_devstate.c, but none were labeled as being for 1.4.

    Does anyone know where I can find the backport?
  7. raj


    Apr 19, 2009
    Likes Received:
    Any clearer instructions? like step by step? i know its quite an old thread but if stinger could provide with step by step guide it would be a of a great help.

    also want to know few more things stating below:

    in our old PBX (Nortel) when a user is already on a call and another one used to call him the phone's display used to show him that person is "on another call" does this DEVSTATE helps bring that feature to Elastix? or its only useful for Day/Night Toggle and DND Toggle? please help as i need this feature so badly.

    Thank you.
  8. Kalama Sutra

    Apr 15, 2009
    Likes Received:
    <<< Moderator's -- I know this is a double posting from " Hardware / Endpoints / Aastra "Visual Message Waiting "
    Just seemed to be buried there for a more general searching.
    It also includes the Loading instructions for the Aastra XML scripts ... other hardware though may have a similar need for the DEVSTATE loading in elastix v 1.6 and lower. It is included within the Beta v. 2.x.x. >>>

    [ Raj - I looked & Stinger81 hasn't been on in over a year ... might not be around anymore - except as a different "user". :dry: Jim ]

    ps. I've set this up in my own text file so I can just grab and go with it as I mess with my test machine << I've also another file for my webmin loading and mondorescue loading ... my fingers always get in the way of typing. :blush:

    Hi All,

    Added some more ... ¿ replace one of my lines below with the reference from dicko ???? maybe not ???? :blink:


    Here's a load of the Aastra XML Script for Elastix , Version 2.2.1
    PDF document Doc. No: PA-001009-05-00

    This is to get DEVSTATE loaded on to my elastix machine as described on page 11 of the document.

    Below was written by : timborino / 6-28-2008 over at

    "Yes, you need to recompile asterisk, or at least just this one module. Sorry it's a little involved for a trixbox server since everything is already installed.
    These are the commands I used to enable it in Trixbox CE VMWare."

    <<< You'll want to make certain you change the asterisk version references to your own version >>>
    <<< anything with triple "<"'s and ">"'s are items I've added for my own functionallity and notes >>>
    <<< done on a Mac Using TextWrangler / copy - pasted thru terminal via ssh >>>

    # yum -y install subversion gcc-c++
    # cd /usr/src
    # wget downloads.digium.com/pub/asterisk/releas...risk-
    # svn checkout svncommunity.digium.com/svn/russell/aste...4/func_devstate-1.4/
    # tar xvfz asterisk-
    # cp func_devstate-1.4/func_devstate.c asterisk-
    # cd asterisk-
    # make clean
    # ./configure
    # make menuselect

    "(func_devstate should be listed under 6. Dialplan Functions)
    press 's' to save changes"
    <<< press ""X"" save & quit / did not see an 's' option >>>

    # make all
    # cp funcs/func_devstate.so /usr/lib/asterisk/modules/
    # service asterisk restart
    # asterisk -r

    <<< below I used the Asterisk CLI from the embeded FreePBX twice rather than from my YourServerName >>>

    <<< YourServerName >>>*CLI> core show function DEVSTATE

    <<< YourServerName >>>*CLI> module show like devstate

    <<< spelling error on page 11 of PA-001009-05-00 >>>

    <<< moving forward to installing the XML script V. 2.2.1 >>>

    " Page 3 -- 2.2 Package installation
    On your Elastix console, logged as root type

    1. cd /tmp

    2. wget

    <<< 2.a. Additional Documentation for items available after this script is run >>>
    <<< www.aastratelecom.com/cps/rde/xchg/SID- ... /35707.htm >>>
    <<< this line is from dicko's reference -- Hardware / Endpoints / Aastra "Visual Message Waiting " >>>

    3. gunzip install-aastra-xml-EL.x.gz

    4. chmod +x install-aastra-xml-EL.x

    5. ./install-aastra-xml-EL.x

    Your screen should look like this for a fresh install ... " <<<see page 3 of the PDF document >>>
  9. Stinger81

    Oct 30, 2008
    Likes Received:
    Still around, but no longer in the Asterisk Business for way over a year.
    Therefore my knowledge about it has about completely drained, so unfortunately I can't be of any halp... :S

Share This Page