aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel <0xc0decafe@users.noreply.github.com>2016-10-18 11:11:31 +0200
committerDaniel <0xc0decafe@users.noreply.github.com>2016-10-18 11:11:31 +0200
commit03f50f3727f0a34553dc40b6613052af346822e4 (patch)
treed39553e1fdf371f7c9353c75a62b47acdac0d0da
parent1deecad86cf30076de0b85e4aacb911c711ab23c (diff)
added provideSubscriberLocation, anyTimeModification
-rw-r--r--src/map_msgs.erl69
-rw-r--r--src/map_tests.erl9
2 files changed, 44 insertions, 34 deletions
diff --git a/src/map_msgs.erl b/src/map_msgs.erl
index 3ee6e5d..aae69ad 100644
--- a/src/map_msgs.erl
+++ b/src/map_msgs.erl
@@ -502,6 +502,25 @@ create_processUnstructuredSS(Imsi, Msisdn, UssdString) ->
asn1_NOVALUE,asn1_NOVALUE},
encode_map_pdu(EncDialoguePDU, 59, MapData).
+% gsm_map and tcap.localValue == 65
+create_anyTimeModification() ->
+ create_anyTimeModification(?IMSI, ?LOCAL_GLOBAL_TITLE).
+create_anyTimeModification(Imsi, GsmSCF) ->
+ MapData = {'AnyTimeModificationArg',
+ {imsi, ss7_helper:encode_imsi(Imsi)}, %~ subscriberIdentity [0] SubscriberIdentity,
+ ss7_helper:encode_msisdn(?NUMBER_EXTENSION_NONE,
+ ?NUMBER_NATURE_INTERNATIONAL, ?NUMBER_PLAN_ISDN,
+ GsmSCF), %~ gsmSCF-Address [1] ISDN-AddressString,
+ asn1_NOVALUE, %~ modificationRequestFor-CF-Info [2] ModificationRequestFor-CF-Info OPTIONAL,
+ asn1_NOVALUE, %~ modificationRequestFor-CB-Info [3] ModificationRequestFor-CB-Info OPTIONAL,
+ asn1_NOVALUE, %~ modificationRequestFor-CSI [4] ModificationRequestFor-CSI OPTIONAL,
+ asn1_NOVALUE, %~ extensionContainer [5] ExtensionContainer OPTIONAL,
+ asn1_NOVALUE, %~ longFTN-Supported [6] NULL OPTIONAL,
+ asn1_NOVALUE %~ modificationRequestFor-ODB-data [7] ModificationRequestFor-ODB-data OPTIONAL
+ },
+ Dialog = build_dialog_request(?'anyTimeInfoHandlingContext-v3'),
+ encode_map_pdu(Dialog, 65, MapData).
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% to MSC/VLR
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -530,36 +549,26 @@ create_provideSubscriberInfo(Imsi) ->
encode_map_pdu(Dialog, 70, MapData).
create_provideSubscriberLocation() ->
- create_provideSubscriberLocation(?IMSI).
-create_provideSubscriberLocation(Imsi) ->
- MapData = {'ProvideSubscriberLocationArg'
- %~ locationType LocationType,
- %~ mlc-Number ISDN-AddressString,
- %~ lcs-ClientID [0] LCS-ClientID OPTIONAL,
- %~ privacyOverride [1] NULL OPTIONAL,
- %~ imsi [2] IMSI OPTIONAL,
- %~ msisdn [3] ISDN-AddressString OPTIONAL,
- %~ lmsi [4] LMSI OPTIONAL,
- %~ imei [5] IMEI OPTIONAL,
- %~ lcs-Priority [6] LCS-Priority OPTIONAL,
- %~ lcs-QoS [7] LCS-QoS OPTIONAL,
- %~ extensionContainer [8] ExtensionContainer OPTIONAL,
- %~ ...,
- %~ supportedGADShapes [9] SupportedGADShapes OPTIONAL,
- %~ lcs-ReferenceNumber [10] LCS-ReferenceNumber OPTIONAL,
- %~ lcsServiceTypeID [11] LCSServiceTypeID OPTIONAL,
- %~ lcsCodeword [12] LCSCodeword OPTIONAL
- %~ -- one of imsi or msisdn is mandatory
- %~ -- If a location estimate type indicates activate deferred location or cancel deferred
- %~ -- location, a lcs-Reference number shall be included.
- %~ LocationType ::= SEQUENCE {
- %~ locationEstimateType [0] LocationEstimateType,
- %~ ...,
- %~ deferredLocationEventType [1] DeferredLocationEventType OPTIONAL}
-
- %~ LocationEstimateType ::= ENUMERATED {
- %~ currentLocation(0), currentOrLastKnownLocation(1), initialLocation(2), ...,
- %~ activateDeferredLocation(3), cancelDeferredLocation(4)}
+ create_provideSubscriberLocation(?IMSI, ?LOCAL_GLOBAL_TITLE).
+create_provideSubscriberLocation(Imsi, Mlc) ->
+ MapData = {'ProvideSubscriberLocationArg',
+ {currentOrLastKnownLocation, asn1_NOVALUE}, %~ locationType LocationType,
+ ss7_helper:encode_msisdn(?NUMBER_EXTENSION_NONE,
+ ?NUMBER_NATURE_INTERNATIONAL, ?NUMBER_PLAN_ISDN,
+ Mlc), %~ mlc-Number ISDN-AddressString,
+ asn1_NOVALUE, %~ lcs-ClientID [0] LCS-ClientID OPTIONAL,
+ asn1_NOVALUE, %~ privacyOverride [1] NULL OPTIONAL,
+ ss7_helper:encode_imsi(Imsi), %~ imsi [2] IMSI OPTIONAL,
+ asn1_NOVALUE, %~ msisdn [3] ISDN-AddressString OPTIONAL,
+ asn1_NOVALUE, %~ lmsi [4] LMSI OPTIONAL,
+ asn1_NOVALUE, %~ imei [5] IMEI OPTIONAL,
+ asn1_NOVALUE, %~ lcs-Priority [6] LCS-Priority OPTIONAL,
+ asn1_NOVALUE, %~ lcs-QoS [7] LCS-QoS OPTIONAL,
+ asn1_NOVALUE, %~ extensionContainer [8] ExtensionContainer OPTIONAL,
+ asn1_NOVALUE, %~ supportedGADShapes [9] SupportedGADShapes OPTIONAL,
+ asn1_NOVALUE, %~ lcs-ReferenceNumber [10] LCS-ReferenceNumber OPTIONAL,
+ asn1_NOVALUE, %~ lcsServiceTypeID [11] LCSServiceTypeID OPTIONAL,
+ asn1_NOVALUE %~ lcsCodeword [12] LCSCodeword OPTIONAL
},
Dialog = build_dialog_request(?'locationInfoRetrievalContext-v3'),
encode_map_pdu(Dialog, 83, MapData).
diff --git a/src/map_tests.erl b/src/map_tests.erl
index 77a8224..152094e 100644
--- a/src/map_tests.erl
+++ b/src/map_tests.erl
@@ -11,8 +11,7 @@
%~ =========
test_hlr(L) ->
- LocalSsn = ?SCCP_SSN_MSC,
- ok = sccp_user:bind_ssn(LocalSsn),
+ ok = sccp_user:bind_ssn(?SCCP_SSN_MSC),
Gts = {L#loop_dat.gt_local, L#loop_dat.gt_hlr},
test_sri(Gts, L),
test_srifs(Gts, L),
@@ -25,8 +24,10 @@ test_hlr(L) ->
test_ul(Gts, L2),
test_ati(Gts, L2),
test_pms(Gts, L2),
+ ok = sccp_user:unbind_ssn(?SCCP_SSN_MSC, undefined),
+ ok = sccp_user:bind_ssn(?SCCP_SSN_VLR),
test_pus(Gts, L2),
- ok = sccp_user:unbind_ssn(LocalSsn, undefined),
+ ok = sccp_user:unbind_ssn(?SCCP_SSN_VLR, undefined),
L2.
test_sri(Gts, L) ->
@@ -355,7 +356,7 @@ test_pus(Gts, L) ->
%~ processUnstructuredSS
%~ ========
io:format("~n\e[93;1m# Testing processUnstructuredSS...\n\e[39;49;0m"),
- tcap:send_tcap(L, Gts, {?SCCP_SSN_MSC, ?SCCP_SSN_HLR}, map_msgs:create_processUnstructuredSS(L#loop_dat.imsi, L#loop_dat.msisdn, "*100#")),
+ tcap:send_tcap(L, Gts, {?SCCP_SSN_VLR, ?SCCP_SSN_HLR}, map_msgs:create_processUnstructuredSS(L#loop_dat.imsi, L#loop_dat.msisdn, "*100#")),
receive
{sccp, {primitive, 'N', 'UNITDATA', indication, Data}} ->
case tcap:decode_tcap(Data) of