From f02408e6d6b415ce85283a02f7841fdd0a16c17c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Z=C3=BA=C3=B1iga?= Date: Thu, 22 Jun 2017 13:53:41 -0500 Subject: [PATCH 01/13] Reporting DAHDIChannelEvent and adding class file --- src/PAMI/Message/Event/DAHDIChannelEvent.php | 67 ++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 src/PAMI/Message/Event/DAHDIChannelEvent.php diff --git a/src/PAMI/Message/Event/DAHDIChannelEvent.php b/src/PAMI/Message/Event/DAHDIChannelEvent.php new file mode 100644 index 000000000..ee65299db --- /dev/null +++ b/src/PAMI/Message/Event/DAHDIChannelEvent.php @@ -0,0 +1,67 @@ + + * @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; + +class DAHDIChannelEvent extends EventMessage +{ + /** + * Returns key: 'Privilege'. + * + * @return string + */ + public function getPrivilege() + { + return $this->getKey('Privilege'); + } + + /** + * Returns key: 'Channel'. + * + * @return string + */ + public function getChannel() + { + return $this->getKey('Channel'); + } + + /** + * Returns key: 'UniqueID'. + * + * @return string + */ + public function getUniqueID() + { + return $this->getKey('UniqueID'); + } + +} From 5b83348fbefaa35702aa164308fcf9e1185b73a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Z=C3=BA=C3=B1iga?= Date: Thu, 22 Jun 2017 14:01:59 -0500 Subject: [PATCH 02/13] Forgot to put the new class in the readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7959d7534..d2c47991d 100644 --- a/README.md +++ b/README.md @@ -207,6 +207,7 @@ can still catch them. If you catch one of these, please report it! * CoreSettings * CoreShowChannels * CoreStatus +* DAHDIChannel * DAHDIDialOffHookAction * DAHDIHangup * DAHDIRestart From 6460acfe0d8f87d96760cf13a0ec315a823ac419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Z=C3=BA=C3=B1iga?= Date: Thu, 22 Jun 2017 15:33:31 -0500 Subject: [PATCH 03/13] Changed tabs for spaces --- src/PAMI/Message/Event/DAHDIChannelEvent.php | 55 ++++++++++---------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/src/PAMI/Message/Event/DAHDIChannelEvent.php b/src/PAMI/Message/Event/DAHDIChannelEvent.php index ee65299db..712acf25b 100644 --- a/src/PAMI/Message/Event/DAHDIChannelEvent.php +++ b/src/PAMI/Message/Event/DAHDIChannelEvent.php @@ -34,34 +34,33 @@ class DAHDIChannelEvent extends EventMessage { - /** - * Returns key: 'Privilege'. - * - * @return string - */ - public function getPrivilege() - { - return $this->getKey('Privilege'); - } + /** + * Returns key: 'Privilege'. + * + * @return string + */ + public function getPrivilege() + { + return $this->getKey('Privilege'); + } - /** - * Returns key: 'Channel'. - * - * @return string - */ - public function getChannel() - { - return $this->getKey('Channel'); - } - - /** - * Returns key: 'UniqueID'. - * - * @return string - */ - public function getUniqueID() - { - return $this->getKey('UniqueID'); - } + /** + * Returns key: 'Channel'. + * + * @return string + */ + public function getChannel() + { + return $this->getKey('Channel'); + } + /** + * Returns key: 'UniqueID'. + * + * @return string + */ + public function getUniqueID() + { + return $this->getKey('UniqueID'); + } } From a8fd01bbd81c78efa1c5026de9058948db2dda2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Z=C3=BA=C3=B1iga?= Date: Thu, 22 Jun 2017 15:46:26 -0500 Subject: [PATCH 04/13] Added DAHDIChannel to test suite --- test/events/Test_Events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/events/Test_Events.php b/test/events/Test_Events.php index b077c80aa..39357822c 100644 --- a/test/events/Test_Events.php +++ b/test/events/Test_Events.php @@ -66,7 +66,7 @@ public function can_report_events() 'PeerStatus', 'PeerEntry', 'OriginateResponse', 'Newstate', 'Newexten', 'Newchannel', 'NewCallerid', 'NewAccountCode', 'MusicOnHold', 'MessageWaiting', 'Masquerade', 'ListDialplan', 'Leave', 'Join', - 'Hold', 'Hangup', 'ExtensionStatus', 'Dial', 'DAHDIShowChannels', + 'Hold', 'Hangup', 'ExtensionStatus', 'Dial', 'DAHDIChannel', 'DAHDIShowChannels', 'CoreShowChannelsComplete', 'CoreShowChannel', 'ChannelUpdate', 'Agents', 'AgentsComplete', 'Agentlogoff', 'Agentlogin', 'AgentConnect', 'DongleSMSStatus', 'FullyBooted', 'DongleShowDevicesComplete', 'DongleDeviceEntry', From 58b071ffa7b3482386640fef29c1ce107e55314c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Z=C3=BA=C3=B1iga?= Date: Thu, 22 Jun 2017 15:56:57 -0500 Subject: [PATCH 05/13] Added two new getters, fighting for the autometed checking T_T --- src/PAMI/Message/Event/DAHDIChannelEvent.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/PAMI/Message/Event/DAHDIChannelEvent.php b/src/PAMI/Message/Event/DAHDIChannelEvent.php index 712acf25b..99b9ec4af 100644 --- a/src/PAMI/Message/Event/DAHDIChannelEvent.php +++ b/src/PAMI/Message/Event/DAHDIChannelEvent.php @@ -44,6 +44,26 @@ 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'. * From 929a8095219fc45f1fd624d3d7a8ad0ec26b9f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Z=C3=BA=C3=B1iga?= Date: Thu, 22 Jun 2017 15:58:05 -0500 Subject: [PATCH 06/13] Fighting tabs with spacesgit add .git add . --- test/events/Test_Events.php | 298 ++++++++++++++++++------------------ 1 file changed, 149 insertions(+), 149 deletions(-) diff --git a/test/events/Test_Events.php b/test/events/Test_Events.php index 39357822c..fa2b67535 100644 --- a/test/events/Test_Events.php +++ b/test/events/Test_Events.php @@ -141,16 +141,16 @@ public function can_report_events() 'FullyBooted' => array(), 'DongleUSSDStatus' => array( 'Privilege' => 'Privilege', - 'Id' => 'Id', - 'Device' => 'Device', + 'Id' => 'Id', + 'Device' => 'Device', 'Status' => 'Status' ), - 'DongleNewUSSDBase64' => array( + 'DongleNewUSSDBase64' => array( 'Device' => 'Device', 'Message' => 'Message', 'Privilege' => 'Privilege' ), - 'DongleNewCUSD' => array( + 'DongleNewCUSD' => array( 'Device' => 'Device', 'Message' => 'Message', 'Privilege' => 'Privilege' @@ -220,17 +220,17 @@ public function can_report_events() 'Waiting' => 'Waiting', 'Releasing' => 'Releasing', 'Initializing' => 'Initializing' - ), - 'DongleShowDevicesComplete' => array('ListItems' => 'items'), + ), + 'DongleShowDevicesComplete' => array('ListItems' => 'items'), 'DongleSMSStatus' => array( 'Privilege' => 'Privilege', - 'Id' => 'Id', - 'Device' => 'Device', + 'Id' => 'Id', + 'Device' => 'Device', 'Status' => 'Status' ), 'DongleStatus' => array( 'Privilege' => 'Privilege', - 'Device' => 'Device', + 'Device' => 'Device', 'Status' => 'Status' ), 'AgentConnect' => array( @@ -270,12 +270,12 @@ public function can_report_events() 'Privilege' => 'Privilege', 'Channel' => 'Channel', 'ChannelType' => 'ChannelType', - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', 'SIPfullcontact' => 'SIPfullcontact', 'SIPcallid' => 'SIPcallid' ), 'CoreShowChannel' => array( - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', 'Privilege' => 'Privilege', 'Channel' => 'Channel', 'AccountCode' => 'AccountCode', @@ -303,40 +303,40 @@ public function can_report_events() 'Privilege' => 'Privilege', 'Destination' => 'Destination', 'SubEvent' => 'SubEvent', - 'CallerIdName' => 'CallerIdName', + 'CallerIdName' => 'CallerIdName', 'CallerIdNum' => 'CallerIdNum', 'Channel' => 'Channel', - 'DialStatus' => 'DialStatus', + 'DialStatus' => 'DialStatus', 'DialString' => 'DialString', - 'UniqueID' => 'UniqueID', - 'DestUniqueID' => 'DestUniqueID', + 'UniqueID' => 'UniqueID', + 'DestUniqueID' => 'DestUniqueID', ), 'ExtensionStatus' => array( 'Privilege' => 'Privilege', 'Status' => 'Status', 'Exten' => 'Extension', 'Hint' => 'Hint', - 'Context' => 'Context', + 'Context' => 'Context', ), 'Hangup' => array( 'CallerIdName' => 'CallerIdName', 'CallerIdNum' => 'CallerIdNum', 'Channel' => 'Channel', 'Privilege' => 'Privilege', - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', 'Cause' => 'Cause', 'cause-txt' => 'cause-txt' ), 'Hold' => array( 'Privilege' => 'Privilege', - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', 'Status' => 'Status', 'Channel' => 'Channel', ), - 'Join' => array( + 'Join' => array( 'CallerIdName' => 'CallerIdName', 'CallerIdNum' => 'CallerIdNum', - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', 'Position' => 'Position', 'Queue' => 'Queue', 'Channel' => 'Channel', @@ -346,11 +346,11 @@ public function can_report_events() 'Leave' => array( 'Channel' => 'Channel', 'Privilege' => 'Privilege', - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', 'Count' => 'Count', 'Queue' => 'Queue' ), - 'ListDialplan' => array( + 'ListDialplan' => array( 'AppData' => 'AppData', 'Application' => 'Application', 'Priority' => 'Priority', @@ -367,25 +367,25 @@ public function can_report_events() 'Privilege' => 'Privilege', ), 'MessageWaiting' => array( - 'Privilege' => 'Privilege', - 'Waiting' => 'Waiting', - 'Mailbox' => 'Mailbox', + 'Privilege' => 'Privilege', + 'Waiting' => 'Waiting', + 'Mailbox' => 'Mailbox', ), 'MusicOnHold' => array( 'Channel' => 'Channel', 'Privilege' => 'Privilege', - 'UniqueID' => 'UniqueID', - 'State' => 'State', + 'UniqueID' => 'UniqueID', + 'State' => 'State', ), 'NewAccountCode' => array( 'Channel' => 'Channel', 'Privilege' => 'Privilege', - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', 'AccountCode' => 'AccountCode', 'OldAccountCode' => 'OldAccountCode', ), 'NewCallerid' => array( - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', 'CallerIdName' => 'CallerIdName', 'CallerIdNum' => 'CallerIdNum', 'Channel' => 'Channel', @@ -393,7 +393,7 @@ public function can_report_events() 'CID-CallingPres' => 'CID-CallingPres' ), 'Newchannel' => array( - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', 'CallerIdName' => 'CallerIdName', 'CallerIdNum' => 'CallerIdNum', 'ChannelStateDesc' => 'ChannelStateDesc', @@ -404,7 +404,7 @@ public function can_report_events() 'Exten' => 'Exten', 'Privilege' => 'Privilege' ), - 'Newexten' => array( + 'Newexten' => array( 'Channel' => 'Channel', 'Privilege' => 'Privilege', 'AppData' => 'AppData', @@ -413,9 +413,9 @@ public function can_report_events() 'Extension' => 'Extension', 'Exten' => 'Exten', 'Context' => 'Context', - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', ), - 'Newstate' => array( + 'Newstate' => array( 'CallerIdName' => 'CallerIdName', 'CallerIdNum' => 'CallerIdNum', 'UniqueID' => 'UniqueID', @@ -452,7 +452,7 @@ public function can_report_events() 'ObjectName' => 'ObjectName', 'ChannelType' => 'ChannelType', ), - 'PeerStatus' => array( + 'PeerStatus' => array( 'Privilege' => 'Privilege', 'ChannelType' => 'ChannelType', 'Peer' => 'Peer', @@ -469,28 +469,28 @@ public function can_report_events() 'Location' => 'Location', 'Queue' => 'Queue', 'Privilege' => 'Privilege', - 'Paused' => 1, + 'Paused' => 1, ), 'QueueMember' => array( 'Name' => 'Name', 'Location' => 'Location', 'Queue' => 'Queue', - 'Paused' => 1, + 'Paused' => 1, 'Status' => 'Status', 'CallsTaken' => 'CallsTaken', 'Penalty' => 'Penalty', - 'Membership' => 'Membership', + 'Membership' => 'Membership', ), 'QueueMemberAdded' => array( 'MemberName' => 'MemberName', 'LastCall' => 'LastCall', 'Location' => 'Location', 'Queue' => 'Queue', - 'Paused' => 1, + 'Paused' => 1, 'Status' => 'Status', 'CallsTaken' => 'CallsTaken', 'Penalty' => 'Penalty', - 'Membership' => 'Membership', + 'Membership' => 'Membership', 'Privilege' => 'Privilege' ), 'QueueMemberStatus' => array( @@ -504,9 +504,9 @@ public function can_report_events() 'Queue' => 'Queue', 'Privilege' => 'Privilege' ), - 'QueueParams' => array( + 'QueueParams' => array( 'Completed' => '4', - 'HoldTime' => '5', + 'HoldTime' => '5', 'Calls' => '6', 'Strategy' => 'Strategy', 'Max' => '6', @@ -517,7 +517,7 @@ public function can_report_events() 'Abandoned' => '3' ), 'QueueSummaryComplete' => array(), - 'QueueSummary' => array( + 'QueueSummary' => array( 'LongestHoldTime' => 'LongestHoldTime', 'HoldTime' => 'HoldTime', 'Callers' => 'Callers', @@ -526,8 +526,8 @@ public function can_report_events() 'Queue' => 'Queue', ), 'QueueStatusComplete' => array(), - 'DAHDIShowChannelsComplete' => array('items' => 'ListItems'), - 'PeerlistComplete' => array('ListItems' => 'ListItems'), + 'DAHDIShowChannelsComplete' => array('items' => 'ListItems'), + 'PeerlistComplete' => array('ListItems' => 'ListItems'), 'CoreShowChannelsComplete' => array('ListItems' => 'ListItems'), 'RTCPReceived' => array( 'DLSR' => 'DLSR', @@ -615,7 +615,7 @@ public function can_report_events() 'Extension' => 'Extension', 'Context' => 'Context', 'UniqueID' => 'UniqueID', - 'Privilege' => 'Privilege', + 'Privilege' => 'Privilege', 'Channel' => 'Channel' ), 'Transfer' => array( @@ -663,85 +663,85 @@ public function can_report_events() 'Key' => 'Key', 'Val' => 'Val' ), - 'ParkedCallsComplete' => array(), - 'StatusComplete' => array('Items' => 'Items'), + 'ParkedCallsComplete' => array(), + 'StatusComplete' => array('Items' => 'Items'), 'RegistrationsComplete' => array('ListItems' => 'ListItems'), 'DTMF' => array( - 'Privilege' => 'Privilege', - 'UniqueID' => 'UniqueID', + 'Privilege' => 'Privilege', + 'UniqueID' => 'UniqueID', 'Channel' => 'Channel', 'Direction' => 'Direction', 'End' => 'End', 'Begin' => 'Begin', 'Digit' => 'Digit' - ), + ), 'AGIExec' => array( - 'Privilege' => 'Privilege', - 'CommandId' => 'CommandId', + 'Privilege' => 'Privilege', + 'CommandId' => 'CommandId', 'SubEvent' => 'SubEvent', 'Channel' => 'Channel', 'Command' => 'Command', 'Result' => 'Result', 'ResultCode' => 'ResultCode' - ), + ), 'VarSet' => array( - 'Privilege' => 'Privilege', + 'Privilege' => 'Privilege', 'Channel' => 'Channel', 'Variable' => 'Variable', 'Value' => 'Value', - 'UniqueID' => 'UniqueID' - ), - 'Unlink' => array( - 'Privilege' => 'Privilege', - 'CallerID1' => 'CallerID1', - 'CallerID2' => 'CallerID2', - 'UniqueID1' => 'UniqueID1', - 'UniqueID2' => 'UniqueID2', - 'Channel1' => 'Channel1', - 'Channel2' => 'Channel2', - ), - 'Bridge' => array( - 'Privilege' => 'Privilege', - 'CallerID1' => 'CallerID1', - 'CallerID2' => 'CallerID2', - 'UniqueID1' => 'UniqueID1', - 'UniqueID2' => 'UniqueID2', - 'Channel1' => 'Channel1', - 'Channel2' => 'Channel2', - 'BridgeState' => 'BridgeStart', - 'BridgeType' => 'BridgeType' - ), - 'vgsm_sms_rx' => array( - 'Privilege' => 'Privilege', - 'X-SMS-Status-Report-Indication' => 'X-SMS-Status-Report-Indication', - 'X-SMS-User-Data-Header-Indicator' => 'X-SMS-User-Data-Header-Indicator', - 'X-SMS-Reply-Path' => 'X-SMS-Reply-Path', - 'X-SMS-More-Messages-To-Send' => 'X-SMS-More-Messages-To-Send', - 'X-SMS-SMCC-Number' => 'X-SMS-SMCC-Number', - 'X-SMS-SMCC-TON' => 'X-SMS-SMCC-TON', - 'X-SMS-SMCC-NP' => 'X-SMS-SMCC-NP', - 'X-SMS-Sender-Number' => 'X-SMS-Sender-Number', - 'X-SMS-Sender-TON' => 'X-SMS-Sender-TON', - 'X-SMS-Sender-NP' => 'X-SMS-Sender-NP', - 'X-SMS-Message-Type' => 'X-SMS-Message-Type', - 'Content' => 'Content', - 'Date' => 'Date', - 'Content-Transfer-Encoding' => 'ContentEncoding', - 'Content-Type' => 'ContentType', - 'MIME-Version' => 'MIME-Version', - 'Subject' => 'Subject', - 'From' => 'From', - 'Received' => 'Received' - ), - 'vgsm_net_state' => array( - 'Privilege' => 'Privilege', - 'X-vGSM-GSM-Registration' => 'X-vGSM-GSM-Registration', - ), - 'vgsm_me_state' => array( - 'Privilege' => 'Privilege', - 'X-vGSM-ME-State-Change-Reason' => 'X-vGSM-ME-State-Change-Reason', - 'X-vGSM-ME-Old-State' => 'X-vGSM-ME-Old-State', - 'X-vGSM-ME-State' => 'X-vGSM-ME-State', + 'UniqueID' => 'UniqueID' + ), + 'Unlink' => array( + 'Privilege' => 'Privilege', + 'CallerID1' => 'CallerID1', + 'CallerID2' => 'CallerID2', + 'UniqueID1' => 'UniqueID1', + 'UniqueID2' => 'UniqueID2', + 'Channel1' => 'Channel1', + 'Channel2' => 'Channel2', + ), + 'Bridge' => array( + 'Privilege' => 'Privilege', + 'CallerID1' => 'CallerID1', + 'CallerID2' => 'CallerID2', + 'UniqueID1' => 'UniqueID1', + 'UniqueID2' => 'UniqueID2', + 'Channel1' => 'Channel1', + 'Channel2' => 'Channel2', + 'BridgeState' => 'BridgeStart', + 'BridgeType' => 'BridgeType' + ), + 'vgsm_sms_rx' => array( + 'Privilege' => 'Privilege', + 'X-SMS-Status-Report-Indication' => 'X-SMS-Status-Report-Indication', + 'X-SMS-User-Data-Header-Indicator' => 'X-SMS-User-Data-Header-Indicator', + 'X-SMS-Reply-Path' => 'X-SMS-Reply-Path', + 'X-SMS-More-Messages-To-Send' => 'X-SMS-More-Messages-To-Send', + 'X-SMS-SMCC-Number' => 'X-SMS-SMCC-Number', + 'X-SMS-SMCC-TON' => 'X-SMS-SMCC-TON', + 'X-SMS-SMCC-NP' => 'X-SMS-SMCC-NP', + 'X-SMS-Sender-Number' => 'X-SMS-Sender-Number', + 'X-SMS-Sender-TON' => 'X-SMS-Sender-TON', + 'X-SMS-Sender-NP' => 'X-SMS-Sender-NP', + 'X-SMS-Message-Type' => 'X-SMS-Message-Type', + 'Content' => 'Content', + 'Date' => 'Date', + 'Content-Transfer-Encoding' => 'ContentEncoding', + 'Content-Type' => 'ContentType', + 'MIME-Version' => 'MIME-Version', + 'Subject' => 'Subject', + 'From' => 'From', + 'Received' => 'Received' + ), + 'vgsm_net_state' => array( + 'Privilege' => 'Privilege', + 'X-vGSM-GSM-Registration' => 'X-vGSM-GSM-Registration', + ), + 'vgsm_me_state' => array( + 'Privilege' => 'Privilege', + 'X-vGSM-ME-State-Change-Reason' => 'X-vGSM-ME-State-Change-Reason', + 'X-vGSM-ME-Old-State' => 'X-vGSM-ME-Old-State', + 'X-vGSM-ME-State' => 'X-vGSM-ME-State', ), 'CEL' => array( 'AMAFlags' => 'AMAFlags', @@ -1404,20 +1404,20 @@ public function can_report_events() 'Agents' => array( 'LoggedInChan' => 'Channel' ), - 'ExtensionStatus' => array( + 'ExtensionStatus' => array( 'Exten' => 'Extension' ), 'Hangup' => array( 'cause-txt' => 'CauseText' ), - 'ListDialplan' => array( + 'ListDialplan' => array( 'AppData' => 'ApplicationData', ), 'NewCallerid' => array( 'CID-CallingPres' => 'CallerIdPres' ), 'Newchannel' => array('Exten' => 'Extension'), - 'Newexten' => array( + 'Newexten' => array( 'AppData' => 'ApplicationData', ), 'QueueMemberStatus' => array( @@ -1426,7 +1426,7 @@ public function can_report_events() 'QueueMember' => array( 'Name' => 'MemberName' ), - 'AGIExec' => array(), + 'AGIExec' => array(), 'Transfer' => array( 'SIP-Callid' => 'SipCallID', ), @@ -1435,31 +1435,31 @@ public function can_report_events() ), 'PeerEntry' => array('ChanObjectType' => 'ChannelObjectType'), 'VarSet' => array('Variable' => 'VariableName'), - 'StatusComplete' => array('Items' => 'ListItems'), + 'StatusComplete' => array('Items' => 'ListItems'), 'DBGetResponse' => array('Key' => 'KeyName', 'Val' => 'Value'), - 'vgsm_sms_rx' => array( - 'X-SMS-Status-Report-Indication' => 'StatusReportIndication', - 'X-SMS-User-Data-Header-Indicator' => 'DataHeaderIndicator', - 'X-SMS-Reply-Path' => 'ReplyPath', - 'X-SMS-More-Messages-To-Send' => 'MoreMessagesToSend', + 'vgsm_sms_rx' => array( + 'X-SMS-Status-Report-Indication' => 'StatusReportIndication', + 'X-SMS-User-Data-Header-Indicator' => 'DataHeaderIndicator', + 'X-SMS-Reply-Path' => 'ReplyPath', + 'X-SMS-More-Messages-To-Send' => 'MoreMessagesToSend', 'X-SMS-SMCC-Number' => 'SMCCNumber', - 'X-SMS-SMCC-TON' => 'SMCCTON', - 'X-SMS-SMCC-NP' => 'SMCCNP', - 'X-SMS-Sender-Number' => 'SenderNumber', - 'X-SMS-Sender-TON' => 'SenderTON', - 'X-SMS-Sender-NP' => 'SenderNP', - 'X-SMS-Message-Type' => 'MessageType', + 'X-SMS-SMCC-TON' => 'SMCCTON', + 'X-SMS-SMCC-NP' => 'SMCCNP', + 'X-SMS-Sender-Number' => 'SenderNumber', + 'X-SMS-Sender-TON' => 'SenderTON', + 'X-SMS-Sender-NP' => 'SenderNP', + 'X-SMS-Message-Type' => 'MessageType', 'Content-Transfer-Encoding' => 'ContentEncoding', 'Content-Type' => 'ContentType', 'MIME-Version' => 'MIMEVersion' - ), - 'DAHDIShowChannelsComplete' => array('items' => 'ListItems'), - 'vgsm_net_state' => array('X-vGSM-GSM-Registration' => 'State'), - 'vgsm_me_state' => array( - 'X-vGSM-ME-State-Change-Reason' => 'Reason', - 'X-vGSM-ME-Old-State' => 'OldState', - 'X-vGSM-ME-State' => 'State', - ), + ), + 'DAHDIShowChannelsComplete' => array('items' => 'ListItems'), + 'vgsm_net_state' => array('X-vGSM-GSM-Registration' => 'State'), + 'vgsm_me_state' => array( + 'X-vGSM-ME-State-Change-Reason' => 'Reason', + 'X-vGSM-ME-Old-State' => 'OldState', + 'X-vGSM-ME-State' => 'State', + ), 'ParkedCall' => array('Exten' => 'Extension'), 'UnParkedCall' => array('Exten' => 'Extension'), 'AGIExecStart' => array( @@ -1482,32 +1482,32 @@ private function _testEvent($eventName, array $getters, array $values, array $tr $mock_stream_socket_client = true; $mock_stream_set_blocking = true; $options = array( - 'host' => '2.3.4.5', + 'host' => '2.3.4.5', 'scheme' => 'tcp://', - 'port' => 9999, - 'username' => 'asd', - 'secret' => 'asd', + 'port' => 9999, + 'username' => 'asd', + 'secret' => 'asd', 'connect_timeout' => 10, - 'read_timeout' => 10 + 'read_timeout' => 10 ); $write = array( - "action: Login\r\nactionid: 1432.123\r\nusername: asd\r\nsecret: asd\r\n" + "action: Login\r\nactionid: 1432.123\r\nusername: asd\r\nsecret: asd\r\n" ); setFgetsMock($standardAMIStart, $write); $client = new \PAMI\Client\Impl\ClientImpl($options); $client->registerEventListener(new SomeListenerClass); - $client->open(); - $message = array(); - $message[] = 'Event: ' . $eventName; - foreach ($values as $key => $value) { - $message[] = $key . ': ' . $value; - } - $message[] = ''; - setFgetsMock($message, $message); - for($i = 0; $i < count($message); $i++) { - $client->process(); - } - $event = SomeListenerClass::$event; + $client->open(); + $message = array(); + $message[] = 'Event: ' . $eventName; + foreach ($values as $key => $value) { + $message[] = $key . ': ' . $value; + } + $message[] = ''; + setFgetsMock($message, $message); + for($i = 0; $i < count($message); $i++) { + $client->process(); + } + $event = SomeListenerClass::$event; foreach ($values as $key => $value) { if (isset($getters[$eventName][$key])) { $methodName = 'get' . $getters[$eventName][$key]; From aa6348de7fb761977bba201d586c2a9d91e1fa81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Z=C3=BA=C3=B1iga?= Date: Thu, 22 Jun 2017 16:01:36 -0500 Subject: [PATCH 07/13] Finished prepping test_events --- test/events/Test_Events.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/events/Test_Events.php b/test/events/Test_Events.php index fa2b67535..536caef0d 100644 --- a/test/events/Test_Events.php +++ b/test/events/Test_Events.php @@ -291,6 +291,13 @@ public function can_report_events() 'BridgedChannel' => 'BridgedChannel', 'Duration' => 'Duration', ), + 'DAHDIChannel' => array( + 'Priviledge' => 'Priviledge', + 'DAHDIChannel' => 'DAHDIChannel', + 'DAHDISpan' => 'DAHDISpan', + 'Channel' => 'Channel', + 'UniqueID' => 'UniqueID' + ), 'DAHDIShowChannels' => array( 'Channel' => 'Channel', 'Context' => 'Context', From 3e8b17b8c5877acd3e7b2bd7f449fe9233f714fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Z=C3=BA=C3=B1iga?= Date: Thu, 22 Jun 2017 16:17:34 -0500 Subject: [PATCH 08/13] Test events modified again --- test/events/Test_Events.php | 298 ++++++++++++++++++------------------ 1 file changed, 149 insertions(+), 149 deletions(-) diff --git a/test/events/Test_Events.php b/test/events/Test_Events.php index 536caef0d..aac798ad2 100644 --- a/test/events/Test_Events.php +++ b/test/events/Test_Events.php @@ -141,16 +141,16 @@ public function can_report_events() 'FullyBooted' => array(), 'DongleUSSDStatus' => array( 'Privilege' => 'Privilege', - 'Id' => 'Id', - 'Device' => 'Device', + 'Id' => 'Id', + 'Device' => 'Device', 'Status' => 'Status' ), - 'DongleNewUSSDBase64' => array( + 'DongleNewUSSDBase64' => array( 'Device' => 'Device', 'Message' => 'Message', 'Privilege' => 'Privilege' ), - 'DongleNewCUSD' => array( + 'DongleNewCUSD' => array( 'Device' => 'Device', 'Message' => 'Message', 'Privilege' => 'Privilege' @@ -220,17 +220,17 @@ public function can_report_events() 'Waiting' => 'Waiting', 'Releasing' => 'Releasing', 'Initializing' => 'Initializing' - ), - 'DongleShowDevicesComplete' => array('ListItems' => 'items'), + ), + 'DongleShowDevicesComplete' => array('ListItems' => 'items'), 'DongleSMSStatus' => array( 'Privilege' => 'Privilege', - 'Id' => 'Id', - 'Device' => 'Device', + 'Id' => 'Id', + 'Device' => 'Device', 'Status' => 'Status' ), 'DongleStatus' => array( 'Privilege' => 'Privilege', - 'Device' => 'Device', + 'Device' => 'Device', 'Status' => 'Status' ), 'AgentConnect' => array( @@ -270,12 +270,12 @@ public function can_report_events() 'Privilege' => 'Privilege', 'Channel' => 'Channel', 'ChannelType' => 'ChannelType', - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', 'SIPfullcontact' => 'SIPfullcontact', 'SIPcallid' => 'SIPcallid' ), 'CoreShowChannel' => array( - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', 'Privilege' => 'Privilege', 'Channel' => 'Channel', 'AccountCode' => 'AccountCode', @@ -310,40 +310,40 @@ public function can_report_events() 'Privilege' => 'Privilege', 'Destination' => 'Destination', 'SubEvent' => 'SubEvent', - 'CallerIdName' => 'CallerIdName', + 'CallerIdName' => 'CallerIdName', 'CallerIdNum' => 'CallerIdNum', 'Channel' => 'Channel', - 'DialStatus' => 'DialStatus', + 'DialStatus' => 'DialStatus', 'DialString' => 'DialString', - 'UniqueID' => 'UniqueID', - 'DestUniqueID' => 'DestUniqueID', + 'UniqueID' => 'UniqueID', + 'DestUniqueID' => 'DestUniqueID', ), 'ExtensionStatus' => array( 'Privilege' => 'Privilege', 'Status' => 'Status', 'Exten' => 'Extension', 'Hint' => 'Hint', - 'Context' => 'Context', + 'Context' => 'Context', ), 'Hangup' => array( 'CallerIdName' => 'CallerIdName', 'CallerIdNum' => 'CallerIdNum', 'Channel' => 'Channel', 'Privilege' => 'Privilege', - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', 'Cause' => 'Cause', 'cause-txt' => 'cause-txt' ), 'Hold' => array( 'Privilege' => 'Privilege', - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', 'Status' => 'Status', 'Channel' => 'Channel', ), - 'Join' => array( + 'Join' => array( 'CallerIdName' => 'CallerIdName', 'CallerIdNum' => 'CallerIdNum', - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', 'Position' => 'Position', 'Queue' => 'Queue', 'Channel' => 'Channel', @@ -353,11 +353,11 @@ public function can_report_events() 'Leave' => array( 'Channel' => 'Channel', 'Privilege' => 'Privilege', - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', 'Count' => 'Count', 'Queue' => 'Queue' ), - 'ListDialplan' => array( + 'ListDialplan' => array( 'AppData' => 'AppData', 'Application' => 'Application', 'Priority' => 'Priority', @@ -374,25 +374,25 @@ public function can_report_events() 'Privilege' => 'Privilege', ), 'MessageWaiting' => array( - 'Privilege' => 'Privilege', - 'Waiting' => 'Waiting', - 'Mailbox' => 'Mailbox', + 'Privilege' => 'Privilege', + 'Waiting' => 'Waiting', + 'Mailbox' => 'Mailbox', ), 'MusicOnHold' => array( 'Channel' => 'Channel', 'Privilege' => 'Privilege', - 'UniqueID' => 'UniqueID', - 'State' => 'State', + 'UniqueID' => 'UniqueID', + 'State' => 'State', ), 'NewAccountCode' => array( 'Channel' => 'Channel', 'Privilege' => 'Privilege', - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', 'AccountCode' => 'AccountCode', 'OldAccountCode' => 'OldAccountCode', ), 'NewCallerid' => array( - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', 'CallerIdName' => 'CallerIdName', 'CallerIdNum' => 'CallerIdNum', 'Channel' => 'Channel', @@ -400,7 +400,7 @@ public function can_report_events() 'CID-CallingPres' => 'CID-CallingPres' ), 'Newchannel' => array( - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', 'CallerIdName' => 'CallerIdName', 'CallerIdNum' => 'CallerIdNum', 'ChannelStateDesc' => 'ChannelStateDesc', @@ -411,7 +411,7 @@ public function can_report_events() 'Exten' => 'Exten', 'Privilege' => 'Privilege' ), - 'Newexten' => array( + 'Newexten' => array( 'Channel' => 'Channel', 'Privilege' => 'Privilege', 'AppData' => 'AppData', @@ -420,9 +420,9 @@ public function can_report_events() 'Extension' => 'Extension', 'Exten' => 'Exten', 'Context' => 'Context', - 'UniqueID' => 'UniqueID', + 'UniqueID' => 'UniqueID', ), - 'Newstate' => array( + 'Newstate' => array( 'CallerIdName' => 'CallerIdName', 'CallerIdNum' => 'CallerIdNum', 'UniqueID' => 'UniqueID', @@ -459,7 +459,7 @@ public function can_report_events() 'ObjectName' => 'ObjectName', 'ChannelType' => 'ChannelType', ), - 'PeerStatus' => array( + 'PeerStatus' => array( 'Privilege' => 'Privilege', 'ChannelType' => 'ChannelType', 'Peer' => 'Peer', @@ -476,28 +476,28 @@ public function can_report_events() 'Location' => 'Location', 'Queue' => 'Queue', 'Privilege' => 'Privilege', - 'Paused' => 1, + 'Paused' => 1, ), 'QueueMember' => array( 'Name' => 'Name', 'Location' => 'Location', 'Queue' => 'Queue', - 'Paused' => 1, + 'Paused' => 1, 'Status' => 'Status', 'CallsTaken' => 'CallsTaken', 'Penalty' => 'Penalty', - 'Membership' => 'Membership', + 'Membership' => 'Membership', ), 'QueueMemberAdded' => array( 'MemberName' => 'MemberName', 'LastCall' => 'LastCall', 'Location' => 'Location', 'Queue' => 'Queue', - 'Paused' => 1, + 'Paused' => 1, 'Status' => 'Status', 'CallsTaken' => 'CallsTaken', 'Penalty' => 'Penalty', - 'Membership' => 'Membership', + 'Membership' => 'Membership', 'Privilege' => 'Privilege' ), 'QueueMemberStatus' => array( @@ -511,9 +511,9 @@ public function can_report_events() 'Queue' => 'Queue', 'Privilege' => 'Privilege' ), - 'QueueParams' => array( + 'QueueParams' => array( 'Completed' => '4', - 'HoldTime' => '5', + 'HoldTime' => '5', 'Calls' => '6', 'Strategy' => 'Strategy', 'Max' => '6', @@ -524,7 +524,7 @@ public function can_report_events() 'Abandoned' => '3' ), 'QueueSummaryComplete' => array(), - 'QueueSummary' => array( + 'QueueSummary' => array( 'LongestHoldTime' => 'LongestHoldTime', 'HoldTime' => 'HoldTime', 'Callers' => 'Callers', @@ -533,8 +533,8 @@ public function can_report_events() 'Queue' => 'Queue', ), 'QueueStatusComplete' => array(), - 'DAHDIShowChannelsComplete' => array('items' => 'ListItems'), - 'PeerlistComplete' => array('ListItems' => 'ListItems'), + 'DAHDIShowChannelsComplete' => array('items' => 'ListItems'), + 'PeerlistComplete' => array('ListItems' => 'ListItems'), 'CoreShowChannelsComplete' => array('ListItems' => 'ListItems'), 'RTCPReceived' => array( 'DLSR' => 'DLSR', @@ -622,7 +622,7 @@ public function can_report_events() 'Extension' => 'Extension', 'Context' => 'Context', 'UniqueID' => 'UniqueID', - 'Privilege' => 'Privilege', + 'Privilege' => 'Privilege', 'Channel' => 'Channel' ), 'Transfer' => array( @@ -670,85 +670,85 @@ public function can_report_events() 'Key' => 'Key', 'Val' => 'Val' ), - 'ParkedCallsComplete' => array(), - 'StatusComplete' => array('Items' => 'Items'), + 'ParkedCallsComplete' => array(), + 'StatusComplete' => array('Items' => 'Items'), 'RegistrationsComplete' => array('ListItems' => 'ListItems'), 'DTMF' => array( - 'Privilege' => 'Privilege', - 'UniqueID' => 'UniqueID', + 'Privilege' => 'Privilege', + 'UniqueID' => 'UniqueID', 'Channel' => 'Channel', 'Direction' => 'Direction', 'End' => 'End', 'Begin' => 'Begin', 'Digit' => 'Digit' - ), + ), 'AGIExec' => array( - 'Privilege' => 'Privilege', - 'CommandId' => 'CommandId', + 'Privilege' => 'Privilege', + 'CommandId' => 'CommandId', 'SubEvent' => 'SubEvent', 'Channel' => 'Channel', 'Command' => 'Command', 'Result' => 'Result', 'ResultCode' => 'ResultCode' - ), + ), 'VarSet' => array( - 'Privilege' => 'Privilege', + 'Privilege' => 'Privilege', 'Channel' => 'Channel', 'Variable' => 'Variable', 'Value' => 'Value', - 'UniqueID' => 'UniqueID' - ), - 'Unlink' => array( - 'Privilege' => 'Privilege', - 'CallerID1' => 'CallerID1', - 'CallerID2' => 'CallerID2', - 'UniqueID1' => 'UniqueID1', - 'UniqueID2' => 'UniqueID2', - 'Channel1' => 'Channel1', - 'Channel2' => 'Channel2', - ), - 'Bridge' => array( - 'Privilege' => 'Privilege', - 'CallerID1' => 'CallerID1', - 'CallerID2' => 'CallerID2', - 'UniqueID1' => 'UniqueID1', - 'UniqueID2' => 'UniqueID2', - 'Channel1' => 'Channel1', - 'Channel2' => 'Channel2', - 'BridgeState' => 'BridgeStart', - 'BridgeType' => 'BridgeType' - ), - 'vgsm_sms_rx' => array( - 'Privilege' => 'Privilege', - 'X-SMS-Status-Report-Indication' => 'X-SMS-Status-Report-Indication', - 'X-SMS-User-Data-Header-Indicator' => 'X-SMS-User-Data-Header-Indicator', - 'X-SMS-Reply-Path' => 'X-SMS-Reply-Path', - 'X-SMS-More-Messages-To-Send' => 'X-SMS-More-Messages-To-Send', - 'X-SMS-SMCC-Number' => 'X-SMS-SMCC-Number', - 'X-SMS-SMCC-TON' => 'X-SMS-SMCC-TON', - 'X-SMS-SMCC-NP' => 'X-SMS-SMCC-NP', - 'X-SMS-Sender-Number' => 'X-SMS-Sender-Number', - 'X-SMS-Sender-TON' => 'X-SMS-Sender-TON', - 'X-SMS-Sender-NP' => 'X-SMS-Sender-NP', - 'X-SMS-Message-Type' => 'X-SMS-Message-Type', - 'Content' => 'Content', - 'Date' => 'Date', - 'Content-Transfer-Encoding' => 'ContentEncoding', - 'Content-Type' => 'ContentType', - 'MIME-Version' => 'MIME-Version', - 'Subject' => 'Subject', - 'From' => 'From', - 'Received' => 'Received' - ), - 'vgsm_net_state' => array( - 'Privilege' => 'Privilege', - 'X-vGSM-GSM-Registration' => 'X-vGSM-GSM-Registration', - ), - 'vgsm_me_state' => array( - 'Privilege' => 'Privilege', - 'X-vGSM-ME-State-Change-Reason' => 'X-vGSM-ME-State-Change-Reason', - 'X-vGSM-ME-Old-State' => 'X-vGSM-ME-Old-State', - 'X-vGSM-ME-State' => 'X-vGSM-ME-State', + 'UniqueID' => 'UniqueID' + ), + 'Unlink' => array( + 'Privilege' => 'Privilege', + 'CallerID1' => 'CallerID1', + 'CallerID2' => 'CallerID2', + 'UniqueID1' => 'UniqueID1', + 'UniqueID2' => 'UniqueID2', + 'Channel1' => 'Channel1', + 'Channel2' => 'Channel2', + ), + 'Bridge' => array( + 'Privilege' => 'Privilege', + 'CallerID1' => 'CallerID1', + 'CallerID2' => 'CallerID2', + 'UniqueID1' => 'UniqueID1', + 'UniqueID2' => 'UniqueID2', + 'Channel1' => 'Channel1', + 'Channel2' => 'Channel2', + 'BridgeState' => 'BridgeStart', + 'BridgeType' => 'BridgeType' + ), + 'vgsm_sms_rx' => array( + 'Privilege' => 'Privilege', + 'X-SMS-Status-Report-Indication' => 'X-SMS-Status-Report-Indication', + 'X-SMS-User-Data-Header-Indicator' => 'X-SMS-User-Data-Header-Indicator', + 'X-SMS-Reply-Path' => 'X-SMS-Reply-Path', + 'X-SMS-More-Messages-To-Send' => 'X-SMS-More-Messages-To-Send', + 'X-SMS-SMCC-Number' => 'X-SMS-SMCC-Number', + 'X-SMS-SMCC-TON' => 'X-SMS-SMCC-TON', + 'X-SMS-SMCC-NP' => 'X-SMS-SMCC-NP', + 'X-SMS-Sender-Number' => 'X-SMS-Sender-Number', + 'X-SMS-Sender-TON' => 'X-SMS-Sender-TON', + 'X-SMS-Sender-NP' => 'X-SMS-Sender-NP', + 'X-SMS-Message-Type' => 'X-SMS-Message-Type', + 'Content' => 'Content', + 'Date' => 'Date', + 'Content-Transfer-Encoding' => 'ContentEncoding', + 'Content-Type' => 'ContentType', + 'MIME-Version' => 'MIME-Version', + 'Subject' => 'Subject', + 'From' => 'From', + 'Received' => 'Received' + ), + 'vgsm_net_state' => array( + 'Privilege' => 'Privilege', + 'X-vGSM-GSM-Registration' => 'X-vGSM-GSM-Registration', + ), + 'vgsm_me_state' => array( + 'Privilege' => 'Privilege', + 'X-vGSM-ME-State-Change-Reason' => 'X-vGSM-ME-State-Change-Reason', + 'X-vGSM-ME-Old-State' => 'X-vGSM-ME-Old-State', + 'X-vGSM-ME-State' => 'X-vGSM-ME-State', ), 'CEL' => array( 'AMAFlags' => 'AMAFlags', @@ -1411,20 +1411,20 @@ public function can_report_events() 'Agents' => array( 'LoggedInChan' => 'Channel' ), - 'ExtensionStatus' => array( + 'ExtensionStatus' => array( 'Exten' => 'Extension' ), 'Hangup' => array( 'cause-txt' => 'CauseText' ), - 'ListDialplan' => array( + 'ListDialplan' => array( 'AppData' => 'ApplicationData', ), 'NewCallerid' => array( 'CID-CallingPres' => 'CallerIdPres' ), 'Newchannel' => array('Exten' => 'Extension'), - 'Newexten' => array( + 'Newexten' => array( 'AppData' => 'ApplicationData', ), 'QueueMemberStatus' => array( @@ -1433,7 +1433,7 @@ public function can_report_events() 'QueueMember' => array( 'Name' => 'MemberName' ), - 'AGIExec' => array(), + 'AGIExec' => array(), 'Transfer' => array( 'SIP-Callid' => 'SipCallID', ), @@ -1442,31 +1442,31 @@ public function can_report_events() ), 'PeerEntry' => array('ChanObjectType' => 'ChannelObjectType'), 'VarSet' => array('Variable' => 'VariableName'), - 'StatusComplete' => array('Items' => 'ListItems'), + 'StatusComplete' => array('Items' => 'ListItems'), 'DBGetResponse' => array('Key' => 'KeyName', 'Val' => 'Value'), - 'vgsm_sms_rx' => array( - 'X-SMS-Status-Report-Indication' => 'StatusReportIndication', - 'X-SMS-User-Data-Header-Indicator' => 'DataHeaderIndicator', - 'X-SMS-Reply-Path' => 'ReplyPath', - 'X-SMS-More-Messages-To-Send' => 'MoreMessagesToSend', + 'vgsm_sms_rx' => array( + 'X-SMS-Status-Report-Indication' => 'StatusReportIndication', + 'X-SMS-User-Data-Header-Indicator' => 'DataHeaderIndicator', + 'X-SMS-Reply-Path' => 'ReplyPath', + 'X-SMS-More-Messages-To-Send' => 'MoreMessagesToSend', 'X-SMS-SMCC-Number' => 'SMCCNumber', - 'X-SMS-SMCC-TON' => 'SMCCTON', - 'X-SMS-SMCC-NP' => 'SMCCNP', - 'X-SMS-Sender-Number' => 'SenderNumber', - 'X-SMS-Sender-TON' => 'SenderTON', - 'X-SMS-Sender-NP' => 'SenderNP', - 'X-SMS-Message-Type' => 'MessageType', + 'X-SMS-SMCC-TON' => 'SMCCTON', + 'X-SMS-SMCC-NP' => 'SMCCNP', + 'X-SMS-Sender-Number' => 'SenderNumber', + 'X-SMS-Sender-TON' => 'SenderTON', + 'X-SMS-Sender-NP' => 'SenderNP', + 'X-SMS-Message-Type' => 'MessageType', 'Content-Transfer-Encoding' => 'ContentEncoding', 'Content-Type' => 'ContentType', 'MIME-Version' => 'MIMEVersion' - ), - 'DAHDIShowChannelsComplete' => array('items' => 'ListItems'), - 'vgsm_net_state' => array('X-vGSM-GSM-Registration' => 'State'), - 'vgsm_me_state' => array( - 'X-vGSM-ME-State-Change-Reason' => 'Reason', - 'X-vGSM-ME-Old-State' => 'OldState', - 'X-vGSM-ME-State' => 'State', - ), + ), + 'DAHDIShowChannelsComplete' => array('items' => 'ListItems'), + 'vgsm_net_state' => array('X-vGSM-GSM-Registration' => 'State'), + 'vgsm_me_state' => array( + 'X-vGSM-ME-State-Change-Reason' => 'Reason', + 'X-vGSM-ME-Old-State' => 'OldState', + 'X-vGSM-ME-State' => 'State', + ), 'ParkedCall' => array('Exten' => 'Extension'), 'UnParkedCall' => array('Exten' => 'Extension'), 'AGIExecStart' => array( @@ -1489,32 +1489,32 @@ private function _testEvent($eventName, array $getters, array $values, array $tr $mock_stream_socket_client = true; $mock_stream_set_blocking = true; $options = array( - 'host' => '2.3.4.5', + 'host' => '2.3.4.5', 'scheme' => 'tcp://', - 'port' => 9999, - 'username' => 'asd', - 'secret' => 'asd', + 'port' => 9999, + 'username' => 'asd', + 'secret' => 'asd', 'connect_timeout' => 10, - 'read_timeout' => 10 + 'read_timeout' => 10 ); $write = array( - "action: Login\r\nactionid: 1432.123\r\nusername: asd\r\nsecret: asd\r\n" + "action: Login\r\nactionid: 1432.123\r\nusername: asd\r\nsecret: asd\r\n" ); setFgetsMock($standardAMIStart, $write); $client = new \PAMI\Client\Impl\ClientImpl($options); $client->registerEventListener(new SomeListenerClass); - $client->open(); - $message = array(); - $message[] = 'Event: ' . $eventName; - foreach ($values as $key => $value) { - $message[] = $key . ': ' . $value; - } - $message[] = ''; - setFgetsMock($message, $message); - for($i = 0; $i < count($message); $i++) { - $client->process(); - } - $event = SomeListenerClass::$event; + $client->open(); + $message = array(); + $message[] = 'Event: ' . $eventName; + foreach ($values as $key => $value) { + $message[] = $key . ': ' . $value; + } + $message[] = ''; + setFgetsMock($message, $message); + for($i = 0; $i < count($message); $i++) { + $client->process(); + } + $event = SomeListenerClass::$event; foreach ($values as $key => $value) { if (isset($getters[$eventName][$key])) { $methodName = 'get' . $getters[$eventName][$key]; From e75caaeab4bab0db1b707e09addcfa29fb87fb54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Z=C3=BA=C3=B1iga?= Date: Fri, 23 Jun 2017 13:34:50 -0500 Subject: [PATCH 09/13] Found some new events in my logs. Removed the testing because apparently I don't know what to do with it. --- src/PAMI/Message/Event/ReloadEvent.php | 46 +++++++++++++++++++++++++ src/PAMI/Message/Event/SuccessEvent.php | 46 +++++++++++++++++++++++++ test/events/Test_Events.php | 9 +---- 3 files changed, 93 insertions(+), 8 deletions(-) create mode 100644 src/PAMI/Message/Event/ReloadEvent.php create mode 100644 src/PAMI/Message/Event/SuccessEvent.php diff --git a/src/PAMI/Message/Event/ReloadEvent.php b/src/PAMI/Message/Event/ReloadEvent.php new file mode 100644 index 000000000..7cb7d8a82 --- /dev/null +++ b/src/PAMI/Message/Event/ReloadEvent.php @@ -0,0 +1,46 @@ + + * @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; + +class ReloadEvent extends EventMessage +{ + /** + * Returns key: 'RawContent'. + * + * @return string + */ + public function getRawContent() + { + return $this->getKey('RawContent'); + } +} diff --git a/src/PAMI/Message/Event/SuccessEvent.php b/src/PAMI/Message/Event/SuccessEvent.php new file mode 100644 index 000000000..42e40bf57 --- /dev/null +++ b/src/PAMI/Message/Event/SuccessEvent.php @@ -0,0 +1,46 @@ + + * @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; + +class SuccessEvent extends EventMessage +{ + /** + * Returns key: 'RawContent'. + * + * @return string + */ + public function getRawContent() + { + return $this->getKey('RawContent'); + } +} diff --git a/test/events/Test_Events.php b/test/events/Test_Events.php index aac798ad2..b077c80aa 100644 --- a/test/events/Test_Events.php +++ b/test/events/Test_Events.php @@ -66,7 +66,7 @@ public function can_report_events() 'PeerStatus', 'PeerEntry', 'OriginateResponse', 'Newstate', 'Newexten', 'Newchannel', 'NewCallerid', 'NewAccountCode', 'MusicOnHold', 'MessageWaiting', 'Masquerade', 'ListDialplan', 'Leave', 'Join', - 'Hold', 'Hangup', 'ExtensionStatus', 'Dial', 'DAHDIChannel', 'DAHDIShowChannels', + 'Hold', 'Hangup', 'ExtensionStatus', 'Dial', 'DAHDIShowChannels', 'CoreShowChannelsComplete', 'CoreShowChannel', 'ChannelUpdate', 'Agents', 'AgentsComplete', 'Agentlogoff', 'Agentlogin', 'AgentConnect', 'DongleSMSStatus', 'FullyBooted', 'DongleShowDevicesComplete', 'DongleDeviceEntry', @@ -291,13 +291,6 @@ public function can_report_events() 'BridgedChannel' => 'BridgedChannel', 'Duration' => 'Duration', ), - 'DAHDIChannel' => array( - 'Priviledge' => 'Priviledge', - 'DAHDIChannel' => 'DAHDIChannel', - 'DAHDISpan' => 'DAHDISpan', - 'Channel' => 'Channel', - 'UniqueID' => 'UniqueID' - ), 'DAHDIShowChannels' => array( 'Channel' => 'Channel', 'Context' => 'Context', From 29654b2445457d458dfd87b3b17208bc1d6394bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Z=C3=BA=C3=B1iga?= Date: Fri, 23 Jun 2017 13:45:10 -0500 Subject: [PATCH 10/13] Fixed readme --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d2c47991d..4baaea704 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,7 @@ can still catch them. If you catch one of these, please report it! * ConfbridgeUnmute * CoreShowChannel * CoreShowChannelComplete +* DAHDIChannel * DAHDIShowChannel * DAHDIShowChannelsComplete * FullyBooted @@ -170,6 +171,7 @@ can still catch them. If you catch one of these, please report it! * QueueParams * QueueStatusComplete * QueueSummaryComplete +* Reload * RegistrationsComplete * Registry * Rename @@ -179,6 +181,7 @@ can still catch them. If you catch one of these, please report it! * RTPReceiverStat * RTPSenderStat * ShowDialPlanComplete +* Success * Status * StatusComplete * Transfer @@ -207,7 +210,6 @@ can still catch them. If you catch one of these, please report it! * CoreSettings * CoreShowChannels * CoreStatus -* DAHDIChannel * DAHDIDialOffHookAction * DAHDIHangup * DAHDIRestart From 1832c09f69d54e3274517f7f5f32ab53019bb118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Z=C3=BA=C3=B1iga?= Date: Fri, 23 Jun 2017 13:54:35 -0500 Subject: [PATCH 11/13] Trying event testing, again. --- test/events/Test_Events.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/events/Test_Events.php b/test/events/Test_Events.php index b077c80aa..8ec316f61 100644 --- a/test/events/Test_Events.php +++ b/test/events/Test_Events.php @@ -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', @@ -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( From 3bdf68042cad6ecedb338f19e7ab6a6ca32b6d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Z=C3=BA=C3=B1iga?= Date: Fri, 23 Jun 2017 14:01:46 -0500 Subject: [PATCH 12/13] Typo in assertTrue() in Test_Events --- test/events/Test_Events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/events/Test_Events.php b/test/events/Test_Events.php index 8ec316f61..40cc13a1d 100644 --- a/test/events/Test_Events.php +++ b/test/events/Test_Events.php @@ -1533,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); From 1639048f85b8204f3b258d0930468f27c17f0247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Z=C3=BA=C3=B1iga?= Date: Fri, 23 Jun 2017 14:03:40 -0500 Subject: [PATCH 13/13] Added a missing array comma --- test/events/Test_Events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/events/Test_Events.php b/test/events/Test_Events.php index 40cc13a1d..508f4e6c3 100644 --- a/test/events/Test_Events.php +++ b/test/events/Test_Events.php @@ -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', 'DAHDIChannel', 'Reload', 'Success' + 'ParkedCall', 'UnParkedCall', 'Link', 'DAHDIChannel', 'Reload', 'Success', 'AGIExecStart', 'AGIExecEnd', 'AsyncAGIStart',