Sip11 RA dialog issue with TLS transport

58 views
Skip to first unread message

rayesh

unread,
Jan 19, 2009, 7:59:11 AM1/19/09
to mobicents-public
I am facing an issue of dialog getting terminated mid-session without
a BYE message being sent. The scenario is as follows:

Client A Mobicents Client B
| INVITE | |
|---------------------->| |
| | |
| 180 | |
|<----------------------| |
| 200 | |
|<----------------------| |
| |<-Dialog 1 |
| REFER | |
|---------------------->| |
| Refer-To (Client B) | |
| | |
| | |
| 202 | |
|<----------------------| |
| | INVITE |
| |---------------------->|
| Dialog 2->| |
| | 180 |
| |<----------------------|
| | 200 |
| NOTIFY |<----------------------|
|<----------------------| |
| | |
| | |

The problem is that the Dialog 2 in the sequence above gets terminated
mid session without any BYE from either the Mobicents or Client B.

06:59:07,351 INFO [SipResourceAdaptor] SIP Dialog -2cf6b86a:
11eeebfbe25:-7e33 terminated

This is getting called from the following call stack (traced by
throwing and catching an exception from within the
processDialogTerminated method).

org.mobicents.slee.resource.sip11.SipResourceAdaptor.processDialogTerminated
(SipResourceAdaptor.java)
gov.nist.javax.sip.EventScanner.deliverEvent(EventScanner.java:416)
gov.nist.javax.sip.SipProviderImpl.handleEvent(SipProviderImpl.java:
158)
gov.nist.javax.sip.stack.SIPTransactionStack.removeDialog
(SIPTransactionStack.java:622)
gov.nist.javax.sip.stack.SIPDialog$LingerTimer.runTask(SIPDialog.java:
194)
gov.nist.javax.sip.stack.SIPStackTimerTask.run(SIPStackTimerTask.java:
29)
java.util.TimerThread.mainLoop(Timer.java:512)
java.util.TimerThread.run(Timer.java:462)

The error is sporadic and happens only with TLS. I have modified the
SipResourceAdaptor to handle TLS transport as well, with required
changes to the run.bat to pass the necessary javax.net.ssl parameters.

From the call stack trace, it looks like the JAIN-SIP stack is
terminating the dialog, but I would like to get your opinion on what
could be the reason leading to the termination. As I mentioned, the
issue is sporadic, and the dialog would be usable at times, but
sometimes it gets terminated and no more messages could be sent inside
it.

Bartosz Baranowski

unread,
Jan 19, 2009, 8:45:44 AM1/19/09
to mobicent...@googlegroups.com
 Can You please post sipp scenario with which You get this or example code? I will digg on it asap.
I dont see any reason for this to happen right now. JSIP delivers DTE when dialog delete() method is called or dialog is terminated accordingly to SIP rfc. Seems like there is posibility that something is not matched against dialog and its state is not confirmed.
--
Bartosz Baranowski
JBoss R & D
==================================
Word of criticism meant to improve is always step forward.

rayesh

unread,
Jan 20, 2009, 12:17:06 AM1/20/09
to mobicents-public
Below is the example code used to handle the above mentioned scenario:
--------------------
sbb-jar.xml
--------------------
<event event-direction="Receive" initial-event="True">
<event-name>Invite</event-name>
<event-type-ref>
<event-type-name>javax.sip.message.Request.INVITE</
event-type-name>
<event-type-vendor>net.java.slee</event-type-vendor>
<event-type-version>1.2</event-type-version>
</event-type-ref>
<initial-event-select variable="ActivityContext"/>
<initial-event-selector-method-name>initialEventSelector</
initial-event-selector-method-name>
</event>

<event event-direction="Receive" initial-event="False">
<event-name>Refer</event-name>
<event-type-ref>
<event-type-name>javax.sip.Dialog.REFER</event-type-
name>
<event-type-vendor>net.java.slee</event-type-vendor>
<event-type-version>1.2</event-type-version>
</event-type-ref>
</event>

