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:
parent
b9ecb4ecba
commit
0481c085f1
|
@ -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.
|
||||
|
|
13
src/MSC.st
13
src/MSC.st
|
@ -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
|
||||
]
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Reference in New Issue