Package net.sourceforge.peers.sip.transport

Examples of net.sourceforge.peers.sip.transport.SipRequest


     * @throws SipUriSyntaxException
     */
    public SipRequest getGenericRequest(String requestUri, String method,
            String profileUri) throws SipUriSyntaxException {
        //8.1.1
        SipRequest request = new SipRequest(method, new SipURI(requestUri));
        SipHeaders headers = request.getSipHeaders();
        //String hostAddress = utils.getMyAddress().getHostAddress();
       
        //Via
       
        //TODO no Via should be added directly by UAC, Via is normally added by Transaction layer
View Full Code Here


    public SipRequest createInitialRequest(String requestUri, String method,
            String profileUri, String callId,
            MessageInterceptor messageInterceptor)
                throws SipUriSyntaxException {
       
        SipRequest sipRequest = createInitialRequestStart(requestUri, method,
                profileUri, callId);
       
        // TODO add route header for outbound proxy give it to xxxHandler to create
        // clientTransaction
        SipURI outboundProxy = userAgent.getOutboundProxy();
        if (outboundProxy != null) {
            NameAddress outboundProxyNameAddress =
                new NameAddress(outboundProxy.toString());
            sipRequest.getSipHeaders().add(new SipHeaderFieldName(RFC3261.HDR_ROUTE),
                    new SipHeaderFieldValue(outboundProxyNameAddress.toString()), 0);
        }
        ClientTransaction clientTransaction = null;
        if (RFC3261.METHOD_INVITE.equals(method)) {
            clientTransaction = inviteHandler.preProcessInvite(sipRequest);
View Full Code Here

        return sipRequest;
    }
   
    private SipRequest createInitialRequestStart(String requestUri, String method,
            String profileUri, String callId) throws SipUriSyntaxException {
        SipRequest sipRequest = getGenericRequest(requestUri, method,
                profileUri);
        if (callId != null) {
            SipHeaderFieldValue callIdValue = sipRequest.getSipHeaders().get(
                    new SipHeaderFieldName(RFC3261.HDR_CALLID));
            callIdValue.setValue(callId);
        }
        return sipRequest;
    }
View Full Code Here

    public void createCancel(SipRequest inviteRequest,
            MidDialogRequestManager midDialogRequestManager, String profileUri) {
        SipHeaders inviteHeaders = inviteRequest.getSipHeaders();
        SipHeaderFieldValue callId = inviteHeaders.get(
                new SipHeaderFieldName(RFC3261.HDR_CALLID));
        SipRequest sipRequest;
        try {
            sipRequest = createInitialRequestStart(
                    inviteRequest.getRequestUri().toString(), RFC3261.METHOD_CANCEL,
                    profileUri, callId.getValue());
        } catch (SipUriSyntaxException e) {
View Full Code Here

    public void generateMidDialogRequest(Dialog dialog,
            String method, MessageInterceptor messageInterceptor) {
       

        SipRequest sipRequest = dialog.buildSubsequentRequest(RFC3261.METHOD_BYE);

        if (RFC3261.METHOD_BYE.equals(method)) {
            byeHandler.preprocessBye(sipRequest, dialog);
        }
        //TODO check that subsequent request is supported before client
View Full Code Here

    void createAndSendAck() {
       
        //p.126 last paragraph
       
        //17.1.1.3
        ack = new SipRequest(RFC3261.METHOD_ACK, request.getRequestUri());
        SipHeaderFieldValue topVia = Utils.getTopVia(request);
        SipHeaders ackSipHeaders = ack.getSipHeaders();
        ackSipHeaders.add(new SipHeaderFieldName(RFC3261.HDR_VIA), topVia);
        Utils.copyHeader(request, ack, RFC3261.HDR_CALLID);
        Utils.copyHeader(request, ack, RFC3261.HDR_FROM);
View Full Code Here

            String method) {
        ArrayList<ClientTransaction> clientTransactionsFromCallId =
            new ArrayList<ClientTransaction>();
        for (ClientTransaction clientTransaction: clientTransactions.values()) {
            Transaction transaction = (Transaction)clientTransaction;
            SipRequest sipRequest = transaction.getRequest();
            String reqCallId = Utils.getMessageCallId(sipRequest);
            String reqMethod = sipRequest.getMethod();
            if (callId.equals(reqCallId) && method.equals(reqMethod)) {
                clientTransactionsFromCallId.add(clientTransaction);
            }
        }
        return clientTransactionsFromCallId;
View Full Code Here

            sipUri = new SipURI(remoteTarget);
        } catch (SipUriSyntaxException e) {
            throw new RuntimeException(e);
            //TODO check remote target when message is received
        }
        SipRequest subsequentRequest = new SipRequest(method, sipUri);
        SipHeaders headers = subsequentRequest.getSipHeaders();
       
        //To
       
        SipHeaderFieldValue to = new SipHeaderFieldValue(
                new NameAddress(remoteUri).toString());
View Full Code Here

        String requestUri = RFC3261.SIP_SCHEME + RFC3261.SCHEME_SEPARATOR
            + domain;
        SipListener sipListener = userAgent.getSipListener();
        profileUri = RFC3261.SIP_SCHEME + RFC3261.SCHEME_SEPARATOR
          + userAgent.getUserpart() + RFC3261.AT + domain;
        SipRequest sipRequest = initialRequestManager.createInitialRequest(
                requestUri, RFC3261.METHOD_REGISTER, profileUri,
                registerCallID);
        if (sipListener != null) {
            sipListener.registering(sipRequest);
        }
View Full Code Here

    private SipRequest getInviteWithAuth(String callId) {
        List<ClientTransaction> clientTransactions =
            transactionManager.getClientTransactionsFromCallId(callId,
                    RFC3261.METHOD_INVITE);
        SipRequest sipRequestNoAuth = null;
        for (ClientTransaction clientTransaction: clientTransactions) {
            InviteClientTransaction inviteClientTransaction =
                (InviteClientTransaction)clientTransaction;
            SipRequest sipRequest = inviteClientTransaction.getRequest();
            SipHeaders sipHeaders = sipRequest.getSipHeaders();
            SipHeaderFieldName authorization = new SipHeaderFieldName(
                    RFC3261.HDR_AUTHORIZATION);
            SipHeaderFieldValue value = sipHeaders.get(authorization);
            if (value == null) {
                SipHeaderFieldName proxyAuthorization = new SipHeaderFieldName(
View Full Code Here

TOP

Related Classes of net.sourceforge.peers.sip.transport.SipRequest

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.