Permission Denied...

  1. 14 years ago

    We are not able to use the listen function. In fact, only the dial button actually works.

    Here is my manager.conf:
    ;
    ; Asterisk Call Management support
    ;
    [general]
    enabled = yes
    port = 5038
    bindaddr = 127.0.0.1

    [admin]
    secret = amp111
    deny=0.0.0.0/0.0.0.0
    permit=127.0.0.1/255.255.255.0
    read = all,system,call,log,verbose,command,agent,user,originate
    write = all,system,call,log,verbose,command,agent,user,originate

    #include manager_additional.conf
    #include manager_custom.conf

    I run fop2 in debug mode and get "permission denied" when I try the buttons. The only one that works is the dial button. What else needs to be added here to make this work?

    127.0.0.1 -> Action: Originate
    127.0.0.1 -> Channel: SIP/742
    127.0.0.1 -> Application: ChanSpy
    127.0.0.1 -> Data: SIP/737
    127.0.0.1 -> Async: True

    127.0.0.1 <- Response: Error
    127.0.0.1 <- Message: Permission denied
    127.0.0.1 <- Server: 0
    Thank You!!

  2. admin

    21 May 2010 Administrator

    Are you using the "admin" user in fop2.cfg ? I believe you are not, because the permissions look correct.

  3. I'm using the fop2 admin module to add users. Here is fop2 section regarding users. Do I need to add something here?

    ;user=620:1234:all:queues
    ;user=621:1234:dial,transfer,pickup:deptA
    ;user=622:1234:all
    ;user=623:1234:meetme,pickup
    ;buttonfile=buttons.cfg
    ; ------ END SAMPLE ------

    ; This line is NOT commented, it executes
    ; the autoconfig configuration for FreePBX
    #exec autoconfig-users-freepbx.sh

    This is on the top:

    AMI definitions
    manager_host=localhost
    manager_port=5038
    manager_user=admin
    manager_secret=amp111

  4. admin

    21 May 2010 Administrator

    The module or your fop2 users have nothing to do, the problem is with asterisk manager permissions. You are getting denied from Asterisk, altough the admin user has all permisiones in /etc/asterisk/manager.conf

    Even you have another admin user defined later on with different permissions (in the _custom or _additional files perhaps?).

    You might also want to try by changing the host in fop2.cfg from "localhost" to 127.0.0.1 . Normally yt should not make a difference, but that error is not "normal" from what you are posting.

    And do not forget to reload asterisk if you change its configuration.

    Best regards,

  5. Ok. I found another admin user in _additional and the permissions did not say "originate". Should I delete the user in _additional or just add the correct permission? Thank You...

  6. admin

    21 May 2010 Administrator

    You have to remove the extra "admin" user from the freepbx gui, in the tools - asterisk api.

  7. Ok... deleted that _additional and it worked immediately. Thanks again Nicolas!

  8. hello everyone
    i'm having the same problem here, "permission denied", but i don't know where to locate the files _custom and _additional you are talking about... could anyone help on this issue please?

    i also have a question, is it possible for FOP to retrieve users info from mysql database? since i'm using dynamic database with asterisk, the "sip.conf" file is empty, so FOP is listing no users. any how to change this?

    thank you

  9. admin

    2 Aug 2010 Administrator

    Hello,

    If you get permission denied when trying to issue commands with fop2, you have to check the manager user in /etc/asterisk/manager.conf and be sure you have the "originate" or "all" in the read/write permissions line.

    However, if your fop2 panel is empty, I am not sure how you made it through the logs to have that specific permission denied message.

    FOP2 can read configuration from anything you can code in a shell script. The autoconfiguration for freepbx does that, it reads text files or queries mysql databases.

    If you do not use freepbx you will have to write your custom scripts to generate the config files, you can look at the ones included for inspiration.

    Anyways, where do you get a permission denied message?

  10. hello, thanks for your response
    in fact, i get "permission denied" messages for commands issued by the fop server when starting up, so i get these messages even before i log in to the fop client. the connection is established with asterisk, but for certain commands asterisk is denying access, the commands' IDs sent by FOP server are:
    127.0.0.1 -> ActionID: parkedcalls
    127.0.0.1 -> ActionID: meetme_10
    127.0.0.1 -> ActionID: astdb-DND-SIP/left
    127.0.0.1 -> Command: sip show peers
    127.0.0.1 -> ActionID: iaxpeers
    127.0.0.1 -> ActionID: sccppeers

    for all the above, asterisk returns the following response:
    127.0.0.1 <- Response: Error
    127.0.0.1 <- ActionID: sccppeers ;of course the action ID in the response isn't the same for every command
    127.0.0.1 <- Message: Permission denied
    127.0.0.1 <- Server: 0

    so i ignored these errors, and started the client. it shows the pannel, but i'm having trouble with the password :oops:
    anyways, the read and write rights in the manager.conf are as follows:

    deny=0.0.0.0/0.0.0.0
    permit=127.0.0.1/255.255.255.0
    read = system, call, log, verbose, command, agent, user
    write = system, call, log, verbose, command, agent, user

    no idea what could be the problem :?
    thanks

  11. i forgot to mention that i'm using fop 0.30, not fop2

  12. ok it works well now, apparently i forgot to append "all" and "originate" rights to read and write. i also changed the password from the config file.

    so i still have one problem, FOP isn't "seeing" users since they are binded to asterisk from a realtime mysql database, do you have any idea how can this be fixed?
    thank you

  13. admin

    3 Aug 2010 Administrator

    fop2 does not "see" configuration, you have to write your own configuration or use the included one that works only for FreePBX. If you do not use FreePBX, you will have to write your own config files manually, or create your own autoconfiguration script. As I said before, the freepbx autoconfig scripts read data from Mysql, so there is no reason that it should not work in your case. But you will need to write the scripts yourself.

    Just write a shell script that outputs valid fop2 cfg data as described in the manual, and run those scripts via #exec directives in the config files.

    Best regards,

  14. hello

    in fact i'm not using freepbx, so i would have to write the conf files myself. i will check where to find examples and build on them

    thanks for ur reply

  15. so as i stated before, i'm using FOP not FOP2, therefore i don't know in which file should i execute my script :?

  16. admin

    3 Aug 2010 Administrator

    AHH... sorry, #exec is a FOP2 feature. It is not present in FOP. You can write a shell script too to generate the op_buttons.cfg file, and after the file is generated you can send the HUP signal to op_server.pl so it rereads the config file.

    #exec on fop2 does that, but internally.

    Best regards,

or Sign Up to reply!