laforge submitted this change.
esipa_asn1_handler: set ecallIndication and fallbackAllowed
SGP.32 adds two new fields (ecallIndication and fallbackAllowed)
to the StoreMetadataRequest. Those fields have to be added to
the StoreMetadataRequest before it is sent to the IPAd via the
AuthenticateClientResponseEsipa.
Change-Id: I4b7673007018d32d062e238d811f655d332f7195
Related: SYS#8100
---
M priv/rest_api_resource_schema.json
M src/esipa_asn1_handler.erl
2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/priv/rest_api_resource_schema.json b/priv/rest_api_resource_schema.json
index 4ddbb8e..69b0060 100644
--- a/priv/rest_api_resource_schema.json
+++ b/priv/rest_api_resource_schema.json
@@ -21,6 +21,14 @@
"activationCode": {
"description": "see GSMA SGP.22, section 4.1",
"type": "string"
+ },
+ "ecallIndication": {
+ "description": "see GSMA SGP.32, section 4.4",
+ "type": "boolean"
+ },
+ "fallbackAllowed": {
+ "description": "see GSMA SGP.32, section 4.4",
+ "type": "boolean"
}
},
"required": [
diff --git a/src/esipa_asn1_handler.erl b/src/esipa_asn1_handler.erl
index df208cf..c006a7a 100644
--- a/src/esipa_asn1_handler.erl
+++ b/src/esipa_asn1_handler.erl
@@ -58,7 +58,7 @@
%GSMA SGP.32, section 6.3.2.2
handle_asn1(Pid, {authenticateClientRequestEsipa, EsipaReq}) ->
TransactionId = maps:get(transactionId, EsipaReq),
- {EidValue, _, WorkState} = mnesia_db_work:pickup(Pid, TransactionId),
+ {EidValue, Order, WorkState} = mnesia_db_work:pickup(Pid, TransactionId),
BaseUrl = maps:get(smdpAddress, WorkState),
% setup ES9+ request message
@@ -91,7 +91,21 @@
EsipaResp =
case Es9Resp of
{authenticateClientOk, AuthClntRespEs9} ->
- {authenticateClientOkDPEsipa, AuthClntRespEs9};
+ % Populate ecallIndication and fallbackAllowed of SGP32-StoreMetadataRequest
+ {[{<<"download">>, {Download}}]} = Order,
+ EcallIndication = proplists:get_value(<<"ecallIndication">>, Download, false),
+ FallbackAllowed = proplists:get_value(<<"fallbackAllowed">>, Download, false),
+ StoreMetadataRequest = maps:merge(
+ maps:get(profileMetaData, AuthClntRespEs9),
+ #{
+ ecallIndication => EcallIndication,
+ fallbackAllowed => FallbackAllowed
+ }
+ ),
+ AuthenticateClientOkDPEsipa = AuthClntRespEs9#{
+ profileMetaData => StoreMetadataRequest
+ },
+ {authenticateClientOkDPEsipa, AuthenticateClientOkDPEsipa};
{authenticateClientError, AuthClntErr} ->
OutcomeEs9p = [{[{authenticateClientError, AuthClntErr}]}],
ok = mnesia_db_work:finish(Pid, OutcomeEs9p, EsipaReq),
@@ -277,7 +291,8 @@
EimTransactionId = rand:bytes(16),
mnesia_db_work:bind(Pid, EimTransactionId),
mnesia_db_work:update(Pid, #{}),
- {[{<<"download">>, {[{<<"activationCode">>, ActivationCode}]}}]} = Order,
+ {[{<<"download">>, {Download}}]} = Order,
+ ActivationCode = proplists:get_value(<<"activationCode">>, Download),
{profileDownloadTriggerRequest, #{
profileDownloadData => {activationCode, ActivationCode},
eimTransactionId => EimTransactionId
To view, visit change 43430. To unsubscribe, or for help writing mail filters, visit settings.