--------------------
Sbb.java
--------------------
/**
* Out-of-dialog INVITE
*/
public void onInvite(javax.sip.RequestEvent event,
ActivityContextInterface aci) {

Request request = event.getRequest();
ServerTransaction txn = event.getServerTransaction();

//Create a dialog
DialogActivity dialog = (DialogActivity)txn.getDialog();
if(null == dialog){
dialog = (DialogActivity)getSipProvider().getNewDialog(txn);
}

Response resp = getMessageFactory().createResponse(Response.OK,
request);

//Add contact header and SDP content into the response
//!!Not relevant for the discussion!!
//....

txn.sendResponse(resp);

//Attach to the dialog ACI

ActivityContextInterface dialogAci = getSipAcif
().getActivityContextInterface((DialogActivity) dialog);

logger.info("Attaching to dialog["+((DialogWrapper)
dialog).getActivityHandle()+"] ACI["+ dialogAci.toString()+"]");
dialogAci.attach(getSbbLocalObject());

dialog.terminateOnBye(true);

//Store the dialog in the CMP
setIncomingDialog(dialog);

}

/**
* REFER request
*/
public void onRefer(javax.sip.RequestEvent event,
ActivityContextInterface aci) {

Request referReq = event.getRequest();
ServerTransaction st = event.getServerTransaction();
DialogActivity incomingDialog = (DialogActivity)event.getDialog();

//Send 'accepted' to the requester
Response res = getMessageFactory().createResponse(Response.ACCEPTED,
request);
st.sendResponse(res);

//Send an immediate NOTIFY with 200 OK
Request notifyReq =incomingDialog.createRequest(Request.NOTIFY);

//Add Content, Event, SubscriptionState and Route headers to the
notifyReq
//!!May not be relevant for the discussion!!
//...

ClientTransaction clientTransaction = getSipProvider
().getNewClientTransaction(notifyReq);
incomingDialog.sendRequest(clientTransaction);

//Send an INVITE to the B-Party

//Construct a new Request from the parameters available in the
request
Request request = getRefereeRequest(referReq);

ClientTransaction ct = getSipProvider().getNewClientTransaction
(request);
ct.sendRequest();

DialogActivity outgoingDialog = (DialogActivity)getSipProvider
().getNewDialog(ct);

ActivityContextInterface outgoingDialogAci = getSipAcif
().getActivityContextInterface(outgoingDialog);

//Store the dialog in the CMP
setOutgoingDialog(outgoingDialog);

logger.info("Attaching to dialog["+((DialogWrapper)
outgoingDialog).getActivityHandle()+"] ACI["+
outgoingDialogAci.toString()+"]");
outgoingDialogAci.attach(getSbbLocalObject());

//Allowing the client to send clean-up messages within dialog after
a
//BYE is sent to it by the server.
outgoingDialog.terminateOnBye(false);

}
--------------------

Thanks for your response.

rayesh

unread,
Jan 20, 2009, 1:12:25 AM1/20/09
to mobicents-public
The response processing part is as follows:

--------------
sbb-jar.xml
--------------

<event event-direction="Receive" initial-event="False">
<event-name>SetupConfirmed</event-name>
<event-type-ref>
<event-type-name>javax.sip.message.Response.SUCCESS</
event-type-name>
<event-type-vendor>net.java.slee</event-type-vendor>
<event-type-version>1.2</event-type-version>
</event-type-ref>
</event>

--------------
Sbb.java
--------------

