Address na = header.getAddress(); log.info("Address: " + na); target = na.getURI();
while (contactHeaders.hasNext()) { ContactHeader newContactHeader = (ContactHeader) contactHeader.clone(); final URI newURI = newRequestContactHeader.getAddress().getURI(); newContactHeader.getAddress().setDisplayName(newRequestContactHeader.getAddress().getDisplayName()); SipURI newContactSipURI = (SipURI) newContactHeader.getAddress().getURI(); ((SipURI)newContactHeader.getAddress().getURI()).setUser(newSipURI.getUser()); Iterator<String> uriParameters = newSipURI.getParameterNames(); while (uriParameters.hasNext()) { Iterator<String> headerParameters = newRequestContactHeader.getParameterNames(); while (headerParameters.hasNext()) { String parameter = headerParameters.next(); String value = newRequestContactHeader.getParameter(parameter); newContactHeader.setParameter(parameter, "".equals(value) ? null : value);
long requestedExpires = contact.getExpires(); if (contact.getQValue() != -1) q = contact.getQValue(); String contactAddress = contact.getAddress().getURI() .toString();
if(contact != null && !contact.isWildCard()) { return ((javax.sip.address.SipURI)contact.getAddress().getURI()).toString();
if (contact.getExpires() >= 0) { requestedExpires = contact.getExpires(); } else if ((expiresHeader != null) && (expiresHeader.getExpires() >= 0)) { contact.setExpires((int) requestedExpires); } catch (InvalidArgumentException e) { tracer.severe("failed to set expires?!?!", e); if (contact.getQValue() != -1) q = contact.getQValue(); if ((q > 1) || (q < 0)) { aci.detach(sbbContextExt.getSbbLocalObject());
if(contactHeader != null && contactHeader.getParameter(MessageDispatcher.SIP_OUTBOUND_PARAM_REG_ID) != null) { int nbVias = 0; ListIterator<ViaHeader> vias = request.getHeaders(ViaHeader.NAME); poppedRouteHasObParam = true; if(contactHeader != null && contactHeader.getParameter(MessageDispatcher.SIP_OUTBOUND_PARAM_REG_ID) != null) { contactHasObParam = true;
/** * Add a route list extacted from the contact list of the incoming message. * * @param contactList * -- contact list extracted from the incoming message. * */ protected void setRemoteTarget(ContactHeader contact) { this.remoteTarget = contact.getAddress(); if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) { logger.logDebug( "Dialog.setRemoteTarget: " + this.remoteTarget); logger.logStackTrace(); } }
/** * Attempts to find a locally registered contact address for the given URI, * using the location service interface. */ private URI isUserAvailable(List<RegistrationBinding> bindings) { URI target = null; if (bindings != null & !bindings.isEmpty()) { Iterator<RegistrationBinding> it = bindings.iterator(); while (it.hasNext()) { RegistrationBinding binding = it.next(); log.info("########## BINDINGS: " + binding); ContactHeader header = null; try { header = getHeaderFactory().createContactHeader(getAddressFactory().createAddress(binding.getContactAddress())); } catch (ParseException e) { log.severe(e.getMessage(), e); } log.info("########## CONTACT HEADER: " + header); if (header == null) { // entry expired continue; // see if there are any more contacts... } Address na = header.getAddress(); log.info("isUserAvailable Address: " + na); target = na.getURI(); break; } } return target; }
CallIdHeader callId = (CallIdHeader)request.getHeader(CallIdHeader.NAME); String username = getHash(callId.getCallId().getBytes()); SipURI uri = (SipURI)ch.getAddress().getURI(); try { uri.setUser(username); ch.getAddress().setDisplayName(null); } catch (ParseException e) { throw new IllegalStateException("Can't create contact header user part with MD5", e);
while(headers.hasNext()) { final ContactHeader contactHeader = (ContactHeader) headers.next(); final javax.sip.address.URI addressURI = contactHeader.getAddress().getURI(); URI contactURI = null; if (addressURI instanceof javax.sip.address.SipURI) {
/** * Log a response received at this message channel. This is used for processing incoming * responses to a client transaction. * * @param receptionTime is the time at which the response was received. * @param status is the processing status of the message. * */ public void logResponse(SIPResponse sipResponse, long receptionTime, String status) { int peerport = getPeerPort(); if (peerport == 0 && sipResponse.getContactHeaders() != null) { ContactHeader contact = (ContactHeader) sipResponse.getContactHeaders().getFirst(); peerport = ((AddressImpl) contact.getAddress()).getPort(); } String from = getPeerAddress().toString() + ":" + peerport; String to = this.getHost() + ":" + getPort(); this.getSIPStack().serverLogger.logMessage(sipResponse, from, to, status, false, receptionTime); }
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(); sipUri.setHost(sipConnector.getStaticServerAddress()); sipUri.setPort(sipConnector.getStaticServerPort());
if ((contact != null && contact.getAddress().getURI() instanceof Parameters && ((Parameters)contact.getAddress().getURI()).getParameter(SIP_OUTBOUND_PARAM_OB) != null)) { final String remoteHost = sipServletRequest.getRemoteAddr(); final int remotePort = sipServletRequest.getRemotePort();
if(contactHeader != null && (((Parameters)contactHeader.getAddress().getURI()).getParameter("gruu") != null || ((Parameters)contactHeader.getAddress().getURI()).getParameter("gr") != null)) { if(logger.isDebugEnabled()) { logger.debug("not changing existing contact header " + contactHeader + " as it contains gruu"); boolean sipURI = contactHeader.getAddress().getURI().isSipURI(); if(sipURI) { javax.sip.address.SipURI contactSipUri = (javax.sip.address.SipURI) contactHeader.getAddress().getURI();
rewriteUri((SipURI) contact.getAddress().getURI()); ContactHeader contact = (ContactHeader)message.getHeader(ContactHeader.NAME); if(contact != null) { rewriteUri((SipURI) contact.getAddress().getURI());
/** * Update the haSipDialog passed in param with the dialogMetaData and app meta data * @param dialogMetaData * @param dialogAppData * @param haSipDialog * @throws ParseException * @throws PeerUnavailableException */ private void updateDialogMetaData(Map<String, Object> dialogMetaData, Object dialogAppData, HASipDialog haSipDialog, boolean recreation) throws ParseException, PeerUnavailableException { haSipDialog.setMetaDataToReplicate(dialogMetaData, recreation); haSipDialog.setApplicationDataToReplicate(dialogAppData); final String contactStringified = (String) dialogMetaData.get(AbstractHASipDialog.CONTACT_HEADER); if(logger.isLoggingEnabled(StackLogger.TRACE_DEBUG)) { logger.logDebug("contactStringified " + contactStringified); } if(contactStringified != null) { Address contactAddress = SipFactory.getInstance().createAddressFactory().createAddress(contactStringified); ContactHeader contactHeader = SipFactory.getInstance().createHeaderFactory().createContactHeader(contactAddress); if(logger.isLoggingEnabled(StackLogger.TRACE_DEBUG)) { logger.logDebug("contactHeader " + contactHeader); logger.logDebug("contactURI " + contactHeader.getAddress().getURI()); } haSipDialog.setContactHeader(contactHeader); } }
/** * Update the haSipDialog passed in param with the dialogMetaData and app meta data * @param dialogMetaData * @param dialogAppData * @param haSipDialog * @throws ParseException * @throws PeerUnavailableException */ private void updateDialogMetaData(Map<String, Object> dialogMetaData, Object dialogAppData, HASipDialog haSipDialog, boolean recreation) throws ParseException, PeerUnavailableException { haSipDialog.setMetaDataToReplicate(dialogMetaData, recreation); haSipDialog.setApplicationDataToReplicate(dialogAppData); final String contactStringified = (String) dialogMetaData.get(AbstractHASipDialog.CONTACT_HEADER); if(logger.isLoggingEnabled(StackLogger.TRACE_DEBUG)) { logger.logDebug("contactStringified " + contactStringified); } if(contactStringified != null) { Address contactAddress = SipFactory.getInstance().createAddressFactory().createAddress(contactStringified); ContactHeader contactHeader = SipFactory.getInstance().createHeaderFactory().createContactHeader(contactAddress); if(logger.isLoggingEnabled(StackLogger.TRACE_DEBUG)) { logger.logDebug("contactHeader " + contactHeader); logger.logDebug("contactURI " + contactHeader.getAddress().getURI()); } haSipDialog.setContactHeader(contactHeader); } }
final URI contactURI = contactHeaders.next().getAddress().getURI();
((SipURI)sipPresenceAgent.getConfiguration().getContactHeader().getAddress().getURI()).setParameter( sipPresenceAgent.getConfiguration().getFromUser(), sipPresenceAgent.getConfiguration().getFromHost());
/** * 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(); }