Presense change question

  1. 11 years ago

    I have a call center that uses a queue in FreePBX. If an agent changes the presence status to anything but "Available" in FOP2, it sets the presence to Do Not Disturb. This repesents some issues in FreePBX as to how the call is routed under my configuration.

    I found the options for editing the presence.js file to list different options, however, is there a way to PAUSE the agent using that availability setting instead of setting them to DND?

    Thanks

    -peter

  2. admin

    19 Sep 2013 Administrator

    There is a way to change behavior and use queue pauses instead of DND, by modyfing FOP2Callbacks.pm and creating a custom context in Asterisk. It is not that simple to do, but neither that complicated. There is no standard recipe as queues and members can vary from installation to installation, and so your custom context must match your setup. Basically, in FOP2Callbacks.pm you intercept the change presence action and instead of setting and ASTDB entry for it, you originate a call to your custom context:

    In FOP2Callbacks.pm flashcommand function:

        if($command eq "setastdb") {
    
            # Pause Local/xxxx@from-queue/n
    
            $return = "Action: Originate\r\n";
            $return .= "Channel: Local/".$parameters[2].":".$parameters[3];
            $return .= "\@custom-logpause-freepbx\r\n";
            $return .= "Application: Noop\r\n";
            $return .= "\r\n";
            push @allreturn, $return;
            return @allreturn;
    

    And your custom-logpause context in the dialplan:

    [custom-logpause-freepbx]
    exten => _X.,1,Verbose(Exten ${EXTEN})
    exten => _X.,n,Set(ACLIDNUM=${CUT(EXTEN,:,1)})
    exten => _X.,n,Set(PAUSECODE=${CUT(EXTEN,:,2)})
    exten => _X.,n,Set(MIAGENTE=Local/${ACLIDNUM}@from-queue/n)
    exten => _X.,n,Verbose(MIAGENTE  = ${MIAGENTE})
    exten => _X.,n,Verbose(ACLIDNUM  = ${ACLIDNUM})
    exten => _X.,n,Verbose(PAUSECODE = ${PAUSECODE})
    exten => _X.,n,GotoIf($[ "x${PAUSECODE}" = "x" ]?unpause)
    exten => _X.,n(pause),QueueLog(NONE,NONE,${MIAGENTE},PAUSE,${PAUSECODE})
    exten => _X.,n,PauseQueueMember(,${MIAGENTE},,${PAUSECODE})
    exten => _X.,n,Set(DB(PAUSECUSTOM/${ACLIDNUM})=${PAUSECODE}:${EPOCH})
    exten => _X.,n,Goto(end)
    exten => _X.,n(unpause),QueueLog(NONE,NONE,${MIAGENTE},UNPAUSE)
    exten => _X.,n,UnPauseQueueMember(,${MIAGENTE})
    exten => _X.,n,NoOp(${DB_DELETE(PAUSECUSTOM/${ACLIDNUM})})
    exten => _X.,n(end),Verbose(Fin log pausa)
    exten => _X.,n,Hangup

or Sign Up to reply!