Device and User mode status updating

I've got a number of devices and users set up for adhoc which all appear to be working. Phone monitoring extensions show the extensions when logged in and not when not logged in. However FOP2 will only show the changes if the daemon is restarted each time someone logs in or out. Looking for a little guidance on what to look for.

Running FreePBX 2.9.0.7 on FreePBX distro 1.86.29.55
and fop2_server version 2.23

Comments

  • There is a bug in the user_login_out.agi in FreePBX that sents an incorrectly formatted UserEvent. I am not sure if that bug was fixed. The problem has to do with Asterisk versions and the way you must format parameters, the version comparison is incorrect and sends 1.4 format over asterisk 1.8.

    Look at the last posts in this thread:

    View Post 129&p=519&hilit=out.agi#p476
  • Got it working by modifying the agi.

    Seems when they switched to 1.8 in the distro they neglected to update the agi scripts.
  • Got it working by modifying the agi.

    Seems when they switched to 1.8 in the distro they neglected to update the agi scripts.

    I have the same problem and asterisk/freepbx versions
    what exactly did you modifyed in agi?

    I'm trying to do this:

    set_hint($user, $new_devices);
    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}\"";
    }
    //Added for FOP2 by
    $user_event_body = "\"UserDeviceAdded,Data: {$user}\\\\,{$device}\"";

    $agi->exec("UserEvent", $user_event_body);

    but still have the problem.
  • It was fixed in 2.11

    http://code.freepbx.org/viewrep/FreePBX ... =&r2=16285

    Shows the changes made, you should be able to use those changes on any version.
  • Thanks a lot..everything is fine now.
    Here is a code:

    // start replaced by Sipk;
    set_queue_hint($user, $device);
    if (version_compare(get_var("ASTVERSION"), "1.8.21.0", "ge")) {
    $user_event_body = "\"UserDeviceAdded,Data: {$user}\\\\,{$device}\"";
    } else 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}\"";
    }
    // end replaced by Sipk;



    // start replaced by Sipk;
    if(version_compare(get_var("ASTVERSION"), "1.8.21.0", "ge")) {
    $user_event_body = "\"UserDeviceRemoved,Data: {$current_user}\\\\,{$device}\"";
    } else 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}\"";
    }

    // end replaced by Sipk;
Sign In or Register to comment.