User logOFF/ON (*11/*12) does not update status (solved)

After logon (using *11 in FreePBX) buttons are not updated.

If I however restart the fop2 service again, it will show correct state.

Same happens when a user loggoff (with *12), I need to restart fop2 service to show correct state.

Tried 'service fop2 reload', but -HUP signal does not solve this either.

As of now using we use a crontab entry like :
# For some reasons fop2 does not detect change in user logon/logoff
0,15,30,45  * * * * /sbin/service fop2 restart
But this is not very nice.

I am using Asterisk 1.6.1.6

Comments

  • Hi Eirik,

    Are you using trixbox? You need to add a special permission to the asterisk manager user, I believe the permission is named "hud", or you can add the "all" permission too (in /etc/asterisk/manager.conf). If you are not using trixbox, then it seems like a fop2 bug. In that case try to catch me online so I can work on the fix before releasing the next version.

    Best regards,
  • edited January 2015
    I am using FreePBX 2.6.0.RC2.1.

    I will try to catch up online.

    I did try to bypass the problem by restarting fop2 after each user login/out with
    system("/usr/bin/sudo /sbin/service fop2 restart", $retval);
    

    inside a modified version of user_login_out.agi, but this cause some other problem with sudo and access rigts after restart of service, and is very ugly..

    Is there any particular debug info I can give you ? What state messages or hints are you relying on from Asterisk to set the fop2 states ?

    When is the next released planned ?
  • edited January 2015
    After your advice, looking for ' UserDeviceAdded', in 'user_login_out.agi' fop2 seems to be OK.

    This is what shows up on telnet to port:
    Event: UserEvent
    Privilege: user,all
    UserEvent: UserDeviceRemoved|Data: 378
    115
    

    This is not correct as the UserEvent with data passed is all merged into one string. I guess this is the reason why why your fop2 event parser does not capture this. You might want to make your parser also to support this odd string.

    Code in ' 'user_login_out.agi'' is
    agi->exec("UserEvent", "\"UserDeviceRemoved|Data: {$current_user},{$device}\"");
    

    Note that pipe '|'. Asterisk seems to have broken handling of pipe '|' as delimiter. Using ',' as delimiter soved it. So this will work:
    // $agi->exec("UserEvent", "\"UserDeviceAdded|Data: {$user},{$device}\"");
        $agi->exec("UserEvent", "\"UserDeviceAdded,Data: {$user},{$device}\"");
    

    and ...
    $agi->exec("UserEvent", "\"UserDeviceRemoved,Data: {$current_user},{$device}\"");
    

    Thank you for your support yesterday, it helped me in the right direction.

    I will perform some more stress testing to verify, but for now this fixed my problems.
  • Hi Eirik,

    Great you've found the root of the problem! It seems to be a FreePBX bug, it would be good to submit a patch there. I do not think it would be wise to polute fop code with workaround for bugs. It makes it hard to mantain and also less efficient. This is clearly a bug in the .agi due to Asterisk 1.6 delimiter change behaviour.

    Best regards,
Sign In or Register to comment.