Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-sinina committed Dec 16, 2024
1 parent 847aa9a commit 571b9fa
Show file tree
Hide file tree
Showing 4 changed files with 1,627 additions and 34 deletions.
37 changes: 20 additions & 17 deletions db/cdr_migrate/20241216143200_new_cdr_sp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ def up
v_version_data:=json_populate_record(null::switch.versions_ty, i_versions);
v_dynamic:=json_populate_record(null::switch.dynamic_cdr_data_ty, i_dynamic);
v_lega_request_headers:=json_populate_record(null::switch.lega_request_headers_ty, i_lega_request_headers);
v_legb_request_headers:=json_populate_record(null::switch.legb_request_headers_ty, i_legb_request_headers);
v_legb_reply_headers:=json_populate_record(null::switch.legb_reply_headers_ty, i_legb_reply_headers);
v_lega_request_headers = json_populate_record(null::switch.lega_request_headers_ty, i_lega_request_headers);
v_legb_request_headers = json_populate_record(null::switch.legb_request_headers_ty, i_legb_request_headers);
v_legb_reply_headers = json_populate_record(null::switch.legb_reply_headers_ty, i_legb_reply_headers);
v_cdr.p_charge_info_in = v_lega_request_headers.p_charge_info;
Expand All @@ -204,6 +204,20 @@ def up
v_cdr.legb_q850_text = v_legb_reason.q850_text;
v_cdr.legb_q850_params = v_legb_reason.q850_params;
v_cdr.diversion_in = array_to_string(v_lega_request_headers.diversion, ',');
v_cdr.pai_in = array_to_string(v_lega_request_headers.p_asserted_identity, ',');
v_cdr.ppi_in = v_lega_request_headers.p_preferred_identity;
v_cdr.privacy_in = array_to_string(v_lega_request_headers.privacy, ',');
v_cdr.rpid_in = array_to_string(v_lega_request_headers.remote_party_id, ',');
v_cdr.rpid_privacy_in = array_to_string(v_lega_request_headers.rpid_privacy, ',');
v_cdr.diversion_out = array_to_string(v_legb_request_headers.diversion, ',');
v_cdr.pai_out = array_to_string(v_legb_request_headers.p_asserted_identity, ',');
v_cdr.ppi_out = v_legb_request_headers.p_preferred_identity;
v_cdr.privacy_out = array_to_string(v_legb_request_headers.privacy, ',');
v_cdr.rpid_out = array_to_string(v_legb_request_headers.remote_party_id, ',');
v_cdr.rpid_privacy_out = array_to_string(v_legb_request_headers.rpid_privacy, ',');
v_cdr.lega_identity = i_lega_identity;
v_cdr.lega_ss_status_id = v_dynamic.lega_ss_status_id;
v_cdr.legb_ss_status_id = v_dynamic.legb_ss_status_id;
Expand Down Expand Up @@ -359,8 +373,11 @@ def up
v_cdr.src_country_id = v_dynamic.src_country_id;
v_cdr.src_network_id = v_dynamic.src_network_id;
v_cdr.src_network_type_id = v_dynamic.src_network_type_id;
v_cdr.dst_country_id = v_dynamic.dst_country_id;
v_cdr.dst_network_id = v_dynamic.dst_network_id;
v_cdr.dst_network_type_id = v_dynamic.dst_network_type_id;
v_cdr.dst_prefix_routing = v_dynamic.dst_prefix_routing;
v_cdr.src_prefix_routing = v_dynamic.src_prefix_routing;
v_cdr.routing_plan_id = v_dynamic.routing_plan_id;
Expand All @@ -379,20 +396,6 @@ def up
v_cdr.id = nextval('cdr.cdr_id_seq'::regclass);
v_cdr.uuid = public.uuid_generate_v1();
v_cdr.diversion_in = array_to_string(v_lega_request_headers.diversion, ',');
v_cdr.pai_in = string_to_array(v_lega_request_headers.p_asserted_identity, ',');
v_cdr.ppi_in = v_lega_request_headers.p_preferred_identity;
v_cdr.privacy_in = string_to_array(v_lega_request_headers.privacy, ',');
v_cdr.rpid_in = string_to_array(v_lega_request_headers.remote_party_id, ',');
v_cdr.rpid_privacy_in = string_to_array(v_lega_request_headers.rpid_privacy, ',');
v_cdr.diversion_out = array_to_string(v_legb_request_headers.diversion, ',');
v_cdr.pai_out = string_to_array(v_lega_request_headers.p_asserted_identity, ',');
v_cdr.ppi_out = v_lega_request_headers.p_preferred_identity;
v_cdr.privacy_out = string_to_array(v_lega_request_headers.privacy, ',');
v_cdr.rpid_out = string_to_array(v_lega_request_headers.remote_party_id, ',');
v_cdr.rpid_privacy_out = string_to_array(v_lega_request_headers.rpid_privacy, ',');
v_cdr.failed_resource_type_id = i_failed_resource_type_id;
v_cdr.failed_resource_id = i_failed_resource_id;
Expand Down
37 changes: 20 additions & 17 deletions db/cdr_structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1722,9 +1722,9 @@ BEGIN
v_version_data:=json_populate_record(null::switch.versions_ty, i_versions);
v_dynamic:=json_populate_record(null::switch.dynamic_cdr_data_ty, i_dynamic);

