public boolean isSipURI() { return uri.isSipURI(); }
public String toString() { return this.uri.toString(); }
@Override public URI clone() { return new GenericURIImpl((javax.sip.address.URI)uri.clone()); }
String userName = null; javax.sip.address.URI uri = from.getAddress().getURI(); if(uri.isSipURI()) { userName = ((javax.sip.address.SipURI)uri).getUser(); javax.sip.address.URI requestUri = (javax.sip.address.URI) request.getRequestURI().clone(); try { request.setMethod(method); SipUri sipUri = (SipUri) sessionCreatingDialog.getRemoteTarget().getURI().clone(); sipUri.clearUriParms(); if(logger.isDebugEnabled()) { SipUri sipUri = (SipUri) sessionCreatingDialog.getRemoteTarget().getURI().clone(); sipUri.clearUriParms(); if(logger.isDebugEnabled()) {
public String getScheme() { return uri.getScheme(); }
public String getScheme() { return ((Request)message).getRequestURI().getScheme(); }
public SipURI getSipURI(URI uri) { if(uri instanceof TelURL) { return lookupSipUri(((TelURL)uri).getPhoneNumber()); } else if(uri.isSipURI() && ((SipURI)uri).getParameter("user") != null && ((SipURI)uri).getParameter("user").equalsIgnoreCase("phone")) { String phoneNumber = ((SipURI)uri).getUser(); if(phoneNumber == null || phoneNumber.isEmpty()) { // https://code.google.com/p/sipservlets/issues/detail?id=236 throw new IllegalArgumentException("Phone Number can't be empty in following uri with phone parameter " + uri); } return lookupSipUri(phoneNumber); } else if (uri instanceof SipURI) { return (SipURI) uri; } return null; }
public boolean equals(Object that) { if (this==that) return true; else if (that instanceof URI) { final URI o = (URI) that; // This is not sufficient for equality; revert to String equality... // return this.getScheme().equalsIgnoreCase( o.getScheme() ) return this.toString().equalsIgnoreCase( o.toString() ); } return false; }
/** * Get the router algorithm. * * @return Router router */ public Router getRouter(SIPRequest request) { if (request.getRequestLine() == null) { return this.defaultRouter; } else if (this.useRouterForAll) { return this.router; } else { if (request.getRequestURI().getScheme().equals("sip") || request.getRequestURI().getScheme().equals("sips")) { return this.defaultRouter; } else { if (this.router != null) return this.router; else return defaultRouter; } } }
/** * This timer task is used to garbage collect the dialog after some time. * */ class DialogDeleteIfNoAckSentTask extends SIPStackTimerTask implements Serializable { private long seqno; public DialogDeleteIfNoAckSentTask(long seqno) { this.seqno = seqno; } public void runTask() { if (SIPDialog.this.highestSequenceNumberAcknowledged < seqno) { /* * Did not send ACK so we need to delete the dialog. B2BUA NOTE: * we may want to send BYE to the Dialog at this point. Do we * want to make this behavior tailorable? */ dialogDeleteIfNoAckSentTask = null; if (!SIPDialog.this.isBackToBackUserAgent) { if (logger.isLoggingEnabled()) logger.logError( "ACK Was not sent. killing dialog " + dialogId); if (((SipProviderImpl) sipProvider).getSipListener() instanceof SipListenerExt) { raiseErrorEvent(SIPDialogErrorEvent.DIALOG_ACK_NOT_SENT_TIMEOUT); } else { delete(); }
/** * Check to see if the uri to resolve contains a "ob" parameter and if so, try * and locate a "flow" for this uri. * * This is part of the RFC5626 implementation * * @param uriToResolve * @return the flow uri or if no flow was found, the same uri * that was passed into the method */ private javax.sip.address.URI resolveSipOutbound(final javax.sip.address.URI uriToResolve) { if (!uriToResolve.isSipURI()) { return uriToResolve; } final javax.sip.address.SipURI sipURI = (javax.sip.address.SipURI) uriToResolve; if (sipURI.getParameter(MessageDispatcher.SIP_OUTBOUND_PARAM_OB) == null) { // no ob parameter, return return uriToResolve; } final MobicentsSipSession session = getSipSession(); final javax.sip.address.SipURI flow = session.getFlow(); if (flow != null) { if (logger.isDebugEnabled()) { logger.debug("Found a flow \"" + flow + "\" for the original uri \"" + uriToResolve + "\""); } return flow; } return uriToResolve; }
public static String parseURI(HeaderAddress header) { URI uri = getURI(header); return uri != null ? uri.toString() : null; }
if (dialog.firstTransactionIsServerTransaction) { dialog.firstTransactionSecure = transaction.getRequest() .getRequestURI().getScheme().equalsIgnoreCase("sips"); } else { dialog.firstTransactionSecure = ((SIPClientTransaction) transaction)
sipRequest.setMethod(Request.ACK); sipRequest.setRequestURI((SipUri) getRemoteTarget().getURI() .clone()); sipRequest.setCallId(this.getCallId()); sipRequest.setCSeq(new CSeq(cseqno, Request.ACK));
public static void optimizeRouteHeaderAddressForInternalRoutingrequest(SipConnector sipConnector, Request request, MobicentsSipSession session, SipFactoryImpl sipFactoryImpl, String transport) { RouteHeader rh = (RouteHeader) request.getHeader(RouteHeader.NAME); javax.sip.address.URI uri = null; if(rh != null) { uri = rh.getAddress().getURI(); } else { uri = request.getRequestURI(); } if(uri.isSipURI()) { javax.sip.address.SipURI sipUri = (javax.sip.address.SipURI) uri; optimizeUriForInternalRoutingRequest(sipConnector, sipUri, session, sipFactoryImpl, transport); } }
public String getValue() { return RFC2396UrlDecoder.decode(this.uri.toString()); }
/** * Get the default route string. * * @param sipRequest * is the request for which we want to compute the next hop. * @throws SipException */ public Hop getNextHop(SIPRequest sipRequest) throws SipException { if (this.useRouterForAll) { // Use custom router to route all messages. if (router != null) return router.getNextHop(sipRequest); else return null; } else { // Also non-SIP request containing Route headers goes to the default // router if (sipRequest.getRequestURI().isSipURI() || sipRequest.getRouteHeaders() != null) { return defaultRouter.getNextHop(sipRequest); } else if (router != null) { return router.getNextHop(sipRequest); } else return null; } }
public String getValue() { return RFC2396UrlDecoder.decode(this.uri.toString()); }
if(sipConnector != null && sipConnector.isUseStaticAddress()) { if(session != null && session.getProxy() == null) { boolean sipURI = contactHeader.getAddress().getURI().isSipURI(); if(sipURI) { javax.sip.address.SipURI sipUri = (javax.sip.address.SipURI) contactHeader.getAddress().getURI();
public String getRequestURI() { return isRequest ? ((SIPRequest) msg).getRequestURI().toString() : null; }