diff --git a/src/ergw_node_selection.erl b/src/ergw_node_selection.erl index 742969d2..bf48a7f6 100644 --- a/src/ergw_node_selection.erl +++ b/src/ergw_node_selection.erl @@ -112,8 +112,9 @@ expand_apn_plmn(IMSI) when is_binary(IMSI) -> expand_apn_plmn(_) -> ergw:get_plmn_id(). -expand_apn([H|_] = APN, IMSI) +expand_apn([H|_] = APN0, IMSI) when is_binary(H) -> + APN = lowercase_apn(APN0), case lists:reverse(APN) of [<<"gprs">> | _] -> APN; [<<"org">>, <<"3gppnetwork">> | _] -> APN; @@ -132,7 +133,7 @@ split_apn([H|_] = APN) apn_to_fqdn([H|_] = APN, IMSI) when is_binary(H) -> - apn_to_fqdn(expand_apn(lowercase_apn(APN), IMSI)). + apn_to_fqdn(expand_apn(APN, IMSI)). apn_to_fqdn([H|_] = APN) when is_binary(H) -> diff --git a/test/pgw_SUITE.erl b/test/pgw_SUITE.erl index 4d44a14b..0ca32238 100644 --- a/test/pgw_SUITE.erl +++ b/test/pgw_SUITE.erl @@ -2473,7 +2473,7 @@ session_options(Config) -> 'Multi-Session-Id' => '_', 'Diameter-Session-Id' => '_', 'Called-Station-Id' => - unicode:characters_to_binary(lists:join($., ?'APN-ExAmPlE')), + unicode:characters_to_binary(lists:join($., ?'APN-EXAMPLE')), 'Calling-Station-Id' => ?MSISDN, 'Service-Type' => 'Framed-User', 'Framed-Protocol' => 'GPRS-PDP-Context', @@ -3451,7 +3451,7 @@ simple_ocs(Config) -> %% 'Acct-Interim-Interval' => '?????', %% 'Bearer-Operation' => '?????', 'Called-Station-Id' => - unicode:characters_to_binary(lists:join($., ?'APN-ExAmPlE')), + unicode:characters_to_binary(lists:join($., ?'APN-EXAMPLE')), 'Calling-Station-Id' => ?MSISDN, 'Charging-Rule-Base-Name' => <<"m2m0001">>, 'Diameter-Session-Id' => '_', diff --git a/test/saegw_s11_SUITE.erl b/test/saegw_s11_SUITE.erl index 88afa73c..dd1d7656 100644 --- a/test/saegw_s11_SUITE.erl +++ b/test/saegw_s11_SUITE.erl @@ -1147,7 +1147,7 @@ session_options(Config) -> 'Multi-Session-Id' => '_', 'Diameter-Session-Id' => '_', 'Called-Station-Id' => - unicode:characters_to_binary(lists:join($., ?'APN-ExAmPlE')), + unicode:characters_to_binary(lists:join($., ?'APN-EXAMPLE')), 'Calling-Station-Id' => ?MSISDN, 'Service-Type' => 'Framed-User', 'Framed-Protocol' => 'GPRS-PDP-Context', @@ -1605,7 +1605,7 @@ simple_ocs(Config) -> %% 'Acct-Interim-Interval' => '?????', %% 'Bearer-Operation' => '?????', 'Called-Station-Id' => - unicode:characters_to_binary(lists:join($., ?'APN-ExAmPlE')), + unicode:characters_to_binary(lists:join($., ?'APN-EXAMPLE')), 'Calling-Station-Id' => ?MSISDN, 'Charging-Rule-Base-Name' => <<"m2m0001">>, 'Diameter-Session-Id' => '_',