1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. If you had a PIAF Forum account in the vBulletin days, log in with your old credentials. Otherwise, sign up again and we'll get you back in business as soon as we can.
  3. A serious FreePBX vulnerability has been reported. Update your Framework Module immediately. Click here for details.
  4. Critical FreePBX vulnerability! Update your server immediately. Details here.

QUESTION Receptionist wants BLF to have 3 states

Discussion in 'Help' started by sorvani, Mar 18, 2014.

  1. sorvani New Member

    I had a request for a 3 state BLF from the receptionist. At the core, she wants to know
    1. Not on the phone
    2. On the phone
    3. On DND
    A standard Red/Green BLF button will show red for both #1 and #2. The receptionist has stated that a prior employer phone system had the BLF set to be
    1. Off - Not on the phone
    2. Green - On the phone
    3. Red - On DND
  2. james Guru

    Some useful info here would be what phones are you using.
    If you are trying to figure out what phone to use what is your budget.
  3. sorvani New Member

    No phone in use yet. I was using a Yealink T38G for demonstration purposes. The receptionist phone is the only one that would need to act like this. It is also not a deal breaker for the upgrade from their legacy system, more of a "this would be nice to have" kind of thing.

    I am actually hoping to roll out the site with the Snom 715 (not shipping yet) for the users. The users only need parking lot BLF keys.
  4. rjaiswal Moderator

    I think the Cisco spa line of phones have buttons that have three led colors. Yellow, red, and green. You might be able to assign hint states to each color...
  5. Porch Guru

    Might just want to setup FOP2 for her. Then you have all the available states.
  6. sorvani New Member

    I'm not not going to buy an overpriced poor quality phone (I do not like Cisco can you tell?) to get a 3 color LED. I do not need 3 colors. I need three states. BLF by default does not do 3 states, I realize this. I was asking /if/ this was possible. I already assume that it will be a custom context or something custom in a config file.
  7. sorvani New Member

    FOP2 is being purchased as part of the deployment but is not relevant to the question.
  8. Yikes, I'm thinking perhaps we should be thinking twice to answering you from how you're responding on here to people trying to help!
    rjaiswal likes this.
  9. nicknomo Happy-IT-Guy

    Well, on the asterisk side, the BLF hints tell you all of this information. Its obvious that the phones are the real bottleneck here, but I am guessing most manufacturers won't let you customize the BLF LED output... a BLF specifically for DND is something I would guess is not commonly on most phones.

    Maybe one of the newer touch screen phones would give you a complete output on the screen rather than just with a BLF? I'm certain such a thing could be scripted, but you'd have to know AMI.
    Last edited by nicknomo, Mar 19, 2014
  10. nicknomo Happy-IT-Guy

    It looks like the Polycom VVX 1500 displays full BLF details on screen, but its expensive and I don't know how well it works with asterisk BLF hints.

    http://tzech.com/home/wp-content/uploads/2007/03/page_07.jpg

    I'd follow up with a support rep to make sure it does what you want before spending that type of money..
  11. sorvani New Member

    Telling me to use FOP2 is not helpful.
  12. sorvani New Member

    Thanks. I will dig more into what I can do with the phones and the BLF hints.
  13. sorvani New Member

    Along that line of thought I found that Yealink has an expansion module with more details.
    http://www.yealink.com/product_info...seInfoCateId=193&Cate_Id=193&parentcateid=148

    Thanks for the pointers.
  14. nicknomo Happy-IT-Guy

    I'm not sure if the EXT39 supports presence states, but the newer devices that will graphically show DND/Away/etc use the presence state hints.

    You'll have to set DND to "custom" in the yealink phones. You'll have to set *78 and *79 for DND on and off.

    FreePBX's dial plan makes presence state hints for each extension, however the DND app doesn't toggle DND. You'd have to overwrite the dial plan in extensions_override.conf to replace the DND dialplan, I use FreePBX 2.8 at the moment, but I do the same thing with custom device states. Below is some of my code in extensions_override.conf.


    Code:
    [app-dnd-off]
    exten => *79,1,Answer
    exten => *79,n,Wait(1)
    exten => *79,n,Macro(user-callerid,)
    exten => *79,n,Noop(Deleting: DND/${AMPUSER} ${DB_DELETE(DND/${AMPUSER})})
    ; Set custom device state to NOT_INUSE
    exten => *79,n,Set(DEVICE_STATE(Custom:${AMPUSER})=NOT_INUSE)
    exten => *79,n,Macro(hangupcall,)
     
     
     
    [app-dnd-on]
    exten => *78,1,Answer
    exten => *78,n,Wait(1)
    exten => *78,n,Macro(user-callerid,)
    exten => *78,n,Set(DB(DND/${AMPUSER})=YES)
    ; Set custom device state to Busy
    exten => *78,n,Set(DEVICE_STATE(Custom:${AMPUSER})=BUSY)
    exten => *78,n,Macro(hangupcall,)
     
     
     
    [app-dnd-toggle]
    exten => *76,1,Answer
    exten => *76,n,Wait(1)
    exten => *76,n,Macro(user-callerid,)
    exten => *76,n,GotoIf($["${DB(DND/${AMPUSER})}" = ""]?activate:deactivate)
    exten => *76,n(activate),Set(DB(DND/${AMPUSER})=YES)
    exten => *76,n,Set(DEVICE_STATE(Custom:${AMPUSER})=BUSY)
    exten => *76,n,Macro(hangupcall,)
    exten => *76,n(deactivate),Noop(Deleting: DND/${AMPUSER} ${DB_DELETE(DND/${AMPUSER})})
    exten => *76,n,Set(DEVICE_STATE(Custom:${AMPUSER})=NOT_INUSE)
    exten => *76,n,Macro(hangupcall,)
    
  15. nicknomo Happy-IT-Guy

    I played with this a little while, and I was able to get this dial plan addition (extensions_override.conf) to set presence states (allows for DND to be set). The EXT40 I have only picked up on the device state, and your only real option is BUSY or RINGING. Setting it to unavailable won't register on any SIP phone, since apparently SIP doesn't pass on that the extension is unavailable.

    Code:
    [app-dnd-off]
    exten => *79,1,Answer
    exten => *79,n,Wait(1)
    exten => *79,n,Macro(user-callerid,)
    exten => *79,n,Noop(Deleting: DND/${AMPUSER} ${DB_DELETE(DND/${AMPUSER})})
    exten => *79,n,NoOP(Presence was: ${PRESENCE_STATE(CustomPresence:${AMPUSER},value)})
    exten => *79,n,Set(PRESENCE_STATE(CustomPresence:${AMPUSER})=Available,,)
    exten => *79,n,NoOP(Presence is now: ${PRESENCE_STATE(CustomPresence:${AMPUSER},value)})
    exten => *79,n,NoOP(DevState was: ${DEVICE_STATE(Custom:${AMPUSER},value)})
    exten => *79,n,Set(DEVICE_STATE(Custom:${AMPUSER})=NOT_INUSE)
    exten => *79,n,NoOP(DevState is now: ${DEVICE_STATE(Custom:${AMPUSER},value)})
    exten => *79,n,Macro(hangupcall,)
     
    [app-dnd-on]
    exten => *78,1,Answer
    exten => *78,n,Wait(1)
    exten => *78,n,Macro(user-callerid,)
    exten => *78,n,Set(DB(DND/${AMPUSER})=YES)
    exten => *78,n,NoOP(Presence was: ${PRESENCE_STATE(CustomPresence:${AMPUSER},value)})
    exten => *78,n,Set(PRESENCE_STATE(CustomPresence:${AMPUSER})=DND,,GOAWAY)
    exten => *78,n,NoOP(Presence is now: ${PRESENCE_STATE(CustomPresence:${AMPUSER},value)})
    exten => *78,n,NoOP(DevState was: ${DEVICE_STATE(Custom:${AMPUSER},value)})
    exten => *78,n,Set(DEVICE_STATE(Custom:${AMPUSER})=BUSY)
    exten => *78,n,NoOP(DevState is now: ${DEVICE_STATE(Custom:${AMPUSER},value)})
    exten => *78,n,Macro(hangupcall,)
     
    [app-dnd-toggle]
    exten => *76,1,Answer
    exten => *76,n,Wait(1)
    exten => *76,n,Macro(user-callerid,)
    exten => *76,n,GotoIf($["${DB(DND/${AMPUSER})}" = ""]?activate:deactivate)
    exten => *76,n(activate),Set(DB(DND/${AMPUSER})=YES)
    exten => *76,n,NoOP(Presence was: ${PRESENCE_STATE(CustomPresence:${AMPUSER},value)})
    exten => *76,n,Set(PRESENCE_STATE(CustomPresence:${AMPUSER})=DND,,GOAWAY)
    exten => *76,n,NoOP(Presence is now: ${PRESENCE_STATE(CustomPresence:${AMPUSER},value)})
    exten => *76,n,NoOP(DevState was: ${DEVICE_STATE(Custom:${AMPUSER},value)})
    exten => *76,n,Set(DEVICE_STATE(Custom:${AMPUSER})=BUSY)
    exten => *76,n,NoOP(DevState is now: ${DEVICE_STATE(Custom:${AMPUSER},value)})
    exten => *76,n,Macro(hangupcall,)
    exten => *76,n(deactivate),Noop(Deleting: DND/${AMPUSER} ${DB_DELETE(DND/${AMPUSER})})
    exten => *76,n,NoOP(Presence was: ${PRESENCE_STATE(CustomPresence:${AMPUSER},value)})
    exten => *76,n,Set(PRESENCE_STATE(CustomPresence:${AMPUSER})=Available,,)
    exten => *76,n,NoOP(Presence is now: ${PRESENCE_STATE(CustomPresence:${AMPUSER},value)})
    exten => *76,n,NoOP(DevState was: ${DEVICE_STATE(Custom:${AMPUSER},value)})
    exten => *76,n,Set(DEVICE_STATE(Custom:${AMPUSER})=NOT_INUSE)
    exten => *76,n,NoOP(DevState is now: ${DEVICE_STATE(Custom:${AMPUSER},value)})
    exten => *76,n,Macro(hangupcall,)
     
    
    For the device state to work, and show up Busy, I had to add hints that looked like this:
    Code:
    exten => 200,hint,SIP/200&Custom:200,CustomPresence:200
    
    The default FreePBX hints for 2.11 look like this, I believe
    Code:
    exten => 200,hint,SIP/200,CustomPresence:200
    
    rjaiswal likes this.
  16. sorvani New Member

    I can completely not follow that @ 23:30 at night. but thanks for posting all of this. I will try and work on it over the weekend to see what I can make the phones do.
  17. nicknomo Happy-IT-Guy


    Don't worry, I can't follow it half the time either...

    Anyway, I hope I didn't give the wrong impression. From what I can tell its sort of bad news regarding the yealink stuff (which is what Im using)...

    Without the code, the run down is this: you have device states and presence states. The device states are limited to busy, ringing, in use, etc. Its basically the state of the SIP channel. Presence states are more about the extension/end user. Is the user on DND, are they away, etc. It also offers the capability of leaving a message. With presence states, sure the phone is on, but are they really there? That is what it is meant to convey.

    There is nothing equivalent to DND in the device states. In order to do what you want, you really need presence states. Its the only way something user specific like DND will show up on another user's phone. The Yealink phone and EXP40 unit didn't respond in any way to the presence states (neither graphically on the LCD or via the BLF).

    The code posted sets both the device state and the presence state on DND, provided that the hints are set up as I described. You can comment out the setting of device and presence states as desired to test them individually. The "NoOP" commands in the code post messages in the CLI that display the device states and the presence states. The code example is really meant to

    1) help confirm whether or not your model phone detects the presence states
    2) Force the custom hints to reflect the device state when you go into DND (if they don't already - I don't really know if they do for you because I am currently on Elastix). This ensures the line is set to BUSY when going into DND.
    3) give a platform to test this on other phones.

    I'm not sure if its really at all helpful or not to you, but I am learning asterisks dial plans and felt it was a good exercise... so I just tried it out for kicks. I was hoping something would happen too, because that would have been a nice feature... but as I said I got no response.

    So, this probably isn't all that helpful, but maybe you can use it for testing and/or experimenting... Best of luck!
    Last edited by nicknomo, Mar 21, 2014

Share This Page