smalltalk
/
osmo-st-mgcp
Archived
1
0
Fork 0

callagent: Fix the parsing of responses without SDP part

This commit is contained in:
Holger Hans Peter Freyther 2011-06-24 19:24:03 +02:00
parent 9c5b73d4c6
commit 557986c4f2
2 changed files with 14 additions and 0 deletions

View File

@ -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

View File

@ -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.
]
]