1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480 |
- <?php
- /*
- Copyright (c) 2012, Open Source Solutions Limited, Dublin, Ireland
- All rights reserved.
- Contact: Barry O'Donovan - barry (at) opensolutions (dot) ie
- http://www.opensolutions.ie/
- This file is part of the OSS_SNMP package.
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of Open Source Solutions Limited nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- namespace OSS_SNMP\MIBS\Asterisk;
- /**
- * A class for performing SNMP V2 queries on Asterisk
- *
- * @see https://wiki.asterisk.org/wiki/display/AST/Asterisk+MIB+Definitions
- * @copyright Copyright (c) 2012, Open Source Solutions Limited, Dublin, Ireland
- * @author Barry O'Donovan <barry@opensolutions.ie>
- */
- class Channels extends \OSS_SNMP\MIB
- {
- const OID_ASTERISK_CHANNELS_ACTIVE = '.1.3.6.1.4.1.22736.1.5.1.0';
- const OID_ASTERISK_CHANNELS_SUPPORTED = '.1.3.6.1.4.1.22736.1.5.3.0';
- const OID_ASTERISK_CHANNEL_TYPE_NAME = '.1.3.6.1.4.1.22736.1.5.4.1.2';
- const OID_ASTERISK_CHANNEL_TYPE_DESCRIPTION = '.1.3.6.1.4.1.22736.1.5.4.1.3';
- const OID_ASTERISK_CHANNEL_TYPE_STATE = '.1.3.6.1.4.1.22736.1.5.4.1.4';
- const OID_ASTERISK_CHANNEL_TYPE_INDICATION = '.1.3.6.1.4.1.22736.1.5.4.1.5';
- const OID_ASTERISK_CHANNEL_TYPE_TRANSFER = '.1.3.6.1.4.1.22736.1.5.4.1.6';
- const OID_ASTERISK_CHANNEL_TYPE_CHANNELS = '.1.3.6.1.4.1.22736.1.5.4.1.7';
-
- const OID_ASTERISK_CHANNEL_NAME = '.1.3.6.1.4.1.22736.1.5.2.1.2';
- const OID_ASTERISK_CHANNEL_LANGUAGE = '.1.3.6.1.4.1.22736.1.5.2.1.3';
- const OID_ASTERISK_CHANNEL_TYPE = '.1.3.6.1.4.1.22736.1.5.2.1.4';
- const OID_ASTERISK_CHANNEL_MUSIC_CLASS = '.1.3.6.1.4.1.22736.1.5.2.1.5';
- const OID_ASTERISK_CHANNEL_BRIDGE = '.1.3.6.1.4.1.22736.1.5.2.1.6';
- const OID_ASTERISK_CHANNEL_MASQ = '.1.3.6.1.4.1.22736.1.5.2.1.7';
- const OID_ASTERISK_CHANNEL_MASQR = '.1.3.6.1.4.1.22736.1.5.2.1.8';
- const OID_ASTERISK_CHANNEL_WHEN_HANGUP = '.1.3.6.1.4.1.22736.1.5.2.1.9';
- const OID_ASTERISK_CHANNEL_APP = '.1.3.6.1.4.1.22736.1.5.2.1.10';
- const OID_ASTERISK_CHANNEL_DATA = '.1.3.6.1.4.1.22736.1.5.2.1.11';
- const OID_ASTERISK_CHANNEL_CONTEXT = '.1.3.6.1.4.1.22736.1.5.2.1.12';
- const OID_ASTERISK_CHANNEL_MACRO_CONTEXT = '.1.3.6.1.4.1.22736.1.5.2.1.13';
- const OID_ASTERISK_CHANNEL_MACRO_EXTEN = '.1.3.6.1.4.1.22736.1.5.2.1.14';
- const OID_ASTERISK_CHANNEL_MACRO_PRI = '.1.3.6.1.4.1.22736.1.5.2.1.15';
- const OID_ASTERISK_CHANNEL_EXTEN = '.1.3.6.1.4.1.22736.1.5.2.1.16';
- const OID_ASTERISK_CHANNEL_PRI = '.1.3.6.1.4.1.22736.1.5.2.1.17';
- const OID_ASTERISK_CHANNEL_ACCOUNT_CODE = '.1.3.6.1.4.1.22736.1.5.2.1.18';
- const OID_ASTERISK_CHANNEL_FORWARD_TO = '.1.3.6.1.4.1.22736.1.5.2.1.19';
- const OID_ASTERISK_CHANNEL_UNQIUEID = '.1.3.6.1.4.1.22736.1.5.2.1.20';
- const OID_ASTERISK_CHANNEL_CALL_GROUP = '.1.3.6.1.4.1.22736.1.5.2.1.21';
- const OID_ASTERISK_CHANNEL_PICKUP_GROUP = '.1.3.6.1.4.1.22736.1.5.2.1.22';
- const OID_ASTERISK_CHANNEL_STATE = '.1.3.6.1.4.1.22736.1.5.2.1.23';
- const OID_ASTERISK_CHANNEL_MUTED = '.1.3.6.1.4.1.22736.1.5.2.1.24';
- const OID_ASTERISK_CHANNEL_RINGS = '.1.3.6.1.4.1.22736.1.5.2.1.25';
- const OID_ASTERISK_CHANNEL_CID_DNID = '.1.3.6.1.4.1.22736.1.5.2.1.26';
- const OID_ASTERISK_CHANNEL_CID_NUM = '.1.3.6.1.4.1.22736.1.5.2.1.27';
- const OID_ASTERISK_CHANNEL_CID_NAME = '.1.3.6.1.4.1.22736.1.5.2.1.28';
- const OID_ASTERISK_CHANNEL_CID_ANI = '.1.3.6.1.4.1.22736.1.5.2.1.29';
- const OID_ASTERISK_CHANNEL_CID_RDNIS = '.1.3.6.1.4.1.22736.1.5.2.1.30';
- const OID_ASTERISK_CHANNEL_CID_PRESENTATION = '.1.3.6.1.4.1.22736.1.5.2.1.31';
- const OID_ASTERISK_CHANNEL_CID_ANI2 = '.1.3.6.1.4.1.22736.1.5.2.1.32';
- const OID_ASTERISK_CHANNEL_CID_TON = '.1.3.6.1.4.1.22736.1.5.2.1.33';
- const OID_ASTERISK_CHANNEL_CID_TNS = '.1.3.6.1.4.1.22736.1.5.2.1.34';
- const OID_ASTERISK_CHANNEL_AMA_FLAGS = '.1.3.6.1.4.1.22736.1.5.2.1.35';
- const OID_ASTERISK_CHANNEL_ADSI = '.1.3.6.1.4.1.22736.1.5.2.1.36';
- const OID_ASTERISK_CHANNEL_TONE_ZONE = '.1.3.6.1.4.1.22736.1.5.2.1.37';
- const OID_ASTERISK_CHANNEL_HANGUP_CAUSE = '.1.3.6.1.4.1.22736.1.5.2.1.38';
- const OID_ASTERISK_CHANNEL_VARIABLES = '.1.3.6.1.4.1.22736.1.5.2.1.39';
- const OID_ASTERISK_CHANNEL_FLAGS = '.1.3.6.1.4.1.22736.1.5.2.1.40';
- const OID_ASTERISK_CHANNEL_TRANSFER_CAP = '.1.3.6.1.4.1.22736.1.5.2.1.41';
-
- const OID_ASTERISK_CHANNELS_BRIDGED = '.1.3.6.1.4.1.22736.1.5.5.1.0';
- /**
- * Returns the current number of active channels.
- *
- * > Current number of active channels.
- *
- * @return int The current number of active channels.
- */
- public function active()
- {
- return $this->getSNMP()->get( self::OID_ASTERISK_CHANNELS_ACTIVE );
- }
- /**
- * Returns the number of channel types (technologies) supported.
- *
- * > Number of channel types (technologies) supported.
- *
- * @return int The number of channel types (technologies) supported.
- */
- public function supported()
- {
- return $this->getSNMP()->get( self::OID_ASTERISK_CHANNELS_SUPPORTED );
- }
- /**
- * Array of supported channel type names
- *
- * > Unique name of the technology we are describing.
- *
- * @return array Supported channel type names
- */
- public function names()
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_TYPE_NAME );
- }
- /**
- * Array of supported channel type descriptions
- *
- * > Description of the channel type (technology).
- *
- * @return array Supported channel type descriptions
- */
- public function descriptions()
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_TYPE_DESCRIPTION );
- }
- /**
- * Array of supported channel type device state capability
- *
- * > Whether the current technology can hold device states.
- *
- * @return array Whether the current technology can hold device states.
- */
- public function deviceStates()
- {
- return $this->getSNMP()->ppTruthValue( $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_TYPE_STATE ) );
- }
- /**
- * Array of supported channel type progress indication capability
- *
- * > Whether the current technology supports progress indication.
- *
- * @return array Whether the current technology supports progress indication.
- */
- public function progressIndications()
- {
- return $this->getSNMP()->ppTruthValue( $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_TYPE_INDICATION ) );
- }
- /**
- * Array of supported channel type transfer capability
- *
- * > Whether the current technology supports transfers, where
- * > Asterisk can get out from inbetween two bridged channels.
- *
- * @return array Whether the current technology transfers
- */
- public function transfers()
- {
- return $this->getSNMP()->ppTruthValue( $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_TYPE_TRANSFER ) );
- }
- /**
- * Array of active calls on supported channels
- *
- * > Number of active channels using the current technology.
- *
- * @return array Active calls on supported channels
- */
- public function activeCalls()
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_TYPE_CHANNELS );
- }
- /**
- * Number of channels currently in a bridged state.
- *
- * > Number of channels currently in a bridged state.
- *
- * @return int Array of active calls on supported channels
- */
- public function bridged()
- {
- return $this->getSNMP()->get( self::OID_ASTERISK_CHANNELS_BRIDGED );
- }
- /**
- * Utility function to gather channel details together in an associative array.
- *
- * Returns an array of support channel types. For example:
- *
- * Array
- * (
- * ....
- * [SIP] => Array
- * (
- * [name] => SIP
- * [index] => 5
- * [description] => Session Initiation Protocol (SIP)
- * [hasDeviceState] => 1
- * [hasProgressIndications] => 1
- * [canTransfer] => 1
- * [activeCalls] => 0
- * )
- * ....
- * )
- *
- * If you chose to index by SNMP table entries, the above element would be indexed with `5` rather than `SIP`.
- *
- * @param bool $useIndex If true, the array is indexed using the SNMP table index rather than the unique channel type name
- * @return array Channel details as an associative array
- */
- public function details( $useIndex = false )
- {
- $details = [];
- foreach( $this->names() as $index => $name )
- {
- if( $useIndex )
- $idx = $index;
- else
- $idx = $name;
- $details[ $idx ]['name'] = $name;
- $details[ $idx ]['index'] = $index;
- $details[ $idx ]['description'] = $this->descriptions()[$index];
- $details[ $idx ]['hasDeviceState'] = $this->deviceStates()[$index];
- $details[ $idx ]['hasProgressIndications'] = $this->progressIndications()[$index];
- $details[ $idx ]['canTransfer'] = $this->transfers()[$index];
- $details[ $idx ]['activeCalls'] = $this->activeCalls()[$index];
- }
- return $details;
- }
-
-
-
-
-
-
-
-
-
-
-
- /**
- * Active Channel Information: Name of the current channel.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Name of the current channel.
- *
- * @return array Name of the current channel.
- */
- public function chanName()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_NAME );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Which language the current channel is configured to use -- used mainly for prompts.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Which language the current channel is configured to use -- used mainly for prompts.
- *
- * @return array Which language the current channel is configured to use -- used mainly for prompts.
- */
- public function chanLanguage()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_LANGUAGE );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Underlying technology for the current channel.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Underlying technology for the current channel.
- *
- * @return array Underlying technology for the current channel.
- */
- public function chanType()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_TYPE );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Music class to be used for Music on Hold for this channel.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Music class to be used for Music on Hold for this channel.
- *
- * @return array Music class to be used for Music on Hold for this channel.
- */
- public function chanMusicClass()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_MUSIC_CLASS );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Which channel this channel is currently bridged (in a conversation) with.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Which channel this channel is currently bridged (in a conversation) with.
- *
- * @return array Which channel this channel is currently bridged (in a conversation) with.
- */
- public function chanBridge()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_BRIDGE );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Channel masquerading for us.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Channel masquerading for us.
- *
- * @return array Channel masquerading for us.
- */
- public function chanMasq()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_MASQ );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Channel we are masquerading for.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Channel we are masquerading for.
- *
- * @return array Channel we are masquerading for.
- */
- public function chanMasqr()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_MASQR );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: How long until this channel will be hung up.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > How long until this channel will be hung up.
- *
- * @return array How long until this channel will be hung up.
- */
- public function chanWhenHangup()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_WHEN_HANGUP );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Current application for the channel.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Current application for the channel.
- *
- * @return array Current application for the channel.
- */
- public function chanApp()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_APP );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Arguments passed to the current application.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Arguments passed to the current application.
- *
- * @return array Arguments passed to the current application.
- */
- public function chanData()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_DATA );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Current extension context.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Current extension context.
- *
- * @return array Current extension context.
- */
- public function chanContext()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_CONTEXT );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Current macro context.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Current macro context.
- *
- * @return array Current macro context.
- */
- public function chanMacroContext()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_MACRO_CONTEXT );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Current macro extension.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Current macro extension.
- *
- * @return array Current macro extension.
- */
- public function chanMacroExten()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_MACRO_EXTEN );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Current macro priority.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Current macro priority.
- *
- * @return array Current macro priority.
- */
- public function chanMacroPri()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_MACRO_PRI );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Current extension.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Current extension.
- *
- * @return array Current extension.
- */
- public function chanExten()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_EXTEN );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Current priority.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Current priority.
- *
- * @return array Current priority.
- */
- public function chanPri()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_PRI );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Account Code for billing.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Account Code for billing.
- *
- * @return array Account Code for billing.
- */
- public function chanAccountCode()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_ACCOUNT_CODE );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Where to forward to if asked to dial on this interface.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Where to forward to if asked to dial on this interface.
- *
- * @return array Where to forward to if asked to dial on this interface.
- */
- public function chanForwardTo()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_FORWARD_TO );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Unique Channel Identifier.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Unique Channel Identifier.
- *
- * @return array Unique Channel Identifier.
- */
- public function chanUniqueId()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_UNQIUEID );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Call Group.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Call Group.
- *
- * @return array Call Group.
- */
- public function chanCallGroup()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_CALL_GROUP );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Pickup Group.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Pickup Group.
- *
- * @return array Pickup Group.
- */
- public function chanPickupGroup()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_PICKUP_GROUP );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
-
- /**
- * Possible state of an Asterisk channel as returned by `chanState()`
- * @var int Possible state of an Asterisk channel as returned by `chanState()`
- */
- const CHANNEL_STATE_DOWN = 0;
-
- /**
- * Possible state of an Asterisk channel as returned by `chanState()`
- * @var int Possible state of an Asterisk channel as returned by `chanState()`
- */
- const CHANNEL_STATE_RESERVED = 1;
-
- /**
- * Possible state of an Asterisk channel as returned by `chanState()`
- * @var int Possible state of an Asterisk channel as returned by `chanState()`
- */
- const CHANNEL_STATE_OFF_HOOK = 2;
-
- /**
- * Possible state of an Asterisk channel as returned by `chanState()`
- * @var int Possible state of an Asterisk channel as returned by `chanState()`
- */
- const CHANNEL_STATE_DIALING = 3;
-
- /**
- * Possible state of an Asterisk channel as returned by `chanState()`
- * @var int Possible state of an Asterisk channel as returned by `chanState()`
- */
- const CHANNEL_STATE_RING = 4;
-
- /**
- * Possible state of an Asterisk channel as returned by `chanState()`
- * @var int Possible state of an Asterisk channel as returned by `chanState()`
- */
- const CHANNEL_STATE_RINGING = 5;
-
- /**
- * Possible state of an Asterisk channel as returned by `chanState()`
- * @var int Possible state of an Asterisk channel as returned by `chanState()`
- */
- const CHANNEL_STATE_UP = 6;
-
- /**
- * Possible state of an Asterisk channel as returned by `chanState()`
- * @var int Possible state of an Asterisk channel as returned by `chanState()`
- */
- const CHANNEL_STATE_BUSY = 7;
-
- /**
- * Possible state of an Asterisk channel as returned by `chanState()`
- * @var int Possible state of an Asterisk channel as returned by `chanState()`
- */
- const CHANNEL_STATE_DIALING_OFF_HOOK = 8;
-
- /**
- * Possible state of an Asterisk channel as returned by `chanState()`
- * @var int Possible state of an Asterisk channel as returned by `chanState()`
- */
- const CHANNEL_STATE_PRE_RING = 9;
-
-
- public static $CHANNEL_STATES = [
- self::CHANNEL_STATE_DOWN => 'down',
- self::CHANNEL_STATE_RESERVED => 'reserved',
- self::CHANNEL_STATE_OFF_HOOK => 'offHook',
- self::CHANNEL_STATE_DIALING => 'dialing',
- self::CHANNEL_STATE_RING => 'ring',
- self::CHANNEL_STATE_RINGING => 'ringing',
- self::CHANNEL_STATE_UP => 'up',
- self::CHANNEL_STATE_BUSY => 'busy',
- self::CHANNEL_STATE_DIALING_OFF_HOOK => 'dialingOffHook',
- self::CHANNEL_STATE_PRE_RING => 'preRing'
- ];
-
- /**
- * Active Channel Information: Channel state (see channel state constants).
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Channel state (see channel state constants).
- *
- * @param bool $translate If true, use the `$CHANNEL_STATES` array to return textual representation
- * @return array Channel state (see channel state constants).
- */
- public function chanState( $translate = false )
- {
- try
- {
- $s = $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_STATE );
-
- if( !$translate )
- return $s;
-
- return $this->getSNMP()->translate( $s, self::$CHANNEL_STATES );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Transmission of voice data has been muted.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Transmission of voice data has been muted.
- *
- * @return array Transmission of voice data has been muted.
- */
- public function chanMuted()
- {
- try
- {
- return $this->getSNMP()->ppTruthValue( $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_MUTED ) );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Number of rings so far.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Number of rings so far.
- *
- * @return array Number of rings so far.
- */
- public function chanRings()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_RINGS );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Dialled Number ID.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Dialled Number ID.
- *
- * @return array Dialled Number ID.
- */
- public function chanCidDNID()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_CID_DNID );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Caller Number.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Caller Number.
- *
- * @return array Caller Number.
- */
- public function chanCidNum()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_CID_NUM );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Caller Name.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Caller Name.
- *
- * @return array Caller Name.
- */
- public function chanCidName()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_CID_NAME );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: ANI
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > ANI
- *
- * @return array ANI
- */
- public function chanCidANI()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_CID_ANI );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Redirected Dialled Number Service.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Redirected Dialled Number Service.
- *
- * @return array Redirected Dialled Number Service.
- */
- public function chanCidRDNIS()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_CID_RDNIS );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Number Presentation/Screening.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Number Presentation/Screening.
- *
- * @return array Number Presentation/Screening.
- */
- public function chanCidPresentation()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_CID_PRESENTATION );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: ANI 2 (info digit).
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > ANI 2 (info digit).
- *
- * @return array ANI 2 (info digit).
- */
- public function chanCidANI2()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_CID_ANI2 );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Type of Number.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Type of Number.
- *
- * @return array Type of Number.
- */
- public function chanCidTON()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_CID_TON );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Transit Network Select.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Transit Network Select.
- *
- * @return array Transit Network Select.
- */
- public function chanCidTNS()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_CID_TNS );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
-
- /**
- * Possible AMA flag of an Asterisk channel as returned by `chanAMAFlags()`
- * @var int Possible AMA flag of an Asterisk channel as returned by `chanAMAFlags()`
- */
- const CHANNEL_AMA_FLAG_DEFAULT = 0;
-
- /**
- * Possible AMA flag of an Asterisk channel as returned by `chanAMAFlags()`
- * @var int Possible AMA flag of an Asterisk channel as returned by `chanAMAFlags()`
- */
- const CHANNEL_AMA_FLAG_OMIT = 1;
-
- /**
- * Possible AMA flag of an Asterisk channel as returned by `chanAMAFlags()`
- * @var int Possible AMA flag of an Asterisk channel as returned by `chanAMAFlags()`
- */
- const CHANNEL_AMA_FLAG_BILLING = 2;
-
- /**
- * Possible AMA flag of an Asterisk channel as returned by `chanAMAFlags()`
- * @var int Possible AMA flag of an Asterisk channel as returned by `chanAMAFlags()`
- */
- const CHANNEL_AMA_FLAG_DOCUMENTATION = 3;
-
-
- public static $CHANNEL_AMA_FLAGS = [
- self::CHANNEL_AMA_FLAG_DEFAULT => 'default',
- self::CHANNEL_AMA_FLAG_OMIT => 'omit',
- self::CHANNEL_AMA_FLAG_BILLING => 'billing',
- self::CHANNEL_AMA_FLAG_DOCUMENTATION => 'documentation'
- ];
-
- /**
- * Active Channel Information: AMA Flags. (See constants)
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > AMA Flags. (See constants)
- *
- * @param bool $translate If true, use the `$CHANNEL_AMA_FLAGS` array to return textual representation
- * @return array AMA Flags. (See constants)
- */
- public function chanAMAFlags( $translate = false )
- {
- try
- {
- $s = $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_AMA_FLAGS );
-
- if( !$translate )
- return $s;
-
- return $this->getSNMP()->translate( $s, self::$CHANNEL_AMA_FLAGS );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
-
- /**
- * Possible ADSI of an Asterisk channel as returned by `chanADSI()`
- * @var int Possible ADSI of an Asterisk channel as returned by `chanADSI()`
- */
- const CHANNEL_ADSI_UNKNOWN = 0;
-
- /**
- * Possible ADSI of an Asterisk channel as returned by `chanADSI()`
- * @var int Possible ADSI of an Asterisk channel as returned by `chanADSI()`
- */
- const CHANNEL_ADSI_AVAILABLE = 1;
-
- /**
- * Possible ADSI of an Asterisk channel as returned by `chanADSI()`
- * @var int Possible ADSI of an Asterisk channel as returned by `chanADSI()`
- */
- const CHANNEL_ADSI_UNAVAILABLE = 2;
-
- /**
- * Possible ADSI of an Asterisk channel as returned by `chanADSI()`
- * @var int Possible ADSI of an Asterisk channel as returned by `chanADSI()`
- */
- const CHANNEL_ADSI_OFF_HOOK_ONLY = 3;
-
-
- public static $CHANNEL_ADSIs = [
- self::CHANNEL_ADSI_UNKNOWN => 'unknown',
- self::CHANNEL_ADSI_AVAILABLE => 'available',
- self::CHANNEL_ADSI_UNAVAILABLE => 'unavailable',
- self::CHANNEL_ADSI_OFF_HOOK_ONLY => 'offHookOnly'
- ];
-
-
-
- /**
- * Active Channel Information: Whether or not ADSI is detected on CPE. (see constants)
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Whether or not ADSI is detected on CPE. (see constants)
- *
- * @param bool $translate If true, use the `$CHANNEL_ADSIs` array to return textual representation
- * @return array Whether or not ADSI is detected on CPE. (see constants)
- */
- public function chanADSI( $translate = false )
- {
- try
- {
- $s = $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_ADSI );
-
- if( !$translate )
- return $s;
-
- return $this->getSNMP()->translate( $s, self::$CHANNEL_ADSIs );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Indication zone to use for channel.
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Indication zone to use for channel.
- *
- * @return array Indication zone to use for channel.
- */
- public function chanToneZone()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_TONE_ZONE );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
-
-
- /**
- * Possible hangup cause of an Asterisk channel as returned by `chanHangupCause()`
- * @var int Possible hangup cause of an Asterisk channel as returned by `chanHangupCause()`
- */
- const CHANNEL_HANGUP_CAUSE_NOT_DEFINED = 0;
-
- /**
- * Possible hangup cause of an Asterisk channel as returned by `chanHangupCause()`
- * @var int Possible hangup cause of an Asterisk channel as returned by `chanHangupCause()`
- */
- const CHANNEL_HANGUP_CAUSE_UNREGISTERED = 3;
-
- /**
- * Possible hangup cause of an Asterisk channel as returned by `chanHangupCause()`
- * @var int Possible hangup cause of an Asterisk channel as returned by `chanHangupCause()`
- */
- const CHANNEL_HANGUP_CAUSE_NORMAL = 16;
-
- /**
- * Possible hangup cause of an Asterisk channel as returned by `chanHangupCause()`
- * @var int Possible hangup cause of an Asterisk channel as returned by `chanHangupCause()`
- */
- const CHANNEL_HANGUP_CAUSE_BUSY = 17;
-
- /**
- * Possible hangup cause of an Asterisk channel as returned by `chanHangupCause()`
- * @var int Possible hangup cause of an Asterisk channel as returned by `chanHangupCause()`
- */
- const CHANNEL_HANGUP_CAUSE_NO_ANSWER = 19;
-
- /**
- * Possible hangup cause of an Asterisk channel as returned by `chanHangupCause()`
- * @var int Possible hangup cause of an Asterisk channel as returned by `chanHangupCause()`
- */
- const CHANNEL_HANGUP_CAUSE_CONGESTION = 34;
-
- /**
- * Possible hangup cause of an Asterisk channel as returned by `chanHangupCause()`
- * @var int Possible hangup cause of an Asterisk channel as returned by `chanHangupCause()`
- */
- const CHANNEL_HANGUP_CAUSE_FAILURE = 38;
-
- /**
- * Possible hangup cause of an Asterisk channel as returned by `chanHangupCause()`
- * @var int Possible hangup cause of an Asterisk channel as returned by `chanHangupCause()`
- */
- const CHANNEL_HANGUP_CAUSE_NO_SUCH_DRIVER = 66;
-
-
- public static $CHANNEL_HANGUP_CAUSES = [
- self::CHANNEL_HANGUP_CAUSE_NOT_DEFINED => 'notDefined',
- self::CHANNEL_HANGUP_CAUSE_UNREGISTERED => 'unregistered',
- self::CHANNEL_HANGUP_CAUSE_NORMAL => 'normal',
- self::CHANNEL_HANGUP_CAUSE_BUSY => 'busy',
- self::CHANNEL_HANGUP_CAUSE_NO_ANSWER => 'noAnswer',
- self::CHANNEL_HANGUP_CAUSE_CONGESTION => 'congestion',
- self::CHANNEL_HANGUP_CAUSE_FAILURE => 'failure',
- self::CHANNEL_HANGUP_CAUSE_NO_SUCH_DRIVER => 'noSuchDriver'
- ];
-
-
- /**
- * Active Channel Information: Why is the channel hung up. (see constants)
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Why is the channel hung up. (see constants)
- *
- * @param bool $translate If true, use the `$CHANNEL_HANGUP_CAUSES` array to return textual representation
- * @return array Why is the channel hung up. (see constants)
- */
- public function chanHangupCause( $translate = false )
- {
- try
- {
- $s = $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_HANGUP_CAUSE );
-
- if( !$translate )
- return $s;
-
- return $this->getSNMP()->translate( $s, self::$CHANNEL_HANGUP_CAUSES );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
- /**
- * Active Channel Information: Channel Variables defined for this channel.
- *
- * Returns an array of arrays where the inner array is key/value pairs
- * of channel variables for that channel: `[varName] => [varValue]`
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Channel Variables defined for this channel.
- *
- * @return array Channel Variables defined for this channel.
- */
- public function chanVariables()
- {
- try
- {
- $vars = $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_VARIABLES );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
-
- foreach( $vars as $idx => $var )
- $vars[ $idx ] = $this->_chanVarsToArray( $var );
-
- return $vars;
- }
-
- /**
- * Utility function for `chanVariables()` to break the string returned by
- * OID_ASTERISK_CHANNEL_VARIABLES into an array of key / value pairs
- *
- * @param string $str String containing channel variables (from `chanVariables()`
- * @return Array An array of `[varName] => [varValue]` pairs for the channel
- */
- protected function _chanVarsToArray( $str )
- {
- $arr = [];
- foreach( explode( "\n", $str ) as $s )
- {
- $arr[ substr( $s, 0, strpos( $s, '=' ) ) ] = substr( $s, strpos( $s, '=' ) + 1 );
- }
- return $arr;
- }
-
- /**
- * Active Channel Information: Flags set on this channel.
- *
- * Returns a HEX number - but I could not map it to the following from Asterisk docs:
- *
- * > BITS {
- * > wantsJitter(0),
- * > deferDTMF(1),
- * > writeInterrupt(2),
- * > blocking(3),
- * > zombie(4),
- * > exception(5),
- * > musicOnHold(6),
- * > spying(7),
- * > nativeBridge(8),
- * > autoIncrementingLoop(9)
- * > }
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Flags set on this channel. (see constants)
- *
- * @return array Flags set on this channel. (see constants)
- */
- public function chanFlags()
- {
- try
- {
- return $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_FLAGS );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
-
-
-
- /**
- * Possible channel transfer capabilities of an Asterisk channel as returned by `chanTransferCap()`
- * @var int Possible channel transfer capabilities of an Asterisk channel as returned by `chanTransferCap()`
- */
- const CHANNEL_TRANSFER_CAPABILITY_SPEECH = 0;
-
- /**
- * Possible channel transfer capabilities of an Asterisk channel as returned by `chanTransferCap()`
- * @var int Possible channel transfer capabilities of an Asterisk channel as returned by `chanTransferCap()`
- */
- const CHANNEL_TRANSFER_CAPABILITY_DIGITAL = 8;
-
- /**
- * Possible channel transfer capabilities of an Asterisk channel as returned by `chanTransferCap()`
- * @var int Possible channel transfer capabilities of an Asterisk channel as returned by `chanTransferCap()`
- */
- const CHANNEL_TRANSFER_CAPABILITY_RESTRICTED_DIGITAL = 9;
-
- /**
- * Possible channel transfer capabilities of an Asterisk channel as returned by `chanTransferCap()`
- * @var int Possible channel transfer capabilities of an Asterisk channel as returned by `chanTransferCap()`
- */
- const CHANNEL_TRANSFER_CAPABILITY_AUDIO_3K = 16;
-
- /**
- * Possible channel transfer capabilities of an Asterisk channel as returned by `chanTransferCap()`
- * @var int Possible channel transfer capabilities of an Asterisk channel as returned by `chanTransferCap()`
- */
- const CHANNEL_TRANSFER_CAPABILITY_DIGITAL_WITH_TONES = 17;
-
- /**
- * Possible channel transfer capabilities of an Asterisk channel as returned by `chanTransferCap()`
- * @var int Possible channel transfer capabilities of an Asterisk channel as returned by `chanTransferCap()`
- */
- const CHANNEL_TRANSFER_CAPABILITY_VIDEO = 24;
-
-
- public static $CHANNEL_TRANSFER_CAPABILITIES = [
- self::CHANNEL_TRANSFER_CAPABILITY_SPEECH => 'speech',
- self::CHANNEL_TRANSFER_CAPABILITY_DIGITAL => 'digital',
- self::CHANNEL_TRANSFER_CAPABILITY_RESTRICTED_DIGITAL => 'restrictedDigital',
- self::CHANNEL_TRANSFER_CAPABILITY_AUDIO_3K => 'audio3k',
- self::CHANNEL_TRANSFER_CAPABILITY_DIGITAL_WITH_TONES => 'digitalWithTones',
- self::CHANNEL_TRANSFER_CAPABILITY_VIDEO => 'video'
- ];
-
- /**
- * Active Channel Information: Transfer Capabilities for this channel. (see constants)
- *
- * NB: SNMP exceptions are caught and in such cases null is returned
- * as not all channels have all properties.
- *
- * > Transfer Capabilities for this channel. (see constants)
- *
- * @param bool $translate If true, use the `$CHANNEL_TRANSFER_CAPABILITIES` array to return textual representation
- * @return array Transfer Capabilities for this channel. (see constants)
- */
- public function chanTransferCap( $translate = false )
- {
- try
- {
- $s = $this->getSNMP()->walk1d( self::OID_ASTERISK_CHANNEL_TRANSFER_CAP );
-
- if( !$translate )
- return $s;
-
- return $this->getSNMP()->translate( $s, self::$CHANNEL_TRANSFER_CAPABILITIES );
- }
- catch( \OSS_SNMP\Exception $e )
- {
- return null;
- }
- }
- }
|