v_lega_request_headers:=json_populate_record(null::switch.lega_request_headers_ty, i_lega_request_headers);
v_legb_request_headers:=json_populate_record(null::switch.legb_request_headers_ty, i_legb_request_headers);
v_legb_reply_headers:=json_populate_record(null::switch.legb_reply_headers_ty, i_legb_reply_headers);
v_lega_request_headers = json_populate_record(null::switch.lega_request_headers_ty, i_lega_request_headers);
v_legb_request_headers = json_populate_record(null::switch.legb_request_headers_ty, i_legb_request_headers);
v_legb_reply_headers = json_populate_record(null::switch.legb_reply_headers_ty, i_legb_reply_headers);

v_cdr.p_charge_info_in = v_lega_request_headers.p_charge_info;

Expand All @@ -1738,6 +1738,20 @@ BEGIN
v_cdr.legb_q850_text = v_legb_reason.q850_text;
v_cdr.legb_q850_params = v_legb_reason.q850_params;

v_cdr.diversion_in = array_to_string(v_lega_request_headers.diversion, ',');
v_cdr.pai_in = array_to_string(v_lega_request_headers.p_asserted_identity, ',');
v_cdr.ppi_in = v_lega_request_headers.p_preferred_identity;
v_cdr.privacy_in = array_to_string(v_lega_request_headers.privacy, ',');
v_cdr.rpid_in = array_to_string(v_lega_request_headers.remote_party_id, ',');
v_cdr.rpid_privacy_in = array_to_string(v_lega_request_headers.rpid_privacy, ',');

v_cdr.diversion_out = array_to_string(v_legb_request_headers.diversion, ',');
v_cdr.pai_out = array_to_string(v_legb_request_headers.p_asserted_identity, ',');
v_cdr.ppi_out = v_legb_request_headers.p_preferred_identity;
v_cdr.privacy_out = array_to_string(v_legb_request_headers.privacy, ',');
v_cdr.rpid_out = array_to_string(v_legb_request_headers.remote_party_id, ',');
v_cdr.rpid_privacy_out = array_to_string(v_legb_request_headers.rpid_privacy, ',');

v_cdr.lega_identity = i_lega_identity;
v_cdr.lega_ss_status_id = v_dynamic.lega_ss_status_id;
v_cdr.legb_ss_status_id = v_dynamic.legb_ss_status_id;
Expand Down Expand Up @@ -1893,8 +1907,11 @@ BEGIN

v_cdr.src_country_id = v_dynamic.src_country_id;
v_cdr.src_network_id = v_dynamic.src_network_id;
v_cdr.src_network_type_id = v_dynamic.src_network_type_id;
v_cdr.dst_country_id = v_dynamic.dst_country_id;
v_cdr.dst_network_id = v_dynamic.dst_network_id;
v_cdr.dst_network_type_id = v_dynamic.dst_network_type_id;

v_cdr.dst_prefix_routing = v_dynamic.dst_prefix_routing;
v_cdr.src_prefix_routing = v_dynamic.src_prefix_routing;
v_cdr.routing_plan_id = v_dynamic.routing_plan_id;
Expand All @@ -1913,20 +1930,6 @@ BEGIN
v_cdr.id = nextval('cdr.cdr_id_seq'::regclass);
v_cdr.uuid = public.uuid_generate_v1();

v_cdr.diversion_in = array_to_string(v_lega_request_headers.diversion, ',');
v_cdr.pai_in = string_to_array(v_lega_request_headers.p_asserted_identity, ',');
v_cdr.ppi_in = v_lega_request_headers.p_preferred_identity;
v_cdr.privacy_in = string_to_array(v_lega_request_headers.privacy, ',');
v_cdr.rpid_in = string_to_array(v_lega_request_headers.remote_party_id, ',');
v_cdr.rpid_privacy_in = string_to_array(v_lega_request_headers.rpid_privacy, ',');

v_cdr.diversion_out = array_to_string(v_legb_request_headers.diversion, ',');
v_cdr.pai_out = string_to_array(v_lega_request_headers.p_asserted_identity, ',');
v_cdr.ppi_out = v_lega_request_headers.p_preferred_identity;
v_cdr.privacy_out = string_to_array(v_lega_request_headers.privacy, ',');
v_cdr.rpid_out = string_to_array(v_lega_request_headers.remote_party_id, ',');
v_cdr.rpid_privacy_out = string_to_array(v_lega_request_headers.rpid_privacy, ',');

v_cdr.failed_resource_type_id = i_failed_resource_type_id;
v_cdr.failed_resource_id = i_failed_resource_id;

Expand Down
Loading

0 comments on commit 571b9fa

Please sign in to comment.