Queue agent status updates

On the dev box I setup, I initially had issues getting the agent to update successfully on logon/off. Now that I'm setting up the production systems I cannot seem to resolve the issue. Previously, it required modifying the user_login_out.agi as per the post [url:3nci2ste]http://www.fop2.com/forum/View Post 129[/url:3nci2ste]. Didn't help this time.

FOP2.20 final
FreePBX 2.9.0.7
Asterisk 1.8.3.3
Debian squeeze

Running fop2 in debug (./fop2_server -X 15), I do see the user events that, I believe, should be updating the client.
127.0.0.1       <- Event: UserEvent
127.0.0.1       <- Privilege: user,all
127.0.0.1       <- UserEvent: UserDeviceRemoved|Data: 219
127.0.0.1       <- 3219
127.0.0.1       <- Server: 0


127.0.0.1       <- Event: UserEvent
127.0.0.1       <- Privilege: user,all
127.0.0.1       <- UserEvent: UserDeviceAdded|Data: 219
127.0.0.1       <- 3219
127.0.0.1       <- Server: 0

Any help would be great.
Thanks

Comments

  • Hi,
    Running fop2 in debug (./fop2_server -X 15), I do see the user events that, I believe, should be updating the client.
    127.0.0.1       <- Event: UserEvent
    127.0.0.1       <- Privilege: user,all
    127.0.0.1       <- UserEvent: UserDeviceRemoved|Data: 219
    127.0.0.1       <- 3219
    127.0.0.1       <- Server: 0
    

    Any help would be great.
    Thanks

    The event is not correct, your user_login_out.agi is broken, The correct output from the event should be:
    127.0.0.1       <- Event: UserEvent
    127.0.0.1       <- Privilege: user,all
    127.0.0.1       <- UserEvent: UserDeviceRemoved
    127.0.0.1       <- Data: 219,3219
    127.0.0.1       <- Server: 0
    

    Previously, it required modifying the user_login_out.agi as per the post [url:36smhqro]http://www.fop2.com/forum/View Post 129[/url:36smhqro]. Didn't help this time.

    I would try with the user_login_out.agi script you had on the other server (backup your current one just in case). But that .agi is still broken. I think it does not work for asterisk 1.8. That should be reported to FreePBX. It is a FreePBX bug.
  • Yes, I had to try a few variations with the user_login_out.agi to get the data formatted correctly for fop2. It seems that under this version of freePBX, the line for asterisk 1.6.0 is correct.
    //if(version_compare(get_var("ASTVERSION"), "1.6.1", "ge")) {
    //      $user_event_body = "\"UserDeviceAdded|Data: {$user}\\,{$device}\"";
    //} else if(version_compare(get_var("ASTVERSION"), "1.6.0", "ge")) {
    //      $user_event_body = "UserDeviceAdded,\"Data: {$user}\\\\,{$device}\"";
    //} else {
    //      $user_event_body = "\"UserDeviceAdded|Data: {$user},{$device}\"";
    //}
    $user_event_body = "UserDeviceAdded,\"Data: {$user}\\\\,{$device}\"";
    
    ...
    
    //if(version_compare(get_var("ASTVERSION"), "1.6.1", "ge")) {
    //     $user_event_body = "\"UserDeviceRemoved|Data: {$current_user}\\,{$device}\"";
    //} else if(version_compare(get_var("ASTVERSION"), "1.6.0", "ge")) {
    //     $user_event_body = "UserDeviceRemoved,\"Data: {$current_user}\\\\,{$device}\"";
    //} else {
    //     $user_event_body = "\"UserDeviceRemoved|Data: {$current_user},{$device}\"";
    //}
    $user_event_body = "UserDeviceRemoved,\"Data: {$current_user}\\\\,{$device}\"";
    

    Now I just have to remember to replicate this change for any core FreePBX updates.

    Thanks Nicolás.
  • edited January 30

    Sorry to wake such an old post but I'm having this problem and haven't been able to solve it.
    I have Elastix 2.5 and FOP 2.28. When using Users and Devices, when I login, most of the time (but not all) the extension that was on the device continues to show it's in a call to *11 and continues to look as thought connected, and when I logoff, the state of the user appears as though still logged in and the *12 call still active (forever).
    The event I see in debug mode looks correct:
    127.0.0.1 <- Event: UserEvent
    127.0.0.1 <- Privilege: user,all
    127.0.0.1 <- UserEvent: UserDeviceRemoved
    127.0.0.1 <- Uniqueid: 1580380014.8496411
    127.0.0.1 <- Data: 51133,44444

    Which event is it looking at?

    I noticed the hangup event is usually right before it notifies the browser and the AccountCode is missing and the CallerIdNum is the new user on the device:
    127.0.0.1 <- Event: Hangup 127.0.0.1 <- Privilege: call,all 127.0.0.1 <- Channel: SIP/44444-00237eb8 127.0.0.1 <- Uniqueid: 1580379756.8495839 127.0.0.1 <- CallerIDNum: 44444 127.0.0.1 <- CallerIDName: device 127.0.0.1 <- ConnectedLineNum: <unknown>
    127.0.0.1 <- ConnectedLineName: <unknown>
    127.0.0.1 <- AccountCode:
    127.0.0.1 <- Cause: 16
    127.0.0.1 <- Cause-txt: Normal Clearing
    Any ideas?

Sign In or Register to comment.