From de592d011d394b31ecb97e7a408a295351ecbc75 Mon Sep 17 00:00:00 2001 From: liuxueli Date: Thu, 12 Oct 2023 10:04:07 +0800 Subject: 修复笔误导致phone_number解析失败 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/tsg_dynamic_mapping_maat.json | 6 ++++-- src/tsg_rule.cpp | 2 +- test/bin/gtest_dyn_mapping_maat.json | 2 +- test/src/gtest_rule.cpp | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/tsg_dynamic_mapping_maat.json b/bin/tsg_dynamic_mapping_maat.json index 407b00e..c70fe9a 100644 --- a/bin/tsg_dynamic_mapping_maat.json +++ b/bin/tsg_dynamic_mapping_maat.json @@ -4,8 +4,10 @@ { "table_name": "TSG_DYN_IPPORT_SUBSCRIBER_MAPPING", "table_content": [ - "1052\t4\t192.168.50.52\ttest52\t0\t255\t1\t{\"imei\":\"1298473129873912\",\"imsi\":\"231\",\"apn\":\"ufone.pin\"}", - "1037\t4\t192.168.50.37\ttest37\t40001\t40255\tnull\t1" + "1052\t4\t192.168.50.52\ttest52\t0\t255\t1\tnull", + "1037\t4\t192.168.50.37\ttest37\t40001\t40255\t1\t{\"imei\":\"1298473129873912\",\"apn\":\"test.com\"}", + "1040\t6\t1030::C9B4:FF12:48AA:1040\ttest1040\t10240\t12800\t1\t{\"imei\":\"1298473129873912\",\"imsi\":\"231\"}", + "1041\t4\t196.189.54.123\ttest1041\t2\t65156\t1\t{\"imei\":\"3527916051651178\",\"imsi\":\"410033150502325\",\"apn\":\"ufone.pinternet\",\"phone_number\":\"923368865801\"}" ] } ] diff --git a/src/tsg_rule.cpp b/src/tsg_rule.cpp index e5cd335..5f03d64 100644 --- a/src/tsg_rule.cpp +++ b/src/tsg_rule.cpp @@ -768,7 +768,7 @@ void ipport_mapping_mobile_identify_parse(struct dynamic_ipport_mapping *ipport_ get_string_from_json(object, "imei", &(ipport_mapping->imei)); get_string_from_json(object, "imsi", &(ipport_mapping->imsi)); - get_string_from_json(object, "phone_numer", &(ipport_mapping->msisdn)); + get_string_from_json(object, "phone_number", &(ipport_mapping->msisdn)); get_string_from_json(object, "apn", &(ipport_mapping->apn)); cJSON_Delete(object); diff --git a/test/bin/gtest_dyn_mapping_maat.json b/test/bin/gtest_dyn_mapping_maat.json index 454b53f..c734fc6 100644 --- a/test/bin/gtest_dyn_mapping_maat.json +++ b/test/bin/gtest_dyn_mapping_maat.json @@ -7,7 +7,7 @@ "1052\t4\t192.168.50.52\ttest52\t0\t255\t1\tnull", "1037\t4\t192.168.50.37\ttest37\t40001\t40255\t1\t{\"imei\":\"1298473129873912\",\"apn\":\"test.com\"}", "1040\t6\t1030::C9B4:FF12:48AA:1040\ttest1040\t10240\t12800\t1\t{\"imei\":\"1298473129873912\",\"imsi\":\"231\"}", - "1041\t6\t1030::C9B4:FF12:3799:1041\ttest1041\t25600\t25856\t1\t{\"imei\":\"1298473129873912\",\"imsi\":\"231\",\"phone_numer\":\"123456789\"}" + "1041\t6\t1030::C9B4:FF12:3799:1041\ttest1041\t25600\t25856\t1\t{\"imei\":\"1298473129873912\",\"imsi\":\"231\",\"phone_number\":\"123456789\"}" ] } ] diff --git a/test/src/gtest_rule.cpp b/test/src/gtest_rule.cpp index 88a09d6..60e4207 100644 --- a/test/src/gtest_rule.cpp +++ b/test/src/gtest_rule.cpp @@ -408,7 +408,7 @@ TEST(TM, ExDataDynamicIPPortMappingSubscriberID) "1052\t4\t192.168.50.52\ttest52\t0\t255\t1\tnull", "1037\t4\t192.168.50.37\ttest37\t40001\t40255\t1\t{\"imei\":\"1298473129873912\",\"apn\":\"test.com\"}", "1040\t6\t1030::C9B4:FF12:48AA:1040\ttest1040\t10240\t12800\t1\t{\"imei\":\"1298473129873912\",\"imsi\":\"231\"}", - "1041\t6\t1030::C9B4:FF12:3799:1041\ttest1041\t25600\t25856\t1\t{\"imei\":\"1298473129873912\",\"imsi\":\"231\",\"phone_numer\":\"123456789\"}" + "1041\t6\t1030::C9B4:FF12:3799:1041\ttest1041\t25600\t25856\t1\t{\"imei\":\"1298473129873912\",\"imsi\":\"231\",\"phone_number\":\"123456789\"}" **************************************************************************************************************************/ struct streaminfo a_stream = {0}; struct dynamic_ipport_mapping *dest_mapping = NULL; -- cgit v1.2.3