No DND status after service reboot

FOP 2.24 license
Centos 64
Asterisk 1.8
Freepbx 2.7 and 2.9
after service fop2 restart ..fop doesn't show DND status.. But I can see

CLI: database show

/DND/0032 : YES
/DND/0310 : YES
/DND/0327 : YES
/DND/0330 : YES
/DND/0351 : YES
/DND/8000 : YES

/fop2state/SIP/0075 : Do not Disturb
/fop2state/SIP/0310 : Do not Disturb
/fop2state/SIP/0311 : Do not Disturb
/fop2state/SIP/0327 : Do not Disturb
/fop2state/SIP/0330 : Do not Disturb
/fop2state/SIP/0351 : Do not Disturb
/fop2state/SIP/0503 : Do not Disturb
/fop2state/SIP/8000 : Do not Disturb

any help would be fine.

Comments

  • what is the value for customastdb entry when you run autoconfig-buttons-freepbx.sh ? Do you see it correctly? If so, you might want to be sure you have all permissions to /etc/asterisk/manager.conf

    Best regards,
  • Thanks for your answer Nicolás

    Here is my buttons.cfg

    [USER/0226]
    type=extension

    extension=0226
    label=Smith
    mailbox=2226@default
    context=from-internal
    queuecontext=from-queue
    extenvoicemail=*2226@from-internal
    group=work

    which i created by autoconfig-buttons-freepbx.sh
    Also i have all permissions to /etc/asterisk/manager.conf

    After I started ./generate_override_contexts.pl -write
    got a new extensions_override_fop2.conf which looks like:

    [app-dnd-off]
    include => app-dnd-off-custom
    exten => 79,1,Answer
    exten => 79,n,Wait(1)
    exten => 79,n,Macro(user-callerid,)
    ; added for fop2
    exten => 79,n,Set(CHAN=${CUT(CHANNEL,-,1)})
    exten => 79,n,dbDel(fop2state/${CHAN})
    exten => 79,n,UserEvent(FOP2ASTDB,Family: fop2state,Channel: ${CHAN},Value: )
    ; end fop2 addition
    exten => 79,n,Noop(Deleting: DND/${AMPUSER} ${DB_DELETE(DND/${AMPUSER})})
    exten => 79,n,Set(STATE=NOT_INUSE)
    exten => 79,n,Gosub(app-dnd-off,sstate,1)
    exten => 79,n(hook_1),Playback(do-not-disturb&de-activated)
    exten => 79,n,Macro(hangupcall,)
    exten => sstate,1,Set(DEVICE_STATE(Custom:DND${AMPUSER})=${STATE})
    exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${AMPUSER}/device)})
    exten => sstate,n,GotoIf($["${DEVICES}" = "" ]?return)
    exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
    exten => sstate,n,Set(ITER=1)
    exten => sstate,n(begin),Set(DEVICE_STATE(Custom:DEVDND${CUT(DEVICES,&,${ITER})})=${STATE})
    exten => sstate,n,Set(ITER=$[${ITER} + 1])
    exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
    exten => sstate,n(return),Return()

    here I changed a standart meaning *78 -> 78 by manual...guess it was my fault.
    Now I've repeated ./generate_override_contexts.pl -write and everything works fine!
    fop2 is located on asterisk server.

    But I have another fop2 which separated from asterisk and this one doesn't show DND status.
    Any suggestions would be great.
  • If you want to show the status change in realtime, then you must run the generate_override_xxx script on the ASTERISK/FreePBX box, so copy the file from your fop2 install into the asterisk box and run that script. (Assuming you use freepbx in the asterisk machine).
  • {quote} status change in realtime {quote}
    Yea, it works fine..
    but after service fop2 restart ..fop2 doesn't show DND status unfortunately
  • {quote} status change in realtime {quote}
    Yea, it works fine..
    but after service fop2 restart ..fop2 doesn't show DND status unfortunately

    If you do not see dnd status on boot, then you have a misconfiguration somewhere, as it works perfectly fine. You *must* configure the customastdb entry in your button.cfg, something like

    customastdb=CF/600

    Not sure why you are configuring buttons manually? If you use freepbx, you should let the autoconfig scripts do their job.

    Best regards,
  • Thanks for the answer Nicolás,

    I'm using a FreePBX based distro Elastix. Freepbx
    I used autoconfig-buttons-freepbx.sh


    [USER/0226]
    type=extension

    extension=0226
    label=Smith
    mailbox=2226@default
    context=from-internal
    queuecontext=from-queue
    extenvoicemail=*2226@from-internal
    group=work


    here is my manager_additional.conf
    [fopp2]
    secret = fop2secret
    deny=0.0.0.0/0.0.0.0
    permit=0.0.0.0/0.0.0.0
    read = system,call,log,verbose,command,agent,user,config,dtmf,reporting,cdr,dialplan,originate
    write = system,call,log,verbose,command,agent,user,config,dtmf,reporting,cdr,dialplan,originate

    in button.cfg I added : customastdb=DND/0226

    1. so it shows me blue arrow on the button. click on it sad "Yes"...after that I swithed DND off, still see the same "Yes"
    2. After "service fop2 restart" I see nothing!?

    besides that, I installed fop2admin, than uninstalled it. Second installation showed me a mistake - exit: 1
    [FATAL] SELECT if(`defaultlot`='no',concat('PARK/parkinglot_',id),'PARK/default') AS channel,parkext AS exten FROM parkplus [nativecode=1146 ** Table 'asterisk.parkplus' doesn't exist]SQL -
    SELECT if(`defaultlot`='no',concat('PARK/parkinglot_',id),'PARK/default') AS channel,parkext AS exten FROM parkplus

    Trace Back:

    /var/www/html/admin/libraries/sql.functions.php:11 die_freepbx()
    [0]: SELECT if(`defaultlot`='no',concat('PARK/parkinglot_',id),'PARK/default') AS channel,parkext AS exten FROM parkplus [nativecode=1146 ** Table 'asterisk.parkplus' doesn't exist]SQL -
    SELECT if(`defaultlot`='no',concat('PARK/parkinglot_',id),'PARK/default') AS channel,parkext AS exten FROM parkplus

    /var/www/html/admin/modules/fop2admin/functions.inc.php:70 sql()
    [0]: SELECT if(`defaultlot`='no',concat('PARK/parkinglot_',id),'PARK/default') AS channel,parkext AS exten FROM parkplus
    [1]: getAll
    [2]: 2

    /var/lib/asterisk/bin/retrieve_conf:606 fop2admin_get_config()
    [0]: asterisk
    1 error(s) occurred, you should view the notification log on the dashboard or main screen to check for more details.
  • Sorry, I mixed up things. Customastdb is used for call forward setting, not for DND setting.

    For the presence box in fop2 to show Do not Disturb, you must have a database entry

    fop2state with the channel name as family, something like

    fop2state/SIP/606

    What do you see if you do

    asterisk -rx "database show fop2state"

    when you set yourself in DND from fop2?

    and when you set DND from the freepbx feature code?


    And about fop2admin, what version did you install? You must have the park module installed for it to work.
  • Thanks for your answer Nicolás,

    First of all, Yes I have /fop2state/SIP/0226 : Do not Disturb
    my first post in this topic about dnd status in database.
    Secondly, fop2admin had been installed succesfuly after module Parking Lot installing.

    Regards,
  • Thanks for your answer Nicolás,

    First of all, Yes I have /fop2state/SIP/0226 : Do not Disturb
    my first post in this topic about dnd status in database.
    Secondly, fop2admin had been installed succesfuly after module Parking Lot installing.

    Regards,

    Ok, I think the problem is that you have SIP/0226 instead of USER/0226 as the family. You might need to change the override context so it uses that instead of the channel name. I have not tested this, but perhaps it works, it should be something similar to this:

    exten => 79,n,dbDel(fop2state/USER/${AMPUSER})
    exten => 79,n,UserEvent(FOP2ASTDB,Family: fop2state,Channel: USER/${AMPUSER},Value: )

    Best regards,
  • source extensions_override_fop2.conf:

    [app-dnd-off]
    include => app-dnd-off-custom
    exten => 79,1,Answer
    exten => 79,n,Wait(1)
    exten => 79,n,Macro(user-callerid,)
    ; added for fop2
    exten => 79,n,Set(CHAN=${CUT(CHANNEL,-,1)})
    exten => 79,n,dbDel(fop2state/${CHAN})
    exten => 79,n,UserEvent(FOP2ASTDB,Family: fop2state,Channel: ${CHAN},Value: )
    ; end fop2 addition
    exten => 79,n,Noop(Deleting: DND/${AMPUSER} ${DB_DELETE(DND/${AMPUSER})})
    exten => 79,n,Set(STATE=NOT_INUSE)
    exten => 79,n,Gosub(app-dnd-off,sstate,1)
    exten => 79,n(hook_1),Playback(agent-loginok)
    exten => 79,n,Macro(hangupcall,)
    exten => sstate,1,Set(DEVICE_STATE(Custom:DND${AMPUSER})=${STATE})
    exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${AMPUSER}/device)})
    exten => sstate,n,GotoIf($["${DEVICES}" = "" ]?return)
    exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
    exten => sstate,n,Set(ITER=1)
    exten => sstate,n(begin),Set(DEVICE_STATE(Custom:DEVDND${CUT(DEVICES,&,${ITER})})=${STATE})
    exten => sstate,n,Set(ITER=$[${ITER} + 1])
    exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
    exten => sstate,n(return),Return()

    [app-dnd-on]
    include => app-dnd-on-custom
    exten => 78,1,Answer
    exten => 78,n,Wait(1)
    exten => 78,n,Macro(user-callerid,)
    ; added for fop2
    exten => 78,n,Set(DB(DND/${AMPUSER})=YES)
    exten => 78,n,Set(CHAN=${CUT(CHANNEL,-,1)})
    exten => 78,n,Set(DB(fop2state/${CHAN})=Do not Disturb)
    exten => 78,n,UserEvent(FOP2ASTDB,Family: fop2state,Channel: ${CHAN},Value: Do not Disturb)
    ; end fop2 addition
    exten => 78,n,Set(DB(DND/${AMPUSER})=YES)
    exten => 78,n,Set(STATE=BUSY)
    exten => 78,n,Gosub(app-dnd-on,sstate,1)
    exten => 78,n(hook_1),Playback(agent-loggedoff)
    exten => 78,n,Macro(hangupcall,)
    exten => sstate,1,Set(DEVICE_STATE(Custom:DND${AMPUSER})=${STATE})
    exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${AMPUSER}/device)})
    exten => sstate,n,GotoIf($["${DEVICES}" = "" ]?return)
    exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
    exten => sstate,n,Set(ITER=1)
    exten => sstate,n(begin),Set(DEVICE_STATE(Custom:DEVDND${CUT(DEVICES,&,${ITER})})=${STATE})
    exten => sstate,n,Set(ITER=$[${ITER} + 1])
    exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
    exten => sstate,n(return),Return()

    a new one, after source was changed:
    [app-dnd-off]
    include => app-dnd-off-custom
    exten => 79,1,Answer
    exten => 79,n,Wait(1)
    exten => 79,n,Macro(user-callerid,)
    ; added for fop2
    exten => 79,n,Set(CHAN=${CUT(CHANNEL,-,1)})
    exten => 79,n,dbDel(fop2state/USER/${AMPUSER})
    exten => 79,n,UserEvent(FOP2ASTDB,Family: fop2state,Channel: USER/${AMPUSER},Value: )
    ; end fop2 addition
    exten => 79,n,Noop(Deleting: DND/${AMPUSER} ${DB_DELETE(DND/${AMPUSER})})
    exten => 79,n,Set(STATE=NOT_INUSE)
    exten => 79,n,Gosub(app-dnd-off,sstate,1)
    exten => 79,n(hook_1),Playback(do-not-disturb&de-activated)
    exten => 79,n,Macro(hangupcall,)
    exten => sstate,1,Set(DEVICE_STATE(Custom:DND${AMPUSER})=${STATE})
    exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${AMPUSER}/device)})
    exten => sstate,n,GotoIf($["${DEVICES}" = "" ]?return)
    exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
    exten => sstate,n,Set(ITER=1)
    exten => sstate,n(begin),Set(DEVICE_STATE(Custom:DEVDND${CUT(DEVICES,&,${ITER})})=${STATE})
    exten => sstate,n,Set(ITER=$[${ITER} + 1])
    exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
    exten => sstate,n(return),Return()

    [app-dnd-on]
    include => app-dnd-on-custom
    exten => 78,1,Answer
    exten => 78,n,Wait(1)
    exten => 78,n,Macro(user-callerid,)
    ; added for fop2
    exten => 78,n,Set(DB(DND/${AMPUSER})=YES)
    exten => 78,n,Set(CHAN=${CUT(CHANNEL,-,1)}) ; guess we don't need this one???
    exten => 78,n,Set(DB(fop2state/USER/${AMPUSER})=Do not Disturb)
    exten => 78,n,UserEvent(FOP2ASTDB,Family: fop2state,Channel: USER/${AMPUSER},Value: Do not Disturb)
    ; end fop2 addition
    exten => 78,n,Set(DB(DND/${AMPUSER})=YES)
    exten => 78,n,Set(STATE=BUSY)
    exten => 78,n,Gosub(app-dnd-on,sstate,1)
    exten => 78,n(hook_1),Playback(do-not-disturb&activated)
    exten => 78,n,Macro(hangupcall,)
    exten => sstate,1,Set(DEVICE_STATE(Custom:DND${AMPUSER})=${STATE})
    exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${AMPUSER}/device)})
    exten => sstate,n,GotoIf($["${DEVICES}" = "" ]?return)
    exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
    exten => sstate,n,Set(ITER=1)
    exten => sstate,n(begin),Set(DEVICE_STATE(Custom:DEVDND${CUT(DEVICES,&,${ITER})})=${STATE})
    exten => sstate,n,Set(ITER=$[${ITER} + 1])
    exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
    exten => sstate,n(return),Return()


    Unfortunately it still doesn't show DND
  • Set some extension to DND and then run:

    asterisk -rx "database show fop2state"

    What is the output?
  • /fop2state/SIP/0351 : Do not Disturb
    /fop2state/SIP/0352 : Do not Disturb
    /fop2state/SIP/0503 : Do not Disturb
    /fop2state/USER/0352 : Do not Disturb

    after service fop2 restart

    I see DND status on 0352..

    so ..it looks like everything is fine now..?!
  • Here is another question: How can user change his status to "Out to lunch" by future code?

    I read this message before posting View Post 601

    Probably we need put a code which is a simular to DND and CF codes, don't we?
  • You will have to replicate the feature code and change the reason:

    exten => 781,n,Set(DB(fop2state/USER/${AMPUSER})=Out to Lunch)
    exten => 781,n,UserEvent(FOP2ASTDB,Family: fop2state,Channel: USER/${AMPUSER},Value: Out to Lunch)

    Chose an extension that will not overlap with your current dialplan.

    Best regards,
Sign In or Register to comment.