Hi All,
What I am trying to do is, at a particular instance of System time, call up a set of people together and get them connected to a conference.
However, my this particular piece of code:
public void onConnectionHalfOpen(MsConnectionEvent event,
ActivityContextInterface aci) {
try {
MsConnection msConnection = event.getConnection();
String sdp = msConnection.getLocalDescriptor();
this.setPREndpointName(msConnection.getEndpoint().getLocalName());
log.info(" connectionHalfOpen " + this.getPREndpointName() + " "+ this.toString());
Request request = this.buildInvite(this.getCalleeAddress(), this
.getCallerAddress(), sdp.getBytes(), count.getAndIncrement(), null);
ClientTransaction ct = sipProvider.getNewClientTransaction(request);
this.setCallerClientTransaction(ct);
Header h = ct.getRequest().getHeader(CallIdHeader.NAME);
String calleeCallId = ((CallIdHeader) h).getCallId();
Dialog dialog = ct.getDialog();
if (dialog != null && log.isDebugEnabled()) {
log
.debug("Obtained dialog from ClientTransaction : automatic dialog support on");
}
if (dialog == null) {
// Automatic dialog support turned off
try {
dialog = sipProvider.getNewDialog(ct);
if (log.isDebugEnabled()) {
log
.debug("Obtained dialog for INVITE request to callee with getNewDialog");
}
} catch (Exception e) {
log.error("Error getting dialog", e);
if (log.isDebugEnabled()) {
log
.debug("Obtained dialog in onThirdPCCTriggerEvent : callId = "
+ dialog.getCallId().getCallId());
}
// Get activity context from factory
ActivityContextInterface sipACI = sipACIF
.getActivityContextInterface((DialogActivity) dialog);
sipACI.attach(this.sbbContext.getSbbLocalObject());
this.setDialogACI(sipACI);
ct.sendRequest();
}
Throws the above mentioned error, it being: RuntimeException and it fails to get a Dialog. Here's a trace:
01:09:00,243 ERROR [DialoutSbb] Error getting dialog
java.lang.RuntimeException: Sequence number should not decrease !
at gov.nist.javax.sip.stack.SIPDialog.setLocalSequenceNumber(SIPDialog.java:1268)
at gov.nist.javax.sip.stack.SIPDialog.addTransaction(SIPDialog.java:1150)
at gov.nist.javax.sip.stack.SIPDialog.<init>(SIPDialog.java:330)
at gov.nist.javax.sip.stack.SIPTransactionStack.createDialog(SIPTransactionStack.java:550)
at gov.nist.javax.sip.SipProviderImpl.getNewDialog(SipProviderImpl.java:837)
at org.mobicents.slee.resource.sip11.SleeSipProviderImpl.getNewDialog(SleeSipProviderImpl.java:373)
at org.mobicents.slee.resource.sip11.SleeSipProviderImpl.getNewDialog(SleeSipProviderImpl.java:364)
at org.mobite.mucc.slee.callcontrol.dialout.DialoutSbb.onConnectionHalfOpen(DialoutSbb.java:174)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.mobicents.slee.runtime.sbbentity.SbbEntity.invokeEventHandler(SbbEntity.java:873)
at org.mobicents.slee.runtime.EventRouterImpl.routeQueuedEvent(EventRouterImpl.java:933)
at org.mobicents.slee.runtime.EventRouterImpl.access$100(EventRouterImpl.java:64)
at org.mobicents.slee.runtime.EventRouterImpl$EventExecutor.run(EventRouterImpl.java:121)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
And this is how buildInvite() looks.... public Request buildInvite(Address toAddress, Address fromAddress,
byte[] content, int cSeq, String callId)
throws java.text.ParseException, InvalidArgumentException {
Request request = null;
try {
// From Header:
FromHeader fromHeader = headerFactory.createFromHeader(fromAddress,
generateTag());
LocationSbbLocalObject handler = getLocationSbb();
Map<String, RegistrationBinding> bindings = handler
.getBindings(toAddress.toString());
String tempContactAddress = null;
for (RegistrationBinding r : bindings.values()) {
if (r.getSipAddress().equals(toAddress.toString())) {
tempContactAddress = r.getContactAddress();
log.info("did it =" + tempContactAddress);
break;
}
}
Address contactAddress = addressFactory
.createAddress(tempContactAddress);
// To header:
ToHeader toHeader = headerFactory.createToHeader(toAddress, null);
CSeqHeader cseqHeader = headerFactory.createCSeqHeader((long) cSeq,
Request.INVITE);
// Create the Via header and add to an array list
ArrayList viaHeadersList = new ArrayList();
viaHeadersList.add(createLocalViaHeader());
MaxForwardsHeader maxForwardsHeader = headerFactory
.createMaxForwardsHeader(70);
final URI requestURI = convertAddressToSipURI(contactAddress);
/*
* Create the request
*/
CallIdHeader callIdHeader = sipProvider.getNewCallId();
if ((callId != null) && (callId.trim().length() > 0)) {
callIdHeader.setCallId(callId);
}
request = messageFactory.createRequest(requestURI, Request.INVITE,
callIdHeader, cseqHeader, fromHeader, toHeader,
viaHeadersList, maxForwardsHeader);
if (content != null) {
setContent(request, "application", "sdp", content);
}
ContactHeader contactHeader = createLocalContactHeader();
request.setHeader(contactHeader);
if (log.isDebugEnabled()) {
log.debug("Contact Header = " + contactHeader);
}
} catch (CreateException ce) {
ce.printStackTrace();
} catch (LocationServiceException e) {
e.printStackTrace();
}
return request;
}
Please can someone advise me as to what's the issue about and can I get it fixed?
Any help would be appreciated.
Thanks and regards,
Raziya