public void onSetupConfirmed(javax.sip.ResponseEvent event,
ActivityContextInterface aci) {

Response response = event.getResponse();
CSeqHeader cseq = SIPUtility.getCSeqHeader(response);

//Handle the response for the 200 OK of INVITE
if(null!=event.getDialog() && cseq.getMethod().equalsIgnoreCase
(Request.INVITE)){


int statusCode = response.getStatusCode();

//Retrieve the dialogs from the CMP
Dialog incomingDialog = getIncomingDialog();
Dialog outgoingDialog = getOutgoingDialog();

//Send an ACK
if(null!=outgoingDialog && (statusCode > 199 && statusCode < 300)){
Request ackRequest = outgoingDialog.createAck(cSeq.getSeqNumber
());

//Add a Route: header
Address toAddress = outgoingDialog.getRemoteParty();
RouteHeader route = getRouteHeader(toAddress);
ackRequest.addHeader(route);

outgoingDialog.sendAck(ackRequest);

}

if(incomingDialog!=null){
//Inform originator of the acceptance
//of the request by the referee

Request notifyReq =incomingDialog.createRequest(method);

//Add Content, Event, SubscriptionState and Route headers to the
notifyReq
//!!May not be relevant for the discussion!!
//...

ClientTransaction clientTransaction = getSipProvider
().getNewClientTransaction(notifyReq);

incomingDialog.sendRequest(clientTransaction);

}
}

}

--------------

rayesh

unread,
Jan 27, 2009, 1:34:47 AM1/27/09
to mobicents-public
Any news on this?
Please let me know if you need any more information from my side. I
could create the scenario again and see the problem recurring. This
time, I sent a MESSAGE message within the dialog (Dialog 2 in the
sequence) and as soon as the 200 OK for the message is processed, the
DTE was fired.
> ...
>
> read more »

Bartosz Baranowski

unread,
Jan 27, 2009, 3:28:16 AM1/27/09
to mobicent...@googlegroups.com
Had only time for brief look, sipp scenario file would be mostly helpful. I didnt a place where dialog would be DTEd (only possible place is place where we check for forks, but fot that to check I need scenario)

rayesh

unread,
Jan 27, 2009, 5:24:49 AM1/27/09
to mobicents-public
Unfortunately, I do not use sipp as yet. But I can try to create one
if it will help.
> ...
>
> read more »

Bartosz Baranowski

unread,
Jan 27, 2009, 5:41:34 PM1/27/09
to mobicent...@googlegroups.com
Yes please, content of messages woudl be mostly helpfull. Also please attach whole sbb-jar.xml

Bartosz Baranowski

unread,
Jan 27, 2009, 5:41:56 PM1/27/09
to mobicent...@googlegroups.com
On Tue, Jan 27, 2009 at 11:41 PM, Bartosz Baranowski <bara...@gmail.com> wrote:
Yes please, content of messages woudl be mostly helpfull. Also please attach whole sbb-jar.xml
Content atleast or sipp scenario :)

rayesh

unread,
Feb 20, 2009, 1:01:02 AM2/20/09
to mobicents-public
My last post on this topic seems to have disappeared, so posting
again. Please ignore if it is a repeat.

Below are the SIPp scenarios for the client parts:

=================
Client A
-----------------
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">

<scenario name="conference">

<send retrans="500">
<![CDATA[

INVITE sip:co...@sip.com SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=
[branch]
Max-Forwards: 70
From: sip:ua...@sip.com;tag=[call_number]
To: sip:co...@sip.com
Contact: sip:ua...@sip.com
Call-ID: [call_id]
CSeq: [cseq] INVITE
Route: <sip:[remote_ip]:[remote_port];transport=[transport];lr>
Allow: INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, SUBSCRIBE,
NOTIFY, REFER
Supported: 100rel
Content-Length: [len]
]]>
</send>

<recv response="100" optional="true">
</recv>

<recv response="302">
<action>
<ereg regexp="sip:([^;>]*)"
search_in="hdr"
header="Contact:"
check_it="true"
assign_to="2">
</ereg>
</action>

</recv>
<pause milliseconds="300"/>



<send>
<![CDATA[

ACK sip:co...@sip.com SIP/2.0
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
[last_Route:]
Content-Length: [len]
]]>
</send>

