DIAMETER_Emulation: Add support for IMSI in Subscription-Id
Ths IMSI on the Gx interface is encoded into a different AVP than
on the S6a/S6d interfaces. Let's make sure our DIAMETER_Emulation
knows both formats.
Change-Id: I299fcc2e01e908914df32fda4fb93b1114402c77
diff --git a/library/DIAMETER_Emulation.ttcn b/library/DIAMETER_Emulation.ttcn
index fad44c3..6dd44b3 100644
--- a/library/DIAMETER_Emulation.ttcn
+++ b/library/DIAMETER_Emulation.ttcn
@@ -216,7 +216,16 @@
imsi_avp := f_DIAMETER_get_avp(pdu, c_AVP_Code_BASE_NONE_User_Name);
if (istemplatekind(imsi_avp, "omit")) {
- return omit;
+ var template (omit) AVP sid_avp;
+ sid_avp := f_DIAMETER_get_avp(pdu, c_AVP_Code_DCC_NONE_Subscription_Id);
+ if (istemplatekind(sid_avp, "omit")) {
+ return omit;
+ }
+ var AVP_Grouped grp := valueof(sid_avp.avp_data.avp_DCC_NONE_Subscription_Id);
+ if (not match(grp[0], tr_SubcrIdType(END_USER_IMSI))) {
+ return omit;
+ }
+ return str2hex(oct2char(grp[1].avp.avp_data.avp_DCC_NONE_Subscription_Id_Data));
} else {
var octetstring imsi_oct := valueof(imsi_avp.avp_data.avp_BASE_NONE_User_Name);
return str2hex(oct2char(imsi_oct));