kusuzhu / sipdroid

Automatically exported from code.google.com/p/sipdroid
GNU General Public License v3.0
0 stars 0 forks source link

RFC 3261 Compact Form support #617

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
7.3.3 of RFC 3261 states:

"Implementations MUST accept both the long and short forms of each header name."

http://www.ietf.org/rfc/rfc3261.txt

Currently callcentric.com does not work because it returns Compact Form 
headers. The code looks for the long form headers only and considers the SIP 
message malformed when it is 'missing' required headers.

I have modified the source in several places to check for both headers like 
this:

    public boolean hasCallIdHeader() {
-       return hasHeader(SipHeaders.Call_ID);
+       return hasHeader(SipHeaders.Call_ID_short) || hasHeader(SipHeaders.Call_ID);
    }

and 

    public CallIdHeader getCallIdHeader() {
-       Header h = getHeader(SipHeaders.Call_ID);
+       Header h = getHeader(SipHeaders.Call_ID_short);
+       if (h != null)
+           return new CallIdHeader(h);
+       
+       h = getHeader(SipHeaders.Call_ID);

Modifying all header checks in org/zoolu/sip/message/BaseMessage.java with the 
short forms in declared in BaseSipHeaders.java allows callcentric.com to 
successfully be registered to and outgoing calls work.

I bet there are more VOIP providers that use short form headers that would 
benefit from this kind of fix.

I don't want to submit a patch as I have no idea if this would be the right way 
to check for synonymous headers.

Original issue reported on code.google.com by soconnor...@gmail.com on 26 Aug 2010 at 7:35

GoogleCodeExporter commented 9 years ago

We are sip providers using SIP short-form headers. I have checked the source 
code and it seems that short-from headers are not truly supported. Is there a 
plan to add this kind of support?

On the other hand, I can personally contribute patches to address this problem. 
But since I am not familiar with the code, some design indication will be very 
helpful. 

Original comment by qingC...@gmail.com on 9 Sep 2010 at 9:38

GoogleCodeExporter commented 9 years ago
Issue 645 has been merged into this issue.

Original comment by pmerl...@googlemail.com on 17 Sep 2010 at 8:19

GoogleCodeExporter commented 9 years ago
Your patches are welcome. However, they have to be tested carefully before 
checkin in because they can affect existing core functionality.

Original comment by pmerl...@googlemail.com on 17 Sep 2010 at 8:23