Source of file SCCPShowDeviceEvent.php

Size: 14,491 Bytes - Last Modified: 2019-04-25T22:07:38+00:00

/data/development/sccp/sources/PAMI/src/PAMI/Message/Event/SCCPShowDeviceEvent.php

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
<?php
/**
 * Event triggered by SCCPShowDevice.
 *
 * PHP Version 5
 *
 * @category   Pami
 * @package    Message
 * @subpackage Event
 * @author     Diederik de Groot <ddegroot@users.sf.net>
 * @license    http://marcelog.github.com/PAMI/ Apache License 2.0
 * @version    SVN: $Id$
 * @link       http://marcelog.github.com/PAMI/
 *
 * Copyright 2015 Diederik de Groot <ddegroot@users.sf.net>, Marcelo Gornstein <marcelog@gmail.com>
 *
 * 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;
use PAMI\Exception\PAMIException;

/**
 * Event triggered by SCCPShowDevice.
 *
 * PHP Version 5
 *
 * @category   Pami
 * @package    Message
 * @subpackage Event
 * @author     Diederik de Groot <ddegroot@users.sf.net>
 * @license    http://marcelog.github.com/PAMI/ Apache License 2.0
 * @link       http://marcelog.github.com/PAMI/
 */
class SCCPShowDeviceEvent extends EventMessage
{
    /**
     * Returns key: 'MACAddress'.
     *
     * @return string
     */
    public function getMACAddress()
    {
        return $this->getKey('MACAddress');
    }

    /**
     * Returns key: 'DeviceName'.
     *
     * @return string
     */
    public function getDeviceName()
    {
        return $this->getMACAddress();
    }

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

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

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

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

    /**
     * Returns key: 'Keepalive'.
     *
     * @return integer
     */
    public function getKeepalive()
    {
        return intval($this->getKey('Keepalive'));
    }

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

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

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

    /**
     * Returns key: 'MWIHandsetLight'.
     *
     * @return boolean
     */
    public function getMWIHandsetLight()
    {
        return $this->getBoolKey('MWIHandsetLight');
    }

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

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

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

    /**
     * Returns key: 'SoftkeySupport'.
     *
     * @return boolean
     */
    public function getSoftkeySupport()
    {
        return $this->getBoolKey('SoftkeySupport');
    }

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

    /**
     * Returns key: 'BTemplateSupport'.
     *
     * @return boolean
     */
    public function getBTemplateSupport()
    {
        return $this->getBoolKey('BTemplateSupport');
    }

    /**
     * Returns key: 'linesRegistered'.
     *
     * @return boolean
     */
    public function getLinesRegistered()
    {
        return $this->getBoolKey('linesRegistered');
    }

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

    /**
     * Returns key: 'TimezoneOffset'.
     *
     * @return integer
     */
    public function getTimezoneOffset()
    {
        return intval($this->getKey('TimezoneOffset'));
    }

    /**
     * Returns key: 'Capabilities'.
     *
     * @return (string|int)[]
     */
    public function getCapabilities()
    {
        $ret = array();
        $codecs=explode(", ", substr($this->getKey('Capabilities'), 1, -1));
        foreach ($codecs as $codec) {
            $codec_parts=explode(" ", $codec);
            $ret[] = array("name" => $codec_parts[0], "value" => substr($codec_parts[1], 1, -1));
        }
        return $ret;
    }

    /**
     * Returns key: 'CodecsPreference'.
     *
     * @return (string|int)[]
     */
    public function getCodecsPreference()
    {
        $ret = array();
        $codecs=explode(", ", substr($this->getKey('CodecsPreference'), 1, -1));
        foreach ($codecs as $codec) {
            $codec_parts=explode(" ", $codec);
            $ret[] = array("name" => $codec_parts[0], "value" => substr($codec_parts[1], 1, -1));
        }
        return $ret;
    }

    /**
     * Returns key: 'AudioTOS'.
     *
     * @return integer
     */
    public function getAudioTOS()
    {
        return intval($this->getKey('AudioTOS'));
    }

    /**
     * Returns key: 'AudioCOS'.
     *
     * @return integer
     */
    public function getAudioCOS()
    {
        return intval($this->getKey('AudioCOS'));
    }

    /**
     * Returns key: 'VideoTOS'.
     *
     * @return integer
     */
    public function getVideoTOS()
    {
        return intval($this->getKey('VideoTOS'));
    }

    /**
     * Returns key: 'VideoCOS'.
     *
     * @return integer
     */
    public function getVideoCOS()
    {
        return intval($this->getKey('VideoCOS'));
    }

    /**
     * Returns key: 'DNDFeatureEnabled'.
     *
     * @return boolean
     */
    public function getDNDFeatureEnabled()
    {
        return $this->getBoolKey('DNDFeatureEnabled');
    }

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

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

