public String getVariable(final Channel channel, final String variableName)
    {
        String value = "";
        final GetVarAction var = new GetVarAction(channel, variableName);

        try
        {
            PBX pbx = PBXFactory.getActivePBX();
            if (!pbx.waitForChannelToQuiescent(channel, 3000))
                throw new PBXException("Channel: " + channel + " cannot be retrieved as it is still in transition.");

            ManagerResponse convertedResponse = sendAction(var, 500);
            if (convertedResponse != null)
            {
                value = convertedResponse.getAttribute("value"); //$NON-NLS-1$
                if (value == null)
                    value = "";
                CoherentManagerConnection.logger.debug("getVarAction returned name:" + variableName + " value:" + value); //$NON-NLS-1$ //$NON-NLS-2$
            }
        }
        catch (final Exception e)
        {
            CoherentManagerConnection.logger.debug(e, e);
            CoherentManagerConnection.logger.error("getVariable: " + e); //$NON-NLS-1$
        }
        return value;
    }
public String getVariable ( final Channel channel , final String variableName ) { String value = "" ; final GetVarAction var = new GetVarAction ( channel , variableName ) ; try { PBX pbx = PBXFactory . getActivePBX ( ) ; if ( ! pbx . waitForChannelToQuiescent ( channel , 3000 ) ) throw new PBXException ( "Channel: " + channel + " cannot be retrieved as it is still in transition." ) ; ManagerResponse convertedResponse = sendAction ( var , 500 ) ; if ( convertedResponse != null ) { value = convertedResponse . getAttribute ( "value" ) ; if ( value == null ) value = "" ; CoherentManagerConnection . logger . debug ( "getVarAction returned name:" + variableName + " value:" + value ) ; } } catch ( final Exception e ) { CoherentManagerConnection . logger . debug ( e , e ) ; CoherentManagerConnection . logger . error ( "getVariable: " + e ) ; } return value ; }
Retrieves and returns the value of a variable associated with a channel.
If the variable is empty or null then an empty string is returned.

@param channel
@param variableName
@return