Minor refactor and cosmetic changes in PCSCF cfg files
This commit is contained in:
@@ -461,7 +461,7 @@ modparam("http_client", "response_headers", 1)
|
||||
modparam("http_client", "query_result", 1)
|
||||
modparam("nghttp2", "listen_addr", "N5_BIND_IP")
|
||||
modparam("nghttp2", "listen_port", "N5_BIND_PORT")
|
||||
# Replace the following with your own Key and Cert, you can use HAProxy to terminate TLS towards Clients (Open5gs)
|
||||
# Replace the following with your own Key and Cert, you can use HAProxy to terminate TLS towards Clients e.g. Open5gs PCF
|
||||
# modparam("nghttp2", "tls_private_key", "/mnt/pcscf/http2_key.pem")
|
||||
# modparam("nghttp2", "tls_public_key", "/mnt/pcscf/http2_tr.pem")
|
||||
|
||||
@@ -1021,8 +1021,8 @@ route[preload_pcscf] {
|
||||
# 5G N5 HTTP2 Server routing script basic code
|
||||
event_route[nghttp2:request] {
|
||||
xinfo("request: $nghttp2(method) - url: $nghttp2(path) - data: [$nghttp2(data)]\n");
|
||||
|
||||
// Check if the requested URL is /nf-status-notify
|
||||
|
||||
# Check if the requested URL is /nf-status-notify
|
||||
if ($nghttp2(path) == "/nf-status-notify") {
|
||||
nghttp2_reply_header("Content-Type", "text/html");
|
||||
nghttp2_reply_header("Server:", "AF");
|
||||
@@ -1034,11 +1034,11 @@ event_route[nghttp2:request] {
|
||||
nghttp2_reply_header("Server", "AF");
|
||||
nghttp2_reply("204", "No Content");
|
||||
} else {
|
||||
// Optionally handle other URLs or do nothing
|
||||
# Optionally handle other URLs or do nothing
|
||||
nghttp2_reply_header("accept", "application/json");
|
||||
nghttp2_reply_header("accept", "application/problem+json");
|
||||
nghttp2_reply_header("Content-Type", "application/json");
|
||||
nghttp2_reply_header("Server", "AF");
|
||||
nghttp2_reply_header("Server", "AF");
|
||||
nghttp2_reply("404", "Not Found");
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -3,9 +3,9 @@
|
||||
######################################################################
|
||||
route[REGISTER] {
|
||||
# Provide some statistics
|
||||
if ($sht(a=>$ci::start_time) == $null || $sht(a=>$ci::start_time) == 0) {
|
||||
$sht(a=>$ci::start_time) = $TV(Sn);
|
||||
}
|
||||
if ($sht(a=>$ci::start_time) == $null || $sht(a=>$ci::start_time) == 0) {
|
||||
$sht(a=>$ci::start_time) = $TV(Sn);
|
||||
}
|
||||
xnotice("PCSCF REGISTER: \n Destination URI: $du\n Request URI: $ru\n");
|
||||
xnotice("Source IP and Port: ($si:$sp)\n Route-URI: $route_uri\n");
|
||||
xnotice("Received IP and Port: ($Ri:$Rp)\n");
|
||||
@@ -21,20 +21,20 @@ route[REGISTER] {
|
||||
exit;
|
||||
}
|
||||
|
||||
### N5 Request create and terminate
|
||||
xlog("L_INFO","Checking if its a Registration and not a De-Reg for $fu\n");
|
||||
$var(reg_exp) = $expires(min);
|
||||
xlog("L_INFO","Checking Expire $fu and it is : $var(reg_exp)\n");
|
||||
|
||||
# tying a dirty workaround to make it only excute after IPSec tunnel to prevent double excution
|
||||
if ($expires(min) != 0 && is_present_hf("Security-Verify")) {
|
||||
route(REGISTER_N5_Req);
|
||||
}
|
||||
#!ifdef WITH_N5
|
||||
$var(reg_exp) = $expires(min);
|
||||
xlog("L_INFO","Expire for $fu is :$var(reg_exp)\n");
|
||||
|
||||
if ($expires(min) == 0 ) {
|
||||
xlog("L_ALERT","delete N5 Session for $fu due to de-register\n");
|
||||
route(REG_N5_TERMINATE);
|
||||
}
|
||||
# Trying a dirty workaround to make it only excute after IPSec tunnel to prevent double excution
|
||||
if ($expires(min) != 0 && is_present_hf("Security-Verify")) {
|
||||
route(REGISTER_N5_REQ);
|
||||
}
|
||||
|
||||
if ($expires(min) == 0) {
|
||||
xlog("L_ALERT","Delete N5 Session for $fu due to de-register\n");
|
||||
route(REG_N5_TERMINATE);
|
||||
}
|
||||
#!endif
|
||||
|
||||
#!ifdef WITH_IPSEC
|
||||
$sht(ipsec_clients=>$(ct{nameaddr.uri})) = $null;
|
||||
@@ -272,8 +272,8 @@ onreply_route[REGISTER_reply]
|
||||
update_stat("register_success", "+1");
|
||||
update_stat("register_time", "$var(stat_add)");
|
||||
#!ifdef WITH_IPSEC
|
||||
ipsec_forward("location", IPSEC_FORWARD_FLAGS);
|
||||
}
|
||||
ipsec_forward("location", IPSEC_FORWARD_FLAGS);
|
||||
}
|
||||
else {
|
||||
if (t_check_status("401")) {
|
||||
if($(T_req($hdr(Security-Client))) != $null && ipsec_create("location", IPSEC_DELETE_UNUSED_TUNNELS)!=1) {
|
||||
@@ -299,9 +299,9 @@ onreply_route[REGISTER_reply]
|
||||
}
|
||||
xnotice("New header - WWW-Authenticate=$var(new_hdr)\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
#!endif
|
||||
}
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -310,11 +310,12 @@ onreply_route[REGISTER_reply]
|
||||
failure_route[REGISTER_failure]
|
||||
{
|
||||
|
||||
# Terminate N5 Session on Reg Failure
|
||||
|
||||
if (t_check_status("403|408|[5-6][0-9][0-9]")) {
|
||||
route(REG_N5_TERMINATE);
|
||||
}
|
||||
#!ifdef WITH_N5
|
||||
# Terminate N5 Session on Reg Failure
|
||||
if (t_check_status("403|408|[5-6][0-9][0-9]")) {
|
||||
route(REG_N5_TERMINATE);
|
||||
}
|
||||
#!endif
|
||||
|
||||
#!ifdef WITH_IPBLOCK
|
||||
if (t_check_status("403|[5-6][0-9][0-9]")) {
|
||||
@@ -327,198 +328,161 @@ failure_route[REGISTER_failure]
|
||||
xlog("Blocking traffic from $si\n");
|
||||
$sht(ipban=>$si) = 1;
|
||||
}
|
||||
update_stat("register_failed", "+1");
|
||||
update_stat("register_failed", "+1");
|
||||
}
|
||||
#!endif
|
||||
if (t_check_status("408")) {
|
||||
send_reply("504","Server Time-Out");
|
||||
update_stat("register_failed", "+1");
|
||||
update_stat("register_failed", "+1");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#!ifdef WITH_N5
|
||||
|
||||
|
||||
|
||||
|
||||
#############################################
|
||||
##### 5G Experemntal PCF N5 Interface Reg ##
|
||||
#############################################
|
||||
|
||||
route[REGISTER_N5_Req]
|
||||
# N5 Policy Authorization - Create Application session context for SIP Registration
|
||||
route[REGISTER_N5_REQ]
|
||||
{
|
||||
|
||||
xlog("L_INFO","SIP Registration - Starting N5 QoS Auth for $fu\n");
|
||||
|
||||
xlog("L_INFO","its a Registration, starting N5 QoS Auth for $fu\n");
|
||||
|
||||
xlog("L_INFO","Initialize empty arrays and objects\n");
|
||||
### Initialize empty arrays and objects
|
||||
$var(events) = '[]';
|
||||
$var(medComponents) = '{}';
|
||||
$var(medSubComps) = '{}';
|
||||
$var(evSubsc) = '{}';
|
||||
$var(payload) = '{}';
|
||||
$var(events) = '[]';
|
||||
$var(medComponents) = '{}';
|
||||
$var(medSubComps) = '{}';
|
||||
$var(evSubsc) = '{}';
|
||||
$var(payload) = '{}';
|
||||
|
||||
### Set afAppId and dnn in payload
|
||||
jansson_set("string", "afAppId", "+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\"", "$var(payload)"); # adding a note that this could be improved in future to get the value SIP Header
|
||||
jansson_set("string", "dnn", "ims", "$var(payload)");
|
||||
# Set afAppId and dnn in payload
|
||||
jansson_set("string", "afAppId", "+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel\"", "$var(payload)"); # adding a note that this could be improved in future to get the value SIP Header
|
||||
jansson_set("string", "dnn", "ims", "$var(payload)");
|
||||
|
||||
### Set medComponents
|
||||
jansson_set("integer", "medCompN", 0, "$var(medComp)");
|
||||
jansson_set("string", "qosReference", "qosVoNR", "$var(medComp)");
|
||||
jansson_set("string", "medType", "CONTROL", "$var(medComp)");
|
||||
# Set media components in payload
|
||||
jansson_set("integer", "medCompN", 0, "$var(medComp)");
|
||||
jansson_set("string", "qosReference", "qosVoNR", "$var(medComp)");
|
||||
jansson_set("string", "medType", "CONTROL", "$var(medComp)");
|
||||
|
||||
jansson_set("integer", "fNum", 0, "$var(medSubComp)");
|
||||
jansson_set("array", "fDescs", "[\"permit out ip from $RAi $RAp to $si $sp\", \"permit in ip from $si $sp to $RAi $RAp\"]", "$var(medSubComp)");
|
||||
jansson_set("string", "fStatus", "ENABLED", "$var(medSubComp)");
|
||||
jansson_set("string", "flowUsage", "AF_SIGNALLING", "$var(medSubComp)");
|
||||
# jansson_set("string", "marBwDl", "5000 Kbps", "$var(medSubComp)");
|
||||
# jansson_set("string", "marBwUl", "3000 Kbps", "$var(medSubComp)");
|
||||
jansson_set("obj", "0", "$var(medSubComp)", "$var(medSubComps)");
|
||||
jansson_set("obj", "medSubComps", "$var(medSubComps)", "$var(medComp)");
|
||||
|
||||
jansson_set("obj", "0", "$var(medComp)", "$var(medComponents)");
|
||||
jansson_set("obj", "medComponents", "$var(medComponents)", "$var(payload)");
|
||||
jansson_set("integer", "fNum", 0, "$var(medSubComp)");
|
||||
jansson_set("array", "fDescs", "[\"permit out ip from $RAi $RAp to $si $sp\", \"permit in ip from $si $sp to $RAi $RAp\"]", "$var(medSubComp)");
|
||||
jansson_set("string", "fStatus", "ENABLED", "$var(medSubComp)");
|
||||
jansson_set("string", "flowUsage", "AF_SIGNALLING", "$var(medSubComp)");
|
||||
# jansson_set("string", "marBwDl", "5000 Kbps", "$var(medSubComp)");
|
||||
# jansson_set("string", "marBwUl", "3000 Kbps", "$var(medSubComp)");
|
||||
jansson_set("obj", "0", "$var(medSubComp)", "$var(medSubComps)");
|
||||
jansson_set("obj", "medSubComps", "$var(medSubComps)", "$var(medComp)");
|
||||
|
||||
xlog("L_INFO","Set evSubsc\n");
|
||||
jansson_set("obj", "0", "$var(medComp)", "$var(medComponents)");
|
||||
jansson_set("obj", "medComponents", "$var(medComponents)", "$var(payload)");
|
||||
|
||||
### Set evSubsc
|
||||
jansson_set("string", "event", "QOS_NOTIF", "$var(event1)");
|
||||
jansson_set("string", "notifMethod", "PERIODIC", "$var(event1)");
|
||||
jansson_append("obj", "", "$var(event1)", "$var(events)");
|
||||
jansson_set("string", "event", "ANI_REPORT", "$var(event2)");
|
||||
jansson_set("string", "notifMethod", "ONE_TIME", "$var(event2)");
|
||||
jansson_append("obj", "", "$var(event2)", "$var(events)");
|
||||
jansson_set("array", "events", "$var(events)", "$var(evSubsc)");
|
||||
# Set evSubsc
|
||||
jansson_set("string", "event", "QOS_NOTIF", "$var(event1)");
|
||||
jansson_set("string", "notifMethod", "PERIODIC", "$var(event1)");
|
||||
jansson_append("obj", "", "$var(event1)", "$var(events)");
|
||||
jansson_set("string", "event", "ANI_REPORT", "$var(event2)");
|
||||
jansson_set("string", "notifMethod", "ONE_TIME", "$var(event2)");
|
||||
jansson_append("obj", "", "$var(event2)", "$var(events)");
|
||||
jansson_set("array", "events", "$var(events)", "$var(evSubsc)");
|
||||
|
||||
jansson_set("obj", "evSubsc", "$var(evSubsc)", "$var(payload)");
|
||||
jansson_set("obj", "evSubsc", "$var(evSubsc)", "$var(payload)");
|
||||
|
||||
### Set other parameters in payload
|
||||
jansson_set("string", "notifUri", "http://172.22.0.21:7777", "$var(payload)");
|
||||
jansson_set("string", "sponStatus", "SPONSOR_DISABLED", "$var(payload)");
|
||||
jansson_set("string", "supi", "imsi-$au", "$var(payload)");
|
||||
jansson_set("string", "suppFeat", "2", "$var(payload)");
|
||||
jansson_set("string", "ueIpv4", "$si", "$var(payload)");
|
||||
# Set other parameters in payload
|
||||
jansson_set("string", "notifUri", "http://172.22.0.21:7777", "$var(payload)");
|
||||
jansson_set("string", "sponStatus", "SPONSOR_DISABLED", "$var(payload)");
|
||||
jansson_set("string", "supi", "imsi-$au", "$var(payload)");
|
||||
jansson_set("string", "suppFeat", "2", "$var(payload)");
|
||||
jansson_set("string", "ueIpv4", "$si", "$var(payload)");
|
||||
|
||||
### Assemble the final JSON request
|
||||
jansson_set("obj", "ascReqData", "$var(payload)", "$var(json_request)");
|
||||
# Assemble the final JSON request
|
||||
jansson_set("obj", "ascReqData", "$var(payload)", "$var(json_request)");
|
||||
|
||||
xlog("L_INFO","Set headers for the HTTP2 Request\n");
|
||||
### Set headers
|
||||
$var(time_now)=$_s($timef(%a, %d %b %Y %H:%M:%S %Z));
|
||||
xlog("L_INFO", "Today is $var(time_now)\n");
|
||||
|
||||
$var(headers) = "Content-Type: application/json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/json\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/problem+json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-max-rsp-time: 10000\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-service-names: npcf-policyauthorization\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now);
|
||||
|
||||
xlog("L_INFO","DEBUG: Sending the request to PCF\n");
|
||||
### Send the request to PCF
|
||||
http_client_request_v2pk("POST", "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions", "$var(json_request)", "$var(headers)", "$var(result)" );
|
||||
# Set HTTP2 request headers
|
||||
$var(time_now)=$_s($timef(%a, %d %b %Y %H:%M:%S %Z));
|
||||
$var(headers) = "Content-Type: application/json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/json\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/problem+json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-max-rsp-time: 10000\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-service-names: npcf-policyauthorization\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now);
|
||||
|
||||
### here we want to kill the dialog in case QoS faild or continue if QoS success.
|
||||
switch ($rc) {
|
||||
xlog("L_INFO","SIP Registration. Sending N5 QoS Auth for $fu to PCF\n");
|
||||
# Send the request to PCF
|
||||
http_client_request_v2pk("POST", "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions", "$var(json_request)", "$var(headers)", "$var(result)" );
|
||||
|
||||
switch ($rc) {
|
||||
# Success case
|
||||
case 201:
|
||||
xlog("L_INFO", "N5 QoS Session successfully Created $rc\n");
|
||||
xlog("L_INFO", "HTTP results: $var(result)\n");
|
||||
xlog("L_INFO", "HTTP response: $rc\n");
|
||||
xlog("L_INFO", "Location Header: $httprhdr(location)\n");
|
||||
xlog("L_INFO", "N5 QoS Session successfully Created $rc\n");
|
||||
xlog("L_INFO", "HTTP results: $var(result)\n");
|
||||
xlog("L_INFO", "HTTP response: $rc\n");
|
||||
xlog("L_INFO", "Location Header: $httprhdr(location)\n");
|
||||
|
||||
# Retrieve the AppSession Id out of the location Header if the resopnse is 201.
|
||||
# Example URL: "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions/(someSessionID)"
|
||||
|
||||
xlog("L_ALERT","Saving AppSessionID to HTABLE\n");
|
||||
# Now I will retrieve the AppSessionID out of the location Header it should be always at the end
|
||||
# Example URL: "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions/(someSessionID)"
|
||||
|
||||
# Firt store the url of the lcoation Header in var
|
||||
$var(url) = $httprhdr(location);
|
||||
|
||||
# Get the length of the URL
|
||||
$var(len) = $(var(url){s.len});
|
||||
|
||||
# Initialize the position variable to the length of the URL
|
||||
$var(pos) = $var(len);
|
||||
|
||||
# Find the position of the last slash by iterating backwards
|
||||
while ($var(pos) > 0) {
|
||||
$var(pos) = $var(pos) - 1;
|
||||
if ($(var(url){s.substr,$var(pos),1}) == "/") {
|
||||
# We've found the last slash
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
# Extract the substring after the last slash
|
||||
# now doing some magic
|
||||
$var(start_pos) = $var(pos) + 1;
|
||||
$var(end_pos) = $var(len) - $var(start_pos);
|
||||
$var(app_session) = $(var(url){s.substr,$var(start_pos),$var(end_pos)});
|
||||
|
||||
# now checking it on console if I got what I wanted :
|
||||
xlog("L_INFO", "AppSession for user $au is: $var(app_session)\n");
|
||||
# Store the url of the location header
|
||||
$var(url) = $httprhdr(location);
|
||||
# Get the length of the URL
|
||||
$var(len) = $(var(url){s.len});
|
||||
# Initialize the position variable to the length of the URL
|
||||
$var(pos) = $var(len);
|
||||
|
||||
# now trying some way to store AppSession with the registred UE
|
||||
$var(user_id) = $au; # should get the user part of the registred UE
|
||||
# Find the position of the last slash by iterating backwards
|
||||
while ($var(pos) > 0) {
|
||||
$var(pos) = $var(pos) - 1;
|
||||
if ($(var(url){s.substr,$var(pos),1}) == "/") {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
# Store the AppSession in the hash table associated with the UE
|
||||
$sht(user_data=>$var(user_id)) = $var(app_session);
|
||||
xlog("L_INFO", "Stored AppSession for user $var(user_id): $var(app_session)\n");
|
||||
# Extract the substring after the last slash
|
||||
$var(start_pos) = $var(pos) + 1;
|
||||
$var(end_pos) = $var(len) - $var(start_pos);
|
||||
$var(app_session) = $(var(url){s.substr,$var(start_pos),$var(end_pos)});
|
||||
|
||||
#######
|
||||
## Storing IMSI for later use :
|
||||
######
|
||||
xlog("L_INFO", "AppSession Id for user $au is: $var(app_session)\n");
|
||||
|
||||
xlog("L_ALERT","Storing User IMSI to HTABLE for later use\n");
|
||||
$var(ue_imsi) = $au;
|
||||
|
||||
# now checking it on console if I got what I wanted :
|
||||
xlog("L_INFO", "IP for UE is: $var(ue_imsi)\n");
|
||||
$var(user_id) = $au;
|
||||
# Store the AppSession Id in the hash table associated with the UE
|
||||
$sht(user_data=>$var(user_id)) = $var(app_session);
|
||||
xlog("L_INFO", "Stored AppSession Id for user $var(user_id): $var(app_session)\n");
|
||||
|
||||
# now trying some way to store AppSession with the registred UE
|
||||
$var(ue_imsi_reg_ip) = $si; # should get the user part of the registred UE
|
||||
|
||||
# Store the AppSession in the hash table associated with the UE
|
||||
$sht(user_ids=>$var(ue_imsi_reg_ip)) = $var(ue_imsi);
|
||||
xlog("L_INFO", "Stored IMSI for IP $var(ue_imsi_reg_ip) is: $var(ue_imsi)\n");
|
||||
break;
|
||||
# now contiue with Reg Proccess, Or:
|
||||
default:
|
||||
xlog("L_ERR", "N5 QoS Session faild - Reason code: $rc\n");
|
||||
send_reply("412", "Register N5 QoS Session Creation faild");
|
||||
exit;
|
||||
} # switch ends here
|
||||
|
||||
### N5 REQ Route END
|
||||
$var(ue_imsi) = $au;
|
||||
$var(ue_imsi_reg_ip) = $si;
|
||||
# Store the AppSession in the hash table associated with the UE
|
||||
$sht(user_ids=>$var(ue_imsi_reg_ip)) = $var(ue_imsi);
|
||||
xlog("L_INFO", "Stored IMSI for IP $var(ue_imsi_reg_ip) is: $var(ue_imsi)\n");
|
||||
break;
|
||||
# Failure case
|
||||
default:
|
||||
xlog("L_ERR", "N5 QoS Session authorization failed - Reason code: $rc\n");
|
||||
send_reply("412", "Register N5 QoS authorization failed");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
###########################
|
||||
## Terminating AppSession #
|
||||
###########################
|
||||
# N5 Policy Authorization - Application session termination for SIP De-registration
|
||||
route[REG_N5_TERMINATE]
|
||||
{
|
||||
xlog("L_ALERT","its a De-Registration for $fu, terminating N5 AppSession\n");
|
||||
# Retrieveing
|
||||
$var(user_id_dereg) = $fU; # User Part of the from Header to get the USER
|
||||
$var(user_appsess_dereg) = $sht(user_data=>$var(user_id_dereg));
|
||||
xlog("L_INFO", "Terminating Stored AppSession for user $var(user_id_dereg): $var(user_appsess_dereg)\n");
|
||||
|
||||
$var(headers) = "X-SIP-Status: De-Registration\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/json\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/problem+json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-max-rsp-time: 10000\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-service-names: npcf-policyauthorization\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now);
|
||||
|
||||
http_client_request_v2pk("POST", "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions/$var(user_appsess_dereg)/delete", "$var(json_request)", "$var(headers)", "$var(result)" );
|
||||
xlog("Termination resuls: $var(result)\n");
|
||||
xlog("L_ALERT", "cURL response: $curlerror(error)\n");
|
||||
xlog("L_INFO", "HTTP results: $var(result)\n");
|
||||
xlog("L_INFO", "HTTP response: $rc\n");
|
||||
xlog("L_INFO", "Location Header: $httprhdr(location)\n");
|
||||
xlog("L_ALERT","SIP De-Registration for $fu - Terminating N5 AppSession\n");
|
||||
# Retrieve the AppSession Id from the hash table
|
||||
$var(user_id_dereg) = $fU;
|
||||
$var(user_appsess_dereg) = $sht(user_data=>$var(user_id_dereg));
|
||||
xlog("L_INFO", "Terminating stored AppSession for user $var(user_id_dereg): $var(user_appsess_dereg)\n");
|
||||
|
||||
$var(headers) = "X-SIP-Status: De-Registration\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/json\r\n";
|
||||
$var(headers) = $var(headers) + "accept: application/problem+json\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-max-rsp-time: 10000\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-discovery-service-names: npcf-policyauthorization\r\n";
|
||||
$var(headers) = $var(headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now);
|
||||
|
||||
http_client_request_v2pk("POST", "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions/$var(user_appsess_dereg)/delete", "$var(json_request)", "$var(headers)", "$var(result)" );
|
||||
xlog("Termination resuls: $var(result)\n");
|
||||
xlog("L_ALERT", "cURL response: $curlerror(error)\n");
|
||||
xlog("L_INFO", "HTTP results: $var(result)\n");
|
||||
xlog("L_INFO", "HTTP response: $rc\n");
|
||||
xlog("L_INFO", "Location Header: $httprhdr(location)\n");
|
||||
}
|
||||
|
||||
#!endif
|
||||
|
Reference in New Issue
Block a user