Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reporting DAHDIChannelEvent and adding class file #138

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ can still catch them. If you catch one of these, please report it!
* ConfbridgeUnmute
* CoreShowChannel
* CoreShowChannelComplete
* DAHDIChannel
* DAHDIShowChannel
* DAHDIShowChannelsComplete
* FullyBooted
Expand Down Expand Up @@ -170,6 +171,7 @@ can still catch them. If you catch one of these, please report it!
* QueueParams
* QueueStatusComplete
* QueueSummaryComplete
* Reload
* RegistrationsComplete
* Registry
* Rename
Expand All @@ -179,6 +181,7 @@ can still catch them. If you catch one of these, please report it!
* RTPReceiverStat
* RTPSenderStat
* ShowDialPlanComplete
* Success
* Status
* StatusComplete
* Transfer
Expand Down
86 changes: 86 additions & 0 deletions src/PAMI/Message/Event/DAHDIChannelEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php
/**
* Event triggered for the end of the list when an action DAHDIChannel
* is issued.
*
* PHP Version 5
*
* @category Pami
* @package Message
* @subpackage Event
* @author Adrián Zúñiga <[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\Event;

use PAMI\Message\Event\EventMessage;

class DAHDIChannelEvent extends EventMessage
{
/**
* Returns key: 'Privilege'.
*
* @return string
*/
public function getPrivilege()
{
return $this->getKey('Privilege');
}

/**
* Returns key: 'DAHDIChannel'.
*
* @return string
*/
public function getDAHDIChannel()
{
return $this->getKey('DAHDIChannel');
}

/**
* Returns key: 'DAHDISpan'.
*
* @return string
*/
public function getDAHDISpan()
{
return $this->getKey('DAHDISpan');
}

/**
* Returns key: 'Channel'.
*
* @return string
*/
public function getChannel()
{
return $this->getKey('Channel');
}

/**
* Returns key: 'UniqueID'.
*
* @return string
*/
public function getUniqueID()
{
return $this->getKey('UniqueID');
}
}
46 changes: 46 additions & 0 deletions src/PAMI/Message/Event/ReloadEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/**
* Event triggered for the end of the list when an action Reload
* is issued.
*
* PHP Version 5
*
* @category Pami
* @package Message
* @subpackage Event
* @author Adrián Zúñiga <[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\Event;

use PAMI\Message\Event\EventMessage;

class ReloadEvent extends EventMessage
{
/**
* Returns key: 'RawContent'.
*
* @return string
*/
public function getRawContent()
{
return $this->getKey('RawContent');
}
}
46 changes: 46 additions & 0 deletions src/PAMI/Message/Event/SuccessEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/**
* Event triggered for the end of the list when an action Success
* is issued.
*
* PHP Version 5
*
* @category Pami
* @package Message
* @subpackage Event
* @author Adrián Zúñiga <[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\Event;

use PAMI\Message\Event\EventMessage;

class SuccessEvent extends EventMessage
{
/**
* Returns key: 'RawContent'.
*
* @return string
*/
public function getRawContent()
{
return $this->getKey('RawContent');
}
}
17 changes: 15 additions & 2 deletions test/events/Test_Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function can_report_events()
'DongleSMSStatus', 'FullyBooted', 'DongleShowDevicesComplete', 'DongleDeviceEntry',
'DongleNewUSSDBase64', 'DongleNewUSSD', 'DongleUSSDStatus', 'DongleNewCUSD',
'DongleStatus', 'CEL', 'JabberEvent', 'Registry', 'UserEvent',
'ParkedCall', 'UnParkedCall', 'Link',
'ParkedCall', 'UnParkedCall', 'Link', 'DAHDIChannel', 'Reload', 'Success',
'AGIExecStart',
'AGIExecEnd',
'AsyncAGIStart',
Expand Down Expand Up @@ -1393,6 +1393,19 @@ public function can_report_events()
'TalkingStatus' => 'TalkingStatus',
'Admin' => 'Admin',
),
'DAHDIChannel' => array(
'Privilege' => 'Privilege',
'DAHDIChannel' => 'DAHDIChannel',
'DAHDISpan' => 'DAHDISpan',
'Channel' => 'Channel',
'UniqueID' => 'UniqueID'
),
'Reload' => array(
'RawContent' => 'RawContent'
),
'Success' => array(
'RawContent' => 'RawContent'
)
);
$eventGetters = array(
'UserEvent' => array(
Expand Down Expand Up @@ -1520,7 +1533,7 @@ private function _testEvent($eventName, array $getters, array $values, array $tr

$this->assertTrue(
method_exists($event, $methodName),
sprintf('Method %s doesn\'t exixt in event %s', $methodName, get_class($event))
sprintf('Method %s doesn\'t exist in event %s', $methodName, get_class($event))
);

$this->assertEquals($event->$methodName(), $value, $eventName);
Expand Down