sccp: Make the initial dispatch based on overloading
This commit is contained in:
parent
20b808d3f0
commit
687815f60f
|
@ -210,7 +210,12 @@ Object subclass: MSGParser [
|
|||
]
|
||||
|
||||
|
||||
|
||||
Osmo.SCCPMessage extend [
|
||||
sccpInitialDispatch: aHandler [
|
||||
^ aHandler dispatchMessage: self.
|
||||
]
|
||||
|
||||
sccpHandlerDispatchOn: aCon [
|
||||
"Message is not handled here"
|
||||
self logError: 'Unhandled SCCP packet %1' % {self class} area: #sccp.
|
||||
|
@ -218,6 +223,21 @@ Osmo.SCCPMessage extend [
|
|||
]
|
||||
]
|
||||
|
||||
Osmo.SCCPUDT extend [
|
||||
sccpInitialDispatch: aHandler [
|
||||
aHandler handleUDT: self.
|
||||
^ true
|
||||
]
|
||||
]
|
||||
|
||||
Osmo.SCCPConnectionRequest extend [
|
||||
sccpInitialDispatch: aHandler [
|
||||
self logNotice: 'New incoming connection' area: #sccp.
|
||||
aHandler confirmConnection: self.
|
||||
^ true
|
||||
]
|
||||
]
|
||||
|
||||
Osmo.SCCPConnectionConfirm extend [
|
||||
sccpHandlerDispatchOn: aCon [
|
||||
aCon confirm: self.
|
||||
|
@ -341,18 +361,7 @@ Object subclass: SCCPHandler [
|
|||
^ false
|
||||
].
|
||||
|
||||
(sccp isKindOf: Osmo.SCCPConnectionRequest) ifTrue: [
|
||||
self logNotice: 'New incoming connection' area: #sccp.
|
||||
self confirmConnection: sccp.
|
||||
^ true
|
||||
].
|
||||
|
||||
(sccp isKindOf: Osmo.SCCPUDT) ifTrue: [
|
||||
self handleUDT: sccp.
|
||||
^ true
|
||||
].
|
||||
|
||||
self dispatchMessage: sccp.
|
||||
sccp sccpInitialDispatch: self.
|
||||
]
|
||||
|
||||
handleUDT: aSCCP [
|
||||
|
|
Reference in New Issue