Re: SipProviderImpl doesn't fill in branch ID anymore

Becky McElroy <[email protected]>
Newsgroups gmane.comp.voip.nist-sip
Message-ID <[email protected]>
No problem, and thanks for the quick reply, Jeroen.
Actually, it does need the 'length()==0' check, but with that included, 
everything worked.
(I downloaded your update, then just changed my local copy to add the 
length check).
I'll watch out for the CANCEL case.
Regards,
Becky

Jeroen van Bemmel wrote:

> Hi Becky,
>
> Well, "JvB"...guess we know who the culprit is, huh?
>
> I have updated the code in CVS to set the branch, but only if it's not 
> set yet (as per your suggestion). Please see if this helps your case 
> (the test may need to be extended to include 'length()==0, not sure)
>
> The reason I changed that code, is that it was overwriting CANCEL 
> branch ids. If your app is stateless, then it will probably need to 
> set the branch correctly at least for CANCEL (createCancel does this, 
> but if your app is stateless that won't help you)
>
> Sorry for the inconvenience, and thanks for the bug report.
>
> Regards,
>
> Jeroen
>
> PS Ranga: seems like we'll need to update the TCK tests to catch this 
> one.
>
> ----- Original Message ----- From: "Becky McElroy" 
> <[email protected]>
> To: <[email protected]>
> Sent: Saturday, May 13, 2006 8:10 PM
> Subject: [nist-sip] SipProviderImpl doesn't fill in branch ID anymore
>
>
>> 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
>>
>> _______________________________________________
>> nist-sip mailing list
>> [email protected]
>> http://www-x.antd.nist.gov/mailman/listinfo/nist-sip 
>
>
>
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.