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.
|
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 [
|
selectAudioRoute: aCCMessage [
|
||||||
"select route for this call, or release the call"
|
"select route for this call, or release the call"
|
||||||
remoteLeg := con selectAudioRoute: aCCMessage calledOrDefault leg: self.
|
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'
|
to: 'sip:911@127.0.0.1'
|
||||||
on: self sipGateway)
|
on: self sipGateway)
|
||||||
remoteLeg: aLeg;
|
remoteLeg: aLeg;
|
||||||
|
msc: self;
|
||||||
yourself
|
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 [
|
selectAudioRoute: aCon plan: aPlan leg: aLeg [
|
||||||
| nr |
|
| nr |
|
||||||
|
@ -278,6 +290,7 @@ Object subclass: MSCApplication [
|
||||||
to: 'sip:1%1@127.0.0.1' % {nr allButFirst}
|
to: 'sip:1%1@127.0.0.1' % {nr allButFirst}
|
||||||
on: self sipGateway)
|
on: self sipGateway)
|
||||||
remoteLeg: aLeg;
|
remoteLeg: aLeg;
|
||||||
|
msc: self;
|
||||||
yourself
|
yourself
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -19,17 +19,26 @@
|
||||||
PackageLoader fileInPackage: 'OsmoSIP'.
|
PackageLoader fileInPackage: 'OsmoSIP'.
|
||||||
|
|
||||||
Osmo.SIPCall subclass: SIPMTCall [
|
Osmo.SIPCall subclass: SIPMTCall [
|
||||||
| remoteLeg sdp_alert |
|
| remoteLeg sdp_alert msc |
|
||||||
|
|
||||||
<category: 'OsmoMSC-SIP'>
|
<category: 'OsmoMSC-SIP'>
|
||||||
<comment: 'I represent a SIP terminated call. It is called Mobile
|
<comment: 'I represent a SIP terminated call. It is called Mobile
|
||||||
Terminated to stay with the GSM speech.'>
|
Terminated to stay with the GSM speech.'>
|
||||||
|
|
||||||
|
msc: aMsc [
|
||||||
|
<category: 'creation'>
|
||||||
|
msc := aMsc
|
||||||
|
]
|
||||||
|
|
||||||
remoteLeg: aLeg [
|
remoteLeg: aLeg [
|
||||||
<category: 'creation'>
|
<category: 'creation'>
|
||||||
remoteLeg := aLeg.
|
remoteLeg := aLeg.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
remoteLeg [
|
||||||
|
^remoteLeg
|
||||||
|
]
|
||||||
|
|
||||||
netTerminate [
|
netTerminate [
|
||||||
<category: 'external'>
|
<category: 'external'>
|
||||||
"The other side of the call has terminated, we need to
|
"The other side of the call has terminated, we need to
|
||||||
|
@ -39,6 +48,14 @@ Osmo.SIPCall subclass: SIPMTCall [
|
||||||
self terminate.
|
self terminate.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
sessionRedirect: aContact [
|
||||||
|
| newLeg |
|
||||||
|
remoteLeg ifNil: [^self].
|
||||||
|
|
||||||
|
newLeg := msc selectRedirectFor: self to: aContact.
|
||||||
|
remoteLeg changeRemoteLeg: newLeg.
|
||||||
|
]
|
||||||
|
|
||||||
sessionNew [
|
sessionNew [
|
||||||
"We now have connected call, tell the other side."
|
"We now have connected call, tell the other side."
|
||||||
remoteLeg isNil
|
remoteLeg isNil
|
||||||
|
|
Reference in New Issue