• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Dialog类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: processBye

import javax.sip.Dialog; //导入依赖的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();
    logger.info("shootme: local party = " + dialog.getLocalParty());
    try {
        logger.info("shootme:  got a bye sending OK.");
        Response response = messageFactory.createResponse(200, request);
        serverTransactionId.sendResponse(response);
        logger.info("shootme: Dialog State is "
                + serverTransactionId.getDialog().getState());

    } catch (Exception ex) {
        logger.error("UNexpected exception",ex);
        fail("UNexpected exception");

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


示例2: processBye

import javax.sip.Dialog; //导入依赖的package包/类
public void processBye(Request request,
        ServerTransaction serverTransactionId) {
    try {
        logger.info("shootist:  got a bye .");
        if (serverTransactionId == null) {
            logger.info("shootist:  null TID.");
            return;
        }
        Dialog dialog = serverTransactionId.getDialog();
        logger.info("Dialog State = " + dialog.getState());
        Response response = protocolObjects.messageFactory.createResponse(
                200, request);
        serverTransactionId.sendResponse(response);
        logger.info("shootist:  Sending OK.");
        logger.info("Dialog State = " + dialog.getState());

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

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


示例3: processInvite

import javax.sip.Dialog; //导入依赖的package包/类
public void processInvite(Request request, ServerTransaction st) {
    try {
        Dialog dialog = st.getDialog();
        Response response = protocolObjects.messageFactory.createResponse(
                Response.OK, request);
        ((ToHeader) response.getHeader(ToHeader.NAME))
                .setTag(((ToHeader) request.getHeader(ToHeader.NAME))
                        .getTag());

        Address address = protocolObjects.addressFactory
                .createAddress("Shootme <sip:" + myAddress + ":" + myPort
                        + ">");
        ContactHeader contactHeader = protocolObjects.headerFactory
                .createContactHeader(address);
        response.addHeader(contactHeader);
        st.sendResponse(response);
    } catch (Exception ex) {
        logger.error("unexpected exception",ex);
        SctpTest.fail("unexpected exception");
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:22,代码来源:Shootist.java


示例4: processBye

import javax.sip.Dialog; //导入依赖的package包/类
public void processBye(Request request,
        ServerTransaction serverTransactionId) {
    try {
        System.out.println("shootist:  got a bye .");
        if (serverTransactionId == null) {
            System.out.println("shootist:  null TID.");
            return;
        }
        Dialog dialog = serverTransactionId.getDialog();
        System.out.println("Dialog State = " + dialog.getState());
        Response response = messageFactory.createResponse(200, request);
        serverTransactionId.sendResponse(response);
        System.out.println("shootist:  Sending OK.");
        System.out.println("Dialog State = " + dialog.getState());

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

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


示例5: processBye

import javax.sip.Dialog; //导入依赖的package包/类
public void processBye(Request request,
        ServerTransaction serverTransactionId) {
    try {
        logger.info("shootist:  got a bye .");
        if (serverTransactionId == null) {
            logger.info("shootist:  null TID.");
            return;
        }
        Dialog dialog = serverTransactionId.getDialog();
        logger.info("Dialog State = " + dialog.getState());
        Response response = messageFactory.createResponse(200, request);
        serverTransactionId.sendResponse(response);
        logger.info("shootist:  Sending OK.");
        logger.info("Dialog State = " + dialog.getState());

    } catch (Exception ex) {
        TestHarness.fail(ex.getMessage());
        System.exit(0);

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


示例6: processBye

import javax.sip.Dialog; //导入依赖的package包/类
/**
 * Process the bye request.
 */
public void processBye(RequestEvent requestEvent,
        ServerTransaction serverTransactionId) {
    final Request request = requestEvent.getRequest();
    final Dialog dialog = requestEvent.getDialog();
    try {
        final Response response = messageFactory.createResponse(200, request);
        if(serverTransactionId == null) {
        	serverTransactionId = ((SipProvider)requestEvent.getSource()).getNewServerTransaction(request);
        }
        serverTransactionId.sendResponse(response);
    } catch (Exception ex) {
        ex.printStackTrace();
        //System.exit(0);

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


示例7: processAck

import javax.sip.Dialog; //导入依赖的package包/类
/**
 * Process the ACK request. Send the bye and complete the call flow.
 */
public void processAck(RequestEvent requestEvent, ServerTransaction serverTransaction) {
    SipProvider sipProvider = (SipProvider) requestEvent.getSource();
    try {
        // System.out.println("*** shootme: got an ACK "
        // + requestEvent.getRequest());
        if (serverTransaction == null) {
            System.out.println("null server transaction -- ignoring the ACK!");
            return;
        }
        Dialog dialog = serverTransaction.getDialog();

        System.out.println("Dialog Created = " + dialog.getDialogId() + " Dialog State = " + dialog.getState());

        System.out.println("Waiting for INFO");

    } catch (Exception ex) {
        ex.printStackTrace();
        TxTimeoutTest.fail("Shootme: Failed on process ACK", ex);
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:24,代码来源:Shootme.java


示例8: processBye

import javax.sip.Dialog; //导入依赖的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


示例9: processResponse

import javax.sip.Dialog; //导入依赖的package包/类
public void processResponse(ResponseEvent responseReceivedEvent) {
    // System.out.println("Got a response");
    Response response = (Response) responseReceivedEvent.getResponse();
    Transaction tid = responseReceivedEvent.getClientTransaction();

    // System.out.println("Response received with client transaction id "
    // + tid + ":\n" + response);

    System.out.println("GOT RESPONSE: " + response.getStatusCode());
    try {
        if (response.getStatusCode() == Response.OK && ((CSeqHeader) response.getHeader(CSeqHeader.NAME)).getMethod().equals(Request.INVITE)) {

            Dialog dialog = tid.getDialog();
            
            Request request = tid.getRequest();
            dialog.sendAck(request);
        }

    } catch (Exception ex) {
        ex.printStackTrace();
        TxTimeoutTest.fail("Shootme: Failed on process response: " + response.getStatusCode(), ex);
    }

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


示例10: processDialogTimeout

import javax.sip.Dialog; //导入依赖的package包/类
public void processDialogTimeout(DialogTimeoutEvent timeoutEvent) {
       System.out.println("processDialogTerminated " + timeoutEvent.getDialog());
       
       DialogTimeoutEvent dialogAckTimeoutEvent = (DialogTimeoutEvent)timeoutEvent;
       Dialog timeoutDialog = dialogAckTimeoutEvent.getDialog();
       if(timeoutDialog == null){
           TxTimeoutTest.fail(
                   "Shootist: Exception on timeout, dialog shouldn't be null");
           stateIsOk = false;
           return;
       }        
       if(dialogAckTimeoutEvent.getReason() == Reason.AckNotReceived) {
           stateIsOk = true;
       }
       if(dialogAckTimeoutEvent.getReason() == Reason.EarlyStateTimeout && !sendOK) {
           stateIsOk = true;
       }
       TimerTask timerTask = new CheckAppData(timeoutDialog);
       new Timer().schedule(timerTask, 9000);
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:21,代码来源:Shootme.java


示例11: processBye

import javax.sip.Dialog; //导入依赖的package包/类
public void processBye(Request request,
        ServerTransaction serverTransactionId) {
    try {
        logger.info("shootist:  got a bye .");
        if (serverTransactionId == null) {
            logger.info("shootist:  null TID.");
            return;
        }
        Dialog dialog = serverTransactionId.getDialog();
        TlsTest.assertSame("dialog mismatch", dialog,this.dialog);
        logger.info("Dialog State = " + dialog.getState());
        Response response = protocolObjects.messageFactory.createResponse(
                200, request);
        serverTransactionId.sendResponse(response);
        logger.info("shootist:  Sending OK.");
        logger.info("Dialog State = " + dialog.getState());
        TlsTest.assertEquals("Should be terminated", dialog.getState() , DialogState.TERMINATED);

    } catch (Exception ex) {
        logger.error("unexpected exception",ex);
        TlsTest.fail("unexpected exception");

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


示例12: processBye

import javax.sip.Dialog; //导入依赖的package包/类
public void processBye(Request request,
        ServerTransaction serverTransactionId) {
    try {
        System.out.println("shootist:  got a bye .");
        if (serverTransactionId == null) {
            System.out.println("shootist:  null TID.");
            return;
        }
        Dialog dialog = serverTransactionId.getDialog();
        System.out.println("Shootist : Dialog State = " + dialog.getState());
        Response response = messageFactory.createResponse(200, request);
        serverTransactionId.sendResponse(response);
        System.out.println("shootist:  Sending OK.");
        System.out.println("Shootist : Dialog State = " + dialog.getState());

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

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


示例13: processAck

import javax.sip.Dialog; //导入依赖的package包/类
/**
 * Process the ACK request. Send the bye and complete the call flow.
 */
public void processAck(RequestEvent requestEvent, ServerTransaction serverTransaction) {
    SipProvider sipProvider = (SipProvider) requestEvent.getSource();
    try {
        // System.out.println("*** shootme: got an ACK "
        // + requestEvent.getRequest());
        if (serverTransaction == null) {
            System.out.println("null server transaction -- ignoring the ACK!");
            return;
        }
        Dialog dialog = serverTransaction.getDialog();

        System.out.println("Dialog Created = " + dialog.getDialogId() + " Dialog State = " + dialog.getState());

        System.out.println("Waiting for INFO");

    } catch (Exception ex) {
        ex.printStackTrace();
        DialogTimeoutTest.fail("Shootme: Failed on process ACK", ex);
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:24,代码来源:Shootme.java


示例14: processResponse

import javax.sip.Dialog; //导入依赖的package包/类
public void processResponse(ResponseEvent responseReceivedEvent) {
    // System.out.println("Got a response");
    Response response = (Response) responseReceivedEvent.getResponse();
    Transaction tid = responseReceivedEvent.getClientTransaction();

    // System.out.println("Response received with client transaction id "
    // + tid + ":\n" + response);

    System.out.println("GOT RESPONSE: " + response.getStatusCode());
    try {
        if (response.getStatusCode() == Response.OK && ((CSeqHeader) response.getHeader(CSeqHeader.NAME)).getMethod().equals(Request.INVITE)) {

            Dialog dialog = tid.getDialog();
            
            Request request = tid.getRequest();
            dialog.sendAck(request);
        }

    } catch (Exception ex) {
        ex.printStackTrace();
        DialogTimeoutTest.fail("Shootme: Failed on process response: " + response.getStatusCode(), ex);
    }

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


示例15: processDialogTimeout

import javax.sip.Dialog; //导入依赖的package包/类
public void processDialogTimeout(DialogTimeoutEvent timeoutEvent) {
       System.out.println("processDialogTerminated " + timeoutEvent.getDialog());
       
       DialogTimeoutEvent dialogAckTimeoutEvent = (DialogTimeoutEvent)timeoutEvent;
       Dialog timeoutDialog = dialogAckTimeoutEvent.getDialog();
       if(timeoutDialog == null){
           DialogTimeoutTest.fail(
                   "Shootist: Exception on timeout, dialog shouldn't be null");
           stateIsOk = false;
           return;
       }        
       if(dialogAckTimeoutEvent.getReason() == Reason.AckNotReceived) {
           stateIsOk = true;
       }
       TimerTask timerTask = new CheckAppData(timeoutDialog);
       new Timer().schedule(timerTask, 9000);
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:18,代码来源:Shootme.java


示例16: processInvite

import javax.sip.Dialog; //导入依赖的package包/类
public void processInvite(Request request, ServerTransaction st) {
    try {
        Dialog dialog = st.getDialog();
        Response response = protocolObjects.messageFactory.createResponse(
                Response.OK, request);
        ((ToHeader) response.getHeader(ToHeader.NAME))
                .setTag(((ToHeader) request.getHeader(ToHeader.NAME))
                        .getTag());

        Address address = protocolObjects.addressFactory
                .createAddress("Shootme <sips:" + myAddress + ":" + myPort
                        + ">");
        ContactHeader contactHeader = protocolObjects.headerFactory
                .createContactHeader(address);
        response.addHeader(contactHeader);
        st.sendResponse(response);
    } catch (Exception ex) {
        logger.error("unexpected exception",ex);
        TlsTest.fail("unexpected exception");
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:22,代码来源:Shootist.java


示例17: processResponse

import javax.sip.Dialog; //导入依赖的package包/类
public void processResponse(ResponseEvent responseReceivedEvent) {
    // System.out.println("Got a response");
    Response response = (Response) responseReceivedEvent.getResponse();
    Transaction tid = responseReceivedEvent.getClientTransaction();

    // System.out.println("Response received with client transaction id "
    // + tid + ":\n" + response);

    System.out.println("GOT RESPONSE: " + response.getStatusCode());
    try {
        if (response.getStatusCode() == Response.OK && ((CSeqHeader) response.getHeader(CSeqHeader.NAME)).getMethod().equals(Request.INVITE)) {

            Dialog dialog = tid.getDialog();
            Request request = tid.getRequest();
            dialog.sendAck(request);
        }

    } catch (Exception ex) {
        ex.printStackTrace();
        DialogTimeoutTest.fail("Shootme: Failed on process response: " + response.getStatusCode(), ex);
    }

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


示例18: processBye

import javax.sip.Dialog; //导入依赖的package包/类
public void processBye(Request request,
        ServerTransaction serverTransactionId) {
    try {
        logger.info("shootist:  got a bye .");
        if (serverTransactionId == null) {
            logger.info("shootist:  null TID.");
            return;
        }
        Dialog dialog = serverTransactionId.getDialog();
        logger.info("Dialog State = " + dialog.getState());
        Response response = messageFactory.createResponse(
                200, request);
        serverTransactionId.sendResponse(response);
        logger.info("shootist:  Sending OK.");
        logger.info("Dialog State = " + dialog.getState());

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

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


示例19: processResponse

import javax.sip.Dialog; //导入依赖的package包/类
public void processResponse(ResponseEvent responseEvent) {
    try {
        Response response = responseEvent.getResponse();
        Dialog dialog = responseEvent.getDialog();
        this.lastResponseTable.put(dialog, response);
         ServerTransaction serverTransaction = (ServerTransaction)responseEvent.getClientTransaction().getApplicationData();
        Request stRequest = serverTransaction.getRequest();
        Response newResponse = this.messageFactory.createResponse(response.getStatusCode(),stRequest);
        SipProvider provider = (SipProvider)responseEvent.getSource();
        SipProvider peerProvider = this.getPeerProvider(provider);
        ListeningPoint peerListeningPoint = peerProvider.getListeningPoint("udp");
        ContactHeader peerContactHeader = ((ListeningPointExt)peerListeningPoint).createContactHeader();
        newResponse.setHeader(peerContactHeader);
        serverTransaction.sendResponse(newResponse);
    } catch (Exception ex) {
        ex.printStackTrace();
        BackToBackUserAgentTest.fail("Unexpected exception");
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:20,代码来源:BackToBackUserAgent.java


示例20: processBye

import javax.sip.Dialog; //导入依赖的package包/类
public void processBye(Request request,
        ServerTransaction serverTransactionId) {
    try {
        logger.info("shootist:  got a bye .");
        if (serverTransactionId == null) {
            logger.info("shootist:  null TID.");
            return;
        }
        Dialog dialog = serverTransactionId.getDialog();
        SctpTest.assertSame("dialog mismatch", dialog,this.dialog);
        logger.info("Dialog State = " + dialog.getState());
        Response response = protocolObjects.messageFactory.createResponse(
                200, request);
        serverTransactionId.sendResponse(response);
        logger.info("shootist:  Sending OK.");
        logger.info("Dialog State = " + dialog.getState());
        SctpTest.assertEquals("Should be terminated", dialog.getState() , DialogState.TERMINATED);

    } catch (Exception ex) {
        logger.error("unexpected exception",ex);
        SctpTest.fail("unexpected exception");

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SwipeMenu类代码示例发布时间:2022-05-22
下一篇:
Java Step类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap