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. Device and User mode status updating

Device and User mode status updating

Scheduled Pinned Locked Moved Support
6 Posts 3 Posters 303 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.
  • W
    W
    wtsexton
    wrote on last edited by
    #1

    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

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

      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

      1 Reply Last reply
      0
      • W
        W
        wtsexton
        wrote on last edited by
        #3

        Got it working by modifying the agi.

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

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

          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.

          1 Reply Last reply
          0
          • W
            W
            wtsexton
            wrote on last edited by
            #5

            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.

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

              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;

              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