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

callagent: Add writing SDP to the datagram

This commit is contained in:
Holger Hans Peter Freyther 2011-06-10 13:12:54 +02:00
parent 74e2cb0415
commit 2a8efb434d
1 changed files with 23 additions and 1 deletions

View File

@ -17,7 +17,7 @@
"
Object subclass: MGCPCommand [
| verb transaction endp params |
| verb transaction endp params sdp |
<comment: 'I am a command send to a MGCP gateway. I know my timeout
and such. Each MGCPGateWay can have a MGCPCommand subclass to specify
certain things. E.g. the endpoint numbering is different'>
@ -71,6 +71,16 @@ Object subclass: MGCPCommand [
^ params ifNil: [params := OrderedCollection new]
]
sdpAdd: line [
<category: 'private'>
self sdp add: line.
]
sdp [
<category: 'private'>
^ sdp ifNil: [sdp := OrderedCollection new]
]
asDatagram [
| out |
<category: 'networking'>
@ -89,6 +99,18 @@ Object subclass: MGCPCommand [
cr; nl.
].
"write optional SDP"
sdp ifNotNil: [
out
cr; nl.
sdp do: [:each |
out
nextPutAll: each;
cr; nl.
].
].
^ out contents
]
]