From dd874d294ac21fdb5f41094fcc3020a83cb5a40d Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 14 Mar 2014 13:45:57 +0100 Subject: [PATCH] grammar: The header fields may be case insensitivie We must extend the grammar to add caseInsensitive to a lot of fields as they are case-insensitive as part of the specification this even applies to some parameter names where expires and eXpiReS are considered to be the same. Start with the simple case of the parameter. --- callagent/SIPResponse.st | 2 +- callagent/tests/SIPCallAgentTest.st | 2 +- callagent/tests/SIPParserTest.st | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/callagent/SIPResponse.st b/callagent/SIPResponse.st index dd21336..e81e7d7 100644 --- a/callagent/SIPResponse.st +++ b/callagent/SIPResponse.st @@ -80,7 +80,7 @@ Object subclass: SIPResponse [ parameter: aPar ifAbsent: absent [ self parameters do: [:each | - each key = aPar ifTrue: [^ each value]]. + (each key sameAs: aPar) ifTrue: [^ each value]]. ^absent value. ] diff --git a/callagent/tests/SIPCallAgentTest.st b/callagent/tests/SIPCallAgentTest.st index 4d5b1f6..5a08ba6 100644 --- a/callagent/tests/SIPCallAgentTest.st +++ b/callagent/tests/SIPCallAgentTest.st @@ -25,7 +25,7 @@ TestCase subclass: SIPCallAgentTest [ ^(WriteStream on: String new) nextPutAll: 'SIP/2.0 302 Moved Temporarily'; cr; nl; nextPutAll: 'Allow: INVITE, ACK'; cr; nl; - nextPutAll: 'Call-ID: '; nextPutAll: aCallId; cr; nl; + nextPutAll: 'Call-Id: '; nextPutAll: aCallId; cr; nl; nextPutAll: 'Contact: sip:+12345678@10.8.254.1'; cr; nl; nextPutAll: 'Content-Length: 0'; cr; nl; nextPutAll: 'CSeq: 1 INVITE'; cr; nl; diff --git a/callagent/tests/SIPParserTest.st b/callagent/tests/SIPParserTest.st index 9d82361..8a3e48b 100644 --- a/callagent/tests/SIPParserTest.st +++ b/callagent/tests/SIPParserTest.st @@ -190,6 +190,7 @@ PP.PPCompositeParserTest subclass: SIPParserTest [ self assert: (auth at: 'nonce') equals: '373ef30b297545cbce99fad09f1409cb.1392124197'. self assert: (auth at: 'stale'). self assert: (auth at: 'algorithm') equals: 'MD5'. + self assert: (res parameter: 'cAlL-Id') equals: 'fc0f7969-8b91-e311-8101-844bf52a8297@xiaoyu'. ] authorizationData [