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

Java SipProvider类代码示例

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

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



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

示例1: processAck

import javax.sip.SipProvider; //导入依赖的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());
        int ackCount =
            ((ApplicationData ) dialog.getApplicationData()).ackCount;
        if (ackCount == 1) {
           dialog = inviteTid.getDialog();
           Request byeRequest = dialog.createRequest(Request.BYE);
           ClientTransaction tr =
            sipProvider.getNewClientTransaction(byeRequest);
           System.out.println("shootme: got an ACK -- sending bye! ");
           dialog.sendRequest(tr);
           System.out.println("Dialog State = " + dialog.getState());
        } else ((ApplicationData) dialog.getApplicationData()).ackCount ++;
    } catch (Exception ex) {
        ex.printStackTrace();
        System.exit(0);
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:26,代码来源:Shootme.java


示例2: AbstractCancelTest

import javax.sip.SipProvider; //导入依赖的package包/类
public AbstractCancelTest() {

        try {
            ProtocolObjects.logFileDirectory = "logs/";
            ProtocolObjects.init("canceltest");
            providerTable = new Hashtable();
            shootist = new Shootist();
            SipProvider shootistProvider = shootist.createSipProvider();
            providerTable.put(shootistProvider, shootist);
            Shootme shootme = new Shootme();
            SipProvider shootmeProvider = shootme.createProvider();
            providerTable.put(shootmeProvider, shootme);
            shootistProvider.addSipListener(this);
            shootmeProvider.addSipListener(this);
            ProtocolObjects.start();
        } catch (Exception ex) {
            fail("unexpected exception ");
        }
    }
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:20,代码来源:AbstractCancelTest.java


示例3: processBye

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


示例4: processBye

import javax.sip.SipProvider; //导入依赖的package包/类
/**
 * Process the bye request.
 */
public void processBye(RequestEvent requestEvent,
        ServerTransaction serverTransactionId) {
    final Request request = requestEvent.getRequest();
    
    try {
    	if (serverTransactionId == null) {
    		try {
    			serverTransactionId = ((SipProvider)requestEvent.getSource()).getNewServerTransaction(request);
} catch ( TransactionUnavailableException tae) {
	tae.printStackTrace();				
             return;
} catch ( TransactionAlreadyExistsException taex ) {
	// This is a retransmission so just return.
	return;				
}              	
        }
        final Response response = messageFactory.createResponse(200, request);            
        serverTransactionId.sendResponse(response);

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

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


示例5: setUp

import javax.sip.SipProvider; //导入依赖的package包/类
public void setUp() {

        try {

            super.setUp();
            // String stackname, String pathname, String transport,
            // boolean autoDialog
            this.shootistProtocolObjs = new ProtocolObjects("shootist", "gov.nist", "udp", true,true);
            shootist = new Shootist(shootistProtocolObjs);
            SipProvider shootistProvider = shootist.createSipProvider();

            this.shootmeProtocolObjs = new ProtocolObjects("shootme", "gov.nist", "udp", true,true);
            shootme = new Shootme(shootmeProtocolObjs);
            SipProvider shootmeProvider = shootme.createSipProvider();
            
            shootistProvider.addSipListener(shootist);
            shootmeProvider.addSipListener(shootme);

            shootistProtocolObjs.start();
            shootmeProtocolObjs.start();
            
        } catch (Exception ex) {
            ex.printStackTrace();
            fail("unexpected exception ");
        }
    }
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:27,代码来源:ReInviteBusyTest.java


示例6: processAck

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


示例7: processInvite

import javax.sip.SipProvider; //导入依赖的package包/类
/**
 * Process the invite request.
 */
public void processInvite(RequestEvent requestEvent, ServerTransaction serverTransaction) {
    try {
        // System.out.println("ProcessInvite");
        Request request = requestEvent.getRequest();
        SipProvider sipProvider = (SipProvider) requestEvent.getSource();
        // Note you need to create the Server Transaction
        // before the listener returns but you can delay sending the
        // response

        ServerTransaction st = sipProvider.getNewServerTransaction(request);

        TTask ttask = new TTask(requestEvent, st);
        int ttime = 100;

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


示例8: processBye

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

import javax.sip.SipProvider; //导入依赖的package包/类
public SipProvider createSipProvider() {
    try {
        listeningPoint = protocolObjects.sipStack.createListeningPoint(host, port,
                protocolObjects.transport);

        logger.info("listening point = " + host + " port = " + port);
        logger.info("listening point = " + listeningPoint);
        sipProvider = protocolObjects.sipStack.createSipProvider(listeningPoint);
        return sipProvider;
    } catch (Exception ex) {
        logger.error(unexpectedException, ex);
        TestHarness.fail(unexpectedException);
        return null;
    }

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


示例10: createProvider

import javax.sip.SipProvider; //导入依赖的package包/类
public SipProvider createProvider() {
    try {

        ListeningPoint lp = sipStack.createListeningPoint(myAddress,
                myPort, transport);

        sipProvider = sipStack.createSipProvider(lp);
        logger.info("udp provider " + sipProvider);
        return sipProvider;
    } catch (Exception ex) {
        logger.error(ex);
        fail(unexpectedException);
        return null;

    }

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


示例11: processAck

import javax.sip.SipProvider; //导入依赖的package包/类
/**
 * Process the ACK request. Send the bye and complete the call flow.
 */
public void processAck(RequestEvent requestEvent,
        ServerTransaction serverTransaction) {
    try {
        logger.info("shootme: got an ACK! ");
        logger.info("Dialog State = " + dialog.getState());
        SipProvider provider = (SipProvider) requestEvent.getSource();
        if (!callerSendsBye) {
            Request byeRequest = dialog.createRequest(Request.BYE);
            ClientTransaction ct = provider
                    .getNewClientTransaction(byeRequest);
            dialog.sendRequest(ct);
        }
    } catch (Exception ex) {
        logger.error("Unexpected exception", ex);
        fail("unexpected exception");
    }

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


示例12: setUp

import javax.sip.SipProvider; //导入依赖的package包/类
public void setUp() throws Exception {
    try {
        super.setUp();

        logger.info("PrackTest: setup()");
        shootist = new Shootist(getTiProtocolObjects());
        SipProvider shootistProvider = shootist.createProvider();
        providerTable.put(shootistProvider, shootist);

        shootme = new Shootme(getRiProtocolObjects());
        SipProvider shootmeProvider = shootme.createProvider();
        providerTable.put(shootmeProvider, shootme);

        shootistProvider.addSipListener(this);
        shootmeProvider.addSipListener(this);

        if (getTiProtocolObjects() != getRiProtocolObjects())
            getTiProtocolObjects().start();
        getRiProtocolObjects().start();
    } catch (Exception ex) {
        logger.error("unexpected excecption ", ex);
        fail("unexpected exception");
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:25,代码来源:AbstractPrackTestCase.java


示例13: processAck

import javax.sip.SipProvider; //导入依赖的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,代码来源:ShootmeNotImplementingListener.java


示例14: createSipProvider

import javax.sip.SipProvider; //导入依赖的package包/类
public SipProvider createSipProvider() {
    try {
        ListeningPoint listeningPoint = protocolObjects.sipStack
                .createListeningPoint(host, port, protocolObjects.transport);

        sipProvider = protocolObjects.sipStack
                .createSipProvider(listeningPoint);
        sipProvider.setAutomaticDialogSupportEnabled(false);
        return sipProvider;
    } catch (Exception ex) {
        logger.error(unexpectedException, ex);
        fail(unexpectedException);
        return null;
    }

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


示例15: createProvider

import javax.sip.SipProvider; //导入依赖的package包/类
public SipProvider createProvider() {
    try {

        ListeningPoint lp = sipStack.createListeningPoint(myAddress,
                myPort, transport);

        sipProvider = sipStack.createSipProvider(lp);
        logger.info("provider " + sipProvider);
        logger.info("sipStack = " + sipStack);
        return sipProvider;
    } catch (Exception ex) {
        logger.error(ex);
        TestCase.fail(unexpectedException);
        return null;

    }

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


示例16: processAck

import javax.sip.SipProvider; //导入依赖的package包/类
public void processAck(RequestEvent requestEvent, ServerTransaction serverTransaction) {
    SipProvider sipProvider = (SipProvider) requestEvent.getSource();
    try {
        logger.info("shootme: got an ACK " + requestEvent.getRequest());

        CSeqHeader cseq = (CSeqHeader) requestEvent.getRequest().getHeader(CSeqHeader.NAME);
        if(cseq.getSeqNumber() == 2) this.ack2Received = true;
       /* int ackCount = ((ApplicationData) dialog.getApplicationData()).ackCount;*/

        dialog = inviteTid.getDialog();
        Thread.sleep(1000);
        logger.info("shootme is sending RE INVITE now");
        System.out.println("Got an ACK " );
        this.reInviteCount++;
        this.sendReInvite(sipProvider);

    } catch (Exception ex) {
        String s = "Unexpected error";
        logger.error(s, ex);
        ReInviteInfoAckOverlapTest.fail(s);
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:23,代码来源:ReInviteInfoAckOverlapTest.java


示例17: processInfo

import javax.sip.SipProvider; //导入依赖的package包/类
public void processInfo(RequestEvent requestEvent, ServerTransaction serverTransactionId) {

            SipProvider sipProvider = (SipProvider) requestEvent.getSource();
            Request request = requestEvent.getRequest();
            try {
                logger.info("shootme:  got a INFO sending OK.");
                Response response = protocolObjects.messageFactory.createResponse(200, request);
                if (serverTransactionId != null) {
                    serverTransactionId.sendResponse(response);
                    logger.info("Dialog State is " + serverTransactionId.getDialog().getState());
                } else {
                    logger.info("null server tx.");
                    // sipProvider.sendResponse(response);
                }

            } catch (Exception ex) {
                String s = "Unexpected exception";
                logger.error(s, ex);
                ReInviteInfoAckOverlapTest.fail(s);

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


示例18: createProvider

import javax.sip.SipProvider; //导入依赖的package包/类
public SipProvider createProvider() {
    try {

        ListeningPoint lp = sipStack.createListeningPoint(myAddress, myPort, transport);

        sipProvider = sipStack.createSipProvider(lp);
        logger.info("provider " + sipProvider);
        logger.info("sipStack = " + sipStack);
        return sipProvider;
    } catch (Exception ex) {
        logger.error(ex);
        TestCase.fail(unexpectedException);
        return null;

    }

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


示例19: createSipProvider

import javax.sip.SipProvider; //导入依赖的package包/类
public SipProvider createSipProvider() {
    try {
        listeningPoint = sipStack.createListeningPoint(host, port, "udp");

        logger.info("listening point = " + host + " port = " + port);
        logger.info("listening point = " + listeningPoint);
        sipProvider = sipStack.createSipProvider(listeningPoint);
        return sipProvider;
    } catch (Exception ex) {
        logger.error(unexpectedException, ex);
        ex.printStackTrace();
        TestCase.fail(unexpectedException);
        return null;
    }

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


示例20: createSipProvider

import javax.sip.SipProvider; //导入依赖的package包/类
public SipProvider createSipProvider() {
    try {
        ListeningPoint listeningPoint = protocolObjects.sipStack
                .createListeningPoint(host, port, protocolObjects.transport);

        sipProvider = protocolObjects.sipStack
                .createSipProvider(listeningPoint);
    //  sipProvider.setAutomaticDialogSupportEnabled(false);
        return sipProvider;
    } catch (Exception ex) {
        logger.error(unexpectedException, ex);
        fail(unexpectedException);
        return null;
    }

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java RequestMessage类代码示例发布时间:2022-05-22
下一篇:
Java SortedNumericDocValues类代码示例发布时间: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