Skip to content

Commit

Permalink
added QueuePenalty Action
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelog committed Jan 26, 2011
1 parent 1787d44 commit 0b63e02
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/examples/quickstart/example.php
Expand Up @@ -86,6 +86,7 @@
use PAMI\Message\Action\QueueRemoveAction;
use PAMI\Message\Action\QueueUnpauseAction;
use PAMI\Message\Action\QueueLogAction;
use PAMI\Message\Action\QueuePenaltyAction;
use PAMI\Message\Action\MonitorAction;
use PAMI\Message\Action\PauseMonitorAction;
use PAMI\Message\Action\UnpauseMonitorAction;
Expand Down Expand Up @@ -171,6 +172,7 @@ public function handle(EventMessage $event)
var_dump($a->send(new ShowDialPlanAction()));
var_dump($a->send(new QueueSummaryAction()));
var_dump($a->send(new QueueLogAction('a', 'asdasd')));
var_dump($a->send(new QueuePenaltyAction('Agent/123', '123')));
//
// The following are commented just in case you run it in the wrong box ;)
//
Expand Down
48 changes: 48 additions & 0 deletions src/mg/PAMI/Message/Action/QueuePenaltyAction.php
@@ -0,0 +1,48 @@
<?php
/**
* QueuePenalty action message.
*
* PHP Version 5
*
* @category Pami
* @package Message
* @subpackage Action
* @author Marcelo Gornstein <marcelog@gmail.com>
* @license http://www.noneyet.ar/ Apache License 2.0
* @version SVN: $Id$
* @link http://www.noneyet.ar/
*/
namespace PAMI\Message\Action;

/**
* QueuePenalty action message.
*
* PHP Version 5
*
* @category Pami
* @package Message
* @subpackage Action
* @author Marcelo Gornstein <marcelog@gmail.com>
* @license http://www.noneyet.ar/ Apache License 2.0
* @link http://www.noneyet.ar/
*/
class QueuePenaltyAction extends ActionMessage
{
/**
* Constructor.
*
* @param string $queue Queue name.
* @param string $event Event.
*
* @return void
*/
public function __construct($interface, $penalty, $queue = false)
{
parent::__construct('QueuePenalty');
$this->setKey('Interface', $interface);
$this->setKey('Penalty', $penalty);
if ($queue !== false) {
$this->setKey('Queue', $queue);
}
}
}

0 comments on commit 0b63e02

Please sign in to comment.