|
@@ -857,6 +857,22 @@ route[Orig_Initial]
|
|
|
send_reply("403","Forbidden - You must register first with a S-CSCF");
|
|
|
break;
|
|
|
}
|
|
|
+
|
|
|
+ #asserted identity header
|
|
|
+ if (is_present_hf("P-Preferred-Identity") && pcscf_assert_identity("location", "$hdr(P-Preferred-Identity)")) {
|
|
|
+ xlog("L_DBG", "P-Preferred-Identity is asserted " + "$hdr(P-Preferred-Identity)");
|
|
|
+ append_hf("P-Asserted-Identity: $hdr(P-Preferred-Identity)\r\n");
|
|
|
+ } else {
|
|
|
+ xlog("L_DBG", "P-Preferred-Identity not asserted - using default " + "$pcscf_asserted_identity");
|
|
|
+ append_hf("P-Asserted-Identity: <$pcscf_asserted_identity>\r\n");
|
|
|
+ }
|
|
|
+ if(is_present_hf("P-Preferred-Identity")) {
|
|
|
+ remove_hf("P-Preferred-Identity");
|
|
|
+ }
|
|
|
+
|
|
|
+ msg_apply_changes();
|
|
|
+
|
|
|
+
|
|
|
if (!pcscf_follows_service_routes("location")){
|
|
|
#Variant 1 - deny access to the network
|
|
|
#send_reply("400","Bad Request - Not following indicated service routes");
|
|
@@ -879,15 +895,6 @@ route[Orig_Initial]
|
|
|
$avp(RR_CUSTOM_USER_AVP)="mo";
|
|
|
record_route();
|
|
|
|
|
|
- if (is_present_hf("P-Preferred-Identity") && pcscf_assert_identity("location", "$hdr(P-Preferred-Identity)")) {
|
|
|
- remove_hf("P-Preferred-Identity");
|
|
|
- append_hf("P-Asserted-Identity: $hdr(P-Preferred-Identity)\r\n");
|
|
|
- } else if (pcscf_assert_identity("location", "$fu")) {
|
|
|
- append_hf("P-Asserted-Identity: <$fu>\r\n");
|
|
|
- } else {
|
|
|
- append_hf("P-Asserted-Identity: <$pcscf_asserted_identity>\r\n");
|
|
|
- }
|
|
|
-
|
|
|
# Do RTP-Relaying, if necessary:
|
|
|
route(RTPPROXY_ORIG);
|
|
|
|
|
@@ -1092,6 +1099,27 @@ route[Term_Initial]
|
|
|
######################################################################
|
|
|
onreply_route[Term_Initial_reply]
|
|
|
{
|
|
|
+
|
|
|
+ if (t_check_status("183")||t_check_status("200")){
|
|
|
+ if (!pcscf_is_registered("location")) {
|
|
|
+ xlog("L_DBG", "IMS: INSIDE TERM_INITIAL_REPLY: can't find contact [$ct] in P-CSCF usrloc\n");
|
|
|
+ send_reply("403","Forbidden - not registered with P-CSCF");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ #asserted identity header
|
|
|
+ if (pcscf_assert_called_identity("location")) {
|
|
|
+ xlog("L_DBG", "P-Called-Party-ID asserted");
|
|
|
+ } else {
|
|
|
+ xlog("L_DBG", "P-Called-Party-ID not asserted - using default " + "$pcscf_asserted_identity");
|
|
|
+ append_hf("P-Asserted-Identity: <$pcscf_asserted_identity>\r\n");
|
|
|
+ }
|
|
|
+ if(is_present_hf("P-Preferred-Identity")) {
|
|
|
+ remove_hf("P-Preferred-Identity");
|
|
|
+ }
|
|
|
+ msg_apply_changes();
|
|
|
+ }
|
|
|
+
|
|
|
#!ifdef WITH_RX
|
|
|
if (t_check_status("180|183|200")){
|
|
|
xlog("L_DBG","Diameter Term authorizing media via Rx\n");
|