-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #114 from thomasvargiu/feature/new-actions
Added new actions for Asterisk 12-14
- Loading branch information
Showing
8 changed files
with
450 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
/** | ||
* BlindTransfer action message. | ||
* | ||
* PHP Version 5 | ||
* | ||
* @category Pami | ||
* @package Message | ||
* @subpackage Action | ||
* @author Marcelo Gornstein <[email protected]> | ||
* @license http://marcelog.github.com/PAMI/ Apache License 2.0 | ||
* @version SVN: $Id$ | ||
* @link http://marcelog.github.com/PAMI/ | ||
* | ||
* Copyright 2011 Marcelo Gornstein <[email protected]> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
namespace PAMI\Message\Action; | ||
|
||
/** | ||
* BlindTransfer action message. | ||
* | ||
* PHP Version 5 | ||
* | ||
* @category Pami | ||
* @package Message | ||
* @subpackage Action | ||
* @author Marcelo Gornstein <[email protected]> | ||
* @license http://marcelog.github.com/PAMI/ Apache License 2.0 | ||
* @link http://marcelog.github.com/PAMI/ | ||
*/ | ||
class BlindTransferAction extends ActionMessage | ||
{ | ||
/** | ||
* Constructor. | ||
* | ||
* @param string $channel Transferer's channel. | ||
* @param string $extension Extension to transfer to. | ||
* @param string $context Context to transfer to. | ||
*/ | ||
public function __construct($channel, $extension, $context) | ||
{ | ||
parent::__construct('BlindTransfer'); | ||
$this->setKey('Channel', $channel); | ||
$this->setKey('Exten', $extension); | ||
$this->setKey('Context', $context); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,56 @@ | ||
<?php | ||
/** | ||
* Challenge action message. | ||
* | ||
* PHP Version 5 | ||
* | ||
* @category Pami | ||
* @package Message | ||
* @subpackage Action | ||
* @author Marcelo Gornstein <[email protected]> | ||
* @license http://marcelog.github.com/PAMI/ Apache License 2.0 | ||
* @version SVN: $Id$ | ||
* @link http://marcelog.github.com/PAMI/ | ||
* | ||
* Copyright 2011 Marcelo Gornstein <[email protected]> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
namespace PAMI\Message\Action; | ||
|
||
/** | ||
* Challenge action message. | ||
* | ||
* PHP Version 5 | ||
* | ||
* @category Pami | ||
* @package Message | ||
* @subpackage Action | ||
* @author Marcelo Gornstein <[email protected]> | ||
* @license http://marcelog.github.com/PAMI/ Apache License 2.0 | ||
* @link http://marcelog.github.com/PAMI/ | ||
*/ | ||
class ChallengeAction extends ActionMessage | ||
{ | ||
/** | ||
* Constructor. | ||
* | ||
* @param string $authType Auth type | ||
*/ | ||
public function __construct($authType = 'MD5') | ||
{ | ||
parent::__construct('Challenge'); | ||
$this->setKey('AuthType', $authType); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,56 @@ | ||
<?php | ||
/** | ||
* DAHDITransfer action message. | ||
* | ||
* PHP Version 5 | ||
* | ||
* @category Pami | ||
* @package Message | ||
* @subpackage Action | ||
* @author Marcelo Gornstein <[email protected]> | ||
* @license http://marcelog.github.com/PAMI/ Apache License 2.0 | ||
* @version SVN: $Id$ | ||
* @link http://marcelog.github.com/PAMI/ | ||
* | ||
* Copyright 2011 Marcelo Gornstein <[email protected]> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
namespace PAMI\Message\Action; | ||
|
||
/** | ||
* DAHDITransfer action message. | ||
* | ||
* PHP Version 5 | ||
* | ||
* @category Pami | ||
* @package Message | ||
* @subpackage Action | ||
* @author Marcelo Gornstein <[email protected]> | ||
* @license http://marcelog.github.com/PAMI/ Apache License 2.0 | ||
* @link http://marcelog.github.com/PAMI/ | ||
*/ | ||
class DAHDITransferAction extends ActionMessage | ||
{ | ||
/** | ||
* Constructor. | ||
* | ||
* @param string $channel DAHDIChannel | ||
*/ | ||
public function __construct($channel) | ||
{ | ||
parent::__construct('DAHDITransfer'); | ||
$this->setKey('DAHDIChannel', $channel); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?php | ||
/** | ||
* MixMonitorMute action message. | ||
* | ||
* PHP Version 5 | ||
* | ||
* @category Pami | ||
* @package Message | ||
* @subpackage Action | ||
* @author Matt Styles <[email protected]> | ||
* @license http://marcelog.github.com/PAMI/ Apache License 2.0 | ||
* @version SVN: $Id$ | ||
* @link http://marcelog.github.com/PAMI/ | ||
* | ||
* Copyright 2011 Marcelo Gornstein <[email protected]> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
namespace PAMI\Message\Action; | ||
|
||
/** | ||
* MixMonitorMute action message. | ||
* | ||
* PHP Version 5 | ||
* | ||
* @category Pami | ||
* @package Message | ||
* @subpackage Action | ||
* @author Matt Styles <[email protected]> | ||
* @license http://marcelog.github.com/PAMI/ Apache License 2.0 | ||
* @link http://marcelog.github.com/PAMI/ | ||
*/ | ||
class MixMonitorMuteAction extends ActionMessage | ||
{ | ||
const DIRECTION_READ = 'read'; | ||
const DIRECTION_WRITE = 'write'; | ||
const DIRECTION_BOTH = 'both'; | ||
|
||
/** | ||
* Sets state key. | ||
* | ||
* @param bool $state Mute state | ||
* | ||
* @return void | ||
*/ | ||
public function setState($state) | ||
{ | ||
$this->setKey('State', $state ? 1 : 0); | ||
} | ||
|
||
/** | ||
* Sets state key. | ||
* | ||
* @param string $direction Which part of the recording to mute: | ||
* read, write or both (from channel, to channel or both channels). | ||
* | ||
* @return void | ||
*/ | ||
public function setDirection($direction) | ||
{ | ||
$this->setKey('Direction', $direction); | ||
} | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param string $channel Channel on which to act. | ||
* @param bool $state Turn mute on or off | ||
* @param string $direction Which part of the recording to mute: | ||
* read, write or both (from channel, to channel or both channels). | ||
*/ | ||
public function __construct($channel, $state = true, $direction = 'both') | ||
{ | ||
parent::__construct('MixMonitorMute'); | ||
$this->setKey('Channel', $channel); | ||
$this->setState($state); | ||
$this->setDirection($direction); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,60 @@ | ||
<?php | ||
/** | ||
* UserEvent action message. | ||
* | ||
* PHP Version 5 | ||
* | ||
* @category Pami | ||
* @package Message | ||
* @subpackage Action | ||
* @author Marcelo Gornstein <[email protected]> | ||
* @license http://marcelog.github.com/PAMI/ Apache License 2.0 | ||
* @version SVN: $Id$ | ||
* @link http://marcelog.github.com/PAMI/ | ||
* | ||
* Copyright 2011 Marcelo Gornstein <[email protected]> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
namespace PAMI\Message\Action; | ||
|
||
/** | ||
* UserEvent action message. | ||
* | ||
* PHP Version 5 | ||
* | ||
* @category Pami | ||
* @package Message | ||
* @subpackage Action | ||
* @author Marcelo Gornstein <[email protected]> | ||
* @license http://marcelog.github.com/PAMI/ Apache License 2.0 | ||
* @link http://marcelog.github.com/PAMI/ | ||
*/ | ||
class UserEventAction extends ActionMessage | ||
{ | ||
/** | ||
* Constructor. | ||
* | ||
* @param string $userEvent UserEvent | ||
* @param array $headers | ||
*/ | ||
public function __construct($userEvent, array $headers = []) | ||
{ | ||
parent::__construct('UserEvent'); | ||
$this->setKey('UserEvent', $userEvent); | ||
foreach ($headers as $key => $value) { | ||
$this->setKey((string)$key, (string)$value); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,56 @@ | ||
<?php | ||
/** | ||
* WaitEvent action message. | ||
* | ||
* PHP Version 5 | ||
* | ||
* @category Pami | ||
* @package Message | ||
* @subpackage Action | ||
* @author Marcelo Gornstein <[email protected]> | ||
* @license http://marcelog.github.com/PAMI/ Apache License 2.0 | ||
* @version SVN: $Id$ | ||
* @link http://marcelog.github.com/PAMI/ | ||
* | ||
* Copyright 2011 Marcelo Gornstein <[email protected]> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
namespace PAMI\Message\Action; | ||
|
||
/** | ||
* WaitEvent action message. | ||
* | ||
* PHP Version 5 | ||
* | ||
* @category Pami | ||
* @package Message | ||
* @subpackage Action | ||
* @author Marcelo Gornstein <[email protected]> | ||
* @license http://marcelog.github.com/PAMI/ Apache License 2.0 | ||
* @link http://marcelog.github.com/PAMI/ | ||
*/ | ||
class WaitEventAction extends ActionMessage | ||
{ | ||
/** | ||
* Constructor. | ||
* | ||
* @param int $timeout Timeout in seconds | ||
*/ | ||
public function __construct($timeout) | ||
{ | ||
parent::__construct('WaitEvent'); | ||
$this->setKey('Timeout', (int)$timeout); | ||
} | ||
} |
Oops, something went wrong.