SCCP: Start parsing the SCCP response from the network
This commit is contained in:
parent
ac111ccd53
commit
5a4cb78826
|
@ -62,7 +62,7 @@ Object subclass: MSGParser [
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
Object subclass: SCCPHadler [
|
Object subclass: SCCPHandler [
|
||||||
| connections last_ref |
|
| connections last_ref |
|
||||||
<comment: 'I handle SCCP messages'>
|
<comment: 'I handle SCCP messages'>
|
||||||
|
|
||||||
|
@ -72,7 +72,19 @@ Object subclass: SCCPHadler [
|
||||||
]
|
]
|
||||||
|
|
||||||
handleMsg: aMsg [
|
handleMsg: aMsg [
|
||||||
'Got a new SCCP message' printNl.
|
| sccp |
|
||||||
|
|
||||||
|
'Got a new SCCP message here.' printNl.
|
||||||
|
|
||||||
|
[
|
||||||
|
sccp := MSGParser parse: (aMsg asByteArray).
|
||||||
|
sccp inspect.
|
||||||
|
sccp printNl.
|
||||||
|
sccp class printNl.
|
||||||
|
] on: Exception do: [
|
||||||
|
self logError: 'Failed to parse message' area: #sccp.
|
||||||
|
aMsg asByteArray printNl.
|
||||||
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
createConnection: aData [
|
createConnection: aData [
|
||||||
|
|
14
TestPhone.st
14
TestPhone.st
|
@ -23,7 +23,7 @@ Object subclass: IPAConnection [
|
||||||
dispatcher := Osmo.IPADispatcher new.
|
dispatcher := Osmo.IPADispatcher new.
|
||||||
dispatcher initialize.
|
dispatcher initialize.
|
||||||
|
|
||||||
sccp := SCCPHadler new.
|
sccp := SCCPHandler new.
|
||||||
sccp registerOn: dispatcher.
|
sccp registerOn: dispatcher.
|
||||||
|
|
||||||
ipa := Osmo.IPAProtoHandler new.
|
ipa := Osmo.IPAProtoHandler new.
|
||||||
|
@ -58,6 +58,10 @@ Object subclass: IPAConnection [
|
||||||
muxer nextPut: aMsg with: aType.
|
muxer nextPut: aMsg with: aType.
|
||||||
self drainSendQueue.
|
self drainSendQueue.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
sccpHandler [
|
||||||
|
^ sccp
|
||||||
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
Object subclass: IPAConfig [
|
Object subclass: IPAConfig [
|
||||||
|
@ -90,6 +94,12 @@ Object subclass: IPAConfig [
|
||||||
]
|
]
|
||||||
|
|
||||||
semaphore [ ^ sem ]
|
semaphore [ ^ sem ]
|
||||||
|
|
||||||
|
sendLU [
|
||||||
|
| msg |
|
||||||
|
msg := MessageTests createLU: (connection sccpHandler).
|
||||||
|
connection send: msg with: Osmo.IPAConstants protocolSCCP.
|
||||||
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
Object subclass: MessageTests [
|
Object subclass: MessageTests [
|
||||||
|
@ -106,6 +116,6 @@ Object subclass: MessageTests [
|
||||||
bssap := BSSAPManagement initWith: msg.
|
bssap := BSSAPManagement initWith: msg.
|
||||||
|
|
||||||
sccp := aHandler createConnection: bssap.
|
sccp := aHandler createConnection: bssap.
|
||||||
^ sccp toMessage asByteArray.
|
^ sccp toMessage.
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
4
Tests.st
4
Tests.st
|
@ -181,9 +181,9 @@ TestCase subclass: TestMessages [
|
||||||
testLU [
|
testLU [
|
||||||
| sccp handler |
|
| sccp handler |
|
||||||
|
|
||||||
handler := SCCPHadler new.
|
handler := SCCPHandler new.
|
||||||
sccp := MessageTests createLU: handler.
|
sccp := MessageTests createLU: handler.
|
||||||
self assert: sccp = #(1 154 2 0 2 2 4 2 66 254 15 32 0 30 87 5 8 0 114 244 128 16 3 156 64 23 17 5 8 112 0 240 0 0 0 51 7 97 102 102 102 102 102 246 0 ) asByteArray.
|
self assert: sccp asByteArray = #(1 154 2 0 2 2 4 2 66 254 15 32 0 30 87 5 8 0 114 244 128 16 3 156 64 23 17 5 8 112 0 240 0 0 0 51 7 97 102 102 102 102 102 246 0 ) asByteArray.
|
||||||
]
|
]
|
||||||
|
|
||||||
testMsgParser [
|
testMsgParser [
|
||||||
|
|
Reference in New Issue