Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

FOP2 Community Forum

  1. Home
  2. Support
  3. No DND status after service reboot

No DND status after service reboot

Scheduled Pinned Locked Moved Support
15 Posts 2 Posters 100 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    S
    sipk
    wrote on last edited by
    #3

    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.

    1 Reply Last reply
    0
    • N
      N
      nicolas
      wrote on last edited by
      #4

      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).

      1 Reply Last reply
      0
      • S
        S
        sipk
        wrote on last edited by
        #5

        {quote} status change in realtime {quote}
        Yea, it works fine..
        but after service fop2 restart ..fop2 doesn't show DND status unfortunately

        1 Reply Last reply
        0
        • N
          N
          nicolas
          wrote on last edited by
          #6

          {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,

          1 Reply Last reply
          0
          • S
            S
            sipk
            wrote on last edited by
            #7

            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.

            1 Reply Last reply
            0
            • N
              N
              nicolas
              wrote on last edited by
              #8

              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.

              1 Reply Last reply
              0
              • S
                S
                sipk
                wrote on last edited by
                #9

                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,

                1 Reply Last reply
                0
                • N
                  N
                  nicolas
                  wrote on last edited by
                  #10

                  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,

                  1 Reply Last reply
                  0
                  • S
                    S
                    sipk
                    wrote on last edited by
                    #11

                    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

                    1 Reply Last reply
                    0
                    • N
                      N
                      nicolas
                      wrote on last edited by
                      #12

                      Set some extension to DND and then run:

                      asterisk -rx "database show fop2state"

                      What is the output?

                      1 Reply Last reply
                      0
                      • S
                        S
                        sipk
                        wrote on last edited by
                        #13

                        /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..?!

                        1 Reply Last reply
                        0
                        • S
                          S
                          sipk
                          wrote on last edited by
                          #14

                          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?

                          1 Reply Last reply
                          0
                          • N
                            N
                            nicolas
                            wrote on last edited by
                            #15

                            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,

                            1 Reply Last reply
                            0

                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                            With your input, this post could be even better 💗

                            Register Login
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            Powered by NodeBB Contributors
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups