Problem with checkHeaders method of SIPResponse
"Mike P. Mikhailov" <[email protected]>
| Newsgroups | gmane.comp.voip.nist-sip |
|---|---|
| Message-ID | <[email protected]> |
The problem is: it will throw an exception in any case for 100 response.
If 'Trying' response DOES NOT have 'To' header
if (getTo() == null) {
throw new ParseException(To.NAME+ " Is missing ", 0);
}
If 'Trying' response DOES have To header
// Check for badly formatted message.
if (getStatusCode() == 100
&& getToTag() != null) {
throw new ParseException(
"Trying response should not have a To
header tag parameter",0);
}
I think it should be something like this
if (getStatusCode() != 100 && getTo() == null) {
throw new ParseException(To.NAME+ " Is missing ", 0);
}