当前位置: 首页>>代码示例>>Java>>正文


Java RequestEvent.getRequest方法代码示例

本文整理汇总了Java中javax.sip.RequestEvent.getRequest方法的典型用法代码示例。如果您正苦于以下问题:Java RequestEvent.getRequest方法的具体用法?Java RequestEvent.getRequest怎么用?Java RequestEvent.getRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.sip.RequestEvent的用法示例。


在下文中一共展示了RequestEvent.getRequest方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processBye

import javax.sip.RequestEvent; //导入方法依赖的package包/类
/**
 * Process the bye request.
 */
public void processBye(RequestEvent requestEvent,
        ServerTransaction serverTransactionId) {
    Request request = requestEvent.getRequest();
    try {
        logger.info("shootme:  got a bye sending OK.");
        logger.info("shootme:  dialog = " + requestEvent.getDialog());
        logger.info("shootme:  dialogState = " + requestEvent.getDialog().getState());
        Response response = messageFactory.createResponse(200, request);
        if ( serverTransactionId != null) {
            serverTransactionId.sendResponse(response);
        }
        logger.info("shootme:  dialogState = " + requestEvent.getDialog().getState());

        this.byeSeen = true;


    } catch (Exception ex) {
        ex.printStackTrace();
        System.exit(0);

    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:26,代码来源:Shootme.java

示例2: processBye

import javax.sip.RequestEvent; //导入方法依赖的package包/类
/**
 * Process the bye request.
 */
public void processBye(RequestEvent requestEvent,
        ServerTransaction serverTransactionId) {
    SipProvider sipProvider = (SipProvider) requestEvent.getSource();
    Request request = requestEvent.getRequest();
    Dialog dialog = requestEvent.getDialog();
    System.out.println("local party = " + dialog.getLocalParty());
    try {
        System.out.println("shootme:  got a bye sending OK.");
        Response response = messageFactory.createResponse(200, request);
        serverTransactionId.sendResponse(response);
        System.out.println("Shootme : Dialog State is "
                + serverTransactionId.getDialog().getState());

    } catch (Exception ex) {
        ex.printStackTrace();
        System.exit(0);

    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:23,代码来源:NoToTagOn1xxDialogLeakTest.java

示例3: processRequest

import javax.sip.RequestEvent; //导入方法依赖的package包/类
public void processRequest(RequestEvent requestEvent) {
    Request request = requestEvent.getRequest();
    ServerTransaction serverTransactionId = requestEvent.getServerTransaction();

    System.out.println("GOT REQUEST: " + request.getMethod());

    if (request.getMethod().equals(Request.INVITE) || request.getMethod().equals(Request.MESSAGE)) {
        processInvite(requestEvent, serverTransactionId);
    } else if (request.getMethod().equals(Request.ACK)) {
        processAck(requestEvent, serverTransactionId);
    } else if (request.getMethod().equals(Request.INFO)) {
        processInfo(requestEvent);
    } else if (request.getMethod().equals(Request.BYE)) {
        processBye(requestEvent, serverTransactionId);
    } 

}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:18,代码来源:Shootme.java

示例4: processRequest

import javax.sip.RequestEvent; //导入方法依赖的package包/类
public void processRequest(RequestEvent requestReceivedEvent) {
    Request request = requestReceivedEvent.getRequest();
    ServerTransaction serverTransactionId = requestReceivedEvent
            .getServerTransaction();

    logger.info("\n\nRequest " + request.getMethod() + " received at "
            + protocolObjects.sipStack.getStackName()
            + " with server transaction id " + serverTransactionId);

    // We are the UAC so the only request we get is the BYE.
    if (request.getMethod().equals(Request.INFO))
        processInfo(requestReceivedEvent);
    else
        TestHarness.fail("Unexpected request ! : " + request);

}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:17,代码来源:Shootist.java

示例5: processRequest

import javax.sip.RequestEvent; //导入方法依赖的package包/类
public void processRequest(RequestEvent requestEvent) {
    Request request = requestEvent.getRequest();
    ServerTransaction serverTransactionId = requestEvent.getServerTransaction();

    System.out.println("GOT REQUEST: " + request.getMethod());

    if (request.getMethod().equals(Request.INVITE)) {
        processInvite(requestEvent, serverTransactionId);
    } else if (request.getMethod().equals(Request.ACK)) {
        processAck(requestEvent, serverTransactionId);
    } else if (request.getMethod().equals(Request.INFO)) {
        processInfo(requestEvent);
    } else if (request.getMethod().equals(Request.BYE)) {
        processBye(requestEvent, serverTransactionId);
    } 

}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:18,代码来源:ShootmeNotImplementingListener.java

示例6: processBye

import javax.sip.RequestEvent; //导入方法依赖的package包/类
/**
 * Process the bye request.
 */
public void processBye(RequestEvent requestEvent,
        ServerTransaction serverTransactionId) {
    SipProvider sipProvider = (SipProvider) requestEvent.getSource();
    Request request = requestEvent.getRequest();
    Dialog dialog = requestEvent.getDialog();
    System.out.println("local party = " + dialog.getLocalParty());
    try {
        System.out.println("shootme:  got a bye sending OK.");
        Response response = messageFactory.createResponse(200, request);
        serverTransactionId.sendResponse(response);
        System.out.println("Dialog State is "
                + serverTransactionId.getDialog().getState());

    } catch (Exception ex) {
        ex.printStackTrace();
        System.exit(0);

    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:23,代码来源:Shootme.java

示例7: processCancel

import javax.sip.RequestEvent; //导入方法依赖的package包/类
public void processCancel(RequestEvent requestEvent,
        ServerTransaction serverTransactionId) {
    Request request = requestEvent.getRequest();
    SipProvider sipProvider = (SipProvider)requestEvent.getSource();
    try {
        logger.info("shootme:  got a cancel. " );
        // Because this is not an In-dialog request, you will get a null server Tx id here.
        if (serverTransactionId == null) {
            serverTransactionId = sipProvider.getNewServerTransaction(request);
        }
        Response response = messageFactory.createResponse(200, request);
        serverTransactionId.sendResponse(response);

        String serverTxId = ((ViaHeader)response.getHeader(ViaHeader.NAME)).getBranch();
        ServerTransaction serverTx = (ServerTransaction) this.serverTxTable.get(serverTxId);
        if ( serverTx != null && (serverTx.getState().equals(TransactionState.TRYING) ||
                serverTx.getState().equals(TransactionState.PROCEEDING))) {
            Request originalRequest = serverTx.getRequest();
            Response resp = messageFactory.createResponse(Response.REQUEST_TERMINATED,originalRequest);
            serverTx.sendResponse(resp);
        }

    } catch (Exception ex) {
        ex.printStackTrace();
        System.exit(0);

    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:29,代码来源:Shootme.java

示例8: processRequest

import javax.sip.RequestEvent; //导入方法依赖的package包/类
public void processRequest(RequestEvent requestEvent) {
    Request request = requestEvent.getRequest();
    ServerTransaction serverTransactionId = requestEvent
            .getServerTransaction();

    System.out.println("\n\nRequest " + request.getMethod()
            + " received at " + sipStack.getStackName()
            + " with server transaction id " + serverTransactionId);

    if (request.getMethod().equals(Request.INVITE)) {
        processInvite(requestEvent, serverTransactionId);
    }

}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:15,代码来源:DeliverRequestEventWithBadHeaderTest.java

示例9: sendInviteOK

import javax.sip.RequestEvent; //导入方法依赖的package包/类
private void sendInviteOK(RequestEvent requestEvent, ServerTransaction inviteTid, String toTag) {
    try {
        
        logger.info("sendInviteOK: " + inviteTid);
        if (inviteTid.getState() != TransactionState.COMPLETED) {
            logger.info("shootme: Dialog state before OK: "
                    + inviteTid.getDialog().getState());

            SipProvider sipProvider = (SipProvider) requestEvent.getSource();
            Request request = requestEvent.getRequest();
            Response okResponse = messageFactory.createResponse(Response.OK,
                    request);
                ListeningPoint lp = sipProvider.getListeningPoint(transport);
            int myPort = lp.getPort();


            ((ToHeader)okResponse.getHeader(ToHeader.NAME)).setTag(toTag);


            Address address = addressFactory.createAddress("Shootme <sip:"
                    + myAddress + ":" + myPort + ">");
            ContactHeader contactHeader = headerFactory
                    .createContactHeader(address);
            okResponse.addHeader(contactHeader);
            inviteTid.sendResponse(okResponse);
            logger.info("shootme: Dialog state after OK: "
                    + inviteTid.getDialog().getState());
            TestCase.assertEquals( DialogState.CONFIRMED , inviteTid.getDialog().getState() );
        } else {
            logger.info("semdInviteOK: inviteTid = " + inviteTid + " state = " + inviteTid.getState());
        }
    } catch (Exception ex) {
        ex.printStackTrace();
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:36,代码来源:Shootme.java

示例10: sendInviteOK

import javax.sip.RequestEvent; //导入方法依赖的package包/类
private void sendInviteOK(RequestEvent requestEvent, ServerTransaction inviteTid, String toTag) {
    try {
        logger.info("sendInviteOK: " + inviteTid);
        if (inviteTid.getState() != TransactionState.COMPLETED) {
            logger.info("shootme: Dialog state before OK: "
                    + inviteTid.getDialog().getState());

            SipProvider sipProvider = (SipProvider) requestEvent.getSource();
            Request request = requestEvent.getRequest();
            Response okResponse = messageFactory.createResponse(Response.OK,
                    request);
                ListeningPoint lp = sipProvider.getListeningPoint(transport);
            int myPort = lp.getPort();


            ((ToHeader)okResponse.getHeader(ToHeader.NAME)).setTag(toTag);


            Address address = addressFactory.createAddress("Shootme <sip:"
                    + myAddress + ":" + myPort + ";transport=" + transport+ ">");
            ContactHeader contactHeader = headerFactory
                    .createContactHeader(address);
            okResponse.addHeader(contactHeader);
            inviteTid.sendResponse(okResponse);
            logger.info("shootme: Dialog state after OK: "
                    + inviteTid.getDialog().getState());
            TestCase.assertEquals( DialogState.CONFIRMED , inviteTid.getDialog().getState() );
        } else {
            logger.info("semdInviteOK: inviteTid = " + inviteTid + " state = " + inviteTid.getState());
        }
    } catch (Exception ex) {
        ex.printStackTrace();
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:35,代码来源:Shootme.java

示例11: processRequest

import javax.sip.RequestEvent; //导入方法依赖的package包/类
public void processRequest(RequestEvent requestReceivedEvent) {
    Request request = requestReceivedEvent.getRequest();
    ServerTransaction serverTransactionId = requestReceivedEvent
            .getServerTransaction();

    System.out.println("GOT REQUEST (we shouldnt get that): "
            + request.getMethod());
    DialogTimeoutTest.fail("Shouldnt receive any request:\n"
            + request);

}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:12,代码来源:ShootistNotImplementingSipListenerExt.java

示例12: processRequest

import javax.sip.RequestEvent; //导入方法依赖的package包/类
public void processRequest(RequestEvent requestReceivedEvent) {
    Request request = requestReceivedEvent.getRequest();
    ServerTransaction serverTransactionId = requestReceivedEvent
            .getServerTransaction();

    logger.info("\n\nRequest " + request.getMethod()
            + " received at " + sipStack.getStackName()
            + " with server transaction id " + serverTransactionId);

    // We are the UAC so the only request we get is the BYE.
    if (request.getMethod().equals(Request.BYE))
        processBye(request, serverTransactionId);

}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:15,代码来源:Shootist.java

示例13: processRequest

import javax.sip.RequestEvent; //导入方法依赖的package包/类
public void processRequest(RequestEvent requestReceivedEvent) {
    Request request = requestReceivedEvent.getRequest();
    ServerTransaction serverTransactionId = requestReceivedEvent
            .getServerTransaction();

    // We are the UAC so the only request we get is the BYE.
    if (request.getMethod().equals(Request.BYE))
        processBye(request, serverTransactionId);

}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:11,代码来源:Shootist.java

示例14: processInvite

import javax.sip.RequestEvent; //导入方法依赖的package包/类
/**
 * Process the invite request.
 */
public void processInvite(RequestEvent requestEvent,
        ServerTransaction serverTransaction) {
    SipProvider sipProvider = (SipProvider) requestEvent.getSource();
    Request request = requestEvent.getRequest();
    this.inviteRequest = request;
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:10,代码来源:ClientTransactionCallingAlertTest.java

示例15: processRequest

import javax.sip.RequestEvent; //导入方法依赖的package包/类
public void processRequest(RequestEvent requestReceivedEvent) {
    Request request = requestReceivedEvent.getRequest();
    ServerTransaction serverTransactionId = requestReceivedEvent
            .getServerTransaction();

    System.out.println("\n\nRequest " + request.getMethod()
            + " received at " + sipStack.getStackName()
            + " with server transaction id " + serverTransactionId);

    // We are the UAC so the only request we get is the BYE.
    if (request.getMethod().equals(Request.NOTIFY))
        processNotify(request, serverTransactionId);

}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:15,代码来源:Subscriber.java


注:本文中的javax.sip.RequestEvent.getRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。