<send retrans="500">
<![CDATA[

INVITE [$2] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=
[branch]
Max-Forwards: 70
From: sip:ua...@sip.com;tag=[call_number]
To: [$2]
Contact: <sip:ua...@sip.com>
Call-ID: [call_id]
CSeq: [cseq] INVITE
Route: <sip:[remote_ip]:[remote_port];transport=[transport];lr>
Allow: INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, SUBSCRIBE,
NOTIFY, REFER
Supported: 100rel
Content-Length: [len]

v=0
o=- 3443959882 3443959882 IN IP[local_ip_type] [local_ip]
s=pjmedia
c=IN IP[local_ip_type] [local_ip]
t=0 0
m=audio 4000 RTP/AVP 0 8 101
a=rtcp:4001 IN IP[local_ip_type] [local_ip]
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
]]>
</send>
<recv response="100" optional="true">
</recv>
<recv response="200">
<action>
<ereg regexp="tag=.*"
search_in="hdr"
header="From:"
check_it="true"
assign_to="3">
</ereg>
<ereg regexp="tag=.*"
search_in="hdr"
header="To:"
check_it="true"
assign_to="4">
</ereg>
</action>
</recv>
<send>
<![CDATA[

ACK sip:co...@sip.com SIP/2.0
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
[last_Route:]
Content-Length: [len]
]]>
</send>

<send retrans="500">
<![CDATA[

REFER [$2] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=
[branch]
Max-Forwards: 70
[last_From:]
[last_To:]
Contact: <sip:ua...@sip.com>
[last_Call-ID:]
CSeq: [cseq] REFER
Route: <sip:[remote_ip]:[remote_port];transport=[transport];lr>
Event: refer
Expires: 3600
Accept: message/sipfrag;version=2.0
Allow-Events: presence, conference, refer
Refer-To: sip:ua...@sip.com;method=INVITE
Content-Length: [len]
]]>
</send>
<recv response="202">
</recv>
<recv request="NOTIFY">
</recv>

<send>
<![CDATA[

SIP/2.0 200 OK
[last_Via:]
[last_Call-ID:]
[last_From:]
[last_To:]
[last_CSeq:]
Contact: <sip:ua...@sip.com>
Allow: INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, SUBSCRIBE,
NOTIFY, REFER
Supported: 100rel
Content-Length: [len]
]]>
</send>

<pause milliseconds="1000"/>

<send retrans="500">
<![CDATA[

MESSAGE [$2] SIP/2.0
[last_Via:]
Max-Forwards: 70
From:<sip:ua...@sip.com>;[$3]
To:<[$2]>;[$4]
[last_Call-ID:]
CSeq: [cseq] MESSAGE
Route: <sip:[remote_ip]:[remote_port];transport=[transport];lr>
Content-Type: text/plain
Content-Length: [len]

Test message

]]>
</send>
<recv response="200">
</recv>
</scenario>
=================

=================
Client B
-----------------
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">

<scenario name="conference">

<recv request="INVITE">
</recv>
<send>
<![CDATA[

SIP/2.0 180 Ringing
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0

]]>
</send>


<send>
<![CDATA[

SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: [len]

v=0
o=- 3443959886 3443959887 IN IP[local_ip_type] [local_ip]
s=pjmedia
c=IN IP[local_ip_type] [local_ip]
t=0 0
m=audio 4000 RTP/AVP 101
a=rtcp:4001 IN IP[local_ip_type] [local_ip]
a=sendrecv
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
]]>
</send>
<recv request="ACK">
</recv>
<recv request="MESSAGE">
</recv>

<send>
<![CDATA[

SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
Content-Length: [len]
]]>
</send>
</scenario>
=================

SDP errors, if any, can be ignored.
Thanks for you support.

Bartosz Baranowski