    /**
     * Returns key: 'CanTransfer'.
     *
     * @return boolean
     */
    public function getCanTransfer()
    {
        return $this->getBoolKey('CanTransfer');
    }

    /**
     * Returns key: 'CanPark'.
     *
     * @return boolean
     */
    public function getCanPark()
    {
        return $this->getBoolKey('CanPark');
    }

    /**
     * Returns key: 'CanCFWDALL'.
     *
     * @return boolean
     */
    public function getCanCFWDALL()
    {
        return $this->getBoolKey('CanCFWDALL');
    }

    /**
     * Returns key: 'CanCFWBUSY'.
     *
     * @return boolean
     */
    public function getCanCFWBUSY()
    {
        return $this->getBoolKey('CanCFWBUSY');
    }

    /**
     * Returns key: 'CanCFWNOANSWER'.
     *
     * @return boolean
     */
    public function getCanCFWNOANSWER()
    {
        return $this->getBoolKey('CanCFWNOANSWER');
    }

    /**
     * Returns key: 'AllowRinginNotification'.
     *
     * @return boolean
     */
    public function getAllowRinginNotification()
    {
        return $this->getBoolKey('AllowRinginNotification');
    }

    /**
     * Returns key: 'PrivateSoftkey'.
     *
     * @return boolean
     */
    public function getPrivateSoftkey()
    {
        return $this->getBoolKey('PrivateSoftkey');
    }

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

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

    /**
     * Returns key: 'Videosupport'.
     *
     * @return boolean
     */
    public function getVideosupport()
    {
        return $this->getBoolKey('Videosupport');
    }

    /**
     * Returns key: 'DirectRTP'.
     *
     * @return boolean
     */
    public function getDirectRTP()
    {
        return $this->getBoolKey('DirectRTP');
    }

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

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

    /**
     * Returns key: 'DenyPermit'.
     *
     * @return string
     */
    public function getDenyPermit()
    {
        $deny = array();
        $permit = array();
        $entries=explode(",", substr($this->getKey('DenyPermit'), 0, -1));
        foreach ($entries as $entry) {
            $entry_parts=explode(":", $entry);
            if ($entry_parts[0]=="deny") {
                $deny[] = $entry_parts[1];
            } elseif ($entry_parts[0]=="permit") {
                $permit[] = $entry_parts[1];
            } else {
                throw new PAMIException('Could not parse DenyPermit value: ' . $this->getKey('DenyPermit'));
            }
        }
        return array('deny'=>$deny, 'permit'=>$permit);
    }

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

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

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

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

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

    /**
     * Returns key: 'DefaultLineInstance'.
     *
     * @return integer
     */
    public function getDefaultLineInstance()
    {
        return intval($this->getKey('DefaultLineInstance'));
    }

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

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

    /**
     * Returns key: 'UsePlacedCalls'.
     *
     * @return boolean
     */
    public function getUsePlacedCalls()
    {
        return $this->getBoolKey('UsePlacedCalls');
    }

    /**
     * Returns key: 'PendingUpdate'.
     *
     * @return boolean
     */
    public function getPendingUpdate()
    {
        return $this->getBoolKey('PendingUpdate');
    }

    /**
     * Returns key: 'PendingDelete'.
     *
     * @return boolean
     */
    public function getPendingDelete()
    {
        return $this->getBoolKey('PendingDelete');
    }

    /**
     * Returns key: 'DirectedPickup'.
     *
     * @return boolean
     */
    public function getDirectedPickup()
    {
        return $this->getBoolKey('DirectedPickup');
    }

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

    /**
     * Returns key: 'PickupModeAnswer'.
     *
     * @return boolean
     */
    public function getPickupModeAnswer()
    {
        return $this->getBoolKey('PickupModeAnswer');
    }

    /**
     * Returns key: 'allowConference'.
     *
     * @return boolean
     */
    public function getallowConference()
    {
        return $this->getBoolKey('allowConference');
    }

    /**
     * Returns key: 'confPlayGeneralAnnounce'.
     *
     * @return boolean
     */
    public function getconfPlayGeneralAnnounce()
    {
        return $this->getBoolKey('confPlayGeneralAnnounce');
    }

    /**
     * Returns key: 'confPlayPartAnnounce'.
     *
     * @return boolean
     */
    public function getconfPlayPartAnnounce()
    {
        return $this->getBoolKey('confPlayPartAnnounce');
    }

    /**
     * Returns key: 'confMuteOnEntry'.
     *
     * @return boolean
     */
    public function getconfMuteOnEntry()
    {
        return $this->getBoolKey('confMuteOnEntry');
    }

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

    /**
     * Returns key: 'confShowConflist'.
     *
     * @return boolean
     */
    public function getconfShowConflist()
    {
        return $this->getBoolKey('confShowConflist');
    }

    /**
     * Returns key: 'conflistActive'.
     *
     * @return boolean
     */
    public function getconflistActive()
    {
        return $this->getBoolKey('conflistActive');
    }

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