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

Java Address类代码示例

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

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



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

示例1: getRemoteParty

import javax.sip.address.Address; //导入依赖的package包/类
/**
 * Returns the Address identifying the remote party. This is the value of
 * the To header of locally initiated requests in this dialogue when acting
 * as an User Agent Client.
 * <p>
 * This is the value of the From header of recieved responses in this
 * dialogue when acting as an User Agent Server.
 * 
 * @return the address object of the remote party.
 */
public javax.sip.address.Address getRemoteParty() {
    // jeand : we save the address in a string form and reparse it, help GC
    // for dialogs updated not too often
    if (remoteParty == null && remotePartyStringified != null) {
        try {
            this.remoteParty = (Address) new AddressParser(
                    remotePartyStringified).address(true);
        } catch (ParseException e) {
            logger.logError(
                    "error reparsing the remoteParty", e);
        }
    }
    if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) {
        logger.logDebug(
                "gettingRemoteParty " + this.remoteParty);
    }
    return this.remoteParty;

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


示例2: sendMultipleContactRegistration

import javax.sip.address.Address; //导入依赖的package包/类
public void sendMultipleContactRegistration() throws Exception {
     	Address fromAddress = addressFactory.createAddress("[email protected]:5070");
     	ContactHeader contactHeader1 = headerFactory.createContactHeader(addressFactory.createAddress("sip:[email protected]:5070"));
 		ContactHeader contactHeader2 = headerFactory.createContactHeader(addressFactory.createAddress("sip:[email protected]:5080"));
 		
 		
CallIdHeader callId = provider.getNewCallId();			
CSeqHeader cSeq = headerFactory.createCSeqHeader(1l, Request.REGISTER);
FromHeader from = headerFactory.createFromHeader(fromAddress, "1234");
ToHeader to = headerFactory.createToHeader(addressFactory.createAddress("[email protected]"+host+":"+SERVER_PORT), null);
List via = Arrays.asList(((ListeningPointImpl)provider.getListeningPoint(testProtocol)).getViaHeader());			
MaxForwardsHeader maxForwards = headerFactory.createMaxForwardsHeader(10);
 		
 		URI requestURI = addressFactory.createURI("sip:[email protected]"+host+":"+SERVER_PORT);
 		Request request = messageFactory.createRequest(requestURI, Request.REGISTER, callId, cSeq, from, to, via, maxForwards);
 		    		
 		request.setRequestURI(requestURI);
 		request.addHeader(contactHeader1);
 		request.addHeader(contactHeader2);
 		ClientTransaction ctx = this.provider.getNewClientTransaction(request);
 		ctx.sendRequest();
     }
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:23,代码来源:MultipleContactsTest.java


示例3: sendTo

