sdp: Parse the SDP file in the command like it is done in the response
This commit is contained in:
parent
2796b46a1f
commit
948264560f
|
@ -37,7 +37,7 @@ Object subclass: MGCPCommandBase [
|
|||
transactionId: nodes third;
|
||||
endpoint: (nodes at: 5);
|
||||
addParametersInternal: (nodes at: 9);
|
||||
sdp: (nodes at: 10);
|
||||
sdp: (MGCPResponse sdpFromDict: (nodes at: 10));
|
||||
yourself
|
||||
]
|
||||
|
||||
|
|
|
@ -33,6 +33,21 @@ Object subclass: MGCPResponse [
|
|||
yourself
|
||||
]
|
||||
|
||||
MGCPResponse class >> sdpFromDict: aDict [
|
||||
| str |
|
||||
|
||||
aDict isNil ifTrue: [
|
||||
^nil
|
||||
].
|
||||
|
||||
str := WriteStream on: (String new).
|
||||
^String streamContents: [:stream |
|
||||
aDict second do: [:each |
|
||||
stream
|
||||
nextPutAll: each first;
|
||||
cr; nl.]]
|
||||
]
|
||||
|
||||
initialize [
|
||||
<category: 'creation'>
|
||||
params := Dictionary new.
|
||||
|
@ -61,22 +76,8 @@ Object subclass: MGCPResponse [
|
|||
]
|
||||
|
||||
addSDPFromDict: aDict [
|
||||
| str |
|
||||
<category: 'creation'>
|
||||
|
||||
aDict isNil ifTrue: [
|
||||
sdp := nil.
|
||||
^ self
|
||||
].
|
||||
|
||||
str := WriteStream on: (String new).
|
||||
aDict second do: [:each |
|
||||
str
|
||||
nextPutAll: each first;
|
||||
cr; nl.
|
||||
].
|
||||
|
||||
sdp := str contents.
|
||||
sdp := self class sdpFromDict: aDict.
|
||||
]
|
||||
|
||||
transactionId [
|
||||
|
|
|
@ -358,7 +358,10 @@ PP.PPCompositeParserTest subclass: MGCPParserTest [
|
|||
nextPutAll: 'CRCX 1 14@mgw MGCP 1.0'; cr; nl;
|
||||
nextPutAll: 'C: 4a84ad5d25f'; cr; nl;
|
||||
nextPutAll: 'L: p:20, a:GSM-EFR, nt:IN'; cr; nl;
|
||||
nextPutAll: 'M: recvonly'; cr; nl]
|
||||
nextPutAll: 'M: recvonly'; cr; nl;
|
||||
cr; nl;
|
||||
nextPutAll: 'v=0'; cr; nl;
|
||||
nextPutAll: 'b=0'; cr; nl]
|
||||
]
|
||||
|
||||
MGCPParserTest class >> natDLCXMessage [
|
||||
|
|
Reference in New Issue