public Object extract(Object input) { if (inputType == REQUEST) { return ((SipServletRequest) input).getRequestURI(); } else { return ((Address) input).getURI(); } } }
public Object extract(Object input) { if (inputType == REQUEST) { return ((SipServletRequest) input).getRequestURI(); } else { return ((Address) input).getURI(); } } }
public Object extract(Object input) { if (inputType == REQUEST) { return ((SipServletRequest) input).getRequestURI(); } else { return ((Address) input).getURI(); } } }
public Object extract(Object input) { if (inputType == REQUEST) { return ((SipServletRequest) input).getRequestURI(); } else { return ((Address) input).getURI(); } } }
@Override public String getOriginator() { final SipURI from = (SipURI)initialInvite.getFrom().getURI(); return from.getUser(); }
@Override public String getRecipient() { final SipURI to = (SipURI)initialInvite.getTo().getURI(); return to.getUser(); }
@Override public String getOriginatorURI(){ return initialInvite.getFrom().getURI().toString(); }
/** * {@inheritDoc} */ public void pushPath(Address uri) { checkReadOnly(); if(!Request.REGISTER.equalsIgnoreCase(((Request)message).getMethod())) { throw new IllegalStateException("Cannot push a Path on a non REGISTER request !"); } if(uri.getURI() instanceof TelURL) { throw new IllegalArgumentException("Cannot push a TelUrl as a path !"); } if (logger.isDebugEnabled()) logger.debug("Pushing path into message of value [" + uri + "]"); try { javax.sip.header.Header p = SipFactoryImpl.headerFactory .createHeader(PathHeader.NAME, uri.toString()); this.message.addFirst(p); } catch (Exception e) { logger.error("Error while pushing path [" + uri + "]"); throw new IllegalArgumentException("Error pushing path ", e); } }
public Enumeration<String> getParameterNames() { // JSR 289 Section 5.6.1 Parameters : // For initial requests where a preloaded Route header specified the application to be invoked, the parameters are those of the SIP or SIPS URI in that Route header. // For initial requests where the application is invoked the parameters are those present on the request URI, // if this is a SIP or a SIPS URI. For other URI schemes, the parameter set is undefined. // For subsequent requests in a dialog, the parameters presented to the application are those that the application itself // set on the Record-Route header for the initial request or response (see 10.4 Record-Route Parameters). // These will typically be the URI parameters of the top Route header field but if the upstream SIP element is a // "strict router" they may be returned in the request URI (see RFC 3261). // It is the containers responsibility to recognize whether the upstream element is a strict router and determine the right parameter set accordingly. Vector<String> retval = new Vector<String>(); if(this.getPoppedRoute() != null) { Iterator<String> parameterNamesIt = this.getPoppedRoute().getURI().getParameterNames(); while (parameterNamesIt.hasNext()) { String parameterName = parameterNamesIt.next(); retval.add(parameterName); } } else { Iterator<String> parameterNamesIt = this.getRequestURI().getParameterNames(); while (parameterNamesIt.hasNext()) { String parameterName = parameterNamesIt.next(); retval.add(parameterName); } } return retval.elements(); }
/** * {@inheritDoc} */ public void pushRoute(Address address) { checkReadOnly(); if(address.getURI() instanceof TelURL) { throw new IllegalArgumentException("Cannot push a TelUrl as a route !"); } javax.sip.address.SipURI sipUri = (javax.sip.address.SipURI) ((AddressImpl) address) .getAddress().getURI(); pushRoute(sipUri); }
public Map<String, String[]> getParameterMap() { // JSR 289 Section 5.6.1 Parameters : // For initial requests where a preloaded Route header specified the application to be invoked, the parameters are those of the SIP or SIPS URI in that Route header. // For initial requests where the application is invoked the parameters are those present on the request URI, // if this is a SIP or a SIPS URI. For other URI schemes, the parameter set is undefined. // For subsequent requests in a dialog, the parameters presented to the application are those that the application itself // set on the Record-Route header for the initial request or response (see 10.4 Record-Route Parameters). // These will typically be the URI parameters of the top Route header field but if the upstream SIP element is a // "strict router" they may be returned in the request URI (see RFC 3261). // It is the containers responsibility to recognize whether the upstream element is a strict router and determine the right parameter set accordingly. HashMap<String, String[]> retval = new HashMap<String, String[]>(); if(this.getPoppedRoute() != null) { Iterator<String> parameterNamesIt = this.getPoppedRoute().getURI().getParameterNames(); while (parameterNamesIt.hasNext()) { String parameterName = parameterNamesIt.next(); String [] paramsArray = {this.getPoppedRoute().getURI().getParameter(parameterName)}; //Get the parameter map value to String[] retval.put(parameterName, paramsArray); } } else { Iterator<String> parameterNamesIt = this.getRequestURI().getParameterNames(); while (parameterNamesIt.hasNext()) { String parameterName = parameterNamesIt.next(); String [] paramsArray = {this.getPoppedRoute().getURI().getParameter(parameterName)}; //Get the parameter map value to String[] retval.put(parameterName, paramsArray); } } return retval; }
Iterator<String> parameterNamesIt = this.getPoppedRoute().getURI().getParameterNames(); while (parameterNamesIt.hasNext()) { String parameterName = parameterNamesIt.next(); String[] paramsArray = { this.getPoppedRoute().getURI().getParameter(parameterName) }; // Get the while (parameterNamesIt.hasNext()) { String parameterName = parameterNamesIt.next(); String[] paramsArray = { this.getPoppedRoute().getURI().getParameter(parameterName) }; // Get the
Iterator<String> parameterNamesIt = this.getPoppedRoute().getURI().getParameterNames(); while (parameterNamesIt.hasNext()) { String parameterName = parameterNamesIt.next(); String[] paramsArray = { this.getPoppedRoute().getURI().getParameter(parameterName) }; // Get the while (parameterNamesIt.hasNext()) { String parameterName = parameterNamesIt.next(); String[] paramsArray = { this.getPoppedRoute().getURI().getParameter(parameterName) }; // Get the
public Map<String, String> getParameterMap() { // JSR 289 Section 5.6.1 Parameters : // For initial requests where a preloaded Route header specified the application to be invoked, the parameters are those of the SIP or SIPS URI in that Route header. // For initial requests where the application is invoked the parameters are those present on the request URI, // if this is a SIP or a SIPS URI. For other URI schemes, the parameter set is undefined. // For subsequent requests in a dialog, the parameters presented to the application are those that the application itself // set on the Record-Route header for the initial request or response (see 10.4 Record-Route Parameters). // These will typically be the URI parameters of the top Route header field but if the upstream SIP element is a // "strict router" they may be returned in the request URI (see RFC 3261). // It is the containers responsibility to recognize whether the upstream element is a strict router and determine the right parameter set accordingly. HashMap<String, String> retval = new HashMap<String, String>(); if(this.getPoppedRoute() != null) { Iterator<String> parameterNamesIt = this.getPoppedRoute().getURI().getParameterNames(); while (parameterNamesIt.hasNext()) { String parameterName = parameterNamesIt.next(); retval.put(parameterName, this.getPoppedRoute().getURI().getParameter(parameterName)); } } else { Iterator<String> parameterNamesIt = this.getRequestURI().getParameterNames(); while (parameterNamesIt.hasNext()) { String parameterName = parameterNamesIt.next(); retval.put(parameterName, this.getRequestURI().getParameter(parameterName)); } } return retval; } }
+ addr + "]"); if (isSystemHeaderAndNotGruu(getModifiableRule(hName), (Parameterable)addr.getURI())) { logger.error("Error, can't set system header [" + hName + "]"); throw new IllegalArgumentException(
callDetailsMap.put(senderPath, callInfo); if (callInfo != null && callInfo.invite() != null) { callLocationMap.put(callInfo.invite().getAddressHeader(ContactHeader.NAME).getURI().toString(), sender);
if (isSystemHeaderAndNotGruu(getModifiableRule(hName), (Parameterable)addr.getURI())) { logger.error("Error, can't add system header [" + hName + "]"); throw new IllegalArgumentException("Header[" + hName
/** * @param message * @param self * @param sender */ private void onStopObserving(StopObserving message, ActorRef self, ActorRef sender) throws ServletParseException { String senderPath = sender.path().name(); callMap.remove(senderPath); CallInfo callInfo = callDetailsMap.remove(senderPath); if (callInfo != null && callInfo.invite() != null) { callLocationMap.remove(callInfo.invite().getAddressHeader(ContactHeader.NAME).getURI().toString()); } if (callInfo.direction().equalsIgnoreCase("inbound")) { if (logger.isDebugEnabled()) { String msg = String.format("MonitoringService Removed inbound call from: %s to: %s, currently liveCalls: %d", callInfo.from(), callInfo.to(),callDetailsMap.size()); logger.debug(msg); } incomingCallDetailsMap.remove(senderPath); } else { if (logger.isDebugEnabled()) { String msg = String.format("MonitoringService Removed outbound call from: %s to: %s, currently liveCallS: %d ", callInfo.from(), callInfo.to(),callDetailsMap.size()); logger.debug(msg); } outgoingCallDetailsMap.remove(senderPath); } callStateMap.remove(senderPath); }
/** * * Extracts the User SIP identity from a request header * * @param request * @param useTo Whether or not to use the To field in the SIP header * @return */ public static String getUserSipId(final SipServletRequest request, boolean useTo) { final SipURI toUri; final String toUser; if (useTo) { toUri = (SipURI) request.getTo().getURI(); toUser = toUri.getUser(); } else { toUri = (SipURI) request.getRequestURI(); toUser = toUri.getUser(); } return toUser; }
public String getParameter(String name) { // JSR 289 Section 5.6.1 Parameters : // For initial requests where a preloaded Route header specified the application to be invoked, the parameters are those of the SIP or SIPS URI in that Route header. // For initial requests where the application is invoked the parameters are those present on the request URI, // if this is a SIP or a SIPS URI. For other URI schemes, the parameter set is undefined. // For subsequent requests in a dialog, the parameters presented to the application are those that the application itself // set on the Record-Route header for the initial request or response (see 10.4 Record-Route Parameters). // These will typically be the URI parameters of the top Route header field but if the upstream SIP element is a // "strict router" they may be returned in the request URI (see RFC 3261). // It is the containers responsibility to recognize whether the upstream element is a strict router and determine the right parameter set accordingly. if(this.getPoppedRoute() != null) { return this.getPoppedRoute().getURI().getParameter(name); } else { return this.getRequestURI().getParameter(name); } }