unread,
Feb 20, 2009, 4:22:43 AM2/20/09
to mobicent...@googlegroups.com
Seems like it didnt go through, this one is here, I will test it.

Rajesh R

unread,
Mar 10, 2009, 5:21:14 AM3/10/09
to mobicent...@googlegroups.com
Hi,
 
Is there any result on this? 
 
Meanwhile, I have another problem with the SIP TLS transport. When a client gets disconnected from the server due to network issues or any other abnormal termination, the SIP RA tries to send the message over the TLS channel and this is a blocking call and all other SBBs/activities keep waiting for the connect to timeout before any other message can be delivered.  This issue can be tested with the presence server.
 
The following is the error trace in a scenario as described above.  The issue is not really with the error trace, but the SIP RA getting blocked. 
 
05:05:54,484 ERROR [SubscriptionControlSbb] failed to notify subscriber
javax.sip.SipException: error sending message
        at gov.nist.javax.sip.stack.SIPDialog.sendRequest(SIPDialog.java:1901)
        at org.mobicents.slee.resource.sip11.wrappers.DialogWrapper.sendRequest(DialogWrapper.java:343)
        at org.mobicents.slee.sipevent.server.subscription.sip.SipSubscriberNotificationHandler.createAndSendNotify(SipSubscriberNotificationHandler.java:169)
        at org.mobicents.slee.sipevent.server.subscription.sip.RemoveSipSubscriptionHandler.removeSipSubscription(RemoveSipSubscriptionHandler.java:60)
        at org.mobicents.slee.sipevent.server.subscription.sip.SipSubscriptionHandler.processRequest(SipSubscriptionHandler.java:220)
        at org.mobicents.slee.sipevent.server.subscription.SubscriptionControlSbb.onSubscribeInDialog(SubscriptionControlSbb.java:269)
        at sun.reflect.GeneratedMethodAccessor378.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.mobicents.slee.runtime.sbbentity.SbbEntity.invokeEventHandler(SbbEntity.java:871)
        at org.mobicents.slee.runtime.EventRouterImpl.routeQueuedEvent(EventRouterImpl.java:892)
        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:885)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.IOException: Timeout aquiring IO SEM
        at gov.nist.javax.sip.stack.IOHandler.sendBytes(IOHandler.java:218)
        at gov.nist.javax.sip.stack.TLSMessageChannel.sendMessage(TLSMessageChannel.java:309)
        at gov.nist.javax.sip.stack.MessageChannel.sendMessage(MessageChannel.java:233)
        at gov.nist.javax.sip.stack.SIPTransaction.sendMessage(SIPTransaction.java:738)
        at gov.nist.javax.sip.stack.SIPClientTransaction.sendMessage(SIPClientTransaction.java:486)
        at gov.nist.javax.sip.stack.SIPDialog.sendRequest(SIPDialog.java:1886)
        ... 15 more
----
 
