From c7d31699eeaf2ae02d5922a93fa775b48b8f405a Mon Sep 17 00:00:00 2001 From: Matt Styles Date: Mon, 9 Oct 2017 10:45:42 -0600 Subject: [PATCH] Add ConfbridgeList action and corresponding response events The ConfbridgeList AMI action lists all users in a particular ConfBridge conference. ConfbridgeList will follow as separate events, followed by a final event called ConfbridgeListComplete. Resolves #146 --- README.md | 4 +- ...AMI-Message-Action-ConfbridgeListAction.md | 310 ++++++++++ ...ssage-Event-ConfbridgeListCompleteEvent.md | 402 +++++++++++++ doc/PAMI-Message-Event-ConfbridgeListEvent.md | 532 ++++++++++++++++++ .../Message/Action/ConfbridgeListAction.php | 58 ++ .../Event/ConfbridgeListCompleteEvent.php | 57 ++ .../Message/Event/ConfbridgeListEvent.php | 155 +++++ test/actions/Test_Actions.php | 15 + test/events/Test_Events.php | 16 + 9 files changed, 1548 insertions(+), 1 deletion(-) create mode 100644 doc/PAMI-Message-Action-ConfbridgeListAction.md create mode 100644 doc/PAMI-Message-Event-ConfbridgeListCompleteEvent.md create mode 100644 doc/PAMI-Message-Event-ConfbridgeListEvent.md create mode 100644 src/PAMI/Message/Action/ConfbridgeListAction.php create mode 100644 src/PAMI/Message/Event/ConfbridgeListCompleteEvent.php create mode 100644 src/PAMI/Message/Event/ConfbridgeListEvent.php diff --git a/README.md b/README.md index 50801dc24..0be4e82b9 100644 --- a/README.md +++ b/README.md @@ -118,10 +118,11 @@ can still catch them. If you catch one of these, please report it! * BridgeInfoComplete * CEL * ChannelUpdate -* ConfbridgeStart * ConfbridgeEnd * ConfbridgeJoin * ConfbridgeLeave +* ConfbridgeList +* ConfbridgeListComplete * ConfbridgeMute * ConfbridgeStart * ConfbridgeTalking @@ -205,6 +206,7 @@ can still catch them. If you catch one of these, please report it! * BridgeInfo * ChangeMonitor * Command +* ConfbridgeList * ConfbridgeMute * ConfbridgeUnmute * CoreSettings diff --git a/doc/PAMI-Message-Action-ConfbridgeListAction.md b/doc/PAMI-Message-Action-ConfbridgeListAction.md new file mode 100644 index 000000000..21e6019de --- /dev/null +++ b/doc/PAMI-Message-Action-ConfbridgeListAction.md @@ -0,0 +1,310 @@ +PAMI\Message\Action\ConfbridgeListAction +=============== + +Lists all users in a particular ConfBridge conference. + +PHP Version 5 + + +* Class name: ConfbridgeListAction +* Namespace: PAMI\Message\Action +* Parent class: [PAMI\Message\Action\ActionMessage](PAMI-Message-Action-ActionMessage.md) + + + +Constants +---------- + + +### EOL + + const EOL = "\r\n" + + + + + +### EOM + + const EOM = "\r\n\r\n" + + + + + +Properties +---------- + + +### $lines + + protected array $lines + +Message content, line by line. This is what it gets sent +or received literally. + + + +* Visibility: **protected** + + +### $variables + + protected array $variables + +Metadata. Message variables (key/value). + + + +* Visibility: **protected** + + +### $keys + + protected array $keys + +Metadata. Message "keys" i.e: Action: login + + + +* Visibility: **protected** + + +### $createdDate + + protected integer $createdDate + +Created date (unix timestamp). + + + +* Visibility: **protected** + + +Methods +------- + + +### __construct + + void PAMI\Message\Message::__construct() + +Constructor. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + + +### setActionID + + void PAMI\Message\Action\ActionMessage::setActionID($actionID) + +Sets Action ID. + +The ActionID can be at most 69 characters long, according to +[Asterisk Issue 14847](https://issues.asterisk.org/jira/browse/14847). + +Therefore we'll throw an exception when the ActionID is too long. + +* Visibility: **public** +* This method is defined by [PAMI\Message\Action\ActionMessage](PAMI-Message-Action-ActionMessage.md) + + +#### Arguments +* $actionID **mixed** - <p>The Action ID to have this action known by</p> + + + +### __sleep + + array PAMI\Message\Message::__sleep() + +Serialize function. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + + +### getCreatedDate + + integer PAMI\Message\Message::getCreatedDate() + +Returns created date. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + + +### setVariable + + void PAMI\Message\Message::setVariable(string $key, string $value) + +Adds a variable to this message. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + +#### Arguments +* $key **string** - <p>Variable name.</p> +* $value **string** - <p>Variable value.</p> + + + +### getVariable + + string PAMI\Message\Message::getVariable(string $key) + +Returns a variable by name. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + +#### Arguments +* $key **string** - <p>Variable name.</p> + + + +### setKey + + void PAMI\Message\Message::setKey(string $key, string $value) + +Adds a variable to this message. + + + +* Visibility: **protected** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + +#### Arguments +* $key **string** - <p>Key name (i.e: Action).</p> +* $value **string** - <p>Key value.</p> + + + +### getKey + + string PAMI\Message\Message::getKey(string $key) + +Returns a key by name. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + +#### Arguments +* $key **string** - <p>Key name (i.e: Action).</p> + + + +### getKeys + + array PAMI\Message\Message::getKeys() + +Returns all keys for this message. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + + +### getVariables + + array PAMI\Message\Message::getVariables() + +Returns all variabels for this message. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + + +### finishMessage + + string PAMI\Message\Message::finishMessage($message) + +Returns the end of message token appended to the end of a given message. + + + +* Visibility: **protected** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + +#### Arguments +* $message **mixed** + + + +### serializeVariable + + string PAMI\Message\Message::serializeVariable(string $key, string $value) + +Returns the string representation for an ami action variable. + + + +* Visibility: **private** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + +#### Arguments +* $key **string** +* $value **string** + + + +### serialize + + string PAMI\Message\Message::serialize() + +Gives a string representation for this message, ready to be sent to +ami. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + + +### getActionID + + string PAMI\Message\Message::getActionID() + +Returns key: 'ActionID'. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + diff --git a/doc/PAMI-Message-Event-ConfbridgeListCompleteEvent.md b/doc/PAMI-Message-Event-ConfbridgeListCompleteEvent.md new file mode 100644 index 000000000..b482a0345 --- /dev/null +++ b/doc/PAMI-Message-Event-ConfbridgeListCompleteEvent.md @@ -0,0 +1,402 @@ +PAMI\Message\Event\ConfbridgeListCompleteEvent +=============== + +Event triggered for the end of the list when an action ConfbridgeList is issued. + +PHP Version 5 + + +* Class name: ConfbridgeListCompleteEvent +* Namespace: PAMI\Message\Event +* Parent class: [PAMI\Message\Event\EventMessage](PAMI-Message-Event-EventMessage.md) + + + +Constants +---------- + + +### EOL + + const EOL = "\r\n" + + + + + +### EOM + + const EOM = "\r\n\r\n" + + + + + +Properties +---------- + + +### $rawContent + + protected string $rawContent + +Holds original message. + + + +* Visibility: **protected** + + +### $channelVariables + + protected array $channelVariables + +Metadata. Specific channel variables. + + + +* Visibility: **protected** + + +### $lines + + protected array $lines + +Message content, line by line. This is what it gets sent +or received literally. + + + +* Visibility: **protected** + + +### $variables + + protected array $variables + +Metadata. Message variables (key/value). + + + +* Visibility: **protected** + + +### $keys + + protected array $keys + +Metadata. Message "keys" i.e: Action: login + + + +* Visibility: **protected** + + +### $createdDate + + protected integer $createdDate + +Created date (unix timestamp). + + + +* Visibility: **protected** + + +Methods +------- + + +### getListItems + + string PAMI\Message\Event\ConfbridgeListCompleteEvent::getListItems() + +Returns key: 'ListItems'. + + + +* Visibility: **public** + + + + +### getName + + string PAMI\Message\Event\EventMessage::getName() + +Returns key 'Event'. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Event\EventMessage](PAMI-Message-Event-EventMessage.md) + + + + +### __sleep + + array PAMI\Message\Message::__sleep() + +Serialize function. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + + +### getEventList + + string PAMI\Message\IncomingMessage::getEventList() + +Returns key 'EventList'. In respones, this will surely be a "start". In +events, should be a "complete". + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\IncomingMessage](PAMI-Message-IncomingMessage.md) + + + + +### getRawContent + + string PAMI\Message\IncomingMessage::getRawContent() + +Returns the original message content without parsing. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\IncomingMessage](PAMI-Message-IncomingMessage.md) + + + + +### getAllChannelVariables + + array PAMI\Message\IncomingMessage::getAllChannelVariables() + +Returns the channel variables for all reported channels. + +https://github.com/marcelog/PAMI/issues/85 + +The channel names will be lowercased. + +* Visibility: **public** +* This method is defined by [PAMI\Message\IncomingMessage](PAMI-Message-IncomingMessage.md) + + + + +### getChannelVariables + + array PAMI\Message\IncomingMessage::getChannelVariables(string $channel) + +Returns the channel variables for the given channel. + +https://github.com/marcelog/PAMI/issues/85 + +* Visibility: **public** +* This method is defined by [PAMI\Message\IncomingMessage](PAMI-Message-IncomingMessage.md) + + +#### Arguments +* $channel **string** - <p>Channel name. If not given, will return variables +for the "current" channel.</p> + + + +### __construct + + void PAMI\Message\Message::__construct() + +Constructor. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + + +### getCreatedDate + + integer PAMI\Message\Message::getCreatedDate() + +Returns created date. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + + +### setVariable + + void PAMI\Message\Message::setVariable(string $key, string $value) + +Adds a variable to this message. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + +#### Arguments +* $key **string** - <p>Variable name.</p> +* $value **string** - <p>Variable value.</p> + + + +### getVariable + + string PAMI\Message\Message::getVariable(string $key) + +Returns a variable by name. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + +#### Arguments +* $key **string** - <p>Variable name.</p> + + + +### setKey + + void PAMI\Message\Message::setKey(string $key, string $value) + +Adds a variable to this message. + + + +* Visibility: **protected** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + +#### Arguments +* $key **string** - <p>Key name (i.e: Action).</p> +* $value **string** - <p>Key value.</p> + + + +### getKey + + string PAMI\Message\Message::getKey(string $key) + +Returns a key by name. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + +#### Arguments +* $key **string** - <p>Key name (i.e: Action).</p> + + + +### getKeys + + array PAMI\Message\Message::getKeys() + +Returns all keys for this message. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + + +### getVariables + + array PAMI\Message\Message::getVariables() + +Returns all variabels for this message. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + + +### finishMessage + + string PAMI\Message\Message::finishMessage($message) + +Returns the end of message token appended to the end of a given message. + + + +* Visibility: **protected** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + +#### Arguments +* $message **mixed** + + + +### serializeVariable + + string PAMI\Message\Message::serializeVariable(string $key, string $value) + +Returns the string representation for an ami action variable. + + + +* Visibility: **private** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + +#### Arguments +* $key **string** +* $value **string** + + + +### serialize + + string PAMI\Message\Message::serialize() + +Gives a string representation for this message, ready to be sent to +ami. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + + +### getActionID + + string PAMI\Message\Message::getActionID() + +Returns key: 'ActionID'. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + diff --git a/doc/PAMI-Message-Event-ConfbridgeListEvent.md b/doc/PAMI-Message-Event-ConfbridgeListEvent.md new file mode 100644 index 000000000..5cf937cf4 --- /dev/null +++ b/doc/PAMI-Message-Event-ConfbridgeListEvent.md @@ -0,0 +1,532 @@ +PAMI\Message\Event\ConfbridgeListEvent +=============== + +Event triggered when an action ConfbridgeList is issued. + +PHP Version 5 + + +* Class name: ConfbridgeListEvent +* Namespace: PAMI\Message\Event +* Parent class: [PAMI\Message\Event\EventMessage](PAMI-Message-Event-EventMessage.md) + + + +Constants +---------- + + +### EOL + + const EOL = "\r\n" + + + + + +### EOM + + const EOM = "\r\n\r\n" + + + + + +Properties +---------- + + +### $rawContent + + protected string $rawContent + +Holds original message. + + + +* Visibility: **protected** + + +### $channelVariables + + protected array $channelVariables + +Metadata. Specific channel variables. + + + +* Visibility: **protected** + + +### $lines + + protected array $lines + +Message content, line by line. This is what it gets sent +or received literally. + + + +* Visibility: **protected** + + +### $variables + + protected array $variables + +Metadata. Message variables (key/value). + + + +* Visibility: **protected** + + +### $keys + + protected array $keys + +Metadata. Message "keys" i.e: Action: login + + + +* Visibility: **protected** + + +### $createdDate + + protected integer $createdDate + +Created date (unix timestamp). + + + +* Visibility: **protected** + + +Methods +------- + + +### getConference + + string PAMI\Message\Event\ConfbridgeListEvent::getConference() + +Returns key: 'Conference'. + + + +* Visibility: **public** + + + + +### getChannel + + string PAMI\Message\Event\ConfbridgeListEvent::getChannel() + +Returns key: 'Channel'. + + + +* Visibility: **public** + + + + +### getCallerIDNum + + string PAMI\Message\Event\ConfbridgeListEvent::getCallerIDNum() + +Returns key: 'CallerIDNum'. + + + +* Visibility: **public** + + + + +### getCallerIDName + + string PAMI\Message\Event\ConfbridgeListEvent::getCallerIDName() + +Returns key: 'CallerIDName'. + + + +* Visibility: **public** + + + + +### getMarkedUser + + string PAMI\Message\Event\ConfbridgeListEvent::getMarkedUser() + +Returns key: 'MarkedUser'. + + + +* Visibility: **public** + + + + +### getWaitMarked + + string PAMI\Message\Event\ConfbridgeListEvent::getWaitMarked() + +Returns key: 'WaitMarked'. + + + +* Visibility: **public** + + + + +### getEndMarked + + string PAMI\Message\Event\ConfbridgeListEvent::getEndMarked() + +Returns key: 'EndMarked'. + + + +* Visibility: **public** + + + + +### getWaiting + + string PAMI\Message\Event\ConfbridgeListEvent::getWaiting() + +Returns key: 'Waiting'. + + + +* Visibility: **public** + + + + +### getMuted + + string PAMI\Message\Event\ConfbridgeListEvent::getMuted() + +Returns key: 'Muted'. + + + +* Visibility: **public** + + + + +### getAnsweredTime + + string PAMI\Message\Event\ConfbridgeListEvent::getAnsweredTime() + +Returns key: 'AnsweredTime'. + + + +* Visibility: **public** + + + + +### getAdmin + + string PAMI\Message\Event\ConfbridgeListEvent::getAdmin() + +Returns key: 'Admin'. + + + +* Visibility: **public** + + + + +### getName + + string PAMI\Message\Event\EventMessage::getName() + +Returns key 'Event'. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Event\EventMessage](PAMI-Message-Event-EventMessage.md) + + + + +### __sleep + + array PAMI\Message\Message::__sleep() + +Serialize function. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + + +### getEventList + + string PAMI\Message\IncomingMessage::getEventList() + +Returns key 'EventList'. In respones, this will surely be a "start". In +events, should be a "complete". + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\IncomingMessage](PAMI-Message-IncomingMessage.md) + + + + +### getRawContent + + string PAMI\Message\IncomingMessage::getRawContent() + +Returns the original message content without parsing. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\IncomingMessage](PAMI-Message-IncomingMessage.md) + + + + +### getAllChannelVariables + + array PAMI\Message\IncomingMessage::getAllChannelVariables() + +Returns the channel variables for all reported channels. + +https://github.com/marcelog/PAMI/issues/85 + +The channel names will be lowercased. + +* Visibility: **public** +* This method is defined by [PAMI\Message\IncomingMessage](PAMI-Message-IncomingMessage.md) + + + + +### getChannelVariables + + array PAMI\Message\IncomingMessage::getChannelVariables(string $channel) + +Returns the channel variables for the given channel. + +https://github.com/marcelog/PAMI/issues/85 + +* Visibility: **public** +* This method is defined by [PAMI\Message\IncomingMessage](PAMI-Message-IncomingMessage.md) + + +#### Arguments +* $channel **string** - <p>Channel name. If not given, will return variables +for the "current" channel.</p> + + + +### __construct + + void PAMI\Message\Message::__construct() + +Constructor. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + + +### getCreatedDate + + integer PAMI\Message\Message::getCreatedDate() + +Returns created date. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + + +### setVariable + + void PAMI\Message\Message::setVariable(string $key, string $value) + +Adds a variable to this message. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + +#### Arguments +* $key **string** - <p>Variable name.</p> +* $value **string** - <p>Variable value.</p> + + + +### getVariable + + string PAMI\Message\Message::getVariable(string $key) + +Returns a variable by name. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + +#### Arguments +* $key **string** - <p>Variable name.</p> + + + +### setKey + + void PAMI\Message\Message::setKey(string $key, string $value) + +Adds a variable to this message. + + + +* Visibility: **protected** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + +#### Arguments +* $key **string** - <p>Key name (i.e: Action).</p> +* $value **string** - <p>Key value.</p> + + + +### getKey + + string PAMI\Message\Message::getKey(string $key) + +Returns a key by name. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + +#### Arguments +* $key **string** - <p>Key name (i.e: Action).</p> + + + +### getKeys + + array PAMI\Message\Message::getKeys() + +Returns all keys for this message. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + + +### getVariables + + array PAMI\Message\Message::getVariables() + +Returns all variabels for this message. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + + +### finishMessage + + string PAMI\Message\Message::finishMessage($message) + +Returns the end of message token appended to the end of a given message. + + + +* Visibility: **protected** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + +#### Arguments +* $message **mixed** + + + +### serializeVariable + + string PAMI\Message\Message::serializeVariable(string $key, string $value) + +Returns the string representation for an ami action variable. + + + +* Visibility: **private** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + +#### Arguments +* $key **string** +* $value **string** + + + +### serialize + + string PAMI\Message\Message::serialize() + +Gives a string representation for this message, ready to be sent to +ami. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + + +### getActionID + + string PAMI\Message\Message::getActionID() + +Returns key: 'ActionID'. + + + +* Visibility: **public** +* This method is defined by [PAMI\Message\Message](PAMI-Message-Message.md) + + + diff --git a/src/PAMI/Message/Action/ConfbridgeListAction.php b/src/PAMI/Message/Action/ConfbridgeListAction.php new file mode 100644 index 000000000..53426d48b --- /dev/null +++ b/src/PAMI/Message/Action/ConfbridgeListAction.php @@ -0,0 +1,58 @@ + + * @license http://marcelog.github.com/PAMI/ Apache License 2.0 + * @version SVN: $Id$ + * @link http://marcelog.github.com/PAMI/ + * + * Copyright 2011 Marcelo Gornstein + * + * 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; + +/** + * Lists all users in a particular ConfBridge conference. + * + * PHP Version 5 + * + * @category Pami + * @package Message + * @subpackage Action + * @author Matt Styles + * @license http://marcelog.github.com/PAMI/ Apache License 2.0 + * @link http://marcelog.github.com/PAMI/ + */ +class ConfbridgeListAction extends ActionMessage +{ + /** + * Constructor. + * + * @param string $conference Conference on which to act. + * + * @return void + */ + public function __construct($conference) + { + parent::__construct('ConfbridgeList'); + $this->setKey('Conference', $conference); + } +} diff --git a/src/PAMI/Message/Event/ConfbridgeListCompleteEvent.php b/src/PAMI/Message/Event/ConfbridgeListCompleteEvent.php new file mode 100644 index 000000000..0be4e7c75 --- /dev/null +++ b/src/PAMI/Message/Event/ConfbridgeListCompleteEvent.php @@ -0,0 +1,57 @@ + + * @license http://marcelog.github.com/PAMI/ Apache License 2.0 + * @version SVN: $Id$ + * @link http://marcelog.github.com/PAMI/ + * + * Copyright 2011 Marcelo Gornstein + * + * 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\Event; + +use PAMI\Message\Event\EventMessage; + +/** + * Event triggered for the end of the list when an action ConfbridgeList is issued. + * + * PHP Version 5 + * + * @category Pami + * @package Message + * @subpackage Event + * @author Matt Styles + * @license http://marcelog.github.com/PAMI/ Apache License 2.0 + * @link http://marcelog.github.com/PAMI/ + */ +class ConfbridgeListCompleteEvent extends EventMessage +{ + /** + * Returns key: 'ListItems'. + * + * @return string + */ + public function getListItems() + { + return $this->getKey('ListItems'); + } +} diff --git a/src/PAMI/Message/Event/ConfbridgeListEvent.php b/src/PAMI/Message/Event/ConfbridgeListEvent.php new file mode 100644 index 000000000..e982f88ed --- /dev/null +++ b/src/PAMI/Message/Event/ConfbridgeListEvent.php @@ -0,0 +1,155 @@ + + * @license http://marcelog.github.com/PAMI/ Apache License 2.0 + * @version SVN: $Id$ + * @link http://marcelog.github.com/PAMI/ + * + * Copyright 2011 Marcelo Gornstein + * + * 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\Event; + +/** + * Event triggered when an action ConfbridgeList is issued. + * + * PHP Version 5 + * + * @category Pami + * @package Message + * @subpackage Event + * @author Matt Styles + * @license http://marcelog.github.com/PAMI/ Apache License 2.0 + * @link http://marcelog.github.com/PAMI/ + */ +class ConfbridgeListEvent extends EventMessage +{ + /** + * Returns key: 'Conference'. + * + * @return string + */ + public function getConference() + { + return $this->getKey('Conference'); + } + + /** + * Returns key: 'Channel'. + * + * @return string + */ + public function getChannel() + { + return $this->getKey('Channel'); + } + + /** + * Returns key: 'CallerIDNum'. + * + * @return string + */ + public function getCallerIDNum() + { + return $this->getKey('CallerIDNum'); + } + + /** + * Returns key: 'CallerIDName'. + * + * @return string + */ + public function getCallerIDName() + { + return $this->getKey('CallerIDName'); + } + + /** + * Returns key: 'MarkedUser'. + * + * @return string + */ + public function getMarkedUser() + { + return $this->getKey('MarkedUser'); + } + + /** + * Returns key: 'WaitMarked'. + * + * @return string + */ + public function getWaitMarked() + { + return $this->getKey('WaitMarked'); + } + + /** + * Returns key: 'EndMarked'. + * + * @return string + */ + public function getEndMarked() + { + return $this->getKey('EndMarked'); + } + + /** + * Returns key: 'Waiting'. + * + * @return string + */ + public function getWaiting() + { + return $this->getKey('Waiting'); + } + + /** + * Returns key: 'Muted'. + * + * @return string + */ + public function getMuted() + { + return $this->getKey('Muted'); + } + + /** + * Returns key: 'AnsweredTime'. + * + * @return string + */ + public function getAnsweredTime() + { + return $this->getKey('AnsweredTime'); + } + + /** + * Returns key: 'Admin'. + * + * @return string + */ + public function getAdmin() + { + return $this->getKey('Admin'); + } +} diff --git a/test/actions/Test_Actions.php b/test/actions/Test_Actions.php index bd5c70c2b..28f9138df 100644 --- a/test/actions/Test_Actions.php +++ b/test/actions/Test_Actions.php @@ -275,6 +275,21 @@ public function can_command() $action = new \PAMI\Message\Action\CommandAction('command'); $client = $this->_start($write, $action); } + /** + * @test + */ + public function can_confbridge_list() + { + $conference = 'conf-59dba3997444e5'; + $write = array(implode("\r\n", array( + 'action: ConfbridgeList', + 'actionid: 1432.123', + 'conference: ' . $conference, + '' + ))); + $action = new \PAMI\Message\Action\ConfbridgeListAction($conference); + $client = $this->_start($write, $action); + } /** * @test */ diff --git a/test/events/Test_Events.php b/test/events/Test_Events.php index 2f1891be1..580fccd13 100644 --- a/test/events/Test_Events.php +++ b/test/events/Test_Events.php @@ -99,6 +99,8 @@ public function can_report_events() 'ConfbridgeMute', 'ConfbridgeUnmute', 'ConfbridgeTalking', + 'ConfbridgeList', + 'ConfbridgeListComplete', 'BridgeInfoChannel', 'BridgeInfoComplete', ); @@ -1395,6 +1397,20 @@ public function can_report_events() 'TalkingStatus' => 'TalkingStatus', 'Admin' => 'Admin', ), + 'ConfbridgeList' => array( + 'Conference' => 'Conference', + 'Channel' => 'Channel', + 'CallerIDNum' => 'CallerIDNum', + 'CallerIDName' => 'CallerIDName', + 'MarkedUser' => 'MarkedUser', + 'WaitMarked' => 'WaitMarked', + 'EndMarked' => 'EndMarked', + 'Waiting' => 'Waiting', + 'Muted' => 'Muted', + 'AnsweredTime' => 'AnsweredTime', + 'Admin' => 'Admin', + ), + 'ConfbridgeListComplete' => array('ListItems' => 'ListItems'), 'BridgeInfoChannel' => array( 'Channel' => 'Channel', 'ChannelState' => 'ChannelState',