Package org.asteriskjava.manager.action

Examples of org.asteriskjava.manager.action.ChallengeAction


    public void sendAction(ManagerAction action, String internalActionId) throws IOException
    {
        if (action instanceof ChallengeAction)
        {
            ChallengeAction challengeAction = (ChallengeAction) action;
            String authType = challengeAction.getAuthType();

            if (!authType.equals("MD5"))
            {
                throw new RuntimeException("Expected authType 'MD5' got '" + authType + "'");
            }
View Full Code Here


     *                                       protocol identifier. The connection is closed in this case.
     */
    protected synchronized void doLogin(long timeout, String eventMask) throws IOException, AuthenticationFailedException,
            TimeoutException
    {
        ChallengeAction challengeAction;
        ManagerResponse challengeResponse;
        String challenge;
        String key;
        LoginAction loginAction;
        ManagerResponse loginResponse;

        if (socket == null)
        {
            connect();
        }

        synchronized (protocolIdentifier)
        {
            if (protocolIdentifier.value == null)
            {
                try
                {
                    protocolIdentifier.wait(timeout);
                }
                catch (InterruptedException e) // NOPMD
                {
                    Thread.currentThread().interrupt();
                }
            }

            if (protocolIdentifier.value == null)
            {
                disconnect();
                if (reader != null && reader.getTerminationException() != null)
                {
                    throw reader.getTerminationException();
                }
                else
                {
                    throw new TimeoutException("Timeout waiting for protocol identifier");
                }
            }
        }

        challengeAction = new ChallengeAction("MD5");
        try
        {
            challengeResponse = sendAction(challengeAction);
        }
        catch (Exception e)
View Full Code Here

     *                                       protocol identifier. The connection is closed in this case.
     */
    protected synchronized void doLogin(long timeout, String eventMask) throws IOException, AuthenticationFailedException,
            TimeoutException
    {
        ChallengeAction challengeAction;
        ManagerResponse challengeResponse;
        String challenge;
        String key;
        LoginAction loginAction;
        ManagerResponse loginResponse;

        if (socket == null)
        {
            connect();
        }

        synchronized (protocolIdentifier)
        {
            if (protocolIdentifier.value == null)
            {
                try
                {
                    protocolIdentifier.wait(timeout);
                }
                catch (InterruptedException e) // NOPMD
                {
                    Thread.currentThread().interrupt();
                }
            }

            if (protocolIdentifier.value == null)
            {
                disconnect();
                if (reader != null && reader.getTerminationException() != null)
                {
                    throw reader.getTerminationException();
                }
                else
                {
                    throw new TimeoutException("Timeout waiting for protocol identifier");
                }
            }
        }

        challengeAction = new ChallengeAction("MD5");
        try
        {
            challengeResponse = sendAction(challengeAction);
        }
        catch (Exception e)
View Full Code Here

TOP

Related Classes of org.asteriskjava.manager.action.ChallengeAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.