diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-03-14 15:06:06 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-03-14 15:06:06 +0100 |
commit | be46bf5b3592a58f5d9f3aa6946da9aca7c6544a (patch) | |
tree | a7a641f33344bd5ffaae2d95beb316b53f49b60e | |
parent | 3ec703beb55a46e6ea26012463a88ad259cef36a (diff) |
mgcp: Be able to parse the first osmocom vendor extension
-rw-r--r-- | grammar/MGCPGrammar.st | 3 | ||||
-rw-r--r-- | grammar/MGCPGrammarTest.st | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/grammar/MGCPGrammar.st b/grammar/MGCPGrammar.st index d6270d6..5ed374e 100644 --- a/grammar/MGCPGrammar.st +++ b/grammar/MGCPGrammar.st @@ -127,7 +127,8 @@ PP.PPCompositeParser subclass: MGCPGrammar [ ($A asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ('ES' asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ('PL' asParser, $: asParser, #blank asParser star, self wordParser star flatten) / - ('MD' asParser, $: asParser, #blank asParser star, self wordParser star flatten) + ('MD' asParser, $: asParser, #blank asParser star, self wordParser star flatten) / + ('X-Osmo-CP' asParser, $: asParser, #blank asParser star, self wordParser star flatten) ] MGCPResponse [ diff --git a/grammar/MGCPGrammarTest.st b/grammar/MGCPGrammarTest.st index 1ac83ba..1262d29 100644 --- a/grammar/MGCPGrammarTest.st +++ b/grammar/MGCPGrammarTest.st @@ -90,4 +90,13 @@ PP.PPCompositeParserTest subclass: MGCPGrammarTest [ self assert: res first first = '200'. self assert: res first third = '433414656'. ] + + testDlcxResponse [ + | res inp | + + inp := #[50 53 48 32 54 56 51 52 53 53 50 52 52 32 79 75 13 10 80 58 32 80 83 61 49 54 57 44 32 79 83 61 55 54 48 53 44 32 80 82 61 48 44 32 79 82 61 48 44 32 80 76 61 48 44 32 74 73 61 48 13 10 88 45 79 115 109 111 45 67 80 58 32 69 67 32 84 73 83 61 48 44 32 84 79 83 61 48 44 32 84 73 82 61 48 44 32 84 79 82 61 48 13 10]. + + res := self parse: inp asString. + res inspect. + ] ] |