bsc: Send the Osmo RSIP extension to our bsc to reset the mediagateway
This commit is contained in:
parent
37c768d3cb
commit
889e86d488
|
@ -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: [
|
||||
|
|
|
@ -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.
|
||||
|
|
Reference in New Issue