support

BLF and DND

hhmcpas
Posts: 24
Member Since:
2008-03-24

Is there any way for the BLF on an Aastra 57i to indicate that a user is on DND? The receptionist would really benefit from being able to see if a user is on DND before transferring a call to them.



aastra2
Posts: 309
Member Since:
2006-10-05
Not if you are using the

Not if you are using the built in phone's DND functionality, as the trixbox server doesn't know that you've enabled DND.

--

----
Gareth

Firmware 2.4.0 released.
Download it from www.aastratelecom.com



hhmcpas
Posts: 24
Member Since:
2008-03-24
DND and BLF

I am using the XML Scripts by Aastra for Trixbox CE. They set the DND feature at the PBX level I assume. Should I see the BLF light change for a user that is on DND?



ethans
Posts: 426
Member Since:
2007-01-16
You could add a DND button

You could add a DND button for the other user as dnd.php?user=[extension]&key=[key].

You then need to do some custom development in the sync.php script to allow for multiple users. You could then do something like set the action uri poll to sync.php?action=check&user=$$SIPUSERNAME$$&user2=[extension]

It's not cut and dry, but it's possible.

--

Ethan Schroeder - ethan d.o.t schroeder a.t schmoozecom d.o.t com
Comprehensive bounty list | Blog



aspegic500mg
Posts: 28
Member Since:
2008-02-09
I think hhmcpas wants to see

I think hhmcpas wants to see on his phone's DEL, if the DND is active on the monitored phones.

I need the same possibility ^^

On Asterisk 1.4 branch, we can't "set" a hint.
On Asterisk 1.6 branch, I think we can set a hint in the dialplan.



hhmcpas
Posts: 24
Member Since:
2008-03-24
BLF and DND

So, I have one of the expansion modules for the 57i and I have loaded it up with BLF buttons. I want our receptionist to be able to see if someone has placed themselves in DND either by flashing their BLF light or even putting the extension "Off Hook". I want a single visual indication for our receptionist that the user is on the phone, in DND or availible. So far the BLF button/light does on hook, off hook but does not indicate DND. So, by editing the DND and Sync applications I can make this happen, correct? I am not trying to be rude, i just want to make sure I understand.



schmooze
Posts: 209
Member Since:
2007-02-17
you should ping philippe on

you should ping philippe on this? I talked to him a few months ago about this and he was going to make this work for Asterisk 1.4 systems but since we are still on 1.2 it would do me no good.



hhmcpas
Posts: 24
Member Since:
2008-03-24
I am using 1.4 but I don't

I am using 1.4 but I don't believe I know how to get in touch with Philippe.



philippel
Posts: 687
Member Since:
2006-05-31
This would require: 1.

This would require:

1. Asterisk to be patched with a back ported version of func_devstate.c which comes from 1.6 but is available for 1.4.
2. modifications to the DND module to set the devstate
3. modifications to the hints that get generated for an extension today, or a new hint to be created, to include the custom DND devstate status.
4. modifications to the Asterisk startup process to trigger something that will initialize the state of each phone upon Asterisk starting up since this is not retained.
5. writing the script or dialplan that will do (4) above

I think that is it. Then anyone subscribing to the BLF of what you generate above will get a response everytime DND is pressed for a phone.

--

Philippe Lindheimer, FreePBX® Project Leader
http://freepbx.org - #freepbx on irc.freenode.net
http://freepbx.org/forums - The FreePBX® Forum
OTTS Training - Jan 20-23, Digium's HQ



timborino
Posts: 9
Member Since:
2008-02-05
I tried this using devstate

I tried this using devstate and custom device hints in 1.4, but for a user to view his own DND status on his phone. It should also work on a sidecar, but it would require a separate BLF key for just the DND status. On the fancier AAstra sidecar with the LCD, you could setup another page just to monitor users' DND, but the receptionist would still have to check both places.

http://www.trixbox.org/forums/vendor-specific-unmoderated/grandst...

I don't think there's a way to create a single combined BLF key for the regular device status + DND since DEVSTATE() only works on custom devices.

philippel - I noticed CLI> 'show hints' kept the same device states after I stopped and restarted asterisk. It looks like custom device states are stored in the astdb.



timborino
Posts: 9
Member Since:
2008-02-05
Actually, I suppose you

Actually, I suppose you could try a hint with both devices.

exten => 101,hint,SIP/101&Custom:dnd101



philippel
Posts: 687
Member Since:
2006-05-31
timborino, yes you would

timborino,
yes you would combine the hints to get a single button and in fact you can write some pretty fancy dialplan to make that same button do several things in addition to blf, dnd status and speedial. As far as retaining the dev state value for the custom hint, my testing shows that it is not retained upon a restart.

--

Philippe Lindheimer, FreePBX® Project Leader
http://freepbx.org - #freepbx on irc.freenode.net
http://freepbx.org/forums - The FreePBX® Forum
OTTS Training - Jan 20-23, Digium's HQ



schmooze
Posts: 209
Member Since:
2007-02-17
Well as I have learned along

