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

response: Provide a Content-Type/Content-Length as well

This commit is contained in:
Holger Hans Peter Freyther 2014-06-05 16:30:16 +02:00
parent 160b36056a
commit a28c2ab64c
2 changed files with 10 additions and 4 deletions

View File

@ -113,10 +113,14 @@ Object subclass: SIPResponse [
cr; nl.
].
out cr;nl.
sdp ifNotNil: [
out nextPutAll: sdp
sdp isNil
ifTrue: [out cr; nl.]
ifFalse: [
out
nextPutAll: 'Content-Type: application/sdp'; cr; nl;
nextPutAll: 'Content-Length: '; nextPutAll: sdp size asString; cr; nl;
cr; nl;
nextPutAll: sdp.
].
^ out contents

View File

@ -148,6 +148,8 @@ TestCase subclass: SIPInviteTest [
self assert: msg phrase equals: 'OK'.
self assert: agent dialogs size equals: 1.
self deny: call unregisterDialogIsPending.
self assert: (msg parameter: 'Content-Type' ifAbsent: []) equals: 'application/sdp'.
self assert: (msg parameter: 'Content-Length' ifAbsent: []) equals: '10'.
"Inject the ACK for the 200"
self assert: call state equals: call class stateAccepted.