BLF for toggle followme

I am working on getting BLF for toggling followme on Aastra phones ( shouldn’t matter the make though). I was successful in using the extension_override.conf file to do this. Problem is that watching *21 is not useful, because if anyone dials this it lights the on or off (as it should). So, I need help getting a per phone BLF light by modifying the app-fmf-toggle code to support multiple users. I have been successful in getting the phone to toggle followme on/off but the DEVICE_STATE doesn’t go to = INUSE and thus light the BLF. Here’s the modified code below. I put a 0 in front of an existing extension to make a unique toggle for each extension the wants BLF for toggling followme on/off. What am I missing?

;######################################################################;### Toggle Follow Me BLF ;######################################################################[hintsforfollowme]
exten => _01XX,1,Goto(app-fmf-toggle2,s,start)
exten => 0171,hint,Custom:followme171
exten => 0118,hint,Custom:followme118
exten => 0177,hint,Custom:followme177
exten => 0163,hint,Custom:followme163
exten => 0170,hint,Custom:followme170
exten => 0162,hint,Custom:followme162
exten => 0173,hint,Custom:followme173
exten => 0161,hint,Custom:followme161
exten => 0172,hint,Custom:followme172
exten => 0121,hint,Custom:followme121
exten => 0122,hint,Custom:followme122

[app-fmf-toggle2]
;exten => 0171,1,Goto(app-fmf-toggle171,s,start)
;exten => 0171,hint,Custom:followme171
exten => s,1(start),Answer
exten => s,n,Wait(1)
exten => s,n,Macro(user-callerid,)
exten => s,n,Set(CID=${CALLERID(num)})
exten => s,n,GotoIf($["${DB(AMPUSER/${AMPUSER}/followme/ddial)}" = “EXTENSION”]?activate)
exten => s,n,GotoIf($["${DB(AMPUSER/${AMPUSER}/followme/ddial)}" = “DIRECT”]?deactivate:end)
exten => s,n(deactivate),Set(DB(AMPUSER/${AMPUSER}/followme/ddial)=EXTENSION)
exten => s,n(hook_off),Playback(followme&de-activated)
exten => s,n,Set(DEVICE_STATE(Custom:followme$CALLERID(num))=NOT_INUSE)
exten => s,n,NoOp(SIP/mypeer has now state ${DEVICE_STATE(Custom:followme$CALLERID(num))})
exten => s,n(end),Macro(hangupcall,)
exten => s,n(activate),Set(DB(AMPUSER/${AMPUSER}/followme/ddial)=DIRECT)
exten => s,n(hook_on),Playback(followme&activated)
exten => s,n,Set(DEVICE_STATE(Custom:followme$CALLERID(num))=INUSE)
exten => s,n,NoOp(SIP/mypeer has now state ${DEVICE_STATE(Custom:followme${CALLERID(num))})
exten => s,n,Macro(hangupcall,)

Answering myself. Hope it helps someone else.
Figured it out. Changed

exten => s,n,Set(DEVICE_STATE(Custom:followme$CALLERID(num))=NOT_INUSE)

to

exten => s,n,Set(DEVICE_STATE(Custom:followme${AMPUSER})=NOT_INUSE)

and

exten => s,n,Set(DEVICE_STATE(Custom:followme$CALLERID(num))=INUSE)

to

exten => s,n,Set(DEVICE_STATE(Custom:followme${AMPUSER})=INUSE)

and it is now lighting the BLF as expected.

if this was wrong in the code (e.g. you are right it should be AMPUSER and not CALLERID(num), can you please file a ticket so we make sure to get the code updated?

Please make sure to include the version you ran into this on in case it has already been fixed in a later version.

thanks!

Phillipe, thanks for the response. The code below is the original. I modified it to make it personal for each person who would like to know if they toggled followme on/off with a BLF. Following *21 would turn on the lamp regardless of who in the office toggled followme on/off. I created custom hints for each extension that wanted to know if followme was on or off. So there is no reason to file a ticket, because it was never intended to do this. If you can use this as a feature, please do so.

[app-fmf-toggle]include => app-fmf-toggle-customexten => *21,1,Goto(app-fmf-toggle,s,start)
exten => s,1(start),Answer
exten => s,n,Wait(1)
exten => s,n,Macro(user-callerid,)
exten => s,n,GotoIf($["${DB(AMPUSER/${AMPUSER}/followme/ddial)}" = “EXTENSION”]?activate)
exten => s,n,GotoIf($["${DB(AMPUSER/${AMPUSER}/followme/ddial)}" = “DIRECT”]?deactivate:end)
exten => s,n(deactivate),Set(DB(AMPUSER/${AMPUSER}/followme/ddial)=EXTENSION)
exten => s,n(hook_off),Playback(followme&de-activated)exten => s,n(end),Macro(hangupcall,)
exten => s,n(activate),Set(DB(AMPUSER/${AMPUSER}/followme/ddial)=DIRECT)
exten => s,n(hook_on),Playback(followme&activated)
exten => s,n,Macro(hangupcall,)

; end of [app-fmf-toggle]