Well as I have learned along time ago to get a project started someone has to offer up some money. I feel this is an important feature and Schmooze will put up $250.00 to get things started. Lets all rally behind here and see if we can get enough money raised to get this project done.

Philippe can you give us an idea on what it would cost to have all the completed?



philippel
Posts: 687
Member Since:
2006-05-31
Maybe something around $1100

Maybe something around $1100 or so?

--

Philippe Lindheimer, FreePBX® Project Leader
http://freepbx.org - #freepbx on irc.freenode.net
http://freepbx.org/forums - The FreePBX® Forum
OTTS Training - Jan 20-23, Digium's HQ



philippel
Posts: 687
Member Since:
2006-05-31
timborino, further testing

timborino,
further testing indicates you are correct and the device states are kept in astdb. The system I was testing on was 1.4.19 and it shows the state as unavailable after restart even though the devices that subscribe to it are getting the proper state. So that would mean 4 and 5 above are not needed and thus there should be a bit less work involved in doing this.

--

Philippe Lindheimer, FreePBX® Project Leader
http://freepbx.org - #freepbx on irc.freenode.net
http://freepbx.org/forums - The FreePBX® Forum
OTTS Training - Jan 20-23, Digium's HQ



hhmcpas
Posts: 24
Member Since:
2008-03-24
So, does this mean that I

So, does this mean that I can use a similar solution to the one posted in the following link? If so, how would you modify this solution to fit this situation?

http://www.trixbox.org/forums/vendor-specific-unmoderated/grandst...

Obviously, this is my first trixbox implementation and am still somewhat ignorant to the inner workings of Asterisk. I am impressed with the responses I have so far. Thanks very much for the help.



SkykingOH
Posts: 3637
Member Since:
2007-12-17
hhm- wrote: I am impressed
hhm- wrote:
I am impressed with the responses I have so far. Thanks very much for the help.

I have not had anything to contribute however I have been watching the thread with interest.

This is a great community and when someone like yourself jumps in and starts figuring out how things work and trying new applications it is a pleasure to help with the process.

Best of luck to you on your application.

Scott

--

Scott

aka "Skyking"



mstroven
Posts: 12
Member Since:
2007-12-23
Just received a request for this feature.

Has anyone made further progress with this feature?



SkykingOH
Posts: 3637
Member Since:
2007-12-17
Take a look at the FreePBX

Take a look at the FreePBX 2.5 beta, I think the functionality you want is there.

--

Scott

aka "Skyking"



hhmcpas
Posts: 24
Member Since:
2008-03-24
YEA!

I just saw this today! I can't wait to try it out. I know our front desk will be glad!



hhmcpas
Posts: 24
Member Since:
2008-03-24
Trixbox + FreePBX 2.5 Beta

Is the func_Devstate module already included when I perform the Trixbox upgrade instructions per the freePBX site or is this a module that I have to compile? I used the Trixbox upgrade tool but I am not really sure if the devstate module is working. Here's what I have done to test using Trixbox 2.6.1 and FreePBX 2.5 beta installed with the upgrade tool.

I have 2 extensions setup 100 and 104.

100 has a BLF button for 104. I put 104 on DND and the BLF light doesn't change. I did the USEDEVSTATE=true in the /etc/amportal.conf and reloaded asterisk.

Am I missing a step possibly?

Thanks again!



philippel
Posts: 687
Member Since:
2006-05-31
The trixbox guys could

The trixbox guys could probably tell you better, but from the CLI type:

show function DEVSTATE

and

module show like devstate

do you see it? If so, it should be installed (for the latter, you would see func_devstate.so). If not, you may have to get it from source or talk to the trixbox team to see if they have an option to get it. It is not officially part of 1.4, but is a widely used and tested module that poses no issues or risk to include in 1.4, to the best of my knowledge.

--

Philippe Lindheimer, FreePBX® Project Leader
http://freepbx.org - #freepbx on irc.freenode.net
http://freepbx.org/forums - The FreePBX® Forum
OTTS Training - Jan 20-23, Digium's HQ



hhmcpas
Posts: 24
Member Since:
2008-03-24
Solved

Thanks Philippe and all the others for the help along the way! I can't thank the community enough for the help you've provided! Here's my specs and solution to the problem

Specs:
Trixbox CE 2.6.1 (asterisk 1.4.20)
Aastra-xml-scripts installed
FreePBX 2.5 RC3 (Performed the upgrade per the FreePBX documentation)
Aastra 57i

Problem: When a extension was put on DND using the aastra-xml-scripts DND application for a 57i the other subscribed users had no BLF light notification that the ext was on DND. The BLF light simply showed "On Hook". The desired result is: When 104 is on DND then ext 100 should have a visual notification. Thanks to the func_devstate module and the FreePBX 2.5 features, this is now possible.

