Problem with creation of Contact header in case calls witn "sips" URI scheme

36 views
Skip to first unread message

Олег Мигрин

unread,
Dec 16, 2010, 10:39:31 AM12/16/10
to mobicents-public
Hello!

In case TLS calls and using sips-like URI's I've met the problem with
Contact header:

Caused by: java.text.ParseException: Scheme for contact should be
sips:sip:nu...@192.168.252.35:5060
at gov.nist.javax.sip.message.SIPRequest.checkHeaders(SIPRequest.java:
321)
at
gov.nist.javax.sip.SipProviderImpl.getNewClientTransaction(SipProviderImpl.java:
300)

This is happening because we create Contact header in
AddressFactoryImpl(jain-sip-1.2.159):
...
line 120: StringBuilder uriString = new StringBuilder("sip:");
...

This is pretty upsetting and we're stuck here.
How we can managed with this?

Actually, I cannot reproduce this issue when running your examples
(I've tried your "call-forwarding" servlet).

---------------------------
Thanks for reply! Oleg Migrin.

Jean Deruelle

unread,
Dec 16, 2010, 10:44:46 AM12/16/10
to mobicent...@googlegroups.com
Can you file an issue at http://code.google.com/p/mobicents/issues/entry?template=Mobicents%20Sip%20Servlets%20Template and attach a simple application reproducing the problem ?

Also can you provide feedback on issue http://code.google.com/p/mobicents/issues/detail?id=2206 ?

Thanks
Jean

Олег Мигрин

unread,
Dec 17, 2010, 12:05:34 PM12/17/10
to mobicents-public
We have pretty complex application so I need some time to localize
steps for reproducing.
--------------------
Oleg Migrin

Jean Deruelle

unread,
Dec 17, 2010, 12:07:26 PM12/17/10
to mobicent...@googlegroups.com
You can post the code creating the request ?

Олег Мигрин

unread,
Dec 20, 2010, 7:55:37 AM12/20/10
to mobicents-public
Here is the part of SipServlet:
----------------------------------------------------------------------------------------------
public class OurSipServlet extends SipServlet
{
....

@Override
public void init(ServletConfig servletConfig) throws
ServletException
{
//Stop gather statistics by Mobicents
super.init(servletConfig);
SipServletsHelper.sipFactory = sipFactory;
}

@Override
protected void doRequest(SipServletRequest request) throws
ServletException, IOException
{
final String method = request.getMethod(); // Here we can
recieve exception in case "Watch" of
a request object in IDE(IntelliJ in my case)

}

....
}

------------------stacktrace below:
----------------------------------------------------------------------------
ERROR PipelineThread-435
com.avistar.callcontrol.sip.CallControlSipServlet.doRequest(CallControlSipServlet.java:
165) - java.lang.IllegalStateException: Error sending request INVITE
sips:cal...@192.168.252.35:5072;transport=TLS SIP/2.0
From: "caller" <sips:caller@omigrin:
5061>;tag=95003921_c71fdaf2_de3b0f53-483a-4d3e-a574-611ea44de391
To: "callee" <sips:callee@omigrin:5061>
CSeq: 1 INVITE
Route: <sips:192.168.252.35:5061;lr>
Max-Forwards: 69
Subject: Performance Test
Content-Type: application/sdp
Call-ID: 7c634c157485ca94...@192.168.252.35
Contact: <sip:nu...@192.168.252.35:5060>;transport=TLS
Avistar-From-Address: 192.168.252.35
Avistar-Call-Control-Originator-URI: sips:cal...@192.168.252.35:5071
Avistar-To-Address: 192.168.252.35
Via: SIP/2.0/UDP 192.168.252.35:5060;branch=z9hG4bKde3b0f53-483a-4d3e-
a574-611ea44de391_c71fdaf2_12718782747233
Content-Length: 141


v=0
o=user1 53655765 2353687637 IN IP4 192.168.252.35
s=-
c=IN IP4 192.168.252.35
t=0 0
m=audio 6001 RTP/AVP 0
a=rtpmap:0 PCMU/8000


callcontrol.sip.CallControlSipServlet.doRequest(CallControlSipServlet.java:
149)
at javax.servlet.sip.SipServlet.service(SipServlet.java:325)
at
org.mobicents.servlet.sip.core.dispatchers.MessageDispatcher.callServlet(MessageDispatcher.java:
235)
at org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher
$InitialDispatchTask.dispatch(InitialRequestDispatcher.java:713)
at
org.mobicents.servlet.sip.core.dispatchers.DispatchTask.dispatchAndHandleExceptions(DispatchTask.java:
55)
at
org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher.dispatchInsideContainer(InitialRequestDispatcher.java:
422)
at
org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher.dispatchMessage(InitialRequestDispatcher.java:
289)
at
org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl.processRequest(SipApplicationDispatcherImpl.java:
694)
at gov.nist.javax.sip.EventScanner.deliverEvent(EventScanner.java:
230)
at
gov.nist.javax.sip.SipProviderImpl.handleEvent(SipProviderImpl.java:
196)
at gov.nist.javax.sip.DialogFilter.processRequest(DialogFilter.java:
1303)
at
gov.nist.javax.sip.stack.SIPServerTransaction.processRequest(SIPServerTransaction.java:
847)
at
gov.nist.javax.sip.stack.TLSMessageChannel.processMessage(TLSMessageChannel.java:
613)
at
gov.nist.javax.sip.parser.PipelinedMsgParser.run(PipelinedMsgParser.java:
470)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.sip.TransactionUnavailableException: Scheme for
gov.nist.javax.sip.SipProviderImpl.getNewClientTransaction(SipProviderImpl.java:
304)
at
org.mobicents.servlet.sip.message.SipServletRequestImpl.send(SipServletRequestImpl.java:
1133)
... 21 more
Caused by: java.text.ParseException: Scheme for contact should be
sips:sip:nu...@192.168.252.35:5060
at gov.nist.javax.sip.message.SIPRequest.checkHeaders(SIPRequest.java:
321)
at
gov.nist.javax.sip.SipProviderImpl.getNewClientTransaction(SipProviderImpl.java:
302)
--------------------------------------------------------------------------------------------------------------------------------------





Vladimir Ralev

unread,
Dec 20, 2010, 8:18:47 AM12/20/10
to mobicent...@googlegroups.com
I was able to reproduce the problem. I think we can include it in 1.5

Олег Мигрин

unread,
Dec 20, 2010, 8:24:50 AM12/20/10
to mobicents-public
Ok, Vladimir
Thank you.

Олег Мигрин

unread,
Dec 20, 2010, 10:53:31 AM12/20/10
to mobicents-public
Can I ask you modify AddressFactoryImpl(jain-sip-1.2.x):
...
line 120: StringBuilder uriString = new StringBuilder("sip:");
...
to sipS and send me this jar file?
It's could be temporary workaround for us..before we get 1.5 release.
Thanks!

Vladimir Ralev

unread,
Dec 20, 2010, 11:03:07 AM12/20/10
to mobicent...@googlegroups.com
It's not enough to patch there. I will give you a patch in an hour or so.

Vladimir Ralev

unread,
Dec 20, 2010, 12:06:36 PM12/20/10
to mobicent...@googlegroups.com
There is a fix in the trunk and the patch itself is in http://code.google.com/p/mobicents/issues/detail?id=2226

If you are building the server yourself be sure to update all modules, because there has been a dependency change. In a few hours there will be a full hudson release build and you can take the fix from there.

Thanks a lot for this report. I will ping you when the build is available.

Олег Мигрин

unread,
Dec 20, 2010, 12:34:57 PM12/20/10
to mobicents-public
Thanks, Vladimir!

I'll try new hudson build and leave feedback.


On 20 dec, 19:06, Vladimir Ralev <vladimir.ra...@gmail.com> wrote:
> There is a fix in the trunk and the patch itself is inhttp://code.google.com/p/mobicents/issues/detail?id=2226
>
> If you are building the server yourself be sure to update all modules,
> because there has been a dependency change. In a few hours there will be a
> full hudson release build and you can take the fix from there.
>
> Thanks a lot for this report. I will ping you when the build is available.
>
> On Mon, Dec 20, 2010 at 6:03 PM, Vladimir Ralev <vladimir.ra...@gmail.com>wrote:
>
> > It's not enough to patch there. I will give you a patch in an hour or so.
>
Reply all
Reply to author
Forward
0 new messages