src/MIBS/Asterisk/Channels.php
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;
    }
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;
    }
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 ; }
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
Utility function to gather channel details together in an associative array .