mgcp: Be able to parse the grammar of custom transids correctly
This commit is contained in:
parent
afb53fc0d0
commit
08ebcfdab3
|
@ -368,6 +368,12 @@ PP.PPCompositeParserTest subclass: MGCPParserTest [
|
||||||
^String streamContents: [:stream |
|
^String streamContents: [:stream |
|
||||||
stream
|
stream
|
||||||
nextPutAll: 'DLCX nat-0 1@mgw MGCP 1.0'; cr; nl]
|
nextPutAll: 'DLCX nat-0 1@mgw MGCP 1.0'; cr; nl]
|
||||||
|
]
|
||||||
|
|
||||||
|
MGCPParserTest class >> dlcxMessageReg [
|
||||||
|
^String streamContents: [:stream |
|
||||||
|
stream
|
||||||
|
nextPutAll: 'DLCX nat-9999999999 a@mgw MGCP 1.0'; cr; nl]
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -384,6 +390,14 @@ PP.PPCompositeParserTest subclass: MGCPParserTest [
|
||||||
self assert: crcx asDatagram equals: self class crcxMessage.
|
self assert: crcx asDatagram equals: self class crcxMessage.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
testParseNatDLCX [
|
||||||
|
| dlcx |
|
||||||
|
dlcx := self parse: self class dlcxMessageReg.
|
||||||
|
|
||||||
|
self assert: dlcx class verb equals: 'DLCX'.
|
||||||
|
self assert: dlcx asDatagram equals: self class dlcxMessageReg.
|
||||||
|
]
|
||||||
|
|
||||||
testParseDLCX [
|
testParseDLCX [
|
||||||
| dlcx |
|
| dlcx |
|
||||||
dlcx := self parse: self class natDLCXMessage.
|
dlcx := self parse: self class natDLCXMessage.
|
||||||
|
|
|
@ -73,7 +73,7 @@ PP.PPCompositeParser subclass: MGCPGrammar [
|
||||||
<category: 'grammar-cmd'>
|
<category: 'grammar-cmd'>
|
||||||
"Add Osmocom extension that starts with 'nat-'"
|
"Add Osmocom extension that starts with 'nat-'"
|
||||||
^ ((#digit asParser) min: 1 max: 9) flatten /
|
^ ((#digit asParser) min: 1 max: 9) flatten /
|
||||||
('nat-' asParser, (#digit asParser) min: 1 max: 9) flatten
|
('nat-' asParser, ((#digit asParser) min: 1 max: 9) plus) flatten
|
||||||
]
|
]
|
||||||
|
|
||||||
endpointName [
|
endpointName [
|
||||||
|
|
Reference in New Issue