SipProviderImpl doesn't fill in branch ID anymore

Becky McElroy <[email protected]>
Newsgroups gmane.comp.voip.nist-sip
Message-ID <[email protected]>
Hi,

I'm moving our application, SipUnit, to the new nist-sip 1.2 stack. Our 
app has a testcase that was passing before, but is now failing. The 
reason is because before, SipProviderImpl.sendRequest() had this code 
for filling in the Via header branch ID (and maybe it was an old version 
of the old version):

                String bid = sipRequest.getTransactionId();
                Via via = sipRequest.getTopmostVia();
                via.setBranch(bid);

and now it has this:

        try {
            /*
             * JvB: Via branch should already be OK, dont touch it here?
             *
             * String bid = sipRequest.getTransactionId(); Via via =
             * sipRequest.getTopmostVia(); via.setBranch(bid);
             */

            MessageChannel messageChannel = null;
            if  ...etc

As a result, the message is discarded at the receive side because of the 
null branch ID:

        DEBUG - 
gov.nist.javax.sip.stack.UDPMessageChannel.run(UDPMessageChannel.java:228) 
[BYE            
        sip:[email protected]:5060;transport=udp SIP/2.0
        Call-ID: [email protected]
        CSeq: 1 BYE
        From: <sip:[email protected]>;tag=1175810803
        To: <sip:[email protected]>;tag=335288537
        Via: SIP/2.0/UDP 192.168.1.101:5060;branch=
        Max-Forwards: 5
        Content-Length: 0

        ]
        ERROR - null branch Id
        java.text.ParseException: null branch Id
            at 
gov.nist.javax.sip.parser.ViaParser.parseVia(ViaParser.java:77)
            at gov.nist.javax.sip.parser.ViaParser.parse(ViaParser.java:186)
            at 
gov.nist.javax.sip.parser.StringMsgParser.parseMessage(StringMsgParser.java:555)
            at 
gov.nist.javax.sip.parser.StringMsgParser.parseSIPMessage(StringMsgParser.java:327)
            at 
gov.nist.javax.sip.stack.UDPMessageChannel.run(UDPMessageChannel.java:235)
            at java.lang.Thread.run(Thread.java:595)
        DEBUG - 
gov.nist.javax.sip.stack.UDPMessageChannel.handleException(UDPMessageChannel.java:475) 
[BAD MESSAGE!]
        DEBUG - 
gov.nist.javax.sip.stack.UDPMessageChannel.handleException(UDPMessageChannel.java:476) 
[null]
        DEBUG - 
gov.nist.javax.sip.stack.UDPMessageChannel.run(UDPMessageChannel.java:240) 
[Rejecting message !


Do I need to do something in my app, or should 
SipProviderImpl.sendRequest() continue to set branch ID (maybe if  not 
already set)?
I suppose normally this kind of message would be sent statefully with a 
client transaction, but this particular case in the application is 
allowing any kind of request to be sent statelessly and so is just 
calling the Sip Provider sendRequest() method with a fully formed 
request (fully formed except for branch ID).

Please advise.
Thanks,
Becky
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.