Solution:
Compile and install the func_devstate module for asterisk 1.4.20
Verify that the module is working per Philippe's instructions above
use *76 to put your phone in DND to verify that your BLF button on the subscribed station changes.
Find the Aastra_manage_DNDAasterisk(user,action) section and add the noted 4 lines to AastraAsterisk.php in the /var/www/html/aastra/include directory (look for the "#add the following 2 lines" comment in the following code to see what to add and where)

##################################################################################################
# Aastra_manage_dnd_Asterisk(user,action)
#
# This function reads and write the DND value in Asterisk Database.
#
# Parameters
# @user user extension
# @action action to be performed, change or anything
#
# Returns
# Current DND value
###################################################################################################
function Aastra_manage_dnd_Asterisk($user,$action)
{
# Connect to AGI
$as = new AGI_AsteriskManager();
$res = $as->connect();

# DND GET
$res = $as->Command('database get DND '.$user);
$line=split("\n", $res['data']);
$value=split(' ', $line[0]);
if($value[1]=='YES') $dnd=1;
if($dnd==0)
{
$value=split(' ', $line[1]);
if($value[1]=='YES') $dnd=1;
}

# Reverse DND if requested
if($action=='change')
{
# change DND status
if($dnd==0)
{
$res = $as->Command('database put DND '.$user.' YES');
##############################################################
#add the following 2 lines
##############################################################
$res = $as->Command('core set global DEVSTATE(Custom:DEVDND'.$user.') BUSY');
$res = $as->Command('core set global DEVSTATE(Custom:DND'.$user.') BUSY');
$dnd=1;
}
else
{
$res = $as->Command('database del DND '.$user);
###############################################################
#add the following 2 lines
###############################################################
$res = $as->Command('core set global DEVSTATE(Custom:DEVDND'.$user.') IDLE');
$res = $as->Command('core set global DEVSTATE(Custom:DND'.$user.') IDLE');
$dnd=0;
}
}

# Disconnect properly
$as->disconnect();

# Return DND
return($dnd);
}

This may not be the most elegant PHP code in the world. I am NOT a developer of any sort. So, if someone sees a better way to accomplish the same thing, please speak up. For now, I know one thing, It works...

Thanks again for the help.



philippel
Posts: 687
Member Since:
2006-05-31
You may want to check with

You may want to check with Stephane (or Ethan) if the XML script has been updated. I only glanced very very quickly above and noted:

$res = $as->Command('core set global DEVSTATE(Custom:DEVDND'.$user.') BUSY');

The DEVDND setting is tied to the Device and not the User, so doing this would not be correct for a deviceanduser setup, which needs the stated tied to that device. In extension mode it works because the User number == Device number but that is not always a given.

--

Philippe Lindheimer, FreePBX® Project Leader
http://freepbx.org - #freepbx on irc.freenode.net
http://freepbx.org/forums - The FreePBX® Forum
OTTS Training - Jan 20-23, Digium's HQ



hhmcpas
Posts: 24
Member Since:
2008-03-24
I THINK...

I THINK that the $user string in this case is used to specify the extension. when the DND button is pressed it does this
http://ip.of.trix.box:80/aastra/asterisk/dnd.php?user=104
So, when extension 104 goes into DND it would play out like this
...('core set global DEVSTATE(Custom:DEVDND104) BUSY');

At least that's what I've pieced together...I think.

When I use the updated PHP and do a "show hints" i see this:

-= Registered Asterisk Dial Plan Hints =-
104@ext-local : SIP/104&Custom:DND10 State:InUse Watchers 1
100@ext-local : SIP/100&Custom:DND10 State:Idle Watchers 0
*21104@ext-findmefollow : Custom:FOLLOWME104 State:Idle Watchers 0
*21100@ext-findmefollow : Custom:FOLLOWME100 State:Idle Watchers 0
*76104@ext-dnd-hints : Custom:DEVDND104 State:Busy Watchers 0
*76100@ext-dnd-hints : Custom:DEVDND100 State:Idle Watchers 0

and when I UN-DND I get:
-= Registered Asterisk Dial Plan Hints =-
104@ext-local : SIP/104&Custom:DND10 State:Idle Watchers 1
100@ext-local : SIP/100&Custom:DND10 State:Idle Watchers 0
*21104@ext-findmefollow : Custom:FOLLOWME104 State:Idle Watchers 0
*21100@ext-findmefollow : Custom:FOLLOWME100 State:Idle Watchers 0
*76104@ext-dnd-hints : Custom:DEVDND104 State:Idle Watchers 0
*76100@ext-dnd-hints : Custom:DEVDND100 State:Idle Watchers 0

Same thing as when I *76

Sound right?



philippel
Posts: 687
Member Since:
2006-05-31
I don't know, I would have

I don't know, I would have to look closer at the code. The easiest way to test is switch to deviceanduser mode, make an adhoc device, then login to that device with a user that has a different user number and test it.

--

Philippe Lindheimer, FreePBX® Project Leader
http://freepbx.org - #freepbx on irc.freenode.net
http://freepbx.org/forums - The FreePBX® Forum
OTTS Training - Jan 20-23, Digium's HQ



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.