Day/Night Button - Grandstream GXP-2000 - Asterisk 1.4 - FreePBX 2.5

I’m trying to configure a BLF to show the stat of the Day/Night function on my GXP2000

we are running Asterisk 1.4 and FreePBX 2.5

the day/night in question is on *280 and the extension that i want to show the “hint” on is 110

i have had a search around and have found some infomation but i just don’t understand what i need to do.

could someone please list a couple of steps to get this configured as i don’t really want to play to much as it is a production system.

Many Thanks

Since you’re running FreePBX 2.5, the hint is already in the dialplan so you don’t need to do anything else to your Asterisk configuration.

All you need to do is go to the “Basic Settings” web page on the GXP-2000, select “Busy Lamp Field” on one of the multi-purpose keys, and put “*280” in the “UserID” field. Now the lamp will glow green in day mode and red in night mode, and you can toggle by simply pressing the button.

Oops; my mistake - I wasn’t thinking. You do have to install the DevState backport into your Asterisk source, since it’s in Asterisk 1.6, not 1.4. Give me a minute and I’ll dig up the instructions for that.

You can download the devstate backport from http://svncommunity.digium.com/view/russell/asterisk-1.4/func_devstate-1.4/. The README.txt file has the instructions, which are basically just to download func_devstate.c into the funcs directory of your Asterisk source, then do “menu makeselect” and build as usual. After that, simply follow the directions in my original response to enable the BLF button on your Grandstream.

Lee

is there anyway to check it all worked

did menuselect, then make and make install

showed that it picked up the new file, and said installation sucessful

reloaded the server (then rebooted to make sure) but core show hints doesn’t show anything new ?

Thanks

[Aug 21 22:22:49] VERBOSE[2464] logger.c: == Registered custom function DEVSTATE
[Aug 21 22:22:49] VERBOSE[2464] logger.c: func_devstate.so => (Gets or sets a device state in the dialplan)
[Aug 21 22:22:49] VERBOSE[2464] logger.c: == Registered application ‘MacroExit’
[Aug 21 22:22:49] VERBOSE[2464] logger.c: == Registered application ‘MacroIf’
[Aug 21 22:22:49] VERBOSE[2464] logger.c: == Registered application ‘MacroExclusive’
[Aug 21 22:22:49] VERBOSE[2464] logger.c: == Registered application ‘Macro’

My fault again. I did this a few weeks ago myself, and have obviously forgotten all the steps I went through.

You need to add the following line to /etc/amportal.conf:

USEDEVSTATE=true

That should enable the new hints in FreePBX.

By the way, you can find several threads that discuss this by searching on “devstate” on the freepbx.org web site. That’s what I did to get it working when I upgraded.

any other pointers at all,

I have added the line, and searched around,

SHOW FUNCTION DEVSTATE shows its loaded

but the hints aren’t being created, i’ve found details on how to create them manually, but as there supposed to be created automatically i’m obviously missing something

Thanks again

just after i wrote the message above, i made an adjustment to the day / night in question.

moment i did that and reloaded everything got created, i think it was either because i wasn’t reloading from the freepbx interface (just doing reload from the asterisk cli) or that a change had to be made (even just a name) just to poke it into action.

so for anybody else using 2.5 with asterisk 1.4 the stages are

  1. download func_devstat (website above)
  2. copy it to /usr/src/asterisk/funcs
  3. cd /usr/src/asterisk
  4. make menuselect
  5. make all
  6. make install
  7. asterisk -r
  8. reload
  9. exit
  10. nano /etc/amportal.conf
  11. add USEDEVSTATE=true to the end
  12. reload from within the freepbx interface

thanks for all the help

I have a trixbox and there is no /usr/src/asterisk directory. I’m sure this is a question showing some linux igorance, but how do I get the source code installed and do this?

Socs28, You need to download the source from the trixbox repo’s. But re-compiling asterisk is also possibly the fastest way to break a trixbox build.

Actually, I found out that it is already loaded in the latest versions of Trixbox, thanks for the help.

First of all clear walktrough, trough i’m a freepbx/asterisk newbie. It was all very clear. Only i’m having trouble putting this all together in a dial plan. My goal is to see if the reception is in day/night mode on my grandstream 2000.

I’ve got devstat working in DND mode but i don’t know how to implement this in day/night reception.

the day/night in question is on *281 and the extension that i want to show the “hint” on is 306

[app-daynight-toggle]
include => app-daynight-toggle-custom
exten => *281,1,Answer
exten => *281,n,Wait(1)
exten => *281,n,Set(INDEX=1)
exten => *281,n,Goto(app-daynight-toggle,s,1)
exten => s,1,Set(DAYNIGHTMODE=${DB(DAYNIGHT/C${INDEX})})
exten => s,n,GotoIf($["${DAYNIGHTMODE}" = “NIGHT”]?day:night)
exten => s,n(day),Set(DB(DAYNIGHT/C${INDEX})=DAY)
exten => s,n,Playback(beep&silence/1&day&reception&digits/${INDEX}&enabled)
exten => s,n,Hangup
exten => s,n(night),Set(DB(DAYNIGHT/C${INDEX})=NIGHT)
exten => s,n,Playback(beep&silence/1&beep&silence/1&day&reception&digits/${INDEX}&disabled)
exten => s,n,Hangup

; end of [app-daynight-toggle]

sorry for my bad english.
biosdino