import javax.sip.address.Address; //导入依赖的package包/类
private void sendTo(ServerTransaction st, Request request, int targetPort) throws Exception {
    Request newRequest = (Request) request.clone();
    
    SipURI sipUri = addressFactory.createSipURI("UA1", "127.0.0.1");
    sipUri.setPort(targetPort);
    sipUri.setLrParam();
    sipUri.setTransportParam(Shootme.transport);
    Address address = addressFactory.createAddress("client1", sipUri);
    RouteHeader rheader = headerFactory.createRouteHeader(address);

    newRequest.addFirst(rheader);
    ViaHeader viaHeader = headerFactory.createViaHeader(host, this.port, "udp", null);
    newRequest.addFirst(viaHeader);
    ClientTransaction ct1 = sipProviders.get(Shootme.transport).getNewClientTransaction(newRequest);
    sipUri = addressFactory.createSipURI("proxy", "127.0.0.1");
    address = addressFactory.createAddress("proxy", sipUri);
    sipUri.setPort(5070);
    sipUri.setLrParam();
    RecordRouteHeader recordRoute = headerFactory.createRecordRouteHeader(address);
    newRequest.addHeader(recordRoute);
    ct1.setApplicationData(st);
    ct1.sendRequest();
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:24,代码来源:Proxy.java


示例4: processInvite

import javax.sip.address.Address; //导入依赖的package包/类
/**
 * Process the invite request.
 */
public void processInvite(RequestEvent requestEvent,
        ServerTransaction serverTransaction) {
    SipProvider sipProvider = (SipProvider) requestEvent.getSource();
    Request request = requestEvent.getRequest();
    this.sawInvite = true;
    try {

        Response okResponse = messageFactory.createResponse(
                Response.OK, request);
        Address address = addressFactory.createAddress("Shootme <sip:"
                + myAddress + ":" + myPort + ">");
        ContactHeader contactHeader = headerFactory
                .createContactHeader(address);
        ToHeader toHeader = (ToHeader) okResponse
                .getHeader(ToHeader.NAME);
        toHeader.setTag("4321"); // Application is supposed to set.
        okResponse.addHeader(contactHeader);
        sipProvider.sendResponse(okResponse); // Send it through the
                                                // Provider.

    } catch (Exception ex) {
        ex.printStackTrace();
        System.exit(0);
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:29,代码来源:DeliverRequestEventWithBadHeaderTest.java


示例5: sendInviteWithRPort

import javax.sip.address.Address; //导入依赖的package包/类
public void sendInviteWithRPort() throws Exception {
     	Address fromAddress = addressFactory.createAddress("[email protected]:5070");
     	ContactHeader contactHeader1 = headerFactory.createContactHeader(addressFactory.createAddress("sip:[email protected]:5070"));
 		ContactHeader contactHeader2 = headerFactory.createContactHeader(addressFactory.createAddress("sip:[email protected]:5080"));
 		
 		
CallIdHeader callId = provider.getNewCallId();			
CSeqHeader cSeq = headerFactory.createCSeqHeader(1l, Request.INVITE);
FromHeader from = headerFactory.createFromHeader(fromAddress, "1234");
ToHeader to = headerFactory.createToHeader(addressFactory.createAddress("[email protected]"+host+":"+SERVER_PORT), null);
ViaHeader via = ((ListeningPointImpl)provider.getListeningPoint(testProtocol)).getViaHeader();
via.setRPort();
List vias = Arrays.asList(via);			
MaxForwardsHeader maxForwards = headerFactory.createMaxForwardsHeader(10);
 		
 		URI requestURI = addressFactory.createURI("sip:[email protected]"+host+":"+SERVER_PORT);
 		Request request = messageFactory.createRequest(requestURI, Request.INVITE, callId, cSeq, from, to, vias, maxForwards);
 		System.out.println(request);
 		assertTrue(request.toString().indexOf("rport=") == -1);    		
 		
 		request.setRequestURI(requestURI);
 		request.addHeader(contactHeader1);
 		request.addHeader(contactHeader2);
 		ClientTransaction ctx = this.provider.getNewClientTransaction(request);
 		ctx.sendRequest();
     }
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:27,代码来源:ViaRPortTest.java


示例6: sendTo

import javax.sip.address.Address; //导入依赖的package包/类
private void sendTo(ServerTransaction st, Request request, int targetPort) throws Exception {
    Request newRequest = (Request) request.clone();
    
    SipURI sipUri = addressFactory.createSipURI("UA1", "127.0.0.1");
    sipUri.setPort(targetPort);
    sipUri.setLrParam();
    Address address = addressFactory.createAddress("client1", sipUri);
    RouteHeader rheader = headerFactory.createRouteHeader(address);

    newRequest.addFirst(rheader);
    ViaHeader viaHeader = headerFactory.createViaHeader(host, this.port, transport, null);
    newRequest.addFirst(viaHeader);
    ClientTransaction ct1 = sipProvider.getNewClientTransaction(newRequest);
    sipUri = addressFactory.createSipURI("proxy", "127.0.0.1");
    address = addressFactory.createAddress("proxy", sipUri);
    sipUri.setPort(5070);
    sipUri.setLrParam();
    RecordRouteHeader recordRoute = headerFactory.createRecordRouteHeader(address);
    newRequest.addHeader(recordRoute);
    ct1.setApplicationData(st);
    this.clientTxTable.put(new Integer(targetPort), ct1);
    ct1.sendRequest();
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:24,代码来源:Proxy.java


示例7: processInvite

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


示例8: processInvite

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


示例9: createTiContact

import javax.sip.address.Address; //导入依赖的package包/类
/**
 * Add a contact for the TI.
 */
public ContactHeader createTiContact() throws Exception {
    try {
        ContactHeader contact = tiHeaderFactory.createContactHeader();

        // JvB: getIPAddress may return null!
        String ip = tiSipProvider.getSipStack().getIPAddress();
        if (ip == null) {
            ListeningPoint lp = (ListeningPoint) tiSipProvider
                    .getSipStack().getListeningPoints().next();
            ip = lp.getIPAddress();
        }

        SipURI srcSipURI = tiAddressFactory.createSipURI(null, ip);
        srcSipURI.setPort(tiSipProvider.getListeningPoint("udp").getPort());
        srcSipURI.setTransportParam("udp");
        Address address = tiAddressFactory.createAddress(srcSipURI);
        address.setDisplayName("TI Contact");
        contact.setAddress(address);
        return contact;
    } catch (Exception ex) {
        ex.printStackTrace();
        assertTrue(false);
        throw ex;
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:29,代码来源:MessageFlowHarness.java


示例10: createRiContact

import javax.sip.address.Address; //导入依赖的package包/类
/**
 * Add a contact for the TI.
 */
public ContactHeader createRiContact() throws TckInternalError {
    try {
        ContactHeader contact = riHeaderFactory.createContactHeader();
        // BUG reported by Ben Evans (Open Cloud):
        // Should be using RI's address factory here, not TI's.

        ListeningPoint lp = riSipProvider.getListeningPoints()[0];
        SipURI srcSipURI = riAddressFactory.createSipURI(null, lp
                .getIPAddress());
        srcSipURI.setPort(lp.getPort());
        srcSipURI.setTransportParam(lp.getTransport());
        Address address = riAddressFactory.createAddress(srcSipURI);
        address.setDisplayName("RI Contact");
        contact.setAddress(address);
        return contact;
    } catch (Exception ex) {
        throw new TckInternalError(ex.getMessage());
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:23,代码来源:MessageFlowHarness.java


示例11: makeRequest

import javax.sip.address.Address; //导入依赖的package包/类
public Request makeRequest(SipManager sipManager, long cseqNumber, int expiresTime) throws ParseException, InvalidArgumentException {

		AddressFactory addressFactory = sipManager.addressFactory;
		SipProvider sipProvider = sipManager.sipProvider;
		MessageFactory messageFactory = sipManager.messageFactory;
		HeaderFactory headerFactory = sipManager.headerFactory;
		// Create addresses and via header for the request
		Address fromAddress = addressFactory.createAddress("sip:"+ SipManager.sipUserName + "@"+ SipManager.registrarIp);
		fromAddress.setDisplayName(SipManager.sipUserName);
		Address toAddress = addressFactory.createAddress("sip:"	+ SipManager.sipUserName + "@"	+ SipManager.registrarIp);
		toAddress.setDisplayName(SipManager.sipUserName);
		Address contactAddress = sipManager.createContactAddress();
		ArrayList<ViaHeader> viaHeaders = sipManager.createViaHeader();
		URI requestURI = addressFactory.createAddress("sip:" + SipManager.registrarIp).getURI();
		// Build the request
		final Request request = messageFactory.createRequest(requestURI,
				Request.REGISTER, sipProvider.getNewCallId(),
				headerFactory.createCSeqHeader(cseqNumber, Request.REGISTER),
				headerFactory.createFromHeader(fromAddress, "c3ff411e"),
				headerFactory.createToHeader(toAddress, null), viaHeaders,
				headerFactory.createMaxForwardsHeader(70));
		// Add the contact header
		request.addHeader(headerFactory.createContactHeader(contactAddress));
		ExpiresHeader eh = headerFactory.createExpiresHeader(expiresTime);
		request.addHeader(eh);
		// Print the request
		System.out.println(request.toString());
		return request;
	}
 
开发者ID:SyMPHOnY-,项目名称:Smart-Home-Gateway,代码行数:30,代码来源:RegisterMessage.java


示例12: SipSubscription

import javax.sip.address.Address; //导入依赖的package包/类
SipSubscription(String from, String to) throws ParseException
{
	this.localParty = SipService.addressFactory.createAddress("sip:" + from + "@" + SipService.sipListener.host);
	this.remoteParty = SipService.addressFactory.createAddress("sip:" + to + "@" + SipService.sipListener.host);

	this.localTag = Integer.toString((int) (Math.random() * 100000));
	this.remoteTag = null;

	callId = SipService.sipProvider.getNewCallId().getCallId();

	this.cseq = 1;

	@SuppressWarnings("unused")
	ListeningPoint listeningPoint = SipService.sipProvider.getListeningPoint(ListeningPoint.UDP);
	this.contact = "sip:" + to + "@" + SipService.getRemoteIP();

	rl = new LinkedList<Address>();

	expires = System.currentTimeMillis() + (3600 * 1000);
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:21,代码来源:SipSubscription.java


示例13: getLocalParty

import javax.sip.address.Address; //导入依赖的package包/类
public javax.sip.address.Address getLocalParty() {
    // jeand : we save the address in a string form and reparse it, help GC
    // for dialogs updated not too often
    if (localParty == null && localPartyStringified != null) {
        try {
            this.localParty = (Address) new AddressParser(
                    localPartyStringified).address(true);
        } catch (ParseException e) {
            logger.logError(
                    "error reparsing the localParty", e);
        }
    }
    return this.localParty;
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:15,代码来源:SIPDialog.java


示例14: getRemoteTarget

import javax.sip.address.Address; //导入依赖的package包/类
public javax.sip.address.Address getRemoteTarget() {
    // jeand : we save the address in a string form and reparse it, help GC
    // for dialogs updated not too often
    if (remoteTarget == null && remoteTargetStringified != null) {
        try {
            this.remoteTarget = (Address) new AddressParser(
                    remoteTargetStringified).address(true);
        } catch (ParseException e) {
            logger.logError(
                    "error reparsing the remoteTarget", e);
        }
    }
    return this.remoteTarget;
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:15,代码来源:SIPDialog.java


示例15: sendInviteOK

import javax.sip.address.Address; //导入依赖的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,代码行数:35,代码来源:Shootme.java


示例16: sendInviteOK

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


示例17: sendInviteOK

import javax.sip.address.Address; //导入依赖的package包/类
private void sendInviteOK(RequestEvent requestEvent, ServerTransaction inviteTid, String toTag) {
    try {
        logger.info("sendInviteOK: " + inviteTid);
        if (inviteTid.getState() == TransactionState.PROCEEDING) {
            logger.info("shootme: Dialog state before OK: " + inviteTid.getDialog().getState());
            System.err.println("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());
            System.err.println("sentInviteOK: inviteTid = " + inviteTid + " state = " + inviteTid.getState());
        }
    } catch (Exception ex) {
        ex.printStackTrace();
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:29,代码来源:Shootme.java


示例18: processPrack

import javax.sip.address.Address; //导入依赖的package包/类
private void processPrack(RequestEvent requestEvent,
        ServerTransaction serverTransactionId) {
    prackRequestReceived = true;
    try {
        logger.info("shootme: got an PRACK! ");
        logger.info("Dialog State = " + dialog.getState());

        /**
         * JvB: First, send 200 OK for PRACK
         */
        Request prack = requestEvent.getRequest();
        Response prackOk = messageFactory.createResponse(200, prack);
        serverTransactionId.sendResponse(prackOk);

        /**
         * Send a 200 OK response to complete the 3 way handshake for the
         * INIVTE.
         */
        Response response = messageFactory.createResponse(200,
                inviteRequest);
        ToHeader to = (ToHeader) response.getHeader(ToHeader.NAME);
        to.setTag(this.toTag);
        Address address = addressFactory.createAddress("Shootme <sip:"
                + myAddress + ":" + myPort + ">");
        ContactHeader contactHeader = headerFactory
                .createContactHeader(address);
        response.addHeader(contactHeader);
        inviteTid.sendResponse(response);
    } catch (Exception ex) {
        TestHarness.fail(ex.getMessage());
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:33,代码来源:UdpPrackTimeoutTest.java


示例19: sendInviteOK

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


示例20: sendReInvite

import javax.sip.address.Address; //导入依赖的package包/类
public void sendReInvite(SipProvider sipProvider) throws Exception {
    Request inviteRequest = dialog.createRequest(Request.INVITE);
    ((SipURI) inviteRequest.getRequestURI()).removeParameter("transport");
    MaxForwardsHeader mf = protocolObjects.headerFactory.createMaxForwardsHeader(10);
    inviteRequest.addHeader(mf);
    ((ViaHeader) inviteRequest.getHeader(ViaHeader.NAME))
            .setTransport(protocolObjects.transport);
    Address address = protocolObjects.addressFactory.createAddress("Shootme <sip:"
            + myAddress + ":" + myPort + ">");
    ContactHeader contactHeader = protocolObjects.headerFactory
            .createContactHeader(address);
    inviteRequest.addHeader(contactHeader);
    ClientTransaction ct = sipProvider.getNewClientTransaction(inviteRequest);
    dialog.sendRequest(ct);
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:16,代码来源:ReInviteBusyTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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