Skip to content

Commit

Permalink
added bridge action example. added GetConfig action
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelog committed Jan 4, 2011
1 parent 9591bfa commit a145c63
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 5 deletions.
1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Currently Supported Actions
* CoreSettings
* CoreShowChannels
* CoreStatus
* GetConfig
* Hangup
* Login
* Logoff
Expand Down
15 changes: 10 additions & 5 deletions docs/examples/quickstart/example.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
use PAMI\Message\Action\LogoffAction;
use PAMI\Message\Action\AbsoluteTimeoutAction;
use PAMI\Message\Action\OriginateAction;
use PAMI\Message\Action\BridgeAction;
use PAMI\Message\Action\GetConfigAction;

class A implements IEventListener
{
Expand Down Expand Up @@ -77,12 +79,15 @@ public function handle(EventMessage $event)
var_dump($a->send(new CoreSettingsAction()));
var_dump($a->send(new ListCategoriesAction('sip.conf')));
var_dump($a->send(new CoreStatusAction()));
$originateMsg = new OriginateAction('SIP/marcelog');
$originateMsg->setContext('netlabs');
$originateMsg->setPriority('1');
$originateMsg->setExtension('51992266');
var_dump($a->send($originateMsg));
var_dump($a->send(new GetConfigAction('extensions.conf')));
var_dump($a->send(new GetConfigAction('sip.conf', 'general')));
//$originateMsg = new OriginateAction('SIP/marcelog');
//$originateMsg->setContext('netlabs');
//$originateMsg->setPriority('1');
//$originateMsg->setExtension('51992266');
//var_dump($a->send($originateMsg));
//var_dump($a->send(new AbsoluteTimeoutAction('SIP/XXXX-123123', 10)));
//var_dump($a->send(new BridgeAction('SIP/a-1', 'SIP/a-2', true)));
//var_dump($a->send(new LogoffAction()));
//var_dump($a->send(new HangupAction('SIP/XXXX-123123')));
//var_dump($a->send(new ReloadAction()));
Expand Down
46 changes: 46 additions & 0 deletions src/mg/PAMI/Message/Action/GetConfigAction.php
Original file line number Diff line number Diff line change
@@ -1 +1,47 @@
<?php
/**
* GetConfig 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;

/**
* GetConfig 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 GetConfigAction extends ActionMessage
{
/**
* Constructor.
*
* @param string $filename Configuration filename (e.g.: foo.conf).
* @param boolean $category Category in configuration file.
*
* @return void
*/
public function __construct($filename, $category = false)
{
parent::__construct('GetConfig');
$this->setKey('Filename', $filename);
if ($category != false) {
$this->setKey('Category', $category);
}
}
}

0 comments on commit a145c63

Please sign in to comment.