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. FreePBX 2.10 bug

FreePBX 2.10 bug

Scheduled Pinned Locked Moved Support
6 Posts 2 Posters 64 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.
  • D
    D
    dcundiff
    wrote on last edited by
    #1

    This seemed like the best place to report a bug.

    I'm using the latest fop 2.26 and there's an issue when generating the buttons

    The following code in autoconfig-buttons-freepbx.sh detects FreePBX version 2.10 incorrectly.

    AMPVERSION=cat $AMPDIR | grep "<version>" | sed -e 's/<[^>]*>//g' | cut -b 2,4
    if [ $AMPVERSION -gt 25 ]; then
    QUEUECONTEXT="from-queue"
    else
    QUEUECONTEXT="from-internal"
    fi

    Its looking for AMPVERSION greater than 25 for versions above 2.5. With FreePBX version 2.10 the string thats returned in AMPVERSION is 21 making it set the wrong queue context. This causes a few features to break.

    This is the only place I see this getting detected incorrectly. Not sure if anything in the fop2_server binary would be effected but it seems to be breaking my users ability to add/remove themselves from queues and pause/unpause.

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

      Thanks for reporting the bug. You can fix it replacing the AMPVERSION line with:

      AMPVERSION=`cat /var/www/html/admin/modules/framework/module.xml | grep "<version>" | sed -e 's/<[^>]*>//g' | cut -d\. -f 1,2 | sed 's/\s//g' | sed 's/\.//g'`
      

      I will update the script for the next release.

      Thanks again!

      1 Reply Last reply
      0
      • D
        D
        dcundiff
        wrote on last edited by
        #3

        Thanks! That fixed the version string return.

        I think there may be some other incompatibility with 2.10 going on though.

        Agents that add themselves to a queue via FreePBX's various methods are being added as

        Name (Local/extension@from-queue/n)

        and cannot control their queue status via fop2.

        Agents that add themselves to a queue via fop2 function correctly and are added as

        Name (Local/extension@from-internal/n)

        Running the button script returns the following contexts for the phones

        context=from-internal
        queuecontext=from-queue

        Seems like something may be mixed up other than in the button script.

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

          The version check is exactly for the purpose of determining what context to use , either from-internal or from-queue.

          The license return should be now "210" and that is higher than "25", so it should use from-queue instead of from-internal.

          Run the autoconfig-buttons-freepbx.sh script and look at the output, you should see that from-queue is being used.

          1 Reply Last reply
          0
          • D
            D
            dcundiff
            wrote on last edited by
            #5

            The AMPVERSION string is being detected correctly now.

            The problem is the flash panel is still adding the agents with the wrong context.

            Here's the debug output showing incorrect context used.

            Response: Success
            Message: Added interface to queue
            Server: 0

            127.0.0.1 <- Event: QueueMemberAdded
            127.0.0.1 <- Privilege: agent,all
            127.0.0.1 <- Queue: 8900
            127.0.0.1 <- Location: Local/8090@from-internal/n
            127.0.0.1 <- MemberName: Daves Sandbox
            127.0.0.1 <- Membership: dynamic
            127.0.0.1 <- Penalty: 0
            127.0.0.1 <- CallsTaken: 0
            127.0.0.1 <- LastCall: 0
            127.0.0.1 <- Status: 5
            127.0.0.1 <- Paused: 0
            127.0.0.1 <- Server: 0

            The code generated by patched autoconfig-buttons-freepbx.sh for above button

            [USER/8090]
            type=extension
            extension=8090
            label=Daves Sandbox
            context=from-internal
            queuecontext=from-queue
            extenvoicemail=*
            privacy=none
            group=Support
            queuechannel=Local/8090@from-internal/n|Penalty=0|MemberName=Daves Sandbox|StateInterface=SIP/8090
            customastdb=CF/8090

            It looks like the queuechannel line is being set incorrectly. I dug a little deeper and found that in the fop2buttons table. Since that is generated by the FreePBX plugin I took a look at that code and sure enough, found the same bug.

            $ver = getversion();
            $ver = str_replace(".","",substr($ver,0,3));

            $ver is populated with the value 21 for FreePBX 2.10. The above bug is 3 places that I found in the plugin. I changed the substr function from 0,3 to 0,4 and its fixed. Having my users test functionality now.

            diff -u /root/fop2admin/functions.inc.php ./functions.inc.php
            --- /root/fop2admin/functions.inc.php	2012-06-05 17:20:39.000000000 -0400
            +++ ./functions.inc.php	2012-07-25 10:19:03.000000000 -0400
            @@ -6,7 +6,7 @@
             
                 $queuechannelString = fop2_set_queuemember_strings();
                 $ver = getversion();
            -    $ver = str_replace(".","",substr($ver,0,3));
            +    $ver = str_replace(".","",substr($ver,0,4));
             
                 if($ver>25) {
                     $qctx="from-queue";
            @@ -1276,7 +1276,7 @@
                 global $db, $astman;
             
                 $ver = getversion();
            -    $ver = str_replace(".","",substr($ver,0,3));
            +    $ver = str_replace(".","",substr($ver,0,4));
             
                 if($ver>25) {
                     $qctx="from-queue";
            Common subdirectories: /root/fop2admin/i18n and ./i18n
            diff -u /root/fop2admin/install.php ./install.php
            --- /root/fop2admin/install.php	2011-10-24 13:17:28.000000000 -0400
            +++ ./install.php	2012-07-25 10:18:45.000000000 -0400
            @@ -114,7 +114,7 @@
             $queuechannelString = fop2_set_queuemember_strings();
             
             $ver = getversion();
            -$ver = str_replace(".","",substr($ver,0,3));
            +$ver = str_replace(".","",substr($ver,0,4));
             
             if($ver>25) {
             	$qctx="from-queue";
            
            1 Reply Last reply
            0
            • N
              N
              nicolas
              wrote on last edited by
              #6

              Thanks again for finding/troubleshooting the issue! I will update fop2admin accordingly

              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