05:05:55,218 ERROR [SubscriptionControlSbb] failed to notify subscriber
javax.sip.SipException: error sending message
        at gov.nist.javax.sip.stack.SIPDialog.sendRequest(SIPDialog.java:1901)
        at org.mobicents.slee.resource.sip11.wrappers.DialogWrapper.sendRequest(DialogWrapper.java:343)
        at org.mobicents.slee.sipevent.server.subscription.sip.SipSubscriberNotificationHandler.notifySipSubscriber(SipSubscriberNotificationHandler.java:65)
        at org.mobicents.slee.sipevent.server.subscription.SubscriptionControlSbb.notifySubscribers(SubscriptionControlSbb.java:469)
        at sun.reflect.GeneratedMethodAccessor380.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.mobicents.slee.container.deployment.interceptors.SbbLocalObjectInterceptor.invokeAndReturnObject(SbbLocalObjectInterceptor.java:72)
        at org.mobicents.slee.container.deployment.interceptors.SbbLocalObjectInterceptor.invokeAndReturnvoid(SbbLocalObjectInterceptor.java:113)
        at org.mobicents.slee.sipevent.server.subscription.SubscriptionControlSbbLocalObjectImpl.notifySubscribers(SubscriptionControlSbbLocalObjectImpl.java)
        at org.mobicents.slee.sippresence.server.publication.PresencePublicationControlSbb.notifySubscribers(PresencePublicationControlSbb.java:113)
        at sun.reflect.GeneratedMethodAccessor379.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.mobicents.slee.container.deployment.interceptors.SbbLocalObjectInterceptor.invokeAndReturnObject(SbbLocalObjectInterceptor.java:72)
        at org.mobicents.slee.container.deployment.interceptors.SbbLocalObjectInterceptor.invokeAndReturnvoid(SbbLocalObjectInterceptor.java:113)
        at org.mobicents.slee.sipevent.server.publication.ImplementedPublicationControlSbbLocalObjectImpl.notifySubscribers(ImplementedPublicationControlSbbLocalObjectImpl.java)
        at org.mobicents.slee.sipevent.server.publication.PublicationControlSbb.modifyPublication(PublicationControlSbb.java:526)
        at sun.reflect.GeneratedMethodAccessor400.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.mobicents.slee.container.deployment.interceptors.SbbLocalObjectInterceptor.invokeAndReturnObject(SbbLocalObjectInterceptor.java:72)
        at org.mobicents.slee.container.deployment.interceptors.SbbLocalObjectInterceptor.invokeAndReturnvoid(SbbLocalObjectInterceptor.java:113)
        at org.mobicents.slee.sipevent.server.publication.PublicationControlSbbLocalObjectImpl.modifyPublication(PublicationControlSbbLocalObjectImpl.java)
        at org.mobicents.slee.sipevent.server.publication.SipPublicationControlSbb.onPublish(SipPublicationControlSbb.java:222)
        at sun.reflect.GeneratedMethodAccessor386.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.mobicents.slee.runtime.sbbentity.SbbEntity.invokeEventHandler(SbbEntity.java:871)
        at org.mobicents.slee.runtime.EventRouterImpl.routeQueuedEvent(EventRouterImpl.java:892)
        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:885)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.ConnectException: Connection timed out: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:519)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:550)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:417)
        at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:138)
        at gov.nist.core.net.DefaultNetworkLayer.createSSLSocket(DefaultNetworkLayer.java:113)
        at gov.nist.javax.sip.stack.IOHandler.sendBytes(IOHandler.java:233)
        at gov.nist.javax.sip.stack.TLSMessageChannel.sendMessage(TLSMessageChannel.java:309)
        at gov.nist.javax.sip.stack.MessageChannel.sendMessage(MessageChannel.java:233)
        at gov.nist.javax.sip.stack.SIPTransaction.sendMessage(SIPTransaction.java:738)
        at gov.nist.javax.sip.stack.SIPClientTransaction.sendMessage(SIPClientTransaction.java:486)
        at gov.nist.javax.sip.stack.SIPDialog.sendRequest(SIPDialog.java:1886)
        ... 34 more


From: mobicent...@googlegroups.com [mailto:mobicent...@googlegroups.com] On Behalf Of Bartosz Baranowski
Sent: Friday, February 20, 2009 14:53
To: mobicent...@googlegroups.com
Subject: [mobicents-public] Re: Sip11 RA dialog issue with TLS transport

Bartosz Baranowski

unread,
Mar 11, 2009, 7:39:00 AM3/11/09
to mobicent...@googlegroups.com
Hi Rajesh, looks like my email ended up drafts. I was not able to replicate this scenario. Could You provide me with detailed steps/service and patch with changes You made to ra ?

Rajesh R

unread,
Mar 16, 2009, 6:36:15 AM3/16/09
to mobicent...@googlegroups.com
Hi,
Please find attached, the patch of the changes I had made to the SIP RA.
 
