本文整理了Java中javax.sip.message.Request.addHeader
方法的一些代码示例,展示了Request.addHeader
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.addHeader
方法的具体详情如下:
包路径:javax.sip.message.Request
类名称:Request
方法名:addHeader
暂无
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
headerName, value);
if(! JainSipUtils.SINGLETON_HEADER_NAMES.contains(header.getName())) {
newRequest.addHeader(header);
} else {
newRequest.setHeader(header);
代码示例来源:origin: org.mobicents.examples/sip11-loadtest-with-dialogs-sbb
public void onTimerEvent(TimerEvent event, ActivityContextInterface aci) {
try {
DialogActivity dialog = (DialogActivity)aci.getActivity();
Request request = dialog.createRequest(Request.BYE);
request.addHeader(getContactHeader());
ClientTransaction clientTransaction = sipFactoryProvider.getNewClientTransaction(request);
clientTransaction.sendRequest();
} catch (Exception ex) {
ex.printStackTrace();
}
}
代码示例来源:origin: org.mobicents.servers.jainslee.enablers/sip-subscription-client-sbb
private void fillSubscribeRequest(Request request, SubscriptionData subscriptionData) throws ParseException {
EventHeader eventHeader = this.headerFactory.createEventHeader(subscriptionData.getEventPackage());
if(subscriptionData.getEventParameters()!=null) {
for(EventPackageParameter parameter : subscriptionData.getEventParameters()) {
eventHeader.setParameter(parameter.getName(), parameter.getValue());
}
}
request.addHeader(eventHeader);
if(subscriptionData.getAcceptedContentTypes()!=null) {
for(ContentType contentType : subscriptionData.getAcceptedContentTypes()) {
request.addHeader(headerFactory.createAcceptHeader(contentType.getType(), contentType.getSubType()));
}
}
if (subscriptionData.isSupportResourceLists()) {
// add necessary headers
request.addHeader(headerFactory.createAcceptHeader("application", "rlmi+xml"));
request.addHeader(headerFactory.createAcceptHeader("multipart", "related"));
request.addHeader(headerFactory.createSupportedHeader("eventlist"));
}
}
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
javax.sip.address.Address javaxAddress = i.next();
RouteHeader routeHeader = new Route((gov.nist.javax.sip.address.AddressImpl) javaxAddress);
request.addHeader(routeHeader);
代码示例来源:origin: org.apache.camel/camel-sip
request.addHeader(getEventHeader());
request.addHeader(getExpiresHeader());
request.addHeader(getContactHeader());
request.addHeader(getExtensionHeader());
代码示例来源:origin: org.mobicents.examples/converged-demo-callcontrol-sbb
request.addHeader(sipUtils.createLocalViaHeader());
request.addHeader(sipUtils.createLocalContactHeader());
} catch (ParseException e) {
代码示例来源:origin: org.jitsi/jain-sip-ri-ossonly
public void setAuthenticationHeaders(Request request) {
SIPRequest sipRequest = (SIPRequest) request;
String callId = sipRequest.getCallId().getCallId();
request.removeHeader(AuthorizationHeader.NAME);
Collection<AuthorizationHeader> authHeaders = this.cachedCredentials
.getCachedAuthorizationHeaders(callId);
if (authHeaders == null) {
if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG))
logger.logDebug(
"Could not find authentication headers for " + callId);
return;
}
for (AuthorizationHeader authHeader : authHeaders) {
request.addHeader(authHeader);
}
}
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
newRequest.addHeader(newContactHeader);
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
ackRequest.addHeader(routeHeader);
代码示例来源:origin: org.mobicents.servers.jainslee.enablers/sip-subscription-client-sbb
request.addHeader(expiresHeader);
request.addHeader(routeHeader);
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
ViaHeader viaHeader = JainSipUtils.createViaHeader(
sipFactoryImpl.getSipNetworkInterfaceManager(), prackRequest, branch, session.getOutboundInterface());
prackRequest.addHeader(viaHeader);
prackRequest.addHeader(routeHeader);
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
((javax.sip.address.SipURI)routeURI).setLrParam();
request.addHeader(routeHeader);
sipURI.setParameter("modifier", "route_back");
Header routeHeader = SipFactoryImpl.headerFactory.createHeader(RouteHeader.NAME, sipURI.toString());
request.addHeader(routeHeader);
request.addHeader(routeHeader);
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
RouteHeader routeHeader = sipFactoryImpl.getHeaderFactory().createRouteHeader(
sipFactoryImpl.getAddressFactory().createAddress(routeURI));
request.addHeader(routeHeader);
} catch (ParseException e) {
logger.error("Impossible to parse the following popped URI " + poppedURI, e);
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
ViaHeader viaHeader = JainSipUtils.createViaHeader(
getSipNetworkInterfaceManager(), newRequest, branch, null);
newRequest.addHeader(viaHeader);
newRequest.addHeader(contactHeader);
代码示例来源:origin: org.jitsi/jain-sip-ri-ossonly
.createRequest(Request.BYE);
if (MessageFactoryImpl.getDefaultUserAgentHeader() != null) {
byeRequest.addHeader(MessageFactoryImpl
.getDefaultUserAgentHeader());
reasonHeader
.setText("Timed out waiting to send ACK " + dialogId);
byeRequest.addHeader(reasonHeader);
ClientTransaction byeCtx = SIPDialog.this
.getSipProvider().getNewClientTransaction(
代码示例来源:origin: org.jitsi/jain-sip-ri-ossonly
.createRequest(Request.BYE);
if (MessageFactoryImpl.getDefaultUserAgentHeader() != null) {
byeRequest.addHeader(MessageFactoryImpl
.getDefaultUserAgentHeader());
reasonHeader.setCause(1024);
reasonHeader.setText("Timed out waiting to re-INVITE");
byeRequest.addHeader(reasonHeader);
ClientTransaction byeCtx = SIPDialog.this
.getSipProvider().getNewClientTransaction(
代码示例来源:origin: org.apache.camel/camel-sip
request.addHeader(configuration.getEventHeader());
subscriberDialog = subscriberTransactionId.getDialog();
代码示例来源:origin: org.jitsi/jain-sip-ri-ossonly
if ( reoriginatedRequest.getHeader(headerName) == null) {
ListIterator<SIPHeader> iterator = challengedRequest.getHeaders(headerName);
while (iterator.hasNext()) { reoriginatedRequest.addHeader(iterator.next()); }
authorization, cacheTime);
reoriginatedRequest.addHeader(authorization);
代码示例来源:origin: org.mobicents.servlet.sip/sip-servlets-impl
request.addHeader(contactHeader);
代码示例来源:origin: org.apache.camel/camel-sip
notifyRequest.addHeader(sstate);
notifyRequest.setHeader(eventHeader);
notifyRequest.setHeader(sipPresenceAgent.getConfiguration().getContactHeader());
内容来源于网络,如有侵权,请联系作者删除!