callagent: Fix the parsing of responses without SDP part
This commit is contained in:
parent
9c5b73d4c6
commit
557986c4f2
|
@ -59,6 +59,11 @@ Object subclass: MGCPResponse [
|
|||
| str |
|
||||
<category: 'creation'>
|
||||
|
||||
aDict isNil ifTrue: [
|
||||
sdp := nil.
|
||||
^ self
|
||||
].
|
||||
|
||||
str := WriteStream on: (String new).
|
||||
aDict second do: [:each |
|
||||
str
|
||||
|
|
|
@ -295,4 +295,13 @@ PP.PPCompositeParserTest subclass: MGCPParserTest [
|
|||
self assert: res sdp = sdp.
|
||||
self assert: (res parameterAt: 'I' ifAbsent: []) = '233434'.
|
||||
]
|
||||
|
||||
testFailureResp [
|
||||
| nl res |
|
||||
nl := Character cr asString, Character nl asString.
|
||||
res := self parse: '400 32323 OK', nl.
|
||||
|
||||
self deny: res isSuccess.
|
||||
self assert: res sdp isNil.
|
||||
]
|
||||
]
|
||||
|
|
Reference in New Issue