The following are the steps that I followed in TLS enabling the mobicents server:
  • Created a self signed certificate and a keystore. saved the keystore in the mobicents\bin directory
  • Added the following additional parameters to the run.bat
    • set JAVA_OPTS=%JAVA_OPTS% -Djavax.net.ssl.keyStore=myKeystore -Djavax.net.ssl.keyStorePassword=123456
where myKeystore is the name of the keystore I created and 123456 is the password of the keystore
  • started the server with the modified run.bat
PS: Although I had sent you the SIPp scenario, I was not able to execute it using the TLS transport as I was having some problem with specifying the private key/certificate in SIPp.
 
If you would like to take up the issue with the SIP RA getting blocked because of TLS connection separately, I can start a new mail thread for the same.

Thanks,
Rajesh


From: mobicent...@googlegroups.com [mailto:mobicent...@googlegroups.com] On Behalf Of Bartosz Baranowski
Sent: Wednesday, March 11, 2009 17:09
sip-tls.patch

Bartosz Baranowski

unread,
Mar 17, 2009, 11:37:16 AM3/17/09
to mobicent...@googlegroups.com
Hi Rajesh
Scenario You have sent me is a bit different than one mentioned. Bit confusing I might say. Can You send me service that You run it against?
There is a way to plug tls into sipp, trying it now so once I get service I can test.
Took some time to look into jsip and possible causes to remove dialog are:
 - transaction is not matched
- timeout - provisional response/or transaction
- i/o exception
-....

It would be helpfull if You could provide me with stack trace of setState() from jsip dialog.

Rajesh R

unread,
Jun 3, 2009, 8:31:48 AM6/3/09
to mobicent...@googlegroups.com
Hello,

The error with the "IOException: Timeout aquiring IO SEM" seems to be a bug in the jain-sip.
In the gov.nist.javax.sip.stack.IOHandler class, a Semaphore is used for concurrent sending of requests and responses (in case of TCP/TLS transport).  The semaphore is instantiated one per IOHandler object, but I think it should be used on a per user basis, otherwise an issue in a particular client socket can lead to timing out of all the request irrespective of whether the message was to the problematic client or not.

Request the experts to look in to the above issue and confirm the bug.

Thanks,
Rajesh

Jean Deruelle

unread,
Jun 8, 2009, 9:11:05 AM6/8/09
to mobicent...@googlegroups.com
Bart, could you try to reproduce and file a bug on jain sip for this ?

Bartosz Baranowski

unread,
Jun 8, 2009, 9:13:33 AM6/8/09
to mobicent...@googlegroups.com
Ok

Rajesh R

unread,
Jun 9, 2009, 3:36:14 AM6/9/09
to mobicent...@googlegroups.com
I have a patch that works for me. I am not sure about the coding standards for jsip, though.  I can submit it once the bug is confirmed.

-rajesh

Jean Deruelle

unread,
Jun 9, 2009, 3:42:00 AM6/9/09
to mobicent...@googlegroups.com
oh excellent, there is 2 ways :

either you open an issue on jain sip project (and provide a sandboxed test case reproducing the issue, might be optional if this is difficult to reproduce) and attach your patch

Or  

attach your patch here and we will escalate the issue into jain sip ourselves.

In any case, we will try to acknowledge your contribution to jain sip.
also since jain sip is public domain (no license, it free of use, redistribution, etc...), you may need to acknowledge that you aware of that in contributing your patch

Thanks 
Jean

Rajesh R

unread,
Jun 9, 2009, 6:04:12 AM6/9/09
to mobicent...@googlegroups.com
I am attaching the patch with this mail. It would be great if you can follow it up with jsip.
Regarding the licensing acknowledgments, please let me know if there is any formal procedure. Otherwise, I acknowledge here that the change submitted is in public domain as jsip.

Cheers!
Rajesh
IOHandler.java.patch
Reply all
Reply to author
Forward
0 new messages