diff options
-rw-r--r-- | callagent/MGCPEndpoint.st | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/callagent/MGCPEndpoint.st b/callagent/MGCPEndpoint.st index a5ac215..a3b909d 100644 --- a/callagent/MGCPEndpoint.st +++ b/callagent/MGCPEndpoint.st @@ -67,4 +67,64 @@ Object subclass: MGCPEndpoint [ <category: 'state'> ^ state = self class stateUsed. ] + + reserve [ + <category: 'allocation'> + state = self class stateUnused ifFalse: [ + ^ self error: 'MGCPEndpoint(%1) not unused.' + % {self endpointName} area: #mgcp. + ]. + + state := self class stateReserved. + ] + + used [ + <category: 'allocation'> + state = self class stateReserved ifFalse: [ + ^ self error: 'MGCPEndpoint(%1) not reserved.' + % {self endpointName} area: #mgcp. + ]. + + state := self class stateUsed. + ] + + free [ + <category: 'allocation'> + state = self class stateUsed ifFalse: [ + ^ self error: 'MGCPEndpoint(%1) not used.' + % {self endpointName} area: #mgcp. + ]. + + state := self class stateUnused. + ] + + tryBlock [ + <category: 'allocation'> + state = self class stateUnused ifTrue: [ + state := self class stateBlocked. + ^ true + ]. + + ^ false + ] + + unblock [ + <category: 'allocation'> + state = self class stateBlocked ifFalse: [ + ^ self error: 'MGCPEndpoint(%1) not blocked.' + % {self endpointName} area: #mgcp. + ]. + + state := self class stateUnused. + ] + + sdp [ + <category: 'sdp'> + ^ sdp + ] + + sdp: aSdp [ + <category: 'sdp'> + sdp := aSdp. + ] ] |