smalltalk
/
osmo-st-msc
Archived
1
0
Fork 0

audio: Implement handling SIP 30X redirects by starting another call

When we receive a SIP 30X redirect we need to open a new leg and
replace it. We do this through the MSCApplication and tell the
other one.
This commit is contained in:
Holger Hans Peter Freyther 2014-03-14 15:39:29 +01:00
parent b9ecb4ecba
commit 0481c085f1
3 changed files with 40 additions and 1 deletions

View File

@ -244,6 +244,15 @@ GSMTransaction subclass: GSMMOCall [
con removeTransaction: self.
]
changeRemoteLeg: aLeg [
self logNotice:
'GSMMOCall(srcref:%1) changing remote leg'
% {con srcRef} area: #bsc.
remoteLeg := aLeg.
remoteLeg createCall: con sdpFile.
]
selectAudioRoute: aCCMessage [
"select route for this call, or release the call"
remoteLeg := con selectAudioRoute: aCCMessage calledOrDefault leg: self.

View File

@ -255,9 +255,21 @@ Object subclass: MSCApplication [
to: 'sip:911@127.0.0.1'
on: self sipGateway)
remoteLeg: aLeg;
msc: self;
yourself
]
selectRedirectFor: aSipCall to: aSipContact [
^ (SIPMTCall
fromUser: 'sip:1000@sip.zecke.osmocom.org'
host: '127.0.0.1'
port: 5060
to: aSipContact
on: self sipGateway)
remoteLeg: aSipCall remoteLeg;
msc: self;
yourself
]
selectAudioRoute: aCon plan: aPlan leg: aLeg [
| nr |
@ -278,6 +290,7 @@ Object subclass: MSCApplication [
to: 'sip:1%1@127.0.0.1' % {nr allButFirst}
on: self sipGateway)
remoteLeg: aLeg;
msc: self;
yourself
]

View File

@ -19,17 +19,26 @@
PackageLoader fileInPackage: 'OsmoSIP'.
Osmo.SIPCall subclass: SIPMTCall [
| remoteLeg sdp_alert |
| remoteLeg sdp_alert msc |
<category: 'OsmoMSC-SIP'>
<comment: 'I represent a SIP terminated call. It is called Mobile
Terminated to stay with the GSM speech.'>
msc: aMsc [
<category: 'creation'>
msc := aMsc
]
remoteLeg: aLeg [
<category: 'creation'>
remoteLeg := aLeg.
]
remoteLeg [
^remoteLeg
]
netTerminate [
<category: 'external'>
"The other side of the call has terminated, we need to
@ -39,6 +48,14 @@ Osmo.SIPCall subclass: SIPMTCall [
self terminate.
]
sessionRedirect: aContact [
| newLeg |
remoteLeg ifNil: [^self].
newLeg := msc selectRedirectFor: self to: aContact.
remoteLeg changeRemoteLeg: newLeg.
]
sessionNew [
"We now have connected call, tell the other side."
remoteLeg isNil