Skip to content

Commit 85823d2

Browse files
alesfdkgroot
authored andcommitted
Implemented missing QueueEntry event
QueueStatus action also returns QueueEntry event. Added test for QueueEvent and updated readme events list. Cherry-Picked 6abf8af from alesf (marcelog#98) Cherry-Picked 92830d8 from alesf (marcelog#98) DdG: Added small fix to Test for Position returning integer
1 parent 5b99c20 commit 85823d2

File tree

3 files changed

+153
-1
lines changed

3 files changed

+153
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ can still catch them. If you catch one of these, please report it!
165165
* PeerEntry
166166
* PeerlistComplete
167167
* PeerStatus
168+
* QueueEvent
168169
* QueueMember
169170
* QueueMemberAdded
170171
* QueueMemberRemoved
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
<?php
2+
/**
3+
* Event triggered for a QueueStatus action.
4+
*
5+
* PHP Version 5
6+
*
7+
* @category Pami
8+
* @package Message
9+
* @subpackage Event
10+
* @author Ales Farcnik <@alesf>
11+
* @license http://marcelog.github.com/PAMI/ Apache License 2.0
12+
* @version SVN: $Id$
13+
* @link http://marcelog.github.com/PAMI/
14+
*
15+
* Copyright 2011 Marcelo Gornstein <marcelog@gmail.com>
16+
*
17+
* Licensed under the Apache License, Version 2.0 (the "License");
18+
* you may not use this file except in compliance with the License.
19+
* You may obtain a copy of the License at
20+
*
21+
* http://www.apache.org/licenses/LICENSE-2.0
22+
*
23+
* Unless required by applicable law or agreed to in writing, software
24+
* distributed under the License is distributed on an "AS IS" BASIS,
25+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26+
* See the License for the specific language governing permissions and
27+
* limitations under the License.
28+
*
29+
*/
30+
namespace PAMI\Message\Event;
31+
32+
use PAMI\Message\Event\EventMessage;
33+
34+
/**
35+
* Event triggered for a QueueStatus action.
36+
*
37+
* PHP Version 5
38+
*
39+
* @category Pami
40+
* @package Message
41+
* @subpackage Event
42+
* @author Ales Farcnik <@alesf>
43+
* @license http://marcelog.github.com/PAMI/ Apache License 2.0
44+
* @link http://marcelog.github.com/PAMI/
45+
*/
46+
class QueueEntryEvent extends EventMessage
47+
{
48+
/**
49+
* Returns key: 'Queue'.
50+
*
51+
* @return string
52+
*/
53+
public function getQueue()
54+
{
55+
return $this->getKey('Queue');
56+
}
57+
58+
/**
59+
* Returns key: 'Position'.
60+
*
61+
* @return integer
62+
*/
63+
public function getPosition()
64+
{
65+
return intval($this->getKey('Position'));
66+
}
67+
68+
/**
69+
* Returns key: 'Channel'.
70+
*
71+
* @return string
72+
*/
73+
public function getChannel()
74+
{
75+
return $this->getKey('Channel');
76+
}
77+
78+
/**
79+
* Returns key: 'Uniqueid'.
80+
*
81+
* @return integer
82+
*/
83+
public function getUniqueid()
84+
{
85+
return $this->getKey('Uniqueid');
86+
}
87+
88+
/**
89+
* Returns key: 'CallerIDNum'.
90+
*
91+
* @return integer
92+
*/
93+
public function getCallerIDNum()
94+
{
95+
return $this->getKey('CallerIDNum');
96+
}
97+
98+
/**
99+
* Returns key: 'CallerIDName'.
100+
*
101+
* @return integer
102+
*/
103+
public function getCallerIDName()
104+
{
105+
return $this->getKey('CallerIDName');
106+
}
107+
108+
/**
109+
* Returns key: 'ConnectedLineNum'.
110+
*
111+
* @return integer
112+
*/
113+
public function getConnectedLineNum()
114+
{
115+
return $this->getKey('ConnectedLineNum');
116+
}
117+
118+
/**
119+
* Returns key: 'ConnectedLineName'.
120+
*
121+
* @return integer
122+
*/
123+
public function getConnectedLineName()
124+
{
125+
return $this->getKey('ConnectedLineName');
126+
}
127+
128+
/**
129+
* Returns key: 'Wait'.
130+
*
131+
* @return float
132+
*/
133+
public function getWait()
134+
{
135+
return $this->getKey('Wait');
136+
}
137+
138+
}

test/events/Test_Events.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function can_report_events()
6161
'Rename', 'RegistrationsComplete', 'RTPSenderStat', 'RTPReceiverStat',
6262
'RTCPSent', 'RTCPReceiverStat', 'RTCPReceived', 'QueueSummaryComplete',
6363
'QueueStatusComplete', 'DAHDIShowChannelsComplete', 'QueueSummary',
64-
'QueueParams', 'QueueMemberStatus', 'QueueMemberRemoved',
64+
'QueueParams', 'QueueEntry', 'QueueMemberStatus', 'QueueMemberRemoved',
6565
'QueueMemberPaused', 'QueueMember', 'QueueMemberAdded', 'PeerlistComplete',
6666
'PeerStatus', 'PeerEntry', 'OriginateResponse', 'Newstate', 'Newexten',
6767
'Newchannel', 'NewCallerid', 'NewAccountCode', 'MusicOnHold',
@@ -117,6 +117,9 @@ public function can_report_events()
117117
'QueueMemberAdded' => array(
118118
'Paused' => true
119119
),
120+
'QueueEntry' => array(
121+
'Position' => 0
122+
),
120123
);
121124
$eventValues = array(
122125
'UserEvent' => array(
@@ -462,6 +465,16 @@ public function can_report_events()
462465
'Peer' => 'Peer',
463466
'PeerStatus' => 'PeerStatus'
464467
),
468+
'QueueEntry' => array(
469+
'Position' => 'Position',
470+
'Channel' => 'Channel',
471+
'Uniqueid' => 'Uniqueid',
472+
'CallerIdNum' => 'CallerIdNum',
473+
'CallerIdName' => 'CallerIdName',
474+
'ConnectedLineNum' => 'ConnectedLineNum',
475+
'ConnectedLineName' => 'ConnectedLineName',
476+
'Wait' => 'Wait'
477+
),
465478
'QueueMemberRemoved' => array(
466479
'MemberName' => 'MemberName',
467480
'Location' => 'Location',

0 commit comments

Comments
 (0)