@startuml "TD_VoLTE_NGC_INT_REJ_01.png"
/'Editor: https://plantuml-editor.kkeisuke.com/ '/
/'Syntax: http://plantuml.com/fr/sequence-diagram '/
!include etsi-style.iuml  
!pragma teoz true
'
participant "UE A"
box "EPC A" #LightBlue
  participant PGw
  participant PCRF
end box
box "IMS A" #LightBlue
  participant "P-CSCF"
  participant "E-CSCF"
  participant  "IBCF"
 participant "BGCF"

end box


  participant "PSAP"



'
rnote right  "UE A"         : Gm
& rnote right "P-CSCF"      : Mw
& rnote right "E-CSCF"      : Mm\nMx\nMi
& rnote right "IBCF"        : Ici
& rnote right "PCRF"        : Rx
& rnote right "PGw"         : Gx
& rnote left "IBCF"        : \nMx\n
& rnote left "BGCF"        : \n\nMi
& rnote left "PSAP"        : Mm\n\n
'
"UE A"      <--> "PGw"      : Not possible
& "PGw"     <--> "PSAP" : Not possible
"UE A"      ->   "P-CSCF"   : INVITE \n(urn:service:sos*)
"P-CSCF"    ->   "PCRF"     : AAR
& "PCRF"    ->   "PGw"      : RAR
rnote over "UE A", PGw #FFAAAA: Installation of emergency Bearer
"PGw"       ->   "PCRF"     : RAA
& "PCRF"    ->   "P-CSCF"   : AAA
"PGw"       ->   "PCRF"     : CCR
& "PCRF"    ->   "P-CSCF"   : RAR
  "P-CSCF"  ->   "PCRF"     : RAA
& "PCRF"    ->   "PGw"      : CCA
 "P-CSCF"  ->   "E-CSCF"   : INVITE \n(urn:service:sos*)

rnote over "PSAP", PSAP #FFAAAA: PSAP unavailable

alt PSAP in IMS A network (option 1)
"E-CSCF"  -> "PSAP"     : INVITE \n(urn:service:sos*)
"PSAP"  -> "E-CSCF"     : 480 Temporary Unavailable
else PSAP not in IMS A network (option 2)\n
"E-CSCF"  -> "IBCF"     : INVITE \n(urn:service:sos*)
&"IBCF"  --> "PSAP"     :  INVITE \n(urn:service:sos*)
"PSAP"  --> "IBCF"     : 480 Temporary Unavailable
&"IBCF"  -> "E-CSCF"     : 480 Temporary Unavailable
else PSAP in PSTN network (option 3)\n
"E-CSCF"  -> "BGCF"     : INVITE \n(urn:service:sos*)
&"BGCF"  --> "PSAP"     :  INVITE \n(urn:service:sos*)
'&"PSTN"  --> "PSAP"     :  INVITE \n(urn:service:sos*)
"PSAP"  --> "BGCF"     : 480 Temporary Unavailable
&"BGCF"  -> "E-CSCF"     : 480 Temporary Unavailable
'&"PSAP"  --> "PSTN"     : 480 Temporary Unavailable
end







 "E-CSCF"  ->   "P-CSCF"   : 480 Temporary Unavailable
& "P-CSCF"  ->   "PCRF"     : STR
& "PCRF"    ->   "PGw"      : RAR
rnote over "UE A", PGw #FFAAAA: Removal of emergency Bearer
"PGw"       ->   "PCRF"     : RAA
& "PCRF"    ->   "P-CSCF"   : STA
"P-CSCF"    ->   "UE A"     : 380 (Alternative Service)
"UE A" -> "P-CSCF" : ACK
& "P-CSCF" -> "E-CSCF" : ACK

alt PSAP in IMS A network (option 1)
"E-CSCF"  -> "PSAP"     : ACK
else PSAP not in IMS A network (option 2)\n
"E-CSCF"  -> "IBCF"     : ACK
&"IBCF"  --> "PSAP"     :  ACK

else PSAP in PSTN network (option 3)\n
"E-CSCF"  -> "BGCF"     : ACK
&"BGCF"  --> "PSAP"     :  ACK
'&"PSTN"  --> "PSAP"     :  ACK

end


"UE A"      <--> "PGw"      : Not possible
& "PGw"     <--> "PSAP" : Not possible

@enduml
