diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-04-06 19:20:51 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-04-06 19:34:59 +0200 |
commit | 889e86d488f71b102e17c94cd7ce9119d74cf25d (patch) | |
tree | 1cc29fdd8d52474306f8cfdb638035e2f3a8511a | |
parent | 37c768d3cb650fec0b004d163ec2ac3763dc583e (diff) |
bsc: Send the Osmo RSIP extension to our bsc to reset the mediagateway
-rw-r--r-- | src/BSCConfig.st | 18 | ||||
-rw-r--r-- | src/BSCIPAConnection.st | 17 | ||||
-rw-r--r-- | src/MSC.st | 4 |
3 files changed, 29 insertions, 10 deletions
diff --git a/src/BSCConfig.st b/src/BSCConfig.st index 6de800d..322ee68 100644 --- a/src/BSCConfig.st +++ b/src/BSCConfig.st @@ -1,5 +1,5 @@ " - (C) 2010 by Holger Hans Peter Freyther + (C) 2010-2012 by Holger Hans Peter Freyther All Rights Reserved This program is free software: you can redistribute it and/or modify @@ -19,7 +19,7 @@ PackageLoader fileInPackage: #Sockets. Object subclass: BSCConfigItem [ - | peer token name lac connected | + | peer token name lac connected osmoExtension | <category: 'OsmoMSC-BSC'> <comment: 'I hold the configuration for one BSC Item. It consists of the @@ -60,6 +60,12 @@ peer address, the lac, if it is connected'> <category: 'private'> connected := aState. ] + + sendOsmoRSIP [ <category: 'accessing'> ^ osmoExtension ] + sendOsmoRSIP: useExtension [ + <category: 'private'> + osmoExtension := useExtension + ] ] Object subclass: BSCConfig [ @@ -78,14 +84,16 @@ Object subclass: BSCConfig [ self bscList removeAllSuchThat: [:element | element lac = aLac]. ] - addBSC: ip withName: aName andLac: aLac [ + addBSC: ip withName: aName andLac: aLac sendOsmoRSIP: aRSIP [ | addr bsc | <category: 'management'> "Make sure that no one with the same IP or LAC registers" addr := Sockets.SocketAddress byName: ip. - bsc := BSCConfigItem initWith: addr name: aName. - bsc lac: aLac. + bsc := (BSCConfigItem initWith: addr name: aName) + lac: aLac; + sendOsmoRSIP: aRSIP; + yourself. (self bscList anySatisfy: [:each | each peer = addr ]) ifTrue: [ diff --git a/src/BSCIPAConnection.st b/src/BSCIPAConnection.st index 1a94d28..cd29fbd 100644 --- a/src/BSCIPAConnection.st +++ b/src/BSCIPAConnection.st @@ -54,11 +54,13 @@ Object subclass: BSCConnection [ initialize [ <category: 'creation'> - "I try to initialize the trunk. Right now I force the usage - of UDP to the given port and do not support the nat traversal. I - also hardcode the kind of audio." + "I try to initialize the trunk to the remote BSC. Right now I force + the usage of UDP." trunk := Osmo.MGCPDSTrunk createWithDest: config peer printString trunkNr: 1. (trunk endpointAt: 1) tryBlock. + + "Osmo Extension" + config sendOsmoRSIP ifTrue: [self sendOsmoRSIP]. ] config [ @@ -75,6 +77,15 @@ Object subclass: BSCConnection [ <category: 'accessing'> ^ trunk ] + + sendOsmoRSIP [ + <category: 'osmo-extensions'> + + "Send the RSIP in a fire and forget style." + (Osmo.MGCPTransaction on: (trunk endpointAt: 2) of: msc mgcpCallAgent) + command: Osmo.MGCPOsmoRSIPCommand createRSIP; + startSingleShot. + ] ] BSCConnection subclass: BSCIPAConnection [ @@ -230,8 +230,8 @@ Object subclass: MSCApplication [ bscPort: 5000; sipIP: '127.0.0.1'. msc bscConfig - addBSC: '127.0.0.1' withName: 'test1' andLac: 4711; - addBSC: '10.240.240.1' withName: 'test2' andLac: 4712. + addBSC: '127.0.0.1' withName: 'test1' andLac: 4711 sendOsmoRSIP: true; + addBSC: '10.240.240.1' withName: 'test2' andLac: 4712 sendOsmoRSIP: true. "Make sure MGCP is running" msc mgcpCallAgent. |