diff --git a/IMS_PART4_IWD_15wk38/Common/Common/CommonDefs.ttcn b/IMS_PART4_IWD_15wk38/Common/Common/CommonDefs.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a6e74c0f1e3f367e0997e3a4c774163b5509205b --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/Common/CommonDefs.ttcn @@ -0,0 +1,1052 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-06-17 14:41:28 +0200 (Wed, 17 Jun 2015) $ +// $Rev: 13929 $ +/******************************************************************************/ + +module CommonDefs { + + //---------------------------------------------------------------------------- + // type definitions: + + type bitstring B1_Type length(1); + type bitstring B2_Type length(2); + type bitstring B3_Type length(3); + type bitstring B4_Type length(4); + type bitstring B5_Type length(5); + type bitstring B6_Type length(6); + type bitstring B7_Type length(7); + type bitstring B7_15_Type length(7..15); // NOTE: length restriction can only be a range but not two destinct lengths + type bitstring B8_Type length(8); + type bitstring B9_Type length(9); + type bitstring B10_Type length(10); + type bitstring B11_Type length(11); + type bitstring B12_Type length(12); + type bitstring B13_Type length(13); + type bitstring B14_Type length(14); + type bitstring B15_Type length(15); + type bitstring B16_Type length(16); + type bitstring B18_Type length(18); + type bitstring B20_Type length(20); + type bitstring B24_Type length(24); + type bitstring B27_Type length(27); + type bitstring B28_Type length(28); + type bitstring B32_Type length(32); + type bitstring B36_Type length(36); + type bitstring B40_Type length(40); + type bitstring B41_Type length(41); + type bitstring B43_Type length(43); + type bitstring B47_Type length(47); + type bitstring B48_Type length(48); + type bitstring B56_Type length(56); + type bitstring B64_Type length(64); + type bitstring B80_Type length(80); + type bitstring B112_Type length(112); + type bitstring B128_Type length(128); + type bitstring B160_Type length(160); + type bitstring B192_Type length(192); + type bitstring B256_Type length(256); + type bitstring B32_128_Type length(32..128); + + type B128_Type B128_Key_Type; /* 128 bit security key */ + type B256_Type B256_Key_Type; /* 256 bit security key */ + + type octetstring O1_Type length(1); + type octetstring O2_Type length(2); + type octetstring O3_Type length(3); + type octetstring O4_Type length(4); + type octetstring O5_Type length(5); + type octetstring O6_Type length(6); + type octetstring O8_Type length(8); + type octetstring O9_Type length(9); + type octetstring O10_Type length(10); + type octetstring O13_Type length(13); + type octetstring O14_Type length(14); + type octetstring O15_Type length(15); + type octetstring O16_Type length(16); + type octetstring O32_Type length(32); + type octetstring O43_Type length(43); + + type hexstring H2_Type length(2); + type hexstring H4_Type length(4); + type hexstring H12_Type length(12); + type hexstring H14_Type length(14); + + type boolean Null_Type (true); // dummy type for 'typeless' fields in unions + type boolean Dummy_Type (true); // dummy type for temporary purposes only + + const integer tsc_UInt8Max := 255; + const integer tsc_UInt16Max := 65535; + const integer tsc_UInt20Max := 1048575; + const integer tsc_UInt32Max := 4294967295; + + type integer UInt_Type (0 .. infinity); + type integer UInt8_Type (0 .. tsc_UInt8Max); + type integer UInt16_Type (0 .. tsc_UInt16Max); + type integer UInt20_Type (0 .. tsc_UInt20Max); + type integer UInt32_Type (0 .. tsc_UInt32Max); + + type charstring Char1_Type length (1); + type record of Char1_Type Char1List_Type; + type record of charstring CharStringList_Type; + + type record of integer IntegerList_Type; + + type enumerated SinglePLMN_TestedType {SinglePLMN, MultiPLMN, MultiPLMNinPrimaryBand, MultiPLMNinSecondaryBand}; // @sic R5-123667 sic@ + type enumerated EUTRA_ATTACH_TESTED_Type { EPS_ATTACH_ONLY, COMBINED_ATTACH}; + type enumerated NAS_ATTACH_STATE_Type {ATTACHED, DETACHED}; + type enumerated EUTRA_FDD_TDD_Mode_Type {FDD, TDD}; + type enumerated UTRAN_FDD_TDD_Type {UTRAN_FDD, UTRAN_TDD}; + type enumerated RATComb_Tested_Type {EUTRA_UTRA, EUTRA_GERAN, EUTRA_Only}; + + type enumerated EUTRA_CellId_Type { + eutra_Cell_NonSpecific, + eutra_Cell1, + eutra_Cell2, + eutra_Cell3, + eutra_Cell4, + eutra_Cell6, + eutra_Cell10, + eutra_Cell11, + eutra_Cell12, + eutra_Cell13, + eutra_Cell14, + eutra_Cell23, + eutra_Cell28, + eutra_Cell29, + eutra_Cell30, + eutra_Cell31, + eutra_CellA, + eutra_CellB, + eutra_CellC, + eutra_CellD, + eutra_CellE, + eutra_CellG, + eutra_CellH, + eutra_CellI, + eutra_CellJ, + eutra_CellK, + eutra_CellL, + eutra_CellM + }; + + type record length (0..7) of EUTRA_CellId_Type EUTRA_CellIdList_Type; + + type enumerated UTRAN_CellId_Type { + utran_CellDedicated (-1), + utran_Cell5 (5), + utran_Cell7 (7), + utran_Cell8 (8), + utran_Cell9 (9), + utran34_Cell1 (1000), + utran34_Cell2 (1001), + utran34_Cell3 (1002), + utran34_Cell4 (1003), + utran34_Cell5 (1004), + utran34_Cell6 (1005), + utran34_Cell7 (1006), + utran34_Cell8 (1007), + utran34_CellA (2000), + utran34_CellB (2001), + utran34_CellC (2002), + utran34_CellD (2003), + utran34_CellE (2004), + utran34_CellF (2005), + utran34_CellG (2006), + utran34_CellH (2007) + }; // @sic R5-133563: added utran34_CellA/B/C... for 34.123-1 NAS tc sic@ + + type record of UTRAN_CellId_Type UTRAN_CellIdList_Type; + + type integer IP_DrbId_Type; /* DRB identity type common for all RATs: + * - for EUTRA it corrensponds to the ASN.1 type DRB-Identity + * - for UTRAN it corrensponds to the ASN.1 type RB-Identity and values are as defined in TS 34.123-3 Table 8.2.4.1 + * - for GERAN the NSAPI value (type record NSAPI) may be used (FFS) + * NOTE: this is introduced to simplify the dependencies (i.e. to keep IP_ASP_TypeDefs independent from any RAT specific type definitions) */ + + type record IP_EUTRA_DrbInfo_Type { + EUTRA_CellId_Type CellId, /* data is routed to a specific cell regardless of whether the same DRB is configured in any other cell */ + IP_DrbId_Type DrbId optional /* mandatory at the system interface */ + }; + type record IP_UTRAN_GERAN_DrbInfo_Type { + integer CellId, + IP_DrbId_Type DrbId optional /* mandatory at the system interface */ + }; + type union IP_DrbInfo_Type { + IP_EUTRA_DrbInfo_Type Eutra, + IP_UTRAN_GERAN_DrbInfo_Type Utran, + IP_UTRAN_GERAN_DrbInfo_Type Geran + }; + + type enumerated GPRS_CipheringAlgorithm_Type { + gea0(0), + gea2(2), + gea3(3), + gea4(4) + }; + + type O4_Type MessageAuthenticationCode; /* 24.301 cl. 9.5 */ + type O4_Type NasCount_Type; + + + type enumerated IPCAN_RAN_Type { /* radio access network technology used by the IPCAN PTC */ + GERAN, + UTRAN_FDD, + UTRAN_TDD, + EUTRA_FDD, + EUTRA_TDD + }; + type IPCAN_RAN_Type RANTech; /* alias to cope with (old) 34.229 implementation */ + + // To indicate which PTCs are configured (EUTRA alone is included for completeness) + type enumerated IRAT_ConfiguredPTCs_Type { EUTRA_Only, EUTRA_UTRAN, EUTRA_GERAN, EUTRA_UTRAN_GERAN, EUTRA_CDMA2000, UTRAN_Only, UTRAN_GERAN } + + const float tsc_GuardTimePreamble := 180.0; + const float tsc_GuardTimePreamble_EmptyCSG := tsc_GuardTimePreamble * int2float(4); + + // definitions needed for IP and IMS handling + const integer tsc_NoOfPDNs := 2; + const integer tsc_Index_PDN1 := 0; + const integer tsc_Index_PDN2 := 1; + type enumerated PDN_Index_Type { PDN_1 (0), PDN_2 (1), PDN_2a, PDN_Internet }; + + //---------------------------------------------------------------------------- + // constant to generate PRBS sequence + const octetstring tsc_RandomPRBS := + 'FFE665A5C5CA3452085408ABEECE4B0B813FD337873F2CD1E29AE91BD6C8E14F'O + & 'DE630F8195688EBE465F09816A8EEB1B83953DD362DAE3B06D5B76D8E3E53087'O + & 'EA645A09017FD99C3CACBB46DF1CD61DA9C435F89943DF9CC34ADEE31AD6E24F'O + & 'A1903D53778D949742750DD49DE9CE9E430AD448A14575D89C16025508814020'O //octets 0 .. 127 + & '0555DDC9CBCB9EC31F833F866A5BA390680EAB11282EAE44F5E7658F6B247A0C'O + & '54A21057F73278595C235077F267A59097E8CEB4EDE49A16FDB36D2485EA3107'O + & 'D59DC360700D5488BEB9B96C24AF44DF498BC135788C14A8BBEC64A5EF64DA1C'O + & '5608FEB312D7B738D3E2CFB4C74A7458A3EF9B3C79F3CD348740DFE330780C01'O //octets 128 .. 255 + & 'FFCCCB4B8B9468A410A81157DD9C9617027FA66F0E7E59A3C535D237AD91C29F'O + & 'BCC61F032AD11D7C8CBE1302D51DD637072A7BA6C5B5C760DAB6EDB1C7CA610F'O + & 'D4C8B41202FFB3387959768DBE39AC3B53886BF13287BF398695BDC635ADC49F'O + & '43207AA6EF1B292E84EA1BA93BD39D3C8615A891428AEBB1382C04AA11028040'O //octets 256 .. 383 + & '0AABBB9397973D863F067F0CD4B74720D01D5622505D5C89EBCECB1ED648F418'O + & 'A94420AFEE64F0B2B846A0EFE4CF4B212FD19D69DBC9342DFB66DA490BD4620F'O + & 'AB3B86C0E01AA9117D7372D8495E89BE9317826AF118295177D8C94BDEC9B438'O + & 'AC11FD6625AF6E71A7C59F698E94E8B147DF3678F3E79A690E81BFC660F01803'O //octets 384 .. 511 + & 'FF9996971728D148215022AFBB392C2E04FF4CDE1CFCB3478A6BA46F5B23853F'O + & '798C3E0655A23AF9197C2605AA3BAC6E0E54F74D8B6B8EC1B56DDB638F94C21F'O + & 'A991682405FF6670F2B2ED1B7C735876A710D7E2650F7E730D2B7B8C6B5B893E'O + & '8640F54DDE36525D09D4375277A73A790C2B51228515D7627058095422050080'O //octets 512 .. 639 + & '155777272F2E7B0C7E0CFE19A96E8E41A03AAC44A0BAB913D79D963DAC91E831'O + & '5288415FDCC9E165708D41DFC99E96425FA33AD3B792685BF6CDB49217A8C41F'O + & '56770D81C0355222FAE6E5B092BD137D262F04D5E23052A2EFB19297BD936871'O + & '5823FACC4B5EDCE34F8B3ED31D29D1628FBE6CF1E7CF34D21D037F8CC1E03007'O //octets 640 .. 767 + & 'FF332D2E2E51A29042A0455F7672585C09FE99BC39F9668F14D748DEB6470A7E'O + & 'F3187C0CAB4475F232F84C0B547758DC1CA9EE9B16D71D836ADBB6C71F29843F'O + & '5322D0480BFECCE1E565DA36F8E6B0ED4E21AFC4CA1EFCE61A56F718D6B7127D'O + & '0C81EA9BBC6CA4BA13A86EA4EF4E74F21856A2450A2BAEC4E0B012A8440A0100'O //octets 768 .. 895 + & '2AAEEE4E5E5CF618FC19FC3352DD1C834075588941757227AF3B2C7B5923D062'O + & 'A51082BFB993C2CAE11A83BF933D2C84BF4675A76F24D0B7ED9B69242F51883E'O + & 'ACEE1B03806AA445F5CDCB61257A26FA4C5E09ABC460A545DF63252F7B26D0E2'O + & 'B047F59896BDB9C69F167DA63A53A2C51F7CD9E3CF9E69A43A06FF1983C0600F'O //octets 896 .. 1023 + & 'FE665A5C5CA3452085408ABEECE4B0B813FD337873F2CD1E29AE91BD6C8E14FD'O + & 'E630F8195688EBE465F09816A8EEB1B83953DD362DAE3B06D5B76D8E3E53087E'O + & 'A645A09017FD99C3CACBB46DF1CD61DA9C435F89943DF9CC34ADEE31AD6E24FA'O + & '1903D53778D949742750DD49DE9CE9E430AD448A14575D89C160255088140200'O //octets 1024 .. 1151 + & '555DDC9CBCB9EC31F833F866A5BA390680EAB11282EAE44F5E7658F6B247A0C5'O + & '4A21057F73278595C235077F267A59097E8CEB4EDE49A16FDB36D2485EA3107D'O + & '59DC360700D5488BEB9B96C24AF44DF498BC135788C14A8BBEC64A5EF64DA1C5'O + & '608FEB312D7B738D3E2CFB4C74A7458A3EF9B3C79F3CD348740DFE330780C01F'O //octets 1152 .. 1279 + & 'FCCCB4B8B9468A410A81157DD9C9617027FA66F0E7E59A3C535D237AD91C29FB'O + & 'CC61F032AD11D7C8CBE1302D51DD637072A7BA6C5B5C760DAB6EDB1C7CA610FD'O + & '4C8B41202FFB3387959768DBE39AC3B53886BF13287BF398695BDC635ADC49F4'O + & '3207AA6EF1B292E84EA1BA93BD39D3C8615A891428AEBB1382C04AA110280400'O //octets 1280 .. 1407 + & 'AABBB9397973D863F067F0CD4B74720D01D5622505D5C89EBCECB1ED648F418A'O + & '94420AFEE64F0B2B846A0EFE4CF4B212FD19D69DBC9342DFB66DA490BD4620FA'O + & 'B3B86C0E01AA9117D7372D8495E89BE9317826AF118295177D8C94BDEC9B438A'O + & 'C11FD6625AF6E71A7C59F698E94E8B147DF3678F3E79A690E81BFC660F01803F'O //octets 1408 .. 1535 + & 'F9996971728D148215022AFBB392C2E04FF4CDE1CFCB3478A6BA46F5B23853F7'O + & '98C3E0655A23AF9197C2605AA3BAC6E0E54F74D8B6B8EC1B56DDB638F94C21FA'O + & '991682405FF6670F2B2ED1B7C735876A710D7E2650F7E730D2B7B8C6B5B893E8'O + & '640F54DDE36525D09D4375277A73A790C2B51228515D76270580954220500801'O //octets 1536 .. 1663 + & '55777272F2E7B0C7E0CFE19A96E8E41A03AAC44A0BAB913D79D963DAC91E8315'O + & '288415FDCC9E165708D41DFC99E96425FA33AD3B792685BF6CDB49217A8C41F5'O + & '6770D81C0355222FAE6E5B092BD137D262F04D5E23052A2EFB19297BD9368715'O + & '823FACC4B5EDCE34F8B3ED31D29D1628FBE6CF1E7CF34D21D037F8CC1E03007F'O //octets 1664 .. 1791 + & 'F332D2E2E51A29042A0455F7672585C09FE99BC39F9668F14D748DEB6470A7EF'O + & '3187C0CAB4475F232F84C0B547758DC1CA9EE9B16D71D836ADBB6C71F29843F5'O + & '322D0480BFECCE1E565DA36F8E6B0ED4E21AFC4CA1EFCE61A56F718D6B7127D0'O + & 'C81EA9BBC6CA4BA13A86EA4EF4E74F21856A2450A2BAEC4E0B012A8440A01002'O //octets 1792 .. 1919 + & 'AAEEE4E5E5CF618FC19FC3352DD1C834075588941757227AF3B2C7B5923D062A'O + & '51082BFB993C2CAE11A83BF933D2C84BF4675A76F24D0B7ED9B69242F51883EA'O + & 'CEE1B03806AA445F5CDCB61257A26FA4C5E09ABC460A545DF63252F7B26D0E2B'O + & '047F59896BDB9C69F167DA63A53A2C51F7CD9E3CF9E69A43A06FF1983C0600'O; //octets 1920 .. 2046 + + const charstring tsc_AT_ResultOK := "OK"; + const charstring tsc_Fox := "The quick brown fox jumps over the lazy dog's back. Kaufen Sie Ihrer Frau vier bequeme Pelze. - 0123456789 - THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG'S BACK."; + const charstring tsc_Fox_PDU := "06812222222222" + & "11000A9174097538740000A7a054741914afa7c76b9058febebb41e6371ea4aeb7e173d0db5e9683" + & "e8e832881dd6e741e4f7f9340789c3e3b50bb40cd7cd6537689a2e83926879590e32cac375903d5d" + & "9683c4e578bddc2e83a065b6beec02b540b0986c46abd96eb81ca805a2228ba06835395c8284d2e7" + & "d509323eb12065b5099d829ed6a21444451641cca0360b223e8fa72948181c2e5d"; + + //---------------------------------------------------------------------------- + // common functions: + + type integer LineNo_Type; + + /* + * @desc local function + * @param p_FileName + * @param p_LineNo + * @param p_Msg + * @return charstring + */ + function fl_FormatLog(charstring p_FileName, + LineNo_Type p_LineNo, + charstring p_Msg) return charstring + { + var charstring v_LineNoStr := int2str(p_LineNo); + + return p_FileName & ":" & v_LineNoStr & ": " & p_Msg; /* common "UNIX style" format as e.g. used by grep; + * the final format for this output is FFS */ + + } + + //---------------------------------------------------------------------------- + /* + * @desc function for common error logging + * @param p_FileName + * @param p_LineNo + * @param p_Msg + */ + function f_ErrorLog(charstring p_FileName, + LineNo_Type p_LineNo, + charstring p_Msg) + { + log(fl_FormatLog(p_FileName, p_LineNo, p_Msg)); + }; + + //---------------------------------------------------------------------------- + /* + * @desc common function for verdict assignment + * @param p_Verdict + * @param p_FileName + * @param p_LineNo + * @param p_Msg + */ + function f_SetVerdict(verdicttype p_Verdict, + charstring p_FileName, + LineNo_Type p_LineNo, + charstring p_Msg) + { + var charstring v_OutputLine := fl_FormatLog(p_FileName, p_LineNo, p_Msg); + setverdict(p_Verdict, v_OutputLine); + } + + //---------------------------------------------------------------------------- + /* + * @desc Common functions to be called in case unrecoverable errors + * (i.e. runtimer errors generated by TTCN) + * @param p_FileName + * @param p_LineNo + * @param p_Msg + */ + function FatalError(charstring p_FileName, + LineNo_Type p_LineNo, + charstring p_Msg) + { + // setverdict(inconc); // setverdict causes problems when FatalError is used in a function called from within a template + f_ErrorLog(p_FileName, p_LineNo, p_Msg); + testcase.stop (p_Msg); // This operation now defined in TTCN3 v4.2.1 + }; + + /* + * @desc set verdict inconc in cases when no pass/fail is possible e.g. due to wrong PICS/PIXIT + * NOTE: as there is no need to evaluate any component specific information ans as "self.kill" can be used to terminate the test case + * (resulting in the final verdict 'inconc') this function is independent from any component and can be call from everywhere where 'setverdict' or 'self.kill' are allowed + * @param p_FileName + * @param p_LineNo + * @param p_Msg + */ + function f_SetVerdictInconc(charstring p_FileName, + LineNo_Type p_LineNo, + charstring p_Msg) + { + f_SetVerdict(inconc, p_FileName, p_LineNo, p_Msg); + self.kill; // => test case will be terminated immediately + } + + + + //---------------------------------------------------------------------------- + /* + * @desc Common function to delay the test case for the given time + * @param p_DelayTime + */ + function f_Delay ( float p_DelayTime ) + { + timer t_Delay; + + t_Delay.start ( p_DelayTime ); + t_Delay.timeout; + }; + + //---------------------------------------------------------------------------- + + function f_TemplateBit2Int(template (present) integer p_Val, + integer p_Length) return template bitstring + { /* Auxiliary function + * note: there is no possibility in TTCN-3 to check whether a template parameter + * which is not a value is "*", "?" or omit + * => we restrict p_Val to "template (present)", i.e it shall be a value or "?" */ + if (isvalue(p_Val)) { + return int2bit(valueof(p_Val), p_Length); + } else { + return ?; + } + } + + //---------------------------------------------------------------------------- + /* + * @desc returns index of first occurency of any char of p_CharList in p_String starting from p_StartIndex; + * returns -1 if there is no occurency + * @param p_String + * @param p_CharList + * @param p_StartIndex + * @return integer + */ + function f_StringFindChar(charstring p_String, + Char1List_Type p_CharList, + UInt_Type p_StartIndex := 0) return integer + { + var integer v_NoOfChars := lengthof(p_CharList); + var integer v_Index; + var integer i; + var Char1_Type v_Char; + + if (v_NoOfChars == 0) { + return -1; + } + + for (v_Index:=p_StartIndex; v_Index 0) { + for (i:=0; i < k - 1; i := i+1) { + v_String := v_String & v_StringList[i] & p_JoinString; + } + v_String := v_String & v_StringList[i]; + } + return v_String; + } + + function f_CharStringList_Concat(CharStringList_Type p_StringList1, + CharStringList_Type p_StringList2) return CharStringList_Type + { + return p_StringList1 & p_StringList2; + } + + + function f_CharStringList_Add(CharStringList_Type p_StringList, + charstring p_NewString) return CharStringList_Type + { + var integer v_Length := lengthof(p_StringList); + var CharStringList_Type v_StringList := p_StringList; + + v_StringList[v_Length] := p_NewString; + return v_StringList; + } + + //---------------------------------------------------------------------------- + + function f_ConvertBoolToBit(boolean p_Bool) return B1_Type + { + var B1_Type v_Bit := '0'B; + if (p_Bool) { + v_Bit := '1'B; + } + return v_Bit; + } + + //---------------------------------------------------------------------------- + /* + * @desc return octet-aligned bitstring + * @param p_Bitstring + * @return bitstring + */ + function f_OctetAlignedBitString( bitstring p_Bitstring) return bitstring + { // @sic R5s100324 change 3 sic@ + var bitstring v_Bitstring := p_Bitstring; + var integer v_BitLength := lengthof(p_Bitstring); + var integer v_PaddingLength; + var integer i; + + if ((v_BitLength mod 8) > 0) { // if not already byte aligned + v_PaddingLength := 8 - (v_BitLength mod 8); + for (i:=0; i < v_PaddingLength; i := i+1) { + v_Bitstring := v_Bitstring & '0'B; + } + } + + return v_Bitstring; + } + + //---------------------------------------------------------------------------- + /* + * @desc function to extract output string from random test pattern of a certain length and at a starting point + * @param p_Start + * @param p_N + * @return octetstring + */ + function f_GetN_OctetsFromPRBS(UInt_Type p_Start, + UInt_Type p_N) + return octetstring + { + var integer i; + var integer k; + var octetstring v_Noctets :=''O; // output string to be extracted from random test pattern + + for (i:= 0; i< p_N; i := i+1) { + k := p_Start + i; + k := k mod 2047; + v_Noctets := v_Noctets & tsc_RandomPRBS[k]; + } + return v_Noctets; + } + + //---------------------------------------------------------------------------- + /* + * @desc check whether given testase name fits L2 test case + * @return boolean + */ + function f_TestcaseIsL2Testcase() return boolean + { + var charstring v_TestcaseName := testcasename(); // This operation now defined in TTCN3 v4.2.1 + var template charstring v_L2TestcasePattern := pattern "TC_7_*"; /* @sic R5s100136 sic@ */ + return (match(v_TestcaseName, v_L2TestcasePattern)); + } + + //---------------------------------------------------------------------------- + + function f_TestcaseIsDrbTestcase() return boolean + { + var charstring v_TestcaseName := testcasename(); // This operation now defined in TTCN3 v4.2.1 + var template charstring v_L2TestcasePattern := pattern "TC_12_*"; + return (match(v_TestcaseName, v_L2TestcasePattern)); + } + + //---------------------------------------------------------------------------- + + type enumerated Gsm7BitPacking_Type { SMS_Packing, CBS_Packing, USSD_Packing }; + + const integer tsc_Gsm7BitLookup[32..126][0..1] := { /* ASCII to GSM 7 bit char conversion table + Self indexing lookup table per ASCII integer value + 1st field - status + 0 => no change + 1 => basic table - no translation required + 2 => escape to ext table 23.038 6.2.1.1 + 3 => char does not exist in gsm char table + 2nd field - translation integer value per 23.038 6.2.1/6.2.1.1 + range 0-127 & dummy entry 256 */ + { 0, 256 }, // 32 - space - no xlat + { 0, 256 }, // 33 - "!" - no xlat + { 0, 256 }, // 34 - """ - no xlat + { 0, 256 }, // 35 - "#" - no xlat + { 1, 2 }, // 36 - "$" - gsm 23.038 6.2.1 - 02 + { 0, 256 }, // 37 - "%" - no xlat + { 0, 256 }, // 38 - "&" - no xlat + { 0, 256 }, // 39 - "'" - no xlat + { 0, 256 }, // 40 - "(" - no xlat + { 0, 256 }, // 41 - ")" - no xlat + { 0, 256 }, // 42 - "*" - no xlat + { 0, 256 }, // 43 - "+" - no xlat + { 0, 256 }, // 44 - "," - no xlat + { 0, 256 }, // 45 - "-" - no xlat + { 0, 256 }, // 46 - "." - no xlat + { 0, 256 }, // 47 - "/" - no xlat + { 0, 256 }, // 48 - "0" - no xlat + { 0, 256 }, // 49 - "1" - no xlat + { 0, 256 }, // 50 - "2" - no xlat + { 0, 256 }, // 51 - "3" - no xlat + { 0, 256 }, // 52 - "4" - no xlat + { 0, 256 }, // 53 - "5" - no xlat + { 0, 256 }, // 54 - "6" - no xlat + { 0, 256 }, // 55 - "7" - no xlat + { 0, 256 }, // 56 - "8" - no xlat + { 0, 256 }, // 57 - "9" - no xlat + { 0, 256 }, // 58 - ":" - no xlat + { 0, 256 }, // 59 - ";" - no xlat + { 0, 256 }, // 60 - "<" - no xlat + { 0, 256 }, // 61 - "=" - no xlat + { 0, 256 }, // 62 - ">" - no xlat + { 0, 256 }, // 63 - "9" - no xlat + { 1, 0 }, // 64 - "@" - gsm 23.038 6.2.1 - 00 + { 0, 256 }, // 65 - "A" - no xlat + { 0, 256 }, // 66 - "B" - no xlat + { 0, 256 }, // 67 - "C" - no xlat + { 0, 256 }, // 68 - "D" - no xlat + { 0, 256 }, // 69 - "E" - no xlat + { 0, 256 }, // 70 - "F" - no xlat + { 0, 256 }, // 71 - "G" - no xlat + { 0, 256 }, // 72 - "H" - no xlat + { 0, 256 }, // 73 - "I" - no xlat + { 0, 256 }, // 74 - "J" - no xlat + { 0, 256 }, // 75 - "K" - no xlat + { 0, 256 }, // 76 - "L" - no xlat + { 0, 256 }, // 77 - "M" - no xlat + { 0, 256 }, // 78 - "N" - no xlat + { 0, 256 }, // 79 - "0" - no xlat + { 0, 256 }, // 80 - "P" - no xlat + { 0, 256 }, // 81 - "Q" - no xlat + { 0, 256 }, // 82 - "R" - no xlat + { 0, 256 }, // 83 - "S" - no xlat + { 0, 256 }, // 84 - "T" - no xlat + { 0, 256 }, // 85 - "U" - no xlat + { 0, 256 }, // 86 - "V" - no xlat + { 0, 256 }, // 87 - "W" - no xlat + { 0, 256 }, // 88 - "X" - no xlat + { 0, 256 }, // 89 - "Y" - no xlat + { 0, 256 }, // 90 - "Z" - no xlat + { 2, 60 }, // 91 - "[" - gsm 23.038 6.2.1.1 ext. - 3C + { 2, 47 }, // 92 - "\" - gsm 23.038 6.2.1.1 ext. - 2F + { 2, 62 }, // 93 - "]" - gsm 23.038 6.2.1.1 ext. - 3E + { 2, 20 }, // 94 - "^" - gsm 23.038 6.2.1.1 ext. - 14 + { 1, 17 }, // 95 - "_" - gsm 23.038 6.2.1 - 11 + { 3, 256 }, // 96 - "`" - char does not exist in gsm 23.038 6.2.1/6.2.1.1 + { 0, 256 }, // 97 - "a" - no xlat + { 0, 256 }, // 98 - "b" - no xlat + { 0, 256 }, // 99 - "c" - no xlat + { 0, 256 }, // 100 - "d" - no xlat + { 0, 256 }, // 101 - "e" - no xlat + { 0, 256 }, // 102 - "f" - no xlat + { 0, 256 }, // 103 - "g" - no xlat + { 0, 256 }, // 104 - "h" - no xlat + { 0, 256 }, // 105 - "i" - no xlat + { 0, 256 }, // 106 - "j" - no xlat + { 0, 256 }, // 107 - "k" - no xlat + { 0, 256 }, // 108 - "l" - no xlat + { 0, 256 }, // 109 - "m" - no xlat + { 0, 256 }, // 110 - "n" - no xlat + { 0, 256 }, // 111 - "o" - no xlat + { 0, 256 }, // 112 - "p" - no xlat + { 0, 256 }, // 113 - "q" - no xlat + { 0, 256 }, // 114 - "r" - no xlat + { 0, 256 }, // 115 - "s" - no xlat + { 0, 256 }, // 116 - "t" - no xlat + { 0, 256 }, // 117 - "u" - no xlat + { 0, 256 }, // 118 - "v" - no xlat + { 0, 256 }, // 119 - "w" - no xlat + { 0, 256 }, // 120 - "x" - no xlat + { 0, 256 }, // 121 - "y" - no xlat + { 0, 256 }, // 122 - "z" - no xlat + { 2, 40 }, // 123 - "{" - gsm 23.038 6.2.1.1 ext. - 28 + { 2, 64 }, // 124 - "|" - gsm 23.038 6.2.1.1 ext. - 40 + { 2, 41 }, // 125 - "}" - gsm 23.038 6.2.1.1 ext. - 29 + { 2, 61 } // 126 - "~" - gsm 23.038 6.2.1.1 ext. - 3D + }; + + function fl_XlatAcsiiToGsm7Bit(octetstring p_AsciiOctetString) return octetstring + { + var octetstring v_GsmOctetString; + var integer v_XlatStatus; + var integer v_AsciiIndex; + var integer i; + var integer j := 0; + + for (i:=0; i '48616C6C6F'O + var bitstring v_BitString := ''B; + var bitstring v_Padding := ''B; + var integer v_TextLength; + var integer v_BitStringLength := 0; + var integer v_IntValue; + var integer v_NoOfOctets; + var integer v_NoOfPaddingBits; + var integer v_Index; + var integer i; + + // convert ascii table to GSM 7 bit table + v_OctetString := fl_XlatAcsiiToGsm7Bit(v_OctetString); // @sic R5s130103 change 3 sic@ + v_TextLength := lengthof(v_OctetString); + + if (((p_Packing == SMS_Packing) and (v_TextLength > 160)) or // a maximum of 160 characters for SMS (i.e. 140 octets) + ((p_Packing == CBS_Packing) and (v_TextLength > 93)) or // a maximum of 93 characters for CBS (i.e. 82 octets) + ((p_Packing == USSD_Packing) and (v_TextLength > 182))) { // a maximum of 182 characters for USSD (i.e. 160 octets) + FatalError(__FILE__, __LINE__, "input string is too long"); + } + + for (i:=0; i 0) { + if ((p_Packing == USSD_Packing) and (v_NoOfPaddingBits == 7)) { + v_Padding := '0001101'B; // use instead of the @ character; see TS 23.038 cl. 6.1.2.3.1 + } else { + v_Padding := int2bit(0, v_NoOfPaddingBits); // 1..7 padding bits, all 0 + } + } + v_BitString := v_Padding & v_BitString; + + // convert bitstring back to octetstring: the first character is at the end of the bitstring + // => we need to take the octets from the end of the bitstring + v_OctetString := ''O; + for (i:=0; i < v_NoOfOctets; i:=i+1) { + v_Index := (v_NoOfOctets - (i+1)) * 8; // get start index of the next octet + v_OctetString[i] := bit2oct(substr(v_BitString, v_Index, 8)); + } + return v_OctetString; + } + + function f_CharPacking_IA5toBCD(charstring p_ASCII_String) return octetstring + { /* Packed BCD coding with "swaping of nibbles" as required e.g. for encoding of called and calling party numbers in NAS messages (e.g. TS 24.004 cl. 10.5.4.7 and 10.5.4.9); + when the length of the input string is odd 'F' is aded as padding: + "0613454120" -> '6031541402'O - even number of digits + "06134541209" -> '6031541402F9'O - odd number of digits (padding) + "A6134541209" -> error */ + var integer i; + var charstring v_BcdString; + var integer v_Length := lengthof(p_ASCII_String); + var charstring v_ASCII_String := p_ASCII_String; + + // check input string + for (i := 0; i < v_Length; i := i+1) { + if (not match(p_ASCII_String[i], pattern "[0-9]")) { + FatalError(__FILE__, __LINE__, "invalid character for BCD string"); + } + } + + // add padding (if needed) + if (v_Length mod 2 != 0) { + v_ASCII_String := v_ASCII_String & "F"; + } + + // swap digits + for (i := 0; i < v_Length; i := i+2) { + v_BcdString[i] := v_ASCII_String[i+1]; + v_BcdString[i+1] := v_ASCII_String[i]; + } + + return str2oct(v_BcdString); + } + + //---------------------------------------------------------------------------- + + function f_BitstringReplaceMSB(bitstring p_Bitstring, + B1_Type p_NewMSB) return bitstring + { + return replace(p_Bitstring, 0, 1, p_NewMSB); + } + + //---------------------------------------------------------------------------- + + function f_Bitstring_BitIsSet(bitstring p_Bitstring, + integer p_Index) return boolean + { + if (p_Index >= lengthof(p_Bitstring)) { + FatalError(__FILE__, __LINE__, "invalid bit position"); + } + return (substr(p_Bitstring, p_Index, 1) == '1'B); + } + + //---------------------------------------------------------------------------- +// Moved here because now needed in Authentication_Init (i.e. GERAN and UTRAN PTCs too) + const integer tsc_KDF_HMAC_SHA_256 := 1; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const integer tsc_KDF_Spare3 := 4; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + type integer KDF_Type ( tsc_KDF_HMAC_SHA_256 .. tsc_KDF_Spare3 ); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + + external function fx_KeyDerivationFunction(KDF_Type p_KDF, + B256_Type p_Key, + octetstring p_String) return B256_Type; + /* External function to hashing function with algorithm as defined in 33.401; + SHA-256 encoding algorithm used as KEY Description Function + @status APPROVED (LTE) */ + + //---------------------------------------------------------------------------- + /* system time acc. to default C library (see time.h) */ + + type record Struct_tm_Type { /* TTCN-3 equivalent for the "struct tm" as defined on C standard library (time.h or ctime.h for C or C++) */ + integer tm_sec, /* seconds after the minute 0..61 (tm_sec is generally 0-59. Extra range to accommodate for leap seconds in certain systems) */ + integer tm_min, /* minutes after the hour 0..59 */ + integer tm_hour, /* hours since midnight 0..23 */ + integer tm_mday, /* day of the month 1..31 */ + integer tm_mon, /* months since January 0..11 */ + integer tm_year, /* years since 1900 */ + integer tm_wday, /* days since Sunday 0..6 */ + integer tm_yday, /* days since January 1 0..365 */ + integer tm_isdst /* Daylight Saving Time flag */ + }; + + external function fx_GetSystemTime(out Struct_tm_Type p_Struct_tm, /* p_Struct_tm returns local system time; + * C implementation: + * time_t v_Now = time(NULL); + * struct tm *v_Tm = localtime(&v_Now); + */ + out integer p_TimezoneInfo); /* p_TimezoneInfo returns the difference (in seconds) between the UTC time (GMT) and the local time; + * C implementation: + * int timezone = (int)difftime(mktime(gmtime(&v_Now)), v_Now); + * NOTE: p_TimezoneInfo does not consider daylight saving e.g. it is always 3600 for CET independent of summer/winter + */ + + /* + * @desc auxiliary function for f_BCD_TimestampWithTimezone + * @param p_Val + * @return H2_Type + */ + function f_SwappedNibbles(integer p_Val) return H2_Type + { + var integer v_LowNibble := p_Val mod 10; + var integer v_HighNibble := (p_Val / 10) mod 10; + + return int2hex(v_LowNibble, 1) & int2hex(v_HighNibble, 1); + } + + /* + * @desc returns the timestamp as e.g. used as ServiceCentreTimeStamp for SMS with current time + * (see e.g. calculation of the TP Service Centre Time Stamp acc. to TS 23.040 cl. 9.2.3.11) + * Example: + * 2002 April 18, 15:32:46, timezone=4 + * f_BCD_TimestampWithTimezone returns 20408151236440 + * @return H14_Type + */ + function f_BCD_TimestampWithTimezone() return H14_Type + { /* @sic R5-1307270: common function to provide timestamp for MDT test cases too sic@ */ + var Struct_tm_Type v_LocalTime; + var integer v_TimezoneSeconds; + var integer v_TimezoneVal; + var integer v_SignVal := 0; // positive value per default + var H2_Type v_Year; + var H2_Type v_Month; + var H2_Type v_Day; + var H2_Type v_Hour; + var H2_Type v_Minute; + var H2_Type v_Second; + var H2_Type v_Timezone; + + fx_GetSystemTime(v_LocalTime, v_TimezoneSeconds); + + v_Year := f_SwappedNibbles(v_LocalTime.tm_year + 1900); /* acc. to definition of struct tm */ + v_Month := f_SwappedNibbles(v_LocalTime.tm_mon + 1); /* acc. to definition of struct tm */ + v_Day := f_SwappedNibbles(v_LocalTime.tm_mday); + v_Hour := f_SwappedNibbles(v_LocalTime.tm_hour); + v_Minute := f_SwappedNibbles(v_LocalTime.tm_min mod 60); /* v_LocalTime.tm_min can be 0..61 on some systems */ + v_Second := f_SwappedNibbles(v_LocalTime.tm_sec); + + /* Calculation of the timezone (-> 23.040): */ + if (v_LocalTime.tm_isdst > 0) { /* The value contained in the Time Zone field must take into account daylight saving time, such that when the sending entity changes from regular + (winter) time to daylight saving (summer) time, there is a change to the value in the Time Zone field, + for example in the UK the winter setting is 00000000 and the summer setting is 01000000. */ + v_TimezoneSeconds := v_TimezoneSeconds + 3600; + } + + if (v_TimezoneSeconds < 0) { + v_TimezoneSeconds := -v_TimezoneSeconds; + v_SignVal := 128; /* In the first of the two semi octets, the first bit (bit 3 of the seventh octet of the TP Service Centre Time Stamp field) + represents the algebraic sign of this difference (0: positive, 1: negative) */ + } + v_TimezoneVal := v_TimezoneSeconds / (60 * 15); /* The Time Zone indicates the difference, expressed in quarters of an hour, between the local time and GMT. */ + v_TimezoneVal := v_TimezoneVal mod 128; /* ... just to be sure */ + v_TimezoneVal := v_TimezoneVal + v_SignVal; /* set the upper bit */ + + v_Timezone := f_SwappedNibbles(v_TimezoneVal); + + return v_Year & v_Month & v_Day & v_Hour & v_Minute & v_Second & v_Timezone; + } + /* + * @desc wrapper function to strip the timezone (e.g. for 'AbsoluteTimeInfo' acc. to 36.331 cl. 6.3.6) + * @return H12_Type + * @status + */ + function f_BCD_TimestampWithoutTimezone() return H12_Type + { + var H14_Type v_TimestampWithTimezone := f_BCD_TimestampWithTimezone(); + return substr(v_TimestampWithTimezone, 0, 12); + } + + /* + * @desc wrapper function to convert f_BCD_TimestampWithoutTimezone() to bitstring as needed for MDT + * @return B48_Type + * @status + */ + + function f_MDT_GetAbsolute_TimeStamp() return B48_Type + { + return hex2bit(f_BCD_TimestampWithoutTimezone()); + } + + /* + * @desc To convert UTRAN cell ID acc to 34.123-3 clause 8.5 + * @param p_CellId - enumerated type + * @return integer + * @status + */ + function f_UtranCellId2Int(UTRAN_CellId_Type p_CellId) return integer + { // @sic R5s130195 Baseline moving to rel-11: UTRAN cellID enhanced sic@ + var integer v_CellId := enum2int(p_CellId); + + // @sic R5-133563: added utran34_CellA/B/C... for 34.123-1 NAS tc sic@ + if (v_CellId >= 2000) { + v_CellId := v_CellId - 2000; + } else if (v_CellId >= 1000) { + v_CellId := v_CellId - 1000; + } + return v_CellId; + } + + //---------------------------------------------------------------------------- + /* + * @desc check that the result string starts with specific sub-string + * @param p_SourceString + * @param p_StartString + * @return boolean + */ + function f_CheckStringStartWith(charstring p_SourceString, + charstring p_StartString) + return boolean + { + var integer v_Length := lengthof(p_StartString); + var charstring v_SubStr; + var boolean v_Result := false; + + if (v_Length <= lengthof(p_SourceString)) { + v_SubStr := substr(p_SourceString, 0, v_Length); + v_Result := (v_SubStr == p_StartString); + } + return v_Result; + } + +} diff --git a/IMS_PART4_IWD_15wk38/Common/Common/UpperTesterCommon.ttcn b/IMS_PART4_IWD_15wk38/Common/Common/UpperTesterCommon.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..92528548a8150fda8b0b607d64bd8f198b16f923 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/Common/UpperTesterCommon.ttcn @@ -0,0 +1,117 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-06-10 16:35:18 +0200 (Wed, 10 Jun 2015) $ +// $Rev: 13728 $ +/******************************************************************************/ + +module UpperTesterCommon { + + group TypeDefs_Common { /* common types being used at the PTC <-> UpperTester interface as well as at the UpperTester <-> System interface */ + + type record Ut_Parameter_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + charstring Name, // name of the parameter/attribute + charstring Value // value (may need to be converted e.g. to integer) + }; + + type record of Ut_Parameter_Type Ut_ParameterList_Type; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + + type enumerated Ut_CnfReq_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + NO_CNF_REQUIRED, + CNF_REQUIRED, /* to request CNF as got from the UE */ + LOCAL_CNF_REQUIRED /* to request immediate CNF after SS has submitted the command to the UE (SS shall not wait for the UE is responding) + @sic R5s110176 BASELINE MOVING 2011 sic@ */ + }; + + type record UT_COMMON_CNF { /* Common confirmation triggered by the UE; + used at the system interface as well as at the inter PTC interface; + @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + boolean Result, // true: success; false: failure + charstring ResultString optional // contains response from the UE (if there is any) + }; + + } // end of group TypeDefs_Common + + //---------------------------------------------------------------------------- + + group TypeDefs_UT_System { // types being used at the UpperTester <-> System interface + + type record MMI_Cmd_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + charstring Cmd, /* commands corresponding to Ut_Common_Req_Type (e.g. "SelectPLMN"); + it is a charstring rather than a enumerated to allow generic implementation in the system adaptor */ + Ut_ParameterList_Type ParameterList optional /* additional information to perform the MMI: + e.g. for "SelectPLMN" this is {"MCC" }, {"MNC" } */ + + }; + type union Ut_System_Cmd_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + charstring AT, /* to carry mandatory and optional AT commands */ + MMI_Cmd_Type MMI /* to carry MMI commands and optional AT commands */ + }; + type record UT_SYSTEM_REQ { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + Ut_System_Cmd_Type Cmd, + Ut_CnfReq_Type CnfRequired /* Notes: a confirmation shall only be requested in cases when there is no signalling + * from the UE being triggered by the MMI/AT command + * @sic R5s110176 BASELINE MOVING 2011 sic@ */ + }; + } // end of group TypeDefs_UT_System + + //---------------------------------------------------------------------------- + + type port MTC_System_Ut message { /* Upper Tester: Port at MTC to be connected with system + @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + out UT_SYSTEM_REQ; + in UT_COMMON_CNF; + }; + + //---------------------------------------------------------------------------- + + template (present) UT_COMMON_CNF car_UT_COMMON_CNF := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + Result := ?, // result is a mandatory field + ResultString := * + }; + + template (value) UT_SYSTEM_REQ cas_UT_SYSTEM_REQ(template (value) Ut_System_Cmd_Type p_ATorMMI_Cmd, + Ut_CnfReq_Type p_CnfRequired) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + Cmd := p_ATorMMI_Cmd, + CnfRequired := p_CnfRequired + }; + + template (value) Ut_Parameter_Type cs_Ut_Parameter_Common(charstring p_Name, + template (value) charstring p_Value) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + Name := p_Name, + Value := p_Value + }; + + template (value) Ut_System_Cmd_Type cs_AT_Cmd(charstring p_AtCmd) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + AT := p_AtCmd + }; + + template (value) Ut_System_Cmd_Type cs_MMI_Cmd(charstring p_MmiCmd, + template (omit) Ut_ParameterList_Type p_ParamList) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + MMI := { + Cmd := p_MmiCmd, + ParameterList := p_ParamList + } + }; + + /* + * @desc Check if a UT command is confirmed as expected + * @param p_CnfReq + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) + */ + function f_UT_CommandRequiresCnf(template (value) Ut_CnfReq_Type p_CnfReq) return boolean + { + return (match(CNF_REQUIRED, p_CnfReq) or match(LOCAL_CNF_REQUIRED, p_CnfReq)); // @sic R5-151792 sic@ + } + +} diff --git a/IMS_PART4_IWD_15wk38/Common/Common/UpperTesterFunctions.ttcn b/IMS_PART4_IWD_15wk38/Common/Common/UpperTesterFunctions.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..18ebfaa7450034a68746dd365762c67df2647f52 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/Common/UpperTesterFunctions.ttcn @@ -0,0 +1,2983 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-15 21:39:48 +0200 (Tue, 15 Sep 2015) $ +// $Rev: 14432 $ +/******************************************************************************/ + +module UpperTesterFunctions { + import from UpperTesterCommon all; + import from UpperTesterPtcToMtcDefs all; + import from CommonDefs all; + import from Parameters all; + import from EPS_NAS_TypeDefs all; // EPS_QualityOfService + import from NAS_CommonTypeDefs all; + + const integer tsc_ManualPLMN_GERAN := 0; /* @status APPROVED (LTE_IRAT) */ + const integer tsc_ManualPLMN_UTRAN := 2; + const integer tsc_ManualPLMN_EUTRA := 7; + const integer tsc_ManualPLMN_None := -1; /* @status APPROVED (LTE, LTE_IRAT) */ + + // octet representation of type of number and numbering plan octet in 24.008 10.5.4.7. + // Put here as inbetween test cases and MTC + const O1_Type tsc_NumberingPlan_Oct := int2oct(tsc_NumberingPlan_Int, 1); /* @status APPROVED (SSNITZ) + @sic R5s150538 sic@ */ + + //============================================================================ + // TEMPLATES (used in this module only) + //----------------------------------------------------------------------------- + + template (value) UT_COMMON_CMD cas_UT_Req(template (value) Ut_Common_Req_Type p_Cmd, + template (value) Ut_CnfReq_Type p_Cnf, + template (omit) Ut_ParameterList_Type p_Parameters := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + Cmd := p_Cmd, + CnfReq := p_Cnf, + ParameterList := p_Parameters + }; + + //============================================================================ + // Common Parameters/Attributes + //----------------------------------------------------------------------------- + + template (value) Ut_Parameter_Type cs_Ut_Parameter_Cid(charstring p_Value) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + cs_Ut_Parameter_Common("Cid", p_Value); + + template (value) Ut_Parameter_Type cs_Ut_Parameter_QoS(charstring p_Value) := + /* @status APPROVED (LTE, LTE_A, LTE_IRAT, SSNITZ, UTRAN) */ + cs_Ut_Parameter_Common("QoS", p_Value); + + template (value) Ut_Parameter_Type cs_Ut_Parameter_PLMN(charstring p_Value) := + /* @status APPROVED (LTE, LTE_A, LTE_IRAT) */ + cs_Ut_Parameter_Common("PLMN", p_Value); + + //============================================================================ + // Parameter lists for UT primitives + //----------------------------------------------------------------------------- + + template (value) Ut_ParameterList_Type cs_CEMode(charstring p_Value) := + { /* @status APPROVED (LTE, LTE_A, LTE_IRAT) */ + cs_Ut_Parameter_Common("CE MODE", p_Value) + }; + + template (value) Ut_ParameterList_Type cs_OpMode(charstring p_Value) := + { /* @status APPROVED (UTRAN) */ + cs_Ut_Parameter_Common("OPERATION MODE", p_Value) + }; + + template (value) Ut_ParameterList_Type cs_CheckPlmn(charstring p_Value) := + { /* @status APPROVED (LTE, LTE_A, LTE_IRAT) */ + cs_Ut_Parameter_PLMN(p_Value) + }; + + template (value) Ut_ParameterList_Type cs_CheckETWS(charstring p_Value1, + charstring p_Value2) := + { /* @status APPROVED (LTE) */ + cs_Ut_Parameter_Common("WARNING1", p_Value1), + cs_Ut_Parameter_Common("WARNING2", p_Value2) + }; + + template (value) Ut_ParameterList_Type cs_UplinkData(charstring p_Data, + charstring p_Sapi) := + { /* @status APPROVED (LTE_IRAT) */ + cs_Ut_Parameter_Common("DATA", p_Data), + cs_Ut_Parameter_Common("SAPI", p_Sapi) + }; + + template (value) Ut_ParameterList_Type cs_ManualPlmn(charstring p_Value) := + { /* @status APPROVED (LTE, LTE_IRAT) */ + /* @sic R5-106675 sic@ */ + cs_Ut_Parameter_PLMN(p_Value) + }; + + template (value) Ut_ParameterList_Type cs_PlmnCSG(charstring p_PLMN, + charstring p_CSG) := + { /* @status APPROVED (LTE, LTE_IRAT) */ + /* @sic R5-106675 sic@ */ + cs_Ut_Parameter_PLMN(p_PLMN), + cs_Ut_Parameter_Common("CSG", p_CSG) + }; + + template (value) Ut_ParameterList_Type cs_CheckCSG(charstring p_CSG, + charstring p_Included) := + { /* @status APPROVED (LTE) */ + cs_Ut_Parameter_Common("CSG", p_CSG), + cs_Ut_Parameter_Common("INCLUDED IN LIST", p_Included) + }; + + template (value) Ut_ParameterList_Type cs_DialNumber(charstring p_Value) := + { /* @status APPROVED (LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + cs_Ut_Parameter_Common("DIAL", p_Value) + }; + + template (value) Ut_ParameterList_Type cs_IMSMode := + { + cs_Ut_Parameter_Common("VOICE_CALL_MODE", "VOIP_ONLY") + }; + + template (value) Ut_ParameterList_Type cs_InsertUsim(template (value) charstring p_Value) := + { /* @status APPROVED (LTE, LTE_A, LTE_IRAT, UTRAN) */ + cs_Ut_Parameter_Common("USIM", p_Value) + }; + + template (value) Ut_ParameterList_Type cs_SecondaryPDP(charstring p_DedId, + charstring p_DefId) := + { /* @status APPROVED (LTE) */ + cs_Ut_Parameter_Cid(p_DedId), + cs_Ut_Parameter_Common("DefId", p_DefId) + }; + + template (value) Ut_ParameterList_Type cs_PDP_Cid(charstring p_Cid) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + cs_Ut_Parameter_Cid(p_Cid) + }; + + template (value) Ut_ParameterList_Type cs_EPSQoS(charstring p_QoSParams) := + { /* @status APPROVED (LTE) */ + cs_Ut_Parameter_QoS(p_QoSParams) + }; + + template (value) Ut_ParameterList_Type cs_TFT(charstring p_TFTParams) := + { /* @status APPROVED (LTE) */ + cs_Ut_Parameter_Common("TFT", p_TFTParams) + }; + + template (value) Ut_ParameterList_Type cs_RequestPDP(charstring p_PDPParams) := + { /* @status APPROVED (LTE, LTE_A, LTE_IRAT, SSNITZ, UTRAN) */ + cs_Ut_Parameter_Common("RequestPDP", p_PDPParams) + }; + + template (value) Ut_ParameterList_Type cs_PowerPreference(charstring p_PowerPreference) := + { + cs_Ut_Parameter_Common("PowerPreference", p_PowerPreference) + }; + + template (value) Ut_ParameterList_Type cs_DeleteMessage_Withflag(charstring p_Index, + charstring p_Delflag) := + { /* @status APPROVED (LTE) */ + cs_Ut_Parameter_Common("Index", p_Index), + cs_Ut_Parameter_Common("Delflag", p_Delflag) + }; + + template (value) Ut_ParameterList_Type cs_MessageService(charstring p_Service) := + { /* @status APPROVED (LTE) */ + cs_Ut_Parameter_Common("Service", p_Service) + }; + + template (value) Ut_ParameterList_Type cs_PreferredStorage(charstring p_Mem1, + charstring p_Mem2, + charstring p_Mem3) := + { /* @status APPROVED (LTE) */ + cs_Ut_Parameter_Common("Mem1", p_Mem1), + cs_Ut_Parameter_Common("Mem2", p_Mem2), + cs_Ut_Parameter_Common("Mem3", p_Mem3) + }; + + template (value) Ut_ParameterList_Type cs_MessageFormat(charstring p_Mode) := + { /* @status APPROVED (LTE) */ + cs_Ut_Parameter_Common("Mode", p_Mode) + }; + + template (value) Ut_ParameterList_Type cs_SelectCharacterSet(charstring p_Chset) := + { /* @status APPROVED (LTE) */ + cs_Ut_Parameter_Common("Chset", p_Chset) + }; + + template (value) Ut_ParameterList_Type cs_TriggerMolr(charstring p_TypeMolr) := + { + cs_Ut_Parameter_Common("TypeMolr", p_TypeMolr) + }; + + template (value) Ut_ParameterList_Type cs_LocationTime(charstring p_Time) := + { + cs_Ut_Parameter_Common("LocationOnTime", p_Time) + }; + + template (value) Ut_ParameterList_Type cs_LocationAnswer(charstring p_Permission, charstring p_HandleId) := + { /* @status APPROVED (POS) */ + cs_Ut_Parameter_Common("Permission", p_Permission), + cs_Ut_Parameter_Common("Handle Id", p_HandleId) + }; + + template (value) Ut_ParameterList_Type cs_LocationNotify(charstring p_Msg) := + { + cs_Ut_Parameter_Common("LocationNotify", p_Msg) + }; + + template (value) Ut_ParameterList_Type cs_ServiceCentreAddress(charstring p_Sca, + charstring p_Tosca) := + { /* @status APPROVED (LTE) */ + cs_Ut_Parameter_Common("Sca", p_Sca), + cs_Ut_Parameter_Common("Tosca", p_Tosca) + }; + + template (value) Ut_ParameterList_Type cs_WriteMessageToMemory_Text(charstring p_Da, + charstring p_Toda, + charstring p_Text) := + { // @sic R5s110750 sic@ + /* @status APPROVED (LTE, SSNITZ, UTRAN) */ + cs_Ut_Parameter_Common("Da", p_Da), + cs_Ut_Parameter_Common("Toda", p_Toda), + cs_Ut_Parameter_Common("Text", p_Text) + }; + + template (value) Ut_ParameterList_Type cs_WriteMessageToMemory_PDU(charstring p_Len, + charstring p_Pdu) := + { /* @status APPROVED (LTE, SSNITZ, UTRAN) */ + cs_Ut_Parameter_Common("Len", p_Len), + cs_Ut_Parameter_Common("Text", p_Pdu) + }; + + template (value) Ut_ParameterList_Type cs_SendMessageFromStorage(charstring p_Index) := + { /* @status APPROVED (LTE, SSNITZ, UTRAN) */ + cs_Ut_Parameter_Common("Index", p_Index) + }; + + template (value) Ut_ParameterList_Type cs_Send_3_MessageFromStorage(charstring p_Index, + charstring p_Index1, + charstring p_Index2) := + { /* @status APPROVED (LTE) */ + cs_Ut_Parameter_Common("Index", p_Index), + cs_Ut_Parameter_Common("Index", p_Index1), + cs_Ut_Parameter_Common("Index", p_Index2) + }; + + template (value) Ut_ParameterList_Type cs_ChkMsgDisplayed(charstring p_Length, + charstring p_Msg) := + { /* @status APPROVED (LTE) */ + cs_Ut_Parameter_Common("Length", p_Length), + cs_Ut_Parameter_Common("Msg", p_Msg) + }; + + template (value) Ut_ParameterList_Type cs_SetTextModeParameters(charstring p_Fo, + charstring p_Vp, + charstring p_Pid) := + { /* @status APPROVED (LTE, SSNITZ, UTRAN) */ + /* @sic R5s100606 sic@ */ + cs_Ut_Parameter_Common("Fo", p_Fo), + cs_Ut_Parameter_Common("Vp", p_Vp), + cs_Ut_Parameter_Common("Pid", p_Pid) + }; + + template (value) Ut_ParameterList_Type cs_ChkCallDisplayed(charstring p_ToDisplay) := + { /* @status APPROVED (SSNITZ) */ + cs_Ut_Parameter_Common("ToDisplay", p_ToDisplay) + }; + + template (value) Ut_ParameterList_Type cs_Chk_SSUserInd(charstring p_SuppService, charstring p_ToDisplay) := + { /* @status APPROVED (SSNITZ) */ + cs_Ut_Parameter_Common("Supplementary Service", p_SuppService), + cs_Ut_Parameter_Common("ToDisplay", p_ToDisplay) + }; + + template (value) Ut_ParameterList_Type cs_QoS_Profile(charstring p_Cid, + charstring p_QoSParams) := + { /* @status APPROVED (LTE_A, LTE_IRAT, SSNITZ, UTRAN) */ + cs_Ut_Parameter_Cid(p_Cid), + cs_Ut_Parameter_QoS(p_QoSParams) + }; + + template (value) Ut_ParameterList_Type cs_OperatorFormat(charstring p_Format) := + { /* @status APPROVED (LTE, SSNITZ) */ + cs_Ut_Parameter_Common("Format", p_Format) + }; + + template (value) Ut_ParameterList_Type cs_ChangePassword(charstring p_SSToBarr, + charstring p_OldPassword, + charstring p_NewPassword) := + { + cs_Ut_Parameter_Common("Service To Barr", p_SSToBarr), + cs_Ut_Parameter_Common("Old Password", p_OldPassword), + cs_Ut_Parameter_Common("New Password", p_NewPassword) + }; + + template (value) Ut_ParameterList_Type cs_MBMSServiceInterest(charstring p_PLMN, + charstring p_ServiceId, + charstring p_Interest, + charstring p_SAI) := + { /* @status APPROVED (LTE_A) */ + cs_Ut_Parameter_PLMN(p_PLMN), + cs_Ut_Parameter_Common("Service Id", p_ServiceId), + cs_Ut_Parameter_Common("Interest", p_Interest), + cs_Ut_Parameter_Common("SAI", p_SAI) + }; + + template (value) Ut_ParameterList_Type cs_MBMSServiceActive(charstring p_ServiceId, + charstring p_SAI, + charstring p_Active) := + { /* @status APPROVED (LTE_A) */ + cs_Ut_Parameter_Common("Service Id", p_ServiceId), + cs_Ut_Parameter_Common("SAI", p_SAI), + cs_Ut_Parameter_Common("Active", p_Active) + }; + + template (value) Ut_ParameterList_Type cs_MBMSPriority(charstring p_PriorityOverUnicast) := + { /* @status APPROVED (LTE_A) */ + cs_Ut_Parameter_Common("Priority Over Unicast", p_PriorityOverUnicast) + }; + template (value) Ut_ParameterList_Type cs_CallIdNumber(charstring p_CallId) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, SSNITZ) */ + cs_Ut_Parameter_Common("Call Id", p_CallId) + }; + + template (value) Ut_ParameterList_Type cs_IntegerString(charstring p_Value) := + { /* @status APPROVED (LTE, POS, SSNITZ) */ + cs_Ut_Parameter_Common("Integer", p_Value) + }; + + template (value) Ut_Parameter_Type cs_Ut_Parameter_Uri(charstring p_Value) := cs_Ut_Parameter_Common("Uri", p_Value); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + template (value) Ut_Parameter_Type cs_Ut_Parameter_SS_Mode(charstring p_Value) := cs_Ut_Parameter_Common("Mode", p_Value); /* @status APPROVED (IMS, SSNITZ) */ + template (value) Ut_Parameter_Type cs_Ut_Parameter_Number(charstring p_Value) := cs_Ut_Parameter_Common("Number", p_Value); /* @status APPROVED (SSNITZ) */ + template (value) Ut_Parameter_Type cs_Ut_Parameter_Password(charstring p_Value) := cs_Ut_Parameter_Common("Password", p_Value); /* @status APPROVED (SSNITZ) */ + template (value) Ut_Parameter_Type cs_Ut_Parameter_USSD(charstring p_Value) := cs_Ut_Parameter_Common("USSD", p_Value); /* @status APPROVED (SSNITZ) */ + template (value) Ut_Parameter_Type cs_Ut_Parameter_SupplementaryService(charstring p_Value) := cs_Ut_Parameter_Common("SupplementaryService", p_Value); /* @status APPROVED (IMS, SSNITZ) */ + template (value) Ut_Parameter_Type cs_Ut_Parameter_SupplementaryServiceCondition(charstring p_Value) := cs_Ut_Parameter_Common("SupplementaryServiceCondition", p_Value); + template (value) Ut_Parameter_Type cs_Ut_Parameter_SupplementaryServiceTime(charstring p_Value) := cs_Ut_Parameter_Common("SupplementaryServiceTime", p_Value); /* @status APPROVED (SSNITZ) */ + template (value) Ut_Parameter_Type cs_Ut_Parameter_PublicUserId(charstring p_Value) := cs_Ut_Parameter_Common("PublicUserId", p_Value); + template (value) Ut_Parameter_Type cs_Ut_Parameter_HomeDomain(charstring p_Value) := cs_Ut_Parameter_Common("HomeDomain", p_Value); + template (value) Ut_Parameter_Type cs_Ut_Parameter_PrivateUserId(charstring p_Value) := cs_Ut_Parameter_Common("PrivateUSerId", p_Value); + + template (value) Ut_Parameter_Type cs_Ut_Parameter_NITZ_Check(charstring p_Value) := cs_Ut_Parameter_Common("Year: ", p_Value); // Value may not be needed, empty for now + template (value) Ut_Parameter_Type cs_Ut_Parameter_NITZ_Confirm(charstring p_Value) := cs_Ut_Parameter_Common("Year: ", p_Value); // Value may not be needed, empty for now + template (value) Ut_Parameter_Type cs_Ut_Parameter_NITZ_Year(charstring p_Value) := cs_Ut_Parameter_Common("Year: ", p_Value); /* @status APPROVED (LTE, SSNITZ) */ + template (value) Ut_Parameter_Type cs_Ut_Parameter_NITZ_Month(charstring p_Value) := cs_Ut_Parameter_Common("Month: ", p_Value); /* @status APPROVED (LTE, SSNITZ) */ + template (value) Ut_Parameter_Type cs_Ut_Parameter_NITZ_Day(charstring p_Value) := cs_Ut_Parameter_Common("Day: ", p_Value); /* @status APPROVED (LTE, SSNITZ) */ + template (value) Ut_Parameter_Type cs_Ut_Parameter_NITZ_Hour(charstring p_Value) := cs_Ut_Parameter_Common("Hour: ", p_Value); /* @status APPROVED (LTE, SSNITZ) */ + template (value) Ut_Parameter_Type cs_Ut_Parameter_NITZ_Minutes(charstring p_Value) := cs_Ut_Parameter_Common("Minutes: ", p_Value); /* @status APPROVED (LTE, SSNITZ) */ + template (value) Ut_Parameter_Type cs_Ut_Parameter_NITZ_Seconds(charstring p_Value) := cs_Ut_Parameter_Common("Seconds: ", p_Value); /* @status APPROVED (LTE, SSNITZ) */ + template (value) Ut_Parameter_Type cs_Ut_Parameter_NITZ_TimeZone(charstring p_Value) := cs_Ut_Parameter_Common("TimeZone: ", p_Value); /* @status APPROVED (LTE, SSNITZ) */ + template (value) Ut_Parameter_Type cs_Ut_Parameter_NITZ_LocalTimeZone(charstring p_Value) := cs_Ut_Parameter_Common("LocalTimeZone: ", p_Value); + template (value) Ut_Parameter_Type cs_Ut_Parameter_NITZ_DaylightSavingTime(charstring p_Value) := cs_Ut_Parameter_Common("DaylightSavingTime: ", p_Value); /* @status APPROVED (LTE, SSNITZ) */ + template (value) Ut_Parameter_Type cs_Ut_Parameter_NITZ_FullNetworkName(charstring p_Value) := cs_Ut_Parameter_Common("FullNetworkName: ", p_Value); + template (value) Ut_Parameter_Type cs_Ut_Parameter_NITZ_ShortNetworkName(charstring p_Value) := cs_Ut_Parameter_Common("ShortNetworkName: ", p_Value); + + //============================================================================ + // local functions + //---------------------------------------------------------------------------- + /* + * @desc local function to send command and get confirmation + * @param p_Port + * @param p_Cmd + * @param p_DontWaitForCnf (default value: false) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) + */ + function fl_UT_ApplyCommand(UT_PTC_MTC_PORT p_Port, + template (value) UT_COMMON_CMD p_Cmd, + boolean p_DontWaitForCnf := false) // @sic R5-140347 sic@ + { + p_Port.send(p_Cmd); + if (f_UT_CommandRequiresCnf(p_Cmd.CnfReq) and not p_DontWaitForCnf) { // @sic R5s110275 sic@ + p_Port.receive(car_UT_COMMON_CNF); + } + } + + /* + * @desc To send the command to the MTC, wait for a response and return the result string + * @param p_Port + * @param p_Cmd + * @return UT_COMMON_CNF + * @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) + */ + function fl_UT_ApplyCommandRetCnf(UT_PTC_MTC_PORT p_Port, + template (value) UT_COMMON_CMD p_Cmd) return UT_COMMON_CNF + { + p_Port.send(p_Cmd); + return fl_UT_RetCnf (p_Port); // @sic R5-140347 sic@ + } + + /* + * @desc To wait for a response and return the CNF + * @param p_Port + * @return UT_COMMON_CNF + * @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) + */ + function fl_UT_RetCnf(UT_PTC_MTC_PORT p_Port) return UT_COMMON_CNF + { + var UT_COMMON_CNF v_Cnf; + + p_Port.receive(car_UT_COMMON_CNF) -> value v_Cnf; + return v_Cnf; + } + + //============================================================================ + // public functions + //---------------------------------------------------------------------------- + /* + * @desc To ask the UE to configure Combined Attach + * TTCN waits until operation is confirmed before continuing + * TTCN waits until operation is confirmed before continuing. + * If the CS PS mode to which p_UE_CS_PS_UsageSetting_Tested is set is supported then this mode is chosen. + * If it does not matter which mode is selected then a supported mode is chosen. + * If the prose requests a specific mode it should be indicated as explicit parameter. + * To be used when the UE is switched off. + * @param p_Port + * @param p_UE_CS_PS_UsageSetting_Tested Whether UE is voice or data centric + * @status APPROVED (LTE, LTE_A, LTE_IRAT) + */ + function f_UT_ConfigureCombinedAttach(UT_PTC_MTC_PORT p_Port, + CS_PS_MODE p_UE_CS_PS_UsageSetting_Tested := px_UE_CS_PS_UsageSetting_Tested) + { + var integer v_Mode := 1; // PS/CS Mode 1 // @sic R5-106675 sic@ @sic R5s120511 sic@ + var CS_PS_MODE v_UE_CS_PS_UsageSetting_Tested := p_UE_CS_PS_UsageSetting_Tested; + + // The attach mode is configured in the preamble. The UE is switched on to reach a mode where AT command setting is possible. + f_UT_SwitchOnUE(p_Port, false, CNF_REQUIRED); // @sic R5s120597r1 sic@ + + if ((v_UE_CS_PS_UsageSetting_Tested == DATA_CENTRIC) and pc_CS_PS_data_centric) { + v_UE_CS_PS_UsageSetting_Tested := DATA_CENTRIC; + } + else if ((v_UE_CS_PS_UsageSetting_Tested == VOICE_CENTRIC) and pc_CS_PS_voice_centric) { + v_UE_CS_PS_UsageSetting_Tested := VOICE_CENTRIC; + } + else { + FatalError(__FILE__, __LINE__, "Invalid Usage Settings, please check pc_CS_PS_data_centric, pc_CS_PS_voice_centric and px_UE_CS_PS_UsageSetting_Tested"); // @sic R5s130828 add. change sic@ + } + if (pc_Combined_Attach) { // The message is only needed if both options are supported; @sic R5-103815 sic@ @sic R5s120079r1 sic@ + if (v_UE_CS_PS_UsageSetting_Tested == DATA_CENTRIC) {// @sic R5-106675 sic@ + v_Mode := 2; // PS/CS Mode 2 + } + fl_UT_ApplyCommand(p_Port, cas_UT_Req(CONFIGURE_CEMODE, CNF_REQUIRED, cs_CEMode(int2str(v_Mode)))); // @sic R5-106675 sic@ + } + else { + FatalError(__FILE__, __LINE__, "inconsistent parameter setting"); + } + + // The attach mode is configured in the preamble. At the end the UE is switched off properly. + f_UT_SwitchOffUE(p_Port, false, CNF_REQUIRED); // @sic R5s120597r1 sic@ + + } // f_UT_ConfigureCombinedAttach + + //---------------------------------------------------------------------------- + /* + * @desc To ask the UE to configure EPS Attach + * TTCN waits until operation is confirmed before continuing. + * If the PS mode to which p_UE_PS_UsageSetting_Tested is set is supported then this mode is chosen. + * If it does not matter which mode is chosen then a supported mode is chosen. + * If the prose requests a specific mode it should be indicated as explicit parameter. + * To be used when the UE is switched off. + * @param p_Port + * @param p_UE_PS_UsageSetting_Tested Whether UE is voice or data centric + * @status APPROVED (LTE, LTE_A, LTE_IRAT) + */ + function f_UT_ConfigureEPSAttach(UT_PTC_MTC_PORT p_Port, + PS_MODE p_UE_PS_UsageSetting_Tested := px_UE_PS_UsageSetting_Tested) + { + var integer v_Mode := 0; // PSMode 2 // @sic R5-106675 sic@ @sic R5s120511r1 sic@ + var PS_MODE v_UE_PS_UsageSetting_Tested := p_UE_PS_UsageSetting_Tested; + + // The attach mode is configured in the preamble. The UE is switched on to reach a mode where AT command setting is possible. + f_UT_SwitchOnUE(p_Port, false, CNF_REQUIRED); // @sic R5s120597r1 sic@ + + if ((v_UE_PS_UsageSetting_Tested == DATA_CENTRIC) and (pc_PS_data_centric == true)) { + v_UE_PS_UsageSetting_Tested := DATA_CENTRIC; + } + else if ((v_UE_PS_UsageSetting_Tested == VOICE_CENTRIC) and (pc_PS_voice_centric == true)) { + v_UE_PS_UsageSetting_Tested := VOICE_CENTRIC; + } + else { + FatalError(__FILE__, __LINE__, "Invalid Usage Settings, please check pc_PS_data_centric, pc_PS_voice_centric and px_UE_PS_UsageSetting_Tested"); // @sic R5s130828 add. change sic@ + } + if (pc_Attach) { // The message is only needed if both options are supported; @sic R5-103815 sic@ @sic R5s120079r1 sic@ + if (v_UE_PS_UsageSetting_Tested == VOICE_CENTRIC) {// @sic R5-106675 sic@ + v_Mode := 3; // PS Mode 1 + } + fl_UT_ApplyCommand(p_Port, cas_UT_Req(CONFIGURE_CEMODE, CNF_REQUIRED, cs_CEMode(int2str(v_Mode)))); // @sic R5-106675 sic@ + } + else { + FatalError(__FILE__, __LINE__, "inconsistent parameter setting"); + } + // The attach mode is configured in the preamble. At the end the UE is switched off properly. + f_UT_SwitchOffUE(p_Port, false, CNF_REQUIRED); // @sic R5s120597r1 sic@ + + } // f_UT_ConfigureEPSAttach + + //---------------------------------------------------------------------------- + /* + * @desc To ask the configure the UTRAN Operation Mode + * @param p_Port + * @param p_UE_OperationMode + * @status APPROVED (UTRAN) + */ + function f_UT_ConfigureUTRANOperationMode(UT_PTC_MTC_PORT p_Port, + charstring p_UE_OperationMode) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(CONFIGURE_OPERATIONMODE, CNF_REQUIRED, cs_OpMode(p_UE_OperationMode))); + } + + //---------------------------------------------------------------------------- + /* + * @desc To ask the operator disable EPS in the UE + * TTCN does not wait until operation is confirmed before continuing + * because the UE may send a DETACH immediately @sic R5s110694 sic@ + * @param p_Port + * @status APPROVED (LTE_IRAT) + */ + function f_UT_DisableEPS(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(DISABLE_EPS, NO_CNF_REQUIRED)); + } + + //---------------------------------------------------------------------------- + /* + * @desc Objective: To make the operator remove the USIM card + * TTCN waits until operation is confirmed before continuing + * @param p_Port + * @status APPROVED (IMS_IRAT, LTE, LTE_IRAT) + */ + function f_UT_USIM_Remove(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(REMOVE_USIM, CNF_REQUIRED)); + } + + //---------------------------------------------------------------------------- + /* + * @desc Objective: To make the operator insert the USIM card + * TTCN waits until operation is confirmed before continuing + * @param p_Port + * @param p_USIM_ID + * @status APPROVED (LTE, LTE_A, LTE_IRAT, UTRAN) + */ + function f_UT_USIM_Insert(UT_PTC_MTC_PORT p_Port, + template (omit) charstring p_USIM_ID) + { + if (isvalue(p_USIM_ID)) { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(INSERT_USIM, CNF_REQUIRED, cs_InsertUsim(valueof(p_USIM_ID)))); + } else { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(INSERT_USIM, CNF_REQUIRED)); + } + } + + //---------------------------------------------------------------------------- + /* + * @desc Objective: To power off the UE + * TTCN waits until operation is confirmed before continuing + * @param p_Port + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) + */ + function f_UT_PowerOffUE(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(POWER_OFF, CNF_REQUIRED)); + } + + //---------------------------------------------------------------------------- + /* + * @desc switch on the UE + * @param p_Port + * @param p_USIM_Rmvd + * @param p_CnfRequired (default: NO_CNF_REQUIRED) @sic R5s110498 sic@ + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) + */ + function f_UT_SwitchOnUE(UT_PTC_MTC_PORT p_Port, + boolean p_USIM_Rmvd, + Ut_CnfReq_Type p_CnfRequired := NO_CNF_REQUIRED) + { + var Ut_Common_Req_Type v_Request; + + if (pc_SwitchOnOff) { // switch on the UE + v_Request := SWITCH_ON; + } else if (p_USIM_Rmvd and pc_USIM_Removal) { // USIM needs to be removed @sic R5s120597r1 sic@ + v_Request := INSERT_USIM; + } else { // power on the UE + v_Request := POWER_ON; + } + fl_UT_ApplyCommand(p_Port, cas_UT_Req(v_Request, p_CnfRequired)); + } // f_UT_SwitchOnUE + + //---------------------------------------------------------------------------- + /* + * @desc switch off the UE + * @param p_Port + * @param p_USIM_Rmvd + * @param p_CnfRequired (default: NO_CNF_REQUIRED) @sic R5s110395 sic@ + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) + */ + function f_UT_SwitchOffUE(UT_PTC_MTC_PORT p_Port, + boolean p_USIM_Rmvd, + Ut_CnfReq_Type p_CnfRequired := NO_CNF_REQUIRED) + { + if (pc_SwitchOnOff) { // switch off the UE + fl_UT_ApplyCommand(p_Port, cas_UT_Req(SWITCH_OFF, p_CnfRequired)); // @sic R5s110395 sic@ + } else if (p_USIM_Rmvd and pc_USIM_Removal) { // UE doesn't support switch off, but does support SIM removal, so remove it; @sic R5-104083 sic@ @sic R5s120597r1 sic@ + fl_UT_ApplyCommand(p_Port, cas_UT_Req(REMOVE_USIM, CNF_REQUIRED)); + } else { // power off the UE - last resort + fl_UT_ApplyCommand(p_Port, cas_UT_Req(POWER_OFF, CNF_REQUIRED)); + } + } // f_UT_SwitchOffUE + + //---------------------------------------------------------------------------- + /* + * @desc Objective: To ask the operator to check the ETWS/CMAS Warning Indication is displayed + * TTCN waits until operation is confirmed before continuing + * @param p_Port + * @param p_WarningMsg1 + * @param p_WarningMsg2 + * @param p_CMAS (default: false) set to true if need to send a CMAS rather than ETWS message + * @return boolean + * @status APPROVED (LTE) + */ + function f_UT_CheckETWS_CMAS(UT_PTC_MTC_PORT p_Port, + charstring p_WarningMsg1, + charstring p_WarningMsg2, + boolean p_CMAS := false) return boolean + { + // To make the operator check if the ETWS/CMAS warning indication is displayed + var Ut_Common_Req_Type v_Type; // @sic R5s130376 sic@ + var UT_COMMON_CNF v_Cnf; + if (p_CMAS) { // for PWS message check + if(p_WarningMsg1 & p_WarningMsg2 != ""){ // @sic R5s130376 sic@ + v_Type := CHECK_CMAS_INDICATION; + } else { + v_Type := CHECK_CMAS_NO_INDICATION; + } + } else { // for ETWS message check + if(p_WarningMsg1 & p_WarningMsg2 != ""){ // @sic R5s130376 sic@ + v_Type := CHECK_ETWS_INDICATION; + } else { + v_Type := CHECK_ETWS_NO_INDICATION; + } + } + v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(v_Type, CNF_REQUIRED, cs_CheckETWS(p_WarningMsg1, p_WarningMsg2))); // @sic R5-140347 sic@ + return v_Cnf.Result; + } + + //---------------------------------------------------------------------------- + /* + * @desc Objective: To ask the operator to check if the ETWS/CMAS Alert is used + * TTCN waits until operation is confirmed before continuing + * @param p_Port + * @param p_CMAS (default: false) set to true if need to send a CMAS rather than ETWS message + * @return boolean + * @status APPROVED (LTE) + */ + function f_UT_CheckETWS_CMAS_Alert(UT_PTC_MTC_PORT p_Port, + boolean p_CMAS := false) return boolean + { + // To make the operator check if the alert is used + var Ut_Common_Req_Type v_Type := CHECK_ETWS_ALERT; + var UT_COMMON_CNF v_Cnf; + + if (p_CMAS) { + v_Type := CHECK_CMAS_ALERT; + } + v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(v_Type, CNF_REQUIRED)); // @sic R5-140347 sic@ + return v_Cnf.Result; + } + + //---------------------------------------------------------------------------- + /* + * @desc Objective: To ask the operator to check if the ETWS/CMAS Alert is not used + * TTCN waits until operation is confirmed before continuing + * @param p_Port + * @param p_CMAS (default: false) set to true if need to send a CMAS rather than ETWS message + * @return boolean + * @status APPROVED (LTE) + */ + function f_UT_CheckETWS_CMAS_NoAlert(UT_PTC_MTC_PORT p_Port, + boolean p_CMAS := false) return boolean + { + var Ut_Common_Req_Type v_Type := CHECK_ETWS_NO_ALERT; // @sic R5s130537 sic@ + var UT_COMMON_CNF v_Cnf; + + if (p_CMAS) { + v_Type := CHECK_CMAS_NO_ALERT; + } + v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(v_Type, CNF_REQUIRED)); // @sic R5-140347 sic@ + return v_Cnf.Result; + } + + //---------------------------------------------------------------------------- + /* + * @desc Objective: To check the DTCH is through connected + * TTCN waits until operation is confirmed before continuing + * @param p_Port + * @return boolean + * @status APPROVED (POS, SSNITZ) + */ + function f_UT_CheckDTCH_ThroughConn(UT_PTC_MTC_PORT p_Port) return boolean + { + var UT_COMMON_CNF v_Cnf; + v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(CHECK_DTCH_THROUGHCONNECTED, CNF_REQUIRED)); // @sic R5-140347 sic@ + return v_Cnf.Result; + } + + //---------------------------------------------------------------------------- + /* + * @desc To convert all TFT parameters into the correct charstring format for the AT command + * @param p_DedicatedId + * @param p_Filter + * @return charstring + * @status APPROVED (LTE) + */ + function fl_GenerateATForTFTPacketFilter(integer p_DedicatedId, + PacketFilter p_Filter) return charstring + { + var charstring v_IPAddress := ""; + var charstring v_ProtIdNextHeader := ""; + var charstring v_LocalPort := ""; + var charstring v_RemotePort := ""; + var charstring v_SecurityIndex := ""; + var charstring v_ToS := ""; + var charstring v_FlowLabel := ""; + var integer v_Direction; + var charstring v_Filterstring := ""; + var PacketFilter v_Filter := p_Filter; + var integer v_LengthOfContents := lengthof(v_Filter.contents); + var integer i; + + v_Filterstring := int2str(p_DedicatedId); + v_Filterstring := v_Filterstring & "," & int2str(hex2int(v_Filter.iei)+1); // identifier @sic R5s100557, R5s130195 Baseline Moving sic@ + v_Direction := bit2int(v_Filter.direction); // @sic R5s130195 Baseline Moving sic@ + v_Filterstring := v_Filterstring & "," & int2str(bit2int(v_Filter.precedence)); // precedence + + for (i := 0; i < v_LengthOfContents; i := i + 1) { + if (ischosen(v_Filter.contents[i].packetFilterComponentValue.ipv4RemoteAddress)) { //IPv4 + v_IPAddress := fl_TFTIPAdd(v_Filter.contents[i].packetFilterComponentValue.ipv4RemoteAddress); + } + else if (ischosen(v_Filter.contents[i].packetFilterComponentValue.ipv6RemoteAddress)) { //IPv6 + v_IPAddress := fl_TFTIPAdd(v_Filter.contents[i].packetFilterComponentValue.ipv6RemoteAddress); + } + else if (ischosen(v_Filter.contents[i].packetFilterComponentValue.protocolIdNextHeader)) { //Protocol id/next header + v_ProtIdNextHeader := fl_TFTProtHeader(v_Filter.contents[i].packetFilterComponentValue.protocolIdNextHeader); + } + else if (ischosen(v_Filter.contents[i].packetFilterComponentValue.singleLocalPort)) { //single local port + v_LocalPort := fl_TFTPort(v_Filter.contents[i].packetFilterComponentValue.singleLocalPort); + } + else if (ischosen(v_Filter.contents[i].packetFilterComponentValue.localPortRange)) { //local port range + v_LocalPort := fl_TFTPort(v_Filter.contents[i].packetFilterComponentValue.localPortRange); + } + else if (ischosen(v_Filter.contents[i].packetFilterComponentValue.singleRemotePort)) { //Single remote port + v_RemotePort := fl_TFTPort(v_Filter.contents[i].packetFilterComponentValue.singleRemotePort); + } + else if (ischosen(v_Filter.contents[i].packetFilterComponentValue.remotePortRange)) { //remote port range + v_RemotePort := fl_TFTPort(v_Filter.contents[i].packetFilterComponentValue.remotePortRange); + } + else if (ischosen(v_Filter.contents[i].packetFilterComponentValue.securityParameterIndex)) { //Security parameter index + v_SecurityIndex := fl_TFTSecurity(v_Filter.contents[i].packetFilterComponentValue.securityParameterIndex); + } + else if (ischosen(v_Filter.contents[i].packetFilterComponentValue.typeOfServiceTrafficClass)) { //Type of Service + v_ToS := fl_TFTToS(v_Filter.contents[i].packetFilterComponentValue.typeOfServiceTrafficClass); + } + else if (ischosen(v_Filter.contents[i].packetFilterComponentValue.flowLabel)) { //Flow Label + v_FlowLabel := fl_TFTFlow(v_Filter.contents[i].packetFilterComponentValue.flowLabel); + } + } + + if (v_IPAddress == "") { + v_Filterstring := v_Filterstring & ","; + } else { + v_Filterstring := v_Filterstring & "," & v_IPAddress; + } + if (v_ProtIdNextHeader == "") { + v_Filterstring := v_Filterstring & ","; + } else { + v_Filterstring := v_Filterstring & "," & v_ProtIdNextHeader; + } + if (v_LocalPort == "") { // @sic R5s100557 sic@ + v_Filterstring := v_Filterstring & ","; + } else { + v_Filterstring := v_Filterstring & "," & v_LocalPort; + } + if (v_RemotePort == "") { + v_Filterstring := v_Filterstring & ","; + } else { + v_Filterstring := v_Filterstring & "," & v_RemotePort; + } + if (v_SecurityIndex == "") { + v_Filterstring := v_Filterstring & ","; + } else { + v_Filterstring := v_Filterstring & "," & v_SecurityIndex; + } + if (v_ToS == "") { + v_Filterstring := v_Filterstring & ","; + } else { + v_Filterstring := v_Filterstring & "," & v_ToS; + } + if (v_FlowLabel == "") { + v_Filterstring := v_Filterstring & ","; + } else { + v_Filterstring := v_Filterstring & "," & v_FlowLabel; + } + if (v_Direction == 1) { // Uplink and downlink are different values in AT cmd + v_Direction := 2; + } else if (v_Direction == 2) { + v_Direction := 1; + } + v_Filterstring := v_Filterstring & "," & int2str(v_Direction); + return v_Filterstring; + } + + //---------------------------------------------------------------------------- + /* + * @desc To convert a TFT parameter into the correct charstring format for the AT command + * @param p_Input + * @return charstring + * @status APPROVED (LTE) + */ + function fl_TFTIPAdd(octetstring p_Input) return charstring + { + var integer v_Length := lengthof(p_Input); + var charstring v_Result:= """"; + var integer i; + + for (i := 0; i < v_Length; i := i + 1) { + v_Result := v_Result & int2str(oct2int(p_Input[i])); + if (i != (v_Length-1)) { + v_Result := v_Result & "."; + } + } + v_Result := v_Result & """"; + return v_Result; + } + + //---------------------------------------------------------------------------- + /* + * @desc To convert a TFT parameter into the correct charstring format for the AT command + * @param p_Input + * @return charstring + * @status APPROVED (LTE) + */ + function fl_TFTProtHeader(octetstring p_Input) return charstring + { + return int2str(oct2int(p_Input)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To convert a TFT parameter into the correct charstring format for the AT command + * @param p_Input + * @return charstring + * @status APPROVED (LTE) + */ + function fl_TFTPort(octetstring p_Input) return charstring + { + var integer v_Length := lengthof(p_Input); + var charstring v_Result := ""; + + v_Result := """"; + + if (v_Length == 4) { + v_Result := v_Result & int2str(oct2int(substr(p_Input, 0, 2))); // @sic R5s100362 sic@ + v_Result := v_Result & "." & int2str(oct2int(substr(p_Input, 2, 2))); + } else { // @sic R5s100362 sic@ + v_Result := v_Result & int2str(oct2int(p_Input)) & "." & int2str(oct2int(p_Input)); // only given one value, so put the same in both + } + + v_Result := v_Result & """"; + return v_Result; + } + + //---------------------------------------------------------------------------- + /* + * @desc To convert a TFT parameter into the correct charstring format for the AT command + * @param p_Input + * @return charstring + * @status APPROVED (LTE) + */ + function fl_TFTSecurity(octetstring p_Input) return charstring + { + return oct2str(p_Input); + } + + //---------------------------------------------------------------------------- + /* + * @desc To convert a TFT parameter into the correct charstring format for the AT command + * @param p_Input + * @return charstring + * @status APPROVED (LTE) + */ + function fl_TFTToS(octetstring p_Input) return charstring + { + var charstring v_Result := ""; + v_Result := int2str(oct2int(substr(p_Input, 0, 1))); + v_Result := v_Result & "." & int2str(oct2int(substr(p_Input, 1, 1))); + return v_Result; + } + + //---------------------------------------------------------------------------- + /* + * @desc To convert a TFT parameter into the correct charstring format for the AT command + * @param p_Input + * @return charstring + * @status APPROVED (LTE) + */ + function fl_TFTFlow(octetstring p_Input) return charstring + { + return hex2str(substr(oct2hex(p_Input), 1, 5)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To ask the operator to dial a CS call + * @param p_Port + * @param p_NumToDial (default value: "01234567890") + * @status APPROVED (LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) + */ + function f_UT_RequestCSCall(UT_PTC_MTC_PORT p_Port, + charstring p_NumToDial := "01234567890") + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(REQUEST_CALL, NO_CNF_REQUIRED, cs_DialNumber(p_NumToDial))); + } + + //---------------------------------------------------------------------------- + /* + * @desc To ask the operator to dial an IMS call + * @param p_Port + * @param p_NumToDial (default value: "01234567890") + * @return charstring + * @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT) + */ + function f_UT_RequestIMSCall(UT_PTC_MTC_PORT p_Port, + charstring p_NumToDial := "01234567890") return charstring // @sic R5-145723 sic@ + { + var UT_COMMON_CNF v_Cnf; + var charstring v_CallId := ""; +// fl_UT_ApplyCommand(p_Port, cas_UT_Req(VOICE_CALL_MODE, CNF_REQUIRED, cs_IMSMode)); + v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(REQUEST_IMS_VOICE_CALL, CNF_REQUIRED, {cs_Ut_Parameter_Uri(p_NumToDial)})); // @sic R5-134290, R5-145723 sic@ + v_CallId := regexp(v_Cnf.ResultString, "*CDU: ([1-9])", 0); + return v_CallId; + } + + //---------------------------------------------------------------------------- + /* + * @desc To ask the operator to dial an IMS call + * @param p_Port + * @param p_NumToDial (default value: px_EmergencyCallNumber) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_IRAT) + */ + function f_UT_RequestIMSEmergencyCall(UT_PTC_MTC_PORT p_Port, + charstring p_NumToDial := px_EmergencyCallNumber) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(REQUEST_IMS_VOICE_CALL, NO_CNF_REQUIRED, {cs_Ut_Parameter_Uri(p_NumToDial)})); // @sic R5-134290 sic@ + } + + //---------------------------------------------------------------------------- + /* + * @desc Initiate a video call + * @param p_Port + * @param p_CalleeUri + * @return charstring + * @status APPROVED (IMS) + */ + function f_UT_RequestIMSVideoCall(UT_PTC_MTC_PORT p_Port, + charstring p_CalleeUri) return charstring + { + var UT_COMMON_CNF v_Cnf; + var charstring v_CallId := ""; + var charstring v_MediaId := ""; + v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(IMS_CONFIGURE_VIDEO_CALL, CNF_REQUIRED, {cs_Ut_Parameter_Uri(p_CalleeUri)})); // @sic R5-145723 sic@ + v_MediaId := regexp(v_Cnf.ResultString, "*CDEFMP: ([1-9])", 0); + v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(INITIATE_VIDEO_CALL, CNF_REQUIRED, {cs_Ut_Parameter_Uri(p_CalleeUri), + cs_Ut_Parameter_Common("MediaId", v_MediaId)})); // @sic R5-145723 sic@ + v_CallId := regexp(v_Cnf.ResultString, "*CDU: ([1-9])", 0); + return v_CallId; + } + + //---------------------------------------------------------------------------- + /* + * @desc Add video to speech call + * @param p_Port + * @param p_CDUIdentifier - returned from f_UT_RequestIMSCall + * @status + */ + function f_UT_AddVideoToIMSCall(UT_PTC_MTC_PORT p_Port, + charstring p_CDUIdentifier) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(IMS_MODIFY_CALL, NO_CNF_REQUIRED, {cs_Ut_Parameter_Common("CallId", p_CDUIdentifier), + cs_Ut_Parameter_Common ("Media", "m=audio\0D\0Am=video")})); + } + + //---------------------------------------------------------------------------- + /* + * @desc To ask the operator to clear the stored assistance data + * To be used if the UE does not support the RESET command defined in 34.109 + * @param p_Port + * @status + */ + function f_UT_ClearStoredData(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(CLEAR_STORED_ASSISTANCE_DATA, CNF_REQUIRED)); + } + + //---------------------------------------------------------------------------- + /* + * @desc Objective: To make the operator check the indicated PLMN + * TTCN waits until operation is confirmed before continuing + * @param p_Port + * @param p_PLMN_ID + * @status APPROVED (LTE, LTE_A, LTE_IRAT) + */ + function f_UT_PLMN_Check(UT_PTC_MTC_PORT p_Port, + charstring p_PLMN_ID) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(CHECK_PLMN, CNF_REQUIRED, cs_CheckPlmn(p_PLMN_ID))); + } + + //---------------------------------------------------------------------------- + /* + * @desc To set manual PLMN selection and select PLMNN (i.e. both of the above in 1 function) + * @param p_Port + * @param p_PLMN_ID + * @param p_Cell_AccessTechnology (default value: tsc_ManualPLMN_None) + * only set this if the prose says e.g. 'select PLMN9 (UTRAN)'; options are _GERAN, _UTRAN or _EUTRA + * @param p_Ut_CnfReq_Type (default value: NO_CNF_REQUIRED) + * @status APPROVED (LTE, LTE_IRAT) + */ + function f_UT_ManualPLMN_Select(UT_PTC_MTC_PORT p_Port, + NAS_PlmnId p_PLMN_ID, + integer p_Cell_AccessTechnology := tsc_ManualPLMN_None, // @sic R5-106675 sic@ + Ut_CnfReq_Type p_Ut_CnfReq_Type := NO_CNF_REQUIRED) // @sic R5s110633 sic@ + { /* Objective: To manually select the specified PLMN + * TTCN waits until operation is confirmed before continuing */ + /* @sic R5-106675 sic@ */ + var charstring v_AT := fl_ConvertPLMN(p_PLMN_ID); + + if (p_Cell_AccessTechnology != tsc_ManualPLMN_None) { + v_AT := v_AT & "," & int2str(p_Cell_AccessTechnology); + } + fl_UT_ApplyCommand(p_Port, cas_UT_Req(PLMN_MANUAL, p_Ut_CnfReq_Type, cs_ManualPlmn(v_AT))); // @sic R5s110633 sic@ + } + + //---------------------------------------------------------------------------- + /* + * @desc To convert the PLMN in NAS format into that required by the AT command + * @param p_PLMN_ID + * @return charstring + * @status APPROVED (LTE, LTE_A, LTE_IRAT) + */ + function fl_ConvertPLMN(NAS_PlmnId p_PLMN_ID) return charstring + { /* @sic R5-106675 sic@ */ + var hexstring v_PLMN_Hex := oct2hex(p_PLMN_ID); // Now re-order it for the AT command + var hexstring v_PLMN_ForAT := v_PLMN_Hex[1] & v_PLMN_Hex[0] & v_PLMN_Hex[3] & v_PLMN_Hex[5] & v_PLMN_Hex[4]; + + if (v_PLMN_Hex[2] != 'F'H) { // @sic R5s120576 sic@ + v_PLMN_ForAT := v_PLMN_ForAT & v_PLMN_Hex[2]; + } + return """" & hex2str(v_PLMN_ForAT) & """"; + } + + //---------------------------------------------------------------------------- + /* + * @desc To request manual PLMN selection of a CSG + * @param p_Port + * @param p_PLMN_ID + * @param p_CSG_ID + * @status APPROVED (LTE, LTE_IRAT) + */ + function f_UT_ManualPLMN_CSG(UT_PTC_MTC_PORT p_Port, + NAS_PlmnId p_PLMN_ID, + bitstring p_CSG_ID) + { /* Objective: To ask the operator to manually select the specified CSG cell TTCN waits until operation is confirmed before continuing */ + fl_UT_ApplyCommand(p_Port, cas_UT_Req(SELECT_CSG, NO_CNF_REQUIRED, cs_PlmnCSG(fl_ConvertPLMN(p_PLMN_ID), int2str(bit2int(p_CSG_ID))))); // @sic R5s120298 sic@ + } + + //---------------------------------------------------------------------------- + /* + * @desc To check CSG id is/is not included in the list + * @param p_Port + * @param p_CSG_ID + * @param p_IncludedInList + * @status APPROVED (LTE) + */ + function f_UT_Check_CSG(UT_PTC_MTC_PORT p_Port, + bitstring p_CSG_ID, + boolean p_IncludedInList) + { /* Objective: To ask the operator to check if the specified CSG cell is (not) included in the list. TTCN waits until operation is confirmed before continuing */ + var charstring v_Included := "FALSE"; + if (p_IncludedInList) { + v_Included := "TRUE"; + } + fl_UT_ApplyCommand(p_Port, cas_UT_Req(CHECK_CSG, NO_CNF_REQUIRED, cs_CheckCSG(int2str(bit2int(p_CSG_ID)), v_Included))); + } + + //---------------------------------------------------------------------------- + /* + * @desc To request automatic PLMN selection + * @param p_Port + * @status APPROVED (LTE, LTE_IRAT) + */ + function f_UT_AutomaticPLMN_Select(UT_PTC_MTC_PORT p_Port) + { /* Objective: To change the UE into automatic mode */ + fl_UT_ApplyCommand(p_Port, cas_UT_Req(PLMN_AUTOMATIC, NO_CNF_REQUIRED)); // @sic R5-106675 sic@ + } + + //---------------------------------------------------------------------------- + /* + * @desc To request to join MBMS Service + * @param p_Port + * @param p_PLMN_ID + * @param p_Service_ID + * @param p_Interest (allowed values: ON, OFF) + * @param p_MBMS_SAI (default: omit) + * @status APPROVED (LTE_A) + */ + function f_UT_MBMS_SERVICE_Interest(UT_PTC_MTC_PORT p_Port, + template (omit) NAS_PlmnId p_PLMN_ID, + charstring p_Service_ID, + boolean p_Interest, + template (omit) integer p_MBMS_SAI := omit) // @sic R5-135000 sic@ + { /* Objective: To ask the operator to join MBMS service */ + var charstring v_Interest := "ON"; + var charstring v_SAI := ""; + var charstring v_PLMN_ID := ""; + + if (isvalue(p_PLMN_ID)) { + v_PLMN_ID := fl_ConvertPLMN(valueof(p_PLMN_ID)); + } + if (not p_Interest) { + v_Interest := "OFF"; + } + if (isvalue(p_MBMS_SAI)) { + v_SAI := int2str (valueof(p_MBMS_SAI)); + } + + fl_UT_ApplyCommand(p_Port, cas_UT_Req(MBMS_SERVICE_INTEREST, CNF_REQUIRED, cs_MBMSServiceInterest(v_PLMN_ID, p_Service_ID, v_Interest, v_SAI))); // @sic R5-135000, R5-142985 sic@ + } + + /* + * @desc To request to activate MBMS Service + * @param p_Port + * @param p_Service_ID + * @param p_Active + * @param p_MBMS_SAI (default value: omit) + * @status APPROVED (LTE_A) + */ + function f_UT_MBMS_SERVICE_Active(UT_PTC_MTC_PORT p_Port, + charstring p_Service_ID, + boolean p_Active, + template (omit) integer p_MBMS_SAI := omit) // @sic R5-135000 sic@ + { /* Objective: To ask the operator to join MBMS service */ + var charstring v_Active := "ON"; + var charstring v_SAI := ""; + + if (not p_Active) { + v_Active := "OFF"; + } + if (isvalue(p_MBMS_SAI)) { + v_SAI := int2str (valueof(p_MBMS_SAI)); + } + + fl_UT_ApplyCommand(p_Port, cas_UT_Req(MBMS_SERVICE_ACTIVE, CNF_REQUIRED, cs_MBMSServiceActive(p_Service_ID, v_SAI, v_Active))); + } + + /* + * @desc To request that the UE is configured such that MBMS services takes priority over unicast bearer transmissions + * @param p_Port + * @param p_PriorityOverUnicast + * @status APPROVED (LTE_A) + */ + function f_UT_MBMS_Unicast(UT_PTC_MTC_PORT p_Port, + boolean p_PriorityOverUnicast) + { + var charstring v_PriorityOverUnicast := "FALSE"; + + if (p_PriorityOverUnicast) { + v_PriorityOverUnicast := "TRUE"; + } + fl_UT_ApplyCommand(p_Port, cas_UT_Req(MBMS_PRIORITY_OVER_UNICAST, CNF_REQUIRED, cs_MBMSPriority(v_PriorityOverUnicast))); + } + + //---------------------------------------------------------------------------- + /* + * @desc To activate a dedicated LTE EPS bearer + * @param p_Port + * @param p_ActivateOrModify + * @param p_DedicatedId + * @param p_DefaultId + * @param p_QoS + * @param p_Tft + * @param p_Ut_CnfReq_Type (default value: NO_CNF_REQUIRED) + * @status APPROVED (LTE) + */ + function fl_UT_RequestActivateOrModifyDedicatedBearer(UT_PTC_MTC_PORT p_Port, + template (value) Ut_Common_Req_Type p_ActivateOrModify, + integer p_DedicatedId, + integer p_DefaultId, + template (value) EPS_QualityOfService p_QoS, + template (value) TrafficFlowTemplate p_Tft, + Ut_CnfReq_Type p_Ut_CnfReq_Type := NO_CNF_REQUIRED) + { + // @sic R5s100470 change 3 sic@ + var EPS_QualityOfService v_QoS := valueof(p_QoS); // need to do this to then manipulate it in the charstring + var TrafficFlowTemplate v_Tft := valueof(p_Tft); // need to do this to then manipulate it in the charstring + var charstring v_QoSstring := ""; + var integer v_NoOfPacketFilters := bit2int(v_Tft.noOfPktFilter); + var integer i; + + v_QoSstring := int2str(p_DedicatedId); + v_QoSstring := v_QoSstring &","& int2str(bit2int(v_QoS.qci)); + v_QoSstring := v_QoSstring &","& int2str(fl_QoS_MaximumBitRate(v_QoS.guaranteedBitRateDl)); // @sic R5s100557 sic@ + v_QoSstring := v_QoSstring &","& int2str(fl_QoS_MaximumBitRate(v_QoS.guaranteedBitRateUl)); // @sic R5s100557 sic@ + v_QoSstring := v_QoSstring &","& int2str(fl_QoS_MaximumBitRate(v_QoS.maxBitRateDl)); // @sic R5s100557 sic@ + v_QoSstring := v_QoSstring &","& int2str(fl_QoS_MaximumBitRate(v_QoS.maxBitRateUl)); // @sic R5s100557 sic@ + // Extended rates are not dealt with at the moment (all set to 0 in current 36.508) + + fl_UT_ApplyCommand(p_Port, cas_UT_Req(REQUEST_DED_BEARER, CNF_REQUIRED, cs_SecondaryPDP(int2str(p_DedicatedId), int2str(p_DefaultId)))); // @sic R5s110570 sic@ + fl_UT_ApplyCommand(p_Port, cas_UT_Req(DEFINE_EPS_QOS, CNF_REQUIRED, cs_EPSQoS(v_QoSstring))); // @sic R5s110570 sic@ + + if (v_NoOfPacketFilters != 0) { + for (i := 0; i < v_NoOfPacketFilters; i := i + 1) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(DEFINE_TFT, CNF_REQUIRED, cs_TFT(fl_GenerateATForTFTPacketFilter(p_DedicatedId, v_Tft.packetFilterList[i])))); // @sic R5s110570 sic@ + } + } + fl_UT_ApplyCommand(p_Port, cas_UT_Req(p_ActivateOrModify, p_Ut_CnfReq_Type, cs_PDP_Cid(int2str(p_DedicatedId)))); + } + + /* + * @desc To convert the maximum bit rate for the QoS + * @param p_Val + * @return integer + * @status APPROVED (LTE, LTE_A, LTE_IRAT, SSNITZ, UTRAN) + */ + function fl_QoS_MaximumBitRate(B8_Type p_Val) return integer + { + var integer v_Val := bit2int(p_Val); + if ((v_Val >= bit2int('00000001'B)) and (v_Val <= bit2int('00111111'B))) { + return v_Val; + } + if ((v_Val >= bit2int('01000000'B)) and (v_Val <= bit2int('01111111'B))) { + return (64 + ((v_Val - 64)*8)); + } + if ((v_Val >= bit2int('10000000'B)) and (v_Val <= bit2int('11111110'B))) { + return (576 + ((v_Val - 128)*64)); + } + if (v_Val == bit2int('11111111'B)) { + return 0; + } + return 0; + } + + /* + * @desc To convert the extended maximum bit rate for the QoS + * @param p_Val + * @return integer + * @status + */ + function fl_QoS_ExtendedMaxBitRate(B8_Type p_Val) return integer + { + var integer v_Val := bit2int(p_Val); + if ((v_Val >= bit2int('00000001'B)) and (v_Val <= bit2int('01001010'B))) { + return (8600 + (v_Val*100)); + } + if ((v_Val >= bit2int('01001011'B)) and (v_Val <= bit2int('10111010'B))) { + return (16000 + ((v_Val - 74)*1000)); + } + if ((v_Val >= bit2int('10111011'B)) and (v_Val <= bit2int('11111010'B))) { + return (128000 + ((v_Val - 186)*2000)); + } + return 0; + } + + /* + * @desc To convert the transfer delay for the QoS + * @param p_Val + * @return integer + * @status APPROVED (LTE_A, LTE_IRAT, SSNITZ, UTRAN) + */ + function fl_QoS_TransferDelay(B6_Type p_Val) return integer + { + var integer v_Val := bit2int(p_Val); + if ((v_Val >= bit2int('000001'B)) and (v_Val <= bit2int('001111'B))) { + return (v_Val*10); + } + if ((v_Val >= bit2int('010000'B)) and (v_Val <= bit2int('011111'B))) { + return (200 + ((v_Val - 16)*50)); + } + if ((v_Val >= bit2int('100000'B)) and (v_Val <= bit2int('111110'B))) { + return (1000 + ((v_Val - 32)*100)); + } + return 0; + } + + /* + * @desc To convert the SDU Error Ratio for the QoS + * @param p_Val + * @return charstring + * @status APPROVED (LTE_A, LTE_IRAT, SSNITZ, UTRAN) + */ + function fl_QoS_SDUErrorRatio(B4_Type p_Val) return charstring + { + select (p_Val) { + case ('0001'B) { return ("1E2"); } + case ('0010'B) { return ("7E3"); } + case ('0011'B) { return ("1E3"); } + case ('0100'B) { return ("1E4"); } + case ('0101'B) { return ("1E5"); } + case ('0110'B) { return ("1E6"); } + case ('0111'B) { return ("1E1"); } + } + return ""; + } + + /* + * @desc To convert the Residual BER for the QoS + * @param p_Val + * @return charstring + * @status APPROVED (LTE_A, LTE_IRAT, SSNITZ, UTRAN) + */ + function fl_QoS_ResidualBER(B4_Type p_Val) return charstring + { + select (p_Val) { + case ('0001'B) { return ("5E2"); } + case ('0010'B) { return ("1E2"); } + case ('0011'B) { return ("5E3"); } + case ('0100'B) { return ("4E3"); } + case ('0101'B) { return ("1E3"); } + case ('0110'B) { return ("1E4"); } + case ('0111'B) { return ("1E5"); } + case ('1000'B) { return ("1E6"); } + case ('1001'B) { return ("6E8"); } + } + return ""; + } + + //---------------------------------------------------------------------------- + /* + * @desc To activate a dedicated LTE EPS bearer + * @param p_Port + * @param p_DedicatedId + * @param p_DefaultId + * @param p_QoS + * @param p_Tft + * @status APPROVED (LTE) + */ + function f_UT_RequestModifyDedicatedBearer(UT_PTC_MTC_PORT p_Port, + integer p_DedicatedId, + integer p_DefaultId, + template (value) EPS_QualityOfService p_QoS, + template (value) TrafficFlowTemplate p_Tft) + { + fl_UT_RequestActivateOrModifyDedicatedBearer(p_Port, MODIFY_BEARER, p_DedicatedId, p_DefaultId, p_QoS, p_Tft); + } + + //---------------------------------------------------------------------------- + /* + * @desc To activate a dedicated LTE EPS bearer + * @param p_Port + * @param p_DedicatedId + * @param p_DefaultId + * @param p_QoS + * @param p_Tft + * @param p_Ut_CnfReq_Type (default value: NO_CNF_REQUIRED) + * @status APPROVED (LTE) + */ + function f_UT_RequestActivateDedicatedBearer(UT_PTC_MTC_PORT p_Port, + integer p_DedicatedId, + integer p_DefaultId, + template (value) EPS_QualityOfService p_QoS, + template (value) TrafficFlowTemplate p_Tft, + Ut_CnfReq_Type p_Ut_CnfReq_Type := NO_CNF_REQUIRED) + { + fl_UT_RequestActivateOrModifyDedicatedBearer(p_Port, ACTIVATE_BEARER, p_DedicatedId, p_DefaultId, p_QoS, p_Tft, p_Ut_CnfReq_Type); + } + + //---------------------------------------------------------------------------- + /* + * @desc To deactivate either an EPS bearer or UTRAN/GERAN PDP context + * @param p_Port + * @param p_DedicatedId + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_UT_DeactivateBearer(UT_PTC_MTC_PORT p_Port, + integer p_DedicatedId) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(DEACTIVATE_BEARER, NO_CNF_REQUIRED, cs_PDP_Cid(int2str(p_DedicatedId)))); + } + //---------------------------------------------------------------------------- + /* + * @desc To create a PDP context on either UTRAN or GERAN + * @param p_Port + * @param p_CId + * @param p_QoSParams + * @param p_APN (default value: "") + * @param p_NSLPI + * @status APPROVED (LTE_A, LTE_IRAT, SSNITZ, UTRAN) + */ + function f_UT_ActivatePDPContextUG(UT_PTC_MTC_PORT p_Port, + integer p_CId, + template (value) QualityOfService p_QoSParams, + charstring p_APN := "", + integer p_NSLPI := -1) + { + var QualityOfService v_QoS := valueof(p_QoSParams); // need to do this to then manipulate the string + var charstring v_QoSstring := ""; + var charstring v_PDP_CtxtString := ""; + var integer v_SSDesc := bit2int(v_QoS.sourceStatisticsDescriptor); + var integer v_TrafficClass := bit2int(v_QoS.trafficClass); + var integer v_DelOrder := bit2int(v_QoS.deliveryOrder); + var integer v_DeliveryErrorSDU := bit2int(v_QoS.deliveryErrorSDU); + + // string produced: "p_PDP_Type","p_AccessPointName","p_PDP_Address" - this field is no longer included + if (p_APN != "") { + v_PDP_CtxtString := """" & p_APN & """"; + } + + if (p_NSLPI >= 0) { // @sic R5-140628 sic@ + v_PDP_CtxtString := v_PDP_CtxtString & ",,,,,,,," & int2str (p_NSLPI) ; + } + // @sic C1-141830 sic@ + if (v_SSDesc > 1) { + v_SSDesc := 1; // Only allowed values are 0 or 1 + } + + v_TrafficClass := v_TrafficClass - 1; // in AT command value is one less than in PDP Context + if (v_TrafficClass < 0) { + v_TrafficClass := 0; + } + + select (v_DelOrder) { + case (1) { v_DelOrder := 1; } + case (2) { v_DelOrder := 0; } + case else { v_DelOrder := 2; } + } + + select (v_DeliveryErrorSDU) { + case (1) { v_DeliveryErrorSDU := 2; } + case (2) { v_DeliveryErrorSDU := 1; } + case (3) { v_DeliveryErrorSDU := 0; } + case else { v_DeliveryErrorSDU := 3; } + } + + v_QoSstring := v_QoSstring & int2str(v_TrafficClass); + v_QoSstring := v_QoSstring & "," & int2str(fl_QoS_MaximumBitRate(v_QoS.maxBitRateUL)); + v_QoSstring := v_QoSstring & "," & int2str(fl_QoS_MaximumBitRate(v_QoS.maxBitRateDL)); + v_QoSstring := v_QoSstring & "," & "," & "," & int2str(v_DelOrder); + v_QoSstring := v_QoSstring & "," & int2str(bit2int(v_QoS.maxSduSize)*10); + v_QoSstring := v_QoSstring & ",""" & fl_QoS_SDUErrorRatio(v_QoS.sduErrorRatio)& """"; + v_QoSstring := v_QoSstring & ",""" & fl_QoS_ResidualBER(v_QoS.residualBER)& """"; + v_QoSstring := v_QoSstring & "," & int2str(v_DeliveryErrorSDU); + v_QoSstring := v_QoSstring & "," & int2str(fl_QoS_TransferDelay(v_QoS.transferDelay)); + v_QoSstring := v_QoSstring & "," & int2str(bit2int(v_QoS.trafficHandlingPrio)); + v_QoSstring := v_QoSstring & "," & int2str(v_SSDesc); + v_QoSstring := v_QoSstring & "," & int2str(bit2int(v_QoS.signallingInd)); + + fl_RequestPDPContext(p_Port, p_CId, v_PDP_CtxtString); + fl_UT_ApplyCommand(p_Port, cas_UT_Req(DEFINE_QOS, CNF_REQUIRED, cs_QoS_Profile(int2str(p_CId), v_QoSstring))); // @sic R5s110570 sic@ + fl_UT_ApplyCommand(p_Port, cas_UT_Req(ACTIVATE_BEARER, NO_CNF_REQUIRED, cs_PDP_Cid(int2str(p_CId)))); + } + + //---------------------------------------------------------------------------- + /* + * @desc To configure SIMTC parameters on an existing bearer + * @param p_Port + * @param p_BearerId + * @param p_NSLPI + * @param p_EAB + * @status + */ + function f_UT_ConfigureSIMTCParams(UT_PTC_MTC_PORT p_Port, + integer p_BearerId, + integer p_NSLPI := -1, + integer p_EAB := -1) + { + var charstring v_PDP_CtxtString := int2str(p_BearerId) & ",,,,,,,,,,"; + + // most parameters are left blank - as bearer is already configured, only SIMTC params are included at the end + if (p_NSLPI >= 0) { + v_PDP_CtxtString := v_PDP_CtxtString & int2str(p_NSLPI); + } + if (p_EAB >= 0) { + v_PDP_CtxtString := v_PDP_CtxtString & "," & int2str(p_EAB); + } + + fl_UT_ApplyCommand(p_Port, cas_UT_Req(REQUEST_PDPCONTEXT, CNF_REQUIRED, cs_RequestPDP(v_PDP_CtxtString))); + } + + //---------------------------------------------------------------------------- + /* + * @desc To modify a PDP Context + * @param p_Port + * @param p_PDPContextId + * @status + */ + function f_UT_RequestModifyPDPContext(UT_PTC_MTC_PORT p_Port, + integer p_PDPContextId) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(MODIFY_BEARER, NO_CNF_REQUIRED, cs_PDP_Cid(int2str(p_PDPContextId)))); + } + + //---------------------------------------------------------------------------- + /* + * @desc To request an additional PDN connection - to be associated with an already existing bearer (p_BearerId) + * @param p_Port + * @param p_BearerId - The id of the already existing bearer + * @param p_APN + * @param p_EmergencyBearer (default: false) - set to true if need an additional PDN for an emergency bearer @sic R5-120403 sic@ + * @param p_Ut_CnfReq_Type (default value: NO_CNF_REQUIRED) + * @param p_NSLPI + * @status APPROVED (LTE, LTE_A, LTE_IRAT) + */ + function f_UT_RequestAdditionalPDNConnectivity(UT_PTC_MTC_PORT p_Port, + integer p_BearerId, + charstring p_APN := "", // @sic R5s100466 sic@ + boolean p_EmergencyBearer := false, // @sic R5-120403 sic@ + Ut_CnfReq_Type p_Ut_CnfReq_Type := NO_CNF_REQUIRED, + integer p_NSLPI := -1) // @sic R5s130330 sic@ + { + var charstring v_Cmd := ""; + var charstring v_CommasToReqType := ",,,,,"; + + if (p_APN != "") { + v_Cmd := """" & p_APN & """"; // @sic R5s100466, R5s100538 sic@ + } + if (p_EmergencyBearer) { // @sic R5-120403 sic@ + v_Cmd := v_Cmd & v_CommasToReqType & "1"; + } + if (p_NSLPI >= 0) { // @sic R5-140628 sic@ + if (not p_EmergencyBearer) { + v_Cmd := v_Cmd & v_CommasToReqType & ",,,"; + } + v_Cmd := v_Cmd & int2str(p_NSLPI); + } + // @sic C1-141830 sic@ + + fl_RequestPDPContext(p_Port, p_BearerId, v_Cmd); + fl_UT_ApplyCommand(p_Port, cas_UT_Req(ACTIVATE_BEARER, p_Ut_CnfReq_Type, cs_PDP_Cid(int2str(p_BearerId)))); + } + + //---------------------------------------------------------------------------- + /* + * @desc Used by LTE, UTRAN and GERAN to send the DCONT AT command + * @param p_Port + * @param p_BearerId + * @param p_RestOfCmd + * @status APPROVED (LTE, LTE_A, LTE_IRAT, SSNITZ, UTRAN) + */ + function fl_RequestPDPContext(UT_PTC_MTC_PORT p_Port, + integer p_BearerId, + charstring p_RestOfCmd) + { // @sic R5s100466 change 5 sic@ + var charstring v_Cmd := ""; + var charstring v_Type := """IP"""; + + if (pc_IPv6 and (not pc_IPv4)) { + v_Type := """IPV6"""; + } + if (pc_IPv6 and pc_IPv4) { + v_Type := """IPV4V6"""; + } + v_Cmd := v_Cmd & int2str(p_BearerId); + v_Cmd := v_Cmd & "," & v_Type; + + if (p_RestOfCmd != "") { // @sic R5s120002 sic@ + v_Cmd := v_Cmd & "," & p_RestOfCmd; // @sic R5s100520 sic@ + } + fl_UT_ApplyCommand(p_Port, cas_UT_Req(REQUEST_PDPCONTEXT, CNF_REQUIRED, cs_RequestPDP(v_Cmd))); // @sic R5s110570 sic@ + } + + //---------------------------------------------------------------------------- + /* + * @desc To attach for PS services + * @param p_Port + * @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) + */ + function f_UT_TriggerAttach(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(ATTACH, NO_CNF_REQUIRED)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To detach + * @param p_Port + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_UT_InitiateDetach(UT_PTC_MTC_PORT p_Port) // @sic R5-113807 sic@ + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(DETACH, NO_CNF_REQUIRED)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To detach + * @param p_Port + * @status APPROVED (LTE) + */ + function f_UT_InitiateDetach_NonEPSOnly(UT_PTC_MTC_PORT p_Port) // @sic R5-113807 sic@ + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(DETACH_NON_EPS, NO_CNF_REQUIRED)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To trigger the transmission of a UE Assistance Information messag + * @param p_Port + * @param p_PowerPreference (default: 1 - low power consumption) + * @status + */ + function f_UT_PowerPreferenceIndication(UT_PTC_MTC_PORT p_Port, B1_Type p_PowerPreference := '1'B ) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(POWER_PREFERENCE, NO_CNF_REQUIRED, cs_PowerPreference (int2str(bit2int(p_PowerPreference))))); + } + + //---------------------------------------------------------------------------- + /* + * @desc To Select the SMS message service + * @param p_Port + * @param p_Service + * @return charstring + * @status APPROVED (LTE) + */ + function f_UT_SelectMessageService(UT_PTC_MTC_PORT p_Port, + charstring p_Service) return charstring + { + var UT_COMMON_CNF v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(SELECT_MESSAGE_SERVICE, + CNF_REQUIRED, + cs_MessageService(p_Service))); + return v_Cnf.ResultString; // @sic R5-140347 sic@ + } + + //---------------------------------------------------------------------------- + /* + * @desc To set the preferred message storage for SMS + * @param p_Port + * @param p_Mem1 + * @param p_Mem2 + * @param p_Mem3 + * @return charstring + * @status APPROVED (LTE) + */ + function f_UT_SetPreferredMessageStorage(UT_PTC_MTC_PORT p_Port, + charstring p_Mem1, + charstring p_Mem2, + charstring p_Mem3) return charstring + { + var UT_COMMON_CNF v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(SET_PREFERRED_STORAGE, + CNF_REQUIRED, + cs_PreferredStorage(p_Mem1, p_Mem2, p_Mem3))); + return v_Cnf.ResultString; // @sic R5-140347 sic@ + } + + //---------------------------------------------------------------------------- + /* + * @desc to set the message format for SMS + * @param p_Port + * @param p_Mode + * @return charstring + * @status APPROVED (LTE) + */ + function f_UT_SetMessageFormat(UT_PTC_MTC_PORT p_Port, + charstring p_Mode) return charstring + { + var UT_COMMON_CNF v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(MESSAGE_FORMAT, + CNF_REQUIRED, + cs_MessageFormat(p_Mode))); + return v_Cnf.ResultString; // @sic R5-140347 sic@ + } + + //---------------------------------------------------------------------------- + /* + * @desc To select the character set for SMS + * @param p_Port + * @param p_Chset + * @return charstring + * @status APPROVED (LTE) + */ + function f_UT_SelectCharacterSet(UT_PTC_MTC_PORT p_Port, + charstring p_Chset) return charstring + { + var UT_COMMON_CNF v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(SELECT_CHARACTER_SET, + CNF_REQUIRED, + cs_SelectCharacterSet(p_Chset))); + return v_Cnf.ResultString; // @sic R5-140347 sic@ + } + + //---------------------------------------------------------------------------- + /* + * @desc To delete the SMS message from storage + * @param p_Port + * @param p_Index + * @param p_Delflag + * @return charstring + * @status APPROVED (LTE) + */ + function f_UT_DeleteMessageFromStorage_DELFLAG(UT_PTC_MTC_PORT p_Port, + integer p_Index, + integer p_Delflag) return charstring + { + var UT_COMMON_CNF v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(DELETE_MESSAGE_WITHFLAG, + CNF_REQUIRED, + cs_DeleteMessage_Withflag(int2str(p_Index), int2str(p_Delflag)))); + return v_Cnf.ResultString; // @sic R5-140347 sic@ + } + + //---------------------------------------------------------------------------- + /* + * @desc To request the service centre address for SMS + * @param p_Port + * @param p_Sca + * @param p_Tosca + * @return charstring + * @status APPROVED (LTE) + */ + function f_UT_ServiceCentreAddress(UT_PTC_MTC_PORT p_Port, + charstring p_Sca, + integer p_Tosca) return charstring + { + var UT_COMMON_CNF v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(SERVICE_CENTRE_ADDRESS, + CNF_REQUIRED, + cs_ServiceCentreAddress(p_Sca, int2str(p_Tosca)))); + return v_Cnf.ResultString; // @sic R5-140347 sic@ + } + + //---------------------------------------------------------------------------- + /* + * @desc to write an SMS message to memory + * @param p_Port + * @param p_Da + * @param p_Toda + * @param p_Text + * @return charstring + * @status APPROVED (LTE, SSNITZ, UTRAN) + */ + function f_UT_WriteMessageToMemoryText(UT_PTC_MTC_PORT p_Port, + charstring p_Da, + charstring p_Toda, + charstring p_Text) return charstring + { + var UT_COMMON_CNF v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(WRITE_MESSAGE_TOMEMORY_TEXTMODE, + CNF_REQUIRED, + cs_WriteMessageToMemory_Text(p_Da, p_Toda, p_Text))); // @sic R5s110750 sic@ + return v_Cnf.ResultString; // @sic R5-140347 sic@ + } + + //---------------------------------------------------------------------------- + /* + * @desc to write an SMS message to memory + * @param p_Port + * @param p_Len + * @param p_Pdu + * @return charstring + * @status APPROVED (LTE, SSNITZ, UTRAN) + */ + function f_UT_WriteMessageToMemoryPDU(UT_PTC_MTC_PORT p_Port, + charstring p_Len, + charstring p_Pdu) return charstring + { + var UT_COMMON_CNF v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(WRITE_MESSAGE_TOMEMORY_PDUMODE, + CNF_REQUIRED, + cs_WriteMessageToMemory_PDU(p_Len, p_Pdu))); + return v_Cnf.ResultString; // @sic R5-140347 sic@ + } + + //---------------------------------------------------------------------------- + /* + * @desc To send a stored SMS message + * @param p_Port + * @param p_Index + * @status APPROVED (LTE, SSNITZ, UTRAN) + */ + function f_UT_SendStoredOneMessage(UT_PTC_MTC_PORT p_Port, + integer p_Index) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(SEND_STORED_MESSAGE_ONE, + NO_CNF_REQUIRED, // @sic R5s110091 sic@ + cs_SendMessageFromStorage(int2str(p_Index)))); + } + + //---------------------------------------------------------------------------- + /* + * @desc To send a stored 3 stored SMS messages, concatenated + * @param p_Port + * @param p_Index + * @status APPROVED (LTE) + */ + function f_UT_SendStored_3_Messages(UT_PTC_MTC_PORT p_Port, + integer p_Index) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(SEND_3_STORED_MESSAGES, + NO_CNF_REQUIRED, + cs_Send_3_MessageFromStorage(int2str(p_Index), int2str(p_Index + 1), int2str(p_Index + 2)))); + } + + //---------------------------------------------------------------------------- + /* + * @desc To set text mode parameters for SMS + * @param p_Port + * @param p_Fo + * @param p_Vp + * @param p_Pid + * @return charstring + * @status APPROVED (LTE, SSNITZ, UTRAN) + */ + function f_UT_SetTextModeParameters(UT_PTC_MTC_PORT p_Port, + integer p_Fo, + integer p_Vp, + integer p_Pid) return charstring + { + var UT_COMMON_CNF v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(SET_TEXTMODE_PARAMETERS, + CNF_REQUIRED, + cs_SetTextModeParameters(int2str(p_Fo), int2str(p_Vp), int2str(p_Pid)))); // @sic R5s100606 sic@ + return v_Cnf.ResultString; // @sic R5-140347 sic@ + } + + //---------------------------------------------------------------------------- + /* + * @desc To check the SMS message displayed + * @param p_Port + * @param p_Length + * @param p_Msg + * @return boolean + * @status APPROVED (LTE) + */ + function f_UT_ChkMsgDisplayed(UT_PTC_MTC_PORT p_Port, + integer p_Length, + charstring p_Msg) return boolean + { + // To make the operator check an MT Short Message received + var UT_COMMON_CNF v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(CHECK_MESSAGE_DISPLAYED, + CNF_REQUIRED, + cs_ChkMsgDisplayed(int2str(p_Length), p_Msg))); + + return v_Cnf.Result; + } + + //---------------------------------------------------------------------------- + /* + * @desc To check the UE displays the string provided (number/name) + * @param p_Port + * @param p_ToDisplay + * @return boolean + * @status APPROVED (SSNITZ) + */ + function f_UT_ChkCallDisplayed(UT_PTC_MTC_PORT p_Port, + charstring p_ToDisplay) return boolean + { // To make the operator check the number/name of the call is displayed + + var UT_COMMON_CNF v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(CHECK_CALL_DISPLAY, + CNF_REQUIRED, + cs_ChkCallDisplayed(p_ToDisplay))); + + return v_Cnf.Result; + } + + //---------------------------------------------------------------------------- + /* + * @desc To check the UE displays the string provided + * @param p_Port + * @param p_ToDisplay + * @return boolean + * @status APPROVED (SSNITZ) + */ + function f_UT_ChkResponseDisplayed(UT_PTC_MTC_PORT p_Port, + charstring p_ToDisplay) return boolean + { + // To make the operator check the response displayed by the SS + var UT_COMMON_CNF v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(CHECK_RESPONSE_DISPLAY, + CNF_REQUIRED, + cs_ChkCallDisplayed(p_ToDisplay))); + + return v_Cnf.Result; + } + + //---------------------------------------------------------------------------- + /* + * @desc To send MMI command to check the UE returns appropriate CNAP response + * @param p_Port + * @param p_ToDisplay + * @status APPROVED (SSNITZ) + */ + function f_UT_TriggerCNAPResponse(UT_PTC_MTC_PORT p_Port, charstring p_ToDisplay) + { + fl_UT_ApplyCommand(p_Port, + cas_UT_Req(CNAP_DUMMY, + CNF_REQUIRED, + cs_ChkCallDisplayed(p_ToDisplay)), + true); // don't wait for CNF at this point @sic R5-153746 sic@ + } + + //---------------------------------------------------------------------------- + /* + * @desc To check the UE returns appropriate CNAP response + * @param p_Port + * @param p_SS_Status + * @return boolean + */ + function f_UT_ChkCNAPQueryResponse(UT_PTC_MTC_PORT p_Port, + octetstring p_SS_Status) return boolean + { + var charstring v_Result := ""; + var UT_COMMON_CNF v_Cnf := fl_UT_RetCnf(p_Port); // @sic R5-153746 sic@ + v_Result := regexp (v_Cnf.ResultString, "*CNAP: *,(*)*", 0); + + return match (v_Result, bit2str(substr(oct2bit(p_SS_Status), 4, 1))); + } + + //---------------------------------------------------------------------------- + /* + * @desc To check the UE returns appropriate Call Forwarding response + * @param p_Port + * @param p_SS_Status + * @return boolean + * @status + */ + function f_UT_ChkCallForwardQueryResponse(UT_PTC_MTC_PORT p_Port, + boolean p_Active) return boolean + { + var charstring v_Result := ""; + var UT_COMMON_CNF v_Cnf := fl_UT_RetCnf(p_Port); // @sic R5-153746 sic@ + v_Result := regexp (v_Cnf.ResultString, "*CCFCU: (*),*", 0); + + return match (v_Result, int2str(bit2int(f_ConvertBoolToBit(p_Active)))); + } + //---------------------------------------------------------------------------- + /* + * @desc To check the UE provides the correct user indication + * @param p_Port + * @param p_SuppService + * @param p_ToDisplay (default value: "") + * @return boolean + * @status APPROVED (SSNITZ) + */ + function f_UT_ChkSuppServiceUserIndication(UT_PTC_MTC_PORT p_Port, + charstring p_SuppService, + charstring p_ToDisplay := "") return boolean + { + // To make the operator check the response displayed by the SS + var UT_COMMON_CNF v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(CHECK_SS_USER_IND, + CNF_REQUIRED, + cs_Chk_SSUserInd(p_SuppService, p_ToDisplay))); + + return v_Cnf.Result; + } + + //---------------------------------------------------------------------------- + /* + * @desc To request the current time - returned in the format "yy/MM/dd,hh:mm:ss?zz", + * where characters indicate year (two last digits), month, day, hour, minutes, seconds and time zone + * @param p_Port + * @return charstring + * @status APPROVED (LTE) + */ + function f_UT_ChkTimeZone(UT_PTC_MTC_PORT p_Port) return charstring + { + var UT_COMMON_CNF v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(CHECK_CLOCK, CNF_REQUIRED)); + return v_Cnf.ResultString; // @sic R5-140347 sic@ + } + + //---------------------------------------------------------------------------- + + type enumerated UT_OPERATOR_FORMAT { LONG_NAME, SHORT_NAME, NUMERIC_ONLY}; /* @status APPROVED (LTE, SSNITZ) */ + + /* + * @desc To request the name of the operator currently camped on + * @param p_Port + * @param p_Format - Use the enumerated type defined just above to select the UE to return the operator name in long short or numeric only format + * @return charstring + * @status APPROVED (LTE, SSNITZ) + */ + function f_UT_ChkOperatorName(UT_PTC_MTC_PORT p_Port, + UT_OPERATOR_FORMAT p_Format) return charstring + { + var UT_COMMON_CNF v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(CHECK_OPERATOR_NAME, + CNF_REQUIRED, + cs_OperatorFormat(int2str(enum2int(p_Format))))); // @sic R5s110439 sic@ + return v_Cnf.ResultString; // @sic R5-140347 sic@ + } + + //---------------------------------------------------------------------------- + /* + * @desc To request the operator to check that the UE displays the correct NITZ information: Universal Time + * @param p_Port + * @param p_NITZ_Year + * @param p_NITZ_Month + * @param p_NITZ_Day + * @param p_NITZ_Hour + * @param p_NITZ_Minutes + * @param p_NITZ_Seconds + * @param p_NITZ_TimeZone + */ + function f_UT_MMI_CheckNITZ_UniversalTime(UT_PTC_MTC_PORT p_Port, + charstring p_NITZ_Year, + charstring p_NITZ_Month, + charstring p_NITZ_Day, + charstring p_NITZ_Hour, + charstring p_NITZ_Minutes, + charstring p_NITZ_Seconds, + charstring p_NITZ_TimeZone) + { + var template (value) Ut_ParameterList_Type v_ParameterList; + v_ParameterList[0] := cs_Ut_Parameter_NITZ_Year(p_NITZ_Year); + v_ParameterList[1] := cs_Ut_Parameter_NITZ_Month(p_NITZ_Month); + v_ParameterList[2] := cs_Ut_Parameter_NITZ_Day(p_NITZ_Day); + v_ParameterList[3] := cs_Ut_Parameter_NITZ_Hour(p_NITZ_Hour); + v_ParameterList[4] := cs_Ut_Parameter_NITZ_Minutes(p_NITZ_Minutes); + v_ParameterList[5] := cs_Ut_Parameter_NITZ_Seconds(p_NITZ_Seconds); + v_ParameterList[6] := cs_Ut_Parameter_NITZ_TimeZone(p_NITZ_TimeZone); + fl_UT_ApplyCommand(p_Port, cas_UT_Req(CHECK_NITZ_UT, CNF_REQUIRED, v_ParameterList)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To request the operator to check that the UE displays the correct NITZ information: Local Time and Timezone + * @param p_Port + * @param p_NITZ_LocalTimeZone + */ + function f_UT_MMI_CheckNITZ_LocalTimeAndTimeZone(UT_PTC_MTC_PORT p_Port, + charstring p_NITZ_LocalTimeZone) + { + var template (value) Ut_ParameterList_Type v_ParameterList; + v_ParameterList[0] := cs_Ut_Parameter_NITZ_LocalTimeZone(p_NITZ_LocalTimeZone); + fl_UT_ApplyCommand(p_Port, cas_UT_Req(CHECK_NITZ_LTZ, CNF_REQUIRED, v_ParameterList)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To request the operator to check that the UE displays the correct NITZ information: Local Time and Timezone + * @param p_Port + * @param p_NITZ_DaylightSavingTime + * @status APPROVED (LTE) + */ + function f_UT_MMI_CheckNITZ_DaylightSavingTime(UT_PTC_MTC_PORT p_Port, + charstring p_NITZ_DaylightSavingTime) + { + var template (value) Ut_ParameterList_Type v_ParameterList; + v_ParameterList[0] := cs_Ut_Parameter_NITZ_DaylightSavingTime(p_NITZ_DaylightSavingTime); + fl_UT_ApplyCommand(p_Port, cas_UT_Req(CHECK_NITZ_DST, CNF_REQUIRED, v_ParameterList)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To request the operator to check that the UE displays the correct NITZ information: Full Network Name + * @param p_Port + * @param p_NITZ_FullNetworkName + */ + function f_UT_MMI_CheckNITZ_FullNetworkName(UT_PTC_MTC_PORT p_Port, + charstring p_NITZ_FullNetworkName) + { + var template (value) Ut_ParameterList_Type v_ParameterList; + v_ParameterList[0] := cs_Ut_Parameter_NITZ_FullNetworkName(p_NITZ_FullNetworkName); + fl_UT_ApplyCommand(p_Port, cas_UT_Req(CHECK_NITZ_FULL_NETWORK_NAME, CNF_REQUIRED, v_ParameterList)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To request the operator to check that the UE displays the correct NITZ information: Short Network Name + * @param p_Port + * @param p_NITZ_ShortNetworkName + */ + function f_UT_MMI_CheckNITZ_ShortNetworkName(UT_PTC_MTC_PORT p_Port, + charstring p_NITZ_ShortNetworkName) + { + var template (value) Ut_ParameterList_Type v_ParameterList; + v_ParameterList[0] := cs_Ut_Parameter_NITZ_ShortNetworkName(p_NITZ_ShortNetworkName); + fl_UT_ApplyCommand(p_Port, cas_UT_Req(CHECK_NITZ_SHORT_NETWORK_NAME, CNF_REQUIRED, v_ParameterList)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To answer a call + * @param p_Port + * @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT, SSNITZ) + */ + function f_UT_AnswerCall(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(ANSWER_CALL, NO_CNF_REQUIRED)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To hang up a call + * @param p_Port + * @status APPROVED (SSNITZ) + */ + function f_UT_HangupCall(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(RELEASE_CALL, NO_CNF_REQUIRED)); + } + + /* + * @desc To hang up an IMS call + * @param p_Port + * @param p_CallId (default value: 1) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) + */ + function f_UT_HangupIMSCall(UT_PTC_MTC_PORT p_Port, + integer p_CallId := 1) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(RELEASE_IMS_CALL, NO_CNF_REQUIRED, cs_CallIdNumber(int2str (p_CallId)))); + } + + function f_UT_IMS_AcceptText(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(ACCEPT_MTSI_TEXT, NO_CNF_REQUIRED)); + } + + function f_UT_IMS_ActivateMWI(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(ACTIVATE_MESSAGE_WAIT_INDICATION, CNF_REQUIRED)); + } + + /* + * @desc trigger UE to send refresh USIM parameters + * @param p_Port + * @status + */ + function f_UT_IMS_Refresh(UT_PTC_MTC_PORT p_Port, + charstring p_HomeDomainName, + charstring p_PrivateUserIdentity, + charstring p_PublicUserIdentity) + { + var template (value) Ut_ParameterList_Type v_ParameterList; + v_ParameterList[0] := cs_Ut_Parameter_HomeDomain(p_HomeDomainName); + v_ParameterList[1] := cs_Ut_Parameter_PrivateUserId(p_PrivateUserIdentity); + v_ParameterList[2] := cs_Ut_Parameter_PublicUserId(p_PublicUserIdentity); + fl_UT_ApplyCommand(p_Port, cas_UT_Req(REFRESH, CNF_REQUIRED, v_ParameterList)); + } + + /* + * @desc trigger UE to send short message + * @param p_Port + * @status APPROVED (IMS) + */ + function f_UT_IMS_TriggerSMS(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(TRIGGER_SMS, NO_CNF_REQUIRED)); + } + + function f_UT_IMS_Trigger2ndIMPU(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(TRIGGER_2ND_IMPU, NO_CNF_REQUIRED)); + } + + function f_UT_IMS_Trigger3rdIMPU(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(TRIGGER_3RD_IMPU, NO_CNF_REQUIRED)); + } + + /* + * @desc Remove a video call + * @param p_Port + * @param p_CDUIdentifier + */ + function f_UT_IMS_RemoveVideoMedia(UT_PTC_MTC_PORT p_Port, + charstring p_CDUIdentifier) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(IMS_MODIFY_CALL, NO_CNF_REQUIRED, {cs_Ut_Parameter_Common("CallId", p_CDUIdentifier), + cs_Ut_Parameter_Common ("Media", "m=audio")})); + } + + //---------------------------------------------------------------------------- + /* + * @desc To trigger the UE to send data uplink on the GERAN GPRS Sapi specified + * @param p_Port + * @param p_Data - the amount of uplink data to send + * @param p_Sapi = the GPRS SAPI to send the data on + * @status APPROVED (LTE_IRAT) + */ + function f_UT_GeranUplinkData(UT_PTC_MTC_PORT p_Port, + charstring p_Data, + charstring p_Sapi) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(GERAN_UPLINK_DATA, NO_CNF_REQUIRED, cs_UplinkData(p_Data, p_Sapi))); + } + + //---------------------------------------------------------------------------- + /* + * @desc To request the operator to configure UE to use SMS Only service for SIMTC + * @param p_Port + * @status + */ + function f_UT_MMI_ConfigureSMSOnly(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(CONFIGURE_SMS_ONLY, CNF_REQUIRED, omit)); + } + //---------------------------------------------------------------------------- + + type enumerated MOLR_Type {ASSISTED_GPS, ASSISTED_GANSS, ASSISTED_GPS_GANSS, POSITION_ESTIMATE} /* @status APPROVED (POS) */ + + /* + * @desc To request the operator to trigger MO-LR for position estimate or assistance data + * @param p_Port + * @param p_TypeOfMolr + * @status APPROVED (POS) + */ + function f_UT_InitMOLR(UT_PTC_MTC_PORT p_Port, + MOLR_Type p_TypeOfMolr) + { + var charstring v_Method; + + select (p_TypeOfMolr) { + case (ASSISTED_GPS) { + v_Method := "1"; + } + case (ASSISTED_GANSS) { + v_Method := "2"; + } + case (ASSISTED_GPS_GANSS) { + v_Method := "3"; + } + case (POSITION_ESTIMATE) { + v_Method := "4"; + } + } + fl_UT_ApplyCommand(p_Port, cas_UT_Req(TRIGGER_MOLR, NO_CNF_REQUIRED, cs_TriggerMolr(v_Method))); + } + + //---------------------------------------------------------------------------- + /* @desc To either allow or deny the previously received Location Request + * @param p_Port + * @param p_HandleId + * @param p_Allow + * @status APPROVED (POS) + */ + function f_UT_AT_AnswerLocationRequest(UT_PTC_MTC_PORT p_Port, + integer p_HandleId, + boolean p_Allow) + { + var charstring v_Permission; + + if (p_Allow) { + v_Permission := "0"; + } else { + v_Permission := "1"; + } + fl_UT_ApplyCommand(p_Port, cas_UT_Req(LOCATION_ANSWER, NO_CNF_REQUIRED, cs_LocationAnswer(v_Permission, int2str(p_HandleId)))); + } + + //---------------------------------------------------------------------------- + /* + * @desc To subscribe to AT response location request notifications. + * To be called at the beginning of appropriate positioning test case bodies + * @param p_Port + * @param p_Enable (default value: true) + * @status APPROVED (POS) + */ + function f_UT_AT_SubscribeLocationRequestNotifications(UT_PTC_MTC_PORT p_Port, + boolean p_Enable := true) + { + var template (value) Ut_ParameterList_Type v_Enable := cs_IntegerString ("3"); // enable everything + + if (not p_Enable) { + v_Enable := cs_IntegerString ("0"); + } + fl_UT_ApplyCommand(p_Port, cas_UT_Req(LOCATION_SUBSCRIBE, CNF_REQUIRED, v_Enable)); // @sic R5s150213 sic@ + } + + //---------------------------------------------------------------------------- + + type enumerated LOCATION_REQUEST_Type { LOCATION_NOTIFICATION, LOCATION_REQ_ALLOWED, LOCATION_REQ_FORBIDDEN }; /* @status APPROVED (POS) */ + + function fl_LocationEnum2Str (LOCATION_REQUEST_Type p_LR_Type) return charstring + { + var charstring v_String := ""; + select (p_LR_Type) + { + case (LOCATION_NOTIFICATION) { + v_String := "LOCATION_NOTIFICATION"; + } + case (LOCATION_REQ_ALLOWED) { + v_String := "LOCATION_REQ_ALLOWED"; + } + case (LOCATION_REQ_FORBIDDEN) { + v_String := "LOCATION_REQ_FORBIDDEN"; + } + } + return v_String; + } + + /* + * @desc To trigger the UE displays the correct notification + * @param p_Port + * @param p_LR_Type + * @status APPROVED (POS) + */ + function f_UT_AT_TriggerNotifyLocationRequest(UT_PTC_MTC_PORT p_Port, + LOCATION_REQUEST_Type p_LR_Type) + { + // Although no AT command is sent at this time, need to provide a dummy MMI prompt for when AT cmd not supported + fl_UT_ApplyCommand (p_Port, cas_UT_Req(CMTLR_DUMMY, CNF_REQUIRED, cs_LocationNotify (fl_LocationEnum2Str (p_LR_Type))), true); // @sic R5s140777, R5-151792, R5-153746 sic@ + } + + /* + * @desc To check the UE displays the correct notification + * @param p_Port + * @param p_LR_Type + * @return integer + * @status APPROVED (POS) + */ + function f_UT_AT_CheckNotifyLocationRequest(UT_PTC_MTC_PORT p_Port, + LOCATION_REQUEST_Type p_LR_Type) return integer + { + var UT_COMMON_CNF v_Cnf; + var integer v_HandleId := -1; // value of -1 means location request notification request received, but of wrong type, so test case should fail + var charstring v_NotificationType := ""; + var charstring v_HandleChar := ""; + + v_Cnf := fl_UT_RetCnf (p_Port); // @sic R5s140777, R5-151792, R5-153746 sic@ + v_HandleChar := regexp(v_Cnf.ResultString, "*CMTLR: (*),", 0); + v_NotificationType := regexp(v_Cnf.ResultString, "*CMTLR: [0-9]+,(*)", 0); + + if (enum2int(p_LR_Type) == str2int(v_NotificationType)) { + v_HandleId := str2int(v_HandleChar); + } + return v_HandleId; + } + + //---------------------------------------------------------------------------- + /* + * @desc To request the operator to provide location information to the UE + * @param p_Port + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) + */ + function f_UT_MMI_ProvideLocationInfoToUE(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(LOCATION_INFO, CNF_REQUIRED)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To enable AT time zone update + * @param p_Port + * @param p_Enable (default value: true) + * @status APPROVED (LTE) + */ + function f_UT_AT_TimeZoneUpdate(UT_PTC_MTC_PORT p_Port, + boolean p_Enable := true) + { + var template (value) Ut_ParameterList_Type v_Enable := cs_IntegerString(bit2str(f_ConvertBoolToBit(p_Enable))); + + fl_UT_ApplyCommand(p_Port, cas_UT_Req(TIMEZONE_UPDATE, CNF_REQUIRED, v_Enable)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To subscribe to AT response time zone reporting + * @param p_Port + * @param p_Enable (default value: true) + * @status APPROVED (LTE, SSNITZ) + */ + function f_UT_AT_SubscribeTimeZoneReporting(UT_PTC_MTC_PORT p_Port, + boolean p_Enable := true) + { + var template (value) Ut_ParameterList_Type v_Enable := cs_IntegerString("2"); // enable everything + + if (not p_Enable) { + v_Enable := cs_IntegerString("0"); + } + fl_UT_ApplyCommand(p_Port, cas_UT_Req(TIMEZONE_SUBSCRIBE, CNF_REQUIRED, v_Enable)); // @sic R5s150213 sic@ + } + + //---------------------------------------------------------------------------- + /* + * @desc To receive a timezone report + * @param p_Port + * @param p_NITZ_Year + * @param p_NITZ_Month + * @param p_NITZ_Day + * @param p_NITZ_Hour + * @param p_NITZ_Minutes + * @param p_NITZ_Seconds + * @param p_NITZ_TimeZone + * @param p_DaylightSavingTime + * @status APPROVED (LTE, SSNITZ) + */ + function f_UT_AT_TriggerTimezoneReport(UT_PTC_MTC_PORT p_Port, + charstring p_NITZ_Year, + charstring p_NITZ_Month, + charstring p_NITZ_Day, + charstring p_NITZ_Hour, + charstring p_NITZ_Minutes, + charstring p_NITZ_Seconds, + charstring p_NITZ_TimeZone, + charstring p_DaylightSavingTime) + + { + var template (value) Ut_ParameterList_Type v_ParameterList; + v_ParameterList[0] := cs_Ut_Parameter_NITZ_Year(p_NITZ_Year); + v_ParameterList[1] := cs_Ut_Parameter_NITZ_Month(p_NITZ_Month); + v_ParameterList[2] := cs_Ut_Parameter_NITZ_Day(p_NITZ_Day); + v_ParameterList[3] := cs_Ut_Parameter_NITZ_Hour(p_NITZ_Hour); + v_ParameterList[4] := cs_Ut_Parameter_NITZ_Minutes(p_NITZ_Minutes); + v_ParameterList[5] := cs_Ut_Parameter_NITZ_Seconds(p_NITZ_Seconds); + v_ParameterList[6] := cs_Ut_Parameter_NITZ_TimeZone(p_NITZ_TimeZone); + v_ParameterList[7] := cs_Ut_Parameter_NITZ_DaylightSavingTime (p_DaylightSavingTime); + // Although no AT command is sent at this time, need to provide a dummy MMI prompt for when AT cmd not supported + fl_UT_ApplyCommand(p_Port, cas_UT_Req(CTZE_DUMMY, CNF_REQUIRED, v_ParameterList), true); // @sic R5s140777, R5-153746 sic@ + } + + /* + * @desc To receive a timezone report + * @param p_Port + * @return charstring + * @status APPROVED (LTE, SSNITZ) + */ + function f_UT_AT_CheckTimezoneReport(UT_PTC_MTC_PORT p_Port) return charstring + { + var UT_COMMON_CNF v_Cnf; + + v_Cnf := fl_UT_RetCnf (p_Port); // @sic R5s140777, R5-153746 sic@ + return v_Cnf.ResultString; + } + + //---------------------------------------------------------------------------- + /* + * @desc To dummy trigger MMI for a message waiting indication + * @param p_Port + */ + function f_UT_AT_TriggerMessageWaitInd(UT_PTC_MTC_PORT p_Port) + { + // Although no AT command is sent at this time, need to provide a dummy MMI prompt for when AT cmd not supported + fl_UT_ApplyCommand (p_Port, cas_UT_Req(CMWN_DUMMY, CNF_REQUIRED), true); + } + + /* + * @desc To receive a message waiting indication + * @param p_Port + * @return charstring + */ + function f_UT_AT_CheckMessageWaitInd(UT_PTC_MTC_PORT p_Port) return charstring + { + var UT_COMMON_CNF v_Cnf; + + v_Cnf := fl_UT_RetCnf (p_Port); + return regexp (v_Cnf.ResultString, "*CMWN: (*)", 0); + } + + //---------------------------------------------------------------------------- + /* + * @desc To get the existing emergency numbers passed from the network + As this information is always available in the test case, this function is not currently used + * @param p_Port + * @return EmergencyNumList + * @status APPROVED (LTE) + */ +/* function f_UT_GetEmergencyNumbers(UT_PTC_MTC_PORT p_Port) return EmergencyNumList + { + var charstring v_Num; + var charstring v_Answer; + var EmergencyNumList v_ExistingNums; + var integer i := 0; + var UT_COMMON_CNF v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(GET_EMERGENCY_NUMS_1, CNF_REQUIRED)); + + v_ExistingNums[i] := 'F'H; // Just to set a default value + + v_Cnf := fl_UT_ApplyCommandRetCnf(p_Port, cas_UT_Req(GET_EMERGENCY_NUMS_2, CNF_REQUIRED)); + v_Answer := v_Cnf.ResultString; // @sic R5-140347 sic@ + + do { + v_Answer := regexp(v_Answer, "*[+]CEN2:(*)", 0); + if (v_Answer != "") { // Another number + v_Num := regexp(v_Answer, "*[+]CEN2: [0-9]+,""[0-9]+""(*)", 0); + v_ExistingNums[i] := str2hex(v_Num); + i := i + 1; + } + } while (v_Answer != ""); + + return v_ExistingNums; + } + */ + //---------------------------------------------------------------------------- + /* + * @desc To trigger an HRPD PDN Connection + * @param p_Port + * @status APPROVED (LTE_IRAT) + */ + function f_UT_Trigger_HRPD_PDN_Connection(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(HRPD_PDN_CONNECTION, NO_CNF_REQUIRED)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To trigger User Reselection + * @param p_Port + * @status APPROVED (LTE) + */ + function f_UT_TriggerUserReselection(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(TRIGGER_USER_RESELECTION, NO_CNF_REQUIRED)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To trigger non call related SS + * @param p_Port + * @status APPROVED (SSNITZ, UTRAN) + */ + function f_UT_RequestNonCallRelatedSS(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(REQUEST_NON_CALL_RELATED_SS, NO_CNF_REQUIRED)); + } + + //---------------------------------------------------------------------------- + /* + * @desc send coordination message to activate/deactivate supplementary service + * @param p_Port + * @param p_SupplementaryService + * @param p_Activate + * @param p_TargetURI (default value: omit) + * @status APPROVED (IMS) + */ + function f_UT_IMS_ActivateDeactivateSupplementaryService(UT_PTC_MTC_PORT p_Port, + SS_Type p_SupplementaryService, + boolean p_Activate, + template (omit) charstring p_TargetURI := omit) + { /* @sic R5s150244 change 2: p_PublicUserIdentity replace by template (omit) charstring p_TargetURI sic@ */ + var template (value) Ut_ParameterList_Type v_ParameterList; + var Ut_Common_Req_Type v_Command := SUPPLEMENTARY_SERVICE; + + v_ParameterList[0] := cs_Ut_Parameter_SupplementaryService(fl_Convert_SS_Type (p_SupplementaryService)); + if (p_Activate) { + v_ParameterList[1] := cs_Ut_Parameter_SS_Mode(tsc_UT_SS_ACTIVATE); + } else { + v_ParameterList[1] := cs_Ut_Parameter_SS_Mode(tsc_UT_SS_DEACTIVATE); + } + if (isvalue(p_TargetURI)) { + v_ParameterList[2] := cs_Ut_Parameter_Uri(valueof(p_TargetURI)); + } + fl_UT_ApplyCommand(p_Port, cas_UT_Req(v_Command, NO_CNF_REQUIRED, v_ParameterList)); + } + + type enumerated SS_Type { SS_CLIP, SS_CLIR, SS_COLP, SS_TIR, SS_CNAP, SS_CALL_WAITING, SS_BAIC, SS_BAIC_ANONYMOUS, SS_BAIC_EXCEPT_SPECIFIC_USER, + SS_BIC_ROAM, SS_BAOC, SS_BOIC, SS_BOIC_EXHC, SS_ALL_BARRING_AB, SS_ALL_OUTGOING_BARRING_AG, SS_ALL_INCOMING_BARRING_AC, SS_BARRING_OUT_ROAM, // @sic R5-153995 sic@ + SS_CFU, SS_CFNRy, SS_CFB, SS_CFNL, SS_CFNRc, SS_CF_ALL, SS_CF_ALL_CONDITIONAL, SS_CD, SS_CDIVN, SS_USSD }; /* @status APPROVED (IMS, SSNITZ) */ + + type enumerated SS_Mode_Type {DEACTIVATE_MODE, ACTIVATE_MODE, QUERY_MODE, REGISTER_MODE, DELETE_MODE}; /* @status APPROVED (SSNITZ) */ + + type enumerated SS_SERVICE_TYPE {SS_ALLSERVICES, SS_SPEECH, SS_SYNC}; /* @status APPROVED (SSNITZ) + There are others, but as not yet added as all UTRAN SS should only be relevant for speech */ + /* + * @desc Converts the supplementary service service enum to a charstring + * @param p_Service + * @return charstring + * @status APPROVED (SSNITZ) + */ + function fl_Convert_SS_Service (SS_SERVICE_TYPE p_Service) return charstring + { + var charstring v_Service := "7"; + select (p_Service) { + case (SS_SPEECH) { + v_Service := "1"; + } + case (SS_SYNC) { + v_Service := "17"; + } + } + return v_Service; + } + + /* + * @desc Converts the supplementary service mode enum to a charstring + * @param p_Mode + * @return charstring + * @status APPROVED (SSNITZ) + */ + function fl_Convert_SS_Mode(SS_Mode_Type p_Mode) return charstring + { + var charstring v_Mode := ""; + select (p_Mode) { + case (DEACTIVATE_MODE) { + v_Mode := tsc_UT_SS_DEACTIVATE; + } case (ACTIVATE_MODE) { + v_Mode := tsc_UT_SS_ACTIVATE; + } case (REGISTER_MODE) { + v_Mode := tsc_UT_SS_REGISTER; + } case (QUERY_MODE) { + v_Mode := tsc_UT_SS_QUERY; + } case (DELETE_MODE) { + v_Mode := tsc_UT_SS_DELETE + } + } + return v_Mode; + } + + /* + * @desc Converts the supplementary service type enum to a charstring + * @param p_SS_Type + * @return charstring + * @status APPROVED (IMS, SSNITZ) + */ + function fl_Convert_SS_Type (SS_Type p_SS_Type) return charstring + { + var charstring v_Type := ""; + select (p_SS_Type) { + case (SS_CLIP) { + v_Type := tsc_UT_SS_CLIP; + } case (SS_CLIR) { + v_Type := tsc_UT_SS_CLIR; + } case (SS_COLP) { + v_Type := tsc_UT_SS_COLP; + } case (SS_TIR) { + v_Type := tsc_UT_SS_TERMINATING_IDENTIFICATION_RESTRICTION; + } case (SS_CNAP) { + v_Type := tsc_UT_SS_CNAP; + } case (SS_CALL_WAITING) { + v_Type := tsc_UT_SS_CALL_WAITING; + } case (SS_BAIC) { + v_Type := tsc_UT_SS_INCOMING_COMMUNICATION_BARRING; + } case (SS_BAIC_ANONYMOUS) { + v_Type := tsc_UT_SS_INCOMING_COMMUNICATION_BARRING_ANONYMOUS; + } case (SS_BAIC_EXCEPT_SPECIFIC_USER) { + v_Type := tsc_UT_SS_INCOMING_COMMUNICATION_BARRING_EXCEPT_SPECIFIC_USER; + } case (SS_BIC_ROAM) { + v_Type := tsc_UT_SS_INCOMING_COMMUNICATION_BARRING_ROAMING; + } case (SS_BAOC) { + v_Type := tsc_UT_SS_OUTGOING_COMMUNICATION_BARRING; + } case (SS_BOIC) { + v_Type := tsc_UT_SS_OUTGOING_INTERNATIONAL_BARRING; + } case (SS_BOIC_EXHC) { + v_Type := tsc_UT_SS_OUTGOING_INTERNATIONAL_EX_HC_BARRING; + } case (SS_ALL_BARRING_AB) { + v_Type := tsc_UT_SS_ALL_BARRING_SERVICES_AB; + } case (SS_ALL_OUTGOING_BARRING_AG) { + v_Type := tsc_UT_SS_ALL_OUTGOING_BARRING_SERVICES_AG; + } case (SS_ALL_INCOMING_BARRING_AC) { + v_Type := tsc_UT_SS_ALL_INCOMING_BARRING_SERVICES_AC; + } case (SS_BARRING_OUT_ROAM) { // @sic R5-153995 sic@ + v_Type := tsc_UT_SS_OUTGOING_COMMUNICATION_BARRING_WHILE_ROAMING; + } case (SS_CFU) { + v_Type := tsc_UT_SS_CALL_FORWARDING_UNCONDITIONAL; + } case (SS_CFNRy) { + v_Type := tsc_UT_SS_CALL_FORWARDING_NO_REPLY; + } case (SS_CFB) { + v_Type := tsc_UT_SS_CALL_FORWARDING_BUSY; + } case (SS_CFNL) { + v_Type := tsc_UT_SS_CALL_FORWARDING_NOT_LOGGED_IN; + } case (SS_CFNRc) { + v_Type := tsc_UT_SS_CALL_FORWARDING_NOT_REACHABLE; + } case (SS_CF_ALL) { + v_Type := tsc_UT_SS_CALL_FORWARDING_ALL; + } case (SS_CF_ALL_CONDITIONAL) { + v_Type := tsc_UT_SS_CALL_FORWARDING_ALL_CONDITIONAL; + } case (SS_CD) { + v_Type := tsc_UT_SS_CALL_FORWARDING_DEFLECTION; + } case (SS_CDIVN) { + v_Type := tsc_UT_SS_CALL_FORWARDING_DIVERSION_NOTIFICATION; + } case (SS_USSD) { + v_Type := tsc_UT_SS_USSD; + } + } + return v_Type; + } + + /* + * @desc send coordination message to activate/deactivate supplementary service CLIR + * @param p_Port + * @param p_Mode + * @status APPROVED (SSNITZ) + */ + function f_UT_SupplementaryService_CLIR(UT_PTC_MTC_PORT p_Port, + SS_Mode_Type p_Mode) + { + var template (value) Ut_ParameterList_Type v_ParameterList; + var Ut_Common_Req_Type v_Command := SUPPLEMENTARY_SERVICE; + + v_ParameterList[1] := cs_Ut_Parameter_SS_Mode(fl_Convert_SS_Mode(p_Mode)); + v_ParameterList[0] := cs_Ut_Parameter_SupplementaryService(tsc_UT_SS_CLIR); + fl_UT_ApplyCommand(p_Port, cas_UT_Req(v_Command, NO_CNF_REQUIRED, v_ParameterList)); + } + + /* + * @desc send coordination message to activate/deactivate supplementary service CNAP + * @param p_Port + * @param p_Mode + * @status APPROVED (SSNITZ) + */ + function f_UT_SupplementaryService_CNAP(UT_PTC_MTC_PORT p_Port, + SS_Mode_Type p_Mode) + { + var template (value) Ut_ParameterList_Type v_ParameterList; + var Ut_Common_Req_Type v_Command := SUPPLEMENTARY_SERVICE; + var Ut_CnfReq_Type v_Cnf := NO_CNF_REQUIRED; + + v_ParameterList[1] := cs_Ut_Parameter_SS_Mode(fl_Convert_SS_Mode(p_Mode)); + v_ParameterList[0] := cs_Ut_Parameter_SupplementaryService(tsc_UT_SS_CNAP); + if (p_Mode != QUERY_MODE) { // @sic R5s150084 sic@ + v_Cnf := CNF_REQUIRED; // @sic R5s150213 sic@ + } + + fl_UT_ApplyCommand(p_Port, cas_UT_Req(v_Command, v_Cnf, v_ParameterList)); + } + + /* + * @desc To check the UE displays the name provided + * @param p_Port + * @param p_ToDisplay + * @return boolean + * @status APPROVED (SSNITZ) + */ + function f_UT_ChkNameDisplayed(UT_PTC_MTC_PORT p_Port, + charstring p_ToDisplay) return boolean + { // To make the operator check the number/name of the call is displayed + // @sic R5s140990 sic@ + var charstring v_Result := ""; + var UT_COMMON_CNF v_Cnf := fl_UT_RetCnf(p_Port); // @sic R5-153746 sic@ + v_Result := regexp (v_Cnf.ResultString, "*CNAP: (*),*", 0); + + return match (v_Result, p_ToDisplay); + } + + //---------------------------------------------------------------------------- + /* + * @desc To send MMI command to check the UE returns appropriate Call Forwarding response + * @param p_Port + */ + function f_UT_TriggerCallForwardResponse(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(CCFCU_DUMMY, + CNF_REQUIRED, + omit), + true); // don't wait for CNF at this point @sic R5-153746 sic@ + } + + //---------------------------------------------------------------------------- + /* + * @desc To check the UE returns appropriate Call Forwarding response + * @param p_Port + */ + function f_UT_CheckCallForwardResponse(UT_PTC_MTC_PORT p_Port) return boolean + { + var UT_COMMON_CNF v_Cnf := fl_UT_RetCnf(p_Port); // @sic R5-153746 sic@ + return v_Cnf.Result; + } + + /* + * @desc send coordination message to activate/deactivate supplementary service CF + * @param p_Port + * @param p_Mode + * @param p_CallForwardType + * @param p_Number + * @param p_Time (default value: omit; used for CFNRy) + * @param p_Service (default value: omit) + * @status APPROVED (SSNITZ) + */ + function f_UT_SupplementaryService_CallForward(UT_PTC_MTC_PORT p_Port, + SS_Mode_Type p_Mode, + SS_Type p_CallForwardType, + charstring p_Number, + template (omit) charstring p_Time := omit, + template (omit) SS_SERVICE_TYPE p_Service := omit) + { + var template (value) Ut_ParameterList_Type v_ParameterList; + var Ut_Common_Req_Type v_Command := SUPPLEMENTARY_SERVICE; + var Ut_CnfReq_Type v_Cnf := NO_CNF_REQUIRED; + var integer i:= 3; + + v_ParameterList[0] := cs_Ut_Parameter_SupplementaryService(fl_Convert_SS_Type(p_CallForwardType)); + v_ParameterList[1] := cs_Ut_Parameter_SS_Mode(fl_Convert_SS_Mode(p_Mode)); + v_ParameterList[2] := cs_Ut_Parameter_Number(p_Number); + if (isvalue(p_Service)) { + v_ParameterList[i] := cs_Ut_Parameter_Common("Service", fl_Convert_SS_Service (valueof(p_Service))); + i := i+1; + } + if (isvalue(p_Time)) { + v_ParameterList[i] := cs_Ut_Parameter_SupplementaryServiceTime(valueof(p_Time)); + } + if (p_Mode != QUERY_MODE) { // @sic R5s150084 sic@ + v_Cnf := CNF_REQUIRED; // @sic R5s150213 sic@ + } + fl_UT_ApplyCommand(p_Port, cas_UT_Req(v_Command, v_Cnf, v_ParameterList)); + } + + /* + * @desc + * @param p_Port + * @param p_Mode + * @param p_Service (default value: SS_ALLSERVICES) + * @status APPROVED (SSNITZ) + */ + function f_UT_SupplementaryService_CallWaiting(UT_PTC_MTC_PORT p_Port, + SS_Mode_Type p_Mode, + SS_SERVICE_TYPE p_Service := SS_ALLSERVICES) + { + var template (value) Ut_ParameterList_Type v_ParameterList; + var Ut_Common_Req_Type v_Command := SUPPLEMENTARY_SERVICE; + + v_ParameterList[2] := cs_Ut_Parameter_Common("Service", fl_Convert_SS_Service(p_Service)); + v_ParameterList[1] := cs_Ut_Parameter_SS_Mode(fl_Convert_SS_Mode(p_Mode)); + v_ParameterList[0] := cs_Ut_Parameter_SupplementaryService(tsc_UT_SS_CALL_WAITING); + fl_UT_ApplyCommand(p_Port, cas_UT_Req(v_Command, NO_CNF_REQUIRED, v_ParameterList)); + } + + /* + * @desc To trigger Call Barring SS + * @param p_Port + * @param p_Mode + * @param p_CallBarringType + * @param p_NewPassword (default value: omit) + * @param p_Service (default value: omit) + * @status APPROVED (SSNITZ) + */ + function f_UT_SupplementaryService_CallBarring(UT_PTC_MTC_PORT p_Port, + SS_Mode_Type p_Mode, + SS_Type p_CallBarringType, + template (omit) charstring p_NewPassword := omit, + template (omit) SS_SERVICE_TYPE p_Service := omit) + { + var template (value) Ut_ParameterList_Type v_ParameterList; + var Ut_Common_Req_Type v_Command := SUPPLEMENTARY_SERVICE; + var integer i := 2; + + v_ParameterList[0] := cs_Ut_Parameter_SupplementaryService(fl_Convert_SS_Type(p_CallBarringType)); + v_ParameterList[1] := cs_Ut_Parameter_SS_Mode(fl_Convert_SS_Mode(p_Mode)); + if (isvalue(p_NewPassword)) { + v_ParameterList[i] := cs_Ut_Parameter_Password(valueof(p_NewPassword)); + i := i+1; + } + if (isvalue(p_Service)) { + v_ParameterList[i] := cs_Ut_Parameter_Common ( "Service", fl_Convert_SS_Service (valueof(p_Service))); + } + fl_UT_ApplyCommand(p_Port, cas_UT_Req(v_Command, NO_CNF_REQUIRED, v_ParameterList)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To trigger SS to change password + * @param p_Port + * @param p_CallBarringType + * @param p_OldPassword + * @param p_NewPassword + * @status APPROVED (SSNITZ) + */ + function f_UT_SS_ChangePassword(UT_PTC_MTC_PORT p_Port, + SS_Type p_CallBarringType, + charstring p_OldPassword, + charstring p_NewPassword) + { + var Ut_Common_Req_Type v_Command := SUPPLEMENTARY_SERVICE; + var template (value) Ut_ParameterList_Type v_ParameterList; + + v_ParameterList[0] := cs_Ut_Parameter_SupplementaryService(tsc_UT_SS_PASSWORD); + v_ParameterList[1] := cs_Ut_Parameter_SupplementaryService(fl_Convert_SS_Type(p_CallBarringType)); + v_ParameterList[2] := cs_Ut_Parameter_Password(p_OldPassword); + v_ParameterList[3] := cs_Ut_Parameter_Password(p_NewPassword); + + fl_UT_ApplyCommand(p_Port, cas_UT_Req(v_Command, NO_CNF_REQUIRED, v_ParameterList)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To send SS USSD + * @param p_Port + * @param p_USSDString (default value: "Network Triggered") + * @param p_CnfRequired (default: CNF_REQUIRED) Only set to NO_CNF_REQUIRED in 15.9.5 when UE to answer SS message + * @status APPROVED (SSNITZ) + */ + function f_UT_SupplementaryService_SendUSSD(UT_PTC_MTC_PORT p_Port, + charstring p_USSDString := "Network Triggered", + Ut_CnfReq_Type p_CnfRequired := CNF_REQUIRED) + { + var Ut_Common_Req_Type v_Command := SUPPLEMENTARY_SERVICE; + var template (value) Ut_ParameterList_Type v_ParameterList; + var boolean v_DontWaitForCnf := false; + + v_ParameterList[0] := cs_Ut_Parameter_SupplementaryService(tsc_UT_SS_USSD); + v_ParameterList[1] := cs_Ut_Parameter_SS_Mode(tsc_UT_SS_ACTIVATE); + v_ParameterList[2] := cs_Ut_Parameter_USSD(""""& p_USSDString &""""); // @sic R5s150603 sic@ + + if (p_USSDString == "Network Triggered") { + v_DontWaitForCnf := true; + } + + fl_UT_ApplyCommand(p_Port, cas_UT_Req(v_Command, p_CnfRequired, v_ParameterList), v_DontWaitForCnf); + } + + /* + * @desc To send SS USSD + * @param p_Port + * @status + */ + function f_UT_SupplementaryService_USSDResponse(UT_PTC_MTC_PORT p_Port) return charstring + { + var UT_COMMON_CNF v_Cnf := fl_UT_RetCnf(p_Port); + return v_Cnf.ResultString; + } + //---------------------------------------------------------------------------- + /* + * @desc SS to trigger release of held call (actually uses AT command call hold = 0) + * @param p_Port + * @status APPROVED (SSNITZ) + */ + function f_UT_CallHoldRelease(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(CALL_HOLD_RELEASE, NO_CNF_REQUIRED, omit)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To trigger SS call hold + * @param p_Port + * @param p_CallToHold (default value: omit) + * @status APPROVED (IMS, SSNITZ) + */ + function f_UT_CallHold(UT_PTC_MTC_PORT p_Port, + template (omit) integer p_CallToHold := omit) + { + var template (omit) Ut_ParameterList_Type v_Params := omit; + if (isvalue(p_CallToHold)) { + v_Params := cs_CallIdNumber(int2str(valueof(p_CallToHold))); + } + fl_UT_ApplyCommand(p_Port, cas_UT_Req(CALL_HOLD, NO_CNF_REQUIRED, v_Params)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To trigger SS call resume (actually uses AT command call hold) + * @param p_Port + * @param p_CallToHold (default value: omit) + * @status APPROVED (IMS, SSNITZ) + */ + function f_UT_CallResume(UT_PTC_MTC_PORT p_Port, + template (omit) integer p_CallToHold := omit) + { + var template (omit) Ut_ParameterList_Type v_Params := omit; + if (isvalue(p_CallToHold)) { + v_Params := cs_CallIdNumber(int2str(valueof(p_CallToHold))); + } + fl_UT_ApplyCommand(p_Port, cas_UT_Req(CALL_RESUME, NO_CNF_REQUIRED, v_Params)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To trigger SS Multiparty call (actually uses AT command call hold) + * @param p_Port + * @status APPROVED (IMS, SSNITZ) + */ + function f_UT_CallMPTY(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(CALL_MPTY, NO_CNF_REQUIRED, omit)); + } + + //---------------------------------------------------------------------------- + /* + * @desc To trigger SS Explicit Call Transfer (actually uses AT command call hold) + * @param p_Port + * @status APPROVED (SSNITZ) + */ + function f_UT_ExplicitCallTransfer(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(CALL_ECT, NO_CNF_REQUIRED, omit)); + } + //---------------------------------------------------------------------------- + + /* + * @desc De-register UE + * @param p_Port + * @status APPROVED (IMS) + */ + function f_UT_IMS_Deregister(UT_PTC_MTC_PORT p_Port) + { + fl_UT_ApplyCommand(p_Port, cas_UT_Req(DEREGISTER, NO_CNF_REQUIRED)); // @sic R5-134290 sic@ + } + //---------------------------------------------------------------------------- + /* + * @desc Invite UE to Conference Call, used in IMS conference test + * @param p_Port + * @param p_ReferToUri + * @status APPROVED (IMS) + */ + function f_UT_InviteToConference(UT_PTC_MTC_PORT p_Port, + charstring p_ReferToUri) + { + var template (value) Ut_ParameterList_Type v_ParameterList; + v_ParameterList[0] := cs_Ut_Parameter_Uri(p_ReferToUri); + fl_UT_ApplyCommand(p_Port, cas_UT_Req(INVITE_TO_CONFERENCE, NO_CNF_REQUIRED, v_ParameterList)); + } + +} diff --git a/IMS_PART4_IWD_15wk38/Common/Common/UpperTesterPtcToMtcDefs.ttcn b/IMS_PART4_IWD_15wk38/Common/Common/UpperTesterPtcToMtcDefs.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fe9e143a0baafb7cc07c5a98925a163e0fe011a9 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/Common/UpperTesterPtcToMtcDefs.ttcn @@ -0,0 +1,245 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-15 19:05:27 +0200 (Tue, 15 Sep 2015) $ +// $Rev: 14431 $ +/******************************************************************************/ +// Common type definitions, e.g. being used in ASP definitions as well as for NAS +//------------------------------------------------------------------------------ +//* History: +//* @sic R5-096657 sic@ Added SMS command DELETE_MESSAGE_WITHFLAG +//------------------------------------------------------------------------------ + +module UpperTesterPtcToMtcDefs { + import from UpperTesterCommon all; + + //---------------------------------------------------------------------------- + group TypeDefs_PTC_UT { // types being used at the PTC <-> UpperTester interface + + type enumerated Ut_Common_Req_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + ACCEPT_MTSI_TEXT, + ACTIVATE_BEARER, + ACTIVATE_MESSAGE_WAIT_INDICATION, + ANSWER_CALL, + ATTACH, + CALL_HOLD, + CALL_HOLD_RELEASE, + CALL_RESUME, + CALL_MPTY, + CALL_ECT, + CCFCU_DUMMY, + CHECK_CALL_DISPLAY, + CHECK_CSG, + CHECK_CLOCK, + CHECK_CMAS_ALERT, + CHECK_CMAS_INDICATION, + CHECK_CMAS_NO_ALERT, + CHECK_CMAS_NO_INDICATION, //@sic R5s130376 sic@ + CHECK_DTCH_THROUGHCONNECTED, + CHECK_ETWS_ALERT, + CHECK_ETWS_INDICATION, + CHECK_ETWS_NO_ALERT, + CHECK_ETWS_NO_INDICATION, //@sic R5s130376 sic@ + CHECK_LCS_CLIENT, + CHECK_MESSAGE_DISPLAYED, + CHECK_OPERATOR_NAME, + CHECK_PLMN, + CHECK_RESPONSE_DISPLAY, + CHECK_SS_USER_IND, + CHECK_NITZ_DST, + CHECK_NITZ_FULL_NETWORK_NAME, + CHECK_NITZ_LTZ, + CHECK_NITZ_SHORT_NETWORK_NAME, + CHECK_NITZ_UT, + CLEAR_STORED_ASSISTANCE_DATA, + CMTLR_DUMMY, + CMWN_DUMMY, + CNAP_DUMMY, + CONFIGURE_CEMODE, + CONFIGURE_OPERATIONMODE, + CONFIGURE_SMS_ONLY, + CTZE_DUMMY, + DEACTIVATE_BEARER, + DEFINE_EPS_QOS, + DEFINE_QOS, + DEFINE_TFT, + DELETE_MESSAGE_WITHFLAG, + DEREGISTER, + DETACH, + DETACH_NON_EPS, + DISABLE_EPS, + GERAN_UPLINK_DATA, + GET_EMERGENCY_NUMS_1, + GET_EMERGENCY_NUMS_2, + HRPD_PDN_CONNECTION, + IMS_CONFIGURE_VIDEO_CALL, + IMS_MODIFY_CALL, + INITIATE_VIDEO_CALL, + INVITE_TO_CONFERENCE, + INSERT_USIM, + LOCATION_ANSWER, + LOCATION_INFO, + LOCATION_SUBSCRIBE, + MBMS_PRIORITY_OVER_UNICAST, + MBMS_SERVICE_ACTIVE, + MBMS_SERVICE_INTEREST, + MESSAGE_FORMAT, + MODIFY_BEARER, + PLMN_AUTOMATIC, + PLMN_MANUAL, + POWER_OFF, + POWER_ON, + POWER_PREFERENCE, + REFRESH, + RELEASE_CALL, + RELEASE_IMS_CALL, + REMOVE_USIM, + REQUEST_CALL, + REQUEST_DED_BEARER, + REQUEST_IMS_EMERGENCY_CALL, + REQUEST_IMS_VOICE_CALL, + REQUEST_NON_CALL_RELATED_SS, + REQUEST_PDPCONTEXT, + SELECT_CHARACTER_SET, + SELECT_CSG, + SELECT_MESSAGE_SERVICE, + SEND_3_STORED_MESSAGES, + SEND_STORED_MESSAGE_ONE, + SERVICE_CENTRE_ADDRESS, + SET_PREFERRED_STORAGE, + SET_TEXTMODE_PARAMETERS, + SUPPLEMENTARY_SERVICE, + SWITCH_OFF, + SWITCH_ON, + TIMEZONE_SUBSCRIBE, + TIMEZONE_UPDATE, + TRIGGER_2ND_IMPU, + TRIGGER_3RD_IMPU, + TRIGGER_MOLR, + TRIGGER_SMS, + TRIGGER_USER_RESELECTION, + WRITE_MESSAGE_TOMEMORY_PDUMODE, // @sic R5s110750 sic@ + WRITE_MESSAGE_TOMEMORY_TEXTMODE // DO NOT ADD FIELDS TO THIS TYPE, TO BE EXTENDED BY FILE OWNER ONLY + }; + + const charstring tsc_UT_SS_CLIP := "ORIGINATING IDENTIFICATION PRESENTATION"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_CLIR := "ORIGINATING IDENTIFICATION RESTRICTION"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_COLP := "TERMINATING IDENTIFICATION PRESENTATION"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_TERMINATING_IDENTIFICATION_RESTRICTION := "TERMINATING IDENTIFICATION RESTRICTION"; /* @status APPROVED (IMS, SSNITZ) */ + const charstring tsc_UT_SS_CNAP := "CALLING NAME PRESENTATION"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_CALL_WAITING := "CALL WAITING"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_INCOMING_COMMUNICATION_BARRING := "INCOMING COMMUNICATION BARRING"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_INCOMING_COMMUNICATION_BARRING_ANONYMOUS := "INCOMING COMMUNICATION BARRING ANONYMOUS"; /* @status APPROVED (IMS, SSNITZ) */ + const charstring tsc_UT_SS_INCOMING_COMMUNICATION_BARRING_ROAMING := "INCOMING COMMUNICATION BARRING WHILE ROAMING"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_OUTGOING_COMMUNICATION_BARRING_WHILE_ROAMING := "OUTGOING COMMUNICATION BARRING WHILE ROAMING"; /* @status APPROVED (IMS, SSNITZ) @sic R5-153995 sic@*/ + const charstring tsc_UT_SS_OUTGOING_COMMUNICATION_BARRING := "OUTGOING COMMUNICATION BARRING"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_OUTGOING_INTERNATIONAL_BARRING := "OUTGOING INTERNATIONAL BARRING"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_OUTGOING_INTERNATIONAL_EX_HC_BARRING := "OUTGOING INTERNATIONAL EXCEPT HOME COUNTRY BARRING"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_ALL_BARRING_SERVICES_AB := "ALL BARRING SERVICES"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_ALL_OUTGOING_BARRING_SERVICES_AG := "ALL OUTGOING BARRING SERVICES"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_ALL_INCOMING_BARRING_SERVICES_AC := "ALL INCOMING BARRING SERVICES"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_CALL_FORWARDING_UNCONDITIONAL := "CALL FORWARDING UNCONDITIONAL"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_CALL_FORWARDING_NO_REPLY := "CALL FORWARDING NO ANSWER"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_CALL_FORWARDING_BUSY := "CALL FORWARDING BUSY"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_CALL_FORWARDING_NOT_LOGGED_IN := "CALL FORWARDING NOT REGISTERED"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_CALL_FORWARDING_NOT_REACHABLE := "CALL FORWARDING NOT REACHABLE"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_CALL_FORWARDING_ALL := "ALL CALL FORWARDING"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_CALL_FORWARDING_ALL_CONDITIONAL := "ALL CONDITIONAL CALL FORWARDING"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_CALL_FORWARDING_DEFLECTION := "COMMUNICATION DEFLECTION"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_CALL_FORWARDING_DIVERSION_NOTIFICATION := "COMMUNICATION DIVERSION NOTIFICATION"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_INCOMING_COMMUNICATION_BARRING_EXCEPT_SPECIFIC_USER := "INCOMING COMMUNICATION BARRING EXCEPT SPECIFIC USER"; /* @status APPROVED (IMS, SSNITZ) */ + const charstring tsc_UT_SS_ALL_CALL_TYPES := "ALL CALL TYPES"; + const charstring tsc_UT_SS_CALL_TYPE_VOICE := "CALL TYPE VOICE"; + const charstring tsc_UT_SS_USSD := "USSD"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_PASSWORD := "CHANGE PASSWORD"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_DEACTIVATE := "DEACTIVATE"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_ACTIVATE := "ACTIVATE"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_REGISTER := "REGISTER"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_QUERY := "QUERY"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const charstring tsc_UT_SS_DELETE := "DELETE"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + + type record UT_COMMON_CMD { /* Common ASP to be sent by a PTC to the upper tester (MTC); + @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + Ut_Common_Req_Type Cmd, + Ut_CnfReq_Type CnfReq, + Ut_ParameterList_Type ParameterList optional // to be used to include any additional information required + }; + + } // end of group TypeDefs_PTC_UT + + //---------------------------------------------------------------------------- + // Ports: + + type port UT_PTC_MTC_PORT message { /* port at a PTC to communicated with the upper tester (MTC) + @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + out UT_COMMON_CMD; + in UT_COMMON_CNF; + }; + + type port UT_MTC_PTC_PORT message { /* port at the upper tester (MTC) to communicated with a PTC + @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + out UT_COMMON_CNF; + in UT_COMMON_CMD; + }; + + // ----------------------------------------------------------------------------- + //Templates: + + const integer tsc_NumberingPlan_Int := 145; /* @status APPROVED (SSNITZ) + integer representation of type of number and numbering plan octet in 24.008 10.5.4.7. @sic R5s150538 sic@ */ + + template (value) Ut_ParameterList_Type cs_EPSBearerParams ( charstring p_Id, + charstring p_Type, + charstring p_AccessPointName, + charstring p_DComp, + charstring p_HComp, + charstring p_PDL, + charstring p_PDN, + charstring p_IPv4Alloc ) := + { + {// Minimum value 1 + Name := "EPS ID", + Value := p_Id + }, + { // values: X.25, IP, IPV6, IPV4V6, PPP + Name := "PDP TYPE", + Value := p_Type + }, + { + Name := "APN", + Value := p_AccessPointName + }, + { + Name := "D COMP", + Value := p_DComp + }, + { + Name := "H COMP", + Value := p_HComp + }, + { + Name := "PD L", + Value := p_PDL + }, + { + Name := "PD N", + Value := p_PDN + }, + { + Name := "IPv4ADDR", + Value := p_IPv4Alloc + } + }; + + template (present) UT_COMMON_CMD car_UT_ReqAny := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + Cmd := ?, + CnfReq := ?, + ParameterList := * + }; + +} diff --git a/IMS_PART4_IWD_15wk38/Common/CommonIP/CommonIP.ttcn b/IMS_PART4_IWD_15wk38/Common/CommonIP/CommonIP.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0bf4fa995b961195121c028e579e586f3d4f039f --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/CommonIP/CommonIP.ttcn @@ -0,0 +1,326 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-15 19:05:27 +0200 (Tue, 15 Sep 2015) $ +// $Rev: 14431 $ +/******************************************************************************/ + +module CommonIP { + + import from CommonDefs all; + import from Parameters all; + + const UInt8_Type tsc_IP_Protocol_ICMP := 1; /* @status APPROVED (LTE, LTE_IRAT) */ + const UInt8_Type tsc_IP_Protocol_UDP := 17; /* @status APPROVED (LTE, UTRAN) */ + const UInt8_Type tsc_ICMP_Type_EchoReply := 0; /* @status APPROVED (LTE, LTE_IRAT) */ + const UInt8_Type tsc_ICMPv6_Type_EchoReply := 129; /* @status APPROVED (LTE, LTE_IRAT) */ + const UInt8_Type tsc_ICMP_Type_EchoRequest := 8; + const UInt8_Type tsc_IP_Protocol_TCP := 6; /* @status APPROVED (LTE, UTRAN) */ + const UInt8_Type tsc_IP_Protocol_IPSec := 50; /* @status APPROVED (LTE, UTRAN) */ + const UInt8_Type tsc_IP_Protocol_ICMPv6 := 58; /* @status APPROVED (LTE, LTE_IRAT) */ + const integer tsc_IMS_PortNumber_5060 := 5060; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + + const octetstring tsc_IP_AnyData := '00112233445566778899AABBCCDDEEFF'O; /* @status APPROVED (LTE, LTE_IRAT, UTRAN) */ + + type record PDN_AddressInfo_Type /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + { + charstring UE_IPAddressIPv4, + charstring UE_IPAddressIPv6, + charstring Remote_IPAddressIPv4, /* @sic R5s130681 additional change sic@ */ + charstring Remote_IPAddressIPv6, /* @sic R5s130681 additional change sic@ */ + charstring DHCP_ServerAddress, + charstring ICMPv6_ServerAddress, + charstring PCSCF_IPAddressIPv4, + charstring PCSCF_IPAddressIPv6, + //charstring PCSCF_DomainName, + charstring DNS_ServerAddressIPv4, + charstring DNS_ServerAddressIPv6, + charstring XCAP_ServerAddressIPv4, /* @sic R5s141051 change 8 sic@ */ + charstring XCAP_ServerAddressIPv6 /* @sic R5s141051 change 8 sic@ */ + }; + + const PDN_AddressInfo_Type tsc_PDN1_AddressInfo := { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + UE_IPAddressIPv4 := px_IPv4_Address1_UE, + UE_IPAddressIPv6 := px_IPv6_Address1_UE, + Remote_IPAddressIPv4 := px_IPv4_Address1_RemoteUE, + Remote_IPAddressIPv6 := px_IPv6_Address1_RemoteUE, + DHCP_ServerAddress := px_IPv4_Address1_NW, + ICMPv6_ServerAddress := px_IPv6_Address1_NW, + PCSCF_IPAddressIPv4 := px_IPv4_Address1_NW, + PCSCF_IPAddressIPv6 := px_IPv6_Address1_NW, + DNS_ServerAddressIPv4 := px_IPv4_Address1_NW, + DNS_ServerAddressIPv6 := px_IPv6_Address1_NW, + XCAP_ServerAddressIPv4 := px_IPv4_Address1_NW, /* @sic R5s141051 change 8 sic@ */ + XCAP_ServerAddressIPv6 := px_IPv6_Address1_NW /* @sic R5s141051 change 8 sic@ */ + }; + const PDN_AddressInfo_Type tsc_PDN2_AddressInfo := { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + UE_IPAddressIPv4 := px_IPv4_Address2_UE, + UE_IPAddressIPv6 := px_IPv6_Address2_UE, + Remote_IPAddressIPv4 := px_IPv4_Address2_RemoteUE, + Remote_IPAddressIPv6 := px_IPv6_Address2_RemoteUE, + DHCP_ServerAddress := px_IPv4_Address2_NW, + ICMPv6_ServerAddress := px_IPv6_Address2_NW, + PCSCF_IPAddressIPv4 := px_IPv4_Address2_NW, + PCSCF_IPAddressIPv6 := px_IPv6_Address2_NW, + DNS_ServerAddressIPv4 := px_IPv4_Address2_NW, + DNS_ServerAddressIPv6 := px_IPv6_Address2_NW, + XCAP_ServerAddressIPv4 := px_IPv4_Address2_NW, /* @sic R5s141051 change 8 sic@ */ + XCAP_ServerAddressIPv6 := px_IPv6_Address2_NW /* @sic R5s141051 change 8 sic@ */ + }; + + const PDN_AddressInfo_Type tsc_PDN_AddressInfo[2] := { tsc_PDN1_AddressInfo, tsc_PDN2_AddressInfo}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + + + /* + * @desc return index of the IP address or IMS server corresponding to the given PdnIndex + * @param p_PdnIndex + * @return integer + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) + */ + function f_PDN_PdnIndex2Integer(PDN_Index_Type p_PdnIndex) return integer + { /* PDN_2a to support change of the IP address for IMS test case 19.5.1 */ + /* @sic R5s150031: fl_IP_ServerIndex -> f_PDN_PdnIndex2Integer sic@ */ + var integer v_Index; + select (p_PdnIndex) { + case (PDN_1) { + v_Index := 0; + } + case (PDN_2, PDN_2a, PDN_Internet) { + v_Index := 1; + } + case else { + FatalError(__FILE__, __LINE__, "Invalid PDN index"); + } + } + return v_Index; + } + + /* + * @desc return PDN_AddressInfo corresponding to the given PdnIndex + * @param p_PdnIndex + * @return PDN_AddressInfo_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) + */ + function f_PDN_AddressInfo_Get(PDN_Index_Type p_PdnIndex) return PDN_AddressInfo_Type + { /* PDN_2a to support change of the IP address for IMS test case 19.5.1 */ + var PDN_AddressInfo_Type v_PDN_AddressInfo; + var integer v_Index := f_PDN_PdnIndex2Integer(p_PdnIndex); + + v_PDN_AddressInfo := tsc_PDN_AddressInfo[v_Index]; + if (p_PdnIndex == PDN_2a) { + v_PDN_AddressInfo.UE_IPAddressIPv4 := px_IPv4_Address2a_UE; /* @sic implementation of IMS TC_19_5_1 sic@ */ + v_PDN_AddressInfo.UE_IPAddressIPv6 := px_IPv6_Address2a_UE; /* @sic implementation of IMS TC_19_5_1 sic@ */ + } + return v_PDN_AddressInfo; + } + + //---------------------------------------------------------------------------- + /* + * @desc Check whether given string is IPv4 address + * @param p_IpAddress + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) + */ + function f_IpAddressIsIPv4(charstring p_IpAddress) return boolean + { + var template charstring v_Pattern := pattern "[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+"; + return match(p_IpAddress, v_Pattern); + }; + + //---------------------------------------------------------------------------- + /* + * @desc Check whether given string is IPv6 address + * @param p_IpAddress + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IpAddressIsIPv6(charstring p_IpAddress) return boolean + { + var Char1List_Type v_SplitCharList := {":"}; + var CharStringList_Type v_FieldList := f_StringSplit(p_IpAddress, v_SplitCharList); + var integer v_FieldCnt := lengthof(v_FieldList); + var charstring v_Field; + var charstring v_Pattern; + var integer v_FieldLength; + var integer i; + + if ((v_FieldCnt == 1) or (v_FieldCnt > 8)) { return false; } + + for (i:=0; i 4) { return false; } + if (not match(v_Field, pattern v_Pattern)) { return false; } + } + return true; + } + + //---------------------------------------------------------------------------- + /* + * @desc convert IP address in dot notation into octetstring; + * e.g. "10.11.12.13" results in '0A0B0C0D'O + * @param p_IPv4AddrChar + * @return O4_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) + */ + function f_Convert_IPv4Addr2OctString(charstring p_IPv4AddrChar) return O4_Type + { + var Char1List_Type v_SplitCharList := {"."}; + var CharStringList_Type v_FieldList := f_StringSplit(p_IPv4AddrChar, v_SplitCharList); + var octetstring v_IPv4AddrOct := ''O; + var integer v_FieldCnt := lengthof(v_FieldList); + var integer v_IntVal; + var integer i; + + if (v_FieldCnt != 4) { + FatalError(__FILE__, __LINE__, "invalid IP Address"); + } + for (i:=0; i subsequent empty fields will just be replaced by '0000' */ + var charstring v_Field; + var integer v_NoOfEmptyBlocks; + var integer i; + var integer k; + + if (v_FieldCnt > 8) { + FatalError(__FILE__, __LINE__, "invalid IP Address"); + } + for (i:=0; i tsc_UInt16Max) { + v_Sum := (v_Sum mod (tsc_UInt16Max+1)) + (v_Sum / (tsc_UInt16Max+1)); + } + // get complement + v_Sum := tsc_UInt16Max - v_Sum; + return int2oct(v_Sum, 2); + } +} diff --git a/IMS_PART4_IWD_15wk38/Common/EUTRA_Defs/EPS_NAS_Constants.ttcn b/IMS_PART4_IWD_15wk38/Common/EUTRA_Defs/EPS_NAS_Constants.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a4b2788f988b68bc55ec8aa27d378b011b4d527a --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/EUTRA_Defs/EPS_NAS_Constants.ttcn @@ -0,0 +1,235 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-06-17 14:41:28 +0200 (Wed, 17 Jun 2015) $ +// $Rev: 13929 $ +/******************************************************************************/ + +module EPS_NAS_Constants { + + import from CommonDefs all; + import from NAS_CommonTypeDefs all; + import from EPS_NAS_TypeDefs all; + + const SecurityHeaderType tsc_SHT_NoSecurityProtection := '0000'B; + const SecurityHeaderType tsc_SHT_IntegrityProtected := '0001'B; + const SecurityHeaderType tsc_SHT_IntegrityProtected_Ciphered := '0010'B; + const SecurityHeaderType tsc_SHT_IntegrityProtected_NewSecurityContext := '0011'B; + const SecurityHeaderType tsc_SHT_IntegrityProtected_Ciphered_NewSecurityContext := '0100'B; + const SecurityHeaderType tsc_SHT_ServiceRequest := '1100'B; + + const ProtocolDiscriminator tsc_PD_EMM := '0111'B; // from CR C1-085163 for 24.007 + const ProtocolDiscriminator tsc_PD_ESM := '0010'B; // from CR C1-085163 for 24.007 + + // NAS message types acc. 24.301 cl.9.8 + const MessageType tsc_MT_AttachRequest := '01000001'B; + const MessageType tsc_MT_AttachAccept := '01000010'B; + const MessageType tsc_MT_AttachComplete := '01000011'B; + const MessageType tsc_MT_AttachReject := '01000100'B; + const MessageType tsc_MT_DetachRequest := '01000101'B; + const MessageType tsc_MT_DetachAccept := '01000110'B; + const MessageType tsc_MT_TauRequest := '01001000'B; + const MessageType tsc_MT_TauAccept := '01001001'B; + const MessageType tsc_MT_TauComplete := '01001010'B; + const MessageType tsc_MT_TauReject := '01001011'B; + const MessageType tsc_MT_ExtServiceRequest := '01001100'B; + const MessageType tsc_MT_ServiceReject := '01001110'B; + const MessageType tsc_MT_GutiReallocCommand := '01010000'B; + const MessageType tsc_MT_GutiReallocComplete := '01010001'B; + const MessageType tsc_MT_AuthenticationRequest := '01010010'B; + const MessageType tsc_MT_AuthenticationResponse := '01010011'B; + const MessageType tsc_MT_AuthenticationReject := '01010100'B; + const MessageType tsc_MT_AuthenticationFailure := '01011100'B; + const MessageType tsc_MT_IdentityRequest := '01010101'B; + const MessageType tsc_MT_IdentityResponse := '01010110'B; + const MessageType tsc_MT_SecurityModeCommand := '01011101'B; + const MessageType tsc_MT_SecurityModeComplete := '01011110'B; + const MessageType tsc_MT_SecurityModeReject := '01011111'B; + const MessageType tsc_MT_EmmStatus := '01100000'B; + const MessageType tsc_MT_EmmInfo := '01100001'B; + const MessageType tsc_MT_DL_NASTransport := '01100010'B; + const MessageType tsc_MT_UL_NASTransport := '01100011'B; + const MessageType tsc_MT_CSServiceNotification := '01100100'B; + const MessageType tsc_MT_DL_GenericNASTransport := '01101000'B; + const MessageType tsc_MT_UL_GenericNASTransport := '01101001'B; + + const MessageType tsc_MT_ActivateDefaultEpsBearerContextRequest := '11000001'B; + const MessageType tsc_MT_ActivateDefaultEpsBearerContextAccept := '11000010'B; + const MessageType tsc_MT_ActivateDefaultEpsBearerContextReject := '11000011'B; + const MessageType tsc_MT_ActivateDedicatedEpsBearerContextRequest := '11000101'B; + const MessageType tsc_MT_ActivateDedicatedEpsBearerContextAccept := '11000110'B; + const MessageType tsc_MT_ActivateDedicatedEpsBearerContextReject := '11000111'B; + const MessageType tsc_MT_ModifyEpsBearerContextRequest := '11001001'B; + const MessageType tsc_MT_ModifyEpsBearerContextAccept := '11001010'B; + const MessageType tsc_MT_ModifyEpsBearerContextReject := '11001011'B; + const MessageType tsc_MT_DeactivateEpsBearerContextRequest := '11001101'B; + const MessageType tsc_MT_DeactivateEpsBearerContextAccept := '11001110'B; + const MessageType tsc_MT_PdnConnectivityRequest := '11010000'B; + const MessageType tsc_MT_PdnConnectivityReject := '11010001'B; + const MessageType tsc_MT_PdnDisconnectRequest := '11010010'B; + const MessageType tsc_MT_PdnDisconnectReject := '11010011'B; + const MessageType tsc_MT_BearerResourceAllocationRequest := '11010100'B; + const MessageType tsc_MT_BearerResourceAllocationReject := '11010101'B; + const MessageType tsc_MT_BearerResourceModificationRequest := '11010110'B; + const MessageType tsc_MT_BearerResourceModificationReject := '11010111'B; + const MessageType tsc_MT_EsmInformationRequest := '11011001'B; + const MessageType tsc_MT_EsmInformationResponse := '11011010'B; + const MessageType tsc_MT_EsmStatus := '11101000'B; + const MessageType tsc_MT_EsmNotification := '11011011'B; + + + const B8_Type tsc_SRVCC_HO_Canceled := '00000001'B; + + const IEI8_Type tsc_IEI_Guti := '50'O; // The same IEI value is used throughout 24.301 + + const ProcedureTransactionIdentifier tsc_PTI_1 := '01'O; + + const HalfOctet_Type tsc_EpsDefaultBearerId := '5'H; // EPS bearer identity (24.301 cl. 9.3.2); + const HalfOctet_Type tsc_EpsDefaultBearerId2ndPDN := 'C'H; + const HalfOctet_Type tsc_EpsDedicatedBearerId := '6'H; + const HalfOctet_Type tsc_EpsDedicatedBearerId2 := '7'H; + const HalfOctet_Type tsc_EpsDedicatedBearerId3 := '8'H; + const HalfOctet_Type tsc_EpsDedicatedBearerId4 := '9'H; + const HalfOctet_Type tsc_EpsDedicatedBearerId5 := 'A'H; + const HalfOctet_Type tsc_EpsDedicatedBearerId6 := 'B'H; + const HalfOctet_Type tsc_EpsDedicatedBearerId7 := 'C'H; + const HalfOctet_Type tsc_EpsDedicatedBearerId8 := 'D'H; + const HalfOctet_Type tsc_EpsDedicatedBearerId9 := 'E'H; + const HalfOctet_Type tsc_EpsDedicatedBearerId10 := 'F'H; + + const NAS_AttDetValue_Type tsc_EAttachType_EpsOnly := '001'B; + const NAS_AttDetValue_Type tsc_EAttachType_Combined := '010'B; + const NAS_AttDetValue_Type tsc_EAttachType_Emergency := '110'B; + + const EPS_UpdateTypeValue tsc_EpsUpdate_TaUpdate := '000'B; // TA updating + const EPS_UpdateTypeValue tsc_EpsUpdate_Combined_TaLaUpdate := '001'B; // Combined TA/LA updating + const EPS_UpdateTypeValue tsc_EpsUpdate_Combined_IMSIAttach := '010'B; // combined TA/LA updating with IMSI attach + const EPS_UpdateTypeValue tsc_EpsUpdate_Periodic := '011'B; // Periodic updating + const EPS_UpdateTypeValue tsc_EpsUpdate_TaLaUpdate_ISRActivated := '100'B; // TA updating with ISR activated + const EPS_UpdateTypeValue tsc_EpsUpdate_Combined_TaLaUpdate_ISRActivated := '101'B; // Combined TA/LA updating with ISR activated + + const B1_Type tsc_EpsUpdate_Active := '1'B; + const B1_Type tsc_EpsUpdate_NotActive := '0'B; + + // GprsOnly & EpsOnly share the same value + const NAS_AttDetValue_Type tsc_DetachMO_GprsOnly := '001'B; + const NAS_AttDetValue_Type tsc_DetachMO_EpsOnly := '001'B; + const NAS_AttDetValue_Type tsc_DetachMO_Imsi := '010'B; + const NAS_AttDetValue_Type tsc_DetachMO_Combined := '011'B; + const NAS_AttDetValue_Type tsc_DetachMT_ReAttach := '001'B; + const NAS_AttDetValue_Type tsc_DetachMT_NoReAttach := '010'B; + const NAS_AttDetValue_Type tsc_DetachMT_Imsi := '011'B; + + const NAS_CauseValue_Type tsc_EmmCause_UnknownIMSI := '00000010'B; + const NAS_CauseValue_Type tsc_EmmCause_IllegalUe := '00000011'B; + const NAS_CauseValue_Type tsc_EmmCause_IllegalMe := '00000110'B; + const NAS_CauseValue_Type tsc_Cause_IMEINotAccepted := '00000101'B; + const NAS_CauseValue_Type tsc_Cause_EPSServNotAllowed := '00000111'B; + const NAS_CauseValue_Type tsc_Cause_EPSandNonEPSServNotAllowed := '00001000'B; + const NAS_CauseValue_Type tsc_EmmCause_UEIdentityNotDerived := '00001001'B; + const NAS_CauseValue_Type tsc_EmmCause_ImplicitlyDetached := '00001010'B; + const NAS_CauseValue_Type tsc_Cause_TA_NotAllowed := '00001100'B; + const NAS_CauseValue_Type tsc_Cause_Roaming_NotAllowed := '00001101'B; + const NAS_CauseValue_Type tsc_Cause_PLMN_NotAllowed := '00001011'B; + const NAS_CauseValue_Type tsc_Cause_EPSServNotAllowedInThisPLMN := '00001110'B; + const NAS_CauseValue_Type tsc_Cause_NoSuitableCells := '00001111'B; + const NAS_CauseValue_Type tsc_EmmCause_MSCnotReachable := '00010000'B; + const NAS_CauseValue_Type tsc_EmmCause_NetworkFailure := '00010001'B; + const NAS_CauseValue_Type tsc_Cause_CSDomainNotAvailable := '00010010'B; + const NAS_CauseValue_Type tsc_Cause_ESMFailure := '00010011'B; + const NAS_CauseValue_Type tsc_Cause_MAC_Failure := '00010100'B; // #20 + const NAS_CauseValue_Type tsc_Cause_SQN_Failure := '00010101'B; // #21 + const NAS_CauseValue_Type tsc_Cause_Congestion := '00010110'B; + const NAS_CauseValue_Type tsc_UeSecurityCapsMismatch := '00010111'B; + const NAS_CauseValue_Type tsc_SecurityModeRejUnspecified := '00011000'B; + const NAS_CauseValue_Type tsc_Cause_NotAuthorizedCSG := '00011001'B; + const NAS_CauseValue_Type tsc_Cause_nonEPS_AuthUnacceptable := '00011010'B; // #26 + const NAS_CauseValue_Type tsc_EmmCause_CsFbCallEstNotAllowed := '00100110'B; // @desc EMM Cause: CS fallback call establishment not allowed. + const NAS_CauseValue_Type tsc_Cause_CSDomainNotTemporarilyAvailable := '00100111'B; // #39 'CS domain temporarily not available' + const NAS_CauseValue_Type tsc_Cause_NoEPSBearerActive := '00101000'B; // #40 + const NAS_CauseValue_Type tsc_EmmCause_SemanticallyIncorrect := '01011111'B; + const NAS_CauseValue_Type tsc_EmmCause_InvalidMandatoryInformation := '01100000'B; + const NAS_CauseValue_Type tsc_EmmCause_MessageTypeNonExistentOrNotImplemented := '01100001'B; + const NAS_CauseValue_Type tsc_EmmCause_IENonExistentOrNotImplemented := '01100011'B; + const NAS_CauseValue_Type tsc_EmmCause_ProtocolErrorUnspecified := '01101111'B; + + const NAS_KsiValue tsc_NasKsi_NoKey := '111'B; + const B1_Type tsc_NasKsi_NativeSecurityContext := '0'B; + const B1_Type tsc_NasKsi_MappedSecurityContext := '1'B; + + const B3_Type tsc_PdnRequest_InitialAttach := '001'B; + const B3_Type tsc_PdnRequest_Handover := '010'B; + const B3_Type tsc_PdnRequest_Emergency := '100'B; + + // PLMN identities acc. to 36.508 Table 6.3.2.2-1 + const NAS_PlmnId tsc_PLMN1 := '00F110'O; // @desc NAS PLMN ID (MCC=001, MNC= 01) for NAS Cell(s) A-F,M. + const NAS_PlmnId tsc_PLMN2 := '00F120'O; // @desc NAS PLMN ID (MCC=001, MNC= 02) for NAS Cell(s) G,H. + const NAS_PlmnId tsc_PLMN3 := '001201'O; // @desc NAS PLMN ID (MCC=002, MNC=101) for NAS Cell(s) I,K,L. + const NAS_PlmnId tsc_PLMN4 := '001301'O; // @desc NAS PLMN ID (MCC=003, MNC=101) for NAS Cell(s) J. + + const EPS_MmeGi tsc_MMEGI1 := '0001'O; + const EPS_MmeGi tsc_MMEGI2 := '0002'O; + const EPS_MmeGi tsc_MMEGI3 := '0003'O; + const EPS_MmeGi tsc_MMEGI4 := '0004'O; + const EPS_MmeGi tsc_MMEGI5 := '0005'O; + const EPS_MmeGi tsc_MMEGI6 := '0006'O; + const EPS_MmeGi tsc_MMEGI7 := '0007'O; + const EPS_MmeGi tsc_MMEGI8 := '0008'O; + const EPS_MmeGi tsc_MMEGI9 := '0009'O; + const EPS_MmeGi tsc_MMEGI10 := '000A'O; + + const EPS_Mmec tsc_MMEC1to10 := '01'O; + + const NAS_Tac tsc_TAC1 := '0001'O; + const NAS_Tac tsc_TAC2 := '0002'O; + const NAS_Tac tsc_TAC3 := '0003'O; + const NAS_Tac tsc_TAC4 := '0004'O; + const NAS_Tac tsc_TAC5 := '0005'O; + const NAS_Tac tsc_TAC6 := '0006'O; + + const EPS_PartialTaiListType tsc_NonConsecutiveTacs := '00'B; + const EPS_PartialTaiListType tsc_ConsecutiveTacs := '01'B; + const EPS_PartialTaiListType tsc_MultiplePlmns := '10'B; + + const EPS_ServiceTypeValue tsc_EST_CsFallback_MO := '0000'B; // @desc Service Type: Mobile originating CS fallback or 1xCS fallback. + const EPS_ServiceTypeValue tsc_EST_CsFallback_MT := '0001'B; // @desc Service Type: Mobile terminating CS fallback or 1xCS fallback. + const EPS_ServiceTypeValue tsc_EST_CsFallback_EC := '0010'B; // @desc Service Type: Mobile originating CS fallback emergency call or 1xCS fallback emergency call. + + const ProcedureTransactionIdentifier tsc_PTI_Unassigned := '00'O; // TS 24.007 clause 11.2.3.1a + + const octetstring tsc_APN1 := '0541504E2D31'O; /* Access Point Name APN-1; + @status APPROVED (LTE) */ + const charstring tsc_APN1_String := "APN-1"; /* Access Point Name APN-1; @sic R5s100466 sic@ + @status APPROVED (LTE) */ + const octetstring tsc_APN2 := '0541504E2D32'O; /* Access Point Name APN-2; + @status APPROVED (LTE) */ + const charstring tsc_APN2_String := "APN-2"; /* Access Point Name APN-2; @sic R5s100748 sic@ + @status APPROVED (LTE) */ + const octetstring tsc_APN3 := '0541504E2D33'O; /* Access Point Name APN-3; + @status */ + const charstring tsc_APN3_String := "APN-3"; /* Access Point Name APN-3; @sic R5-143213 sic@ + @status */ + + const B8_Type tsc_ESM_Cause36_RegularDeactivation := '00100100'B; // @sic R5s141315 ch. 7 sic@ + const B8_Type tsc_ESM_Cause26_InsufficientResources := '00011010'B; + + + const float tsc_WaitforAttach := 1.5; // @sic R5s130634 sic@ + + //---------------------------------------------------------------------------- + /* + * @desc calculation of DRB_Identity associated to EpsBearerId + * @param p_EpsBearerId + * @return integer + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_EUTRA_EpsBearerAssociatedDRB(HalfOctet_Type p_EpsBearerId) return integer + { /* @sic R5s141351 change 5: returns integer instead of DRB_Identity sic@ */ + return (hex2int(p_EpsBearerId) - 4); + } + +} diff --git a/IMS_PART4_IWD_15wk38/Common/EUTRA_Defs/EPS_NAS_TypeDefs.ttcn b/IMS_PART4_IWD_15wk38/Common/EUTRA_Defs/EPS_NAS_TypeDefs.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dd2b890d178868a23389a6e70153c46a6004875f --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/EUTRA_Defs/EPS_NAS_TypeDefs.ttcn @@ -0,0 +1,1139 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-04-24 16:58:12 +0200 (Fri, 24 Apr 2015) $ +// $Rev: 13504 $ +/******************************************************************************/ + +module EPS_NAS_TypeDefs { + +import from CommonDefs all; +import from NAS_CommonTypeDefs all; + +//**************************************************************************** +// NAS PROTOCOL DEFINITIONS: IEs +//---------------------------------------------------------------------------- +// General Info Elements (24.301 cl. 9) +//---------------------------------------------------------------------------- + +type B4_Type SecurityHeaderType; /* 24.301 cl. 9.3.1 */ +type HalfOctet_Type EPS_BearerIdentity; /* 24.301 cl. 9.3.2 */ +type Octet_Type ProcedureTransactionIdentifier; /* 24.301 cl. 9.4 */ +type Octet_Type NAS_SequenceNumber; /* 24.301 cl. 9.6 */ + + +// Note: This IE is not needed when SECURITY PROTECTED NAS MESSAGE is +// handled by the NAS emulation An alternative approach would be to +// implement NAS_Message as a union of all NAS messages except +// SECURITY PROTECTED NAS MESSAGE and SERVICE REQUEST - but this would +// have impact on codec implementation and may reduce readability */ +type octetstring NAS_Message; /* 24.301 cl. 9.7 */ + +type O2_Type EPS_MmeGi; +type O1_Type EPS_Mmec; +type O4_Type EPS_M_Tmsi; +type O5_Type EPS_S_Tmsi; + +type B2_Type EPS_PartialTaiListType; +type B3_Type NAS_KsiValue; +type B4_Type EPS_ServiceTypeValue; +type B3_Type PdnTypeValue; +type B3_Type EPS_UpdateTypeValue; + +type O2_Type NAS_Tac; + +//---------------------------------------------------------------------------- +// Common Info Elements (24.301 cl. 9.9.2) +//---------------------------------------------------------------------------- + +type record PDN_Address { /* 24.301 cl. 9.9.4.9 */ + IEI8_Type iei optional, /* present in case of TLV; omit in case of LV */ + Type4Length_Type iel optional, /* present in case of LV or TLV; omit in case of V */ + B5_Type spare, + B3_Type typeValue, + octetstring adressInfo length(4..12) +}; + + +type record TrackingAreaId { /* 24.301 cl. 9.9.3.32 */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + NAS_PlmnId plmnId, /* MCC + MNC 3 digits each */ + NAS_Tac tac /* TAC */ +}; + +type record length (1..16) of NAS_Tac NAS_TacList; + +type record PartialTai { + NAS_PlmnId plmnId, /* MCC + MNC 3 digits each */ + NAS_Tac tac +}; + +type record Type0Element { // @sic R5s100184 sic@ + NAS_PlmnId plmnId, /* MCC + MNC 3 digits each */ + NAS_TacList tacList +}; + +type record Type1Element { // @sic R5s100184 sic@ + PartialTai partialTac +}; + +type record length (1..16) of PartialTai PlmnAndTacs; + +type record Type2Element { // @sic R5s100184 sic@ + PlmnAndTacs plmnAndTacs +}; + +type record length (1..16) of Type0Element Type0List; +type record length (1..16) of Type1Element Type1List; +type record length (1..16) of Type2Element Type2List; + +type union PartialTaiType { + Type0List type0List, + Type1List type1List, + Type2List type2List +}; + +type record ListOfPartialTaiList { + B1_Type spareBit, + EPS_PartialTaiListType typeOfList, + B5_Type numberOfElements, + PartialTaiType partialTaiList // @sic R5s100184 sic@ +}; + +type record TrackingAreaIdList { /* 24.301 cl. 9.9.3.33 */ + IEI8_Type iei optional, /* present in case of TLV; omit in case of LV */ + Type4Length_Type iel, + record length (1..16) of ListOfPartialTaiList listOfPartialTais +}; + +//**************************************************************************** +// NAS PROTOCOL DEFINITIONS: PDUs +//---------------------------------------------------------------------------- +// EPS mobility management messages (24.301 cl. 8.2) +//---------------------------------------------------------------------------- + +type record ATTACH_ACCEPT { /* 24.301 cl. 8.2.1 + Significance: dual + Direction: network to UE */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + SpareHalfOctet spareHalfOctet, /* cl. 9.9.2.9 M V 1/2 */ + EPS_AttachResult epsAttachResult, /* cl. 9.9.3.10 M V 1/2 */ + GPRS_Timer t3412, /* cl. 9.9.3.16 M V 1 */ + TrackingAreaIdList taiList, /* cl. 9.9.3.33 M LV 7-97 */ + ESM_MessageContainer esmMessage, /* cl. 9.9.3.15 M LV-E 5-n @sic R5s110176 Baseline Moving sic@ */ + MobileIdentity guti optional, /* cl. 9.9.3.12 O TLV 13 IEI=0x50 */ + LocAreaId lai optional, /* cl. 9.9.2.2 O TV 6 IEI=0x13 */ + MobileIdentity msIdentity optional, /* cl. 9.9.2.3 O TLV 7-10 IEI=0x23 */ + EMM_Cause emmCause optional, /* cl. 9.9.3.9 O TV 2 IEI=0x53 */ + GPRS_Timer t3402 optional, /* cl. 9.9.3.16 O TV 2 IEI=0x17 */ + GPRS_Timer t3423 optional, /* cl. 9.9.3.16 O TV 2 IEI=0x59 */ + PLMN_List equivalentPlmns optional, /* cl. 9.9.2.8 O TLV 5-47 IEI=0x4a */ + EmergNumList emergencyNumberList optional, /* cl. 9.9.3.37 O TLV 5-50 IEI=0x34 */ + EPS_NetworkFeatureSupport epsNetworkFeatureSupport optional, /* cl.9.9.3.12A O TLV 3 IEI=0x64 @sic R5s100135 sic@ */ + AdditionalUpdateResult addUpdateResult optional, /* cl.9.9.3.0A O TV 1 IEI=0xF @sic R5s100135 sic@ */ + GPRS_Timer3 t3412ExtdValue optional, /* cl. 9.9.3.16B O TLV 3 IEI=0x5E @sic R5s120178 Baseline Moving sic@*/ + GPRS_Timer2 t3324Value optional /* cl. 9.9.3.16A O TLV 3 IEI=0x6A @sic R5s150329 Baseline Moving sic@ */ +}; + +type record ATTACH_COMPLETE { /* 24.301 cl. 8.2.2 + Significance: dual + Direction: UE to network */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + ESM_MessageContainer esmMessage /* cl. 9.9.3.15 M LV-E 5-n @sic R5s110176 Baseline Moving sic@ */ +}; + +type record ATTACH_REJECT { /* 24.301 cl. 8.2.3 + Significance: dual + Direction: network to UE */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + EMM_Cause emmCause, /* cl. 9.9.3.9 M V 1 */ + ESM_MessageContainer esmMessage optional, /* cl. 9.9.3.15 M TLV-E 6-n IEI=0x78 @sic R5s110176 Baseline Moving sic@ */ + GPRS_Timer2 t3346 optional, /* cl. 9.9.3.16A O TLV 3 IEI=0x5F @sic R5s120178 Baseline Moving sic@*/ + GPRS_Timer2 t3402 optional, /* cl. 9.9.3.16A O TLV 3 IEI=0x16 @sic R5s120178 Baseline Moving sic@*/ + Extd_EMM_Cause extdEMMCause optional /* cl. 9.9.3.26A O TV 1 IEI=0xA @sic R5s150329 Baseline Moving sic@ */ +}; + +type record ATTACH_REQUEST { /* 24.301 cl. 8.2.4 + Significance: dual + Direction: UE to network */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + NAS_KeySetIdentifier nasKeySetId, /* cl. 9.9.3.21 M V 1/2 */ + EPS_AttachType epsAttachType, /* cl. 9.9.3.11 M V 1/2 */ + MobileIdentity epsMobileIdentity, /* cl. 9.9.3.12 M LV 5-12 @sic R5s110176 Baseline Moving sic@ */ + UE_NetworkCap ueNetworkCapability, /* cl. 9.9.3.34 M LV 3-14 */ + ESM_MessageContainer esmMessage, /* cl. 9.9.3.15 M LV-E 5-n */ + PTMSI_Signature oldPtmsiSignature optional, /* cl 10.5.5.8 of 24.008 O TV 4 IEI=Ox19*/ + MobileIdentity additionalGuti optional, /* cl 9.9.3.12 O TLV 13 IEI=Ox50*/ + TrackingAreaId lastVisitedRegisteredTai optional, /* cl. 9.9.3.32 O TV 6 IEI=0x52 */ + DRXparameter drxParameter optional, /* cl. 9.9.3.8 O TV 3 IEI=Ox5c */ + MS_NetworkCap msNetworkCapability optional, /* cl. 9.9.3.20 O TLV 4-10 IEI=Ox31 */ + LocAreaId oldLai optional, /* cl. 9.9.2.2 O TV 6 IEI=0x13 */ + TMSI_Status tmsiStatus optional, /* cl. 9.9.2.31 O TV 1 IEI=0x9- */ + MS_Clsmk2 msClassmark2 optional, /* cl. 9.9.2.4 O TLV 5 IEI=0x11 */ + MS_Clsmk3 msClassmark3 optional, /* cl. 9.9.2.5 O TLV 2-34 IEI=0x20 */ + CodecList supportedCodecList optional, /* cl. 9.9.2.10 O TLV 5-n IEI=0x40 */ + AdditionalUpdateType addUpdateType optional, /* cl.9.9.3.0B O TV 1 IEI=0xF @sic R5s100135 sic@ */ + VoiceDomainPref voiceDomainPref optional, /* cl.9.9.3.44 O TLV 3 IEI=0x5D @sic R5s110176 Baseline Moving sic@ */ + DeviceProperties deviceProperties optional, /* cl. 9.9.2.0A O TV 1 IEI=0xD- @sic R5s120178 Baseline Moving sic@*/ + GUTI_Type oldGUTI_Type optional, /* cl. 9.9.3.45 O TV 1 IEI=0xE- @sic R5s120178 Baseline Moving sic@*/ + MS_NetworkFeatureSupport msNetworkFeatureSupport optional, /* cl. 9.9.2.0A O TV 1 IEI=0xC- @sic R5s120178 Baseline Moving sic@*/ + NwkResourceId tmsiBasedNRIContainer optional, /* cl. 10.5.5.31 O TLV 4 IEI=0x10 @sic R5s130195 Baseline Moving sic@*/ + GPRS_Timer2 t3324Value optional, /* cl. 9.9.3.16A O TLV 3 IEI=0x6A @sic R5s150329 Baseline Moving sic@ */ + GPRS_Timer3 t3412ExtdValue optional /* cl. 9.9.3.16B O TLV 3 IEI=0x5E @sic R5s150329 Baseline Moving sic@*/ +}; + +type record AUTHENTICATION_FAILURE { /* 24.301 cl. 8.2.5 + Significance: dual + Direction: UE to network */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + EMM_Cause emmCause, /* cl. 9.9.3.9 M V 1 */ + AuthenticationFailureParameter authenticationFailureParameter optional /* cl. 9.9.3.1 O TLV 16 IEI=0x30 */ +}; + +type record AUTHENTICATION_REJECT { /* 24.301 cl. 8.2.6 + Significance: dual + Direction: network to UE */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType /* cl. 9.8 M V 1 */ +}; + +type record AUTHENTICATION_REQUEST { /* 24.301 cl. 8.2.7 + Significance: dual + Direction: network to UE */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + SpareHalfOctet spareHalfOctet, /* cl. 9.9.2.9 M V 1/2 */ + NAS_KeySetIdentifier asmeNasKeySetId, /* cl. 9.9.3.21 M V 1/2 */ + RAND rand, /* cl. 9.9.3.3 M V 16 */ + AUTN autn /* cl. 9.9.3.2 M LV 17 */ +}; + +type record AUTHENTICATION_RESPONSE { /* 24.301 cl. 8.2.8 + Significance: dual + Direction: UE to network */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + AuthenticationResponseParameter authenticationResponseParameter /* cl. 9.9.3.4 M LV 5-17 */ +}; + +type record CS_SERVICE_NOTIFICATION { /* 24.301 cl. 8.2.9 + Significance: dual + Direction: network to UE */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + PagingIdentity pagingIdentity, /* cl. 9.9.3.25A M V 1 @sic R5s100135 sic@ */ + CLI cli optional, /* cl. 9.9.3.38 O TLV 3-14 IEI=0x60 */ + SsCode ssCode optional, /* cl. 9.9.3.39 O TV 2 IEI=0x61 */ + LcsIndicator lcsIndicator optional, /* cl. 9.9.3.40 O TV 2 IEI=0x62 */ + LcsClientIdentity lcsClientIdentity optional /* cl. 9.9.3.41 O TLV 3-257 IEI=0x63 */ +}; + +type record DETACH_ACCEPT { /* 24.301 cl. 8.2.10.1/2 (both directions) + Significance: dual + Direction: network to UE */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType /* cl. 9.8 M V 1 */ +}; + +type record DETACH_REQUEST_MO { /* 24.301 cl. 8.2.11.1 (UE originating detach) + Significance: dual + Direction: UE to network */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + NAS_KeySetIdentifier asmeNasKeySetId, /* cl. 9.9.3.21 M V 1/2 */ + DetachType detachType, /* cl. 9.9.3.7 M V 1/2 */ + MobileIdentity epsMobileIdentity /* cl. 9.9.3.12 M LV 5-12 @sic R5s110176 Baseline Moving sic@ */ +}; + +type record DETACH_REQUEST_MT { /* 24.301 cl. 8.2.11.2 (UE terminated detach) + Significance: dual + Direction: network to UE */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + SpareHalfOctet spareHalfOctet, /* cl. 9.9.2.9 M V 1/2 */ + DetachType detachType, /* cl. 9.9.3.7 M V 1/2 */ + EMM_Cause emmCause optional /* cl. 9.9.3.9 O TV 2 IEI=0x53 */ +}; + +type record DL_NAS_TRANSPORT { /* 24.301 cl. 8.2.12 + Significance: local + Direction: network to UE */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + NAS_MessageContainer nasMessage /* cl. 9.9.3.22 M LV 3-252 */ +}; + +type record EMM_INFORMATION { /* 24.301 cl. 8.2.13 + Significance: local + Direction: network to UE */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + NetworkName fullNetworkName optional, /* cl. 9.9.3.24 O TLV 3-? IEI=0x43 */ + NetworkName shortNetworkName optional, /* cl. 9.9.3.24 O TLV 3-? IEI=0x45 */ + TimeZone localTimeZone optional, /* cl. 9.9.3.29 O TV 2 IEI=0x46 */ + TimeZoneAndTime localTimeZoneAndTime optional, /* cl. 9.9.3.30 O TV 8 IEI=0x47 */ + DaylightSavingTime daylightSavingTime optional /* cl. 9.9.3.6 O TLV 3 IEI=0x49 */ +}; + +type record EMM_STATUS { /* 24.301 cl. 8.2.14 + Significance: local + Direction: both */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + EMM_Cause emmCause /* cl. 9.9.3.9 M V 1 */ +}; + +type record EXT_SERVICE_REQUEST { /* 24.301 cl. 8.2.15 + Significance: dual + Direction: UE to network */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + NAS_KeySetIdentifier nasKeySetId, /* cl. 9.9.3.21 M V 1/2 */ + EPS_ServiceType serviceType, /* cl. 9.9.3.27 M V 1/2 */ + MobileIdentity mTMSI, /* cl. 9.9.2.3 M LV 6 */ + CSFBResponse csfbResponse optional, /* cl. 9.9.3.5 C TV 1 IEI=0xB- */ + EPS_BearerContextStatus epsBearerContextStatus optional, /* cl. 9.9.2.1 O TLV 4 IEI=0x57 @sic R5s110176 Baseline Moving sic@ */ + DeviceProperties deviceProperties optional /* cl. 9.9.2.0A O TV 1 IEI=0xD- @sic R5s120178 Baseline Moving sic@*/ +}; + +type record GUTI_REALLOCATION_COMMAND { /* 24.301 cl. 8.2.16 + Significance: dual + Direction: network to UE */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + MobileIdentity guti, /* cl. 9.9.3.12 M LV 12 */ + TrackingAreaIdList taiList optional /* cl. 9.9.3.33 O TLV 8-98 IEI=0x54 */ +}; + +type record GUTI_REALLOCATION_COMPLETE { /* 24.301 cl. 8.2.17 + Significance: dual + Direction: UE to network */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType /* cl. 9.8 M V 1 */ +}; + +type record IDENTITY_REQUEST { /* 24.301 cl. 8.2.18 + Significance: dual + Direction: network to UE */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + SpareHalfOctet spareHalfOctet, /* cl. 9.9.2.9 M V 1/2 */ + IdentityType identityType2 /* cl. 9.9.3.17 M V 1/2 */ +}; + +type record IDENTITY_RESPONSE { /* 24.301 cl. 8.2.19 + Significance: dual + Direction: UE to network */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + MobileIdentity mobileIdentity /* cl. 9.9.2.3 M LV 4-10 */ +}; + +type record SECURITY_MODE_COMMAND { /* 24.301 cl. 8.2.20 + Significance: dual + Direction: network to UE */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + NAS_SecurityAlgorithms nasSecurityAlgorithms, /* cl. 9.9.3.23 M V 1 */ + SpareHalfOctet spareHalfOctet, /* cl. 9.9.2.9 M V 1/2 */ + NAS_KeySetIdentifier asmeNasKeySetId, /* cl. 9.9.3.21 M V 1/2 */ + UE_SecurityCapability replayedSecurityCapability, /* cl. 9.9.3.36 M LV 3-6 */ + IMEISV_Request imeisvRequest optional, /* cl. 9.9.3.18 O TV 1 IEI=0xC- */ + Nonce replayedNonceUe optional, /* cl. 9.9.3.25 O TV 5 IEI=0x55 */ + Nonce nonceMme optional /* cl. 9.9.3.25 O TV 5 IEI=0x56 */ +}; + +type record SECURITY_MODE_COMPLETE { /* 24.301 cl. 8.2.21 + Significance: dual + Direction: UE to network */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + MobileIdentity imeisv optional /* cl. 9.9.2.3 O TLV 11 IEI=0x23 */ +}; + +type record SECURITY_MODE_REJECT { /* 24.301 cl. 8.2.22 + Significance: dual + Direction: UE to network */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + EMM_Cause emmCause /* cl. 9.9.3.9 M V 1 */ +}; + +type record SECURITY_PROTECTED_NAS_MESSAGE { /* 24.301 cl. 8.2.23 + Significance: dual + Direction: both */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageAuthenticationCode messageAuthenticationCode, /* cl. 9.5 M V 4 */ + NAS_SequenceNumber sequenceNumber, /* cl. 9.6 M V 1 */ + NAS_Message nasMessage /* cl. 9.7 M V 1-n */ +}; + +type record SERVICE_REJECT { /* 24.301 cl. 8.2.24 + Significance: dual + Direction: network to UE */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + EMM_Cause emmCause, /* cl. 9.9.3.9 M V 1 */ + GPRS_Timer t3442 optional,/* cl. 9.9.3.16 C TV 2 IEI=0x5b */ + GPRS_Timer2 t3346 optional /* cl. 9.9.3.16A O TLV 3 IEI=0x5F @sic R5s120178 Baseline Moving sic@ */ +}; + +type record SERVICE_REQUEST { /* 24.301 cl. 8.2.25 + Significance: dual + Direction: UE to network */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + KSIandSN ksiAndSN, /* cl. 9.9.3.19 M V 1 */ + ShortMAC shortMAC /* cl. 9.9.3.28 M V 2 */ +}; + +type record TRACKING_AREA_UPDATE_ACCEPT { /* 24.301 cl. 8.2.26 + Significance: dual + Direction: network to UE */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + SpareHalfOctet spareHalfOctet, /* cl. 9.9.2.9 M V 1/2 */ + EPS_UpdateResult epsUpdateResult, /* cl. 9.9.3.13 M V 1/2 */ + GPRS_Timer t3412 optional, /* cl. 9.9.3.16 O TV 2 IEI=0x5a */ + MobileIdentity guti optional, /* cl. 9.9.3.12 O TLV 13 IEI=0x50 */ + TrackingAreaIdList taiList optional, /* cl. 9.9.3.33 O TLV 8-98 IEI=0x54 */ + EPS_BearerContextStatus epsBearerContextStatus optional, /* cl. 9.9.2.1 O TLV 4 IEI=0x57 */ + LocAreaId lai optional, /* cl. 9.9.2.2 O TV 6 IEI=0x13 */ + MobileIdentity msIdentity optional, /* cl. 9.9.2.3 O TLV 7-10 IEI=0x23 */ + EMM_Cause emmCause optional, /* cl. 9.9.3.9 O TV 2 IEI=0x53 */ + GPRS_Timer t3402 optional, /* cl. 9.9.3.16 O TV 2 IEI=0x17 */ + GPRS_Timer t3423 optional, /* cl. 9.9.3.16 O TV 2 IEI=0x59 */ + PLMN_List equivalentPlmns optional, /* cl. 9.9.2.8 O TLV 5-47 IEI=0x4a */ + NAS_KeySetIdentifier asmeNasKeySetId optional, /* cl. 9.9.3.21 O TV 1 IEI=0x8-*/ + EmergNumList emergencyNumberList optional, /* cl. 9.9.3.37 O TLV 5-50 IEI=0x34 */ + EPS_NetworkFeatureSupport epsNetworkFeatureSupport optional, /* cl.9.9.3.12A O TLV 3 IEI=0x64 @sic R5s100135 sic@ */ + AdditionalUpdateResult addUpdateResult optional, /* cl.9.9.3.0A O TV IEI=0xF @sic R5s100135 sic@ */ + GPRS_Timer3 t3412ExtdValue optional, /* cl. 9.9.3.16B O TLV 3 IEI=0x5E @sic R5s120178 Baseline Moving sic@*/ + GPRS_Timer2 t3324Value optional /* cl. 9.9.3.16A O TLV 3 IEI=0x6A @sic R5s150329 Baseline Moving sic@ */ +}; + +type record TRACKING_AREA_UPDATE_COMPLETE { /* 24.301 cl. 8.2.27 + Significance: dual + Direction: UE to network */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType /* cl. 9.8 M V 1 */ +}; + +type record TRACKING_AREA_UPDATE_REJECT { /* 24.301 cl. 8.2.28 + Significance: dual + Direction: network to UE */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + EMM_Cause emmCause, /* cl. 9.9.3.9 M V 1 */ + GPRS_Timer2 t3346 optional, /* cl. 9.9.3.16A O TLV 3 IEI=0x5F @sic R5s120178 Baseline Moving sic@*/ + Extd_EMM_Cause extdEMMCause optional /* cl. 9.9.3.26A O TV 1 IEI=0xA @sic R5s150329 Baseline Moving sic@ */ +}; + +type record TRACKING_AREA_UPDATE_REQUEST { /* 24.301 cl. 8.2.29 + Significance: dual + Direction: UE to network */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + NAS_KeySetIdentifier asmeNasKeySetId, /* cl. 9.9.3.21 M V 1/2 */ + EPS_UpdateType epsUpdateType, /* cl. 9.9.3.14 M V 1/2 */ + MobileIdentity oldGuti, /* cl. 9.9.3.12 M LV 12 */ + NAS_KeySetIdentifier nonCurrentNativeNasKeySetId optional, /* cl. 9.9.3.21 O TV 1 IEI=0xB- */ + CiphKeySeqNum gprsCipheringKeySeqNum optional, /* cl. 9.9.3.4a O TV 1 IEI=0x8- @sic R5s100135 sic@ */ + PTMSI_Signature oldPtmsiSignature optional, /* cl. 9.9.3.26 O TV 4 IEI=0x19 */ + MobileIdentity additionalGuti optional, /* cl. 9.9.3.12 O TLV 13 IEI=0x50 */ + Nonce nonce optional, /* cl. 9.9.3.25 O TV 5 IEI=0x55 */ + UE_NetworkCap ueNetworkCapability optional, /* cl. 9.9.3.34 O TLV 4-10 IEI=0x58 */ + TrackingAreaId lastVisitedRegisteredTai optional, /* cl. 9.9.3.32 O TV 6 IEI=0x52 */ + DRXparameter drxParameter optional, /* cl. 9.9.3.8 O TV 3 IEI=Ox5c */ + UERadioCapInfoUpdateNeeded ueRadioCapNeeded optional, /* cl. 9.9.3.35 O TV 1 IEI=OxA- */ + EPS_BearerContextStatus epsBearerContextStatus optional, /* cl. 9.9.2.1 O TLV 4 IEI=0x57 */ + MS_NetworkCap msNetworkCapability optional, /* cl. 9.9.3.20 O TLV 4-10 IEI=0x31 */ + LocAreaId oldLai optional, /* cl. 9.9.2.2 O TV 6 IEI=0x13 */ + TMSI_Status tmsiStatus optional, /* cl. 9.9.2.31 O TV 1 IEI=0x9- */ + MS_Clsmk2 msClassmark2 optional, /* cl. 9.9.2.4 O TLV 5 IEI=0x11 */ + MS_Clsmk3 msClassmark3 optional, /* cl. 9.9.2.5 O TLV 2-34 IEI=0x20 */ + CodecList supportedCodecList optional, /* cl. 9.9.2.10 O TLV 5-n IEI=0x40 */ + AdditionalUpdateType addUpdateType optional, /* cl.9.9.3.0B O TV IEI=0xF @sic R5s100135 sic@ */ + VoiceDomainPref voiceDomainPref optional, /* cl.9.9.3.44 O TLV 3 IEI=0x5D @sic R5s110176 Baseline Moving sic@ */ + GUTI_Type oldGUTI_Type optional, /* cl. 9.9.3.45 O TV 1 IEI=0xE- @sic R5s120178 Baseline Moving sic@*/ + DeviceProperties deviceProperties optional, /* cl. 9.9.2.0A O TV 1 IEI=0xD- @sic R5s120178 Baseline Moving sic@*/ + MS_NetworkFeatureSupport msNetworkFeatureSupport optional, /* cl. 9.9.2.0A O TV 1 IEI=0xC- @sic R5s120178 Baseline Moving sic@*/ + NwkResourceId tmsiBasedNRIContainer optional, /* cl. 10.5.5.31 O TLV 4 IEI=0x10 @sic R5s130195 Baseline Moving sic@*/ + GPRS_Timer2 t3324Value optional, /* cl. 9.9.3.16A O TLV 3 IEI=0x6A @sic R5s150329 Baseline Moving sic@ */ + GPRS_Timer3 t3412ExtdValue optional /* cl. 9.9.3.16B O TLV 3 IEI=0x5E @sic R5s150329 Baseline Moving sic@*/ +}; + +type record UL_NAS_TRANSPORT { /* 24.301 cl. 8.2.30 + Significance: local + Direction: UE to network */ + SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + NAS_MessageContainer nasMessage /* cl. 9.9.3.22 M LV 3-252 */ +}; + +type record DL_GENERIC_NAS_TRANSPORT{ /* 24.301 cl. 8.2.31 + Significance: dual + Direction: network to UE @sic R5s110176 Baseline Moving sic@ */ +SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ +ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ +MessageType messageType, /* cl. 9.8 M V 1 */ +GenericMessageContainerType genericMessageContainerType, /* cl. 9.9.3.42 M V 1 */ +GenericMessageContainer genericMessageContainer, /* cl. 9.9.3.43 M LV-E 3-n */ +AdditionalInformation additionalInformation optional /* cl. 9.9.2.0 O TLV 3-n IEI=65 */ +}; + +type record UL_GENERIC_NAS_TRANSPORT{ /* 24.301 cl. 8.2.32 + Significance: dual + Direction: UE to network @sic R5s110176 Baseline Moving sic@ */ +SecurityHeaderType securityHeaderType, /* cl. 9.3.1 M V 1/2 */ +ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ +MessageType messageType, /* cl. 9.8 M V 1 */ +GenericMessageContainerType genericMessageContainerType, /* cl. 9.9.3.42 M V 1 */ +GenericMessageContainer genericMessageContainer, /* cl. 9.9.3.43 M LV-E 3-n */ +AdditionalInformation additionalInformation optional /* cl. 9.9.2.0 O TLV 3-n IEI=65 */ +}; + +//---------------------------------------------------------------------------- +// EPS session management messages (24.301 cl. 8.3) +//---------------------------------------------------------------------------- + +type record ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT { /* 24.301 cl. 8.3.1 + Significance: dual + Direction: UE to network */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + ProtocolConfigOptions protocolConfigurationOptions optional /* cl. 9.9.4.11 O TLV 3-253 IEI=0x27*/ +}; + +type record ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REJECT { /* 24.301 cl. 8.3.2 + Significance: dual + Direction: UE to network */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + ESM_Cause esmCause, /* cl. 9.9.4.4 M V 1 */ + ProtocolConfigOptions protocolConfigurationOptions optional /* cl. 9.9.4.11 O TLV 3-253 IEI=0x27 */ +}; + +type record ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST { /* 24.301 cl. 8.3.3 + Significance: dual + Direction: network to UE */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + SpareHalfOctet spareHalfOctet, /* cl. 9.9.2.9 M V 1/2 */ + LinkedEpsBearerIdentity linkedEpsBearerId, /* cl. 9.9.4.6 M V 1/2 */ + EPS_QualityOfService epsQos, /* cl. 9.9.4.3 M LV 2-14 */ + TrafficFlowTemplate tft, /* cl. 9.9.4.16 M LV 2-256 */ + TransactionIdentifier transactionIdentifier optional, /* cl. 9.9.4.17 O TLV 3-4 IEI=0x5d */ + QualityOfService negotiatedQos optional, /* cl. 9.9.4.12 O TLV 14-22 IEI=0x30 */ + LLC_SAPI negotiatedLlcSapi optional, /* cl. 9.9.4.7 O TV 2 IEI=0x32 */ + RadioPriority radioPriority optional, /* cl. 9.9.4.13 O TV 1 IEI=0x8- */ + PacketFlowIdentifier packetFlowIdentifier optional, /* cl. 9.9.4.8 O TLV 3 IEI=0x34 */ + ProtocolConfigOptions protocolConfigurationOptions optional, /* cl. 9.9.4.11 O TLV 3-253 IEI=0x27 */ + WLANOffloadAcceptability wlanOffloadInd optional /* cl. 9.9.4.18 O TLV 1 IEI=0xC @sic R5s150329 Baseline Moving sic@*/ +}; + +type record ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT { /* 24.301 cl. 8.3.4 + Significance: dual + Direction: UE to network */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + ProtocolConfigOptions protocolConfigurationOptions optional /* cl. 9.9.4.11 O TLV 3-253 IEI=0x27 */ +}; + +type record ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT { /* 24.301 cl. 8.3.5 + Significance: dual + Direction: UE to network */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + ESM_Cause esmCause, /* cl. 9.9.4.4 M V 1 */ + ProtocolConfigOptions protocolConfigurationOptions optional /* cl. 9.9.4.11 O TLV 3-253 IEI=0x27 */ +}; + +type record ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST { /* 24.301 cl. 8.3.6 + Significance: dual + Direction: network to UE */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + EPS_QualityOfService epsQos, /* cl. 9.9.4.3 M LV 2-14 */ + AccessPointName accessPointName, /* cl. 9.9.4.1 M LV 2-101 */ + PDN_Address pdnAdress, /* cl. 9.9.4.9 M LV 6-14 */ + TransactionIdentifier transactionIdentifier optional, /* cl. 9.9.4.17 O TLV 3-4 IEI=0x5d */ + QualityOfService negotiatedQos optional, /* cl. 9.9.4.12 O TLV 14-22 IEI=0x30 */ + LLC_SAPI negotiatedLlcSapi optional, /* cl. 9.9.4.7 O TV 2 IEI=0x32 */ + RadioPriority radioPriority optional, /* cl. 9.9.4.13 O TV 1 IEI=0x8- */ + PacketFlowIdentifier packetFlowIdentifier optional, /* cl. 9.9.4.8 O TLV 3 IEI=0x34 */ + APN_AMBR apnAggMaxBitRate optional, /* cl. 9.9.4.2 O TLV 4-8 IEI=0x5e */ + ESM_Cause esmCause optional, /* cl. 9.9.4.4 O TV 2 IEI=0x58 */ + ProtocolConfigOptions protocolConfigurationOptions optional, /* cl. 9.9.4.11 O TLV 3-253 IEI=0x27 */ + ConnectivityType connectivityType optional, /* cl. 9.9.2.0A O TV 1 IEI=0xB- @sic R5s120178 Baseline Moving sic@*/ + WLANOffloadAcceptability wlanOffloadInd optional /* cl. 9.9.4.18 O TV 1 IEI=0xC @sic R5s150329 Baseline Moving sic@*/ +}; + +type record BEARER_RESOURCE_ALLOCATION_REJECT { /* 24.301 cl. 8.3.7 + Significance: dual + Direction: network to UE */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + ESM_Cause esmCause, /* cl. 9.9.4.4 M V 1 */ + ProtocolConfigOptions protocolConfigurationOptions optional, /* cl. 9.9.4.11 O TLV 3-253 IEI=0x27 */ + GPRS_Timer3 backOffTimerValue optional, /* cl. 9.9.3.16B O TLV 3 IEI=0x37 @sic R5s120178, R5s150329 Baseline Moving sic@ Was T3396 Value*/ + ReAttemptIndicator reattemptInd optional /* cl. 9.9.4.13A O TLV 3 IEI=0x6B @sic R5s150329 Baseline Moving sic@*/ +}; + +type record BEARER_RESOURCE_ALLOCATION_REQUEST { /* 24.301 cl. 8.3.8 + Significance: dual + Direction: UE to network */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + SpareHalfOctet spareHalfOctet, /* cl. 9.9.2.9 M V 1/2 */ + LinkedEpsBearerIdentity linkedEpsBearerId, /* cl. 9.9.4.6 M V 1/2 */ + TrafficFlowTemplate trafficFlowAgg, /* cl. 9.9.4.15 M LV 2-256 */ + EPS_QualityOfService requiredTrafficFlowQoS, /* cl. 9.9.4.3 M LV 2-14 */ + ProtocolConfigOptions protocolConfigurationOptions optional, /* cl. 9.9.4.11 O TLV 3-253 IEI=0x27 */ + DeviceProperties deviceProperties optional /* cl. 9.9.2.0A O TV 1 IEI=0xC- @sic R5s120178 Baseline Moving sic@*/ +}; + +type record BEARER_RESOURCE_MODIFICATION_REJECT { /* 24.301 cl. 8.3.9 + Significance: dual + Direction: network to UE */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + ESM_Cause esmCause, /* cl. 9.9.4.4 M V 1 */ + ProtocolConfigOptions protocolConfigurationOptions optional, /* cl. 9.9.4.11 O TLV 3-253 IEI=0x27 */ + GPRS_Timer3 backOffTimerValue optional, /* cl. 9.9.3.16B O TLV 3 IEI=0x37 @sic R5s120178, R5s150329 Baseline Moving sic@ Was T3396 Value*/ + ReAttemptIndicator reattemptInd optional /* cl. 9.9.4.13A O TLV 3 IEI=0x6B @sic R5s150329 Baseline Moving sic@*/ +}; + +type record BEARER_RESOURCE_MODIFICATION_REQUEST { /* 24.301 cl. 8.3.10 + Significance: dual + Direction: UE to network */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + SpareHalfOctet spareHalfOctet, /* cl. 9.9.2.9 M V 1/2 */ + LinkedEpsBearerIdentity epsBearerIdentityforPacketFilter, /* cl. 9.9.4.6 M V 1/2 */ + TrafficFlowTemplate trafficFlowAgg, /* cl. 9.9.4.15 M LV 2-256 */ + EPS_QualityOfService requiredTrafficFlowQoS optional, /* cl. 9.9.4.3 O TLV 3-15 IEI=0x5b @sic R5s100692 sic@ */ + ESM_Cause esmCause optional, /* cl. 9.9.4.4 O TV 2 IEI=0x58 */ + ProtocolConfigOptions protocolConfigurationOptions optional, /* cl. 9.9.4.11 O TLV 3-253 IEI=0x27 */ + DeviceProperties deviceProperties optional /* cl. 9.9.2.0A O TV 1 IEI=0xC- @sic R5s120178 Baseline Moving sic@*/ +}; + +type record DEACTIVATE_EPS_BEARER_CONTEXT_ACCEPT { /* 24.301 cl. 8.3.11 + Significance: dual + Direction: UE to network */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + ProtocolConfigOptions protocolConfigurationOptions optional /* cl. 9.9.4.11 O TLV 3-253 IEI=0x27 */ +}; + +type record DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST { /* 24.301 cl. 8.3.12 + Significance: dual + Direction: network to UE */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + ESM_Cause esmCause, /* cl. 9.9.4.4 M V 1 */ + ProtocolConfigOptions protocolConfigurationOptions optional, /* cl. 9.9.4.8 O TLV 3-253 IEI=0x27 */ + GPRS_Timer3 t3396Value optional, /* cl. 10.5.7.4a O TLV 3 IEI=0x37 @sic R5s130195 Baseline Moving sic@*/ + WLANOffloadAcceptability wlanOffloadInd optional /* cl. 9.9.4.18 O TV 1 IEI=0xC @sic R5s150329 Baseline Moving sic@*/ +}; + +type record ESM_INFORMATION_REQUEST { /* 24.301 cl. 8.3.13 + Significance: dual + Direction: network to UE */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType /* cl. 9.8 M V 1 */ +}; + +type record ESM_INFORMATION_RESPONSE { /* 24.301 cl. 8.3.14 + Significance: dual + Direction: UE to network */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + AccessPointName accessPointName optional, /* cl. 9.9.4.1 O TLV 3-102 IEI=0x28 */ + ProtocolConfigOptions protocolConfigurationOptions optional /* cl. 9.9.4.11 O TLV 3-253 IEI=0x27 */ +}; + +type record ESM_STATUS { /* 24.301 cl. 8.3.15 + Significance: dual + Direction: both */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + ESM_Cause esmCause /* cl. 9.9.4.4 M V 1 */ +}; + +type record MODIFY_EPS_BEARER_CONTEXT_ACCEPT { /* 24.301 cl. 8.3.16 + Significance: dual + Direction: UE to network */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + ProtocolConfigOptions protocolConfigurationOptions optional /* cl. 9.9.4.11 O TLV 3-253 IEI=0x27 */ +}; + +type record MODIFY_EPS_BEARER_CONTEXT_REJECT { /* 24.301 cl. 8.3.17 + Significance: dual + Direction: UE to network */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + ESM_Cause esmCause, /* cl. 9.9.4.4 M V 1 */ + ProtocolConfigOptions protocolConfigurationOptions optional /* cl. 9.9.4.11 O TLV 3-253 IEI=0x27 */ +}; + +type record MODIFY_EPS_BEARER_CONTEXT_REQUEST { /* 24.301 cl. 8.3.18 + Significance: dual + Direction: network to UE */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + EPS_QualityOfService newEPSQos optional, /* cl. 9.9.4.3 O TLV 3-15 IEI=0x5b */ + TrafficFlowTemplate tft optional, /* cl. 9.9.4.16 O TLV 3-257 IEI=0x36 */ + QualityOfService newQos optional, /* cl. 9.9.4.12 O TLV 14-22 IEI=0x30 */ + LLC_SAPI negotiatedLlcSapi optional, /* cl. 9.9.4.7 O TV 2 IEI=0x32 */ + RadioPriority radioPriority optional, /* cl. 9.9.4.13 O TV 1 IEI=0x8- */ + PacketFlowIdentifier packetFlowIdentifier optional, /* cl. 9.9.4.5 O TLV 3 IEI=0x34 */ + APN_AMBR apnAggMaxBitRate optional, /* cl. 9.9.4.2 O TLV 4-8 IEI=0x5e */ + ProtocolConfigOptions protocolConfigurationOptions optional, /* cl. 9.9.4.11 O TLV 3-253 IEI=0x27 */ + WLANOffloadAcceptability wlanOffloadInd optional /* cl. 9.9.4.18 O TV 1 IEI=0xC @sic R5s150329 Baseline Moving sic@*/ +}; + + +type record NOTIFICATION { /* 24.301 cl. 8.3.18A + Significance: local + Direction: network to UE @sic R5s110176 Baseline Moving sic@ */ + + + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + NotificationIndicator notificationIndicator /* cl. 9.9.4.7A M LV 2 */ +}; + + +type record PDN_CONNECTIVITY_REJECT { /* 24.301 cl. 8.3.19 + Significance: dual + Direction: network to UE */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + ESM_Cause esmCause, /* cl. 9.9.4.4 M V 1 */ + ProtocolConfigOptions protocolConfigurationOptions optional, /* cl. 9.9.4.11 O TLV 3-253 IEI=0x27 */ + GPRS_Timer3 backOffTimerValue optional, /* cl. 9.9.3.16B O TLV 3 IEI=0x37 @sic R5s120178, R5s150329 Baseline Moving sic@ Was T3396 Value*/ + ReAttemptIndicator reattemptInd optional /* cl. 9.9.4.13A O TLV 3 IEI=0x6B @sic R5s150329 Baseline Moving sic@*/ +}; + +type record PDN_CONNECTIVITY_REQUEST { /* 24.301 cl. 8.3.20 + Significance: dual + Direction: UE to network */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + PDN_Type pdnType, /* cl. 9.9.4.10 M V 1/2 */ + Request_Type requestType, /* cl. 9.9.4.14 M V 1/2 */ + ESM_InfoTransferFlag esmInfoTransferFlag optional, /* cl. 9.9.4.5 O TV 1 IEI=0xD- */ + AccessPointName accessPointName optional, /* cl. 9.9.4.1 O TLV 3-102 IEI=0x28 */ + ProtocolConfigOptions protocolConfigurationOptions optional, /* cl. 9.9.4.11 O TLV 3-253 IEI=0x27 */ + DeviceProperties deviceProperties optional /* cl. 9.9.2.0A O TV 1 IEI=0xC- @sic R5s120178 Baseline Moving sic@*/ +}; + +type record PDN_DISCONNECT_REJECT { /* 24.301 cl. 8.3.21 + Significance: dual + Direction: network to UE */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + ESM_Cause esmCause, /* cl. 9.9.4.2 M V 1 */ + ProtocolConfigOptions protocolConfigurationOptions optional /* cl. 9.9.4.11 O TLV 3-253 IEI=0x27 */ +}; + +type record PDN_DISCONNECT_REQUEST { /* 24.301 cl. 8.3.22 + Significance: dual + Direction: UE to network */ + EPS_BearerIdentity epsBearerId, /* cl. 9.3.2 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* cl. 9.2 M V 1/2 */ + ProcedureTransactionIdentifier procedureTransactionIdentifier, /* cl. 9.4 M V 1 */ + MessageType messageType, /* cl. 9.8 M V 1 */ + SpareHalfOctet spareHalfOctet, /* cl. 9.9.2.9 M V 1/2 */ + LinkedEpsBearerIdentity linkedEpsBearerId, /* cl. 9.9.4.6 M V 1/2 */ + ProtocolConfigOptions protocolConfigurationOptions optional /* cl. 9.9.4.11 O TLV 3-253 IEI=0x27 */ +}; + +//---------------------------------------------------------------------------- +// Common Info Elements (24.301 cl. 9.9.2) +//---------------------------------------------------------------------------- + +type record AdditionalInformation{ /* 24.301 cl. 9.9.2.0 @sic R5s110176 Baseline Moving sic@ */ + IEI8_Type iei, + Type4Length_Type iel, + octetstring additionalInfo +}; +type record EPS_BearerContextStatus { /* 24.301 cl. 9.9.2.1 */ + IEI8_Type iei optional, /* present in case of TV or TLV; omit in case of V */ + Type4Length_Type iel optional, /* present in case of LV or TLV; omit in case of V */ + B3_Type ebi5_7, /* EBI(5)- EBI(7) */ + B5_Type spare, /* EBI(0)- EBI(4) are spare and shall be coded as zero*/ + B8_Type ebi8_15 /* EBI(8)- EBI(15)*/ +}; + +type record NAS_SecurityParametersfromEUTRA { /* 24.301 cl. 9.9.2.6 */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + B4_Type spare, /* 8-5 are spare and shall be coded as zero */ + B4_Type dl_nasCountValue /* contains the 4 least significant bits of the binary representation of the downlink NAS COUNT value applicable when + this information element is sent*/ +}; + +type record NAS_SecurityParameterstoEUTRA { /* 24.301 cl. 9.9.2.7 */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + O4_Type noncevalue, /*NonceMME value */ + B1_Type spare1, /* are spare and shall be coded as zero */ + B3_Type cipherAlgorithmType, /* type of ciphering algorithm in the NAS security algorithms information element */ + B1_Type spare2, /* are spare and shall be coded as zero */ + B3_Type integrityAlgorithmType, /* as the type of integrity protection algorithm */ + B4_Type spare3, /* are spare and shall be coded as zero*/ + B1_Type tsc, /* type of security context flag (TSC) */ + B3_Type naskeysetid /* Nas key set identifier*/ + }; + + +//---------------------------------------------------------------------------- +// EPS Mobility Management (EMM) information elements (24.301 cl. 9.9.3) +//---------------------------------------------------------------------------- + +type record AuthenticationResponseParameter { /* 24.301 cl. 9.9.3.4 */ + IEI8_Type iei optional, /* present in case of TLV; omit in case of LV */ + Type4Length_Type iel optional, /* present in case of LV or TLV; omit in case of V */ + B32_128_Type res /* 4..16 octets */ +}; + +type record CSFBResponse { // 24.301 cl. 9.9.3.5 + IEI4_Type iei, // currently only used as TV + B1_Type spare, + B3_Type csfbValue //0 = CS fallback rejected, 1 = accepted by UE +}; + +type record EMM_Cause { /* 24.301 cl. 9.9.3.9 */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + NAS_CauseValue_Type causeValue +}; + +type record Extd_EMM_Cause { /* 24.301 cl. 9.9.3.26A */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + B3_Type spare, + B1_Type eutranAllowed +}; + +type record EPS_AttachResult { /* 24.301 cl. 9.9.3.10 */ + // IEI is always skipped + B1_Type spare, + NAS_AttDetValue_Type resultValue +}; + +type record EPS_AttachType { /* 24.301 cl. 9.9.3.11 */ + // IEI is always skipped + B1_Type spare, + NAS_AttDetValue_Type typeValue +}; + +type record EPS_NetworkFeatureSupport { /* 24.301 cl 9.9.3.12A @sic R5s100135 sic@ */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + Type4Length_Type iel optional, /* present in case of LV or TLV; omit in case of V */ + B2_Type spareBits, /* @sic R5s110176 Baseline Moving sic@ */ + B1_Type esrps, /* @sic R5s120178 Baseline Moving sic@ */ + B2_Type csLCS, /* @sic R5s110176, R5s120178 Baseline Moving sic@ */ + B1_Type epcLCS, /* @sic R5s110176 Baseline Moving sic@ */ + B1_Type emcBS, /* @sic R5s110176, R5s120178 Baseline Moving sic@ */ + B1_Type imsVoPS +}; + +type record PagingIdentity { /* 24.301 cl. 9.9.93.25A @sic R5s100135 sic@ */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + B7_Type spareBits, + B1_Type pagingId +}; + +type record AdditionalUpdateResult { /* 24.301 cl. 9.9.3.0A @sic R5s100135 sic@ */ + IEI4_Type iei, // currently only used as TV + B2_Type spare2, + B2_Type addUpdateResultValue +}; + +type record EPS_UpdateResult { /* 24.301 cl. 9.9.3.13 */ + // IEI is always skipped + B1_Type spare, + NAS_AttDetValue_Type resultValue +}; + +type record EPS_UpdateType { /* 24.301 cl. 9.9.3.14 */ + // IEI is always skipped + B1_Type activeFlag, + NAS_AttDetValue_Type typeValue +}; + +type record ESM_MessageContainer { /* 24.301 cl. 9.9.3.15 */ + IEI8_Type iei optional, /* present in case of TLV; omit in case of LV */ + Type6Length_Type iel, + octetstring esmPdu /* ESM PDU without NAS security header*/ +}; + +type record KSIandSN { /* 24.301 cl. 9.9.3.19 */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + B3_Type ksi, + B5_Type sn +}; + +type record NAS_KeySetIdentifier { /* 24.301 cl. 9.9.3.21 */ + IEI4_Type iei optional, /* present in case of TV; omit in case of V */ + B1_Type tsc, // Type of security context: 0 = cached, 1 = mapped + NAS_KsiValue nasKeySetId +}; + +type record NAS_MessageContainer { // 24.301 cl. 9.9.3.22 + IEI8_Type iei optional, /* present in case of TLV; omit in case of LV */ + Type4Length_Type iel, + octetstring smsmessage length(2..251) /* can contain an SMS message (i.e. CP-DATA, CP-ACK or CP-ERROR) + as defined in subclause 7.2 in 3GPP TS 24.011 */ +}; + +type record NAS_SecurityAlgorithms { /* 24.301 cl. 9.9.3.23 */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + B1_Type spare1, + B3_Type cipheringType, /* Type of ciphering algorithm */ + B1_Type spare2, + B3_Type integrityType /* Type of integrity protection algorithm */ +}; + +type record Nonce { /* 24.301 cl. 9.9.3.25 */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + O4_Type nonceValue +}; + +type record EPS_ServiceType { // 24.301 cl. 9.9.3.27 + IEI4_Type iei optional, /* present in case of TV; omit in case of V */ + EPS_ServiceTypeValue serviceValue +}; + +type record ShortMAC { /* 24.301 cl. 9.9.3.28 */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + B16_Type macValue +}; + +type record UERadioCapInfoUpdateNeeded { // 24.301 cl. 9.9.3.35 + IEI4_Type iei optional, /* present in case of TV; omit in case of V */ + B3_Type spare, + B1_Type urcUpdate +}; + +type record UE_SecurityCapability { /* 24.301 cl. 9.9.3.36 */ + Type4Length_Type iel, // @sic R5s10035 iei never used, so removed sic@ + O1_Type eeaCap, // @sic R5s100135 sic@ + O1_Type eiaCap, // @sic R5s100135 sic@ + O1_Type ueaCap optional, // @sic R5s100135 sic@ + O1_Type uiaCap optional, // @sic R5s100135 sic@ + O1_Type geaCap optional // @sic R5s100135 sic@ +}; + +type record CLI { /* 24.301 cl. 9.9.3.38 */ + IEI8_Type iei optional, /* present in case of TLV; omit in case of LV */ + Type4Length_Type iel, + octetstring cliValue length(1..12) /* The coding of the CLI value part is the same as for octets 3 to + 14 of the Calling party BCD number information element defined + in subclause 10.5.4.9 of 3GPP TS 24.008 */ +}; + +type record SsCode { /* 24.301 cl. 9.9.3.39 */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + O1_Type ssCodeValue /*The coding of the SS Code value is given in subclause 17.7.5 of 3GPP TS 29.002 */ +}; + +type record LcsIndicator { /* 24.301 cl. 9.9.3.40 */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + O1_Type lcsIndicator +}; + +type record LcsClientIdentity { /* 24.301 cl. 9.9.3.41 */ + IEI8_Type iei optional, /* present in case of TLV; omit in case of LV */ + Type4Length_Type iel, + octetstring lcsClientIdentityValue length(1..255) /* The coding of the value part of the LCS client + identity is given in subclause 17.7.13 of 3GPP TS 29.002 */ +}; + +type B8_Type GenericMessageContainerType; /* 24.301 cl. 9.9.3.42 M V 1 @sic R5s110176 Baseline Moving sic@ */ + +type record GenericMessageContainer{ /* 24.301 cl. 9.9.3.43 M LV-E 3-n @sic R5s110176 Baseline Moving sic@*/ + IEI8_Type iei optional, + Type6Length_Type iel, + octetstring genericMsgContainerValue +}; + +type record GUTI_Type{ /* 24.301 cl. 9.9.3.45 @sic R5s110178 Baseline Moving sic@*/ + IEI4_Type iei, + B3_Type spare, + B1_Type gutiType +}; + +//---------------------------------------------------------------------------- +// EPS Session Management (ESM) information elements (24.301 cl. 9.9.4) +//---------------------------------------------------------------------------- + +type record APN_AMBR { // 24.301 cl. 9.9.4.2 + IEI8_Type iei optional, /* present in case of TLV; omit in case of LV */ + Type4Length_Type iel optional, /* present in case of LV or TLV; omit in case of V */ + B8_Type downlink, + B8_Type uplink, + B8_Type downlinkExt optional, + B8_Type uplinkExt optional, + B8_Type downlinkExt2 optional, + B8_Type uplinkExt2 optional +}; + +type record EPS_QualityOfService { /* 24.301 cl. 9.9.4.3 */ + IEI8_Type iei optional, + Type4Length_Type iel, + B8_Type qci, + B8_Type maxBitRateUl optional, + B8_Type maxBitRateDl optional, + B8_Type guaranteedBitRateUl optional, + B8_Type guaranteedBitRateDl optional, + B8_Type maxBitRateUlExt optional, + B8_Type maxBitRateDlExt optional, + B8_Type guaranteedBitRateUlExt optional, + B8_Type guaranteedBitRateDlExt optional, + B8_Type maxBitRateDL_Ext2 optional, // @sic R5s1300195 Baseline Moving sic@ + B8_Type guaranteedBitRateDL_Ext2 optional, // @sic R5s1300195 Baseline Moving sic@ + B8_Type maxBitRateUL_Ext2 optional, // @sic R5s1300195 Baseline Moving sic@ + B8_Type guaranteedBitRateUL_Ext2 optional // @sic R5s1300195 Baseline Moving sic@ +}; + +type record ESM_Cause { /* 24.301 cl. 9.9.4.4 */ + IEI8_Type iei optional, /* present in case of TLV; omit in case of LV */ + NAS_CauseValue_Type causeValue +}; + +type record ESM_InfoTransferFlag { /* 24.301 cl. 9.9.4.5 */ + IEI4_Type iei optional, + B3_Type spare, + B1_Type eitValue +}; + +type record LinkedEpsBearerIdentity { /* 24.301 cl. 9.9.4.6 */ + // IEI is always skipped + B4_Type idValue +}; + +type record NotificationIndicator{ /* 24.301 cl. 9.9.4.7A @sic R5s110176 Baseline Moving sic@ */ + IEI8_Type iei optional, + Type4Length_Type iel, + B8_Type notificationInd +}; + +type record PDN_Type { /* 24.301 cl. 9.9.4.10 */ + // IEI is always skipped + B1_Type spare, + PdnTypeValue typeValue +}; + +type record TransactionIdentifier { /* 24.301 cl. 9.9.4.17 */ + IEI8_Type iei optional, + Type4Length_Type iel, + B1_Type tiFlag, + B3_Type tiValue, + B4_Type spare, + B1_Type ext optional, // @sic R5s110176 sic@ + B7_Type tiValue_2 optional // @sic R5s110176 sic@ +}; + + type O8_Type EllipsoidPointWithAltitude_Type; + type O3_Type HorizontalVelocity_Type; + type O3_Type Gnss_TOD_msec_Type; + + // ============================================================================= + // Update UE Location Information + // 3G TS 36.509 cl. 6.12 + // Direction: SS to UE + // ----------------------------------------------------------------------------- + type record UPDATE_UE_LOCATION_INFORMATION { + SkipIndicator skipIndicator, /* M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* M V 1/2 */ + MessageType messageType, /* M V 1 */ + EllipsoidPointWithAltitude_Type ellipsoidPointWithAltitude, /* M V 8 */ + HorizontalVelocity_Type horizontalVelocity, /* M V 3 */ + Gnss_TOD_msec_Type gnss_TOD_msec /* M V 3 */ + }; + +} with { encode "NAS Types"} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_34229_SelectionExpressions.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_34229_SelectionExpressions.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f2f891712319b2f58d172191d71af2f9c1122071 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_34229_SelectionExpressions.ttcn @@ -0,0 +1,305 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-15 19:05:27 +0200 (Tue, 15 Sep 2015) $ +// $Rev: 14431 $ +/******************************************************************************/ + +module IMS_34229_SelectionExpressions { + + import from IMS_CommonParameters all; + import from IMS_CC_Parameters all; + // import from UTRAN_Parameters all; + import from Parameters all; + + type enumerated Condition_Type { + IMS34_R, + IMS34_C04, + IMS34_C05, + IMS34_C06, + IMS34_C07, + IMS34_C08, + IMS34_C09, + IMS34_C10, + IMS34_C17, + IMS34_C18, + IMS34_C19, + IMS34_C22, + IMS34_C23, + IMS34_C24, + IMS34_C26, + IMS34_C27, + IMS34_C28, + IMS34_C30, + IMS34_C31, + IMS34_C32, + IMS34_C37, + IMS34_C43, + IMS34_C44, + IMS34_C45, + IMS34_C48, + IMS34_C49, + IMS34_C50, + IMS34_C55, + IMS34_C56, + IMS34_C57, + IMS34_C58, + IMS34_C59, + IMS34_C61, + IMS34_C62, + // IMS34_C63 void + IMS34_C64, + IMS34_C65, + IMS34_C66, + IMS34_C68, + IMS34_C69, + IMS34_C70, + IMS34_C71, + IMS34_C72, + IMS34_C73, + IMS34_C74, + IMS34_C75, + IMS34_C76, + IMS34_C77, + IMS34_C78, + IMS34_C79, + IMS34_C80, //@sic R5s145157 sic@ + IMS34_C81, + IMS34_C82, //@sic R5-151964 sic@ + IMS34_C83, + IMS34_Cxx_R5153996 //@sic R5-153996 sic@ + }; + + function f_SelectionExpr ( Condition_Type p_Condition) return boolean + { + /* Set the applicability conditions according to 34.229-2 clause 4 table "Conditions/Options" */ + + var boolean v_ApplCond; + + select (p_Condition) { + case (IMS34_R) { + v_ApplCond := true; + } + case (IMS34_C04) { + // Dedicated PDP Context + v_ApplCond := pc_InitiatesDedicatedPDPContext; + } + case (IMS34_C05) { + // P-CSCF Discovery via PCO + v_ApplCond := pc_P_CSCFDiscovery_viaPCO; + } + case (IMS34_C06) { + // IPv4 AND configured to initiate P-CSCF discovery via DHCPv4 + v_ApplCond := pc_IPv4 and pc_InitiateP_CSCFDiscovery_viaDHCPv4; + } + case (IMS34_C07) { + // IPv4 AND P-CSCF discovery via PCO AND P-CSCF discovery via DHCPv4 AND configured to initiate P-CSCF discovery via PCO + v_ApplCond := pc_IPv4 and pc_P_CSCFDiscovery_viaPCO and pc_P_CSCFDiscovery_viaDHCPv4 and pc_InitiateP_CSCFDiscovery_viaPCO; + } + case (IMS34_C08) { + // Configured to initiate P-CSCF discovery via DHCPv6 + v_ApplCond := pc_InitiateP_CSCFDiscovery_viaDHCPv6; + } + case (IMS34_C09) { + // P-CSCF Discovery via PCO AND P-CSCF discovery via DHCPv6 AND configured to initiate P-CSCF discovery via PCO + v_ApplCond := pc_P_CSCFDiscovery_viaPCO and pc_P_CSCFDiscovery_viaDHCPv6 and pc_InitiateP_CSCFDiscovery_viaPCO; + } + case (IMS34_C10) { + //P-CSCF Discovery via PCO AND P-CSCF discovery via DHCPv6 AND configured to initiate P-CSCF discovery via DHCPv6 + v_ApplCond := pc_P_CSCFDiscovery_viaPCO and pc_P_CSCFDiscovery_viaDHCPv6 and pc_InitiateP_CSCFDiscovery_viaDHCPv6; + } + case (IMS34_C17) { + // IMS security + v_ApplCond := pc_IMS_Sec; + } + case (IMS34_C18) { + // GIBA AND NOT IMS security + v_ApplCond := pc_IMS_GIBA_Sec and not(pc_IMS_Sec); + } + case (IMS34_C19) { + // IMS security AND GIBA + v_ApplCond := pc_IMS_Sec and pc_IMS_GIBA_Sec; + } + case (IMS34_C22) { + // MTSI and speech + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_Speech; + } + case (IMS34_C23) { + // MTSI and speech and Communication Hold + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_Speech and pc_MTSI_CommHold ; + } + case (IMS34_C24) { + // MTSI and Incoming Communication Barring @sic R5-153996 sic@ + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_Incoming_CB; //@sic R5-153996 sic@ + } + case (IMS34_C26) { + // MTSI AND Initiating session AND preconditions AND MTSI text, RTP + v_ApplCond := pc_MultimediaTelephonyService and pc_InitiateSession and pc_Preconditions and pc_MTSI_Text_RTP; + } + case (IMS34_C27) { + // MTSI AND Initiating session AND MTSI speech + v_ApplCond := pc_MultimediaTelephonyService and pc_InitiateSession and pc_MTSI_Speech; + } + case (IMS34_C28) { + // MTSI AND Initiating session AND MTSI speech AND MTSI speech, AMR wideband + v_ApplCond := pc_MultimediaTelephonyService and pc_InitiateSession and pc_MTSI_Speech and pc_MTSI_Speech_AMRWB; + } + case (IMS34_C30) { + // MTSI and Communication Diversion + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_CommDivert; + } + case (IMS34_C31) { + // MTSI and speech and Communication Diversion + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_CommDivert and pc_MTSI_Speech; + } + case (IMS34_C32) { + // MTSI and Conference + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_Conference; + } + case (IMS34_C37) { + //MTSI AND Initiating session AND MTSI text, RTP + v_ApplCond := pc_MultimediaTelephonyService and pc_InitiateSession and pc_MTSI_Text_RTP; + } + case (IMS34_C43) { + //UE supporting MTSI and Originating Identification Presentation + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_OIP; + } + case (IMS34_C44) { + // UE supporting MTSI and Originating Identification Restriction + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_OIR; + } + case (IMS34_C45) { + //MTSI and Communication Barring and Anonymous Communication Rejection + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_Incoming_CB and pc_MTSI_ACR; //@sic R5-153996 sic@ + } + case (IMS34_C48) { + // MTSI and Terminating Identification Presentation + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_TIP; + } + case (IMS34_C49) { + //MTSI and Terminating Identification Restriction + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_TIR; + } + case (IMS34_C50) { + // MTSI and Message Waiting Indication + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_MessageWait; + } + case (IMS34_C55) { + // SM-over-IP sender + v_ApplCond := pc_SMS_MO; + } + case (IMS34_C56) { + // SM-over-IP receiver + v_ApplCond := pc_SMS_MT; + } + case (IMS34_C57) { + //MTSI AND communication waiting + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_CommWaiting; + } + case (IMS34_C58) { + // IMS security AND Indicate Sigcomp + v_ApplCond := pc_IMS_Sec and pc_IndicateSigcomp; + } + case (IMS34_C59) { + // IMS emergency services + v_ApplCond := pc_IMS_EmergencyCall; + } + case (IMS34_C61) { + //UE supporting MTSI and Conference and three way session + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_Conference and pc_IMS_TWS; + } + case (IMS34_C62) { + //IMS emergency services and emergency speech call and UTRAN or GERAN + v_ApplCond := pc_IMS_EmergencyCall and pc_EmergSpeech and (pc_UTRA or pc_GERAN); + } + case (IMS34_C64) { + //IMS emergency services and EUTRA FDD or EUTRA TDD + v_ApplCond := pc_IMS_EmergencyCall and (pc_eFDD or pc_eTDD); + } + case (IMS34_C65) { + // IMS emergency services and UTRA and PS domain + v_ApplCond := pc_IMS_EmergencyCall and pc_GERAN and pc_PS; + } + case (IMS34_C66) { + //Speech and IMS emergency call and emergency call over GERAN or UTRAN + v_ApplCond := pc_BidirecVoiceOverIMS and pc_MTSI_Speech and (pc_EmergSpeech and (pc_UTRA or pc_GERAN)); + } + case (IMS34_C68) { + //MTSI AND Initiating session AND MTSI speech AND E-UTRA + v_ApplCond := pc_MultimediaTelephonyService and pc_InitiateSession and pc_MTSI_Speech and (pc_eFDD or pc_eTDD); + } + case (IMS34_C69) { + //MTSI AND Initiating session AND MTSI speech AND MTSI video AND E-UTRA + v_ApplCond := pc_MultimediaTelephonyService and pc_InitiateSession and pc_MTSI_Speech and pc_MTSI_Video and (pc_eFDD or pc_eTDD) ; + } + case (IMS34_C70) { + //MTSI AND MTSI speech AND MTSI video AND MTSI Video H.264 CBP Level 1.2 + v_ApplCond := pc_MultimediaTelephonyService and pc_InitiateSession and pc_MTSI_Video and pc_VideoCodecH264CBP; + } + case (IMS34_C71) { + //MTSI AND Initiating session AND MTSI speech AND MTSI video AND MTSI Video H.264 CBP Level 1.2 + v_ApplCond := pc_MultimediaTelephonyService and pc_InitiateSession and pc_MTSI_Speech and pc_MTSI_Video and pc_VideoCodecH264CBP; + } + case (IMS34_C72) { + //IMS emergency services and MTSI and speech and Communication Hold during emergency call. + v_ApplCond := pc_IMS_EmergencyCall and pc_MultimediaTelephonyService and pc_MTSI_Speech and pc_CommunicationHold_DuringEmergencyCall; + } + case (IMS34_C73) { + //UE supports IMS emergency services and MTSI and speech + v_ApplCond := pc_IMS_EmergencyCall and pc_MultimediaTelephonyService and pc_MTSI_Speech; //@sic R5133708 R5-151518 sic@ + } + case (IMS34_C74) { + // UE supporting IMS emergency services and Emergency speech call over 1XRTT (NOTE 2) + v_ApplCond := pc_IMS_EmergencyCall and pc_EmergSpeech and pc_1xRTT; + } + case (IMS34_C75) { + // Speech and IMS emergency call and emergency call over 1XRTT (NOTE 2) + v_ApplCond := pc_BidirecVoiceOverIMS and pc_Speech and (pc_EmergSpeech and pc_1xRTT); + } + case (IMS34_C76) { + // IMS emergency services and capable of obtaining location Information + v_ApplCond := pc_IMS_EmergencyCall and pc_IMS_Geolocation; + } + case (IMS34_C77) { + // UE supporting MTSI and MTSI speech and MTSI video H.264 CBP Level 1.2 and Communication Hold + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_Speech and pc_MTSI_Video and pc_VideoCodecH264CBP and pc_MTSI_CommHold; + } + case (IMS34_C78) { + // UE supporting MTSI and MTSI speech and MTSI video H.264 CBP Level 1.2 and Conference + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_Speech and pc_MTSI_Video and pc_VideoCodecH264CBP and pc_MTSI_Conference; + } + case (IMS34_C79) { + // UE supporting MTSI and MTSI speech and MTSI video H.264 CBP Level 1.2 and Conference + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_Speech and pc_MTSI_Video and pc_VideoCodecH264CBP and pc_MTSI_Conference and pc_IMS_TWS; + } + case (IMS34_C80) { //@sic R5s145157 sic@ + //IMS security and UE supporting IMS deregistration + v_ApplCond := pc_IMS_Sec and pc_IMS_Deregistration; + } + case (IMS34_C81) { + //MTSI and Originating Identification Presentation and GBA for XCAP authentication + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_OIP and pc_HttpGBAAuthentication; //@sic R5-151962 sic@ + } + case(IMS34_C82) { //@sic R5-151964 sic@ + // MTSI and speech and early media + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_Speech and pc_EarlyMedia; + } + case(IMS34_C83){ + //MTSI and MTSI speech EVS. @sic R5-151970 sic@ + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_Speech_EVS; + } + case(IMS34_Cxx_R5153996) { + //MTSI and Outgoing Communication Barring + v_ApplCond := pc_MultimediaTelephonyService and pc_MTSI_Outgoing_CB; + } + case else { + v_ApplCond := false; + } + } + return v_ApplCond; + } +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_ASP_Templates.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_ASP_Templates.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f951e73f17e60c9a6ecbe454ad6cc34ce62d9ac5 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_ASP_Templates.ttcn @@ -0,0 +1,248 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-08-02 11:28:08 +0200 (Sun, 02 Aug 2015) $ +// $Rev: 14043 $ +/******************************************************************************/ + +module IMS_ASP_Templates { + import from LibSip_SIPTypesAndValues all; + import from IP_ASP_TypeDefs all; + import from IMS_ASP_TypeDefs all; + + //**************************************************************************** + // ASPs to send/receive IMS messages + //---------------------------------------------------------------------------- + + template (value) IMS_RoutingInfo_Type cs_IMS_RoutingInfo(InternetProtocol_Type p_Protocol, + template (omit) IMS_SecurityContextEnum_Type p_SecurityContextEnum := omit, + template (omit) IP_AddrInfo_Type p_UE_Address := omit, + template (omit) IP_AddrInfo_Type p_NW_Address := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + Protocol := p_Protocol, + Security := p_SecurityContextEnum, + UE_Address := p_UE_Address, + NW_Address := p_NW_Address + }; + + template (present) IMS_RoutingInfo_Type cr_IMS_RoutingInfo(template (present) InternetProtocol_Type p_Protocol := ?, + template IMS_SecurityContextEnum_Type p_SecurityContextEnum := *) := // @sic R5s130133 additional change 1; R5s130187 sic@ + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + Protocol := p_Protocol, + Security := p_SecurityContextEnum, + UE_Address := *, // @sic R5s120907 change 1 sic@ + NW_Address := * // @sic R5s120907 change 1 sic@ + }; + + //---------------------------------------------------------------------------- + + template (present) IMS_DATA_REQ cr_IMS_DATA_REQ_Any(template (present) IMS_RoutingInfo_Type p_RoutingInfo := ?, + template (present) IMS_Request_Type p_IMS_Request := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + /* @sic @sic R5s140710 - MCC160 Implementation sic@ */ + RoutingInfo := p_RoutingInfo, + Request := p_IMS_Request + }; + + template (present) IMS_DATA_REQ car_IMS_Register_Request(template (present) REGISTER_Request p_RegisterRequest) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + RoutingInfo := cr_IMS_RoutingInfo, + Request := { + Register := p_RegisterRequest + } + }; + + template (present) IMS_DATA_RSP cr_IMS_DATA_RSP_Any := ?; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + + template (present) IMS_DATA_REQ car_IMS_Subscribe_Request(template (present) SUBSCRIBE_Request p_SubscribeRequest) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + RoutingInfo := cr_IMS_RoutingInfo, + Request := { + Subscribe := p_SubscribeRequest + } + }; + + template (value) IMS_DATA_REQ cas_IMS_Notify_Request(template (value) IMS_RoutingInfo_Type p_RoutingInfo, + template (value) NOTIFY_Request p_NotifyRequest) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + RoutingInfo := p_RoutingInfo, + Request := { + Notify := p_NotifyRequest + } + }; + + template (present) IMS_DATA_REQ car_IMS_Notify_Request(template (present) NOTIFY_Request p_NotifyRequest) := + { + RoutingInfo := cr_IMS_RoutingInfo, + Request := { + Notify := p_NotifyRequest + } + }; + + //---------------------------------------------------------------------------- + + template (value) IMS_DATA_REQ cas_IMS_DATA_REQ(template (value) IMS_RoutingInfo_Type p_RoutingInfo, + template (value) IMS_Request_Type p_Request) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + RoutingInfo := p_RoutingInfo, + Request := p_Request + }; + + template (value) IMS_DATA_RSP cas_IMS_DATA_RSP(template (value) IMS_RoutingInfo_Type p_RoutingInfo, + template (value) IMS_Response_Type p_Response) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + RoutingInfo := p_RoutingInfo, + Response := p_Response + }; + + template (present) IMS_DATA_RSP car_IMS_DATA_RSP(template (present) IMS_RoutingInfo_Type p_RoutingInfo, + template (present) IMS_Response_Type p_Response) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + RoutingInfo := p_RoutingInfo, + Response := p_Response + }; + + //---------------------------------------------------------------------------- + + template (present) IMS_DATA_REQ car_IMS_Ack_Request(template (present) ACK_Request p_AckRequest) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + RoutingInfo := cr_IMS_RoutingInfo, + Request := { + Ack := p_AckRequest + } + }; + + template (present) IMS_DATA_REQ car_IMS_Prack_Request(template (present) PRACK_Request p_PrackRequest) := + { /* @status APPROVED (IMS, LTE, LTE_A) */ + RoutingInfo := cr_IMS_RoutingInfo, + Request := { + Prack := p_PrackRequest + } + }; + + template (present) IMS_DATA_REQ car_IMS_Refer_Request(template (present) REFER_Request p_ReferRequest) := + { /* @status APPROVED (IMS) */ + RoutingInfo := cr_IMS_RoutingInfo, + Request := { + Refer := p_ReferRequest + } + }; + + template (value) IMS_DATA_REQ cas_IMS_Prack_Request(template (value) IMS_RoutingInfo_Type p_RoutingInfo, + template (value) PRACK_Request p_PrackRequest) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + RoutingInfo := p_RoutingInfo, + Request := { + Prack := p_PrackRequest + } + }; + + template (value) IMS_DATA_REQ cas_IMS_Ack_Request(template (value) IMS_RoutingInfo_Type p_RoutingInfo, + template (value) ACK_Request p_AckRequest) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + RoutingInfo := p_RoutingInfo, + Request := { + Ack := p_AckRequest + } + }; + + template (present) IMS_DATA_REQ car_IMS_Update_Request(template (present) UPDATE_Request p_UpdateRequest := ?) := + { /* @status APPROVED (IMS, LTE, LTE_A) */ + RoutingInfo := cr_IMS_RoutingInfo, + Request := { + Update := p_UpdateRequest + } + }; + + template (value) IMS_DATA_REQ cas_IMS_Update_Request(template (value) IMS_RoutingInfo_Type p_RoutingInfo, + template (value) UPDATE_Request p_UpdateRequest) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + RoutingInfo := p_RoutingInfo, + Request := { + Update := p_UpdateRequest + } + }; + + + template (value) IMS_DATA_REQ cas_IMS_Cancel_Request(template (value) IMS_RoutingInfo_Type p_RoutingInfo, + template (value) CANCEL_Request p_CancelRequest ) := + { /* @status APPROVED (IMS, LTE_A) */ + RoutingInfo := p_RoutingInfo, + Request := { + Cancel := p_CancelRequest + } + }; + + template (present) IMS_DATA_REQ car_IMS_Invite_Request(template (present) INVITE_Request p_InviteRequest := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + RoutingInfo := cr_IMS_RoutingInfo, + Request := { + Invite := p_InviteRequest + } + }; + + template (value) IMS_DATA_REQ cas_IMS_Invite_Request(template (value) IMS_RoutingInfo_Type p_RoutingInfo, + template (value) INVITE_Request p_InviteRequest ) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + RoutingInfo := p_RoutingInfo, + Request := { + Invite := p_InviteRequest + } + }; + + template (present) IMS_DATA_REQ car_IMS_Bye_Request(template (present) BYE_Request p_ByeRequest := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) */ + RoutingInfo := cr_IMS_RoutingInfo, + Request := { + Bye := p_ByeRequest + } + }; + + template (value) IMS_DATA_REQ cas_IMS_BYE_Request(template (value) IMS_RoutingInfo_Type p_RoutingInfo, + template (value) BYE_Request p_ByeRequest ) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + RoutingInfo := p_RoutingInfo, + Request := { + Bye := p_ByeRequest + } + }; + + template (present) IMS_DATA_REQ car_IMS_Publish_Request(template (present) PUBLISH_Request p_PublishRequest := ?) := + { + RoutingInfo := cr_IMS_RoutingInfo, + Request := { + Publish := p_PublishRequest + } + }; + + template (present) IMS_DATA_REQ car_IMS_Message_Request(template (present) MESSAGE_Request p_MessageRequest := ?) := + { /* @status APPROVED (IMS, LTE_A) */ + RoutingInfo := cr_IMS_RoutingInfo, + Request := { + Message := p_MessageRequest + } + }; + + template (value) IMS_DATA_REQ cas_IMS_Message_Request(template (value) IMS_RoutingInfo_Type p_RoutingInfo, + template (value) MESSAGE_Request p_MessageRequest ) := + { /* @status APPROVED (IMS, LTE_A) */ + RoutingInfo := p_RoutingInfo, + Request := { + Message := p_MessageRequest + } + }; + + template (value) IMS_DATA_REQ cas_IMS_Refer_Request(template (value) IMS_RoutingInfo_Type p_RoutingInfo, + template (value) REFER_Request p_ReferRequest ) := + { + RoutingInfo := p_RoutingInfo, + Request := { + Refer := p_ReferRequest + } + }; + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_ASP_TypeDefs.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_ASP_TypeDefs.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7b9699bf5a9637df8811923e7dc18006f954fedb --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_ASP_TypeDefs.ttcn @@ -0,0 +1,138 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-06-26 20:08:06 +0200 (Fri, 26 Jun 2015) $ +// $Rev: 13970 $ +/******************************************************************************/ + +module IMS_ASP_TypeDefs { + import from CommonDefs all; + import from LibSip_SIPTypesAndValues all; + import from IP_ASP_TypeDefs all; + + //**************************************************************************** + // Data ASPs + //**************************************************************************** + + type enumerated IMS_SecurityContextEnum_Type {unprotected, protectedContext1, protectedContext2}; /* @sic R5-145732: support of second security context sic@ */ + + type record IMS_RoutingInfo_Type { + InternetProtocol_Type Protocol, // UDP or TCP + IMS_SecurityContextEnum_Type Security optional, // protected or unprotected (in DL omit when IP PTC shall decide what to do) + IP_AddrInfo_Type UE_Address optional, // sent by the IP PTC when there is an initial request on unprotected connection + IP_AddrInfo_Type NW_Address optional // sent by the IP PTC when there is an initial request on unprotected connection + }; + + type RequestUnion IMS_Request_Type with { encode "SIPCodec"}; // Alias for "RequestUnion" as defined in LibSip_SIPTypesAndValues + type Response IMS_Response_Type with { encode "SIPCodec"}; // Alias for "Response" as defined in LibSip_SIPTypesAndValues + + type record IMS_DATA_REQ { + IMS_RoutingInfo_Type RoutingInfo, + IMS_Request_Type Request + }; + + type record IMS_DATA_RSP { + IMS_RoutingInfo_Type RoutingInfo, + IMS_Response_Type Response + }; + + //**************************************************************************** + // Configuration ASPs and common definitions + //**************************************************************************** + + type record IMS_UnprotectedPorts_Type { + PortNumber_Type Port_us, // UE side: 5060 per default; may be set to other value by initial request (REGISTER) by the UE + PortNumber_Type Port_ps // network side: 5060 (without choice) + }; + + type record IMS_ProtectedPorts_Type { + PortNumber_Type Port_us, // UE side: Server + PortNumber_Type Port_uc, // UE side: Client + PortNumber_Type Port_ps, // network side: Server + PortNumber_Type Port_pc // network side: Client + }; + + type record IMS_SPIs_Type { + IPsec_SPI_Type SPI_us, // SPI at UE side: assigned by the UE + IPsec_SPI_Type SPI_uc, // SPI at UE side: assigned by the UE + IPsec_SPI_Type SPI_ps optional, // SPI at network side: to be assigned by TTCN + IPsec_SPI_Type SPI_pc optional // SPI at network side: to be assigned by TTCN + }; + + type record IMS_SecurityInfo_Type { + IMS_ProtectedPorts_Type ProtectedPorts, + IMS_SPIs_Type SPIs, + IPsec_IntegrityAlgorithm_Type IntegrityAlgorithm, + IPsec_CipheringAlgorithm_Type CipheringAlgorithm + }; + + type record IMS_RegistrationInfo_Type { + IP_AddrInfo_Type NW_Address, // network address of the chosen IMS server (e.g. IPv4, IPv6) + IP_AddrInfo_Type UE_Address, // UE address as used for security protected connections + IMS_SecurityInfo_Type SecurityInfo optional // omit in case of GIBA + }; + + type record IMS_PortsAndSecurityConfigReq_Type { + PortNumber_Type UnprotectedPort_us optional, // 5060 per default + IMS_RegistrationInfo_Type RegistrationInfo optional /* @sic R5s150268 change 3: optional sic@ */ + }; + + type Null_Type IMS_PortsAndSecurityConfigCnf_Type; /* @sic R5s130266 change 1.3, 4, 5 - MCC160 Implementation: sic@ + SPIs and protected ports are fully controlled by the IMS PTC + => it is not necessary anymore to return IMS_ProtectedPorts_Type, IMS_SPIs_Type to the IMS PTC */ + + type union IMS_CONFIG_REQ { + IPsec_SecurityKeys_Type InstallKey, + IMS_PortsAndSecurityConfigReq_Type PortsAndSecurityConfig, + Null_Type SecurityRelease, + Null_Type RegInfoRelease, /* @sic R5s140123 change 9 sic@ */ + Null_Type CloseTCP /* @sic R5s130988 change 1 - MCC160 implementation sic@ */ + }; + + type union IMS_CONFIG_CNF { + Null_Type InstallKey, + IMS_PortsAndSecurityConfigCnf_Type PortsAndSecurityConfig, + Null_Type SecurityRelease, + Null_Type RegInfoRelease, /* @sic R5s140123 change 9 sic@ */ + Null_Type CloseTCP /* @sic R5s130988 change 1 - MCC160 implementation sic@ */ + }; + + //**************************************************************************** + // Port definitions + //**************************************************************************** + + type port IMS_IP_CTRL_PORT message { // Control port at the IMS PTC to configure IP for IMS + out IMS_CONFIG_REQ; + in IMS_CONFIG_CNF; + }; + + type port IP_IMS_CTRL_PORT message { // Control port at the IP PTC to get configuration from IMS + out IMS_CONFIG_CNF; + in IMS_CONFIG_REQ; + }; + + type port IMS_IP_CLIENT_PORT message { // IMS client: send requests, receive response + out IMS_DATA_REQ; + in IMS_DATA_RSP; + }; + + type port IP_IMS_CLIENT_PORT message { // counter part for the IMS client at the IP PTC: receive requests, send response + out IMS_DATA_RSP; + in IMS_DATA_REQ; + }; + + type port IMS_IP_SERVER_PORT message { // IMS server: send response, receive requests + out IMS_DATA_RSP; + in IMS_DATA_REQ; + }; + + type port IP_IMS_SERVER_PORT message { // counter part for the IMS server at the IP PTC: receive response, send requests + out IMS_DATA_REQ; + in IMS_DATA_RSP; + }; + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_CommonDefs.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_CommonDefs.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d4f0617b7d62ed1d9a89c4a277ede0122af65e53 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_CommonDefs.ttcn @@ -0,0 +1,239 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-15 21:39:48 +0200 (Tue, 15 Sep 2015) $ +// $Rev: 14432 $ +/******************************************************************************/ + +module IMS_CommonDefs { + import from CommonDefs all; + import from Parameters all; + + type enumerated IMS_SecurityScheme_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + GIBA, /* 34.229-2 Table A.6a Item 1 */ + IMS_Security /* 34.229-2 Table A.6a Item 2 */ + }; + + type enumerated IMS_Emergency_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + NO_EMERGENCY, /* No IMS emergency call */ + REGULAR_EMERGENCY, /* Regular IMS emergency call (normal or limited service) */ + ASSERTED_EMERGENCY /* Asserted emergency call (Non-UE detectable emergency call) */ + }; + + type enumerated IMS_CallHoldResume_Type {HOLD, RESUME}; /* @status APPROVED (IMS) */ + + const B128_Type tsc_IMS_AuthRAND := px_eAuthRAND; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + const integer tsc_IMS_Port_ps_NoSec := 5060; + const integer tsc_IMS_Port_pc := 5061; /* client port at NW side for security protected IMS signalling + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + const integer tsc_IMS_Port_ps := 5062; /* server port at NW side for security protected IMS signalling + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + const integer tsc_IMS_Port_pc_2 := 5063; /* "new" client port at NW side for security protected IMS signalling: for re-authentication a new client port is needed + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + const integer tsc_IMS_MediaPort_M1 := 60350; /* RTP port Speech @sic R5s130495 Change 19 sic@ + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + const integer tsc_IMS_MediaPort_M2 := 60352; /* RTP port Video @sic R5s130495 Change 19 sic@ + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + const integer tsc_IMS_MediaPort_M3 := 60354; /* RTP port Text @sic R5s130495 Change 19 sic@ + * @status APPROVED (IMS, LTE, LTE_A) */ + const charstring tsc_IMS_Scscf := "scscf@3gpp.org"; + const charstring tsc_IMS_Opaque := "5ccc069c403ebaf9f0171e9517f40e41"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + const charstring tsc_IMS_RegisterExpiration := "600"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + @sic R5-153254: 600 -> 600000 sic@ */ + + const charstring tsc_IMS_FeatureParamId_3gpp_icsi_ref := "+g.3gpp.icsi-ref"; /* @sic R5s120530 change 3.6 sic@ + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + + const charstring tsc_IMS_FeatureParamValue_3gpp_icsi_ref := "urn:urn-7:3gpp-service.ims.icsi.mmtel"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + template (value) charstring cs_IMS_EncodedFeatureParamValue_3gpp_icsi_ref := f_URL_Encoding(tsc_IMS_FeatureParamValue_3gpp_icsi_ref); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + @sic R5-142247 URL encoding sic@ */ + + const charstring tsc_IMS_FeatureCap_SrvccAlerting := "+g.3gpp.srvcc-alerting"; /* @sic R5-142287 change 1, 2 sic@ + @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + const charstring tsc_IMS_FeatureCap_SrvccPreAlerting := "+g.3gpp.ps2cs-srvcc-orig-pre-alerting"; /* @sic R5s140962 sic@ + @status APPROVED (IMS, LTE, LTE_A) */ + + const charstring tsc_IMS_PubGRUU_UriParameterValue := "urn%3Auuid%3Af81d4fae-7dec-11d0-a765-00a0c91e6bf6"; /* arbitrary value @sic R5s150721 sic@ + @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + const integer tsc_IMS_RSeqNumFor183 := 121; /* @status APPROVED (IMS, IMS_IRAT, LTE_A, LTE, LTE_IRAT) */ + const charstring tsc_IMS_Emergency_TelUri := "tel:112"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + const charstring tsc_IMS_CalleeTelUri := "tel:+4989364072"; //FFS + const charstring tsc_IMS_UrnServiceSos := "urn:service:sos"; /* @status APPROVED (IMS, IMS_IRAT) */ + const charstring tsc_IMS_UrnServiceSos_Ambulance := tsc_IMS_UrnServiceSos & "." & "ambulance"; /* @status APPROVED (IMS) */ + + const charstring tsc_IMS_CallerDomain := "stf160.etsi.org"; /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + const charstring tsc_IMS_CallerSipAddrStr := "sip:PeerUE-Public@" & tsc_IMS_CallerDomain; /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + const integer tsc_IMS_CallerPort := 6543; /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + + const charstring tsc_P_CSCF_DomainName := "3gpp.org"; + + const charstring tsc_IMS_ExpiresDef := "600000"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + const charstring tsc_IMS_Ecscf := "ecscf.other.com"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + + const float tsc_IMS_WaitForTcpClose := 3.0; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + /* + * @desc build up receive template for (case-insensitve) token + * @param p_Charstring + * @return template (present) charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_TokenPattern(charstring p_Charstring) return template (present) charstring + { /* @sic R5-140901: temporary solution - handle most common variants of the (case insensitive) token sic@ */ + var charstring v_CharstringPattern := p_Charstring; + var charstring v_UpperCasePattern := f_StringToUpper(p_Charstring); + var charstring v_LowerCasePattern := f_StringToLower(p_Charstring); + + if (lengthof(v_CharstringPattern) > 0) { + v_CharstringPattern[0] := f_StringToUpper(v_CharstringPattern[0]); + } + return (pattern v_UpperCasePattern, pattern v_LowerCasePattern, pattern v_CharstringPattern); + } + + /* + * @desc convert IPCAN_RAN_Type to charstring + * @param p_RAN_Type + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_RANType2Charstring(IPCAN_RAN_Type p_RAN_Type) return charstring + { + var charstring v_RanString; + + select (p_RAN_Type) { + case (UTRAN_FDD) { v_RanString := "3GPP-UTRAN-FDD"; } + case (UTRAN_TDD) { v_RanString := "3GPP-UTRAN-TDD"; } + case (GERAN) { v_RanString := "3GPP-GERAN"; } + case (EUTRA_FDD) { v_RanString := "3GPP-E-UTRAN-FDD"; } // @sic R5s120530 change 1.4 sic@ + case (EUTRA_TDD) { v_RanString := "3GPP-E-UTRAN-TDD"; } + case else { v_RanString := "Unknown RANTech"; } + } + return v_RanString; + } + + /* + * @desc generic function to build a tag + * @param p_Method + * @param p_FromOrTo (default value: "To") + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_GenerateTag(charstring p_Method, + charstring p_FromOrTo := "To") return charstring + { /* p_Method .. e.g. "INVITE" */ + /* @sic R5-131897, R5-132063 - new generic function sic@ */ + return "abc-" & p_Method & "-" & p_FromOrTo & "tag"; + } + + /* + * @desc restore URL-encoded (or "percent-encoded") URL: + * replace all "%XY" with the the respective character corresponding to the hex code XY + * @param p_EncodedUrl + * @return charstring + * @status APPROVED (IMS) + */ + function f_URL_Decoding(charstring p_EncodedUrl) return charstring + { + var charstring v_Url := p_EncodedUrl; + var charstring v_Pattern := "(*)(%[0-9a-fA-F]#2)"; + var charstring v_PercentCodedChar; + var charstring v_HexCode; + var charstring v_Char; + var integer v_Pos; + + while (true) { + v_PercentCodedChar := regexp(v_Url, v_Pattern, 1); + if (v_PercentCodedChar != "") { + v_Pos := lengthof(regexp(v_Url, v_Pattern, 0)); + v_HexCode := substr(v_PercentCodedChar, 1, 2); + v_Char := oct2char(hex2oct(str2hex(v_HexCode))); + v_Url := replace(v_Url, v_Pos, 3, v_Char); + } else { + break; + } + } + return v_Url; + } + + /* + * @desc returns p_Char if it is not a reserved character or the encoded value + * @param p_Char + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_URL_Encoding_SingleChar(Char1_Type p_Char) return charstring + { + var Char1List_Type v_ReservedChars := {":", "/", "?", "#", "[", "]", "@", "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "="}; + var charstring v_EncodedChar; + var integer i; + for (i:=0; i < lengthof(v_ReservedChars); i:=i+1) { + if (v_ReservedChars[i] == p_Char) { + v_EncodedChar := "%" & oct2str(char2oct(p_Char)); + return v_EncodedChar; + } + } + return p_Char; + } + + /* + * @desc apply URL-encoded (or "percent-encoded") URL: + * reserved characters acc. to RFC 3986 are replaced by their percent-code + * @param p_Url + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_URL_Encoding(charstring p_Url) return charstring + { + var charstring v_EncodedUrl := ""; + var integer i; + + for (i:=0; i < lengthof(p_Url); i:=i+1) { + v_EncodedUrl := v_EncodedUrl & fl_URL_Encoding_SingleChar(p_Url[i]); + } + return v_EncodedUrl; + } + + /* + * @desc returns p_Char if it is not a reserved character or the corresponding escape sequence + * @param p_Char + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_HTML_Encoding_SingleChar(Char1_Type p_Char) return charstring + { + var Char1List_Type v_ReservedChars := {"""", "&", "'", "<", ">"}; /* NOTE: may not be complete */ + var CharStringList_Type v_EscapeString := {"quot", "amp", "apos", "lt", "gt"}; + var integer i; + for (i:=0; i < lengthof(v_ReservedChars); i:=i+1) { + if (v_ReservedChars[i] == p_Char) { + return "&" & v_EscapeString[i] & ";"; + } + } + return p_Char; + } + + /* + * @desc HTML encoding: reserved characters are replaced by their escape sequence + * @param p_String + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_HTML_Encoding(charstring p_String) return charstring + { + var charstring v_EncodedString := ""; + var integer i; + + for (i:=0; i < lengthof(p_String); i:=i+1) { + v_EncodedString := v_EncodedString & fl_HTML_Encoding_SingleChar(p_String[i]); + } + return v_EncodedString; + } +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_CommonFunctions.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_CommonFunctions.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6e800dde8bb42ad9e553d0411a958f5317c23fca --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_CommonFunctions.ttcn @@ -0,0 +1,290 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-04-25 09:25:26 +0200 (Sat, 25 Apr 2015) $ +// $Rev: 13507 $ +/******************************************************************************/ + +module IMS_CommonFunctions { + + import from CommonDefs all; + import from IP_ASP_TypeDefs all; + import from IMS_ASP_TypeDefs all; + import from IMS_ASP_Templates all; + import from NAS_AuthenticationCommon all; + import from LibSip_Common all; + import from IMS_CommonTemplates all; + import from IMS_SIP_Templates all; + + //**************************************************************************** + // security/authentication functions: + //---------------------------------------------------------------------------- + + // function to calculate the MD5 Message-Digest Algorithm according to RFC 1321 + external function fx_MD5_Hex(octetstring p_Data) return octetstring; + + /* + * @desc Convert a bitstring into its Base64 representation + * Adapted from Java Base64 implementation in en.wikibooks.org + * @param p_Bitstring + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_Bitstring2Base64 (bitstring p_Bitstring) return charstring + { + const charstring tsc_Base64Table := // The 64 encoding characters + "ABCDEFGHIJKLMNOP" & + "QRSTUVWXYZabcdef" & + "ghijklmnopqrstuv" & + "wxyz0123456789+/"; + var octetstring v_S := bit2oct(p_Bitstring); // String to be encoded + var bitstring v_BS; + var charstring v_R := ""; // Result encoded string + var charstring v_P := ""; // Padding + var integer v_C := lengthof(v_S) mod 3; + var integer v_Idx; + + // Add right zero pad to make string a multiple of 3 characters + if (v_C > 0){ + while(v_C < 3){ + v_P := v_P & "="; + v_S := v_S & '00'O; + v_C := v_C + 1; + } + } + // Run over the bitstring + v_BS := oct2bit(v_S); + for (v_C := 0; v_C < lengthof(v_BS) / 6; v_C := v_C + 1) { + v_Idx := bit2int(substr(v_BS, v_C*6, 6)); + v_R := v_R & tsc_Base64Table[v_Idx]; + } + // Now return result considering padding + return substr(v_R, 0, (lengthof(v_R) - lengthof(v_P))) & v_P; + } + + /* + * @desc IMS specifc wrapper function for f_AuthenticationInit + * @param p_Rand + * @param p_AuthenticationError (default value: noError) + * @return Common_AuthenticationParams_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_AuthenticationInit(template (value) B128_Type p_Rand, + AuthenticationError_Type p_AuthenticationError := noError) return Common_AuthenticationParams_Type + { + var Common_AuthenticationParams_Type v_AuthenticationParams := valueof(cs_CommonAuthParams_Init(p_Rand)); + return f_AuthenticationInit(v_AuthenticationParams, p_AuthenticationError); // as defined for NAS (NAS_AuxiliaryDefsAndFunctions) + } + + /* + * @desc check digest response sent by the UE + * @param p_Method (default value: "REGISTER") + * @param p_DigestResponse + * @param p_XRES + * @param p_XRESLength .. length of XRES in octets + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_Authorization_CheckDigestResponse(charstring p_Method := "REGISTER", + CommaParam_List p_DigestResponse, + bitstring p_XRES, + integer p_XRESLength) return boolean + { /* input is the comma separated parameter list: digestResponse from the Authorization header and the value of XRES calculated in ts_AuthenticationInit + This function calculates the digest response (v_RequestDigest) for p_XRES according to RFC 2617 and compares it with the response received from the UE (v_Dresponse) */ + /* @sic R5s130794 change 6: additional parameter p_Method to allow function to be used for HTTP Digest XCAP authentication sic@ */ + + var octetstring v_METHOD := char2oct(p_Method); + var octetstring v_Username := char2oct(f_SIP_CommaParamList_GetParamValue (p_DigestResponse, "username")); + var octetstring v_Realm := char2oct(f_SIP_CommaParamList_GetParamValue (p_DigestResponse, "realm")); + var octetstring v_DigestUri := char2oct(f_SIP_CommaParamList_GetParamValue (p_DigestResponse, "uri")); + var octetstring v_Nonce := char2oct(f_SIP_CommaParamList_GetParamValue (p_DigestResponse, "nonce")); + var octetstring v_NC := char2oct(f_SIP_CommaParamList_GetParamValue (p_DigestResponse, "nc")); + var octetstring v_CNonce := char2oct(f_SIP_CommaParamList_GetParamValue (p_DigestResponse, "cnonce")); + var octetstring v_Qop := char2oct(f_SIP_CommaParamList_GetParamValue (p_DigestResponse, "qop")); + + var octetstring v_Passwd := substr(bit2oct(p_XRES), 0, p_XRESLength); // @sic R5s120907 sic@ + var octetstring v_Dresponse := str2oct(f_SIP_CommaParamList_GetParamValue (p_DigestResponse, "response")); + + var octetstring v_Secret; + var octetstring v_HA2; + var octetstring v_Data; + var octetstring v_RequestDigest; + + var octetstring v_A1; + var octetstring v_A2; + var octetstring v_SecretData; + + // RFC 2617 3.2.2.2 + // A1 = unq(username-value) ":" unq(realm-value) ":" passwd + v_A1 := v_Username & tsc_COLON_HEX & v_Realm & tsc_COLON_HEX & v_Passwd; + + // H(A1) + v_Secret := char2oct(f_StringToLower(oct2str(fx_MD5_Hex(v_A1)))); + + // RFC 2617 3.2.2.3 + // A2 = Method ":" digest-uri-value + v_A2 := v_METHOD & tsc_COLON_HEX & v_DigestUri; + v_HA2 := char2oct(f_StringToLower(oct2str(fx_MD5_Hex(v_A2)))); + + // RFC 2617 3.2.2.1 + // unq(nonce-value) + // ":" nc-value + // ":" unq(cnonce-value) + // ":" unq(qop-value) + // ":" H(A2) + + v_Data := v_Nonce & tsc_COLON_HEX & v_NC & tsc_COLON_HEX & v_CNonce & tsc_COLON_HEX & v_Qop & tsc_COLON_HEX & v_HA2; + + //now apply KD function described in RFC 2617 section 3.2.1 + //KD(secret, data) = H(concat(secret, ":", data)) + v_SecretData := v_Secret & tsc_COLON_HEX & v_Data; + v_RequestDigest := fx_MD5_Hex(v_SecretData); + + return (v_RequestDigest == v_Dresponse); + } + + //**************************************************************************** + // auxilliary functions: + //---------------------------------------------------------------------------- + /* + * @desc convert transport protocol to string to be used in IMS messages + * @param p_Protocol + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_ConvertTransportProtocolToString(InternetProtocol_Type p_Protocol) return charstring + { + var charstring v_ProtocolString := ""; + + select (p_Protocol) { + case (tcp) { + v_ProtocolString := "TCP"; + } + case (udp) { + v_ProtocolString := "UDP"; + } + } + return v_ProtocolString; + } + + + /* + * @desc return routing information for DL data corresponding to the routing information received in UL; + * NOTE: in DL we never send any IP addresses + * @param p_RoutingInfo_UL + * @return template (value) IMS_RoutingInfo_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_RoutingInfo_ULtoDL(IMS_RoutingInfo_Type p_RoutingInfo_UL) return template (value) IMS_RoutingInfo_Type + { + return cs_IMS_RoutingInfo(p_RoutingInfo_UL.Protocol, + p_RoutingInfo_UL.Security, + p_RoutingInfo_UL.UE_Address, // may be omit + p_RoutingInfo_UL.NW_Address); // may be omit + } + + //---------------------------------------------------------------------------- + /* + * @desc calculate timer tolerance for IMS + * @param p_TimerVal + * @return float .. timer value + * @status APPROVED (IMS) + */ + function fl_IMS_TimerTolerance(float p_TimerVal) return float + { + return p_TimerVal * 0.1; + } + + //---------------------------------------------------------------------------- + /* + * @desc to calculate lower bound of timer tolerance for IMS + * @param p_Timer + * @return float + * @status APPROVED (IMS) + */ + function f_IMS_SetTimerToleranceMin(float p_Timer) return float + { + return p_Timer - fl_IMS_TimerTolerance(p_Timer); + } + + //---------------------------------------------------------------------------- + /* + * @desc to calculate upper bound of timer tolerance for IMS + * @param p_Timer + * @return float + * @status APPROVED (IMS) + */ + function f_IMS_SetTimerToleranceMax(float p_Timer) return float + { + return p_Timer + fl_IMS_TimerTolerance(p_Timer); + } + + //---------------------------------------------------------------------------- + /* + * @desc build up a domain name derived from IMSI acc. to 23.003 + * @param p_FirstLabel + * @param p_IMSI + * @param p_LengthOfMNC (default value: 2) + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_3gppDomainNameDerivedFromIMSI(charstring p_FirstLabel, + hexstring p_IMSI, + integer p_LengthOfMNC := 2) return charstring + { /* NOTE: the length of the MNC in general cannot be derived from the IMSI (some countries have MNCs with 2 and 3 digits; see e.g "Annex to ITU Operational Bulletin No. 992 - 15.XI.2011") + * instead the length of the MNC is stored in the EF-AD file on the SIM card (see 31.102 cl. 4.2.18) and acc. to 31.121 the MNC has 2 digits. */ + var charstring v_IMSI := hex2str(p_IMSI); + var charstring v_MCC := substr(v_IMSI, 0, 3); + var charstring v_MNC := substr(v_IMSI, 3, p_LengthOfMNC); // @sic R5s140356: index = 3 sic@ + + if (p_LengthOfMNC == 2) { + v_MNC := "0" & v_MNC; + } + return p_FirstLabel & ".mnc" & v_MNC & ".mcc" & v_MCC & ".3gppnetwork.org"; + } + + /* + * @desc build up home network domain name derived from IMSI acc. to 23.003 clause 13.2 + * @param p_IMSI + * @param p_LengthOfMNC (default value: 2) + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_HomeDomainNameDerivedFromIMSI(hexstring p_IMSI, + integer p_LengthOfMNC := 2) return charstring + { + return f_IMS_3gppDomainNameDerivedFromIMSI("ims", p_IMSI, p_LengthOfMNC); + } + + /* + * @desc build up Private User Identity derived from IMSI acc. to 23.003 clause 13.3 + * @param p_IMSI (default value: px_IMSI_Def) + * @param p_LengthOfMNC (default value: 2) + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PrivateUserIdentityDerivedFromIMSI(hexstring p_IMSI, + integer p_LengthOfMNC := 2) return charstring + { + var charstring v_IMSI := hex2str(p_IMSI); + return v_IMSI & "@" & f_IMS_HomeDomainNameDerivedFromIMSI(p_IMSI, p_LengthOfMNC); + } + + /* + * @desc build up Public User Identity derived from IMSI acc. to 23.003 clause 13.4B + * @param p_IMSI (default value: px_IMSI_Def) + * @param p_LengthOfMNC (default value: 2) + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_TemporaryPublicUserIdentity(hexstring p_IMSI, + integer p_LengthOfMNC := 2) return charstring + { + return "sip:" & f_IMS_PrivateUserIdentityDerivedFromIMSI(p_IMSI, p_LengthOfMNC); + } + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_CommonTemplates.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_CommonTemplates.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0961019875aa3507c619fa4f8e227ab094a11846 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_CommonTemplates.ttcn @@ -0,0 +1,456 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-12 11:05:29 +0200 (Sat, 12 Sep 2015) $ +// $Rev: 14310 $ +/******************************************************************************/ + +module IMS_CommonTemplates { + + import from CommonDefs all; + import from LibSip_Common all; + + /* + * @desc concat two semicolon param lists + * @param p_SemicolonParam_List1 + * @param p_SemicolonParam_List2 + * @return template (value) SemicolonParam_List + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SemicolonParam_List_Concat_TX(template (omit) SemicolonParam_List p_SemicolonParam_List1, + template (value) SemicolonParam_List p_SemicolonParam_List2) return template (value) SemicolonParam_List + { + var template (value) SemicolonParam_List v_SemicolonParam_List; + var integer i := 0; + var integer k; + + if (isvalue(p_SemicolonParam_List1)) { /* @sic R5s140580 change 3 sic@ */ + v_SemicolonParam_List := valueof(p_SemicolonParam_List1); + i := lengthof(v_SemicolonParam_List); + } + for (k := 0; k < lengthof(p_SemicolonParam_List2); k := k + 1) { /* @sic R5s140580 change 3 sic@ */ + v_SemicolonParam_List[i+k] := p_SemicolonParam_List2[k]; + } + return v_SemicolonParam_List; + } + + /* + * @desc Add element to semi colon seperated parameter list + * @param p_SemicolonParam_List + * @param p_GenericParam + * @return template (value) SemicolonParam_List + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SemicolonParam_List_Add_TX(template (omit) SemicolonParam_List p_SemicolonParam_List, + template (value) GenericParam p_GenericParam) return template (value) SemicolonParam_List + { + return f_SemicolonParam_List_Concat_TX(p_SemicolonParam_List, {p_GenericParam}); + } + + /* + * @desc Add element to semi colon seperated parameter list + * @param p_SemicolonParam_List + * @param p_GenericParam + * @return template (present) SemicolonParam_List + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_SemicolonParam_List_Add_RX(template (present) SemicolonParam_List p_SemicolonParam_List, + template (present) GenericParam p_GenericParam) return template (present) SemicolonParam_List + { /* NOTE: may need to be enhanced like f_SemicolonParam_List_Concat_TX/f_SemicolonParam_List_Add_TX */ + var template (present) SemicolonParam_List v_SemicolonParam_List := p_SemicolonParam_List; + var integer i := lengthof(p_SemicolonParam_List); + v_SemicolonParam_List[i] := p_GenericParam; + return v_SemicolonParam_List; + } + + /******************************************************************************/ + /* AuxiliaryTemplates */ + /******************************************************************************/ + /* + * @desc return parameter value ("" if none) + * @param p_GenericParam + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_GenericParam_GetValue(template (omit) GenericParam p_GenericParam) return charstring + { + var GenValue v_GenValue; + + if (ispresent(p_GenericParam.paramValue)) { + v_GenValue := valueof(p_GenericParam.paramValue); + if (ischosen(v_GenValue.quotedString)) { + return v_GenValue.quotedString; + } + else { + return v_GenValue.tokenOrHost; + } + } + return ""; + } + + // Generic parameter as used in SemicolonParam_List, AmpersandParam_List, CommaParam_List: + + template (value) GenValue cs_GenValueToken(template (value) charstring p_ParamValue) := {tokenOrHost := p_ParamValue}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + template (value) GenValue cs_GenValueQuoted(template (value) charstring p_ParamValue) := {quotedString := p_ParamValue}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + template (present) GenValue cr_GenValueToken(template (present) charstring p_ParamValue) := {tokenOrHost := p_ParamValue}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + template (present) GenValue cr_GenValueQuoted(template (present) charstring p_ParamValue) := {quotedString := p_ParamValue}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + template (present) GenValue cr_GenValue(template (present) charstring p_ParamValue) := (cr_GenValueToken(p_ParamValue), cr_GenValueQuoted(p_ParamValue)); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + template GenValue cr_GenValue_None := (cr_GenValue(""), omit); /* i.e. either an empty string or omit + @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + /* + * @desc build GenValue considering that value my be omit + * @param p_ParamValue + * @return template (omit) GenValue + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_GenValue_TX(template (omit) charstring p_ParamValue) return template (omit) GenValue + { + var template (omit) GenValue v_GenValue := omit; + + if (isvalue(p_ParamValue)) { + v_GenValue := cs_GenValueToken(valueof(p_ParamValue)); + } + return v_GenValue; + } + + template (value) GenericParam cs_GenericParam_Common(charstring p_Id, + template (omit) GenValue p_GenValue := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + id := p_Id, + paramValue := p_GenValue + }; + + template (value) GenericParam cs_GenericParamQuoted(charstring p_Id, + template (value) charstring p_ParamValue) := cs_GenericParam_Common(p_Id, cs_GenValueQuoted(p_ParamValue)); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + template (value) GenericParam cs_GenericParamToken(charstring p_Id, + charstring p_ParamValue) := cs_GenericParam_Common(p_Id, cs_GenValueToken(p_ParamValue)); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + template (value) GenericParam cs_GenericParam(charstring p_Id, + template (omit) charstring p_ParamValue := omit) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + cs_GenericParam_Common(p_Id, fl_GenValue_TX(p_ParamValue)); // @sic R5w140111 sic@ + + + + template (present) GenericParam cr_GenericParam_Common(template (present) charstring p_Id := ?, + template GenValue p_GenValue := *) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + id := p_Id, + paramValue := p_GenValue + }; + + + template (present) GenericParam cr_GenericParam(template (present) charstring p_Id, + template (present) charstring p_ParamValue) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + cr_GenericParam_Common(p_Id, cr_GenValue(p_ParamValue)); // @sic R5w140111 sic@ + + template (present) GenericParam cr_GenericParam_Any := cr_GenericParam_Common(?, *); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + + /* + * @desc build GenericParam to be used as receive template with same id and value as given send template + * @param p_GenericParamTX + * @return template (present) GenericParam + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_GenericParam_AsTX(template (value) GenericParam p_GenericParamTX) return template (present) GenericParam + { + var template GenValue v_GenValue; + + if (ispresent(p_GenericParamTX.paramValue)) { + v_GenValue := cr_GenValue(f_GenericParam_GetValue(p_GenericParamTX)); + } else { + v_GenValue := omit; + } + return cr_GenericParam_Common(p_GenericParamTX.id, v_GenValue); + } + + + //---------------------------------------------------------------------------- + // templates to check SemicolonParam_List for a specific parameter + + template (present) SemicolonParam_List cr_SemicolonParam_List_OneSpecificParam(charstring p_Id, + template GenValue p_GenValue := *) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + /* @sic R5w140111: GenValue sic@ */ + cr_GenericParam_Common(p_Id, p_GenValue), + * + }; + + template (present) SemicolonParam_List cr_SemicolonParam_List_OneSpecificParamWithValue(charstring p_Id, + template (present) charstring p_ParamValue := ?) := /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + cr_SemicolonParam_List_OneSpecificParam(p_Id, cr_GenValue(p_ParamValue)); + + template (present) SemicolonParam_List cr_SemicolonParam_List_OneSpecificParamNoValue(charstring p_Id) := /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + cr_SemicolonParam_List_OneSpecificParam(p_Id, omit); + + /******************************************************************************/ + /* AuxiliaryFunctions */ + /******************************************************************************/ + + type set of GenericParam GenericParamList_Type; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + //**************************************************************************** + // auxilliary functions to access comma, semicolon or ampersand separated lists + //---------------------------------------------------------------------------- + /* + * @desc common function to get index of specific parameter from GenericParamList or -1 when the parameter has not been found + * @param p_ParamList + * @param p_ParamId + * @param p_StartIndex (default value: 0) + * @return integer + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_SIP_GenericParamList_GetParamIndex(GenericParamList_Type p_ParamList, + charstring p_ParamId, + integer p_StartIndex := 0) return integer + { /* @sic R5w140111: GenValue sic@ */ + var charstring v_ParamId; + var integer v_NoOfParams := lengthof(p_ParamList); + var integer i; + + for ( i:= p_StartIndex; i < v_NoOfParams; i := i + 1) { + v_ParamId := f_StringToLower(p_ParamList[i].id); + if (v_ParamId == p_ParamId) { + return i; + } + } + return -1; + } + + /* + * @desc common function to get specific parameter from GenericParamList + * @param p_ParamList + * @param p_ParamId + * @return template (omit) GenericParam + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_SIP_GenericParamList_GetParam(GenericParamList_Type p_ParamList, + charstring p_ParamId) return template (omit) GenericParam + { /* @sic R5w140111: GenValue sic@ */ + var integer i := fl_SIP_GenericParamList_GetParamIndex(p_ParamList, p_ParamId); + + if (i >= 0) { + return p_ParamList[i]; + } + return omit; + } + + /* + * @desc convert CommaParamList to GenericParamList + * @param p_ParamList + * @return GenericParamList_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_SIP_CommaParamList2GenericParamList(template (omit) CommaParam_List p_ParamList) return GenericParamList_Type + { + var CommaParam_List v_ParamList; + var GenericParamList_Type v_GenericParamList := {}; + var integer i; + + if (isvalue(p_ParamList)) { + v_ParamList := valueof(p_ParamList); + for (i:=0; i < lengthof(v_ParamList); i := i+1) {v_GenericParamList[i] := v_ParamList[i];} + } + return v_GenericParamList; + } + + /* + * @desc convert SemicolonParamList to GenericParamList + * @param p_ParamList + * @return GenericParamList_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_SIP_SemicolonParamList2GenericParamList(template (omit) SemicolonParam_List p_ParamList) return GenericParamList_Type + { + var SemicolonParam_List v_ParamList; + var GenericParamList_Type v_GenericParamList := {}; + var integer i; + + if (isvalue(p_ParamList)) { + v_ParamList := valueof(p_ParamList); + for (i:=0; i < lengthof(v_ParamList); i := i+1) {v_GenericParamList[i] := v_ParamList[i];} + } + return v_GenericParamList; + } + + /* + * @desc convert AmpersandParamList to GenericParamList + * @param p_ParamList + * @return GenericParamList_Type + * @status APPROVED (IMS) + */ + function fl_SIP_AmpersandParamList2GenericParamList(template (omit) AmpersandParam_List p_ParamList) return GenericParamList_Type + { + var AmpersandParam_List v_ParamList; + var GenericParamList_Type v_GenericParamList := {}; + var integer i; + + if (isvalue(p_ParamList)) { + v_ParamList := valueof(p_ParamList); + for (i:=0; i < lengthof(v_ParamList); i := i+1) {v_GenericParamList[i] := v_ParamList[i];} + } + return v_GenericParamList; + } + + /* + * @desc common function to get value of specific parameter from GenericParamList + * @param p_ParamId + * @param p_GenericParam + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_SIP_GenericParamCheckAndGetValue(charstring p_ParamId, + template (omit) GenericParam p_GenericParam) return charstring + { /* @sic R5w140111: GenValue sic@ */ + if (not isvalue(p_GenericParam)) { + f_ErrorLog(__FILE__, __LINE__, "ParamList does not contain '" & p_ParamId & "'"); + } + return f_GenericParam_GetValue(p_GenericParam); + } + + /* + * @desc return given parameter in parameter list (or omit if not present) + * @param p_ParamList + * @param p_ParamId + * @return template (omit) GenericParam + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SIP_CommaParamList_GetParam(template (omit) CommaParam_List p_ParamList, + charstring p_ParamId) return template (omit) GenericParam + { /* @sic R5w140111: GenValue sic@ */ + var GenericParamList_Type v_GenericParamList := fl_SIP_CommaParamList2GenericParamList(p_ParamList); + return fl_SIP_GenericParamList_GetParam(v_GenericParamList, p_ParamId); + } + + /* + * @desc return value of given parameter in parameter list + * @param p_ParamList + * @param p_ParamId + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SIP_CommaParamList_GetParamValue(template (omit) CommaParam_List p_ParamList, + charstring p_ParamId) return charstring + { /* @sic R5w140111: GenValue sic@ */ + var template (omit) GenericParam v_GenericParam := f_SIP_CommaParamList_GetParam(p_ParamList, p_ParamId); + return fl_SIP_GenericParamCheckAndGetValue(p_ParamId, v_GenericParam); + } + + + /* + * @desc Add element to Comma seperated parameter list + * @param p_CommaParam_List + * @param p_GenericParam + * @return template (value) CommaParam_List + */ + function f_CommaParam_List_Add_TX(template (value) CommaParam_List p_CommaParam_List, + template (value) GenericParam p_GenericParam) return template (value) CommaParam_List + { + var template (value) CommaParam_List v_CommaParam_List := p_CommaParam_List; + var integer i := lengthof(p_CommaParam_List); + v_CommaParam_List[i] := p_GenericParam; + return v_CommaParam_List; + } + + /* + * @desc Add element to comma seperated parameter list + * @param p_CommaParam_List + * @param p_GenericParam + * @return template (present) CommaParam_List + * @status APPROVED (IMS) + */ + function f_CommaParam_List_Add_RX(template (present) CommaParam_List p_CommaParam_List, + template (present) GenericParam p_GenericParam) return template (present) CommaParam_List + { + var template (present) CommaParam_List v_CommaParam_List := p_CommaParam_List; + var integer i := lengthof(p_CommaParam_List); + v_CommaParam_List[i] := p_GenericParam; + return v_CommaParam_List; + } + + /* + * @desc return given parameter in parameter list (or omit if not present) + * @param p_ParamList + * @param p_ParamId + * @return template (omit) GenericParam + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SIP_SemicolonParamList_GetParam(template (omit) SemicolonParam_List p_ParamList, + charstring p_ParamId) return template (omit) GenericParam + { /* @sic R5w140111: GenValue sic@ */ + var GenericParamList_Type v_GenericParamList := fl_SIP_SemicolonParamList2GenericParamList(p_ParamList); + return fl_SIP_GenericParamList_GetParam(v_GenericParamList, p_ParamId); + } + + /* + * @desc Remove parameter from SemicolonParamList + * @param p_ParamList + * @param p_ParamId + * @return template (omit) SemicolonParam_List + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SIP_SemicolonParamList_RemoveParam(template (omit) SemicolonParam_List p_ParamList, + charstring p_ParamId) return template (omit) SemicolonParam_List + { + var SemicolonParam_List v_SemicolonParamList; + var GenericParamList_Type v_GenericParamList := fl_SIP_SemicolonParamList2GenericParamList(p_ParamList); + var integer v_Index := fl_SIP_GenericParamList_GetParamIndex(v_GenericParamList, p_ParamId); + var integer i; + var integer k := 0; + + if (v_Index >= 0) { + for (i := 0; i < lengthof(v_GenericParamList); i := i + 1) { + if (i != v_Index) { + v_SemicolonParamList[k] := v_GenericParamList[i]; + k := k + 1; + } + } + return v_SemicolonParamList; + } + return p_ParamList; + } + + /* + * @desc return value of given parameter in parameter list + * @param p_ParamList + * @param p_ParamId + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SIP_SemicolonParamList_GetParamValue(template (omit) SemicolonParam_List p_ParamList, + charstring p_ParamId) return charstring + { /* @sic R5w140111: GenValue sic@ */ + var template (omit) GenericParam v_GenericParam := f_SIP_SemicolonParamList_GetParam(p_ParamList, p_ParamId); + return fl_SIP_GenericParamCheckAndGetValue(p_ParamId, v_GenericParam); + } + + /* + * @desc return given parameter in parameter list (or omit if not present) + * @param p_ParamList + * @param p_ParamId + * @return template (omit) GenericParam + * @status APPROVED (IMS) + */ + function f_SIP_AmpersandParamList_GetParam(template (omit) AmpersandParam_List p_ParamList, + charstring p_ParamId) return template (omit) GenericParam + { /* @sic R5w140111: GenValue sic@ */ + var GenericParamList_Type v_GenericParamList := fl_SIP_AmpersandParamList2GenericParamList(p_ParamList); + return fl_SIP_GenericParamList_GetParam(v_GenericParamList, p_ParamId); + } + + function f_SIP_AmpersandParamList_GetParamValue(template (omit) AmpersandParam_List p_ParamList, + charstring p_ParamId) return charstring + { /* @sic R5w140111: GenValue sic@ */ + var template (omit) GenericParam v_GenericParam := f_SIP_AmpersandParamList_GetParam(p_ParamList, p_ParamId); + return fl_SIP_GenericParamCheckAndGetValue(p_ParamId, v_GenericParam); + } + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_Component.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_Component.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2d520a4d4a5398d4fcb540f48ff7398b299c511c --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_Component.ttcn @@ -0,0 +1,1637 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-15 19:05:27 +0200 (Tue, 15 Sep 2015) $ +// $Rev: 14431 $ +/******************************************************************************/ + +module IMS_Component { + import from LibSip_Common all; + import from LibSip_SIPTypesAndValues all; + import from LibSip_SDPTypes all; + import from CommonDefs all; + import from CommonIP all; + import from Parameters all; + import from IMS_ASP_TypeDefs all; + import from IMS_PTC_CoordMsg all; + import from IP_ASP_TypeDefs all; + import from IP_ASP_Common all; + import from IMS_ASP_Templates all; + import from IMS_CommonDefs all; + import from IMS_CommonFunctions all; + import from IMS_CommonParameters all; + import from IMS_SIP_Templates all; + import from NAS_AuthenticationCommon all; + import from UpperTesterPtcToMtcDefs all; // all messages being defined to communicate with the upper tester; port definitions + + type enumerated IMS_PTC_Handling_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + testcaseSpecificHandling, + defaultHandling + }; + + type record IMS_PTC_Ctrl_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + default Default, /* default behaviour being activated on IMS PTC */ + boolean TestBody, /* true: => fail may be assigend + * false: => inconc is assigned instead of fail */ + boolean BlockUlDataInDefault, /* @sic R5s140780 - MCC160 Implementation sic@ + * true: => ports IMS_Server and IMS_Client are not handle by default handler + * i.e. any messages coming up at these ports are stored until there are explicit receive statements in the test case + * false: => UL data may cause test case fail/inconc */ + boolean IgnoreReset /* @sic R5s150031: to deal with "Reset" sent from IPCAN to reset IMS in case of the UE being switched on after a switch-off during the test case sic@ */ + }; + + type record IMS_PTC_SecurityInfo_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + IPsec_IntegrityAlgorithm_Type IntegrityAlgorithm, + IPsec_CipheringAlgorithm_Type CipheringAlgorithm, + IMS_ProtectedPorts_Type ProtectedPorts optional, + IMS_SPIs_Type SPIs optional, + charstring Nonce optional, + B32_128_Type XRES optional, + integer XRESLength optional // @sic R5s120907 sic@ + }; + + type enumerated IMS_UriInfo_UriType_Type { firstId, secondId, thirdId, defaultId, registrationId, emergencyId, dialogLocalId, dialogRemoteId, temporaryId, gruu }; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + @sic R5-153760: gruu sic@ */ + type enumerated IMS_PTC_CseqType_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + register, /* CSeq used by the UE in any REGISTER message (registration, re-registration and de-registration */ + dialogRemote, /* CSeq to be used in requests which are sent MO requests */ + dialogLocal /* CSeq to be used in requests which are sent MT requests */ + }; + type enumerated IMS_PTC_DialogIndex_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + firstDialog, + secondDialog, + thirdDialog, + referDialog, + confEventDialog, /* @sic R5-153986: confEventDialog sic@ */ + regEventDialog, /* @sic R5-153756: needed to unsubscribe (to get the correct CSeq for the NOTIFY) sic@ */ + msgSummayDialog /* @sic R5-153756: needed to unsubscribe (to get the correct CSeq for the NOTIFY) sic@ */ + }; + + type record IMS_PTC_RegistrationInfo_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + charstring Uri optional, /* SIP URI used for registration (can be temporary SIP URI when the UE does not have an ISIM) */ + charstring CallId optional, /* CallId used for registration (needed to check against CallId of INVITE) */ + integer Cseq + }; + + type record IMS_DialogInfo_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + @sic R5s140092 change 1.5: RemoteURI, RemoteCseq, LocalURI, LocalCseq stored in this structure sic@ */ + boolean MobileOriginated optional, /* needed e.g. to get the right route-set for re-INVITE */ + charstring RemoteTag optional, /* acc. to RFC 3261 when creating a dialog in first request there is a From tag but no To tag; + the To tag is chosen by the other send and sent in a response; in all further messages within the dialogthe same From and To tags shall be used + (=> especially in request messages (e.g. BYE) it may be necessary to use this stored value whereas in responses the values can be used as sent in the request); + NOTE: in general outside a dialog (e.g. registration) requests get a new From tag and the corresponding reponses contain a new To tag */ + charstring RemoteURI optional, /* URI of the remote side in a dialog created by INVITE */ + integer RemoteCseq optional, /* @sic R5s140235: changed to optional sic@ */ + charstring LocalTag optional, + charstring LocalURI optional, /* URI of the UE in a dialog created by INVITE */ + integer LocalCseq, + charstring CallId optional, + charstring SessionId optional, + charstring SdpSessionIdTX, /* @sic R5-150707 sic@ */ + integer SdpSessionVersionTX, /* current SDP session version for the DL @sic R5-150707 sic@ */ + SDP_Message SdpMessagePrevRX optional /* previous SDP message sent by the UE @sic R5-150702 sic@ */ + }; + + const integer tsc_IMS_NoOfDialogs := 6; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + type record length(tsc_IMS_NoOfDialogs) of IMS_DialogInfo_Type IMS_PTC_DialogInfoList_Type; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + type record IMS_PTC_DialogList_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + integer CurrentIndex, + IMS_PTC_DialogInfoList_Type Info + }; + + type record IMS_PTC_ImsInfo_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + CharStringList_Type IMPUList, /* list of all Public User Ids acc. to ISIM setting (31.121) or as stored in the HSS */ + IP_AddrInfo_Type UE_Address optional, + IP_AddrInfo_Type NW_Address optional, + charstring P_CSCF_Address optional, /* @sic R5s140934 sic@ */ + InternetProtocol_Type TransportProtocol, /* transport protocol to be used for requests sent in DL + * @sic R5s120530 change 1.7 sic@ + * NOTE: in contrast to R5s120530 and acc. to rejection of R5-130765 at RAN WG5 Meeting #58 in Malta UDP is used for all requests in DL; + * nevertheless "TransportProtocol" is kept in case there are other decisions in the future */ + IPCAN_RAN_Type RanType optional, + integer UE_Release optional, /* @sic R5s130739 MCC160 implementation: new field to store the UE's release sic@ */ + boolean SigCompStarted, + charstring HomeDomainName, + charstring PrivateUserId, + SipUrl ContactUrl optional, /* contact address as provided in contact header of the REGISTER message; + to be used e.g. for Request-URI of INVITE for MT call */ + integer BranchIndex, /* internal index used to generate unique branches */ + integer CallIdCnt, /* counter to achieve unique callids e.g. for SMS MESSAGE sent to the UE @sic R5-133705 sic@ */ + IMS_PTC_RegistrationInfo_Type Registration, + IMS_PTC_DialogList_Type Dialog, /* @sic R5s140092 change 1.5: two sets of dialogs sic@ */ + IMS_SecurityScheme_Type SecurityScheme /* IMS security or GIBA acc. to 34.229-2 Table A.6a; depends on PICS setting and may depend on test case */ + }; + + type record IMS_Global_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + PDN_Index_Type PdnIndex, /* @sic R5s130651: new variable sic@ */ + IMS_PTC_Ctrl_Type Ctrl, + IMS_PTC_SecurityInfo_Type Security, + IMS_PTC_ImsInfo_Type ImsInfo + }; + + type component IMS_PTC { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + var IMS_Global_Type vc_IMS_Global; + + // port to RAT components + port IMS_IPCAN_CO_ORD_PORT IPCAN; + port IMS_IPCAN_CO_ORD_PORT OtherIPCAN; /* @sic R5-142919 sic@ */ + + // port to other IMS PTC (other PDN) + port IMS_IMS_CO_ORD_PORT OtherPDN; + + // ports connected to IP: + port IMS_IP_CTRL_PORT IMS_CTRL; + port IMS_IP_SERVER_PORT IMS_Server; + port IMS_IP_CLIENT_PORT IMS_Client; + + // ports for MMI (used by IMS CC test suite) + port UT_PTC_MTC_PORT MMI; + }; + + //---------------------------------------------------------------------------- + + template (value) IMS_PTC_SecurityInfo_Type cs_IMS_SecurityInfo_Init := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + IntegrityAlgorithm := px_IMS_IPSecAlgorithm, + CipheringAlgorithm := px_IMS_CiphAlgo_Def, + ProtectedPorts := omit, + SPIs := omit, + Nonce := omit, + XRES := omit, + XRESLength := omit // @sic R5s120907 sic@ + }; + + template (value) IMS_PTC_RegistrationInfo_Type cs_IMS_RegistrationInfo_Init := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + Uri := omit, + CallId := omit, + Cseq := 0 + }; + + template (value) IMS_DialogInfo_Type cs_IMS_DialogInfo_Init := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + MobileOriginated := omit, + RemoteTag := omit, + RemoteURI := omit, + RemoteCseq := omit, /* @sic R5s140235: changed to omit sic@ */ + LocalTag := omit, + LocalURI := omit, + LocalCseq := 0, + CallId := omit, + SessionId := omit, + SdpSessionIdTX := "1111111111", /* @sic R5-150707: new variable replacing tsc_SDP_SessionId sic@ */ + SdpSessionVersionTX := 1111111110, /* @sic R5-150702: new variable; intialised with 1111111110 as being incremented firstly (see f_IMS_PTC_ImsInfo_DialogIncrAndGetSessVersionTX) sic@ */ + SdpMessagePrevRX := omit + }; + + /* + * @desc initialise dialog status information + * @return template (value) IMS_PTC_DialogList_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_IMS_PTC_DialogList_Init() return template (value) IMS_PTC_DialogList_Type + { + var template (value) IMS_PTC_DialogList_Type v_DialogList; + var integer i; + v_DialogList.CurrentIndex := 0; + for (i:=0; i in this function we will ensure that in the 4-tuple of SPIs needed for IMS in a given PDN all values are distinct. + * In addition e.g. in case of re-authentication the network's SPIs shall be different than the previous ones. + * @param p_NewSPI_us + * @param p_NewSPI_uc + * @param p_PrevSPI_ps (default value: omit) + * @param p_PrevSPI_pc (default value: omit) + * @return IMS_SPIs_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_SPIs_Init(integer p_NewSPI_us, + integer p_NewSPI_uc, + template (omit) integer p_PrevSPI_ps := omit, + template (omit) integer p_PrevSPI_pc := omit) runs on IMS_PTC return IMS_SPIs_Type + { /* @sic R5s130266 change 1.3, 4, 5 - MCC160 Implementation: taking into account the previous SPIs of the network side sic@ */ + /* p_PrevSPI_ps, p_PrevSPI_pc are omit at initial registration */ + + var IMS_SPIs_Type v_SPIs := valueof(cs_IMS_SPIs_Init(p_NewSPI_us, p_NewSPI_uc)); + var integer v_Index := enum2int(vc_IMS_Global.PdnIndex); + var integer v_SPI := 256 + (v_Index * 1024); /* According to RFC 2406, SPI values from 0 to 255 are reserved + @sic R5s130651: v_Index used to get different SPIs for different PDNs sic@ */ + if (p_NewSPI_uc == p_NewSPI_us) { + FatalError(__FILE__, __LINE__, "SPIs of UE side have the same values"); + } + + while (not isvalue(v_SPIs.SPI_ps) or not isvalue(v_SPIs.SPI_pc)) { + if ((v_SPI != p_NewSPI_uc) and (v_SPI != p_NewSPI_us) and // new value shall be neither equal to the UE's values ... + not match(v_SPI, p_PrevSPI_pc) and not match(v_SPI, p_PrevSPI_ps)) { // ... nor to the network's previous values + if (not isvalue(v_SPIs.SPI_ps)) { + v_SPIs.SPI_ps := v_SPI; + } else { + v_SPIs.SPI_pc := v_SPI; + } + } + v_SPI := v_SPI + 1; + } + return v_SPIs; + } + + //**************************************************************************** + /* + * @desc initialise or re-initialise security at the IMS PTC + * @param p_AuthenticationParams (default value: omit) + * @param p_Port_us + * @param p_Port_uc + * @param p_SPI_us + * @param p_SPI_uc + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_Security_Init(template (omit) Common_AuthenticationParams_Type p_AuthenticationParams := omit, + PortNumber_Type p_Port_us, + PortNumber_Type p_Port_uc, + IPsec_SPI_Type p_SPI_us, + IPsec_SPI_Type p_SPI_uc) runs on IMS_PTC + { /* @sic R5s130266 change 1.3, 4, 5 - MCC160 Implementation: taking into account SPIs for re-authentication sic@ */ + + var Common_AuthenticationParams_Type v_AuthenticationParams; + var template (omit) IPsec_SPI_Type v_PrevSPI_ps := omit; + var template (omit) IPsec_SPI_Type v_PrevSPI_pc := omit; + var PortNumber_Type v_Port_pc := tsc_IMS_Port_pc; + + if (isvalue(p_AuthenticationParams)) { + v_AuthenticationParams := valueof(p_AuthenticationParams); + vc_IMS_Global.Security.Nonce := f_Bitstring2Base64(v_AuthenticationParams.RandValue & v_AuthenticationParams.AUTN); + vc_IMS_Global.Security.XRES := v_AuthenticationParams.XRES; + } + if (isvalue(vc_IMS_Global.Security.SPIs)) { // => re-authentication + v_PrevSPI_ps := vc_IMS_Global.Security.SPIs.SPI_ps; + v_PrevSPI_pc := vc_IMS_Global.Security.SPIs.SPI_pc; + } + vc_IMS_Global.Security.SPIs := fl_SPIs_Init(p_SPI_us, p_SPI_uc, v_PrevSPI_ps, v_PrevSPI_pc); + + if (isvalue(vc_IMS_Global.Security.ProtectedPorts)) { // => re-authentication + if (vc_IMS_Global.Security.ProtectedPorts.Port_pc == tsc_IMS_Port_pc) { + v_Port_pc := tsc_IMS_Port_pc_2; // new client port + } + } + vc_IMS_Global.Security.ProtectedPorts := valueof(cs_IMS_ProtectedPorts(p_Port_us, p_Port_uc, tsc_IMS_Port_ps, v_Port_pc)); + } + + /* + * @desc return true when IMS security is started on protected ports + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_Security_IsStarted() runs on IMS_PTC return boolean + { + return isvalue(vc_IMS_Global.Security.ProtectedPorts); + } + + /* + * @desc return integrity algorithm stored at the IMS PTC + * @return IPsec_IntegrityAlgorithm_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_Security_GetIntegrityAlgorithm() runs on IMS_PTC return IPsec_IntegrityAlgorithm_Type + { + return vc_IMS_Global.Security.IntegrityAlgorithm; + } + + /* + * @desc return ciphering algorithm stored at the IMS PTC + * @return IPsec_CipheringAlgorithm_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_Security_GetCipheringAlgorithm() runs on IMS_PTC return IPsec_CipheringAlgorithm_Type + { + return vc_IMS_Global.Security.CipheringAlgorithm; + } + + /* + * @desc return NONCE stored at the IMS PTC + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_Security_GetNonce() runs on IMS_PTC return charstring + { + return vc_IMS_Global.Security.Nonce; + } + + /* + * @desc return XRES stored at the IMS PTC + * @return B32_128_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_Security_GetXRES() runs on IMS_PTC return B32_128_Type + { + return vc_IMS_Global.Security.XRES; + } + + /* + * @desc return length of XRES as stored at the IMS PTC + * @return integer + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_Security_GetXRESLength() runs on IMS_PTC return integer // @sic R5s120907 sic@ + { + return vc_IMS_Global.Security.XRESLength; + } + + /* + * @desc set info retrieved from IPCAN + * @param p_IpcanInfo + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_SetIpcanInfo(IPCAN_INFO_Type p_IpcanInfo) runs on IMS_PTC + { /* @sic R5s120907 R5s130133 additional changes sic@ */ + vc_IMS_Global.Security.XRESLength := p_IpcanInfo.AuthResLength; + vc_IMS_Global.ImsInfo.UE_Release := p_IpcanInfo.UE_Release; /* @sic R5s130739 MCC160 implementation sic@ */ + vc_IMS_Global.ImsInfo.RanType := p_IpcanInfo.RanType; + } + + /* + * @desc set RAN type + * @param p_RanType + * @status APPROVED (IMS_IRAT, LTE_A, LTE_IRAT) + */ + function f_IMS_PTC_SetRanType(IPCAN_RAN_Type p_RanType) runs on IMS_PTC + { + vc_IMS_Global.ImsInfo.RanType := p_RanType; + } + + /* + * @desc reset RAN type to omit + * @status APPROVED (IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ResetRanType() runs on IMS_PTC + { + vc_IMS_Global.ImsInfo.RanType := omit; + } + + /* + * @desc get UE release + * @return template (omit) integer + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_GetUE_Release() runs on IMS_PTC return template (omit) integer + { + return vc_IMS_Global.ImsInfo.UE_Release; + } + + /* + * @desc return true when UE release is >= given release + * @param p_Release + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_UE_ReleaseGreaterOrEqual(integer p_Release) runs on IMS_PTC return boolean + { + var template (omit) integer v_UERelease := f_IMS_PTC_GetUE_Release(); + var boolean v_Result := false; + + if (isvalue(v_UERelease)) { + v_Result := (valueof(v_UERelease) >= p_Release); + } + return v_Result; + } + + /* + * @desc get SPIs stored at IMS PTC + * @return IMS_SPIs_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_Security_GetSPIs() runs on IMS_PTC return IMS_SPIs_Type + { + return vc_IMS_Global.Security.SPIs; + } + + /* + * @desc return security information as stored at the IMS PTC + * @return IMS_ProtectedPorts_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_Security_GetProtectedPorts() runs on IMS_PTC return IMS_ProtectedPorts_Type + { + return vc_IMS_Global.Security.ProtectedPorts; + } + + /* + * @desc Build SecurityMechanism list template from the stored security configuration to be used for sending + * @return template (value) SecurityMechanism_List + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_BuildSecurityServerParam() runs on IMS_PTC return template (value) SecurityMechanism_List + { + var IMS_PTC_SecurityInfo_Type v_Security := vc_IMS_Global.Security; + + return f_SIP_BuildSecurityServerParam(v_Security.IntegrityAlgorithm, + v_Security.CipheringAlgorithm, + int2str(v_Security.SPIs.SPI_pc), + int2str(v_Security.SPIs.SPI_ps), + int2str(v_Security.ProtectedPorts.Port_pc), + int2str(v_Security.ProtectedPorts.Port_ps)); + } + + /* + * @desc Build SecurityVerify heaader template from the stored security configuration to be used for sending + * @return template (present) SecurityVerify + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_BuildSecurityVerifyHeader() runs on IMS_PTC return template (present) SecurityVerify + { + var IMS_PTC_SecurityInfo_Type v_Security := vc_IMS_Global.Security; + + return f_SIP_BuildSecurityVerifyHeader(v_Security.IntegrityAlgorithm, + v_Security.CipheringAlgorithm, + int2str(v_Security.SPIs.SPI_pc), + int2str(v_Security.SPIs.SPI_ps), + int2str(v_Security.ProtectedPorts.Port_pc), + int2str(v_Security.ProtectedPorts.Port_ps)); + } + + /* + * @desc return true when GIBA + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_SecurityScheme_IsGiba() runs on IMS_PTC return boolean + { + return (vc_IMS_Global.ImsInfo.SecurityScheme == GIBA); + } + + /* + * @desc return true when GIBA + * @param p_SecurityScheme + */ + function f_IMS_PTC_SecurityScheme_Set(IMS_SecurityScheme_Type p_SecurityScheme) runs on IMS_PTC + { + vc_IMS_Global.ImsInfo.SecurityScheme := p_SecurityScheme; + } + + //**************************************************************************** + /* + * @desc initialise IMS PTC + * @param p_UE_Address + * @param p_NW_Address + * @param p_RegisterReq + * @param p_SigCompStarted (default value: false) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_Init(IP_AddrInfo_Type p_UE_Address, + IP_AddrInfo_Type p_NW_Address, + template (omit) REGISTER_Request p_RegisterReq := omit, + boolean p_SigCompStarted := false) runs on IMS_PTC + { /* @sic R5s130756 change 14, 15 sic@ */ + var REGISTER_Request v_RegisterReq; + var InternetProtocol_Type v_TransportProtocol := udp; /* @sic acc. to discussions regarding rejection of R5-130765 at RAN WG5 Meeting #58 in Malta per default UDP is used for all requests in DL sic@ */ + + if (match(testcasename(), pattern "TC_8_[0-9]#(1,2)")) { /* @sic R5-131292 - TCP as normative DL transport protocol in IMS Registration test sic@ + @sic R5s130897 - distinguish IMS from LTE test cases sic@ */ + v_TransportProtocol := tcp; + } + + vc_IMS_Global.Ctrl.IgnoreReset := false; /* @sic R5s150031: f_IMS_PTC_ImsInfo_Init is called e.g. after the UE has send the initial REGISTER => from now on we need to care about any reset sic@ */ + + vc_IMS_Global.ImsInfo.UE_Address := p_UE_Address; + vc_IMS_Global.ImsInfo.NW_Address := p_NW_Address; + vc_IMS_Global.ImsInfo.TransportProtocol := v_TransportProtocol; + vc_IMS_Global.ImsInfo.SigCompStarted := p_SigCompStarted; + + if (ispresent(p_RegisterReq)) { + v_RegisterReq := valueof(p_RegisterReq); + vc_IMS_Global.ImsInfo.ContactUrl := f_MessageHeader_GetContactSipUrl(v_RegisterReq.msgHeader); + vc_IMS_Global.ImsInfo.Registration.Uri := f_SIP_SipUrl_GetPublicUserIdentity(f_Addr_Union_GetSipUrl(v_RegisterReq.msgHeader.toField.addressField)); + vc_IMS_Global.ImsInfo.Registration.CallId := v_RegisterReq.msgHeader.callId.callid; + vc_IMS_Global.ImsInfo.Registration.Cseq := v_RegisterReq.msgHeader.cSeq.seqNumber; + } + } + + /* + * @desc Get dialog index value related to given enumerated + * @param p_Index + * @return integer + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_IMS_PTC_ImsInfo_GetDialogIndexValue(template (omit) IMS_PTC_DialogIndex_Type p_Index) runs on IMS_PTC return integer + { + var integer i; + + if (isvalue(p_Index)) { + select (valueof(p_Index)) { + case (firstDialog) { i := 0; } + case (secondDialog) { i := 1; } + case (thirdDialog, + referDialog) { i := 2; } + case (confEventDialog) { i := 3; } /* @sic R5-153986 sic@ */ + case (regEventDialog) { i := 4; } /* @sic R5-153756 sic@ */ + case (msgSummayDialog) { i := 6; } /* @sic R5-153756 sic@ */ + case else { FatalError(__FILE__, __LINE__, "invalid dialog"); } + } + } else { + i := vc_IMS_Global.ImsInfo.Dialog.CurrentIndex; + } + return i; + } + + + /* + * @desc Get dialog status information for the currenct dialog + * @param p_DialogIndex + * @return IMS_DialogInfo_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_IMS_PTC_ImsInfo_GetDialog(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex) runs on IMS_PTC return IMS_DialogInfo_Type + { + var integer i := fl_IMS_PTC_ImsInfo_GetDialogIndexValue(p_DialogIndex); + return vc_IMS_Global.ImsInfo.Dialog.Info[i]; + } + + /* + * @desc Set dialog status information for the currenct dialog + * @param p_DialogIndex + * @param p_DialogInfo + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_IMS_PTC_ImsInfo_SetDialog(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex, + IMS_DialogInfo_Type p_DialogInfo) runs on IMS_PTC + { + var integer i := fl_IMS_PTC_ImsInfo_GetDialogIndexValue(p_DialogIndex); + vc_IMS_Global.ImsInfo.Dialog.Info[i] := p_DialogInfo; + } + + /* + * @desc return IP address which is used by the UE for IMS signalling (IPv4 or IPv6) + * @return IP_AddrInfo_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_UE_Address_Get() runs on IMS_PTC return IP_AddrInfo_Type + { + return vc_IMS_Global.ImsInfo.UE_Address; + } + + /* + * @desc return network address stored at the IMS PTC + * @return IP_AddrInfo_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_NW_Address_Get() runs on IMS_PTC return IP_AddrInfo_Type + { + return vc_IMS_Global.ImsInfo.NW_Address; + } + + /* + * @desc return IP type for network address stored at the IMS PTC + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_PTC_NW_Address_GetTypeStr() runs on IMS_PTC return charstring + { + return f_IP_AddrInfo_TypeStr(vc_IMS_Global.ImsInfo.NW_Address); + } + + /* + * @desc return network address stored at the IMS PTC as charstring + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_NW_Address_GetAddrStr() runs on IMS_PTC return charstring + { + if (not isvalue(vc_IMS_Global.ImsInfo.NW_Address)) { + FatalError(__FILE__, __LINE__, "NW address not initialiased yet"); + } + return f_IP_AddrInfo_AddrStr(vc_IMS_Global.ImsInfo.NW_Address); + } + + /* + * @desc return address of the simulated remote UE as charstring + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_PTC_RemoteAddress_GetAddrStr() runs on IMS_PTC return charstring + { /* @sic R5s130681 additional change sic@ */ + var PDN_AddressInfo_Type v_PDN_AddressInfo := f_PDN_AddressInfo_Get(vc_IMS_Global.PdnIndex); + var IP_AddrInfo_Type v_UE_Address := f_IMS_PTC_UE_Address_Get(); + var charstring v_RemoteAddress; + + if (ischosen(v_UE_Address.V4)) { + v_RemoteAddress := v_PDN_AddressInfo.Remote_IPAddressIPv4; + } else { + v_RemoteAddress := v_PDN_AddressInfo.Remote_IPAddressIPv6; + } + return v_RemoteAddress; + } + + /* + * @desc return P-CSCF address (FQDN) stored at the IMS PTC + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_Pcscf_Get() runs on IMS_PTC return charstring + { /* @sic R5-144747 removal of px_IMS_Pcscf and px_IMS_Pcscf_Emg sic@ */ + /* @sic R5s140934: P_CSCF_Address sic@ */ + var charstring v_P_CSCF_Address; + + if (ispresent(vc_IMS_Global.ImsInfo.P_CSCF_Address)) { + v_P_CSCF_Address := vc_IMS_Global.ImsInfo.P_CSCF_Address; + } else { + v_P_CSCF_Address := f_IMS_PTC_NW_Address_GetAddrStr(); + } + return v_P_CSCF_Address; + } + + /* + * @desc Check P-CSCF address; + * NOTE: the P-CSCF address is the same address as the NW_Address but in case of IPv6 it may be a different notation + * typically the UE may use the canonical format acc. to RFC 5952 + * @param p_P_CSCF_Address + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_Pcscf_CheckAndSet(charstring p_P_CSCF_Address) runs on IMS_PTC return boolean + { + var charstring v_P_CSCF_Address := f_IMS_PTC_Pcscf_Get(); + + if (v_P_CSCF_Address != p_P_CSCF_Address) { + if (f_IPAddresses_Compare(v_P_CSCF_Address, p_P_CSCF_Address)) { + vc_IMS_Global.ImsInfo.P_CSCF_Address := p_P_CSCF_Address; + } else { + return false; + } + } + return true; + } + + /* + * @desc check validity of the host/port information used by the UE + * @param p_HostPort + * @param p_Port (default value: *) + * @param p_AllowFQDN (default value: true) + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_CheckHostPortForIPAddrOrFQDN(HostPort p_HostPort, + template integer p_Port := *, + boolean p_AllowFQDN := true) runs on IMS_PTC return boolean + { /* p_AllowFQDN .. shall be set to false e.g. for condition A6 of A.2.1 */ + if (p_AllowFQDN and match(p_HostPort, cr_HostPort(f_IMS_PTC_ImsInfo_GetHomeDomainName(), p_Port))) { // => FQDN + return true; + } + return (match(p_HostPort.portField, p_Port) and // check port + f_IMS_IpAddrMatch(f_IMS_PTC_UE_Address_Get(), p_HostPort.host)); // check IP address taking into account that formats may be different + } + + + /* + * @desc Check SipUrl (e.g. in Contact header) to be "SIP URI with IP address or FQDN and protected server port of UE or GRUU as returned by the SS in registration" + * @param p_SipUrl + * @param p_Port (default value: *) + * @param p_GRUUsInSIP (default value: pc_IMS_GRUUsInSIP) + * @param p_AllowFQDN (default value: true) + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_CheckSipUrlForIPAddrOrFQDNOrGRUU(SipUrl p_SipUrl, + template integer p_Port := *, + boolean p_GRUUsInSIP := pc_IMS_GRUUsInSIP, + boolean p_AllowFQDN := true) runs on IMS_PTC return boolean + { /* @sic R5s130195 BASELINE MOVING 2013: change of SipUrl sic@ */ + /* @sic R5-153760: p_GRUUsInSIP := pc_IMS_GRUUsInSIP sic@ */ + var template (present) SipUrl v_ExpectedSipUrl; + var HostPort v_HostPort; + + if (not ischosen(p_SipUrl.components.sip)) { + return false; + } + v_HostPort := p_SipUrl.components.sip.hostPort; + + if (p_GRUUsInSIP) { // @sic R5-153760 sic@ + v_ExpectedSipUrl := f_SIP_BuildSipUri_RX(f_IMS_PTC_ImsInfo_GetURI(gruu), -, cr_UriParameters_gruu); /* when "obtaining and using GRUUs in SIP" the UE shall use the public GRUU in the Contact header + => SIP URI as used during registration + "gr" uri-parameter + @sic R5s150721, R5-153760 sic@ */ + return match(p_SipUrl, v_ExpectedSipUrl); + } else { // No GRUU + return f_IMS_PTC_CheckHostPortForIPAddrOrFQDN(v_HostPort, p_Port, p_AllowFQDN); + } + } + + /* + * @desc RAN type as stored at the IMS PTC; at the beginning the RAN type is omit => '?' is returned in this case + * @return template (present) charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_RanType_GetString() runs on IMS_PTC return template (present) charstring + { // when RanType is not explicitly initialised it is omit as initialised; => we check for presence only + if (isvalue(vc_IMS_Global.ImsInfo.RanType)) { + return f_IMS_RANType2Charstring(vc_IMS_Global.ImsInfo.RanType); + } + return ?; + } + + /* + * @desc return true when SigComp is started + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_SigCompStarted() runs on IMS_PTC return boolean + { + return vc_IMS_Global.ImsInfo.SigCompStarted; + } + + /* + * @desc return sig comp parameters or omit when sig comp is not started + * @return template (omit) GenericParam + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_GetSigCompParam() runs on IMS_PTC return template (omit) GenericParam + { + if (vc_IMS_Global.ImsInfo.SigCompStarted) { + return cs_SigCompParam; + } else { + return omit; + } + } + + //---------------------------------------------------------------------------- + /* + * @desc return specific public user id e.g. as used for registration + * @param p_IdType + * @param p_DialogIndex (default value: omit) + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_GetURI(IMS_UriInfo_UriType_Type p_IdType, + template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return charstring + { + var IMS_DialogInfo_Type v_Dialog := fl_IMS_PTC_ImsInfo_GetDialog(p_DialogIndex); + + select (p_IdType) { + case (firstId, defaultId, emergencyId) { + return vc_IMS_Global.ImsInfo.IMPUList[0]; + } + case (secondId) { + return vc_IMS_Global.ImsInfo.IMPUList[1]; + } + case (thirdId) { + return vc_IMS_Global.ImsInfo.IMPUList[2]; + } + case (registrationId, gruu) { /* @sic R5-153760: support of gruu; same URI as used by the UE in the To header of the REGISTER message sic@ */ + if (ispresent(vc_IMS_Global.ImsInfo.Registration.Uri)) { + return vc_IMS_Global.ImsInfo.Registration.Uri; + } + } + case (dialogLocalId) { + if (ispresent(v_Dialog.LocalURI)) { + return v_Dialog.LocalURI; + } + } + case (dialogRemoteId) { + if (ispresent(v_Dialog.RemoteURI)) { + return v_Dialog.RemoteURI; + } + } + case (temporaryId) { + return f_IMS_TemporaryPublicUserIdentity(px_IMSI_Def); + } + } + FatalError(__FILE__, __LINE__, "Invalid URI or URI not initialised"); + return ""; + } + + /* + * @desc return SipUrl to be used in DL + * @param p_IdType + * @param p_Port (default value: omit) + * @param p_DialogIndex (default value: omit) + * @return template (value) SipUrl + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_GetSipUriTX(IMS_UriInfo_UriType_Type p_IdType, + template (omit) integer p_Port := omit, + template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return template (value) SipUrl + { /* @sic R5s150382 change 1: p_DialogIndex sic@ */ + return f_SIP_BuildSipUri_TX(f_IMS_PTC_ImsInfo_GetURI(p_IdType, p_DialogIndex), p_Port); + } + + /* + * @desc return SipUrl to be used in UL + * @param p_IdType + * @param p_Port (default value: omit) + * @param p_DialogIndex (default value: omit) + * @return template (present) SipUrl + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_PTC_ImsInfo_GetSipUriRX(IMS_UriInfo_UriType_Type p_IdType, + template integer p_Port := omit, + template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return template (present) SipUrl + { /* @sic R5s150382 change 1: p_DialogIndex sic@ */ + return f_SIP_BuildSipUri_RX(f_IMS_PTC_ImsInfo_GetURI(p_IdType, p_DialogIndex), p_Port); + } + + /* + * @desc return all PublicUserIds for which the UE is registered or shall be registered + * @return CharStringList_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_GetAllIMPUs() runs on IMS_PTC return CharStringList_Type + { + return vc_IMS_Global.ImsInfo.IMPUList; + } + + /* + * @desc return SipUrl as used for subscription + * @param p_Port (default value: omit) + * @return template (present) SipUrl + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_GetSipUriSubscriptionRX(template integer p_Port := omit) runs on IMS_PTC return template (present) SipUrl + { + var charstring v_PublicUserIdDefault := f_IMS_PTC_ImsInfo_GetURI(defaultId); + var charstring v_PublicUserIdRegistration := f_IMS_PTC_ImsInfo_GetURI(registrationId); + var template (present) SipUrl v_SipUrl; + + if (px_UEwithISIM and (v_PublicUserIdDefault != v_PublicUserIdRegistration)) { + v_SipUrl := (f_SIP_BuildSipUri_RX(v_PublicUserIdDefault, p_Port), f_SIP_BuildSipUri_RX(v_PublicUserIdRegistration, p_Port)); + } else { + v_SipUrl := f_SIP_BuildSipUri_RX(v_PublicUserIdDefault, p_Port); + } + return v_SipUrl; + } + + /* + * @desc Initialise structure of type IMS_DialogInfo_Type + * @param p_DialogInfo + * @param p_CseqType + * @param p_MessageHeader_InviteOrReferOrSubscribe + * @return IMS_DialogInfo_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_DialogInfo_Init(IMS_DialogInfo_Type p_DialogInfo, + IMS_PTC_CseqType_Type p_CseqType, + MessageHeader p_MessageHeader_InviteOrReferOrSubscribe) return IMS_DialogInfo_Type + { + var charstring v_FromURI := f_SIP_SipUrl2Str(f_Addr_Union_GetSipUrl(p_MessageHeader_InviteOrReferOrSubscribe.fromField.addressField)); + var charstring v_ToURI := f_SIP_SipUrl2Str(f_Addr_Union_GetSipUrl(p_MessageHeader_InviteOrReferOrSubscribe.toField.addressField)); + var charstring v_FromTag := f_MessageHeader_GetFromTag(p_MessageHeader_InviteOrReferOrSubscribe); + var integer v_CseqValue := p_MessageHeader_InviteOrReferOrSubscribe.cSeq.seqNumber; + var IMS_DialogInfo_Type v_Dialog := p_DialogInfo; + + select (p_CseqType) { + case (dialogLocal) { /* MT establishment of the dialog */ + v_Dialog.LocalURI := v_FromURI; /* @sic R5s140121 change 2.2: needs to be v_FromURI instead of v_ToURI sic@ */ + v_Dialog.RemoteURI := v_ToURI; /* @sic R5s140121 change 2.2: needs to be v_ToURI instead of v_FromURI sic@ */ + v_Dialog.MobileOriginated := false; + v_Dialog.LocalTag := v_FromTag; + v_Dialog.RemoteTag := omit; /* @sic R5s130497 change 1 - MCC160 implementation sic@ */ + v_Dialog.LocalCseq := v_CseqValue; + } + case (dialogRemote) { /* MO establishment of the dialog */ + v_Dialog.LocalURI := v_ToURI; /* @sic R5s140121 change 2.2: needs to be v_ToURI instead of v_FromURI sic@ */ + v_Dialog.RemoteURI := v_FromURI; /* @sic R5s140121 change 2.2: needs to be v_FromURI instead of v_ToURI sic@ */ + v_Dialog.MobileOriginated := true; + v_Dialog.LocalTag := omit; /* @sic R5s130497 change 1 - MCC160 implementation sic@ */ + v_Dialog.RemoteTag := v_FromTag; + v_Dialog.RemoteCseq := v_CseqValue; + } + case else { + FatalError (__FILE__, __LINE__, ""); + } + } + + v_Dialog.CallId := p_MessageHeader_InviteOrReferOrSubscribe.callId.callid; + if (ispresent(p_MessageHeader_InviteOrReferOrSubscribe.sessionId)) { + v_Dialog.SessionId := p_MessageHeader_InviteOrReferOrSubscribe.sessionId.sessid; + } + return v_Dialog; + } + + /* + * @desc Initialise global variables for SIP dialog + * @param p_CseqType + * @param p_MessageHeader_InviteOrReferOrSubscribe + * @param p_DialogIndex (default value: omit) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_DialogInit(IMS_PTC_CseqType_Type p_CseqType, + MessageHeader p_MessageHeader_InviteOrReferOrSubscribe, + template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC + { /* @sic R5s140017 MCC160 implementation: ToTag replaced by RemoteTag and LocalTag; additional state variables: CallId, SessionId sic@ */ + /* @sic R5sXXXXXX function may be used for REFER dialog as well (-> e.g. test case 15.21) sic@ */ + var IMS_DialogInfo_Type v_Dialog := fl_IMS_PTC_ImsInfo_GetDialog(p_DialogIndex); + + v_Dialog := f_IMS_DialogInfo_Init(v_Dialog, p_CseqType, p_MessageHeader_InviteOrReferOrSubscribe); + fl_IMS_PTC_ImsInfo_SetDialog(p_DialogIndex, v_Dialog); + } + + /* + * @desc check whether given dialog is started + * @param p_DialogIndex (default value: omit) + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_PTC_ImsInfo_DialogIsStarted(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return boolean + { + var IMS_DialogInfo_Type v_Dialog := fl_IMS_PTC_ImsInfo_GetDialog(p_DialogIndex); + return ispresent(v_Dialog.CallId); + } + + /* + * @desc release a SIP dialog + * @param p_DialogIndex (default value: omit) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_PTC_ImsInfo_DialogRelease(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC + { + fl_IMS_PTC_ImsInfo_SetDialog(p_DialogIndex, valueof(cs_IMS_DialogInfo_Init)); + } + + /* + * @desc returns true if a dialog is released already + * @param p_DialogIndex (default value: omit) + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) + */ + function f_IMS_PTC_ImsInfo_DialogIsReleased(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return boolean + { + var template (omit) charstring v_LocalTag := f_IMS_PTC_ImsInfo_DialogGetLocalTag(p_DialogIndex); + var template (omit) charstring v_RemoteTag := f_IMS_PTC_ImsInfo_DialogGetRemoteTag(p_DialogIndex); + return (not isvalue(v_LocalTag) and not isvalue(v_RemoteTag)); + } + + /* + * @desc set active dialog, i.e. dialog of which global procedures take dialog state info + * @param p_Index + * @status APPROVED (IMS, LTE_A) + */ + function f_IMS_PTC_ImsInfo_ActivateDialog(IMS_PTC_DialogIndex_Type p_Index) runs on IMS_PTC + { /* @sic R5s140092 change 1.5: new function sic@ */ + vc_IMS_Global.ImsInfo.Dialog.CurrentIndex := fl_IMS_PTC_ImsInfo_GetDialogIndexValue(p_Index); + } + + /* + * @desc function to set local tag acc. to response for INVITE (MO call setup) + * @param p_Tag + * @param p_DialogIndex (default value: omit) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_DialogSetLocalTag(charstring p_Tag, + template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC + { + var IMS_DialogInfo_Type v_Dialog := fl_IMS_PTC_ImsInfo_GetDialog(p_DialogIndex); + v_Dialog.LocalTag := p_Tag; + fl_IMS_PTC_ImsInfo_SetDialog(p_DialogIndex, v_Dialog); + } + + /* + * @desc function to set remote tag acc. to response for INVITE (MT call setup) + * @param p_Tag + * @param p_DialogIndex (default value: omit) + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_PTC_ImsInfo_DialogSetRemoteTag(charstring p_Tag, + template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC + { + var IMS_DialogInfo_Type v_Dialog := fl_IMS_PTC_ImsInfo_GetDialog(p_DialogIndex); + v_Dialog.RemoteTag := p_Tag; + fl_IMS_PTC_ImsInfo_SetDialog(p_DialogIndex, v_Dialog); + } + + /* + * @desc function to be used to get local tag for sending any request to a UE within a dialog (e.g. PRACK, BYE etc.) + * @param p_DialogIndex (default value: omit) + * @return template (omit) charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_DialogGetLocalTag(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return template (omit) charstring + { + var IMS_DialogInfo_Type v_Dialog := fl_IMS_PTC_ImsInfo_GetDialog(p_DialogIndex); + return v_Dialog.LocalTag; + } + + /* + * @desc function to be used to get remote tag for sending any request to a UE within a dialog (e.g. PRACK, BYE etc.) + * @param p_DialogIndex (default value: omit) + * @return template (omit) charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_DialogGetRemoteTag(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return template (omit) charstring + { + var IMS_DialogInfo_Type v_Dialog := fl_IMS_PTC_ImsInfo_GetDialog(p_DialogIndex); + return v_Dialog.RemoteTag; + } + + /* + * @desc function to get call id of the current dialog + * @param p_DialogIndex (default value: omit) + * @return template (value) CallId + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_DialogGetCallId(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return template (value) CallId + { + var IMS_DialogInfo_Type v_Dialog := fl_IMS_PTC_ImsInfo_GetDialog(p_DialogIndex); + return cs_CallId(v_Dialog.CallId); + } + + /* + * @desc function to get session id of the current dialog + * @desc function to be used to get remote tag for sending any request to a UE within a dialog (e.g. PRACK, BYE etc.) + * @param p_DialogIndex (default value: omit) + * @return template (omit) SessionId + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_DialogGetSessionId(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return template (omit) SessionId + { + var IMS_DialogInfo_Type v_Dialog := fl_IMS_PTC_ImsInfo_GetDialog(p_DialogIndex); + var template (omit) SessionId v_SessionId := omit; + if (ispresent(v_Dialog.SessionId)) { + v_SessionId := cs_SessionId(v_Dialog.SessionId); + } + return v_SessionId; + } + + /* + * @desc get previous SDP message (sent by the UE) + * @param p_DialogIndex (default value: omit) + * @return template (omit) SDP_Message + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_PTC_ImsInfo_DialogGetPrevSdpMessageRX(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return template (omit) SDP_Message + { + var IMS_DialogInfo_Type v_Dialog := fl_IMS_PTC_ImsInfo_GetDialog(p_DialogIndex); + return v_Dialog.SdpMessagePrevRX; + } + + /* + * @desc store SDP message (sent by the UE) + * @param p_SDP_Message + * @param p_DialogIndex (default value: omit) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_PTC_ImsInfo_DialogSetPrevSdpMessageRX(template (omit) SDP_Message p_SDP_Message, + template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC + { + var IMS_DialogInfo_Type v_Dialog := fl_IMS_PTC_ImsInfo_GetDialog(p_DialogIndex); + if (isvalue(p_SDP_Message)) { /* @sic R5s150666, R5-153525 sic@ */ + v_Dialog.SdpMessagePrevRX := valueof(p_SDP_Message); + } else { + v_Dialog.SdpMessagePrevRX := omit; + } + fl_IMS_PTC_ImsInfo_SetDialog(p_DialogIndex, v_Dialog); + } + + /* + * @desc set SDP session version to be used in DL + * @param p_SessVersion + * @param p_DialogIndex (default value: omit) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_PTC_ImsInfo_DialogSetSessVersionTX(integer p_SessVersion, + template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC + { /* @sic R5-150707: new function to allow to set session version needs to specific values by a test case sic@ */ + var IMS_DialogInfo_Type v_Dialog := fl_IMS_PTC_ImsInfo_GetDialog(p_DialogIndex); + v_Dialog.SdpSessionVersionTX := p_SessVersion; + fl_IMS_PTC_ImsInfo_SetDialog(p_DialogIndex, v_Dialog); + } + + /* + * @desc get SDP session version to be used in DL + * @param p_DialogIndex (default value: omit) + * @return integer + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_PTC_ImsInfo_DialogGetSessVersionTX(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return integer + { + var IMS_DialogInfo_Type v_Dialog := fl_IMS_PTC_ImsInfo_GetDialog(p_DialogIndex); + return v_Dialog.SdpSessionVersionTX; + } + + /* + * @desc get next session version for DL + * @param p_DialogIndex (default value: omit) + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_PTC_ImsInfo_DialogIncrAndGetSessVersionTX(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return charstring + { /* @sic R5-150707: replaces f_IMS_PTC_SDP_SessVersionIndex_GetNext and f_IMS_SDP_SessVersion_GetNext sic@ + NOTE: when session version needs to be set to specific values by a test case we cannot use an index anymore to increment the value */ + + var integer v_SdpSessionVersionTX := f_IMS_PTC_ImsInfo_DialogGetSessVersionTX(p_DialogIndex) + 1; + f_IMS_PTC_ImsInfo_DialogSetSessVersionTX(v_SdpSessionVersionTX, p_DialogIndex); + + return int2str(v_SdpSessionVersionTX); + } + + /* + * @desc set SDP session id to be used in DL + * @param p_SessId + * @param p_DialogIndex (default value: omit) + * @status APPROVED (IMS) + */ + function f_IMS_PTC_ImsInfo_DialogSetSessIdTX(charstring p_SessId, + template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC + { /* @sic R5-150707: new function sic@ */ + var IMS_DialogInfo_Type v_Dialog := fl_IMS_PTC_ImsInfo_GetDialog(p_DialogIndex); + v_Dialog.SdpSessionIdTX := p_SessId; + fl_IMS_PTC_ImsInfo_SetDialog(p_DialogIndex, v_Dialog); + } + + /* + * @desc set SDP session id to be used in DL + * @param p_DialogIndex (default value: omit) + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_PTC_ImsInfo_DialogGetSessIdTX(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return charstring + { + var IMS_DialogInfo_Type v_Dialog := fl_IMS_PTC_ImsInfo_GetDialog(p_DialogIndex); + return v_Dialog.SdpSessionIdTX; + } + + /* + * @desc returns true when the current dialog is MO + * @param p_DialogIndex (default value: omit) + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_PTC_ImsInfo_DialogIsMO(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return boolean + { + var IMS_DialogInfo_Type v_Dialog := fl_IMS_PTC_ImsInfo_GetDialog(p_DialogIndex); + if (not ispresent(v_Dialog.MobileOriginated)) { + FatalError(__FILE__, __LINE__, "no dialog established"); + } + return v_Dialog.MobileOriginated; + } + + //---------------------------------------------------------------------------- + /* + * @desc return contact address as provided in contact header of the REGISTER message + * @return SipUrl + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_GetContactUrl() runs on IMS_PTC return SipUrl + { + return vc_IMS_Global.ImsInfo.ContactUrl; + } + + /* + * @desc return Contact header as stored + * @param p_ContactUrl + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_SetContactUrl(SipUrl p_ContactUrl) runs on IMS_PTC + { /* shall be used when subsequent REGISTER has been received during registration */ + vc_IMS_Global.ImsInfo.ContactUrl := p_ContactUrl; + } + + /* + * @desc return CallId that has been used for registration + * @return template (omit) charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_PTC_ImsInfo_GetCallIdRegistration() runs on IMS_PTC return template (omit) charstring + { + return vc_IMS_Global.ImsInfo.Registration.CallId; + } + + /* + * @desc generate a call id derived from the NW's IP address (see examples in RFC 3261) + * @param p_Method + * @return charstring + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_PTC_GenerateCallId(charstring p_Method) runs on IMS_PTC return charstring + { /* p_Method .. e.g. "INVITE" */ + var integer v_CallIdCnt := vc_IMS_Global.ImsInfo.CallIdCnt; + + vc_IMS_Global.ImsInfo.CallIdCnt := v_CallIdCnt + 1; + return p_Method & "-" & int2str(v_CallIdCnt) & "-7dec-11d0-a765-00a0c91e6bf6@" & f_IMS_PTC_NW_Address_GetAddrStr(); /* @sic R5-133705: CallIdCnt to achieve unique callids sic@ */ + } + + /* + * @desc return transport protocol (UDP/TCP) to be used for requests in DL + * @return InternetProtocol_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_GetTransportProtocol() runs on IMS_PTC return InternetProtocol_Type + { + return vc_IMS_Global.ImsInfo.TransportProtocol; + } + + /* + * @desc get CSeq for respective message + * @param p_CseqType + * @param p_DialogIndex (default value: omit) + * @return template (omit) integer + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_CseqGet(IMS_PTC_CseqType_Type p_CseqType, + template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return template (omit) integer + { /* @sic R5s140235: return value changed to "template (omit)" sic@ */ + var IMS_DialogInfo_Type v_Dialog := fl_IMS_PTC_ImsInfo_GetDialog(p_DialogIndex); + var template (omit) integer v_CseqValue; + + select (p_CseqType) { + case (register) { v_CseqValue := vc_IMS_Global.ImsInfo.Registration.Cseq; } + case (dialogRemote) { v_CseqValue := v_Dialog.RemoteCseq; } + case (dialogLocal) { v_CseqValue := v_Dialog.LocalCseq; } + case else { FatalError (__FILE__, __LINE__, ""); } + } + return v_CseqValue; + } + + /* + * @desc get CSeq for respective message + * @param p_CseqType + * @param p_DialogIndex (default value: omit) + * @return integer + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_CseqGetValue(IMS_PTC_CseqType_Type p_CseqType, + template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return integer + { /* @sic R5s140235: new function sic@ */ + var template (omit) integer v_Cseq := f_IMS_PTC_ImsInfo_CseqGet(p_CseqType, p_DialogIndex); + + if (not isvalue(v_Cseq)) { + FatalError(__FILE__, __LINE__, "no valid Cseq yet"); + } + return valueof(v_Cseq); + } + + /* + * @desc set CSeq for respective message + * @param p_CseqType + * @param p_CseqValue + * @param p_DialogIndex (default value: omit) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_CseqSet(IMS_PTC_CseqType_Type p_CseqType, + integer p_CseqValue, + template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC + { + var IMS_DialogInfo_Type v_Dialog := fl_IMS_PTC_ImsInfo_GetDialog(p_DialogIndex); + select (p_CseqType) { + case (register) { vc_IMS_Global.ImsInfo.Registration.Cseq := p_CseqValue; } + case (dialogRemote) { v_Dialog.RemoteCseq := p_CseqValue; } + case (dialogLocal) { v_Dialog.LocalCseq := p_CseqValue; } + case else { FatalError (__FILE__, __LINE__, ""); } + } + fl_IMS_PTC_ImsInfo_SetDialog(p_DialogIndex, v_Dialog); + } + + /* + * @desc increment CSeq for respective message + * @param p_CseqType + * @param p_DialogIndex (default value: omit) + * @return integer + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_CseqIncr(IMS_PTC_CseqType_Type p_CseqType, + template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return integer + { /* @sic R5s140235: Cseq may be omit sic@ */ + var integer v_CseqValue := f_IMS_PTC_ImsInfo_CseqGetValue(p_CseqType, p_DialogIndex) + 1; + f_IMS_PTC_ImsInfo_CseqSet(p_CseqType, v_CseqValue, p_DialogIndex); + return v_CseqValue; + } + + /* + * @desc return appropriate branch value + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_GetNextBranch() runs on IMS_PTC return charstring + { /* @sic R5s130561 change 4: addtional branch values sic@ */ + const CharStringList_Type tsc_TagList := { "1234567890", "2345678901", "3456789012", "4567890123", "5678901234", "6789012345", "7890123456", "8901234567", "9012345678", "0123456789", + "0987654321", "9876543210", "8765432109", "7654321098", "6543210987", "5432109876", "4321098765", "3210987654", "2109876543", "1098765432", + "0987654320", "9876543200", "8765432009", "7654320098", "6543200987", "5432009876", "4320098765", "3200987654", "2009876543", "0098765432", + "0987654300", "9876543000", "8765430009", "7654300098", "6543000987", "5430009876", "4300098765", "3000987654", "0009876543", "0098765430", + "0987654000", "9876540000", "8765400009", "7654000098", "6540000987", "5400009876", "4000098765", "0000987654", "0009876540", "0098765400" }; + var charstring v_Branch; + + if (vc_IMS_Global.ImsInfo.BranchIndex >= lengthof(tsc_TagList)) { + FatalError (__FILE__, __LINE__, "not enough branches"); + } + + v_Branch := c_branchCookie & tsc_TagList[vc_IMS_Global.ImsInfo.BranchIndex]; + vc_IMS_Global.ImsInfo.BranchIndex := vc_IMS_Global.ImsInfo.BranchIndex + 1; + return v_Branch; + } + + + /* + * @desc provide latest HomeDomainName + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_GetHomeDomainName() runs on IMS_PTC return charstring + { + return vc_IMS_Global.ImsInfo.HomeDomainName; + } + + /* + * @desc provide latest HomeDomainName + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ImsInfo_GetPrivateUserId() runs on IMS_PTC return charstring + { + return vc_IMS_Global.ImsInfo.PrivateUserId; + } + + function f_IMS_PTC_ImsInfo_Refresh(charstring p_HomeDomainName, + charstring p_PrivateUserId, + CharStringList_Type p_IMPUList) runs on IMS_PTC + { + vc_IMS_Global.ImsInfo.HomeDomainName := p_HomeDomainName; + vc_IMS_Global.ImsInfo.PrivateUserId := p_PrivateUserId; + vc_IMS_Global.ImsInfo.IMPUList := p_IMPUList; + } + + /* + * @desc reset ImsInfo, Security and 'IgnoreReset' flag as it is before initial registration + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_Reset() runs on IMS_PTC + { /* @sic R5s150031: new common function sic@ */ + vc_IMS_Global.ImsInfo := valueof(cs_IMS_ImsInfo_Init(vc_IMS_Global.ImsInfo.RanType, + vc_IMS_Global.ImsInfo.UE_Release, + vc_IMS_Global.ImsInfo.HomeDomainName, + vc_IMS_Global.ImsInfo.PrivateUserId, + vc_IMS_Global.ImsInfo.SecurityScheme, + vc_IMS_Global.ImsInfo.BranchIndex)); /* @sic R5s140802 sic@ */ + vc_IMS_Global.Security := valueof(cs_IMS_SecurityInfo_Init); + vc_IMS_Global.Ctrl.IgnoreReset := true; + } + + //**************************************************************************** + /* + * @desc to deal with entry and exit of the test body + * @param p_TestBodyFlag + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) + */ + function f_IMS_TestBody_Set(boolean p_TestBodyFlag) runs on IMS_PTC + { + vc_IMS_Global.Ctrl.TestBody := p_TestBodyFlag; + } + + /* + * @desc check whether test body is active + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_IMS_TestBody_Check() runs on IMS_PTC return boolean + { + return vc_IMS_Global.Ctrl.TestBody; + } + + /* + * @desc to block UL data from default handling + * @param p_BlockUlDataInDefault + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_BlockUlDataInDefault_Set(boolean p_BlockUlDataInDefault) runs on IMS_PTC + { + vc_IMS_Global.Ctrl.BlockUlDataInDefault := p_BlockUlDataInDefault; + } + + /* + * @desc set correct verdict: FAIL is assigned only when being in the test body + * @param p_FileName + * @param p_LineNo + * @param p_Msg + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_SetVerdictFailOrInconc(charstring p_FileName, + LineNo_Type p_LineNo, + charstring p_Msg) runs on IMS_PTC + { + if (fl_IMS_TestBody_Check()) { + f_SetVerdict(fail, p_FileName, p_LineNo, p_Msg); + } else { + f_SetVerdict(inconc, p_FileName, p_LineNo, p_Msg); + } + self.kill; // => test case will terminate immediately + } + + /* + * @desc set correct verdict: prelininary PASS is only be assigned when being in the test body + * @param p_FileName + * @param p_LineNo + * @param p_Msg + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_IRAT) + */ + function f_IMS_PreliminaryPass(charstring p_FileName, + LineNo_Type p_LineNo, + charstring p_Msg) runs on IMS_PTC + { + if (fl_IMS_TestBody_Check()) { + f_SetVerdict(pass, p_FileName, p_LineNo, p_Msg); + } + } + + //**************************************************************************** + + template (present) IMS_CONFIG_CNF cr_IMS_CONFIG_CNF_Any := ?; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + /* + * @desc Default behaviour for test cases when the IMS behaviour is matter of the test purpose + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + altstep a_IMS_PTC_DefaultBehaviour_TestcaseSpecificImsHandling() runs on IMS_PTC + { + var boolean v_IgnoreReset := vc_IMS_Global.Ctrl.IgnoreReset; + + [v_IgnoreReset] IPCAN.receive(cmr_IPCAN_IMS_Reset) { + repeat; + } + [] IMS_CTRL.receive(cr_IMS_CONFIG_CNF_Any) { + all timer.stop; + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "unexpected receive event at the IMS_CTRL port"); + } + [not vc_IMS_Global.Ctrl.BlockUlDataInDefault] IMS_Server.receive(cr_IMS_DATA_REQ_Any) { /* @sic R5s140780 - MCC160 Implementation sic@ */ + all timer.stop; + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "unexpected receive event at the IMS_Server port"); + } + [not vc_IMS_Global.Ctrl.BlockUlDataInDefault] IMS_Client.receive(cr_IMS_DATA_RSP_Any) { /* @sic R5s140780 - MCC160 Implementation sic@ */ + all timer.stop; + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "unexpected receive event at the IMS_Client port"); + } + [] any timer.timeout { + all timer.stop; + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "unexpected timeout"); + } + } + + /* + * @desc Default behaviour for default IMS handling + * when IMS PTC shall only deal with IMS messages as for the initial registration + * but IMS behavour is not matter of the test purpose + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + altstep a_IMS_PTC_DefaultBehaviour_DefaultImsHandling() + { + [] any port.receive { + f_ErrorLog(__FILE__, __LINE__, "unexpected message (skipped)"); + repeat; + } + [] any timer.timeout { + f_ErrorLog(__FILE__, __LINE__, "unexpected timeout"); + repeat; + } + } + + /* + * @desc default handler to be activated on top of regular default handler to deal with repetitions of SIP requests (especially REGISTER request) + * @param p_IMS_DATA_REQ + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + altstep a_IMS_RetransmissionHandler(IMS_DATA_REQ p_IMS_DATA_REQ) runs on IMS_PTC + { + var template (present) IMS_RoutingInfo_Type v_RoutingInfo := p_IMS_DATA_REQ.RoutingInfo; + var template (present) IMS_Request_Type v_IMS_Request := p_IMS_DATA_REQ.Request; /* repeated message has to be exactly the same (especially cseq) */ + + [] IMS_Server.receive(cr_IMS_DATA_REQ_Any(v_RoutingInfo, v_IMS_Request)) { repeat; } + } + + /* + * @desc to activate the standard default behaviour or default behaviour for test case specific IMS handling + * @param p_Handling + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_ActivateDefault(IMS_PTC_Handling_Type p_Handling) runs on IMS_PTC + { + deactivate(vc_IMS_Global.Ctrl.Default); + + select (p_Handling) { + case (testcaseSpecificHandling) { + vc_IMS_Global.Ctrl.Default := activate(a_IMS_PTC_DefaultBehaviour_TestcaseSpecificImsHandling()); + } + case (defaultHandling) { + vc_IMS_Global.Ctrl.Default := activate(a_IMS_PTC_DefaultBehaviour_DefaultImsHandling()); + } + case else { + FatalError (__FILE__, __LINE__, "unknown default behaviour"); + } + } + } + + //**************************************************************************** + /* + * @desc initialisiation of IMS PTC + * @param p_PdnIndex (default value: PDN_1) + * @param p_Handling (default value: testcaseSpecificHandling) + * @param p_SecurityScheme (default value: omit) + * @param p_RanType (default value: omit) + * @param p_UE_Release (default value: omit) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_Init(PDN_Index_Type p_PdnIndex := PDN_1, + IMS_PTC_Handling_Type p_Handling := testcaseSpecificHandling, + template (omit) IMS_SecurityScheme_Type p_SecurityScheme := omit, + template (omit) IPCAN_RAN_Type p_RanType := omit, + template (omit) integer p_UE_Release := omit) runs on IMS_PTC + { /* @sic R5s130651: new parameter p_PdnIndex sic@ */ + /* @sic R5s130756 additional changes: new parameter p_SecurityScheme sic@ */ + /* @sic R5s130756: new parameter p_Pcscf sic@ */ + /* @sic R5-144747: removal of px_IMS_Pcscf and px_IMS_Pcscf_Emg => p_Pcscf removed sic@ */ + var charstring v_HomeDomainName; + var charstring v_PrivateUserId; + var IMS_SecurityScheme_Type v_SecurityScheme; + + if (px_UEwithISIM) { /* @sic R5-133628: check of temporary user id sic@ */ + v_HomeDomainName := px_IMS_HomeDomainName; + v_PrivateUserId := px_IMS_Private_UserId; + } else { + v_HomeDomainName := f_IMS_HomeDomainNameDerivedFromIMSI(px_IMSI_Def); + v_PrivateUserId := f_IMS_PrivateUserIdentityDerivedFromIMSI(px_IMSI_Def); + } + if (ispresent(p_SecurityScheme)) { + v_SecurityScheme := valueof(p_SecurityScheme); + } else if (pc_IMS_GIBA_Sec and not pc_IMS_Sec) { + v_SecurityScheme := GIBA; + } else if (pc_IMS_Sec) { + v_SecurityScheme := IMS_Security; + } else { + FatalError(__FILE__, __LINE__, "Invalid security setting (neither pc_IMS_GIBA_Sec nor pc_IMS_Sec is set)"); + } + + vc_IMS_Global.PdnIndex := p_PdnIndex; + vc_IMS_Global.Ctrl.TestBody := false; + vc_IMS_Global.Ctrl.BlockUlDataInDefault := false; /* @sic R5s140780 - MCC160 Implementation sic@ */ + vc_IMS_Global.Ctrl.IgnoreReset := true; /* @sic R5s150031: IMS is already reset after initialisation sic@ */ + vc_IMS_Global.Ctrl.Default := null; + vc_IMS_Global.Security := valueof(cs_IMS_SecurityInfo_Init); + vc_IMS_Global.ImsInfo := valueof(cs_IMS_ImsInfo_Init(p_RanType, p_UE_Release, v_HomeDomainName, v_PrivateUserId, v_SecurityScheme)); + + f_IMS_PTC_ActivateDefault(p_Handling); + } + + /* + * @desc create IMS component + * @return IMS_PTC + * @status APPROVED (IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_Create() return IMS_PTC + { + var IMS_PTC v_IMS_PTC := IMS_PTC.create alive; + return v_IMS_PTC; + } + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_EmgFunctions.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_EmgFunctions.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..82b7113327df89108744bc0d4f98c327198afe70 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_EmgFunctions.ttcn @@ -0,0 +1,32 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2014-08-10 11:24:52 +0200 (Sun, 10 Aug 2014) $ +// $Rev: 11869 $ +/******************************************************************************/ + +module IMS_EmgFunctions { + + import from IMS_CommonParameters all; + import from TestcaseProperties all; + + //**************************************************************************** + // common functions for IMS Emg Call 34.229 cl. 19, split over 2 ATSs + //---------------------------------------------------------------------------- + + /* + * @desc Determine if Geololcation info is to be used in the test case + * If feature is supported and test case wants it + * @return boolean + * @status APPROVED (IMS, IMS_IRAT) + */ + function f_IMS_GetGeolocationUsage() return boolean + { + return (pc_IMS_Geolocation and f_GetTestcaseAttrib_GeolocationInformation(testcasename())) + } + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_IP_Config.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_IP_Config.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..53de7b041dd34d3f9fdaa1a4bf88f7e314209698 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_IP_Config.ttcn @@ -0,0 +1,179 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-04-25 09:25:26 +0200 (Sat, 25 Apr 2015) $ +// $Rev: 13507 $ +/******************************************************************************/ + +module IMS_IP_Config { + + import from CommonDefs all; + import from IMS_Component all; + import from IP_ASP_TypeDefs all; + import from IMS_ASP_TypeDefs all; + + //**************************************************************************** + // ASP Templates: + //---------------------------------------------------------------------------- + + template (value) IMS_SecurityInfo_Type cs_IMS_SecurityInfo(template (value) IMS_ProtectedPorts_Type p_ProtectedPorts, + template (value) IMS_SPIs_Type p_SPIs, + IPsec_IntegrityAlgorithm_Type p_IntegrityAlgorithm, + IPsec_CipheringAlgorithm_Type p_CipheringAlgorithm) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + ProtectedPorts := p_ProtectedPorts, + SPIs := p_SPIs, + IntegrityAlgorithm := p_IntegrityAlgorithm, + CipheringAlgorithm := p_CipheringAlgorithm + }; + + template (value) IMS_RegistrationInfo_Type cs_IMS_RegistrationInfo(IP_AddrInfo_Type p_NW_Address, + IP_AddrInfo_Type p_UE_Address, + template (omit) IMS_SecurityInfo_Type p_SecurityInfo := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + NW_Address := p_NW_Address, + UE_Address := p_UE_Address, + SecurityInfo := p_SecurityInfo + }; + + template (value) IMS_PortsAndSecurityConfigReq_Type cs_IMS_PortsAndSecurityConfig(template (omit) PortNumber_Type p_UnprotectedPort_us, + template (omit) IMS_RegistrationInfo_Type p_RegistrationInfo) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + UnprotectedPort_us := p_UnprotectedPort_us, + RegistrationInfo := p_RegistrationInfo + }; + + template (value) IPsec_SecurityKeys_Type cs_IPsecKeys(bitstring p_MD5_96Key, + bitstring p_SHA_1_96Key, + bitstring p_DES_EDE3_CBCKey, + bitstring p_AES_CBCKey) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + MD5_96Key := p_MD5_96Key, + SHA_1_96Key := p_SHA_1_96Key, + DES_EDE3_CBCKey := p_DES_EDE3_CBCKey, + AES_CBCKey := p_AES_CBCKey + }; + + template (value) IMS_CONFIG_REQ cas_IMS_InstallKey_REQ(template (value) IPsec_SecurityKeys_Type p_InstallKey) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + InstallKey := p_InstallKey + }; + + template (value) IMS_CONFIG_REQ cas_IMS_PortsAndSecurityConfig_REQ(template (value) IMS_PortsAndSecurityConfigReq_Type p_PortsAndSecurityConfig) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + PortsAndSecurityConfig := p_PortsAndSecurityConfig + }; + + template (value) IMS_CONFIG_REQ cas_IMS_SecurityRelease_REQ := + { /* @status APPROVED (IMS) */ + /* @sic R5w150015: SecurityRelease gets Null_Type sic@ */ + SecurityRelease := true + }; + + template (value) IMS_CONFIG_REQ cas_IMS_CloseTCP_REQ := {CloseTCP := true}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + template (value) IMS_CONFIG_REQ cas_IMS_RegInfoRelease_REQ := {RegInfoRelease := true}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + template (present) IMS_CONFIG_CNF car_IMS_InstallKey_CNF := {InstallKey := true}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + template (present) IMS_CONFIG_CNF car_IMS_PortsAndSecurityConfig_CNF := {PortsAndSecurityConfig := ?}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + template (present) IMS_CONFIG_CNF car_IMS_SecurityRelease_CNF := {SecurityRelease := true}; /* @status APPROVED (IMS) */ + template (present) IMS_CONFIG_CNF car_IMS_CloseTCP_CNF := {CloseTCP := true}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + template (present) IMS_CONFIG_CNF car_IMS_RegInfoRelease_CNF := {RegInfoRelease := true}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + + /* + * @desc Common function to configure the IP PTC (send IMS_CONFIG_REQ, receive IMS_CONFIG_CNF) + * @param p_IMS_CONFIG_REQ + * @param p_IMS_CONFIG_CNF + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_IMS_ConfigureIP(template (value) IMS_CONFIG_REQ p_IMS_CONFIG_REQ, + template (present) IMS_CONFIG_CNF p_IMS_CONFIG_CNF) runs on IMS_PTC + { + f_IMS_BlockUlDataInDefault_Set(true); + IMS_CTRL.send(p_IMS_CONFIG_REQ); + IMS_CTRL.receive(p_IMS_CONFIG_CNF); + f_IMS_BlockUlDataInDefault_Set(false); + } + + //============================================================================ + // configuration of the IP PTC: + + /* + * @desc Computation of the IPsec keys according to "Key extension functions for IPsec ESP" in TS 33.203 Annex I; + * the keys are sent to the SS via the IP PTC + * @param p_IK + * @param p_CK + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_InstallIPsecKeys(B128_Type p_IK, + B128_Type p_CK) runs on IMS_PTC + { + var B64_Type v_Bitestring1 := substr(p_CK, 0, 64); + var B64_Type v_Bitestring2 := substr(p_CK, 64, 64); + var B128_Type v_MD5_96Key := p_IK; + var B160_Type v_SHA_1_96Key := p_IK & int2bit(0, 32); // 160 bits + var B192_Type v_DES_EDE3_CBCKey := v_Bitestring1 & v_Bitestring2 & v_Bitestring1; // 192 bits + var B128_Type v_AES_CBCKey := p_CK; // 128 bits + + fl_IMS_ConfigureIP(cas_IMS_InstallKey_REQ(cs_IPsecKeys(v_MD5_96Key, v_SHA_1_96Key, v_DES_EDE3_CBCKey, v_AES_CBCKey)), + car_IMS_InstallKey_CNF); /* @sic R5s140780 - MCC160 Implementation sic@ */ + } + + /* + * @desc configure ports and security at the SS + * @param p_UnprotectedPort_us + * @param p_RegistrationInfo + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PortsAndSecurityConfig(template (omit) PortNumber_Type p_UnprotectedPort_us, + template (omit) IMS_RegistrationInfo_Type p_RegistrationInfo := omit) runs on IMS_PTC + { /* configure IMS security; the IP PTC returns SPIs which it has assigned; + * p_SecurityInfo is omit in case of GIBA + * @sic R5s130266 change 1.3, 4, 5 - MCC160 Implementation: SPIs for re-authentication sic@ */ + /* @sic R5s150268 change 2: p_RegistrationInfo instead of p_NW_Address, p_UE_Address, p_SecurityInfo sic@ */ + + if (isvalue(p_RegistrationInfo.SecurityInfo)) { + if (valueof(p_RegistrationInfo.SecurityInfo.SPIs.SPI_us) == valueof(p_RegistrationInfo.SecurityInfo.SPIs.SPI_uc)) { + FatalError(__FILE__, __LINE__, "SPI_us and SPI_uc shall have different values"); + } + } + + fl_IMS_ConfigureIP(cas_IMS_PortsAndSecurityConfig_REQ(cs_IMS_PortsAndSecurityConfig(p_UnprotectedPort_us, p_RegistrationInfo)), + car_IMS_PortsAndSecurityConfig_CNF); /* @sic R5s140780 - MCC160 Implementation sic@ */ + } + + + /* + * @desc trigger IP PTC to release security related to this IMS PTC + * @status APPROVED (IMS) + */ + function f_IMS_Register_SecurityRelease() runs on IMS_PTC + { /* @sic R5w150015: p_SecurityInfo removed sic@ */ + fl_IMS_ConfigureIP(cas_IMS_SecurityRelease_REQ, + car_IMS_SecurityRelease_CNF); /* @sic R5s140780 - MCC160 Implementation sic@ */ + } + + /* + * @desc trigger IP PTC to release registration info related to this IMS PTC + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_RegisterInfo_Release() runs on IMS_PTC + { + fl_IMS_ConfigureIP(cas_IMS_RegInfoRelease_REQ, + car_IMS_RegInfoRelease_CNF); /* @sic R5s140780 - MCC160 Implementation sic@ */ + } + + /* + * @desc trigger IP PTC to close TCP connections related to this IMS PTC + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_CloseTCP() runs on IMS_PTC + { + fl_IMS_ConfigureIP(cas_IMS_CloseTCP_REQ, + car_IMS_CloseTCP_CNF); /* @sic R5s140780 - MCC160 Implementation sic@ */ + } +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_MessageBody_Templates.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_MessageBody_Templates.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..44292278f431e587466420a77e1150cf326bcd26 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_MessageBody_Templates.ttcn @@ -0,0 +1,129 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-06-01 18:14:24 +0200 (Mon, 01 Jun 2015) $ +// $Rev: 13618 $ +/******************************************************************************/ + +module IMS_MessageBody_Templates { + + import from LibSip_MessageBodyTypes all; + import from LibSip_SDPTypes all; + import from IMS_SDP_Messages all; + import from IMS_XML_Templates all; // !!!! temporary solution as long as IMS_XML_Templates contains definition of Reginfo_Type !!!! + + //**************************************************************************** + // MIME Message + //---------------------------------------------------------------------------- + + template (present) MIME_Message cr_MIME_Message := + { /* MIME encapsulation acc. to condition A8 in A.2.1 */ + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + boundary := ?, + mimeEncapsulatedList := { + { + content_type := ?, + content_disposition := *, + mime_encapsulated_part := { + sdpMessageBody := ? /* @sic R5w140112 sic@ */ + } + }, + { + content_type := ?, + content_disposition := *, + mime_encapsulated_part := { + xmlBody := ? // !!!! may need to be decoded and checked later on !!!! + } + } + } + }; + + //**************************************************************************** + // Message Body + //---------------------------------------------------------------------------- + + template (value) MessageBody cs_MessageBody_SDP(template (value) SDP_Message p_SDP) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + sdpMessageBody := f_IMS_SDP_Message_Encode(p_SDP) + }; + + template (value) MessageBody cs_MessageBody_RegInfo(template (value) Reginfo_Type p_RegInfo) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + xmlBody := oct2char(bit2oct(encvalue(p_RegInfo))) /* @sic R5s130195 BASELINE MOVING 2013 sic@ */ + }; + + template (value) MessageBody cs_MessageBody_SMS(template (value) octetstring p_SMS) := + { /* @status APPROVED (IMS) */ + smsMessage := p_SMS + }; + + template (present) MessageBody cr_MessageBody_SDP := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + sdpMessageBody := ? + }; + + template (present) MessageBody cr_MessageBody_MIME(template (present) MIME_Message p_MIME := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + mimeMessageBody:= p_MIME + }; + + template (present) MessageBody cr_MessageBody_SMS(template (present) octetstring p_SMS := ?) := + { /* @status APPROVED (IMS) */ + smsMessage := p_SMS + }; + + template (present) MessageBody cr_MessageBody_SipFrag(template (present) charstring p_SipFrag := ?) := + { + sipfrag := p_SipFrag + }; + + template (value) MessageBody cs_MessageBody_SipFrag(charstring p_SipFrag) := + { /* @status APPROVED (IMS) */ + sipfrag := p_SipFrag + }; + + // @sic R5s141138 sic@ + template (value) MessageBody cs_MessageBody_XML(template (value) Ims_3gpp_Type p_Ims3gpp) := + { /* @status APPROVED (IMS, IMS_IRAT) */ + xmlBody := oct2char(bit2oct(encvalue(p_Ims3gpp))) + }; + + template (value) MessageBody cs_MessageBody_XML_SRVCC(template (value) State_and_event_info_Type p_State_and_event_info) := + { + xmlBody := oct2char(bit2oct(encvalue(p_State_and_event_info))) + }; + + template (present) MessageBody cr_MessageBody_XML_SRVCC(template (present) State_and_event_info_Type p_State_and_event_info) := + { + xmlBody := oct2char(bit2oct(encvalue(p_State_and_event_info))) + }; + + //**************************************************************************** + // Message Body depending on conditions + //---------------------------------------------------------------------------- + + /* + * @desc to be used e.g. for INVITE when message body depends on condition A8 + * (UE uses Geolocation header to provide its geographical location for emergency session setup, + * has obtained its location and is setting up an emergency session) + * @param p_UseMIME + * @return template (present) MessageBody + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_SIP_MessageBodySDP_RX(boolean p_UseMIME) return template (present) MessageBody + { /* to be used e.g. for INVITE when message body depends on condition A8 (UE uses Geolocation header to provide its geographical location for emergency session setup, + has obtained its location and is setting up an emergency session) */ + var template (present) MessageBody v_MessageBody; + + if (p_UseMIME) { + v_MessageBody := cr_MessageBody_MIME(cr_MIME_Message); + } else { + v_MessageBody := cr_MessageBody_SDP; + } + return v_MessageBody; + } +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_PTC_CoordMsg.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_PTC_CoordMsg.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d7034084089ec9b57c8815421deb6ef3bb169448 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_PTC_CoordMsg.ttcn @@ -0,0 +1,364 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-08-26 09:14:31 +0200 (Wed, 26 Aug 2015) $ +// $Rev: 14113 $ +/******************************************************************************/ + +module IMS_PTC_CoordMsg { + import from CommonDefs all; + import from NAS_CommonTypeDefs all; + + //============================================================================ + // Commands/Responses used at the IMS-IPCAN interface for IMS test cases acc. to 34.229 + + // parameters + + type enumerated IMS_TestProcedure_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + /* @sic R5s141286 change 9: new field IPCAN_MO_Speech_EmergencyCall sic@ */ + IPCAN_InitialRegistration, /* EUTRA/EPS signalling acc. to 36.508 cl. 4.5.2.3 without RRC Connection Release at the end of the procedure + * NOTE: As working assumption the UE does IMS REGISTRATION automatically after RRC/NAS registration; + * if that is not the case the IMS PTC may trigger release of the connection after some time and initiate manual IMS registration (FFS) */ + IPCAN_EmergencyCall_NormalService, /* EUTRA/EPS signalling acc. to 36.508 cl. 4.5A.4.3 */ + IPCAN_EmergencyCall_LimitedService, /* EUTRA/EPS signalling acc. to 36.508 cl. 4.5A.5.3 */ + IPCAN_MO_SpeechCall, /* EUTRA/EPS signalling acc. to 36.508 cl. 4.5A.6.3 */ + IPCAN_MT_SpeechCall, /* EUTRA/EPS signalling acc. to 36.508 cl. 4.5A.7.3 */ + IPCAN_MO_VideoCall, /* EUTRA/EPS signalling acc. to 36.508 cl. 4.5A.8.3 */ + IPCAN_MT_VideoCall, /* EUTRA/EPS signalling acc. to 36.508 cl. 4.5A.9.3 */ + IPCAN_MO_AddVideo, /* EUTRA/EPS signalling acc. to 36.508 cl. 4.5A.11.3 */ + IPCAN_MT_AddVideo, /* EUTRA/EPS signalling acc. to 36.508 cl. 4.5A.12.3 */ + IPCAN_ReleaseVideo, /* EUTRA/EPS signalling acc. to 36.508 cl. 4.5A.15.3 */ + IPCAN_MO_IMS_Signalling, /* EUTRA/EPS signalling acc. to 36.508 cl. 4.5.3.3 with m = n = 0; used e.g. for MT SMS test case 18.2 */ + IPCAN_MT_IMS_Signalling, /* EUTRA/EPS signalling acc. to 36.508 cl. 4.5.3.3 Steps 3 to 9 with m = n = 0; used e.g. for MT SMS test case 18.1 */ + IPCAN_XCAP_Signalling, /* EUTRA/EPS signalling acc. to 36.508 cl. 4.5A.14 */ + IPCAN_MO_Speech_EmergencyCall /* EUTRA/EPS signalling acc. to 36.508 cl. 4.5A.4.3 and 4.5A.6.3 */ + }; + + type enumerated IMS_TestConfiguration_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + IPCAN_SignallingOnly, /* EUTRA: default DRB is used only */ + IPCAN_SpeechCall, /* EUTRA: one dedicated UM bearer; for normal speech calls and emergency call for limited services */ + IPCAN_VideoCall, /* EUTRA: two dedicated UM bearers */ + IPCAN_EmergencyCall, /* EUTRA: second default bearer (AM) and one dedicated UM bearer */ + IPCAN_XCAP /* EUTRA: second default bearer (AM) for second PDN used for XCAP signalling */ + }; + + type enumerated IMS_CellConfiguration_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + SIB2_Normal, /* to change cell configuration back to normal configuration */ + SIB2_TC_12_18, /* SIB2 configuration acc. to test case 12.18 */ + SIB2_TC_12_18b, /* SIB2 configuration acc. to test case 12.18b */ + SIB2_TC_12_19, /* SIB2 configuration acc. to test case 12.19 */ + SIB2_TC_12_19b, /* SIB2 configuration acc. to test case 12.19b */ + SIB2_TC_12_20, /* SIB2 configuration acc. to test case 12.20 */ + SIB2_TC_12_20a, /* SIB2 configuration acc. to test case 12.20a */ + IPCAN_UpdateUELocationInformation /* EUTRA: set UELocationInformation acc. to 36.509 */ + }; + + type record IPCAN_INFO_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + /* @sic R5s120907 R5s130133 additional changes sic@ */ + /* @sic R5s130739 MCC160 implementation: new field UE_Release sic@ */ + IPCAN_RAN_Type RanType optional, + integer UE_Release optional, + integer AuthResLength optional + }; + + type enumerated IMS_IPCAN_CommandName_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + IPCAN_INIT, /* trigger the IPCAN_PTC to create a cell and do further appropriate initialisation; + * which RAN technology to be use is decided by the IPCAN_PTC based on PIXITs; + * as test procedure shall be specified which procedure is used during the test body to know which DRBs need to be pre-configured; + * IPCAN returns response indicating the RAN type */ + IPCAN_CONFIG, /* trigger the IPCAN_PTC to apply test case specific change of the cell configuration as e.g. SIB2 for cell barring */ + IPCAN_STARTPROCEDURE, /* trigger the IPCAN to expect (MO) or page (MT) the UE to establish an RRC connection; + * depending on the connection type triggers may need to be sent from IPCAN to IMS or from IMS to IPCAN to synchronise establishment + * of dedicated DRBs (EUTRA) or secondary PDP contexts (UTRAN) */ + IPCAN_ENDPROCEDURE, /* trigger RRC connection release by the IPCAN_PTC; + * as a SIP message may be sent out just before end of the procedure in general a delay of 2s shall be added before sending IPCAN_ENDPROCEDURE to IPCAN; + * for UTRAN it is up to IPCAN and SS implementation to cope with possible/necessary release of (secondary) PDP context; + * a trigger shall be sent from IPCAN to IMS to indicate when RRC connection is released */ + IPCAN_RELEASE, /* Detach UE and release cell (postamble); + * a trigger is shall be sent from IPCAN to IMS to indicate when IPCAN is released */ + IPCAN_QUERY /* query information from the IPCAN PTC + * @sic R5s130133 additional changes sic@ */ + }; + + type record IMS_IPCAN_Command_Type { /* Messages IMS_PTC -> IPCAN + @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + IMS_IPCAN_CommandName_Type Name, + IMS_TestConfiguration_Type TestConfiguration optional, + IMS_TestProcedure_Type TestProcedure optional, + IMS_CellConfiguration_Type CellConfiguration optional /* used for IPCAN_CONFIG to allow test case specific initialisation of the EUTRA cell info */ + }; + + type enumerated IMS_IPCAN_ResponseName_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + IPCAN_INIT, /* response for INIT command: carries the RAN type as used by the IPCAN PTC; + the RAN type depends on PIXIT settings: + part 4 model: px_RANTech + part 3 model: EUTRA_FDD or EUTRA_TDD depending on px_ePrimaryFrequencyBand (px_ePrimaryFrequencyBand < 33 => FDD) */ + IPCAN_QUERY /* @sic R5s120907 R5s130133 additional changes sic@ */ + }; + + type record IPCAN_IMS_Response_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + IMS_IPCAN_ResponseName_Type Name, + IPCAN_INFO_Type IpcanInfo optional /* @sic R5s120907 R5s130133 additional changes sic@ */ + }; + + //============================================================================ + + type enumerated TriggerResult_Type {NORMAL, ABORT}; /* @status APPROVED (IMS) */ + + type union IMS_IPCAN_Coordination_MSG { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + Null_Type TriggerEvent, // any trigger of confirmation + Null_Type AbortEvent, // sent instead of TriggerEvent if procedure shall be aborted + Null_Type Reset, // IMS <- IPCAN: to reset IMS after UE has been switched off and gets switched on again + IMS_IPCAN_Command_Type IMS_IPCAN_Command, // IMS -> IPCAN: command to be done at IPCAN + IPCAN_IMS_Response_Type IPCAN_IMS_Response, // IMS <- IPCAN: response for previous command + NAS_ProtocolConfigOptions_Type ProtocolConfigOptions, // IMS <-> IPCAN: PCOs to be used in NAS signalling + charstring IPCAN_IMS_Data // IMS <- IPCAN: to send data from IPCAN to IMS @sic R5-151607 sic@ + }; + + type port IMS_IPCAN_CO_ORD_PORT message + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + out IMS_IPCAN_Coordination_MSG; + in IMS_IPCAN_Coordination_MSG; + }; + + + type union IMS_IMS_Coordination_MSG { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + Null_Type TriggerEvent + }; + + type port IMS_IMS_CO_ORD_PORT message { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + out IMS_IMS_Coordination_MSG; + in IMS_IMS_Coordination_MSG; + }; + + //---------------------------------------------------------------------------- + + template (value) IMS_IPCAN_Coordination_MSG cms_IMS_IPCAN_Trigger := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + TriggerEvent := true + }; + + template (present) IMS_IPCAN_Coordination_MSG cmr_IMS_IPCAN_Trigger := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + TriggerEvent := true + }; + + template (value) IMS_IPCAN_Coordination_MSG cms_IMS_IPCAN_Abort := + { /* @status APPROVED (IMS) */ + AbortEvent := true + }; + + template (present) IMS_IPCAN_Coordination_MSG cmr_IMS_IPCAN_Abort := + { /* @status APPROVED (IMS) */ + AbortEvent := true + }; + + template (value) IMS_IPCAN_Coordination_MSG cms_IMS_IPCAN_Command(IMS_IPCAN_CommandName_Type p_CommandName, + template (omit) IMS_TestConfiguration_Type p_TestConfiguration := omit, + template (omit) IMS_TestProcedure_Type p_TestProcedure := omit, + template (omit) IMS_CellConfiguration_Type p_CellConfiguration := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + IMS_IPCAN_Command := { + Name := p_CommandName, + TestConfiguration := p_TestConfiguration, + TestProcedure := p_TestProcedure, + CellConfiguration := p_CellConfiguration + } + }; + + template (present) IMS_IPCAN_Coordination_MSG cmr_IMS_IPCAN_Command(template (present) IMS_IPCAN_CommandName_Type p_CommandName := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + IMS_IPCAN_Command := { + Name := p_CommandName, + TestConfiguration := *, + TestProcedure := *, + CellConfiguration := * + } + }; + + template (value) IPCAN_INFO_Type cs_IPCAN_INFO(template (omit) IPCAN_RAN_Type p_RanType, + template (omit) integer p_UE_Release, + template (omit) integer p_AuthResLength) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + RanType := p_RanType, + UE_Release := p_UE_Release, + AuthResLength := p_AuthResLength + }; + + template (value) IMS_IPCAN_Coordination_MSG cms_IPCAN_IMS_Response(IMS_IPCAN_ResponseName_Type p_ResponseName, + template (omit) IPCAN_INFO_Type p_IpcanInfo := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + /* @sic R5s120907 R5s130133 additional changes sic@ */ + IPCAN_IMS_Response := { + Name := p_ResponseName, + IpcanInfo := p_IpcanInfo + } + }; + + template (value) IMS_IPCAN_Coordination_MSG cms_IPCAN_IMS_QueryResponse(template (value) IPCAN_INFO_Type p_IpcanInfo) := cms_IPCAN_IMS_Response(IPCAN_QUERY, p_IpcanInfo); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + @sic R5s130133 additional changes sic@ */ + + template (present) IMS_IPCAN_Coordination_MSG cmr_IPCAN_IMS_Response := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + IPCAN_IMS_Response := ? + }; + + template (value) IMS_IPCAN_Coordination_MSG cms_IPCAN_IMS_Reset := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + Reset := true + }; + + template (present) IMS_IPCAN_Coordination_MSG cmr_IPCAN_IMS_Reset := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + Reset := true + }; + + template (value) IMS_IPCAN_Coordination_MSG cms_IPCAN_IMS_Data (charstring p_Data):= + { /* @status APPROVED (LTE_A) */ + /* @sic R5-151607 sic@ */ + IPCAN_IMS_Data := p_Data + }; + + template (present) IMS_IPCAN_Coordination_MSG cmr_IPCAN_IMS_Data (template (present) charstring p_Data := ?):= + { /* @status APPROVED (LTE_A) */ + /* @sic R5-151607 sic@ */ + IPCAN_IMS_Data := p_Data + }; + + //---------------------------------------------------------------------------- + + template (value) IMS_IMS_Coordination_MSG cms_IMS_IMS_Trigger := + { /* @status APPROVED (IMS) */ + TriggerEvent := true + }; + + template (present) IMS_IMS_Coordination_MSG cmr_IMS_IMS_Trigger := + { /* @status APPROVED (IMS) */ + TriggerEvent := true + }; + + //---------------------------------------------------------------------------- + /* + * @desc query IPCAN specific information from IPCAN PTC + * @param p_ImsCoorPort + * @return IPCAN_INFO_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_IPCAN_Query(IMS_IPCAN_CO_ORD_PORT p_ImsCoorPort) return IPCAN_INFO_Type + { + var IMS_IPCAN_Coordination_MSG v_IMS_IPCAN_CoordMsg; + p_ImsCoorPort.send(cms_IMS_IPCAN_Command(IPCAN_QUERY)); + p_ImsCoorPort.receive(cmr_IPCAN_IMS_Response) -> value v_IMS_IPCAN_CoordMsg; + return v_IMS_IPCAN_CoordMsg.IPCAN_IMS_Response.IpcanInfo; + } + + //---------------------------------------------------------------------------- + /* + * @desc to immediately detect programming errors (shall normally not happen) + * @param p_Port + * @status APPROVED (IMS) + */ + altstep a_IMS_IPCAN_Default(IMS_IPCAN_CO_ORD_PORT p_Port) + { + [] p_Port.receive { + FatalError(__FILE__, __LINE__, "unexpected coordination message"); + } + } + + /* + * @desc Wait for a synchonisation message from IMS/IPCAN PTC + * @param p_Port + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_IPCAN_WaitForTrigger(IMS_IPCAN_CO_ORD_PORT p_Port) + { /* @sic R5s130495 change 3: a_IMS_IPCAN_Default removed as at least at EUTRA queries (IPCAN_QUERY) need to be handled by EUTRA's default behaviour sic@ */ + alt { + [] p_Port.receive(cmr_IMS_IPCAN_Trigger) {} + //[] a_IMS_IPCAN_Default(p_Port) {} + } + } + + /* + * @desc Wait for a synchonisation message from IMS/IPCAN PTC + * @param p_Port + * @return TriggerResult_Type + * @status APPROVED (IMS) + */ + function f_IMS_IPCAN_WaitForTriggerOrAbort(IMS_IPCAN_CO_ORD_PORT p_Port) return TriggerResult_Type + { /* @sic R5s130495 change 3: a_IMS_IPCAN_Default removed as at least at EUTRA queries (IPCAN_QUERY) need to be handled by EUTRA's default behaviour sic@ */ + var TriggerResult_Type v_Result := ABORT; + alt { + [] p_Port.receive(cmr_IMS_IPCAN_Trigger) {v_Result := NORMAL} + [] p_Port.receive(cmr_IMS_IPCAN_Abort) {} + //[] a_IMS_IPCAN_Default(p_Port) {} + } + return v_Result; + } + + /* + * @desc Wait for a synchonisation message from IMS/IPCAN PTC + * @param p_Port + * @return charstring + * @status APPROVED (LTE_A) + */ + function f_IMS_IPCAN_WaitForData(IMS_IPCAN_CO_ORD_PORT p_Port) return charstring + { /* @sic R5-151607 sic@ */ + var IMS_IPCAN_Coordination_MSG v_IMS_IPCAN_CoordMsg; + p_Port.receive(cmr_IPCAN_IMS_Data) -> value v_IMS_IPCAN_CoordMsg; // @sic R5s150704 sic@ + return v_IMS_IPCAN_CoordMsg.IPCAN_IMS_Data; + } + + //---------------------------------------------------------------------------- + /* + * @desc send message to IMS/IPCAN PTC + * @param p_Port + * @param p_Msg (default value: cms_IMS_IPCAN_Trigger) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) + */ + function f_IMS_IPCAN_SendCoOrdMsg(IMS_IPCAN_CO_ORD_PORT p_Port, + template (value) IMS_IPCAN_Coordination_MSG p_Msg := cms_IMS_IPCAN_Trigger) + { + p_Port.send(p_Msg); + } + +/* function f_IMS_IPCAN_CheckForTrigger(IMS_IPCAN_CO_ORD_PORT p_Port) return boolean */ +/* { */ +/* timer t_Timer := 0.0; */ +/* t_Timer.start; */ + +/* alt { */ +/* [] p_Port.receive(cmr_IMS_IPCAN_Trigger) { return true; } */ +/* [] a_IMS_IPCAN_Default(p_Port) {} */ +/* [] t_Timer.timeout {} */ +/* } */ +/* return false; */ +/* } */ + + //---------------------------------------------------------------------------- + /* + * @desc send coordination message to the other IMS PTC + * @param p_Port + * @param p_Msg (default value: cms_IMS_IMS_Trigger) + * @status APPROVED (IMS) + */ + function f_IMS_IMS_SendCoOrdMsg(IMS_IMS_CO_ORD_PORT p_Port, + template (value) IMS_IMS_Coordination_MSG p_Msg := cms_IMS_IMS_Trigger) + { + p_Port.send(p_Msg); + } + + /* + * @desc wait for coordination message from the other IMS PTC + * @param p_Port + * @status APPROVED (IMS) + */ + function f_IMS_IMS_WaitForTrigger(IMS_IMS_CO_ORD_PORT p_Port) + { + p_Port.receive(cmr_IMS_IMS_Trigger); + } + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_Procedures_CallControl.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_Procedures_CallControl.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6062a615427666cc41dcf9e34258c3bbfd76b8dd --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_Procedures_CallControl.ttcn @@ -0,0 +1,2816 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-17 13:17:48 +0200 (Thu, 17 Sep 2015) $ +// $Rev: 14487 $ +/******************************************************************************/ + +module IMS_Procedures_CallControl { + + import from CommonDefs all; + import from CommonIP all; + import from IP_ASP_TypeDefs all; + import from IMS_IP_Config all; + import from IMS_Component all; + import from IMS_ASP_TypeDefs all; + import from IMS_ASP_Templates all; + import from IMS_CommonParameters all; + import from IMS_CommonTemplates all; + import from IMS_CommonDefs all; + import from IMS_SIP_Templates all; + import from IMS_MessageBody_Templates all; + import from IMS_SDP_Templates all; + import from IMS_SDP_Messages all; + import from IMS_CommonFunctions all; + import from IMS_Procedures_Common all; + import from UpperTesterFunctions all; + import from LibSip_Common all; + import from LibSip_MessageBodyTypes all; + import from LibSip_SIPTypesAndValues all; + import from LibSip_SDPTypes all; + import from IMS_XML_PIDF_Templates all; + import from Parameters all; + + type enumerated INVITE_A_2_1_Context_Type { /* NOTE: some of the conditions for A.2.1 describe the context in which the INVITE is used (=> these conditions are mutual exclusive) + * whereas other conditions are "add-on" + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + A_2_1_A4, /* INVITE creating a dialog */ + A_2_1_A5, /* re-INVITE within a dialog */ + A_2_1_A6, /* INVITE for creating an emergency session in case of no registration */ + A_2_1_A7 /* INVITE for creating an emergency session within an emergency registration */ + }; + + type record IMS_InviteRequestWithSdp_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + @sic R5w140112: new type sic@ */ + IMS_RoutingInfo_Type RoutingInfo, + INVITE_Request Invite, + SDP_Message SdpOffer + }; + + type record IMS_ResponseWithSdp_Type { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) + @sic R5w140112: new type sic@ */ + IMS_Response_Type Response, + SDP_Message SdpMessage optional + }; + + template (value) IMS_ResponseWithSdp_Type cs_IMS_ResponseWithSdp(IMS_Response_Type p_Response, + template (omit) SDP_Message p_SDP_Message) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + Response := p_Response, + SdpMessage := p_SDP_Message + }; + + + /* + * @desc build-up IMS_InviteRequestWithSdp_Type + * @param p_IMS_DATA_REQ + * @param p_SdpOffer + * @return IMS_InviteRequestWithSdp_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_InviteRequestWithSdpMO(IMS_DATA_REQ p_IMS_DATA_REQ, + SDP_Message p_SdpOffer) return IMS_InviteRequestWithSdp_Type + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + + v_InviteRequestWithSdp.RoutingInfo := p_IMS_DATA_REQ.RoutingInfo; + v_InviteRequestWithSdp.Invite := p_IMS_DATA_REQ.Request.Invite; + v_InviteRequestWithSdp.SdpOffer := p_SdpOffer; + return v_InviteRequestWithSdp; + } + + /* + * @desc build-up IMS_InviteRequestWithSdp_Type + * @param p_InviteRequest + * @param p_SdpOffer + * @return IMS_InviteRequestWithSdp_Type + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_InviteRequestWithSdpMT(template (value) INVITE_Request p_InviteRequest, + template (value) SDP_Message p_SdpOffer) runs on IMS_PTC return IMS_InviteRequestWithSdp_Type + { + var template (value) IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var InternetProtocol_Type v_Protocol := f_IMS_PTC_ImsInfo_GetTransportProtocol(); + + v_InviteRequestWithSdp.RoutingInfo := cs_IMS_RoutingInfo(v_Protocol); + v_InviteRequestWithSdp.Invite := p_InviteRequest; + v_InviteRequestWithSdp.SdpOffer := p_SdpOffer; + + return valueof(v_InviteRequestWithSdp); + } + + /* + * @desc return true when the given INVITE is MO in which case it does not contain a record route (yet) + * @param p_InviteRequest + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function fl_IMS_InviteRequestIsMO(template (value) INVITE_Request p_InviteRequest) return boolean + { + return not ispresent(p_InviteRequest.msgHeader.recordRoute.routeBody); + } + + /* + * @desc Check max-red parameter in fmtp line + * @param p_AttributeList + * @param p_Fmt + * @param p_FormatSpecificParameters (default value: cr_AMR_Fmtp_DefaultParameters) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) + */ + function fl_IMS_SDP_Fmtp_CheckMaxRed(template (omit) SDP_attribute_list p_AttributeList, + charstring p_Fmt, + template (present) SDP_attribute_fmtp_format_specific_params p_FormatSpecificParameters := cr_AMR_Fmtp_DefaultParameters) runs on IMS_PTC + { + var template (omit) SDP_attribute v_Attribute; + var charstring v_RedMaxValStr; + var integer v_RedMaxVal; + + v_Attribute := f_SDP_AttributeList_GetAttribute(p_AttributeList, cr_SDP_Attribute_fmtp(p_Fmt, p_FormatSpecificParameters)); + if (isvalue(v_Attribute)) { + v_RedMaxValStr := f_SIP_SemicolonParamList_GetParamValue(v_Attribute.fmtp.params.paramList, "max-red"); // @sic R5w140113, R5w140009 sic@ + if (v_RedMaxValStr != "") { + v_RedMaxVal := str2int(v_RedMaxValStr); + if (not match(v_RedMaxVal, (0..220))) { /* @sic R5-141114sic@ */ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "invalid value for red-max parameter"); + } + } + } + } + + /* + * @desc Check whether given media description contains default AMR codec + * @param p_SDP_Media_Desc + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) + */ + function f_IMS_SDP_CheckMediaDescr_AMR_8000_1(SDP_media_desc p_SDP_Media_Desc) runs on IMS_PTC + { + var charstring v_Fmt := f_SDP_MediaDescr_GetAMR_8000_1(p_SDP_Media_Desc); + + if (v_Fmt == "") { /* @sic R5-141114: tsc_AMR_Fmtp_DefaultParameters -> tsc_AMR_Fmtp_DefaultParameters_RX_Pattern sic@ */ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "AMR/8000/1 not found in given media description"); + } + + /* check of the red-max parameter: @sic R5-141114sic@ */ + fl_IMS_SDP_Fmtp_CheckMaxRed(p_SDP_Media_Desc.attributes, v_Fmt); + } + + /* + * @desc Check whether given media description contains AMR-WB/16000 codec + * @param p_SDP_Media_Desc + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) + */ + function f_IMS_SDP_CheckMediaDescr_AMR_16000_1(SDP_media_desc p_SDP_Media_Desc) runs on IMS_PTC + { + var charstring v_Fmt := f_SDP_MediaDescr_GetAMR_16000_1(p_SDP_Media_Desc); + + if (v_Fmt == "") { /* @sic R5-141114: tsc_AMR_Fmtp_DefaultParameters -> tsc_AMR_Fmtp_DefaultParameters_RX_Pattern sic@ */ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "AMR/WB/1 not found in given media description"); + } + + /* check of the red-max parameter: */ + fl_IMS_SDP_Fmtp_CheckMaxRed(p_SDP_Media_Desc.attributes, v_Fmt); + } + + /* + * @desc Check whether given media description contains EVS/16000 codec + * @param p_SDP_Media_Desc + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) + */ + function f_IMS_SDP_CheckMediaDescr_EVS_16000_1(SDP_media_desc p_SDP_Media_Desc) runs on IMS_PTC + { + var charstring v_Fmt := f_SDP_MediaDescr_GetEVS_16000_1(p_SDP_Media_Desc); + + if (v_Fmt == "") { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "EVS/16000/1 not found in given media description"); + } + + /* check of the red-max parameter: */ + fl_IMS_SDP_Fmtp_CheckMaxRed(p_SDP_Media_Desc.attributes, v_Fmt); + } + + /* + * @desc Check whether given media description contains default video codec + * @param p_SDP_Media_Desc + * @status APPROVED (IMS) + */ + function f_IMS_SDP_CheckMediaDescr_H264_90000(SDP_media_desc p_SDP_Media_Desc) runs on IMS_PTC + { + if (f_SDP_MediaDescr_GetH264_90000(p_SDP_Media_Desc) == "") { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "H264/90000 not found in given media description"); + } + } + + /* + * @desc DTMF Digits, Telephony Tones, and Telephony Signals (RFC 4733) + * @param p_SDP_Media_Desc + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) + */ + function f_IMS_SDP_CheckMediaDescr_DTMF(SDP_media_desc p_SDP_Media_Desc) runs on IMS_PTC + { + if (f_SDP_MediaDescr_GetMediaFormat(p_SDP_Media_Desc, cr_RTPMAP_TelephoneEvent) == "") { // @sic R5s130333 change 14.2 - pattern needs to include a rate; R5-133684 sic@ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "'telephone-event' not found in given media description"); + } + } + + /* + * @desc build up Reason header depending on the UE's release + * @param p_CauseValue + * @param p_Text (default value: omit) + * @return template (present) Reason + * @status APPROVED (LTE_A, LTE_IRAT) + */ + function f_IMS_SIP_Reason_RX(integer p_CauseValue, + template charstring p_Text := omit) runs on IMS_PTC return template (present) Reason + { + var template charstring v_ReasonText := p_Text; + + if (not f_IMS_PTC_UE_ReleaseGreaterOrEqual(10)) { // @sic R5s140234 change 1; R5-142948; R5-142287 change 3; R5s150630: f_IMS_PTC_UE_ReleaseGreaterOrEqual sic@ + v_ReasonText := omit; + } + return cr_Reason(p_CauseValue, v_ReasonText); + } + + /* + * @desc build up Reason header for reason 487 + * @return template (present) Reason + * @status APPROVED (LTE_A, LTE_IRAT) + */ + function f_IMS_SIP_Reason487_RX() runs on IMS_PTC return template (present) Reason + { + var template charstring v_ReasonText := ("failure to transition to CS domain", "handover cancelled"); + return f_IMS_SIP_Reason_RX(487, v_ReasonText); + } + + //============================================================================ + // local functions to build send/receive messages + //---------------------------------------------------------------------------- + + /* + * @desc revert order of given RouteBody_List + * @param p_RouteBodyList + * @return template (value) RouteBody_List + * @status APPROVED (LTE, IMS_IRAT, IMS, LTE_A, LTE_IRAT) + */ + function fl_RouteSet_ReverseOrder(template (value) RouteBody_List p_RouteBodyList) return template (value) RouteBody_List + { + var template (value) RouteBody_List v_RouteBodyList := {}; + var integer v_LengthOfList; + var integer i; + var integer k; + + v_LengthOfList := lengthof(p_RouteBodyList); + k := v_LengthOfList; + for (i:=0; i parameter p_Port_us sic@ */ + var template integer v_Port_us := p_Port_us; + + if (f_IMS_PTC_Security_IsStarted()) { + v_Port_us := f_IMS_PTC_GetPort_us(); + } + return cr_ViaDef(?, cr_HostPort(?, v_Port_us)); /* additional checks in f_IMS_MessageHeader_Request_CheckVia: check of FQDN or IP address */ + } + + /* + * @desc build up Via header to be sent to the UE in the INVITE request + * @param p_CallerDomain (default value: tsc_IMS_CallerDomain) + * @param p_CallerPort (default value: tsc_IMS_CallerPort) + * @return template (value) Via + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_InviteRequest_ViaTX(charstring p_CallerDomain := tsc_IMS_CallerDomain, + integer p_CallerPort := tsc_IMS_CallerPort) runs on IMS_PTC return template (value) Via + { + var template (value) ViaBody_List v_ViaBodyList; + var template (omit) GenericParam v_SigCompParam := f_IMS_PTC_ImsInfo_GetSigCompParam(); // omit when sigcomp is not started + var charstring v_Host := f_IMS_PTC_Pcscf_Get(); + var integer v_Port_ps := f_IMS_PTC_GetPort_ps(); + var charstring v_TransportProtocol := "UDP"; /* acc. to via parameter in TS 34.229 A.2.9 udp shall be used + @sic NOTE: acc. to discussions regarding rejection of R5-130765 at RAN WG5 Meeting #58 UDP is used for all requests in DL sic@ */ + + v_ViaBodyList := { + cs_ViaBody(v_TransportProtocol, cs_HostPort(v_Host, v_Port_ps), f_ViaParamsTX(f_IMS_PTC_ImsInfo_GetNextBranch(), v_SigCompParam)), + cs_ViaBody(v_TransportProtocol, cs_HostPort("scscf1.3gpp.org"), f_ViaParamsTX(f_IMS_PTC_ImsInfo_GetNextBranch())), + cs_ViaBody(v_TransportProtocol, cs_HostPort("scscf2.3gpp.org"), f_ViaParamsTX(f_IMS_PTC_ImsInfo_GetNextBranch())), + cs_ViaBody(v_TransportProtocol, cs_HostPort("pcscf2.3gpp.org"), f_ViaParamsTX(f_IMS_PTC_ImsInfo_GetNextBranch())), + cs_ViaBody(v_TransportProtocol, cs_HostPort(p_CallerDomain, p_CallerPort), f_ViaParamsTX(f_IMS_PTC_ImsInfo_GetNextBranch())) + }; + return cs_Via(v_ViaBodyList); + } + + //============================================================================ + // Functions to build responses to be sent to the UE + //---------------------------------------------------------------------------- + /* + * @desc 100 Trying for INVITE (see TS 34.229, A.2.2) + * NOTE: acc. to A.2.2 there is no Session-ID in this message + * @param p_InviteRequest + * @return template (value) MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_InviteResponse_100_MessageHeaderTX(INVITE_Request p_InviteRequest) return template (value) MessageHeader + { + var MessageHeader v_MessageHeader_Invite := p_InviteRequest.msgHeader; + var template (value) MessageHeader v_MessageHeader_Response := cs_MessageHeader_Dummy; + + v_MessageHeader_Response.via := v_MessageHeader_Invite.via; + v_MessageHeader_Response.fromField := v_MessageHeader_Invite.fromField; + v_MessageHeader_Response.toField := cs_ToDef(f_Addr_Union_GetSipUrl(v_MessageHeader_Invite.toField.addressField)); + v_MessageHeader_Response.callId := v_MessageHeader_Invite.callId; + v_MessageHeader_Response.cSeq := v_MessageHeader_Invite.cSeq; + + return v_MessageHeader_Response; + } + + /* + * @desc 180 Ringing for INVITE (see TS 34.229, A.2.6) + * @param p_InviteRequest + * @param p_ContactUri (default value: px_IMS_CalleeContactUri) + * @param p_PrackRequested (default value: true) + * @param p_EmergencyType (default value: NO_EMERGENCY) + * @param p_SrvccAlertingSupported (default value: pc_IMS_SRVCCAlert) + * @return template (value) MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_InviteResponse_180_MessageHeaderTX(INVITE_Request p_InviteRequest, + charstring p_ContactUri := px_IMS_CalleeContactUri, + boolean p_PrackRequested := true, + IMS_Emergency_Type p_EmergencyType := NO_EMERGENCY, + boolean p_SrvccAlertingSupported := pc_IMS_SRVCCAlert) runs on IMS_PTC return template (value) MessageHeader + { // p_PrackRequested .. condition A3; needs to be true when the 180 response shall be acknowleged with a PRACK i.e. is "sent reliably" acc. to A.2.6 A3 + // p_SrvccAlertingSupported .. if voice call => condition A6; needs to be set to false for non-voice calls + /* @sic R5s130333 change 2: new parameter p_PrackRequested sic@ */ + /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5s140370 change 6: new parameter p_SrvccAlertingSupported sic@ */ + /* @sic R5s150692 change 11: parameter p_EmergencyType sic@ */ + var MessageHeader v_MessageHeader_Invite := p_InviteRequest.msgHeader; + var template (value) MessageHeader v_MessageHeader_Response := cs_MessageHeader_Dummy; + var template (value) RouteBody_List v_RouteBodyList := f_IMS_RouteSet_MO_Call_TX(p_EmergencyType); /* @sic R5s150692 change 11 sic@ */ + + v_MessageHeader_Response.recordRoute := cs_RecordRoute(v_RouteBodyList); + v_MessageHeader_Response.via := v_MessageHeader_Invite.via; + v_MessageHeader_Response.fromField := v_MessageHeader_Invite.fromField; + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderTX(v_MessageHeader_Invite); /* @sic R5-131897, R5-132063 - generic handling of to-tags sic@ */ + v_MessageHeader_Response.contact := cs_Contact(f_SIP_BuildSipUri_TX(p_ContactUri)); // @sic R5s130109 sic@ + v_MessageHeader_Response.callId := v_MessageHeader_Invite.callId; + v_MessageHeader_Response.sessionId := v_MessageHeader_Invite.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Response.cSeq := v_MessageHeader_Invite.cSeq; + if (p_PrackRequested) { // Condition A3 @sic R5s130333 change 2 sic@ + v_MessageHeader_Response.require := cs_Require(tsc_OptionTagList_100rel); /* -> reliable provisional responses acc. RFC 3262 */ + v_MessageHeader_Response.rSeq := cs_RSeq(tsc_IMS_RSeqNumFor183 + 1); + } + if (p_EmergencyType != NO_EMERGENCY) { // Condition A4 @sic R5s150692 change 11 sic@ + v_MessageHeader_Response.pAssertedID := cs_PAssertedId(f_SIP_BuildSipUri_lr_TX(tsc_IMS_Emergency_TelUri)); + } + if (p_SrvccAlertingSupported) { + v_MessageHeader_Response.featureCaps := cs_FeatureCaps({ cs_GenericParam(tsc_IMS_FeatureCap_SrvccAlerting)}); // @sic R5-145796 sic@ + } + return v_MessageHeader_Response; + } + + /* + * @desc 181 Call is being forwarded (see TS 34.229, A.2.14) + * @param p_InviteRequest + * @param p_TargetedTo + * @return template (value) MessageHeader + * @status APPROVED (IMS) + */ + function f_IMS_InviteResponse_181_MessageHeaderTX(INVITE_Request p_InviteRequest, + template (value) SipUrl p_TargetedTo) runs on IMS_PTC return template (value) MessageHeader + { + var MessageHeader v_MessageHeader_Invite := p_InviteRequest.msgHeader; + var template (value) MessageHeader v_MessageHeader_Response := cs_MessageHeader_Dummy; + + v_MessageHeader_Response.via := v_MessageHeader_Invite.via; + v_MessageHeader_Response.fromField := v_MessageHeader_Invite.fromField; + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderTX(v_MessageHeader_Invite); /* @sic R5-131897, R5-132063 - generic handling of to-tags sic@ */ + v_MessageHeader_Response.historyInfo := cs_HistoryInfo(p_TargetedTo); + v_MessageHeader_Response.callId := v_MessageHeader_Invite.callId; + v_MessageHeader_Response.sessionId := v_MessageHeader_Invite.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Response.cSeq := v_MessageHeader_Invite.cSeq; + + return v_MessageHeader_Response; + } + + /* + * @desc 183 Session Progress for INVITE (see TS 34.229, A.2.3) + * @param p_InviteRequest + * @param p_AdditionalOptionTagsForRequire (default value: tsc_OptionTagList_Empty) + * @param p_ContactUri (default value: px_IMS_CalleeContactUri) + * @param p_AditionalContactParams (default value: omit) + * @param p_EmergencyType (default value: NO_EMERGENCY) + * @param p_A6 (default value: pc_IMS_Video_FeatureTag) + * @param p_Earlymedia (default value: false) + * @return template (value) MessageHeader + * @status APPROVED (IMS, LTE, LTE_A) + */ + function f_IMS_InviteResponse_183_MessageHeaderTX(INVITE_Request p_InviteRequest, + OptionTag_List p_AdditionalOptionTagsForRequire := tsc_OptionTagList_Empty, + charstring p_ContactUri := px_IMS_CalleeContactUri, + template (omit) SemicolonParam_List p_AditionalContactParams := omit, + IMS_Emergency_Type p_EmergencyType := NO_EMERGENCY, + boolean p_A6 := pc_IMS_Video_FeatureTag, + boolean p_Earlymedia := false) runs on IMS_PTC return template (value) MessageHeader + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5s150180: tsc_IMS_VideoFeature replaced by pc_IMS_Video_FeatureTag sic@ */ + /* @sic R5s150692 change 7: parameter p_EmergencyType sic@ */ + var MessageHeader v_MessageHeader_Invite := p_InviteRequest.msgHeader; + var template (value) MessageHeader v_MessageHeader_Response := cs_MessageHeader_Dummy; + var template (omit) SemicolonParam_List v_ContactParams := p_AditionalContactParams; + var OptionTag_List v_OptionTag_List := tsc_OptionTagList_100rel & p_AdditionalOptionTagsForRequire; // @sic R5-133629 sic@ + var template (value) RouteBody_List v_RouteBodyList := f_IMS_RouteSet_MO_Call_TX(p_EmergencyType); /* @sic R5s150692 change 7 sic@ */ + + v_MessageHeader_Response.recordRoute := cs_RecordRoute(v_RouteBodyList); + v_MessageHeader_Response.via := v_MessageHeader_Invite.via; + v_MessageHeader_Response.require := cs_Require(v_OptionTag_List); // @sic R5s130333 change 3 sic@ + v_MessageHeader_Response.fromField := v_MessageHeader_Invite.fromField; + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderTX(v_MessageHeader_Invite); /* @sic R5-131897, R5-132063 - generic handling of to-tags sic@ */ + v_MessageHeader_Response.rSeq := cs_RSeq(tsc_IMS_RSeqNumFor183); + v_MessageHeader_Response.callId := v_MessageHeader_Invite.callId; + v_MessageHeader_Response.sessionId := v_MessageHeader_Invite.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Response.cSeq := v_MessageHeader_Invite.cSeq; + v_MessageHeader_Response.contentType := cs_ContentTypeSDP; + if (p_EmergencyType == ASSERTED_EMERGENCY) { // Condition A5 @sic R5s150692 change 7 sic@ + v_MessageHeader_Response.pAssertedID := cs_PAssertedId(f_SIP_BuildSipUri_lr_TX(tsc_IMS_Emergency_TelUri)); + } + if (pc_BSRVCC) { // @sic R5s140962 sic@ + v_MessageHeader_Response.featureCaps := cs_FeatureCaps({ cs_GenericParam(tsc_IMS_FeatureCap_SrvccPreAlerting)}); // @sic R5-145796 sic@ + } + if (p_A6) { // @sic R5s130109 sic@ + v_ContactParams := f_SemicolonParam_List_Add_TX(v_ContactParams, cs_GenericParam("video")); + } + v_MessageHeader_Response.contact := cs_Contact(f_SIP_BuildSipUri_TX(p_ContactUri), v_ContactParams); + if (p_Earlymedia) { // @sic R5-151953 sic@ + v_MessageHeader_Response.pEarlyMedia := cs_PEarlyMedia({c_sendonly}) + } + return v_MessageHeader_Response; + } + + /* + * @desc 200 OK for other requests than REGISTER or SUBSCRIBE (see TS 34.229, A.3.1) + * @param p_MessageHeader_Request + * @param p_ContentType (default value: omit) + * @param p_EmergencyTelURI (default value: omit) + * @param p_ContactUri (default value: px_IMS_CalleeContactUri) + * @param p_AdditionalOptionTagsForRequire (default value: tsc_OptionTagList_Empty) + * @param p_EmergencyType (default value: NO_EMERGENCY) + * @return template (value) MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_OtherResponse_200_MessageHeaderTX(template (value) MessageHeader p_MessageHeader_Request, + template (omit) ContentType p_ContentType := omit, + template (omit) charstring p_EmergencyTelURI := omit, + charstring p_ContactUri := px_IMS_CalleeContactUri, + OptionTag_List p_AdditionalOptionTagsForRequire := tsc_OptionTagList_Empty, + IMS_Emergency_Type p_EmergencyType := NO_EMERGENCY) + runs on IMS_PTC return template (value) MessageHeader + { /* @sic R5-130683: common handling for INVITE and UPDATE sic@ */ + /* p_EmergencyTelURI .. shall be set e.g. to tsc_IMS_Emergency_TelUri for condition A6 in A.3.1 */ + /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5s150237: parameter p_AdditionalOptionTagsForRequire sic@ */ + /* @sic R5s150692 change 17: parameter p_EmergencyType sic@ */ + var template (value) MessageHeader v_MessageHeader_Response := cs_MessageHeader_Dummy; + var charstring v_Method := valueof(p_MessageHeader_Request.cSeq.method); + var boolean v_A1A3 := false; + var template (value) RouteBody_List v_RouteBodyList; + var IMS_Emergency_Type v_EmergencyType := p_EmergencyType; + var template (omit) Require v_Require := omit; + + if (lengthof(p_AdditionalOptionTagsForRequire) > 0) { + v_Require := cs_Require(p_AdditionalOptionTagsForRequire); + } + + if ((p_EmergencyType == ASSERTED_EMERGENCY) and (not (ispresent(p_EmergencyTelURI)))) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "EmergencyTelURI not provided for Asserted Emergency"); /* @sic R5s150692 change 17 sic@ */ + } + + select (v_Method) { + case ("INVITE", "UPDATE") { v_A1A3 := true; } + } + v_MessageHeader_Response.via := p_MessageHeader_Request.via; + v_MessageHeader_Response.require := v_Require; /* @sic R5s150237 change 1 sic@ */ + v_MessageHeader_Response.fromField := p_MessageHeader_Request.fromField; + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderTX(p_MessageHeader_Request); /* @sic R5-131897, R5-132063 - generic handling of to-tags sic@ */ + v_MessageHeader_Response.callId := p_MessageHeader_Request.callId; + v_MessageHeader_Response.sessionId := p_MessageHeader_Request.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Response.cSeq := p_MessageHeader_Request.cSeq; + v_MessageHeader_Response.contentType := p_ContentType; + + if (v_A1A3) { + v_RouteBodyList := f_IMS_RouteSet_MO_Call_TX(v_EmergencyType); /* @sic R5s150692 change 17 sic@ */ + v_MessageHeader_Response.recordRoute := cs_RecordRoute(v_RouteBodyList); + v_MessageHeader_Response.contact := cs_Contact(f_SIP_BuildSipUri_TX(p_ContactUri)); + } + if (v_EmergencyType != NO_EMERGENCY) { // Condition A6 + v_MessageHeader_Response.pAssertedID := cs_PAssertedId(f_SIP_BuildSipUri_lr_TX(valueof(p_EmergencyTelURI))); + } + return v_MessageHeader_Response; + } + + /* + * @desc 202 Accepted acc. to 34.229 A.3.3 + * @param p_MessageHeader_Request + * @return template (value) MessageHeader + * @status APPROVED (IMS) + */ + function f_IMS_Accepted_202_MessageHeaderTX(MessageHeader p_MessageHeader_Request) runs on IMS_PTC return template (value) MessageHeader + { + var template (value) MessageHeader v_MessageHeader_Response := cs_MessageHeader_Dummy; + + v_MessageHeader_Response.via := p_MessageHeader_Request.via; + v_MessageHeader_Response.fromField := p_MessageHeader_Request.fromField; + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderTX(p_MessageHeader_Request); /* @sic R5-132063 sic@ */ + v_MessageHeader_Response.callId := p_MessageHeader_Request.callId; + v_MessageHeader_Response.sessionId := p_MessageHeader_Request.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Response.cSeq := p_MessageHeader_Request.cSeq; + + return v_MessageHeader_Response; + } + + /* + * @desc generic message header for 4XX message to be sent to the UE + * @param p_MessageHeader_InviteRequest + * @return template (value) MessageHeader + * @status APPROVED (LTE_A) + */ + function f_IMS_InviteResponse_4XX_MessageHeaderTX(MessageHeader p_MessageHeader_InviteRequest) runs on IMS_PTC return template (value) MessageHeader + { /* @sic R5s140572 change 3: new function sic@ */ + var template (value) MessageHeader v_MessageHeader_Response := cs_MessageHeader_Dummy; + + v_MessageHeader_Response.via := p_MessageHeader_InviteRequest.via; + v_MessageHeader_Response.fromField := p_MessageHeader_InviteRequest.fromField; + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderTX(p_MessageHeader_InviteRequest); + + v_MessageHeader_Response.callId := p_MessageHeader_InviteRequest.callId; + v_MessageHeader_Response.sessionId := p_MessageHeader_InviteRequest.sessionId; + v_MessageHeader_Response.cSeq := p_MessageHeader_InviteRequest.cSeq; + + return v_MessageHeader_Response; + } + + //---------------------------------------------------------------------------- + /* + * @desc CANCEL Request (see TS 34.229, A.2.15) + * @param p_InviteRequest + * @return template (value) MessageHeader + * @status APPROVED (IMS, LTE_A) + */ + function f_IMS_CancelRequest_MessageHeaderTX(template (value) INVITE_Request p_InviteRequest) runs on IMS_PTC return template (value) MessageHeader + { + var template (value) MessageHeader v_MessageHeader_Invite := p_InviteRequest.msgHeader; + var template (value) MessageHeader v_MessageHeader_Cancel := cs_MessageHeader_Dummy; + var template (value) Via v_Via := fl_Via_AddSigCompParam(v_MessageHeader_Invite.via); + var integer v_CSeqValue := f_MessageHeader_GetCseqValue(v_MessageHeader_Invite); + + v_MessageHeader_Cancel.via := v_Via; + v_MessageHeader_Cancel.toField := f_IMS_RequestInDialog_ToHeaderTX(); + v_MessageHeader_Cancel.fromField := f_IMS_RequestInDialog_FromHeaderTX(); + v_MessageHeader_Cancel.callId := v_MessageHeader_Invite.callId; + v_MessageHeader_Cancel.sessionId := v_MessageHeader_Invite.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Cancel.cSeq := cs_CseqDef(v_CSeqValue, "CANCEL"); /* @sic R5s140092 change 11 sic@ */ + + return v_MessageHeader_Cancel; + } + + + //============================================================================ + // Functions to build responses to be expected from the UE + //---------------------------------------------------------------------------- + /* + * @desc 100 Trying for INVITE (see TS 34.229, A.2.2) + * @param p_InviteRequest + * @return template (present) MessageHeader + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_InviteResponse_100_MessageHeaderRX(template (value) INVITE_Request p_InviteRequest) return template (present) MessageHeader + { /* NOTE: acc. to A.2.2 there is no Session-ID in this message */ + const boolean tsc_Is100Response := true; + var template (value) MessageHeader v_MessageHeader_Invite := p_InviteRequest.msgHeader; + var template (present) MessageHeader v_MessageHeader_Response := cr_MessageHeader_Dummy; + + v_MessageHeader_Response.via := f_Via_ResponseRX(v_MessageHeader_Invite.via); /* @sic R5s140350 sic@ */ + v_MessageHeader_Response.fromField := f_IMS_Response_FromHeaderRX(v_MessageHeader_Invite); /* @sic R5s130453 sic@ */ + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderRX(v_MessageHeader_Invite, tsc_Is100Response); /* @sic R5s130453, R5s130685 sic@ */ + v_MessageHeader_Response.callId := v_MessageHeader_Invite.callId; + v_MessageHeader_Response.cSeq := v_MessageHeader_Invite.cSeq; + + return v_MessageHeader_Response; + } + + /* + * @desc 180 Ringing for INVITE (see TS 34.229, A.2.6) + * @param p_InviteRequest + * @param p_EmergencyType (default value: NO_EMERGENCY) + * @param p_ContentType (default value: *) + * @param p_ContentLength (default value: ?) + * @return template (present) MessageHeader + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_InviteResponse_180_MessageHeaderRX(template (value) INVITE_Request p_InviteRequest, + IMS_Emergency_Type p_EmergencyType := NO_EMERGENCY, + template ContentType p_ContentType := *, + template (present) ContentLength p_ContentLength := ?) runs on IMS_PTC return template (present) MessageHeader + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5-140975: new parameters p_ContentType, p_ContentLength to ensure that the content type is omit in case of C.11 sic@ */ + /* @sic R5s150692 change 22: parameter p_EmergencyType sic@ */ + var template (value) MessageHeader v_MessageHeader_Invite := p_InviteRequest.msgHeader; + var template (present) MessageHeader v_MessageHeader_Response := cr_MessageHeader_Dummy; + var integer v_Port_us := f_IMS_PTC_GetPort_us(); + + v_MessageHeader_Response.recordRoute := f_IMS_RecordRoute_AsInInvite_RX(v_MessageHeader_Invite.recordRoute); /* @sic R5s130510 change 9 sic@ + @sic R5s150039 change 2 sic@ */ + + v_MessageHeader_Response.via := f_Via_ResponseRX(v_MessageHeader_Invite.via); /* @sic R5s140350 sic@ */ + v_MessageHeader_Response.fromField := f_IMS_Response_FromHeaderRX(v_MessageHeader_Invite); /* @sic R5s130453 sic@ */ + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderRX(v_MessageHeader_Invite); /* @sic R5s130453 sic@ */ + + v_MessageHeader_Response.contact := cr_Contact(f_Contact_SipUri_HostPortRX(?, v_Port_us), cr_FeatureParamList_3gpp_icsi_ref); /* host address needs to be checked after receiving + @sic R5s150721, R5-153760: cr_SipUri_HostPort replaced by f_Contact_SipUri_HostPortRX sic@ */ + v_MessageHeader_Response.callId := v_MessageHeader_Invite.callId; + v_MessageHeader_Response.sessionId := v_MessageHeader_Invite.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Response.cSeq := v_MessageHeader_Invite.cSeq; + v_MessageHeader_Response.contentType := p_ContentType; /* @sic R5-140975 sic@ */ + v_MessageHeader_Response.contentLength := p_ContentLength; /* @sic R5-140975 sic@ */ + + v_MessageHeader_Response.pAccessNetworkInfo := cr_PAccessNetworkInfoDef(f_IMS_PTC_RanType_GetString()); // NOTE: acc. A.2.6 there is no condition regarding GIBA + if (p_EmergencyType == ASSERTED_EMERGENCY) { // Condition A4 @sic R5s150692 change 22 sic@ + v_MessageHeader_Response.pAssertedID := cr_PAssertedId(f_SIP_BuildSipUri_lr_RX(tsc_IMS_Emergency_TelUri)); + } + return v_MessageHeader_Response; + } + + /* + * @desc 183 Session Progress for INVITE (see TS 34.229, A.2.3) + * @param p_InviteRequest + * @param p_AdditionalOptionTagsForRequire (default value: tsc_OptionTagList_Empty) + * @param p_A7 (default value: pc_IMS_Video_FeatureTag) + * @return template (present) MessageHeader + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_InviteResponse_183_MessageHeaderRX(template (value) INVITE_Request p_InviteRequest, + OptionTag_List p_AdditionalOptionTagsForRequire := tsc_OptionTagList_Empty, + boolean p_A7 := pc_IMS_Video_FeatureTag) + runs on IMS_PTC return template (present) MessageHeader + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + var template (value) MessageHeader v_MessageHeader_Invite := p_InviteRequest.msgHeader; + var template (present) MessageHeader v_MessageHeader_Response := cr_MessageHeader_Dummy; + var integer v_Port_us := f_IMS_PTC_GetPort_us(); + var OptionTag_List v_OptionTag_List := tsc_OptionTagList_100rel & p_AdditionalOptionTagsForRequire; // @sic R5-133629 sic@ + var template (present) SemicolonParam_List v_ContactParams := { cr_FeatureParam_3gpp_icsi_ref }; + + if (p_A7) { /* @sic R5s150180 sic@ */ + v_ContactParams := f_SemicolonParam_List_Add_RX(v_ContactParams, cr_FeatureParam_Video); + } + + v_MessageHeader_Response.via := f_Via_ResponseRX(v_MessageHeader_Invite.via); /* @sic R5s140350 sic@ */ + v_MessageHeader_Response.recordRoute := f_IMS_RecordRoute_AsInInvite_RX(v_MessageHeader_Invite.recordRoute); /* @sic R5s130510 change 6.1, R5-135004 change 1 sic@ + @sic R5s150039 change 2 sic@ */ + v_MessageHeader_Response.require := cr_Require(v_OptionTag_List); + v_MessageHeader_Response.fromField := f_IMS_Response_FromHeaderRX(v_MessageHeader_Invite); /* @sic R5s130453 sic@ */ + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderRX(v_MessageHeader_Invite); /* @sic R5s130453 sic@ */ + v_MessageHeader_Response.contact := cr_Contact(f_Contact_SipUri_HostPortRX(?, v_Port_us), superset(all from v_ContactParams)); /* host address needs to be checked after receiving + @sic R5s150721, R5-153760: cr_SipUri_HostPort replaced by f_Contact_SipUri_HostPortRX sic@ */ + v_MessageHeader_Response.rSeq := cr_RSeq(?); /* @sic R5s130510 sic@ */ + v_MessageHeader_Response.callId := v_MessageHeader_Invite.callId; + v_MessageHeader_Response.sessionId := v_MessageHeader_Invite.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Response.cSeq := v_MessageHeader_Invite.cSeq; + v_MessageHeader_Response.contentType := cr_ContentTypeSDP; + + return v_MessageHeader_Response; + } + + function f_IMS_Accepted_202_MessageHeaderRX(template (value) MessageHeader p_MessageHeader_Request) return template (present) MessageHeader + { // 202 Accepted (see TS 34.229, A.3.3) + + var template (present) MessageHeader v_MessageHeader_Response := cr_MessageHeader_Dummy; + + v_MessageHeader_Response.via := f_Via_ResponseRX(p_MessageHeader_Request.via); /* @sic R5s140350 sic@ */ + v_MessageHeader_Response.fromField := f_IMS_Response_FromHeaderRX(p_MessageHeader_Request); /* @sic R5s130453 sic@ */ + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderRX(p_MessageHeader_Request); /* @sic R5-132063 sic@ */ + v_MessageHeader_Response.callId := p_MessageHeader_Request.callId; + v_MessageHeader_Response.sessionId := p_MessageHeader_Request.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Response.cSeq := p_MessageHeader_Request.cSeq; + + return v_MessageHeader_Response; + } + + /* + * @desc 380 Alternative Service (see TS 34.229, A.4.1) + * @param p_InviteRequest + * @return template (value) MessageHeader + * @status APPROVED (IMS, IMS_IRAT) + */ + function f_IMS_InviteResponse_380_MessageHeaderTX(INVITE_Request p_InviteRequest) runs on IMS_PTC return template (value) MessageHeader + { + var MessageHeader v_MessageHeader_Invite := p_InviteRequest.msgHeader; + var template (value) MessageHeader v_MessageHeader_Response := cs_MessageHeader_Dummy; + + v_MessageHeader_Response.via := v_MessageHeader_Invite.via; + v_MessageHeader_Response.fromField := v_MessageHeader_Invite.fromField; + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderTX(v_MessageHeader_Invite); /* @sic R5s140788 change 16 - MCC160 Implementation sic@ */ + v_MessageHeader_Response.pAssertedID := cs_PAssertedId(cs_SipUri_HostPort_lr(f_IMS_PTC_Pcscf_Get())); /* @sic R5-144747: removal of px_IMS_Pcscf_Emg => f_IMS_PTC_Pcscf_Get sic@ */ + v_MessageHeader_Response.callId := v_MessageHeader_Invite.callId; + v_MessageHeader_Response.sessionId := v_MessageHeader_Invite.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Response.cSeq := v_MessageHeader_Invite.cSeq; + v_MessageHeader_Response.contentType := cs_ContentType("application/3gpp-ims+xml"); + + return v_MessageHeader_Response; + } + + /* + * @desc common 4XX response to INVITE (e.g. 487 Request Terminated (see TS 34.229, A.2.16) + * @param p_MessageHeader_Request + * @return template (present) MessageHeader + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_InviteResponse_4XX_MessageHeaderRX(template (value) MessageHeader p_MessageHeader_Request) return template (present) MessageHeader + { + var template (present) MessageHeader v_MessageHeader_Response := cr_MessageHeader_Dummy; + + v_MessageHeader_Response.via := f_Via_ResponseRX(p_MessageHeader_Request.via); /* @sic R5s140350 sic@ */ + v_MessageHeader_Response.fromField := f_IMS_Response_FromHeaderRX(p_MessageHeader_Request); /* @sic R5s130453 sic@ */ + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderRX(p_MessageHeader_Request); /* @sic R5s130453 sic@ */ + v_MessageHeader_Response.callId := p_MessageHeader_Request.callId; + v_MessageHeader_Response.sessionId := p_MessageHeader_Request.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Response.cSeq := p_MessageHeader_Request.cSeq; + + return v_MessageHeader_Response; + } + + //============================================================================ + // Functions to build requests to be sent to the UE + //---------------------------------------------------------------------------- + /* + * @desc INVITE acc. to condition A4 - INVITE creating a dialog, or A5 - re-INVITE within a dialog (see TS 34.229, A.2.9) + * @param p_AdditionalOptionTagsForSupported (default value: tsc_OptionTagList_Empty) + * @param p_Context (default value: A_2_1_A4) + * @param p_SrvccAlertingSupported (default value: pc_IMS_SRVCCAlert) + * @param p_MTSI (default value: pc_MultimediaTelephonyService) + * @param p_Video (default value: pc_IMS_Video_FeatureTag) + * @param p_SessionIdSupported (default value: pc_IMS_SessionIdSupported) + * @param p_CSeqValue (default value: 4711) + * @return template (value) MessageHeader + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_InviteRequest_MessageHeaderTX(OptionTag_List p_AdditionalOptionTagsForSupported := tsc_OptionTagList_Empty, + INVITE_A_2_1_Context_Type p_Context := A_2_1_A4, + boolean p_SrvccAlertingSupported := pc_IMS_SRVCCAlert, + boolean p_MTSI := pc_MultimediaTelephonyService, /* @sic R5s130510 additional change 1: tsc_IMS_MTSI replaced by pc_MultimediaTelephonyService sic@ */ + boolean p_Video := pc_IMS_Video_FeatureTag, + boolean p_SessionIdSupported := pc_IMS_SessionIdSupported, + integer p_CSeqValue := 4711) runs on IMS_PTC return template (value) MessageHeader + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5-140915 MT call hold requires re-INVITE => new parameter p_Context for A4/A5 sic@ */ + /* @sic R5s140385 change 6: new parameter p_SrvccAlertingSupported sic@ */ + /* @sic R5s150086 - p_SessionIdSupported: pc_IMS_SessionIdSupported per default sic@ */ + /* @sic R5s150180: tsc_IMS_VideoFeature replaced by pc_IMS_Video_FeatureTag sic@ */ + + var template (value) MessageHeader v_MessageHeader_Invite := cs_MessageHeader_Dummy; + var template (value) SipUrl v_PublicUserId_SipUrl := f_IMS_PTC_ImsInfo_GetSipUriTX(defaultId); // @sic R5-133304: use default public user id sic@ + var template (omit) SemicolonParam_List v_ContactParams := omit; + var template (value) GenericParam v_GenericParam_3gpp_icsi_ref; + var charstring v_CallIdString := f_IMS_PTC_GenerateCallId("INVITE"); + var charstring v_FromTag := f_IMS_GenerateTag("INVITE", "From"); + var template (value) RouteBody_List v_RouteBodyList; + var integer v_CSeqValue; + var template (value) From v_From; + var template (value) To v_To; + var template (value) CallId v_CallId; + var template (omit) SessionId v_SessionId; + + select (p_Context) { + case (A_2_1_A4) { + v_CSeqValue := p_CSeqValue; + v_From := cs_From(f_SIP_BuildSipUri_TX(tsc_IMS_CallerSipAddrStr), v_FromTag); + v_To := cs_ToDef(v_PublicUserId_SipUrl); + v_CallId := cs_CallId(v_CallIdString); + v_RouteBodyList := f_IMS_RouteSet_MT_Call_TX(); /* @sic R5s140324 - MCC160 Implementation sic@ */ + if (p_SessionIdSupported) { /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_SessionId := cs_SessionId(f_IMS_SessionId_TX_Generate(v_CallIdString)); + } else { + v_SessionId := omit; + } + } + case (A_2_1_A5) { + v_CSeqValue := f_IMS_PTC_ImsInfo_CseqIncr(dialogLocal); + v_From := f_IMS_RequestInDialog_FromHeaderTX(); + v_To := f_IMS_RequestInDialog_ToHeaderTX(); + v_CallId := f_IMS_PTC_ImsInfo_DialogGetCallId(); + if (f_IMS_PTC_ImsInfo_DialogIsMO()) { /* @sic R5s140324 - MCC160 Implementation sic@ */ + v_RouteBodyList := fl_RouteSet_ReverseOrder(f_IMS_RouteSet_MO_Call_TX()); /* @sic R5-142320, R5-144601 sic@ */ + } else { + v_RouteBodyList := f_IMS_RouteSet_MT_Call_TX(); + } + v_SessionId := f_IMS_PTC_ImsInfo_DialogGetSessionId(); + } + case else { + FatalError(__FILE__, __LINE__, "unknown context"); + } + } + + v_MessageHeader_Invite.via := f_IMS_InviteRequest_ViaTX(); /* @sic R5-134116: New function fl_IMS_InviteRequest_ViaTX sic@ */ + v_MessageHeader_Invite.recordRoute := cs_RecordRoute(v_RouteBodyList); + v_MessageHeader_Invite.fromField := v_From; + v_MessageHeader_Invite.toField := v_To; + v_MessageHeader_Invite.callId := v_CallId; + v_MessageHeader_Invite.sessionId := v_SessionId; + v_MessageHeader_Invite.cSeq := cs_CseqDef(v_CSeqValue, "INVITE"); + v_MessageHeader_Invite.supported := cs_Supported(tsc_OptionTagList_100rel & p_AdditionalOptionTagsForSupported); + v_MessageHeader_Invite.pCalledPartyID := cs_PCalledPartyId(v_PublicUserId_SipUrl); + v_MessageHeader_Invite.contentType := cs_ContentTypeSDP; + v_MessageHeader_Invite.maxForwards := cs_MaxForwardsDef; + v_MessageHeader_Invite.accept := cs_Accept({cs_AcceptBody("application/sdp"), cs_AcceptBody("application/3gpp-ims+xml")}); + + if (p_MTSI) { + v_GenericParam_3gpp_icsi_ref := cs_GenericParam_Common(tsc_IMS_FeatureParamId_3gpp_icsi_ref, cs_GenValueQuoted(cs_IMS_EncodedFeatureParamValue_3gpp_icsi_ref)); // @sic R5s130738: string needs to be quoted; R5-142247 sic@ + + if (p_Context == A_2_1_A4) { // @sic R5-142949 sic@ + v_MessageHeader_Invite.pAssertedService := cs_PAssertedService(tsc_IMS_FeatureParamValue_3gpp_icsi_ref); /* @sic R5s140565 change 1 sic@ */ + v_MessageHeader_Invite.acceptContact := cs_AcceptContact({v_GenericParam_3gpp_icsi_ref}); + } + v_ContactParams := f_SemicolonParam_List_Add_TX(v_ContactParams, v_GenericParam_3gpp_icsi_ref); + } + if (p_Video) { // @sic R5s130109 sic@ + v_ContactParams := f_SemicolonParam_List_Add_TX(v_ContactParams, cs_GenericParam("video")); + } + v_MessageHeader_Invite.contact := cs_Contact(f_SIP_BuildSipUri_TX(tsc_IMS_CallerSipAddrStr, tsc_IMS_CallerPort), v_ContactParams); + + if (p_Context != A_2_1_A5) { + if (p_SrvccAlertingSupported) { /* @sic R5s140385 change 6 - NOTE: feature caps shall only be inserted when creating a voice call sic@ */ + v_MessageHeader_Invite.featureCaps := cs_FeatureCaps({ cs_GenericParam(tsc_IMS_FeatureCap_SrvccAlerting)}); // @sic R5-145796 sic@ + } + + f_IMS_PTC_ImsInfo_DialogInit(dialogLocal, valueof(v_MessageHeader_Invite)); + } + return v_MessageHeader_Invite; + } + + /* + * @desc PRACK (see TS 34.229, A.2.4) + * @param p_InviteRequest + * @param p_MessageHeader_PrevReliableResponse + * @param p_ContentType (default value: omit) + * @return template (value) MessageHeader + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_PrackRequest_MessageHeaderTX(template (value) INVITE_Request p_InviteRequest, + MessageHeader p_MessageHeader_PrevReliableResponse, + template (omit) ContentType p_ContentType := omit) runs on IMS_PTC return template (value) MessageHeader + { /* p_MessageHeader_PrevReliableResponse .. MessageHeader of "the reliable response" (e.g. previous 183 response) */ + var template (value) MessageHeader v_MessageHeader_Invite := p_InviteRequest.msgHeader; + var template (value) MessageHeader v_MessageHeader_Prack := cs_MessageHeader_Dummy; + var template (value) Via v_Via := fl_Via_AddSigCompParam(v_MessageHeader_Invite.via); + var CSeq v_CSeq := p_MessageHeader_PrevReliableResponse.cSeq; /* sequence number of the reliable response which is to be acknowledged (-> rAck); see RFC 3262 cl. 7.2 */ + var integer v_CSeqValue := f_IMS_PTC_ImsInfo_CseqIncr(dialogLocal); /* incremented sequence number of the network side @sic R5-133188 sic@ */ + var integer v_ResponseNumber := p_MessageHeader_PrevReliableResponse.rSeq.responseNum; /* @sic R5s130510 additional change 2.1 sic@ */ + + v_MessageHeader_Prack.via := f_IMS_ViaRefreshBranches(v_Via); /* @sic R5s130561 change 1: refresh branches sic@ */ + v_MessageHeader_Prack.toField := f_IMS_RequestInDialog_ToHeaderTX(); + v_MessageHeader_Prack.fromField := f_IMS_RequestInDialog_FromHeaderTX(); + v_MessageHeader_Prack.callId := v_MessageHeader_Invite.callId; + v_MessageHeader_Prack.sessionId := v_MessageHeader_Invite.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Prack.cSeq := cs_CseqDef(v_CSeqValue, "PRACK"); + v_MessageHeader_Prack.maxForwards := cs_MaxForwardsDef; + v_MessageHeader_Prack.rAck := cs_RAckDef(v_ResponseNumber, v_CSeq.seqNumber, v_CSeq.method); + v_MessageHeader_Prack.contentType := p_ContentType; + + return v_MessageHeader_Prack; + } + + /* + * @desc UPDATE (see TS 34.229, A.2.5) + * @param p_InviteRequest + * @return template (value) MessageHeader + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_UpdateRequest_MessageHeaderTX(template (value) INVITE_Request p_InviteRequest) runs on IMS_PTC return template (value) MessageHeader + { + var template (value) MessageHeader v_MessageHeader_Invite := p_InviteRequest.msgHeader; + var template (value) MessageHeader v_MessageHeader_Update := cs_MessageHeader_Dummy; + var template (value) Via v_Via := fl_Via_AddSigCompParam(v_MessageHeader_Invite.via); + var integer v_CSeqValue := f_IMS_PTC_ImsInfo_CseqIncr(dialogLocal); + + v_MessageHeader_Update.via := f_IMS_ViaRefreshBranches(v_Via); /* @sic R5s130561 change 2: refresh branches sic@ */ + v_MessageHeader_Update.toField := f_IMS_RequestInDialog_ToHeaderTX(); + v_MessageHeader_Update.fromField := f_IMS_RequestInDialog_FromHeaderTX(); + v_MessageHeader_Update.callId := v_MessageHeader_Invite.callId; + v_MessageHeader_Update.sessionId := v_MessageHeader_Invite.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Update.cSeq := cs_CseqDef(v_CSeqValue, "UPDATE"); + v_MessageHeader_Update.maxForwards := cs_MaxForwardsDef; + v_MessageHeader_Update.contentType := cs_ContentTypeSDP; + v_MessageHeader_Update.contact := v_MessageHeader_Invite.contact; /* @sic R5-150692 sic@ */ + + return v_MessageHeader_Update; + } + + /* + * @desc ACK (see TS 34.229, A.2.7) + * @param p_InviteRequest + * @param p_StatusLine_PrevResponse (default value: c_statusLine200) + * @return template (value) MessageHeader + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_AckRequest_MessageHeaderTX(template (value) INVITE_Request p_InviteRequest, + template (value) StatusLine p_StatusLine_PrevResponse := c_statusLine200) runs on IMS_PTC return template (value) MessageHeader + { /* @sic R5-141115: new parameter p_StatusLine_PrevResponse sic@ */ + /* @sic R5s140194, R5-142319: no Route header in DL sic@ */ + var template (value) MessageHeader v_MessageHeader_Invite := p_InviteRequest.msgHeader; + var template (value) MessageHeader v_MessageHeader_Ack := cs_MessageHeader_Dummy; + var template (value) Via v_Via := fl_Via_AddSigCompParam(v_MessageHeader_Invite.via); + var integer v_CSeqValue := f_MessageHeader_GetCseqValue(v_MessageHeader_Invite); // for ACK the CSeq value of the corresponding INVATE has to be used + var integer v_StatusCode := valueof(p_StatusLine_PrevResponse.statusCode); + var boolean v_Is2xxResponse := not ((v_StatusCode < 200) or (v_StatusCode > 299)); // @sic R5s140264: missing braces sic@ + + if (v_Is2xxResponse) { /* @sic R5-141115, R5s140092 sic@ */ + v_MessageHeader_Ack.via := f_IMS_ViaRefreshBranches(v_Via); /* @sic R5s130510 sic@ */ + } else { + v_MessageHeader_Ack.via := v_MessageHeader_Invite.via; /* @sic R5s140092 change 6 sic@ */ + } + + v_MessageHeader_Ack.toField := f_IMS_RequestInDialog_ToHeaderTX(); + v_MessageHeader_Ack.fromField := f_IMS_RequestInDialog_FromHeaderTX(); + v_MessageHeader_Ack.callId := v_MessageHeader_Invite.callId; + v_MessageHeader_Ack.cSeq := cs_CseqDef(v_CSeqValue, "ACK"); + v_MessageHeader_Ack.maxForwards := cs_MaxForwardsDef; + v_MessageHeader_Ack.sessionId := v_MessageHeader_Invite.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + + return v_MessageHeader_Ack; + } + + /* + * @desc BYE (see TS 34.229, A.2.8) + * @param p_InviteRequest + * @return template (value) MessageHeader + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_ByeRequest_MessageHeaderTX(template (value) INVITE_Request p_InviteRequest) runs on IMS_PTC return template (value) MessageHeader + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + var template (value) MessageHeader v_MessageHeader_Invite := p_InviteRequest.msgHeader; + var template (value) MessageHeader v_MessageHeader_Bye := cs_MessageHeader_Dummy; + var template (value) Via v_Via; + var integer v_CSeqValue := f_IMS_PTC_ImsInfo_CseqIncr(dialogLocal); + + if (fl_IMS_InviteRequestIsMO(p_InviteRequest)) { /* @sic R5-134116: distinguish MO/MT call establishment sic@ */ + v_Via := f_IMS_InviteRequest_ViaTX(); + } else { + v_Via := fl_Via_AddSigCompParam(v_MessageHeader_Invite.via); + v_Via := f_IMS_ViaRefreshBranches(v_Via); /* @sic R5s130510 sic@ */ + } + + v_MessageHeader_Bye.via := v_Via; + v_MessageHeader_Bye.callId := v_MessageHeader_Invite.callId; + v_MessageHeader_Bye.sessionId := v_MessageHeader_Invite.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Bye.cSeq := cs_CseqDef(v_CSeqValue, "BYE"); + v_MessageHeader_Bye.maxForwards := cs_MaxForwardsDef; + v_MessageHeader_Bye.toField := f_IMS_RequestInDialog_ToHeaderTX(); + v_MessageHeader_Bye.fromField := f_IMS_RequestInDialog_FromHeaderTX(); + + return v_MessageHeader_Bye; + } + + //============================================================================ + // Functions to build requests to be received from the UE + //---------------------------------------------------------------------------- + /* + * @desc INVITE acc. to condition A4 - INVITE creating a dialog (see TS 34.229, A.2.1) + * @param p_MessageHeader (default value: cr_MessageHeader_Dummy) + * @param p_ExpectedCalleeUri + * @param p_AdditionalOptionTagsForSupported (default value: tsc_OptionTagList_Empty) + * @param p_Context (default value: A_2_1_A4) + * @param p_A3 (default value: pc_MultimediaTelephonyService) + * @param p_A8 (default value: pc_IMS_Geolocation) + * @param p_A9 (default value: pc_IMS_SessionIdSupported) + * @param p_A11 (default value: false) + * @return template (present) MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_InviteRequest_MessageHeaderRX(template (present) MessageHeader p_MessageHeader := cr_MessageHeader_Dummy, + template (present) SipUrl p_ExpectedCalleeUri, + OptionTag_List p_AdditionalOptionTagsForSupported := tsc_OptionTagList_Empty, + INVITE_A_2_1_Context_Type p_Context := A_2_1_A4, + boolean p_A3 := pc_MultimediaTelephonyService, /* @sic R5s130510 additional change 1: tsc_IMS_MTSI replaced by pc_MultimediaTelephonyService sic@ */ + boolean p_A8 := pc_IMS_Geolocation, + boolean p_A9 := pc_IMS_SessionIdSupported, + boolean p_A11 := false) + runs on IMS_PTC return template (present) MessageHeader + { /* p_A3: MTSI + p_A8: UE uses Geolocation header to provide its geographical location for emergency session setup, has obtained its location and is setting up an emergency session + p_A9: UE supports Session-ID @sic R5s150086: pc_IMS_SessionIdSupported per default sic@ + p_A11: INVITE for creating a video call and UE supports video media feature tag + NOTE1: If SigComp shall be applied the param "comp=sigcomp" is optional for Via, Route and Contact + NOTE2: condition A5 (re-INVITE within a dialog) is not considered yet and will have impact e.g. on checking of the From/To headers */ + /* @sic R5-133629: 100rel option tag shall always be included in INVITE; further option tags may be added => p_Supported replaced by p_AdditionalOptionTagsForSupported; Cleanup of functions for MO Call Setup sic@ */ + /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5s140017 MCC160 implementation: checks for A_2_1_A5 sic@ */ + /* @sic R5-140799: additional parameter p_MessageHeader to deal with Reason header sic@ */ + var boolean v_IsGiba := f_IMS_PTC_SecurityScheme_IsGiba(); // => A1/A2 + var template (present) MessageHeader v_MessageHeader_Invite := p_MessageHeader; + var template (present) RouteBody_List v_RouteBodyList; + var IMS_ProtectedPorts_Type v_Protected; + var template integer v_Port_us := *; + var template integer v_Port_ps := *; + var template DisplayName v_DisplayName := *; + var template (present) SipUrl v_SipUrlFrom := ?; /* per default any SIP URI is accepted in the From header in the first place; + further checks may be applied in f_IMS_A_2_1_Invite_CommonChecks (depending on the conditions acc. to A.2.1 */ + var template (present) charstring v_Pcscf; + var template (present) charstring v_MediaType := "application/sdp"; + var template (present) CallId v_CallId; + var template (present) integer v_CSeqValue := ?; + var template (present) From v_From; + var template (present) To v_To; + var template SessionId v_SessionId; + var template AcceptBody_List v_AcceptBodyList := {}; + var OptionTag_List v_OptionTag_List := tsc_OptionTagList_100rel & p_AdditionalOptionTagsForSupported; + + if (pc_IMS_CS_PS_SRVCCMidCall or pc_IMS_CS_PS_SRVCCAlert) { // @sic R5-145746 sic@ + v_OptionTag_List := v_OptionTag_List & tsc_OptionTagList_norefersub; + } + + if (p_Context == A_2_1_A6) { // INVITE for creating an emergency session in case of no registration + // Via, Route, Contact: ports to be used + v_Port_us := ?; + v_Port_ps := tsc_IMS_PortNumber_5060; + // From: Display + v_DisplayName := cr_DisplayName("Anonymous"); /* @sic R5s140005, R5-140901, R5w140111 sic@ */ + } + else { + // Via, Route, Contact: ports to be used + if (not v_IsGiba or (p_Context == A_2_1_A7)) { + v_Protected := f_IMS_PTC_Security_GetProtectedPorts(); + v_Port_us := v_Protected.Port_us; + v_Port_ps := v_Protected.Port_ps; + } + } + + if (p_Context == A_2_1_A5) { /* re-invite @sic R5s140017 MCC160 implementation sic@ */ + v_RouteBodyList := f_RouteSet_RouteBodyList_RX(); + v_CallId := f_IMS_PTC_ImsInfo_DialogGetCallId(); + v_From := f_IMS_RequestInDialog_FromHeaderRX(); + v_To := f_IMS_RequestInDialog_ToHeaderRX(); + v_CSeqValue := f_IMS_RequestInDialog_CSeqValueRX(); /* @sic R5s140235, R5s140385 change 3 MCC160 implementation sic@ */ + v_SessionId := f_IMS_PTC_ImsInfo_DialogGetSessionId(); + } + else { /* normal case: no re-invite */ + // route body acc. to conditions in A.2.1 + v_Pcscf := ?; /* @sic R5s140934 change 6: P-CSCF address is checked later on sic@ */ + + + if (match(p_Context, (A_2_1_A6, A_2_1_A7))) { // => emergency call + v_RouteBodyList[0] := cr_RouteBody(*, cr_SipUri_HostPort(v_Pcscf, v_Port_ps)); /* @sic R5s150817: "loose routing" parameter not mandatory for emergency call sic@ */ + } else { + v_RouteBodyList[0] := cr_RouteBody(*, cr_SipUri_HostPort_lr(v_Pcscf, v_Port_ps)); /* @sic R5s140873: v_Pcscf; R5s140934 change 6 sic@ */ + v_RouteBodyList[1] := cr_RouteBody(*, cr_SipUri_HostPort_lr(px_IMS_Scscf)); + } + if (p_A8) { + v_MessageHeader_Invite.geolocation := cr_GeolocationAny; + v_MessageHeader_Invite.geolocationRouting := cr_GeolocationRoutingSupported; // @sic R5-134798 sic@ + v_MediaType := "multipart/mixed"; + } + v_CallId := cr_CallId(?); + v_From := cr_From(v_DisplayName, v_SipUrlFrom); + v_To := cr_ToDef(p_ExpectedCalleeUri); + v_SessionId := f_IMS_SessionId_RX_IfSupported(p_A9); + } + + v_MessageHeader_Invite.via := f_IMS_InviteRequest_ViaRX(); /* additional checks in f_IMS_A_2_1_Invite_CommonChecks: check of FQDN or IP address + @sic R5-133358: rport is optional for tcp sic@ */ + v_MessageHeader_Invite.route := cr_Route(v_RouteBodyList); + v_MessageHeader_Invite.fromField := v_From; /* additional checks in f_IMS_A_2_1_Invite_CommonChecks: check of FQDN or IP address, check against P-Preferred-Identity header */ + v_MessageHeader_Invite.toField := v_To; /* additional checks in f_IMS_A_2_1_Invite_CommonChecks: check of tag */ + v_MessageHeader_Invite.callId := v_CallId; /* additional checks in f_IMS_A_2_1_Invite_CommonChecks: value acc. to A4 or A5 */ + v_MessageHeader_Invite.sessionId := v_SessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Invite.cSeq := cr_CseqDef(v_CSeqValue, "INVITE"); /* additional checks in f_IMS_A_2_1_Invite_CommonChecks: A5 */ + v_MessageHeader_Invite.supported := cr_Supported(v_OptionTag_List); + v_MessageHeader_Invite.contact := cr_Contact(f_Contact_SipUri_HostPortRX(?, v_Port_us)); /* additional checks in f_IMS_A_2_1_Invite_CommonChecks: check of FQDN or IP address, check of feature-param for A3, A6, A10, A12 + @sic R5s150721, R5-153760: cr_SipUri_HostPort replaced by f_Contact_SipUri_HostPortRX sic@ */ + v_MessageHeader_Invite.contentType := cr_ContentType(v_MediaType); + v_MessageHeader_Invite.maxForwards := cr_MaxForwardsDef; + + // additional headers for specific conditions: + if (v_IsGiba or (p_Context == A_2_1_A6)) { + v_MessageHeader_Invite.securityVerify := omit; + if (p_Context == A_2_1_A6) { + v_MessageHeader_Invite.require := omit; + v_MessageHeader_Invite.proxyRequire := omit; + } + } else { // -> A1 or A7 + v_MessageHeader_Invite.securityVerify := f_IMS_PTC_BuildSecurityVerifyHeader(); + if (p_Context != A_2_1_A5) { /* @sic R5s140017 change 9.3 sic@ */ + v_MessageHeader_Invite.require := cr_RequireSecAgree; + v_MessageHeader_Invite.proxyRequire := cr_ProxyRequireDef; + } + } + + if (not v_IsGiba) { + v_MessageHeader_Invite.pAccessNetworkInfo := cr_PAccessNetworkInfoDef(f_IMS_PTC_RanType_GetString()); + } + + if (p_Context == A_2_1_A4) { /* @sic R5s140017 change 9.3 sic@ */ + v_AcceptBodyList := {cr_AcceptBody("application/sdp"), cr_AcceptBody("application/3gpp-ims+xml")}; + } + if (pc_IMS_CS_PS_SRVCCMidCall) { // @sic R5-145746 sic@ + v_AcceptBodyList[lengthof(v_AcceptBodyList)] := cr_AcceptBody("application/vnd.3gpp.mid-call+xml"); // add another element in the array + } + if (pc_IMS_CS_PS_SRVCCAlert) { // @sic R5-145746 sic@ + v_AcceptBodyList[lengthof(v_AcceptBodyList)] := cr_AcceptBody("application/vnd.3gpp.state-and-event-info+xml"); // add another element in the array + v_MessageHeader_Invite.recvInfo := cr_RecvInfo ({cr_InfoPackage_Type("g.3gpp.state-and-event")}); // @sic R5-145746, R5s150704 sic@ + } + if (lengthof(v_AcceptBodyList) > 0) { + v_MessageHeader_Invite.accept := cr_Accept(superset(all from v_AcceptBodyList)); + } + + if (p_A8) { + v_MessageHeader_Invite.geolocation := cr_GeolocationAny; // Checked in f_IMS_A_2_1_Invite_CommonChecks + v_MessageHeader_Invite.geolocationRouting := cr_GeolocationRoutingAny; // Checked in f_IMS_A_2_1_Invite_CommonChecks @sic R5-133151 sic@ + } + + if (p_Context == A_2_1_A7) { + v_MessageHeader_Invite.pPreferredID := cr_PPreferredID(?); // Checked in f_IMS_A_2_1_Invite_CommonChecks + } + if (p_A3 and (p_Context == A_2_1_A4)) { /* @sic R5s140263 change 5, modified by R5-142949 (-> A4 only) sic@ */ + v_MessageHeader_Invite.pPreferredService := cr_PPreferredService(tsc_IMS_FeatureParamValue_3gpp_icsi_ref); /* @sic R5s140565 change 2 sic@ */ + } + if ((p_A3 and (p_Context == A_2_1_A4)) or p_A11) { /* @sic R5-142949 sic@ */ + v_MessageHeader_Invite.acceptContact := cr_AcceptContact; // Checked in f_IMS_A_2_1_Invite_CommonChecks (depending on conditions) + } + + return v_MessageHeader_Invite; + } + + //---------------------------------------------------------------------------- + /* + * @desc PRACK (see TS 34.229, A.2.4) + * @param p_InviteRequest + * @param p_MessageHeader_PrevReliableResponse + * @param p_ContentType (default value: *) + * @return template (present) MessageHeader + * @status APPROVED (IMS, LTE, LTE_A) + */ + function f_IMS_PrackRequest_MessageHeaderRX(template (value) INVITE_Request p_InviteRequest, + template (value) MessageHeader p_MessageHeader_PrevReliableResponse, + template ContentType p_ContentType := *) runs on IMS_PTC return template (present) MessageHeader + { /* p_MessageHeader_PrevReliableResponse .. MessageHeader of "the reliable response" (e.g. previous 183 response) */ + var MessageHeader v_MessageHeader_PrevReliableResponse := valueof(p_MessageHeader_PrevReliableResponse); + var template (value) MessageHeader v_MessageHeader_Invite := p_InviteRequest.msgHeader; + var template (present) MessageHeader v_MessageHeader_Prack := cr_MessageHeader_Dummy; + var CSeq v_CSeq := v_MessageHeader_PrevReliableResponse.cSeq; + var integer v_CSeqValue := f_IMS_PTC_ImsInfo_CseqIncr(dialogRemote); /* @sic R5s130497 change 3; R5-133188 sic@ */ + var integer v_ResponseNumber := v_MessageHeader_PrevReliableResponse.rSeq.responseNum; /* @sic R5s130333 change 5.2 sic@ */ + + v_MessageHeader_Prack.via := fl_Via_AsInPrevInvite(v_MessageHeader_Invite.via); // @sic R5s120530 change 3.9 sic@ + v_MessageHeader_Prack.route := fl_Route_ReverseOrderOfRecordRouteRX(v_MessageHeader_PrevReliableResponse.recordRoute); + v_MessageHeader_Prack.toField := f_IMS_RequestInDialog_ToHeaderRX(); /* @sic R5s130497 change 1 - MCC160 implementation; R5s140017 MCC160 implementation sic@ */ + v_MessageHeader_Prack.fromField := f_IMS_RequestInDialog_FromHeaderRX(); /* @sic R5s130497 change 1 - MCC160 implementation; R5s140017 MCC160 implementation sic@ */ + v_MessageHeader_Prack.callId := v_MessageHeader_Invite.callId; + v_MessageHeader_Prack.sessionId := v_MessageHeader_Invite.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Prack.cSeq := cr_CseqDef(v_CSeqValue, "PRACK"); + v_MessageHeader_Prack.maxForwards := cr_MaxForwardsDef; + v_MessageHeader_Prack.rAck := cr_RAckDef(v_ResponseNumber, v_CSeq.seqNumber, v_CSeq.method); + v_MessageHeader_Prack.contentType := p_ContentType; + + return v_MessageHeader_Prack; + } + + /* + * @desc UPDATE (see TS 34.229, A.2.5) + * @param p_InviteRequest + * @param p_EmergencyType (default value: NO_EMERGENCY) + * @return template (present) MessageHeader + * @status APPROVED (IMS, LTE, LTE_A) + */ + function f_IMS_UpdateRequest_MessageHeaderRX(template (value) INVITE_Request p_InviteRequest, + IMS_Emergency_Type p_EmergencyType := NO_EMERGENCY) + runs on IMS_PTC return template (present) MessageHeader + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5s150692 change 8: parameter p_EmergencyType sic@ */ + var template (value) MessageHeader v_MessageHeader_Invite := p_InviteRequest.msgHeader; + var template (present) MessageHeader v_MessageHeader_Update := cr_MessageHeader_Dummy; + var template (present) integer v_CSeqValue := f_IMS_RequestInDialog_CSeqValueRX(); + var template (present) RouteBody_List v_RouteBodyList := f_RouteSet_RouteBodyList_RX(p_EmergencyType); /* @sic R5s140385 change 3 - MCC160 Implementation: sic@ + @sic R5s150692 change 8 sic@ */ + var template (present) Via v_Via; + + if (f_IMS_PTC_ImsInfo_DialogIsMO()) { /* @sic R5s140385 change 3 - MCC160 Implementation sic@ */ + v_Via := fl_Via_AsInPrevInvite(v_MessageHeader_Invite.via); // @sic R5s120530 change 3.10 sic@ + } else { + v_Via := f_IMS_InviteRequest_ViaRX(); /* @sic R5s140385 change 3 - MCC160 Implementation: same as in INVITE sic@ */ + } + + v_MessageHeader_Update.via := v_Via; + v_MessageHeader_Update.route := cr_Route(v_RouteBodyList); + v_MessageHeader_Update.toField := f_IMS_RequestInDialog_ToHeaderRX(); /* @sic R5s130497 change 1 - MCC160 implementation; R5s140017 MCC160 implementation sic@ */ + v_MessageHeader_Update.fromField := f_IMS_RequestInDialog_FromHeaderRX(); /* @sic R5s130497 change 1 - MCC160 implementation; R5s140017 MCC160 implementation sic@ */ + v_MessageHeader_Update.callId := v_MessageHeader_Invite.callId; + v_MessageHeader_Update.sessionId := v_MessageHeader_Invite.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Update.cSeq := cr_CseqDef(v_CSeqValue, "UPDATE"); + v_MessageHeader_Update.maxForwards := cr_MaxForwardsDef; + v_MessageHeader_Update.contentType := cr_ContentTypeSDP; + v_MessageHeader_Update.contact := cr_Contact(?); /* @sic R5-150692 sic@ */ + + if (not f_IMS_PTC_SecurityScheme_IsGiba()) { + v_MessageHeader_Update.require := cr_RequireSecAgree; + v_MessageHeader_Update.proxyRequire := cr_ProxyRequireDef; + v_MessageHeader_Update.securityVerify := f_IMS_PTC_BuildSecurityVerifyHeader(); + v_MessageHeader_Update.pAccessNetworkInfo := cr_PAccessNetworkInfoDef(f_IMS_PTC_RanType_GetString()); + } else { + v_MessageHeader_Update.securityVerify := omit; + } + + return v_MessageHeader_Update; + } + + /* + * @desc ACK (see TS 34.229, A.2.7) + * @param p_InviteRequest + * @param p_StatusLine_PrevResponse + * @param p_EmergencyType (default value: NO_EMERGENCY) + * @param p_IsReInvite (default value: false) + * @return template (present) MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_AckRequest_MessageHeaderRX(template (value) INVITE_Request p_InviteRequest, + template (value) StatusLine p_StatusLine_PrevResponse, + IMS_Emergency_Type p_EmergencyType := NO_EMERGENCY, + boolean p_IsReInvite := false) + runs on IMS_PTC return template (present) MessageHeader + { /* @sic R5s130684: p_StatusLine_PrevResponse made mandatory, p_MessageHeader_PrevResponse removed, new parameter p_IsGiba sic@ */ + /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5-141115: new parameter p_IsReInvite sic@ */ + /* @sic R5s150692 change 18: parameter p_EmergencyType sic@ */ + var template (value) MessageHeader v_MessageHeader_Invite := p_InviteRequest.msgHeader; + var template (present) MessageHeader v_MessageHeader_Ack := cr_MessageHeader_Dummy; + var integer v_CSeqValue := f_MessageHeader_GetCseqValue(v_MessageHeader_Invite); + var integer v_StatusCode := valueof(p_StatusLine_PrevResponse.statusCode); + var boolean v_Is2xxResponse := not ((v_StatusCode < 200) or (v_StatusCode > 299)); // @sic R5s140264: missing braces sic@ + var template RouteBody_List v_RouteBodyList; + + if (p_IsReInvite or not v_Is2xxResponse) { /* @sic R5-141115 sic@ */ + v_RouteBodyList := p_InviteRequest.msgHeader.route.routeBody; /* @sic R5-134958, R5s130885: use the Route header of the INVITE in case of e.g. 5XX responses (see RFC 3261 cl. 17.1.1.3) sic@ */ + } else { + v_RouteBodyList := f_RouteSet_RouteBodyList_RX(p_EmergencyType); /* @sic R5s130684: same as for 180 or 183 response in reverse order sic@ + @sic R5s130897 change 3 sic@ + @sic R5s140017 MCC160 implementation: re-INVITE - Route is different for MO and MT calls sic@ + @sic R5s150692 change 18 sic@ */ + } + + if (v_Is2xxResponse) { /* @sic R5-130682: ACK for 2xx response sic@ */ + v_MessageHeader_Ack.via := fl_Via_AsInPrevInvite(v_MessageHeader_Invite.via); + } else { /* @sic R5-130682: ACK for non-2xx response sic@ */ + v_MessageHeader_Ack.via := v_MessageHeader_Invite.via; + } + + v_MessageHeader_Ack.route := cr_Route(v_RouteBodyList); + v_MessageHeader_Ack.toField := f_IMS_RequestInDialog_ToHeaderRX(); /* @sic R5s130497 change 1 - MCC160 implementation; R5-133303; R5s140017 MCC160 implementation sic@ */ + v_MessageHeader_Ack.fromField := f_IMS_RequestInDialog_FromHeaderRX(); /* @sic R5s130497 change 1 - MCC160 implementation; R5-133303; R5s140017 MCC160 implementation sic@ */ + v_MessageHeader_Ack.callId := v_MessageHeader_Invite.callId; + v_MessageHeader_Ack.sessionId := v_MessageHeader_Invite.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Ack.cSeq := cr_CseqDef(v_CSeqValue, "ACK"); + v_MessageHeader_Ack.maxForwards := cr_MaxForwardsDef; + v_MessageHeader_Ack.pAccessNetworkInfo := omit; + + return v_MessageHeader_Ack; + } + + /* + * @desc BYE (see TS 34.229, A.2.8) + * @param p_InviteRequest + * @param p_EmergencyType (default value: NO_EMERGENCY) + * @param p_DialogIndex (default value: omit) + * @return template (present) MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) + */ + function f_IMS_ByeRequest_MessageHeaderRX(template (value) INVITE_Request p_InviteRequest, + IMS_Emergency_Type p_EmergencyType := NO_EMERGENCY, + template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return template (present) MessageHeader + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5s150692 change 19: parameter p_EmergencyType sic@ */ + var template (value) MessageHeader v_MessageHeader_Invite := p_InviteRequest.msgHeader; + var template (present) MessageHeader v_MessageHeader_Bye := cr_MessageHeader_Dummy; + var integer v_CSeqValue := f_IMS_PTC_ImsInfo_CseqIncr(dialogRemote, p_DialogIndex); + var boolean v_SecurityIsStarted := f_IMS_PTC_Security_IsStarted(); /* @sic R5s130988 Change 2-5 - MCC160 Implementation sic@ */ + var template (present) RouteBody_List v_RouteBodyList; + var template (present) Via v_Via; + + if (not fl_IMS_InviteRequestIsMO(p_InviteRequest)) { /* @sic R5-134116: sic@ + in case of MT call establishment the INVITE sent to the UE contains a Record-Route header with a valid route set */ + v_Via := f_IMS_InviteRequest_ViaRX(); + } else { /* in case of MO call establishment the route set as for the 183 response shall be used (in reverse order) */ + v_Via := fl_Via_AsInPrevInvite(v_MessageHeader_Invite.via) + } + v_RouteBodyList := f_RouteSet_RouteBodyList_RX(p_EmergencyType, p_DialogIndex); /* @sic R5s140017 MCC160 implementation: re-INVITE - Route is different for MO and MT calls sic@ + @sic R5s150692 change 19 sic@ */ + + v_MessageHeader_Bye.via := v_Via; + v_MessageHeader_Bye.route := cr_Route(v_RouteBodyList); + v_MessageHeader_Bye.toField := f_IMS_RequestInDialog_ToHeaderRX(p_DialogIndex); /* @sic R5s130497 change 1 - MCC160 implementation; R5s140017 MCC160 implementation sic@ */ + v_MessageHeader_Bye.fromField := f_IMS_RequestInDialog_FromHeaderRX(p_DialogIndex); /* @sic R5s130497 change 1 - MCC160 implementation; R5s140017 MCC160 implementation sic@ */ + v_MessageHeader_Bye.callId := v_MessageHeader_Invite.callId; + v_MessageHeader_Bye.sessionId := v_MessageHeader_Invite.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Bye.cSeq := cr_CseqDef(v_CSeqValue, "BYE"); + v_MessageHeader_Bye.maxForwards := cr_MaxForwardsDef; + + if (v_SecurityIsStarted) { /* @sic R5s130988 Change 2-5 - MCC160 Implementation sic@ */ + v_MessageHeader_Bye.require := cr_RequireSecAgree; + v_MessageHeader_Bye.proxyRequire := cr_ProxyRequireDef; + v_MessageHeader_Bye.securityVerify := f_IMS_PTC_BuildSecurityVerifyHeader(); + v_MessageHeader_Bye.pAccessNetworkInfo := cr_PAccessNetworkInfoDef(f_IMS_PTC_RanType_GetString()); + } else { + v_MessageHeader_Bye.securityVerify := omit; + } + + return v_MessageHeader_Bye; + } + + //============================================================================ + // Check functions + //---------------------------------------------------------------------------- + /* + * @desc check whether call-id has been used previously + * @param p_MessageHeader + * @param p_PrevCallIds + * @status APPROVED (IMS) + */ + function f_IMS_MessageHeader_CheckCallId(MessageHeader p_MessageHeader, + CharStringList_Type p_PrevCallIds) runs on IMS_PTC + { + var integer i; + + for (i:=0; i < lengthof(p_PrevCallIds); i:=i+1) { + if (match(p_MessageHeader.callId.callid, p_PrevCallIds[i])) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "invalid 'CallId': has already been used in previous request)"); + } + } + } + + /* + * @desc Additional checks of the INVITE acc. to A.2.1 + * @param p_IMS_INVITE_REQ + * @param p_Context (default value: A_2_1_A4) + * @param p_A3 (default value: false) + * @param p_A8 (default value: false) + * @param p_A10 (default value: pc_IMS_Video_FeatureTag) + * @param p_A11 (default value: false) + * @param p_SrvccAlertingSupported (default value: pc_IMS_SRVCCAlert) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_A_2_1_Invite_CommonChecks(IMS_DATA_REQ p_IMS_INVITE_REQ, + INVITE_A_2_1_Context_Type p_Context := A_2_1_A4, + boolean p_A3 := false, + boolean p_A8 := false, + boolean p_A10 := pc_IMS_Video_FeatureTag, + boolean p_A11 := false, + boolean p_SrvccAlertingSupported := pc_IMS_SRVCCAlert) runs on IMS_PTC + { // p_A12 .. shall be pc_IMS_SRVCCAlert for voice call; needs to be set to false for non-voice calls + /* @sic R5-133276, R5-133301 Cleanup of functions for MO Call Setup sic@ */ + /* @sic R5s140370 change 7: pc_IMS_SRVCCAlert default value for p_A12, p_A12 renamed to p_SrvccAlertingSupported sic@ */ + /* @sic R5s150180: tsc_IMS_VideoFeature replaced by pc_IMS_Video_FeatureTag sic@ */ + var MessageHeader v_MessageHeader := p_IMS_INVITE_REQ.Request.Invite.msgHeader; + var SemicolonParam_List v_ContactParams := {}; + var SemicolonParam_List v_AcceptContactParams := {}; + var InternetProtocol_Type v_Protocol := p_IMS_INVITE_REQ.RoutingInfo.Protocol; + var SipUrl v_SipUrlFrom := f_Addr_Union_GetSipUrl(v_MessageHeader.fromField.addressField); + var SipUrl v_SipUrlPreferred; + var template SipUrl v_ExpectedFromUrl := omit; + var PPreferredIDValue_List v_PreferredIDValueList; + var CharStringList_Type v_PreferredPublicUserIdList; + var boolean v_AllowFQDN := (p_Context != A_2_1_A6); // for A6 there is no FQDN for the UE + var boolean v_CheckRport := (p_Context == A_2_1_A6); + var boolean v_A12 := p_SrvccAlertingSupported and (p_Context != A_2_1_A5); /* @sic R5s140370 change 7 sic@ */ + var integer i; + var template (present) GenValue v_SipInstanceValue; + + if (ispresent(v_MessageHeader.contact.contactBody.contactAddresses[0].contactParams)) { + v_ContactParams := v_MessageHeader.contact.contactBody.contactAddresses[0].contactParams; + } + if (ispresent(v_MessageHeader.acceptContact.acValues[0].acRcParams)) { + v_AcceptContactParams := v_MessageHeader.acceptContact.acValues[0].acRcParams; + } + + // **** Common checks **** + f_IMS_MessageHeader_Request_CheckVia(v_MessageHeader, v_Protocol, v_AllowFQDN, v_CheckRport); // check whether via contains "SIP URI with IP address or FQDN" (see @sic R5s120727 sic@) + f_IMS_MessageHeader_CheckContactAddr(v_MessageHeader); // check whether contact contains "SIP URI with IP address or FQDN" (see @sic R5s120727 sic@) + if (p_Context != A_2_1_A5) { + f_IMS_MessageHeader_CheckTo(v_MessageHeader, noToTag); // check that there is no To tag + f_IMS_MessageHeader_Request_CheckRoute(v_MessageHeader); // @sic R5s140934 change 7 sic@ + } + + // **** Check URIs in From header, P-Preferred-Identity header and further headers **** + select (p_Context) { + case (A_2_1_A4) { + // Check Call-Id + if (match(v_MessageHeader.callId.callid, f_IMS_PTC_ImsInfo_GetCallIdRegistration())) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "A.2.1 condition A4: invalid 'CallId' in INVITE (has to be different than in previous REGISTER)"); + } + // Additional checks regarding SIP URI in the From header @sic R5-130750 change 3 sic@ + if (not f_IMS_PublicUserId_Match(f_IMS_PTC_ImsInfo_GetAllIMPUs(), v_SipUrlFrom)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "invalid 'From'"); + } + if (ispresent(v_MessageHeader.pPreferredID.pPreferredIDValueList)) { + v_PreferredIDValueList := v_MessageHeader.pPreferredID.pPreferredIDValueList; + for (i:=0; i < lengthof(v_PreferredIDValueList); i := i+1) { + v_PreferredPublicUserIdList[i] := f_SIP_SipUrl_GetPublicUserIdentity(f_Addr_Union_GetSipUrl(v_PreferredIDValueList[i])); + } + if (not f_IMS_PublicUserId_Match(v_PreferredPublicUserIdList, v_SipUrlFrom)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "A.2.1 condition A4: invalid 'From': does not match with P-Preferred-Identity"); + } + } + } + case (A_2_1_A5) { + /* @sic R5s140017 MCC160 implementation: no further checks for A5 are needed in this function anymore sic@ */ + } + case (A_2_1_A6) { + v_SipInstanceValue := cr_GenValueQuoted(f_SIP_InstanceId()); /* @sic R5s130756 change 11; R5w140111: GenValue; R5s141212 sic@ */ + if (not match(v_ContactParams, cr_SemicolonParam_List_OneSpecificParam("+sip.instance", v_SipInstanceValue))) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "IMEI code of the UE, coded as specified in draft-montemurro-gsma-imei-urn, not matching"); + } + } + case (A_2_1_A7) { + v_ExpectedFromUrl := f_IMS_PTC_ImsInfo_GetSipUriRX(emergencyId, *); + if (not match(v_SipUrlFrom, v_ExpectedFromUrl)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "A.2.1 condition A7: invalid 'From'"); + } + v_SipUrlPreferred := f_Addr_Union_GetSipUrl(v_MessageHeader.pPreferredID.pPreferredIDValueList[0]); + if (not match(v_SipUrlPreferred, v_ExpectedFromUrl)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "A.2.1 condition A7: invalid 'P-Preferred-Identity'"); + } + } + case else { + FatalError(__FILE__, __LINE__, "unknown context"); + } + } + + // **** Check further Contact feature-param acc. to further conditions of A.2.1: **** + // + if (p_A3) { // A.1.2 condition A3: MTSI + if (not match(v_ContactParams, cr_FeatureParamList_3gpp_icsi_ref)) { // @sic R5s130738: string needs to be quoted; R5-142247 sic@ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "A.2.1 condition A3: Missing feature-param in Contact header"); + } + if (p_Context == A_2_1_A4) { // @sic R5-142949 sic@ + if (not match(v_AcceptContactParams, cr_FeatureParamList_3gpp_icsi_ref)) { // @sic R5s130738: string needs to be quoted; R5-142247 sic@ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "A.2.1 condition A3: Missing feature-param in AcceptContact header"); + } + } + } + if (p_A8) { // A.1.2 condition A8: check geolocation and geolocationRouting @sic R5-133151 sic@ + /* NOTE: v_MessageHeader.geolocation and geolocationRouting are checked already by template returned by f_IMS_InviteRequest_MessageHeaderRX: + * geolocation and geolocationRouting to be present. @sic R5-133151 sic@ */ + if (not match(v_MessageHeader.geolocationRouting.state, GEOLOCATION_ROUTING_YES_E)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "A.2.1 condition A8: Wrong geolocation-routing"); + } + } + if (p_A10 and p_A11 and (p_Context != A_2_1_A6) and (p_Context != A_2_1_A7)) { /* A.1.2 condition A10: UE supports video + A.1.2 condition A11: INVITE for creating a video call and UE supports video + @sic R5-153766: "p_A10 and p_A11 and (p_Context != A_2_1_A6) and (p_Context != A_2_1_A7)" sic@ */ + if (not match(v_ContactParams, cr_VideoInContactParams)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "A.2.1 condition A10, A11: Missing feature-param in Contact header"); + } + if (not match(v_AcceptContactParams, cr_VideoInContactParams)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "A.2.1 condition A10, A11: Missing feature-param in Accept-Contact header"); + } + } + if (v_A12) { // A.1.2 condition A12: INVITE for creating a voice call and UE supports g.3gpp.srvcc-alerting media feature tag + if (not match(v_ContactParams, cr_SemicolonParam_List_OneSpecificParamNoValue(tsc_IMS_FeatureCap_SrvccAlerting))) { /* @sic R5s140370 change 7: tsc_IMS_FeatureCap_SrvccAlerting sic@ */ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "A.2.1 condition A12: Missing feature-param"); + } + } + } + + //---------------------------------------------------------------------------- + /* + * @desc Check Geolocation header (if any) + * @param p_MessageBody + * @param p_SDP_MessageTemplate + * @param p_GeolocationInfoAvailable (default value: false) + * @return SDP_Message + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_MessageBody_CheckSdpMessageAndGeolocation(MessageBody p_MessageBody, + template (present) SDP_Message p_SDP_MessageTemplate, + boolean p_GeolocationInfoAvailable := false) runs on IMS_PTC return SDP_Message + { /* @sic R5w140112: new parameter p_SDP_MessageTemplate sic@ */ + var SdpBody v_SdpBody; + var MimeEncapsulatedList v_MimeEncapsulatedList; + var Geolocation_Type v_Geolocation; + var PIDF_Presence_Type v_Presence; + var PIDF_Status_ElemList_Type v_Status_ElemList; + var charstring v_XmlBody; + var bitstring v_BitStr; + + if (p_GeolocationInfoAvailable) { + if (not ispresent(p_MessageBody.mimeMessageBody.mimeEncapsulatedList) and + lengthof(p_MessageBody.mimeMessageBody.mimeEncapsulatedList) != 2) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Invalid Invite body"); + } + v_MimeEncapsulatedList := p_MessageBody.mimeMessageBody.mimeEncapsulatedList; + if (ischosen(v_MimeEncapsulatedList[0].mime_encapsulated_part.sdpMessageBody)) { + v_SdpBody := v_MimeEncapsulatedList[0].mime_encapsulated_part.sdpMessageBody; + v_XmlBody := v_MimeEncapsulatedList[1].mime_encapsulated_part.xmlBody; + } else { + v_SdpBody := v_MimeEncapsulatedList[1].mime_encapsulated_part.sdpMessageBody; + v_XmlBody := v_MimeEncapsulatedList[0].mime_encapsulated_part.xmlBody; + } + + // Check PDIF + v_BitStr := oct2bit(char2oct(v_XmlBody)); + if (decvalue(v_BitStr, v_Presence) != 0) { + FatalError(__FILE__, __LINE__, "Presence (PIDF) cannot be decoded"); + } + if (not match (v_Presence, cr_PIDF_Presence_Any)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Presence (PIDF) does not match"); + } + + // Check PDIF-LO see RFC 4119 cl. 2.2 + // extends the 'status' element of PIDF with a complex element called 'geopriv' + // There are two major subelements that are encapsulated within geopriv: one for location information, and one for usage rules + if (not ispresent(v_Presence.tuple_list[0].status.elem_list)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Presence.tuple_list[0].status.elem_list not present"); // + } + else { + v_Status_ElemList := v_Presence.tuple_list[0].status.elem_list; + } + v_BitStr := oct2bit(str2oct(v_Status_ElemList[0])); // first of 1 or more geopriv elements + + if (decvalue(v_BitStr, v_Geolocation) != 0) { + FatalError(__FILE__, __LINE__, "Geolocation cannot be decoded"); + } + // The PIDF-LO shall contain at least the following elements: (34.229-1 cl. A.2.1) + // - One or more 'geopriv' elements, each containing: + // - One 'location-info' element describing the location of the UE; and + // - One 'usage-rules' element describing the limitations of the usage of the location info. + if (not match (v_Geolocation, cr_Geolocation_Any)) { // 1st geopriv element is checked: well structured information is matched, not the contents + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Geolocation does not match"); + } + } else { + v_SdpBody := p_MessageBody.sdpMessageBody; + } + return f_IMS_SIP_DecodeMatchAndCheckSDP(v_SdpBody, p_SDP_MessageTemplate); + } + + //============================================================================ + // Common functions for Call Control acc. to 34.229-1 Annex C + //---------------------------------------------------------------------------- + /* + * @desc Common function to receive and check INVITE + * when the INVITE is optional a wait duration shall be given + * @param p_Context (default value: A_2_1_A4) + * @param p_MessageHeader (default value: cr_MessageHeader_Dummy) + * @param p_AdditionalOptionTagsForSupported (default value: tsc_OptionTagList_Empty) + * @param p_OtherCalleeUri (default value: omit) + * @param p_WaitDuration (default value: omit) + * @param p_A3 (default value: pc_MultimediaTelephonyService) + * @param p_A8 (default value: pc_IMS_Geolocation) + * @param p_A9 (default value: false) + * @param p_A11 (default value: false) + * @param p_SrvccAlertingSupported (default value: pc_IMS_SRVCCAlert) + * @return template (omit) IMS_DATA_REQ + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_INVITE_ReceiveRequest_Common(INVITE_A_2_1_Context_Type p_Context := A_2_1_A4, + template (present) MessageHeader p_MessageHeader := cr_MessageHeader_Dummy, + OptionTag_List p_AdditionalOptionTagsForSupported := tsc_OptionTagList_Empty, + template SipUrl p_OtherCalleeUri := omit, + template (omit) float p_WaitDuration := omit, + boolean p_A3 := pc_MultimediaTelephonyService, /* @sic R5s130510 additional change 1: tsc_IMS_MTSI replaced by pc_MultimediaTelephonyService sic@ */ + boolean p_A8 := pc_IMS_Geolocation, + boolean p_A9 := false, + boolean p_A11 := false, + boolean p_SrvccAlertingSupported := pc_IMS_SRVCCAlert) + runs on IMS_PTC return template (omit) IMS_DATA_REQ + { /* p_OtherCalleeUri .. if present to be used as CalleeUri; if omit default CalleeUri is used acc. to PIXITs and context */ + /* @sic R5-133276, R5-133301 Cleanup of functions for MO Call Setup sic@ */ + /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5-140799: additional parameter p_MessageHeader to deal with Reason header sic@ */ + /* @sic R5s140370 change 7: pc_IMS_SRVCCAlert default value for p_A12, p_A12 renamed to p_SrvccAlertingSupported sic@ */ + /* @sic R5s150180: p_A10 removed sic@ */ + /* @sic R5s150177 change 9, R5s150204: p_OtherCalleeUri changed to "template SipUrl p_OtherCalleeUri"; NOTE: p_OtherCalleeUri shall either omit or "template (present)" (but not e.g. "*") sic@ */ + var IMS_DATA_REQ v_IMS_DATA_REQ; + var template (present) MessageBody v_MessageBody := f_SIP_MessageBodySDP_RX(p_A8); /* @sic R5w140112 sic@ */ + var template (present) MessageHeader v_MessageHeader_Invite; + var template (present) SipUrl v_ExpectedCalleeUri; + var INVITE_Request v_InviteRequest; + var SipUrl v_ContactUrl; + var boolean v_TimerControl := ispresent(p_WaitDuration); + timer t_Timer; + + if (ispresent(p_OtherCalleeUri)) { + v_ExpectedCalleeUri := p_OtherCalleeUri; /* @sic R5s150204 sic@ */ + } else { + select (p_Context) { + case (A_2_1_A4) { // A4: INVITE creating a dialog + v_ExpectedCalleeUri := f_SIP_BuildSipUri_RX(px_IMS_CalleeUri); + } + case (A_2_1_A5) { // A5: re-INVITE + v_ExpectedCalleeUri := f_SIP_BuildSipUri_RX(px_IMS_CalleeContactUri, *); /* @sic R5s140020 change 8.1 sic@ */ + } + case (A_2_1_A6, A_2_1_A7) { // A6, A7: emergency call + v_ExpectedCalleeUri := cr_SipUrl_Common(c_urnScheme, cr_SipUrl_SOS); + } + case else { + FatalError(__FILE__, __LINE__, ""); + } + } + } + v_MessageHeader_Invite := f_IMS_InviteRequest_MessageHeaderRX(p_MessageHeader, v_ExpectedCalleeUri, p_AdditionalOptionTagsForSupported, p_Context, p_A3, p_A8, p_A9, p_A11); + + if (v_TimerControl) { + t_Timer.start(valueof(p_WaitDuration)); + } + alt { + [] IMS_Server.receive(car_IMS_Invite_Request(cr_INVITE_Request(v_ExpectedCalleeUri, v_MessageHeader_Invite, v_MessageBody))) -> value v_IMS_DATA_REQ + { + t_Timer.stop; + v_InviteRequest := v_IMS_DATA_REQ.Request.Invite; + if (p_Context == A_2_1_A6) { // emergency call without registration @sic R5s130756 change 14 sic@ + v_ContactUrl := f_MessageHeader_GetContactSipUrl(v_InviteRequest.msgHeader); /* @sic R5s150268 change 1 sic@ */ + f_IMS_PTC_ImsInfo_Init(v_IMS_DATA_REQ.RoutingInfo.UE_Address, v_IMS_DATA_REQ.RoutingInfo.NW_Address); + f_IMS_PortsAndSecurityConfig(f_SIP_ContactUrl_GetPort(v_ContactUrl)); /* @sic R5s150268 change 1 sic@ */ + } + f_IMS_A_2_1_Invite_CommonChecks(v_IMS_DATA_REQ, p_Context, p_A3, p_A8, -, p_A11, p_SrvccAlertingSupported); + if (p_Context != A_2_1_A5) { /* @sic R5s140020 change 8.2 sic@ */ + f_IMS_PTC_ImsInfo_DialogInit(dialogRemote, v_InviteRequest.msgHeader); + } else { + if (not isvalue(f_IMS_PTC_ImsInfo_CseqGet(dialogRemote))) { /* @sic R5s140235 sic@ */ + f_IMS_PTC_ImsInfo_CseqSet(dialogRemote, v_InviteRequest.msgHeader.cSeq.seqNumber); + } + } + return v_IMS_DATA_REQ; + } + [v_TimerControl] t_Timer.timeout {} + } + return omit; + } + + /* + * @desc Common function to receive and check INVITE + * @param p_Context (default value: A_2_1_A4) + * @param p_AdditionalOptionTagsForSupported (default value: tsc_OptionTagList_Empty) + * @param p_OtherCalleeUri (default value: omit) + * @param p_A3 (default value: pc_MultimediaTelephonyService) + * @param p_A8 (default value: pc_IMS_Geolocation) + * @param p_A9 (default value: false) + * @param p_A11 (default value: false) + * @param p_SrvccAlertingSupported (default value: pc_IMS_SRVCCAlert) + * @return IMS_DATA_REQ + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_IRAT) + */ + function f_IMS_INVITE_ReceiveRequest(INVITE_A_2_1_Context_Type p_Context := A_2_1_A4, + OptionTag_List p_AdditionalOptionTagsForSupported := tsc_OptionTagList_Empty, + template SipUrl p_OtherCalleeUri := omit, + boolean p_A3 := pc_MultimediaTelephonyService, /* @sic R5s130510 additional change 1: tsc_IMS_MTSI replaced by pc_MultimediaTelephonyService sic@ */ + boolean p_A8 := pc_IMS_Geolocation, + boolean p_A9 := false, + boolean p_A11 := false, + boolean p_SrvccAlertingSupported := pc_IMS_SRVCCAlert) + runs on IMS_PTC return IMS_DATA_REQ + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5s140370 change 7: pc_IMS_SRVCCAlert default value for p_A12, p_A12 renamed to p_SrvccAlertingSupported sic@ */ + /* @sic R5s150180: p_A10 removed sic@ */ + /* @sic R5s150204: p_OtherCalleeUri charstring -> SipUrl sic@ */ + var template (omit) float v_WaitDuration := omit; // no wait duration + var template (omit) IMS_DATA_REQ v_IMS_DATA_REQ; + v_IMS_DATA_REQ := f_IMS_INVITE_ReceiveRequest_Common(p_Context, -, p_AdditionalOptionTagsForSupported, p_OtherCalleeUri, v_WaitDuration, p_A3, p_A8, p_A9, p_A11, p_SrvccAlertingSupported); + return valueof(v_IMS_DATA_REQ); // as we don't have any WaitDuration f_IMS_INVITE_ReceiveRequest_Common returns a value (omit could only occur when a timer expires) + } + + /* + * @desc MT Call release acc. to 34.229-1 C.33 + * @param p_InviteRequest + * @param p_ContactSipUrl + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_CallReleaseMT(template (value) INVITE_Request p_InviteRequest, + SipUrl p_ContactSipUrl) runs on IMS_PTC + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + var template (value) MessageHeader v_MessageHeader_Bye; + var InternetProtocol_Type v_Protocol := f_IMS_PTC_ImsInfo_GetTransportProtocol(); + + // The SS sends BYE to release the call + v_MessageHeader_Bye := f_IMS_ByeRequest_MessageHeaderTX(p_InviteRequest); + IMS_Client.send(cas_IMS_BYE_Request(cs_IMS_RoutingInfo(v_Protocol), cs_BYE_Request(p_ContactSipUrl, v_MessageHeader_Bye))); + + // The UE sends 200 OK for the BYE request and ends the call. + f_IMS_ReceiveResponse(v_MessageHeader_Bye, v_Protocol, cr_Response(c_statusLine200, f_IMS_OtherResponse_200_MessageHeaderRX(v_MessageHeader_Bye))); /* @sic R5s140350 sic@ */ + + f_IMS_PTC_ImsInfo_DialogRelease(); /* there is no dialog anymore; @sic R5s140017 MCC160 implementation sic@ */ + } + + /* + * @desc MO Call release scc. to 34.229-1 C.32 + * @param p_DialogIndex (default value: omit) + * @param p_ContactSipUrl + * @param p_MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) + */ + altstep a_IMS_ReceiveByeSendOK(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit, + template (present) SipUrl p_ContactSipUrl, + template (present) MessageHeader p_MessageHeader) runs on IMS_PTC + { + var IMS_DATA_REQ v_IMS_DATA_REQ; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo; + + // --- Receive BYE + [] IMS_Server.receive(car_IMS_Bye_Request(cr_BYE_Request(p_ContactSipUrl, p_MessageHeader))) -> value v_IMS_DATA_REQ + { + if (f_IMS_PTC_ImsInfo_DialogIsReleased(p_DialogIndex)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Dialog has already been released"); + } + f_IMS_MessageHeader_Request_CheckVia(v_IMS_DATA_REQ.Request.Bye.msgHeader, v_IMS_DATA_REQ.RoutingInfo.Protocol); /* @sic R5-134116: additional check of Via header sic@ */ + + // --- Send 200 OK + v_RoutingInfo := f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo); + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo, cs_Response(c_statusLine200, f_IMS_OtherResponse_200_MessageHeaderTX(v_IMS_DATA_REQ.Request.Bye.msgHeader)))); + + f_IMS_PTC_ImsInfo_DialogRelease(p_DialogIndex); /* there is no dialog anymore; @sic R5s140017 MCC160 implementation sic@ */ + } + } + + /* + * @desc MO Call release scc. to 34.229-1 C.32 + * @param p_InviteRequest + * @param p_ContactSipUrl (default value: f_SIP_BuildSipUri_RX(px_IMS_CalleeContactUri)) + * @param p_EmergencyType (default value: NO_EMERGENCY) + * @param p_AutonomousCallRelease (default value: false) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) + */ + function f_IMS_CallReleaseMO(template (value) INVITE_Request p_InviteRequest, + template (present) SipUrl p_ContactSipUrl := f_SIP_BuildSipUri_RX(px_IMS_CalleeContactUri), + IMS_Emergency_Type p_EmergencyType := NO_EMERGENCY, + boolean p_AutonomousCallRelease := false) runs on IMS_PTC + { /* @sic R5s130333 change 6 - new parameter p_ContactUri sic@ */ + /* @sic R5-134116: parameter p_RecordRouteOfPrevResponse removed sic@ */ + /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5s140370 change 14: p_AutonomousCallRelease sic@ */ + /* @sic R5s150692 change 20: parameter p_EmergencyType sic@ */ + var template (present) MessageHeader v_MessageHeader_Bye := f_IMS_ByeRequest_MessageHeaderRX(p_InviteRequest, p_EmergencyType); /* @sic R5s150692 change 20 sic@ */ + + if (not p_AutonomousCallRelease) { + f_UT_HangupIMSCall(MMI); /* @sic R5s130333 change 20, R5-134290 sic@ */ + } + a_IMS_ReceiveByeSendOK(-, p_ContactSipUrl, v_MessageHeader_Bye); /* @sic R5s150382 - Additional Change by MCC160 sic@ */ + } + + /* + * @desc Emergency Call release (wrapper function) + * @param p_InviteRequest + * @param p_AutonomousCallRelease (default value: false) + * @status APPROVED (IMS, IMS_IRAT, LTE) + */ + function f_IMS_EmergencyCallRelease(INVITE_Request p_InviteRequest, + boolean p_AutonomousCallRelease := false) runs on IMS_PTC + { /* @sic R5s141286 change 2: new parameter p_AutonomousCallRelease sic@ */ + f_IMS_CallReleaseMO(p_InviteRequest, -, REGULAR_EMERGENCY, p_AutonomousCallRelease); + f_IMS_TCP_CloseHandling(waitAndClose); /* @sic R5s130988 change 1 - MCC160 implementation sic@ + * @sic R5s140219 - additional changes sic@ + * NOTE: for emergency call there is no user-initiated emergency deregistration (see 24.229 cl. 5.1.6.6); + * nevertheless as working assumption the UE is expected to close its TCP (client) connection and if not it is closed by the IP_PTC; + * this may cause issues when - for what reason ever - the UE wants to re-open the TCP connction ("WAIT TIME" acc. to RFC 793 clause 3.2, figure 6; see R5w140110); + * but even if we would keep the UE's client connection any SS' client connection shall be closed (cuurently we don't distinguish these but close all) */ + } + + //---------------------------------------------------------------------------- + /* + * @desc Emergency speech call setup according to 34.229-1 Annex C.22 + * @param p_Context (default value: A_2_1_A7) + * @param p_GeolocationInfoAvailable (default value: false) + * @param p_OtherCalleeUri (default value: omit) + * @return INVITE_Request + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_IRAT) + */ + function f_IMS_EmergencyCallSetup_AnnexC22(INVITE_A_2_1_Context_Type p_Context := A_2_1_A7, + boolean p_GeolocationInfoAvailable := false, + template SipUrl p_OtherCalleeUri := omit) runs on IMS_PTC return INVITE_Request + { /* p_Context .. A_2_1_A6 (INVITE for creating an emergency session in case of no registration) or + * A_2_1_A7 (INVITE for creating an emergency session within an emergency registration) */ + /* @sic R5s130988 change 6/7: sic@ + * in case of A_2_1_A6 there has been no registration beforehand and therefore we don't know whether the UE uses IPv4 or IPv6 + * => we cannot setup any address information before we have received the INVITE + * => as the SDP message at step 1 contains address information we cannot build up the template in advance but need to match after the INVITE has been received */ + /* @sic R5-140920: additional parameter p_OtherCalleeUri sic@ */ + /* @sic R5s150204: p_OtherCalleeUri charstring -> SipUrl sic@ */ + var IMS_DATA_REQ v_IMS_DATA_REQ; + var template(value) IMS_RoutingInfo_Type v_RoutingInfo_DL; + var template (present) SipUrl v_CalleeContactSipUri; + + var INVITE_Request v_InviteRequest; + var template (value) MessageHeader v_MessageHeader_InviteResponse_200; + var template (present) MessageHeader v_MessageHeader_Ack; + var template (present) SDP_Message v_SDP_Message_Step1; + var template (value) SDP_Message v_SDP_Message_Step4; + var SDP_Message v_SDP_Message; + var IMS_Emergency_Type v_EmergencyType := REGULAR_EMERGENCY; + var boolean v_PrackRequiredFor180Ringing := false; /* => there is no PRACK expected to acknowledge the 180 response */ + var charstring v_FmtAudio; + + // Step 1. Receive INVITE for an Emergency call + v_IMS_DATA_REQ := f_IMS_INVITE_ReceiveRequest(p_Context, -, p_OtherCalleeUri, -, p_GeolocationInfoAvailable); + v_InviteRequest := v_IMS_DATA_REQ.Request.Invite; + v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo); + + v_SDP_Message_Step1 := f_IMS_BuildSDP_AnnexC22_Step1(); /* @sic R5s130988 change 6/7: has to be done after the INVITE has been received and the address information has been initialised even for A_2_1_A6 sic@ */ + v_SDP_Message := f_IMS_MessageBody_CheckSdpMessageAndGeolocation(v_InviteRequest.messageBody, v_SDP_Message_Step1, p_GeolocationInfoAvailable); /* @sic R5w140112 sic@ sic@ */ + + v_FmtAudio := f_SDP_MediaDescr_GetAMR_Any(v_SDP_Message.media_list[0]); /* any AMR codec is acceptable @sic R5-134795 sic@ */ + if (v_FmtAudio == "") { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "no AMR codec found in given media description"); + } + + // Step 2. SS sends a 100 Trying provisional response. + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine100, f_IMS_InviteResponse_100_MessageHeaderTX(v_InviteRequest)))); + + // Step 3. SS sends a 180 Ringing. + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine180, f_IMS_InviteResponse_180_MessageHeaderTX(v_InviteRequest, -, v_PrackRequiredFor180Ringing, v_EmergencyType)))); + + // Step 4. SS responds to the invite INVITE with 200 OK including the SDP record. + v_SDP_Message_Step4 := f_IMS_BuildSDP_AnnexC22_Step4(v_FmtAudio); /* @sic R5s141244: no origin address to be handed over anymore sic@ */ + v_MessageHeader_InviteResponse_200 := f_IMS_OtherResponse_200_MessageHeaderTX(v_InviteRequest.msgHeader, cs_ContentTypeSDP, tsc_IMS_Emergency_TelUri, -, -, v_EmergencyType); + v_CalleeContactSipUri := f_Addr_Union_GetSipUrl(v_MessageHeader_InviteResponse_200.contact.contactBody.contactAddresses[0].addressField); + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine200, v_MessageHeader_InviteResponse_200, cs_MessageBody_SDP(v_SDP_Message_Step4)))); + + // Step 5. Finally, UE acknowledges call setup. + v_MessageHeader_Ack := f_IMS_AckRequest_MessageHeaderRX(v_InviteRequest, c_statusLine200, v_EmergencyType); // @sic R5s130897 change 2 sic@ + IMS_Server.receive(car_IMS_Ack_Request(cr_ACK_Request(v_CalleeContactSipUri, v_MessageHeader_Ack))); + return v_InviteRequest; + } + + //============================================================================ + // Common MT call setup (used for C.11, C.26 and in test cases) + //---------------------------------------------------------------------------- + /* + * @desc MT speech/video call setup according to 34.229-1 Annex C.11, C.26, steps 3 to 4. + * return SessionInProgress183 received in step 4 + * @param p_InviteRequestStep1 + * @param p_SDP_MessageStep4 + * @param p_Protocol + * @param p_AllowTrying (default value: true) + * @return IMS_ResponseWithSdp_Type + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_MTCallSetup_Common_Steps3_4(template (value) INVITE_Request p_InviteRequestStep1, + template (present) SDP_Message p_SDP_MessageStep4, + InternetProtocol_Type p_Protocol, + boolean p_AllowTrying := true) runs on IMS_PTC return IMS_ResponseWithSdp_Type + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5w140112: returns IMS_ResponseWithSdp_Type instead of IMS_Response_Type sic@ */ + var IMS_DATA_RSP v_IMS_DATA_RSP; + var boolean v_AllowTrying := p_AllowTrying; + var MessageHeader v_MessageHeader; + var SDP_Message v_SDP_Message; + var IMS_Response_Type v_SessionInProgress183; + + alt { + // Step 3 - Receive optional 100 Trying + [v_AllowTrying] a_IMS_ReceiveResponse(p_InviteRequestStep1.msgHeader, + p_Protocol, + cr_Response(c_statusLine100, f_IMS_InviteResponse_100_MessageHeaderRX(p_InviteRequestStep1)), + v_IMS_DATA_RSP) /* @sic R5s140350: v_IMS_DATA_RSP is 'out' parameter sic@ */ + { + v_AllowTrying := false; + repeat; + } + // Step 4 - Receive 183 Session in Progress + [] a_IMS_ReceiveResponse(p_InviteRequestStep1.msgHeader, + p_Protocol, + cr_Response(c_statusLine183, + f_IMS_InviteResponse_183_MessageHeaderRX(p_InviteRequestStep1, tsc_OptionTagList_precondition), + cr_MessageBody_SDP), + v_IMS_DATA_RSP) /* @sic R5s140350: v_IMS_DATA_RSP is 'out' parameter sic@ */ + { + v_SessionInProgress183 := v_IMS_DATA_RSP.Response; + v_MessageHeader := v_SessionInProgress183.msgHeader; + f_IMS_MessageHeader_Response_CheckRecordRoute(v_MessageHeader); /* @sic R5s150039 Change 4 sic@ */ + f_IMS_MessageHeader_CheckContactAddr(v_MessageHeader); // check whether contact contains "SIP URI with IP address or FQDN" (see @sic R5s120727 sic@) + f_IMS_Dialog_SetRemoteTag(v_MessageHeader); + // check SDP message: + v_SDP_Message := f_IMS_SIP_SdpMessageBody_DecodeMatchAndCheckSDP(v_SessionInProgress183.messageBody, p_SDP_MessageStep4); // @sic R5w140112 sic@ + } + } + + // fl_IMS_Params_CheckSigComp(v_IMS_DATA_RSP.Response.msgHeader.route.routeBody[0].rrParam); // acc. to 34.229-1 cl. 13.3.4 step 3 "comp=sigcomp" is mandatory for first route parameter of Record-Route only; this is checked in f_IMS_InviteResponse_183_MessageHeaderTX + + return valueof(cs_IMS_ResponseWithSdp(v_SessionInProgress183, v_SDP_Message)); + } + + /* + * @desc Common function to send PRACK and receive the corresponding 200 OK (mainly to be used for MT call setup + * @param p_InviteRequest + * @param p_MessageHeader_PrevReliableResponse + * @param p_OtherResponseForInvite (default value: omit) + * @param p_ContentType (default value: omit) + * @return template (omit) IMS_Response_Type + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_MTCallSetup_SendPRACK_ReceiveOK(template (value) INVITE_Request p_InviteRequest, + MessageHeader p_MessageHeader_PrevReliableResponse, + template IMS_Response_Type p_OtherResponseForInvite := omit, + template (omit) ContentType p_ContentType := omit) runs on IMS_PTC return template (omit) IMS_Response_Type + { /* @sic R5-142994: allow optionally e.g. a 180 Ringing in parallel to the 200 OK sic@ */ + var IMS_DATA_RSP v_IMS_DATA_RSP_ByRef; + var template (value) MessageHeader v_MessageHeader_Prack; + var InternetProtocol_Type v_Protocol := f_IMS_PTC_ImsInfo_GetTransportProtocol(); + var SipUrl v_ContactUrl := f_IMS_PTC_ImsInfo_GetContactUrl(); + var boolean v_AllowOtherResponse := ispresent(p_OtherResponseForInvite); + var template (omit) IMS_Response_Type v_OtherResponse := omit; + + // Send PRACK + v_MessageHeader_Prack := f_IMS_PrackRequest_MessageHeaderTX(p_InviteRequest, p_MessageHeader_PrevReliableResponse, p_ContentType); + IMS_Client.send(cas_IMS_Prack_Request(cs_IMS_RoutingInfo(v_Protocol), cs_PRACK_Request(v_ContactUrl, v_MessageHeader_Prack))); + + // Receive 200 OK + alt { /* @sic R5s140551 sic@ */ + [] a_IMS_ReceiveResponse(v_MessageHeader_Prack, + v_Protocol, + cr_Response(c_statusLine200, f_IMS_OtherResponse_200_MessageHeaderRX(v_MessageHeader_Prack)), + v_IMS_DATA_RSP_ByRef) + {} /* @sic R5s140350 sic@ */ + [v_AllowOtherResponse] a_IMS_ReceiveResponse(p_InviteRequest.msgHeader, + v_Protocol, + p_OtherResponseForInvite, // NOTE: compiler warning cannot be avoided here + v_IMS_DATA_RSP_ByRef) + { + v_AllowOtherResponse := false; + v_OtherResponse := v_IMS_DATA_RSP_ByRef.Response; + repeat; + } + } + return v_OtherResponse; + } + + /* + * @desc MT speech/video call setup according to 34.229-1 Annex C.11, C.26, steps 7 to 11: send UPDATE, receive 200 OK and optional 180 Ringing + * @param p_InviteRequest + * @param p_SDP_MessageStep7 + * @param p_SDP_MessageStep8 + * @param p_ProtocolUsedForInvite + * @param p_SrvccAlerting (default value: false) + * @param p_WaitDuration_Ringing (default value: 5.0) + * @return template (omit) MessageHeader + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_MTCallSetup_Common_Steps7_11(template (value) INVITE_Request p_InviteRequest, + template (value) SDP_Message p_SDP_MessageStep7, + template (present) SDP_Message p_SDP_MessageStep8, + InternetProtocol_Type p_ProtocolUsedForInvite, + boolean p_SrvccAlerting := false, + float p_WaitDuration_Ringing := 5.0) runs on IMS_PTC return template (omit) MessageHeader + { /* @sic R5-140975: p_MessageBodyRinging removed as it is never used i.e. always omit sic@ */ + /* @sic R5s140385 change 8: new parameter p_SrvccAlerting sic@ */ + var IMS_DATA_RSP v_IMS_DATA_RSP; + var template (value) MessageHeader v_MessageHeader_Update; + var MessageHeader v_MessageHeader_Ringing; + var InternetProtocol_Type v_ProtocolForUpdate := f_IMS_PTC_ImsInfo_GetTransportProtocol(); + var SipUrl v_ContactUrl := f_IMS_PTC_ImsInfo_GetContactUrl(); + var boolean v_WaitingFor180 := true; + var boolean v_WaitingFor200 := true; + var template ContentType v_ContentTypeRinging := omit; /* @sic R5-140975 sic@ */ + var template (present) ContentLength v_ContentLengthRinging := cr_ContentLength(0); /* @sic R5-140975 sic@ */ + var template MessageBody v_MessageBodyRinging := omit; /* @sic R5-140975 sic@ */ + var SemicolonParam_List v_ContactParams := {}; + + timer t_Timer := p_WaitDuration_Ringing; + + // Send UPDATE + v_MessageHeader_Update := f_IMS_UpdateRequest_MessageHeaderTX(p_InviteRequest); + IMS_Client.send(cas_IMS_Update_Request(cs_IMS_RoutingInfo(v_ProtocolForUpdate), cs_UPDATE_Request(v_ContactUrl, v_MessageHeader_Update, cs_MessageBody_SDP(p_SDP_MessageStep7)))); + + t_Timer.start; // @sic R5-125772 sic@ Have introduced the timer to accommodate optional messages that may not arrive + while (v_WaitingFor180 or v_WaitingFor200) { + alt { + // Step 8. Receive 200 OK. The UE acknowledges the UPDATE with 200 OK and includes SDP answer to acknowledge its current precondition status. + [v_WaitingFor200] a_IMS_ReceiveResponse(v_MessageHeader_Update, + v_ProtocolForUpdate, + cr_Response(c_statusLine200, + f_IMS_OtherResponse_200_MessageHeaderRX(v_MessageHeader_Update, cr_ContentTypeSDP), /* @sic R5s130685 change 4 sic@ */ + cr_MessageBody_SDP), + v_IMS_DATA_RSP) /* @sic R5s140350: v_IMS_DATA_RSP is 'out' parameter sic@ */ + { + // check at least one connections field sent + f_IMS_SIP_SdpMessageBody_DecodeMatchAndCheckSDP(v_IMS_DATA_RSP.Response.messageBody, p_SDP_MessageStep8); // @sic R5w140112 sic@ + v_WaitingFor200 := false; + } + [v_WaitingFor180] a_IMS_ReceiveResponse(p_InviteRequest.msgHeader, + p_ProtocolUsedForInvite, + cr_Response(c_statusLine180, + f_IMS_InviteResponse_180_MessageHeaderRX(p_InviteRequest, -, v_ContentTypeRinging, v_ContentLengthRinging), + v_MessageBodyRinging), + v_IMS_DATA_RSP) /* @sic R5s140350: v_IMS_DATA_RSP is 'out' parameter sic@ */ + { + t_Timer.stop; + v_MessageHeader_Ringing := v_IMS_DATA_RSP.Response.msgHeader; + v_WaitingFor180 := false; + } + [] t_Timer.timeout + { + v_WaitingFor180 := false; + } + } + } + if (isbound(v_MessageHeader_Ringing)) { + f_IMS_MessageHeader_Response_CheckRecordRoute (v_MessageHeader_Ringing); /* @sic R5s150039 Change 5 sic@ */ + f_IMS_MessageHeader_CheckContactAddr(v_MessageHeader_Ringing); // check whether contact contains "SIP URI with IP address or FQDN" (see @sic R5s120727 sic@) + + if (p_SrvccAlerting) { /* @sic R5s140385 change 8 sic@ */ + v_ContactParams := v_MessageHeader_Ringing.contact.contactBody.contactAddresses[0].contactParams; + + if (not match(v_ContactParams, cr_SemicolonParam_List_OneSpecificParamNoValue(tsc_IMS_FeatureCap_SrvccAlerting))) { /* @sic R5s140385 change 8 sic@ */ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "A.2.6 condition A5: Missing feature-param"); + } + } + if (f_MessageHeader_CheckRequire(v_MessageHeader_Ringing, c_tag100rel)) { + // Step 10 - 11. Send PRACK, Receive 200 OK if the 180 response contains 100rel option tag within the Require header + f_IMS_MTCallSetup_SendPRACK_ReceiveOK(p_InviteRequest, v_MessageHeader_Ringing); + } + + return v_MessageHeader_Ringing; + } + return omit; + } + + /* + * @desc MT speech/video call setup according to 34.229-1 Annex C.11, C.26, steps 12..13 + * @param p_InviteRequestWithSdp + * @param p_SDP_Message (default value: omit) + * @return IMS_ResponseWithSdp_Type + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_MTCallSetup_Common_Steps12_13(IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + template SDP_Message p_SDP_Message := omit) runs on IMS_PTC return IMS_ResponseWithSdp_Type + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5w140112: p_InviteRequestWithSdp instead of p_InviteRequest sic@ */ + /* @sic R5w140112: returns IMS_ResponseWithSdp_Type instead of Response sic@ */ + var InternetProtocol_Type v_ProtocolUsedForInvite := p_InviteRequestWithSdp.RoutingInfo.Protocol; + var IMS_DATA_RSP v_IMS_DATA_RSP; + var Response v_Response; + var MessageHeader v_MessageHeader; + var MessageHeader v_MessageHeader_Invite; + var template (present) MessageHeader v_MessageHeader_OtherResponse_200; + var template (value) MessageHeader v_MessageHeader_Ack; + var template ContentType v_ContentType := omit; + var template MessageBody v_MessageBody := omit; + var SipUrl v_ContactUrl := f_IMS_PTC_ImsInfo_GetContactUrl(); + var template (omit) SDP_Message v_SDP_Message := omit; + + if (ispresent(p_SDP_Message)) { + v_ContentType := cr_ContentTypeSDP; + v_MessageBody := cr_MessageBody_SDP; + } + + // Step 12. Receive 200 OK. The UE responds to INVITE with a 200 OK final response after the user answers the call. + v_MessageHeader_Invite := p_InviteRequestWithSdp.Invite.msgHeader; + v_MessageHeader_OtherResponse_200 := f_IMS_OtherResponse_200_MessageHeaderRX(v_MessageHeader_Invite, v_ContentType); + v_IMS_DATA_RSP := f_IMS_ReceiveResponse(v_MessageHeader_Invite, v_ProtocolUsedForInvite, cr_Response(c_statusLine200, v_MessageHeader_OtherResponse_200, v_MessageBody)); /* @sic R5s140350 sic@ */ + v_Response := v_IMS_DATA_RSP.Response; + v_MessageHeader := v_Response.msgHeader; + f_IMS_MessageHeader_CheckContactAddr(v_MessageHeader); /* check whether contact contains "SIP URI with IP address or FQDN" (see @sic R5s120727 sic@) */ + v_SDP_Message := f_IMS_SIP_SdpMessageBody_DecodeMatchAndCheckSDP_Ifpresent(v_Response.messageBody, p_SDP_Message); + + if (isvalue(f_IMS_PTC_ImsInfo_DialogGetRemoteTag())) { /* normal case: there has been e.g. a 183 response already + @sic R5s140017 MCC160 implementation: use remote tag sic@ */ + f_IMS_MessageHeader_CheckTo(v_MessageHeader, dialogToTag); + } else { /* special case (e.g. 16.X test cases): 200 OK is the only response */ + f_IMS_Dialog_SetRemoteTag(v_MessageHeader); /* @sic R5s140017 MCC160 implementation: use remote tag sic@ */ + } + + // Step 13. Send ACK. The SS acknowledges the receipt of 200 OK for INVITE. + v_MessageHeader_Ack := f_IMS_AckRequest_MessageHeaderTX(p_InviteRequestWithSdp.Invite); + IMS_Client.send(cas_IMS_Ack_Request(cs_IMS_RoutingInfo(v_ProtocolUsedForInvite), cs_ACK_Request(v_ContactUrl, v_MessageHeader_Ack))); + + return valueof(cs_IMS_ResponseWithSdp(v_Response, v_SDP_Message)); + } + + //============================================================================ + // MT speech call setup according to 34.229-1 Annex C.11 + //---------------------------------------------------------------------------- + /* + * @desc Build INVITE to be used for MO call estblishment (C.11) + * @param p_IsC45 (default value: false) + * @return IMS_InviteRequestWithSdp_Type + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_MTCallSetup_AnnexC11_INVITE(boolean p_IsC45:= false) runs on IMS_PTC return IMS_InviteRequestWithSdp_Type + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5w140112: return IMS_InviteRequestWithSdp_Type instead of IMS_DATA_REQ; initialisation of routing info sic@ */ + /* @sic R5-153798: p_IsC45 sic@ */ + var SipUrl v_ContactUrl := f_IMS_PTC_ImsInfo_GetContactUrl(); + var template (value) INVITE_Request v_InviteRequest; + var template (value) MessageHeader v_MessageHeader_Invite; + var template (value) SDP_Message v_SDP_MessageStep1; + + v_SDP_MessageStep1 := f_IMS_BuildSDP_AnnexC11_Step1or7(-, p_IsC45); + v_MessageHeader_Invite := f_IMS_InviteRequest_MessageHeaderTX(tsc_OptionTagList_precondition); + v_InviteRequest := cs_INVITE_Request(v_ContactUrl, v_MessageHeader_Invite, cs_MessageBody_SDP(v_SDP_MessageStep1)); + + return f_IMS_InviteRequestWithSdpMT(v_InviteRequest, v_SDP_MessageStep1); + } + + /* + * @desc MT speech call setup according to 34.229-1 Annex C.11, steps 1 to 4. + * return p_SessionInProgress183 received in step 4 + * @param p_InviteRequestWithSdp + * @param p_IsC45 (default value: false) + * @return IMS_ResponseWithSdp_Type + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_MTCallSetup_AnnexC11_Steps1_4(IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + boolean p_IsC45:= false) runs on IMS_PTC return IMS_ResponseWithSdp_Type + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5w140112: p_InviteRequestWithSdp instead of p_InviteRequest sic@ */ + /* @sic R5w140112: returns IMS_ResponseWithSdp_Type instead of IMS_Response_Type sic@ */ + var template (present) SDP_Message v_SDP_MessageStep4; + var INVITE_Request v_InviteRequest := p_InviteRequestWithSdp.Invite; + var InternetProtocol_Type v_Protocol := p_InviteRequestWithSdp.RoutingInfo.Protocol; + + // Step 1 - Send INVITE + IMS_Client.send(cas_IMS_Invite_Request(p_InviteRequestWithSdp.RoutingInfo, v_InviteRequest)); + + // Step 2 - Void + + // Step 3 .. 4 + v_SDP_MessageStep4 := f_IMS_BuildSDP_AnnexC11_Step4or8("step 4", p_IsC45); + return f_IMS_MTCallSetup_Common_Steps3_4(v_InviteRequest, v_SDP_MessageStep4, v_Protocol); + } + + //---------------------------------------------------------------------------- + /* + * @desc MT speech call setup according to 34.229-1 Annex C.11, steps 7..11 + * @param p_InviteRequestWithSdp + * @param p_SessionInProgress183 + * @param p_IsC45 (default value: false) + * @return template (omit) MessageHeader + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_MTCallSetup_AnnexC11_Steps7_11(IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + IMS_ResponseWithSdp_Type p_SessionInProgress183, + boolean p_IsC45:= false) runs on IMS_PTC return template (omit) MessageHeader + { /* @sic R5w140112: p_InviteRequestWithSdp instead of p_InviteRequest sic@ */ + /* @sic R5-153798: new parameter p_SessionInProgress183, p_IsC45 sic@ */ + var template (value) INVITE_Request v_InviteRequest := p_InviteRequestWithSdp.Invite; + var InternetProtocol_Type v_ProtocolUsedForInvite := p_InviteRequestWithSdp.RoutingInfo.Protocol; + var SDP_Message v_SDP_Message183 := p_SessionInProgress183.SdpMessage; + var template (value) SDP_Message v_Tx_SDP; + var template (present) SDP_Message v_Rx_SDP; + + // Step 7 - 8. Send UPDATE, Receive 200 OK + v_Tx_SDP := f_IMS_BuildSDP_AnnexC11_Step1or7(v_SDP_Message183, p_IsC45); /* @sic R5-153798 sic@*/ + v_Rx_SDP := f_IMS_BuildSDP_AnnexC11_Step4or8("step 8", p_IsC45); // @sic R5s120530 change 3.16 sic@ @sic R5-153798 sic@ + return f_IMS_MTCallSetup_Common_Steps7_11(v_InviteRequest, v_Tx_SDP, v_Rx_SDP, v_ProtocolUsedForInvite, pc_IMS_SRVCCAlert); + } + + /* + * @desc MT speech call setup according to 34.229-1 Annex C.11, steps 5 to 13 + * @param p_InviteRequestWithSdp + * @param p_SessionInProgress183 + * @param p_IsC45 (default value: false) + * @status APPROVED (IMS, LTE_IRAT) + */ + function f_IMS_MTCallSetup_AnnexC11_Steps5_13(IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + IMS_ResponseWithSdp_Type p_SessionInProgress183, + boolean p_IsC45 := false ) runs on IMS_PTC + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5w140112: p_InviteRequestWithSdp instead of p_InviteRequest sic@ */ + /* @sic R5-153798: p_SessionInProgress183 changed to IMS_ResponseWithSdp_Type sic@ */ + /* @sic R5-153798: p_IsC45 sic@ */ + var MessageHeader v_MessageHeader_PrevReliableResponse := p_SessionInProgress183.Response.msgHeader; + + // Step 5 - 6. Send PRACK, Receive 200 OK + f_IMS_MTCallSetup_SendPRACK_ReceiveOK(p_InviteRequestWithSdp.Invite, v_MessageHeader_PrevReliableResponse); + + // Step 7 - 11. Send UPDATE, Receive 200 OK, Receive optional 180 Ringing and send PRACK if requested + f_IMS_MTCallSetup_AnnexC11_Steps7_11(p_InviteRequestWithSdp, p_SessionInProgress183, p_IsC45); /* @sic R5-153798 sic@ */ + + // Step 11A - Make UE accept the speech AMR offer + f_UT_AnswerCall(MMI); // @sic R5-134290 sic@ + + // Step 12. Receive 200 OK, Send ACK + f_IMS_MTCallSetup_Common_Steps12_13(p_InviteRequestWithSdp); + } + + //============================================================================ + /* + * @desc 34.229-1 Annex C.21 - Step 2: receive INVITE acc. to A.2.1; + * if the INVITE is optional a wait duration shall be given + * @param p_SDP_Message_Step2 + * @param p_OtherCalleeUri (default value: omit) + * @param p_A_2_1_Context (default value: A_2_1_A4) + * @param p_WaitDuration (default value: omit) + * @param p_GeolocationInfoAvailable (default value: false) + * @param p_IsC44 (default value: false) + * @return template (omit) IMS_InviteRequestWithSdp_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) + */ + function f_IMS_MOCallSetup_AnnexC21_Step2_Optional(template (present) SDP_Message p_SDP_Message_Step2, + template SipUrl p_OtherCalleeUri := omit, + INVITE_A_2_1_Context_Type p_A_2_1_Context := A_2_1_A4, + template (omit) float p_WaitDuration := omit, + boolean p_GeolocationInfoAvailable := false, + boolean p_IsC44 := false) runs on IMS_PTC return template (omit) IMS_InviteRequestWithSdp_Type + { /* @sic R5-133276, R5-133301 Cleanup of functions for MO Call Setup sic@ */ + /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5w140112: return type changed to IMS_InviteRequestWithSdp_Type to carry decoded SDP offer */ + /* @sic R5s150204: p_OtherCalleeUri charstring -> SipUrl sic@ */ + /* @sic R5-151968: p_IsC44 sic@ */ + /* @sic R5s150704 - additional changes: parameter p_SDP_Message_Step2 sic@ */ + var template (omit) IMS_DATA_REQ v_IMS_DATA_REQ; + var template (omit) IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp := omit; + var IMS_DATA_REQ v_IMS_DATA_REQ_Value; + var SDP_Message v_SDP_Message; + var INVITE_Request v_InviteRequest; + + // Step 2. Receive INVITE Request + v_IMS_DATA_REQ := f_IMS_INVITE_ReceiveRequest_Common(p_A_2_1_Context, -, tsc_OptionTagList_precondition, p_OtherCalleeUri, p_WaitDuration, -, p_GeolocationInfoAvailable); + if (isvalue(v_IMS_DATA_REQ)) { + v_IMS_DATA_REQ_Value := valueof(v_IMS_DATA_REQ); + v_InviteRequest := v_IMS_DATA_REQ_Value.Request.Invite; + v_SDP_Message := f_IMS_MessageBody_CheckSdpMessageAndGeolocation(v_InviteRequest.messageBody, p_SDP_Message_Step2, p_GeolocationInfoAvailable); + + // check media description: + if (p_IsC44) { + f_IMS_SDP_CheckMediaDescr_EVS_16000_1(v_SDP_Message.media_list[0]); /* @sic R5-151968 sic@ */ + f_IMS_SDP_CheckMediaDescr_AMR_16000_1(v_SDP_Message.media_list[0]); /* @sic R5-151968 sic@ */ + } + f_IMS_SDP_CheckMediaDescr_AMR_8000_1(v_SDP_Message.media_list[0]); + f_IMS_SDP_CheckMediaDescr_DTMF(v_SDP_Message.media_list[0]); + + v_InviteRequestWithSdp := f_IMS_InviteRequestWithSdpMO(v_IMS_DATA_REQ_Value, v_SDP_Message); + } + return v_InviteRequestWithSdp; + } + + /* + * @desc 34.229-1 Annex C.21 and C.44 - Step 2: receive INVITE acc. to A.2.1 + * @param p_OtherCalleeUri (default value: omit) + * @param p_A_2_1_Context (default value: A_2_1_A4) + * @param p_GeolocationInfoAvailable (default value: false) + * @param p_IsC44 (default value: false) + * @return IMS_InviteRequestWithSdp_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) + */ + function f_IMS_MOCallSetup_AnnexC21_Step2_Common(template SipUrl p_OtherCalleeUri := omit, + INVITE_A_2_1_Context_Type p_A_2_1_Context := A_2_1_A4, + boolean p_GeolocationInfoAvailable := false, + boolean p_IsC44 := false) runs on IMS_PTC return IMS_InviteRequestWithSdp_Type + { /* @sic R5-133276, R5-133301 Cleanup of functions for MO Call Setup sic@ */ + /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5w140112: return type changed to IMS_InviteRequestWithSdp_Type to carry decoded SDP offer */ + /* @sic R5s150204: p_OtherCalleeUri charstring -> SipUrl sic@ */ + /* @sic R5-151968: p_IsC44 sic@ */ + var template (omit) float v_WaitDuration := omit; + var template (omit) IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var template (present) SDP_Message v_SDP_Message_Step2 := f_IMS_BuildSDP_AnnexC21_Step2(); /* @sic R5s150704 - additional changes sic@ */ + v_InviteRequestWithSdp := f_IMS_MOCallSetup_AnnexC21_Step2_Optional(v_SDP_Message_Step2, p_OtherCalleeUri, p_A_2_1_Context, v_WaitDuration, p_GeolocationInfoAvailable, p_IsC44); + return valueof(v_InviteRequestWithSdp); + } + + /* + * @desc 34.229-1 Annex C.21 C.44 - Step 2: Wrapper function for A.2.1 condition A4 (INVITE creating a dialog) + * @param p_OtherCalleeUri (default value: omit) + * @param p_GeolocationInfoAvailable (default value: false) + * @param p_IsC44 (default value: false) + * @return IMS_InviteRequestWithSdp_Type + * @status APPROVED (IMS, LTE, LTE_A) + */ + function f_IMS_MOCallSetup_AnnexC21_Step2_A4(template SipUrl p_OtherCalleeUri := omit, + boolean p_GeolocationInfoAvailable := false, + boolean p_IsC44 := false) runs on IMS_PTC return IMS_InviteRequestWithSdp_Type + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5w140112: return type changed to IMS_InviteRequestWithSdp_Type to carry decoded SDP offer */ + /* @sic R5s150204: p_OtherCalleeUri charstring -> SipUrl sic@ */ + /* @sic R5-151968: p_IsC44 sic@ */ + return f_IMS_MOCallSetup_AnnexC21_Step2_Common(p_OtherCalleeUri, A_2_1_A4, p_GeolocationInfoAvailable, p_IsC44); + } + + /* + * @desc 34.229-1 Annex C.21 - Step 3: send 100 Trying + * @param p_InviteRequestWithSdp + * @status APPROVED (IMS, LTE, LTE_A) + */ + function f_IMS_MOCallSetup_AnnexC21_Step3(IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp) runs on IMS_PTC + { + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(p_InviteRequestWithSdp.RoutingInfo); + + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine100, f_IMS_InviteResponse_100_MessageHeaderTX(p_InviteRequestWithSdp.Invite)))); + } + + /* + * @desc 34.229-1 Annex C.21 - Step 3: send 183 Session In Progress + * return MessageHeader of the 183 response + * @param p_InviteRequestWithSdp + * @param p_ContactUri (default value: px_IMS_CalleeContactUri) + * @param p_AditionalContactParams (default value: omit) + * @param p_EmergencyType (default value: NO_EMERGENCY) + * @param p_IsC44 (default value: false) + * @param p_CodecName (default value: "AMR-8000") + * @return MessageHeader + * @status APPROVED (IMS, LTE, LTE_A) + */ + function f_IMS_MOCallSetup_AnnexC21_Step4(IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + charstring p_ContactUri := px_IMS_CalleeContactUri, + template (omit) SemicolonParam_List p_AditionalContactParams := omit, + IMS_Emergency_Type p_EmergencyType := NO_EMERGENCY, + boolean p_IsC44 := false, + charstring p_CodecName := "AMR-8000") runs on IMS_PTC return MessageHeader + { /* @sic R5-142951: tsc_OptionTagList_precondition to be added to the Require header instead of the Supported header sic@ */ + /* @sic R5-151968 new parameter: p_IsC44 sic@ */ + /* @sic R5s150692 change 13: parameter p_EmergencyType sic@ */ + /* @sic R5-153950 parameter p_CodecName sic@ */ + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(p_InviteRequestWithSdp.RoutingInfo); + var INVITE_Request v_InviteRequest := p_InviteRequestWithSdp.Invite; + var SDP_Message v_SDP_MessageInvite := p_InviteRequestWithSdp.SdpOffer; /* @sic R5w140112 sic@ */ + var template (value) MessageHeader v_MessageHeader_Response183; + var template (value) SDP_Message v_SDP_MessageTx := f_IMS_BuildSDP_AnnexC21_Step4(v_SDP_MessageInvite, p_IsC44, p_CodecName); /* @sic R5-135020 sic@ */ + // Step 4. Send 183 Session In Progress. + v_MessageHeader_Response183 := f_IMS_InviteResponse_183_MessageHeaderTX(v_InviteRequest, tsc_OptionTagList_precondition, p_ContactUri, p_AditionalContactParams, p_EmergencyType); /* @sic R5-142951 sic@ @sic R5s150692 change 13 sic@*/ + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine183, v_MessageHeader_Response183, cs_MessageBody_SDP(v_SDP_MessageTx)))); + + return valueof(v_MessageHeader_Response183); + } + + /* + * @desc 34.229-1 Annex C.21 and C.44 - Step 3..4 + * return MessageHeader of the 183 response + * @param p_InviteRequestWithSdp + * @param p_ContactUri (default value: px_IMS_CalleeContactUri) + * @param p_AditionalContactParams (default value: omit) + * @param p_EmergencyType (default value: NO_EMERGENCY) + * @param p_IsC44 (default value: false) + * @param p_CodecName (default value: "AMR-8000") + * @return MessageHeader + * @status APPROVED (IMS, LTE, LTE_A) + */ + function f_IMS_MOCallSetup_AnnexC21_Step3_4(IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + charstring p_ContactUri := px_IMS_CalleeContactUri, + template (omit) SemicolonParam_List p_AditionalContactParams := omit, + IMS_Emergency_Type p_EmergencyType := NO_EMERGENCY, + boolean p_IsC44 := false, + charstring p_CodecName := "AMR-8000") runs on IMS_PTC return MessageHeader + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5w140112: p_InviteRequestWithSdp instead of p_RoutingInfo_DL, p_InviteRequest sic@ */ + /* @sic R5s140359 - Additional Changes: split (f_IMS_MOCallSetup_AnnexC21_Step3, f_IMS_MOCallSetup_AnnexC21_Step4) sic@ */ + /* @sic R5-151968: p_IsC44 sic@ */ + /* @sic R5s150692 change 12: parameter p_EmergencyType sic@ */ + /* @sic R5s153535, R5-153950 parameter p_CodecName sic@ */ + var MessageHeader v_MessageHeader_Response183; + + // Step 3. SS sends a 100 Trying provisional response. + f_IMS_MOCallSetup_AnnexC21_Step3(p_InviteRequestWithSdp); + + // Step 4. Send 183 Session In Progress. + v_MessageHeader_Response183 := f_IMS_MOCallSetup_AnnexC21_Step4(p_InviteRequestWithSdp, p_ContactUri, p_AditionalContactParams, p_EmergencyType, p_IsC44, p_CodecName); /* @sic R5s150692 change 12 sic@ @sic R5s153535, R5-153950 sic@*/ + + return v_MessageHeader_Response183; + } + + /* + * @desc 34.229-1 Annex C.21 - Step 5..8 + * returns the "latest SDP offer" received from the UE + * @param p_InviteRequestWithSdp + * @param p_MessageHeader_Prev183Response + * @param p_GeolocationInfoAvailable (default value: false) + * @param p_SDP_Message_Step5or7 (default value: omit) + * @param p_PrevSDP_Message (default value: omit) + * @param p_EmergencyType (default value: NO_EMERGENCY) + * @param p_IsCAT (default value: false) + * @param p_IsC44 (default value: false) + * @return SDP_Message + * @status APPROVED (IMS, LTE, LTE_A) + */ + function f_IMS_MOCallSetup_AnnexC21C25_Steps5_8(IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + template (value) MessageHeader p_MessageHeader_Prev183Response, + boolean p_GeolocationInfoAvailable := false, + template SDP_Message p_SDP_Message_Step5or7 := omit, + template (omit) SDP_Message p_PrevSDP_Message := omit, + IMS_Emergency_Type p_EmergencyType := NO_EMERGENCY, + boolean p_IsCAT := false, + boolean p_IsC44 := false) runs on IMS_PTC return SDP_Message + { /* p_SDP_Message_Step5or7 .. used in case of video (C.25) */ + /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5w140112: p_InviteRequest changed to p_InviteRequestWithSdp */ + /* @sic R5s140686, R5-144755: parameter p_PrevSDP_Message sic@ */ + /* @sic R5-151953 new parameter: p_IsCAT sic@ */ + /* @sic R5-151968 new parameter: p_IsC44 sic@ */ + /* @sic R5s150692 change 16: parameter p_EmergencyType sic@ */ + var SipUrl v_ContactUrl := f_MessageHeader_GetContactSipUrl(p_MessageHeader_Prev183Response); /* @sic R5s130333 change 8.2 - acc. to A.2.4, A.2.5 same as in previous response sic@ */ + var INVITE_Request v_InviteRequest := p_InviteRequestWithSdp.Invite; + var SDP_Message v_SDP_Message := p_InviteRequestWithSdp.SdpOffer; /* @sic R5w140112 sic@ */ + var template (present) SDP_Message v_SDP_Message_Step5or7; + var template (present) MessageBody v_MessageBody; + var boolean v_MediaConfigured := false; + var IMS_DATA_REQ v_IMS_DATA_REQ; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL; + var template (present) MessageHeader v_MessageHeader_Prack; + var template (present) MessageHeader v_MessageHeader_Update; + var template (omit) MessageBody v_MessageBodyTx := omit; + var template (omit) ContentType v_ContentType := omit; + var PRACK_Request v_PrackRequest; + var UPDATE_Request v_UpdateRequest; + var SDP_Message v_SDP_LatestOffer; + + if (isvalue(p_PrevSDP_Message)) { /* e.g. in case of C.27 the INVITE's SDP message is not the latest SDP sent by the UE */ + v_SDP_Message := valueof(p_PrevSDP_Message); + } + + if (not ispresent(p_SDP_Message_Step5or7)) { + v_SDP_Message_Step5or7 := f_IMS_BuildSDP_AnnexC21_Step5or7(v_SDP_Message, p_IsCAT, p_IsC44); /* => use speech per default */ + } else { + v_SDP_Message_Step5or7 := p_SDP_Message_Step5or7; /* In case of video the SDP message needs to be handed over + NOTE: compiler warning cannot be avoided here */ + } + + // Step 5. Receive PRACK + v_MessageHeader_Prack := f_IMS_PrackRequest_MessageHeaderRX(v_InviteRequest, p_MessageHeader_Prev183Response); + IMS_Server.receive(car_IMS_Prack_Request(cr_PRACK_Request(v_ContactUrl, v_MessageHeader_Prack, cr_MessageBody_SDP ifpresent))) -> value v_IMS_DATA_REQ; + v_PrackRequest := v_IMS_DATA_REQ.Request.Prack; + v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo); + + // fl_IMS_Params_CheckSigComp(v_PrackRequest.msgHeader.route.routeBody[0].rrParam); // acc. to 34.229-1 cl. 13.2.4 step 4 (PRACK) "comp=sigcomp" is optional for Via and Route + + // Step 6. Send 200 OK + if (ispresent(v_PrackRequest.messageBody)) { + v_SDP_LatestOffer := f_IMS_SIP_SdpMessageBody_DecodeMatchAndCheckSDP(v_PrackRequest.messageBody, v_SDP_Message_Step5or7); // @sic R5w140112 sic@ + + // check session version increased @sic R5-150702: done in f_IMS_SIP_DecodeMatchAndCheckSDP sic@ */ + + v_ContentType := cs_ContentTypeSDP; + v_MessageBodyTx := cs_MessageBody_SDP(f_IMS_BuildSDP_AnnexC21C25_Step6or8(v_SDP_LatestOffer)); /* @sic R5w140112 sic@ */ + v_MediaConfigured := true; + } + + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine200, + f_IMS_OtherResponse_200_MessageHeaderTX(v_PrackRequest.msgHeader, v_ContentType, -, -, tsc_OptionTagList_precondition, p_EmergencyType), /* @sic R5s150237 change 2 sic@ @sic R5s150692 change 16 sic@ */ + v_MessageBodyTx))); + + // Step 7 Optional. Receive Update + // Note: UE will send Update if Media is not yet configured + if (not v_MediaConfigured) { + v_MessageHeader_Update := f_IMS_UpdateRequest_MessageHeaderRX(v_InviteRequest, p_EmergencyType); /* @sic R5s150692 change 16 sic@ */ + v_MessageBody := f_SIP_MessageBodySDP_RX(p_GeolocationInfoAvailable); + if (p_GeolocationInfoAvailable) { + v_MessageHeader_Update.geolocation := cr_GeolocationAny; + v_MessageHeader_Update.geolocationRouting := cr_GeolocationRoutingSupported; // @sic R5-134798 sic@ + v_MessageHeader_Update.contentType := cr_ContentType("multipart/mixed"); + } + if (testcasename() == "TC_19_3_1") { // @sic !!!! R5-153760: DIRTY HACK - PROSE CR REQUIRED to correct Content-Type !!!! sic@ + v_MessageHeader_Update.contentType := cr_ContentType("multipart/mixed"); + } + IMS_Server.receive(car_IMS_Update_Request(cr_UPDATE_Request(v_ContactUrl, v_MessageHeader_Update, v_MessageBody))) -> value v_IMS_DATA_REQ; + v_UpdateRequest := v_IMS_DATA_REQ.Request.Update; + v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo); + v_SDP_LatestOffer := f_IMS_MessageBody_CheckSdpMessageAndGeolocation(v_UpdateRequest.messageBody, v_SDP_Message_Step5or7); /* @sic R5w140112 sic@ */ + + //fl_IMS_Params_CheckSigComp(v_UpdateRequest.msgHeader.route.routeBody[0].rrParam); // acc. to 34.229-1 cl. 13.2.4 step 6 (UPDATE) "comp=sigcomp" is optional for Via and Route + + // check session version increased @sic R5-150702: done in f_IMS_SIP_DecodeMatchAndCheckSDP sic@ */ + + v_ContentType := cs_ContentTypeSDP; + v_MessageBodyTx := cs_MessageBody_SDP(f_IMS_BuildSDP_AnnexC21C25_Step6or8(v_SDP_LatestOffer)); /* @sic R5w140112 sic@ */ + + if (testcasename() == "TC_19_3_1") { // @sic !!!! R5-153760: DIRTY HACK - PROSE CR REQUIRED to remove checking of Route_header from UPDATE !!!! sic@ */ + f_IMS_MessageHeader_CheckContactAddr(v_UpdateRequest.msgHeader); // @sic R5-153760: check route header sic@ + } + + // Step 8 Optional. Send 200 OK + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine200, + f_IMS_OtherResponse_200_MessageHeaderTX(v_UpdateRequest.msgHeader, v_ContentType, -, -, tsc_OptionTagList_precondition, p_EmergencyType), /* @sic R5s150237 change 2 sic@ @sic R5s150692 change 16 sic@ */ + v_MessageBodyTx))); + } + + return v_SDP_LatestOffer; + } + + /* + * @desc wrapper function: 34.229-1 Annex C.21 and C.44 - Step 5..8 + * returns the "latest SDP offer" received from the UE + * @param p_InviteRequestWithSdp + * @param p_MessageHeader_Prev183Response + * @param p_GeolocationInfoAvailable (default value: false) + * @param p_PrevSDP_Message (default value: omit) + * @param p_EmergencyType (default value: NO_EMERGENCY) + * @param p_IsCAT (default value: false) + * @param p_IsC44 (default value: false) + * @return SDP_Message + * @status APPROVED (IMS, LTE_A) + */ + function f_IMS_MOCallSetup_AnnexC21_Steps5_8(IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + template (value) MessageHeader p_MessageHeader_Prev183Response, + boolean p_GeolocationInfoAvailable := false, + template (omit) SDP_Message p_PrevSDP_Message := omit, + IMS_Emergency_Type p_EmergencyType := NO_EMERGENCY, + boolean p_IsCAT := false, + boolean p_IsC44 := false) runs on IMS_PTC return SDP_Message + { /* @sic R5-151953 new parameter: p_IsCAT sic@ */ + /* @sic R5-151968: p_IsC44 sic@ */ + /* @sic R5s150692 change 15: parameter p_EmergencyType sic@ */ + return f_IMS_MOCallSetup_AnnexC21C25_Steps5_8(p_InviteRequestWithSdp, p_MessageHeader_Prev183Response, p_GeolocationInfoAvailable, -, p_PrevSDP_Message, p_EmergencyType, p_IsCAT, p_IsC44); /* @sic R5s150692 change 15 sic@ */ + } + + /* + * @desc 34.229-1 Annex C.21 - Step 9..11 + * @param p_InviteRequestWithSdp + * @param p_ContactUri (default value: px_IMS_CalleeContactUri) + * @param p_SrvccAlertingSupported (default value: pc_IMS_SRVCCAlert) + * @param p_EmergencyType (default value: NO_EMERGENCY) + * @status APPROVED (IMS, LTE, LTE_A) + */ + function f_IMS_MOCallSetup_AnnexC21C25_Step9_11(IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + charstring p_ContactUri := px_IMS_CalleeContactUri, + boolean p_SrvccAlertingSupported := pc_IMS_SRVCCAlert, + IMS_Emergency_Type p_EmergencyType := NO_EMERGENCY) runs on IMS_PTC + { // p_SrvccAlertingSupported .. if voice call => condition A6 of A.2.6; needs to be set to false for non-voice calls + /* @sic R5s130333 change 9.2 - parameter p_ContactUri: acc. to see A.2.4 contact in request line of PRACK shall be the same in as in previous response (180 Ringing) sic@ */ + /* @sic R5w140112: p_IMS_INVITE_REQ changed to p_InviteRequestWithSdp */ + /* @sic R5s140370 change 6: new parameter p_SrvccAlertingSupported sic@ */ + /* @sic R5s150692 change 10: parameter p_EmergencyType sic@ */ + var INVITE_Request v_InviteRequest := p_InviteRequestWithSdp.Invite; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(p_InviteRequestWithSdp.RoutingInfo); + var template (value) MessageHeader v_MessageHeader_180Response := f_IMS_InviteResponse_180_MessageHeaderTX(v_InviteRequest, p_ContactUri, -, p_EmergencyType, p_SrvccAlertingSupported); /* @sic R5s150667 change 2 sic@ + @sic R5s150692 change 3, 10 sic@ */ + var template (value) MessageHeader v_MessageHeader_PrackResponse_200; + var template (present) MessageHeader v_MessageHeader_Prack; + var IMS_DATA_REQ v_IMS_DATA_REQ; + var PRACK_Request v_PrackRequest; + + // Step 9. SS sends a 180 Ringing. + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine180, v_MessageHeader_180Response))); + + // Step 10. Receive PRACK + v_MessageHeader_Prack := f_IMS_PrackRequest_MessageHeaderRX(v_InviteRequest, v_MessageHeader_180Response); + IMS_Server.receive(car_IMS_Prack_Request(cr_PRACK_Request(f_SIP_BuildSipUri_RX(p_ContactUri), v_MessageHeader_Prack))) -> value v_IMS_DATA_REQ; + + v_PrackRequest := v_IMS_DATA_REQ.Request.Prack; + v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo); + + //fl_IMS_Params_CheckSigComp(v_PrackRequest.msgHeader.route.routeBody[0].rrParam); // acc. to 34.229-1 cl. 13.2.4 step 9 (PRACK) "comp=sigcomp" is optional for Via and Route + + // Step 11. Send 200 OK (response to last PRACK) + v_MessageHeader_PrackResponse_200 := f_IMS_OtherResponse_200_MessageHeaderTX(v_PrackRequest.msgHeader); + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine200, v_MessageHeader_PrackResponse_200))); + } + + /* + * @desc 34.229-1 Annex C.21 - Step 12..13 + * @param p_InviteRequestWithSdp + * @param p_ContactUri (default value: px_IMS_CalleeContactUri) + * @param p_EmergencyType (default value: NO_EMERGENCY) + * @status APPROVED (IMS, LTE, LTE_A) + */ + function f_IMS_MOCallSetup_AnnexC21C25_Step12_13(IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + charstring p_ContactUri := px_IMS_CalleeContactUri, + IMS_Emergency_Type p_EmergencyType := NO_EMERGENCY) runs on IMS_PTC + { /* @sic R5s130333 change 9.3 - parameter p_ContactUri: acc. to A.2.7 contact in request line of ACK shall be the same in as PRACK sic@ */ + /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5w140112: p_IMS_INVITE_REQ changed to p_InviteRequestWithSdp */ + /* @sic R5s150692 change 21: parameter p_EmergencyType sic@ */ + var INVITE_Request v_InviteRequest := p_InviteRequestWithSdp.Invite; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(p_InviteRequestWithSdp.RoutingInfo); + var template (value) MessageHeader v_MessageHeader_InviteResponse_200; + var template (present) MessageHeader v_MessageHeader_Ack; + var template (omit) charstring v_EmergencyTelURI := omit; /* @sic R5s150739 sic@ */ + + if(p_EmergencyType == ASSERTED_EMERGENCY) { /* @sic R5s150739 sic@ */ + v_EmergencyTelURI := tsc_IMS_Emergency_TelUri; + } + + // Step 12. Send 200 OK (response to INVITE) + v_MessageHeader_InviteResponse_200 := f_IMS_OtherResponse_200_MessageHeaderTX(v_InviteRequest.msgHeader, -, v_EmergencyTelURI, p_ContactUri, -, p_EmergencyType); /* @sic R5s150692 change 21 sic@ @sic R5s150739 sic@ */ + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine200, v_MessageHeader_InviteResponse_200))); + + // Step 13. Finally, UE acknowledges call setup. + v_MessageHeader_Ack := f_IMS_AckRequest_MessageHeaderRX(v_InviteRequest, c_statusLine200, p_EmergencyType); /* @sic R5s150692 change 21 sic@ */ + IMS_Server.receive(car_IMS_Ack_Request(cr_ACK_Request(f_SIP_BuildSipUri_RX(p_ContactUri), v_MessageHeader_Ack))); + + //fl_IMS_Params_CheckSigComp(v_IMS_DATA_REQ.Request.Ack.msgHeader.route.routeBody[0].rrParam); // acc. to 34.229-1 cl. 13.2.4 step 12 (ACK) "comp=sigcomp" is optional for Route + } + + /* + * @desc wrapper for steps 5..13 of C.21 and C.44; + * returns the "latest SDP offer" received from the UE + * @param p_InviteRequestWithSdp + * @param p_MessageHeader_Prev183Response + * @param p_ContactUri (default value: px_IMS_CalleeContactUri) + * @param p_GeolocationInfoAvailable (default value: false) + * @param p_EmergencyType (default value: NO_EMERGENCY) + * @param p_IsC44 (default value: false) + * @return SDP_Message + * @status APPROVED (IMS) + */ + function f_IMS_MOCallSetup_AnnexC21_Steps5_13(IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + MessageHeader p_MessageHeader_Prev183Response, + charstring p_ContactUri := px_IMS_CalleeContactUri, + boolean p_GeolocationInfoAvailable := false, + IMS_Emergency_Type p_EmergencyType := NO_EMERGENCY, + boolean p_IsC44 := false) runs on IMS_PTC return SDP_Message + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5w140112: p_IMS_INVITE_REQ changed to p_InviteRequestWithSdp */ + /* @sic R5-151968: p_IsC44 sic@ */ + /* @sic R5s150692 change 9: parameter p_EmergencyType sic@ */ + var SDP_Message v_SDP_Message := f_IMS_MOCallSetup_AnnexC21_Steps5_8(p_InviteRequestWithSdp, p_MessageHeader_Prev183Response, p_GeolocationInfoAvailable, -, p_EmergencyType, p_IsC44); //@sic R5s141155 change 3 sic@ + + f_IMS_MOCallSetup_AnnexC21C25_Step9_11(p_InviteRequestWithSdp, p_ContactUri, -, p_EmergencyType); /* @sic R5s150692 ch. 2 sic@ @sic R5s150692 change 9 sic@ */ + f_IMS_MOCallSetup_AnnexC21C25_Step12_13(p_InviteRequestWithSdp, p_ContactUri, p_EmergencyType); /* @sic R5s150692 change 9 sic@ */ + return v_SDP_Message; + } + + //============================================================================ + +/* group HandlingOfPublishMessage { */ + +/* function f_IMS_PublishRequest_MessageHeaderRX(template (present) SipUrl p_SipUrlPublicUserId, */ +/* boolean p_SessionIdSupported := false) runs on IMS_PTC return template (present) MessageHeader */ +/* { /\* PUBLISH (see TS 34.229, A.4.3) *\/ */ +/* /\* !!!! NOTE: Checks may need to be enhanced !!!!*\/ */ +/* var template (present) MessageHeader v_MessageHeader_Publish := cr_MessageHeader_Dummy; */ + +/* v_MessageHeader_Publish.route := cr_RouteSubs(f_IMS_PTC_Pcscf_Get(), *, px_IMS_Scscf); */ +/* v_MessageHeader_Publish.via := cr_ViaDef(-, cr_HostPort(?)); */ +/* v_MessageHeader_Publish.toField := cr_ToDef(p_SipUrlPublicUserId); // NOTE: absence of the To tag needs to be checked separately */ +/* v_MessageHeader_Publish.fromField := cr_FromWithTag(p_SipUrlPublicUserId); */ +/* v_MessageHeader_Publish.cSeq := cr_CseqDef(?, "PUBLISH"); */ +/* v_MessageHeader_Publish.callId := cr_CallId(?); */ +/* v_MessageHeader_Publish.sessionId := f_IMS_SessionId_RX_IfSupported(p_SessionIdSupported); /\* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ *\/ */ +/* v_MessageHeader_Publish.maxForwards := cr_MaxForwardsDef; */ +/* v_MessageHeader_Publish.event := cr_EventDef(?); */ +/* if (not f_IMS_PTC_SecurityScheme_IsGiba()) { */ +/* v_MessageHeader_Publish.securityVerify := f_IMS_PTC_BuildSecurityVerifyHeader(); */ +/* v_MessageHeader_Publish.pAccessNetworkInfo := cr_PAccessNetworkInfoDef(f_IMS_PTC_RanType_GetString()); */ +/* } */ +/* return v_MessageHeader_Publish; */ +/* } */ + +/* function f_IMS_PublishResponse_200_MessageHeaderTX(PUBLISH_Request p_PublishRequest) runs on IMS_PTC return template (value) MessageHeader */ +/* { // 200 OK for PUBLISH (see TS 34.229, A.4.4) */ +/* var MessageHeader v_MessageHeader_Publish := p_PublishRequest.msgHeader; */ +/* var template (value) MessageHeader v_MessageHeader_Response := cs_MessageHeader_Dummy; */ + +/* v_MessageHeader_Response.via := v_MessageHeader_Publish.via; */ +/* v_MessageHeader_Response.fromField := v_MessageHeader_Publish.fromField; */ +/* v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderTX(v_MessageHeader_Publish); */ +/* v_MessageHeader_Response.callId := v_MessageHeader_Publish.callId; */ +/* v_MessageHeader_Response.sessionId := v_MessageHeader_Publish.sessionId; /\* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ *\/ */ +/* v_MessageHeader_Response.cSeq := v_MessageHeader_Publish.cSeq; */ +/* v_MessageHeader_Response.contact := cs_Contact(cs_SipUri_HostPort(px_IMS_Scscf)); */ +/* v_MessageHeader_Response.expires := cs_Expires ("600000"); */ +/* v_MessageHeader_Response.sipETag := cs_SIP_ETag("dx200xyz"); /\* @sic R5s130195 BASELINE MOVING 2013 - SIP-ETag (RFC 3903) sic@ *\/ */ + +/* return v_MessageHeader_Response; */ +/* } */ + +/* // FFS: Code not yet used, but may be needed */ +/* altstep a_IMS_DefaultPublish() runs on IMS_PTC */ +/* { /\* acc. to 34.229-1 C.5 Default handling of PUBLISH requests *\/ */ +/* var IMS_DATA_REQ v_IMS_DATA_REQ; */ +/* var template (present) SipUrl v_SipUrlPublicUserId := ?; /\* acc. to A.4.3 in the PUBLISH request the public user id to be used in the Request-Line, From and To is "any IMPU within the set of IMPUs" */ +/* => needs to be checked after receiving as well as the tag for From and To */ +/* !!!! check function needs to be implemented !!!! *\/ */ + +/* [] IMS_Server.receive(car_IMS_Publish_Request(cr_PUBLISH_Request(v_SipUrlPublicUserId, f_IMS_PublishRequest_MessageHeaderRX(v_SipUrlPublicUserId)))) */ +/* -> value v_IMS_DATA_REQ */ +/* { */ +/* IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo), */ +/* cs_Response(c_statusLine200, f_IMS_PublishResponse_200_MessageHeaderTX(v_IMS_DATA_REQ.Request.Publish)))); */ +/* } */ +/* } */ + +/* } // group */ +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_Procedures_CallHold.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_Procedures_CallHold.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..31f129c6dd02116ca0fc4d232875f4d43cafe8c2 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_Procedures_CallHold.ttcn @@ -0,0 +1,380 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-11 10:39:38 +0200 (Fri, 11 Sep 2015) $ +// $Rev: 14283 $ +/******************************************************************************/ + +module IMS_Procedures_CallHold { + + import from LibSip_SDPTypes all; + import from LibSip_SIPTypesAndValues all; + import from LibSip_MessageBodyTypes all; + + import from IMS_Component all; + import from IMS_CommonDefs all; + import from IMS_SDP_Templates all; + import from IMS_SDP_Messages all; + import from IMS_SDP_MessagesVideo all; + import from IMS_MessageBody_Templates all; + import from IMS_SIP_Templates all; + import from IMS_ASP_TypeDefs all; + import from IMS_ASP_Templates all; + import from IMS_CommonFunctions all; + + import from IMS_Procedures_CallControl all; + import from IMS_Procedures_Common all; + import from IMS_CommonParameters all; + + //============================================================================ + // Annex C8 - SDP Messages + //---------------------------------------------------------------------------- + /* + * @desc Acc. to 34.229-1 C.8 the UE shall use the same SDP body as for step 5 of C.21 or C.25 except from + * - direction-tag for the current-status remote segment shall be "sendrecv" (handled in f_IMS_BuildSDP_AnnexC21_Step5or7/f_IMS_BuildSDP_MOCallAudioVideo_Step5or7) + * - specific bandwith values in case of pc_SendRTCPOnlyOnHold==true: + * this is checked by f_IMS_CallHoldResume_AnnexC8_CheckBandwidth after the message has been received + * (=> no changes needed compared to step 5 of C.21 or C.25) + * - specific direction attribute (either on session level or on media description level) + * this is checked by fl_IMS_MOCallHoldResume_AnnexC8_CheckSendRecvMode after the message has been received + * (=> no changes needed compared to step 5 of C.21 or C.25) + * @param p_SDP_Message_PrevOffer + * @return template (present) SDP_Message + * @status APPROVED (IMS) + */ + function f_IMS_BuildSDP_AnnexC8_Step1(SDP_Message p_SDP_Message_PrevOffer) runs on IMS_PTC return template (present) SDP_Message + { /* @sic R5-145726: use of f_IMS_BuildSDP_AnnexC21_Step5or7, f_IMS_BuildSDP_MOCallAudioVideo_Step5or7 sic@ */ + var template (present) SDP_Message v_SDP_Message; + var boolean v_CallHoldC8 := true; + + if (lengthof(p_SDP_Message_PrevOffer.media_list) == 1) { // => audio only + v_SDP_Message := f_IMS_BuildSDP_AnnexC21_Step5or7(p_SDP_Message_PrevOffer, v_CallHoldC8); + } else { + v_SDP_Message := f_IMS_BuildSDP_MOCallAudioVideo_Step5or7(CallHold, p_SDP_Message_PrevOffer); + } + return v_SDP_Message; + } + + /* + * @desc build up SDP message for step 3 of C.8 + * @param p_HoldResume + * @param p_SDP_Message_PrevOffer + * @return template (value) SDP_Message + * @status APPROVED (IMS) + */ + function f_IMS_BuildSDP_AnnexC8_Step3(IMS_CallHoldResume_Type p_HoldResume, + SDP_Message p_SDP_Message_PrevOffer) runs on IMS_PTC return template (value) SDP_Message + { + var template (value) SDP_Message v_SDP_Message := f_IMS_BuildSDP_CommonResponseToOfferTX(p_SDP_Message_PrevOffer); + + if (p_HoldResume == HOLD) { + // invert "sendonly" to "recvonly" in the session attributes (if the UE uses session attribute to hold the call) + v_SDP_Message.attributes := f_SDP_ExchangeAttribute(v_SDP_Message.attributes, cr_SDP_Attribute_sendonly, cs_SDP_Attribute_recvonly); // change session attributes + v_SDP_Message.media_list := f_IMS_SDP_MediaList_ExchangeAttribute(v_SDP_Message.media_list, cr_SDP_Attribute_sendonly, cs_SDP_Attribute_recvonly); // change media lines + } + return v_SDP_Message; + } + + //---------------------------------------------------------------------------- + /* + * @desc Check recv mode for call hold/resume acc. to C.8 + * @param p_HoldResume + * @param p_HoldResumeOffer + * @param p_OriginalOffer + * @status APPROVED (IMS) + */ + function fl_IMS_MOCallHoldResume_AnnexC8_CheckSendRecvMode(IMS_CallHoldResume_Type p_HoldResume, + SDP_Message p_HoldResumeOffer, + SDP_Message p_OriginalOffer) runs on IMS_PTC + { + var SDP_attribute_list v_HoldResumeOffer_AttributeList; + var SDP_attribute_list v_OriginalOffer_AttributeList; + var template (omit) SDP_attribute v_SendRecvAttribute; + var SDP_attribute v_SendRecvAttributeVal; + var integer i; + + v_SendRecvAttribute := f_SDP_AttributeList_GetAttribute(p_HoldResumeOffer.attributes, cr_SDP_Attribute_AnySendRecvMode); // session attribute + if (ispresent(v_SendRecvAttribute)) { + // Hold/Resume offer has session attribute for send/recv mode + v_SendRecvAttributeVal := valueof(v_SendRecvAttribute); + select (p_HoldResume) { + case (HOLD) { + if (match(v_SendRecvAttributeVal, cs_SDP_Attribute_inactive)) { // => check all media streams of the original offer to be recvonly + if (not f_SDP_CheckMediaListAttributes(p_OriginalOffer.media_list, cs_SDP_Attribute_recvonly)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "SDP offer for call hold has session attribute 'inactive' and but not all media streams of the original offer have been 'recvonly' "); + return; + } + } else if (match(v_SendRecvAttributeVal, cs_SDP_Attribute_sendonly)) { // => check all media streams of the original offer to be sendrecv + if (not f_SDP_CheckMediaListAttributes(p_OriginalOffer.media_list, cs_SDP_Attribute_sendrecv)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "SDP offer for call hold has session attribute 'sendonly' and but not all media streams of the original offer have been 'sendrecv' "); + return; + } + } else { // send/recv mode is neither inactive nor sendonly + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "SDP offer for call hold has session attribute being neither 'sendonly' not 'inactive'"); + return; + } + } + case (RESUME) { // all media streams of the original offer shall be the same and the same as in the "RESUME offer" + if (not f_SDP_CheckMediaListAttributes(p_OriginalOffer.media_list, v_SendRecvAttributeVal)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "SDP offer for call resume has session attribute not matching with all media streams of the original offer"); + return; + } + } + } + // check that Hold/Resume offer does not have further send/recv mode attributes in any media stream + if (f_SDP_CheckMediaListAttributes(p_HoldResumeOffer.media_list, cr_SDP_Attribute_AnySendRecvMode)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "SDP offer for call hold/resume has session attribute for send/recv mode but also send/recv mode attributes for media streams"); + return; + } + } else { + // Hold/Resume offer has no session attribute for send/recv mode => check stream by stream + if (lengthof(p_HoldResumeOffer.media_list) != lengthof(p_OriginalOffer.media_list)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "SDP offer for call hold/resume has different number of media streams than the original offer"); + return; + } + for (i := 0; i < lengthof(p_HoldResumeOffer.media_list); i:=i+1) { + v_HoldResumeOffer_AttributeList := p_HoldResumeOffer.media_list[i].attributes; + v_OriginalOffer_AttributeList := p_OriginalOffer.media_list[i].attributes; + select (p_HoldResume) { + case (HOLD) { + if (f_SDP_AttributeList_CheckAttribute(v_HoldResumeOffer_AttributeList, cs_SDP_Attribute_inactive)) { + v_SendRecvAttribute := cs_SDP_Attribute_recvonly; + } + else if (f_SDP_AttributeList_CheckAttribute(v_HoldResumeOffer_AttributeList, cs_SDP_Attribute_sendonly)) { + v_SendRecvAttribute := cs_SDP_Attribute_sendrecv; + } + } + case (RESUME) { + v_SendRecvAttribute := f_SDP_AttributeList_GetAttribute(v_HoldResumeOffer_AttributeList, cr_SDP_Attribute_AnySendRecvMode); + } + } + if (not ispresent(v_SendRecvAttribute) or not f_SDP_AttributeList_CheckAttribute(v_OriginalOffer_AttributeList, v_SendRecvAttribute)) { // compiler warning cannot be avoided for v_SendRecvAttribute + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "SDP offer for call hold/resume has invalid send/recv mode attribute for single media stream"); + return; + } + } + } + } + + /* + * @desc Check bandwidth for call hold/resume acc. to C.8 + * @param p_HoldResume + * @param p_BandwidthList + * @param p_RtcpDuringHold (default value: pc_SendRTCPOnlyOnHold) + * @status APPROVED (IMS) + */ + function f_IMS_CallHoldResume_AnnexC8_CheckBandwidthList(IMS_CallHoldResume_Type p_HoldResume, + template (omit) SDP_bandwidth_list p_BandwidthList, + boolean p_RtcpDuringHold := pc_SendRTCPOnlyOnHold) runs on IMS_PTC + { /* @sic R5-145730: new parameter p_RtcpDuringHold sic@ */ + var integer i; + var SDP_bandwidth_list v_BandwidthList; + var charstring v_Modifier; + var integer v_Bandwidth; + + if (isvalue(p_BandwidthList)) { + v_BandwidthList := valueof(p_BandwidthList); + for (i := 0; i < lengthof(v_BandwidthList); i := i+1) { + v_Modifier := v_BandwidthList[i].modifier; + v_Bandwidth := v_BandwidthList[i].bandwidth; + select (p_HoldResume) { + case (HOLD) { + select (v_Modifier) { + case ("RR") { /* @sic R5-145730: bandwith shall be changed for RR only sic@ */ + if (p_RtcpDuringHold and not (v_Bandwidth > 0)) { /* @sic R5-145730: p_RtcpDuringHold sic@ */ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Call hold: " & v_Modifier & " bandwidth shall be greater than zero"); + return; + } + } + } + } + case (RESUME) { + select (v_Modifier) { + case ("RR", "RS") { + if (p_RtcpDuringHold and (v_Bandwidth != 0)) { /* @sic R5-145730: p_RtcpDuringHold sic@ + @sic R5s150153 change 2 sic@ */ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Call resume: " & v_Modifier & " bandwidth shall be zero"); + return; + } + } + } + } + } + } + } + } + + /* + * @desc Check bandwidth for call hold/resume acc. to C.8 + * @param p_HoldResume + * @param p_SDP_Message + * @status APPROVED (IMS) + */ + function f_IMS_CallHoldResume_AnnexC8_CheckBandwidth(IMS_CallHoldResume_Type p_HoldResume, + SDP_Message p_SDP_Message) runs on IMS_PTC + { /* @sic R5-145730: new local function f_IMS_CallHoldResume_AnnexC8_CheckBandwidthList to check media level bandwidth sic@ */ + var integer i; + + f_IMS_CallHoldResume_AnnexC8_CheckBandwidthList(p_HoldResume, p_SDP_Message.bandwidth); + for (i:=0; i < lengthof(p_SDP_Message.media_list); i:=i+1) { + f_IMS_CallHoldResume_AnnexC8_CheckBandwidthList(p_HoldResume, p_SDP_Message.media_list[i].bandwidth); + } + } + + /* + * @desc MO call hold according to Annex C.8 (TS 34.229-1) + * @param p_HoldResume + * @param p_PrevInviteRequest + * @param p_MessageHeader_Prev183Response + * @param p_SDP_OriginalOffer + * @param p_ContactUri (default value: px_IMS_CalleeContactUri) + * @return SDP_Message + * @status APPROVED (IMS) + */ + function f_IMS_MOCallHoldResume_AnnexC8(IMS_CallHoldResume_Type p_HoldResume, + INVITE_Request p_PrevInviteRequest, + MessageHeader p_MessageHeader_Prev183Response, + SDP_Message p_SDP_OriginalOffer, + charstring p_ContactUri := px_IMS_CalleeContactUri) runs on IMS_PTC return SDP_Message + { /* @sic R5-150702: p_PrevSessionVersion removed; session version now is checked in generic way in f_IMS_SIP_DecodeMatchAndCheckSDP sic@ */ + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL; + var template (present) MessageHeader v_MessageHeader_Invite; + var template (present) MessageHeader v_MessageHeader_Update; + var template (present) MessageHeader v_MessageHeader_Ack; + var template (value) SDP_Message v_SDP_HoldResumeResponse; + var MessageBody v_MessageBody; + var IMS_DATA_REQ v_IMS_DATA_REQ; + var INVITE_Request v_InviteRequest; + var UPDATE_Request v_UpdateRequest; + var MessageHeader v_MessageHeader; + var SDP_Message v_SDP_HoldResumeOffer; + var SipUrl v_RequestSipUrl := f_MessageHeader_GetContactSipUrl(p_MessageHeader_Prev183Response); // get the contact URI out of the Contact header being sent to the UE in the earlier 183 response + var SipUrl v_ToHeaderSipUrl := f_Addr_Union_GetSipUrl(p_PrevInviteRequest.msgHeader.toField.addressField); // SIP URI in the To header of the INVITE needs to be the same SIP URI as been used in the previous INVITE + var integer v_CseqValue := f_IMS_PTC_ImsInfo_CseqGetValue(dialogRemote); /* @sic R5s140121 change 7: CSeq Value is incremented in f_IMS_InviteRequest_MessageHeaderRX and in f_IMS_UpdateRequest_MessageHeaderRX but shall be the same for both sic@ */ + + // Steps 1 and 2 - Receive Invite Request or Update Request + v_MessageHeader_Invite := f_IMS_InviteRequest_MessageHeaderRX(-, v_ToHeaderSipUrl, -, A_2_1_A5); + f_IMS_PTC_ImsInfo_CseqSet(dialogRemote, v_CseqValue); /* @sic R5s140121 change 7: restore CSeq Value sic@ */ + v_MessageHeader_Update := f_IMS_UpdateRequest_MessageHeaderRX(p_PrevInviteRequest); + + alt { + // INVITE + [] IMS_Server.receive(car_IMS_Invite_Request(cr_INVITE_Request(v_RequestSipUrl, v_MessageHeader_Invite, cr_MessageBody_SDP))) + -> value v_IMS_DATA_REQ + { + v_InviteRequest := v_IMS_DATA_REQ.Request.Invite; + v_MessageHeader := v_InviteRequest.msgHeader; + v_MessageBody := v_InviteRequest.messageBody; + + f_IMS_A_2_1_Invite_CommonChecks(v_IMS_DATA_REQ, A_2_1_A5); + } + // UPDATE + [] IMS_Server.receive(car_IMS_Update_Request(cr_UPDATE_Request(v_RequestSipUrl, v_MessageHeader_Update, cr_MessageBody_SDP))) + -> value v_IMS_DATA_REQ + { + v_UpdateRequest := v_IMS_DATA_REQ.Request.Update; + v_MessageHeader := v_UpdateRequest.msgHeader; + v_MessageBody := v_UpdateRequest.messageBody; + } + } + f_IMS_PreliminaryPass(__FILE__, __LINE__, "Annex C.8 step 1"); + + v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo); + v_SDP_HoldResumeOffer := f_IMS_MessageBody_CheckSdpMessageAndGeolocation(v_MessageBody, f_IMS_BuildSDP_AnnexC8_Step1(p_SDP_OriginalOffer)); /* @sic R5s140324 - additional change 2 sic@ */ + + /* @sic R5-150702: session version is checked in generic way in f_IMS_SIP_DecodeMatchAndCheckSDP sic@ */ + + // Check bandwidth + f_IMS_CallHoldResume_AnnexC8_CheckBandwidth(p_HoldResume, v_SDP_HoldResumeOffer); + + // Check send/receive mode + fl_IMS_MOCallHoldResume_AnnexC8_CheckSendRecvMode(p_HoldResume, v_SDP_HoldResumeOffer, p_SDP_OriginalOffer); + + if (isbound(v_InviteRequest)) { + // Step 2. Send 100 Trying + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine100, f_IMS_InviteResponse_100_MessageHeaderTX(v_InviteRequest)))); + } + + // Step 3. Respond with 200 OK (A.3.1 condition A5: Any response sent by the UE within a dialog + v_SDP_HoldResumeResponse := f_IMS_BuildSDP_AnnexC8_Step3(p_HoldResume, v_SDP_HoldResumeOffer); + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine200, + f_IMS_OtherResponse_200_MessageHeaderTX(v_MessageHeader, + cs_ContentTypeSDP, + -, + p_ContactUri, + tsc_OptionTagList_precondition), /* @sic R5s150274: tsc_OptionTagList_precondition sic@ */ + cs_MessageBody_SDP(v_SDP_HoldResumeResponse)))); + if (isbound(v_InviteRequest)) { + // Step 4. Receive ACK + v_MessageHeader_Ack := f_IMS_AckRequest_MessageHeaderRX(v_InviteRequest, c_statusLine200); + IMS_Server.receive(car_IMS_Ack_Request(cr_ACK_Request(v_RequestSipUrl, v_MessageHeader_Ack))); + } + + return v_SDP_HoldResumeOffer; + } + + function f_IMS_ReferRequest_MessageHeaderTX(boolean p_ReferCreatingDialog := true, + charstring p_CallerSipAddrStr, + charstring p_ConferenceURI, + template (omit) charstring p_ReferredByURI := omit, + boolean p_SessionIdSupported := pc_IMS_SessionIdSupported, + integer p_CSeqValue := 1234) runs on IMS_PTC return template (value) MessageHeader + { /* REFER acc. to see TS 34.229, A.2.12 - MT REFER: + p_CallerSipAddrStr .. Address of the remote UE + p_ConferenceURI .. URI of the conference focus as defined in RFC 4353 */ + /* @sic R5s150086 - p_SessionIdSupported: pc_IMS_SessionIdSupported per default sic@ */ + /* Prose issues (-> A.2.12): + * - acc to prose there shall be P-Access-Network-Info (does not make sense for MT) + * - Via is not exactly the same as for INVITE (A.2.9) but there seems to be no reason for any difference + */ + var template (value) MessageHeader v_MessageHeader_Refer := cs_MessageHeader_Dummy; + var template (value) SipUrl v_PublicUserId_SipUrl := f_IMS_PTC_ImsInfo_GetSipUriTX(defaultId); // as for INVITE + var template (omit) SessionId v_SessionId := omit; + var charstring v_CallIdString; + var template (value) From v_From; + var template (value) To v_To; + var template (value) CallId v_CallId; + var integer v_CSeqValue; + + if (p_ReferCreatingDialog) { + v_CSeqValue := p_CSeqValue; + v_From := cs_From(f_SIP_BuildSipUri_TX(p_CallerSipAddrStr), f_IMS_GenerateTag("REFER", "From")); + v_To := cs_ToDef(v_PublicUserId_SipUrl); + v_CallIdString := f_IMS_PTC_GenerateCallId("REFER"); + v_CallId := cs_CallId(v_CallIdString); + if (p_SessionIdSupported) { + v_SessionId := cs_SessionId(f_IMS_SessionId_TX_Generate(v_CallIdString)); + } + } else { /* no dialog is active => there has been no previous INVITE (e.g. test case 15.21) + => REFER creates dialog between the remote UE (p_CallerSipAddrStr) and the UE (addressed with default IMPU) - see RFC 3515 clause 2 */ + // !!!! this branch needs to be checked !!!! + v_CSeqValue := f_IMS_PTC_ImsInfo_CseqIncr(dialogLocal); + v_To := f_IMS_RequestInDialog_ToHeaderTX(); + v_From := f_IMS_RequestInDialog_FromHeaderTX(); + v_CallId := f_IMS_PTC_ImsInfo_DialogGetCallId(); + v_SessionId := f_IMS_PTC_ImsInfo_DialogGetSessionId(); + } + + v_MessageHeader_Refer.via := f_IMS_InviteRequest_ViaTX(); // same as for INVITE + v_MessageHeader_Refer.fromField := v_From; + v_MessageHeader_Refer.toField := v_To; + v_MessageHeader_Refer.callId := v_CallId; + v_MessageHeader_Refer.sessionId := v_SessionId; + v_MessageHeader_Refer.cSeq := cs_CseqDef(v_CSeqValue, "REFER"); + v_MessageHeader_Refer.contact := cs_Contact(f_SIP_BuildSipUri_TX(p_CallerSipAddrStr, tsc_IMS_CallerPort)); /* same as for INVITE: this is the address to which the UE shall send the notifications */ + v_MessageHeader_Refer.referTo := cs_ReferTo(f_SIP_BuildSipUri_TX(p_ConferenceURI)); /* NOTE: acc. to 24.147 cl. 5.3.1.5.2 when inviting another user there shall be a "method=INVITE" + * or the "method parameter shall be omitted => we don't need to include the "method" parameter */ + v_MessageHeader_Refer.maxForwards := cs_MaxForwardsDef; + + if (ispresent(p_ReferredByURI)) { + v_MessageHeader_Refer.referredBy := cs_ReferredBy(f_SIP_BuildSipUri_TX(valueof(p_ReferredByURI))); /* NOTE: acc. to 24.147 cl. 5.3.1.5.2 this shall be the "URI of the conference participant that is sending the REFER request" + * => it might not be necessary to use a different URI than as for the From header */ + } + return v_MessageHeader_Refer; + } + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_Procedures_Common.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_Procedures_Common.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fabc23667a8fc0338b14ba3a27404fc1999dc649 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_Procedures_Common.ttcn @@ -0,0 +1,668 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-15 21:39:48 +0200 (Tue, 15 Sep 2015) $ +// $Rev: 14432 $ +/******************************************************************************/ + +module IMS_Procedures_Common { + import from CommonDefs all; + import from CommonIP all; + import from IMS_Component all; + import from IMS_ASP_TypeDefs all; + import from IMS_ASP_Templates all; + import from IP_ASP_TypeDefs all; + import from IMS_IP_Config all; + import from IMS_CommonDefs all; + import from IMS_CommonFunctions all; + import from IMS_CommonParameters all; + import from IMS_CommonTemplates all; + import from IMS_SIP_Templates all; + import from LibSip_Common all; + import from LibSip_SIPTypesAndValues all; + + type enumerated IMS_TCP_CloseHandling_Type { justWait, waitAndClose, dontWait }; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + @sic R5s140801: dontWait sic@ */ + + /* + * @desc common function to handle closing down TCP connections used for SIP signalling + * @param p_Handling + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_TCP_CloseHandling(IMS_TCP_CloseHandling_Type p_Handling) runs on IMS_PTC + { + f_Delay(tsc_IMS_WaitForTcpClose); + + select (p_Handling) { + case (waitAndClose) { + f_IMS_CloseTCP(); + } + case else { + // do nothing + } + } + } + + //---------------------------------------------------------------------------- + /* + * @desc Release of IMS registration and security plus resetting of IMS information + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_GlobalRelease() runs on IMS_PTC + { + f_IMS_RegisterInfo_Release(); /* release registration information at IPCAN */ + f_IMS_PTC_Reset(); /* reset ImsInfo and release security + @sic R5s150031: common function f_IMS_PTC_Reset sic@ */ + } + + //---------------------------------------------------------------------------- + /* + * @desc check whether public user id matches with any public user id in the given list + * @param p_PublicUserIdentityList + * @param p_SipUrl + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PublicUserId_Match(CharStringList_Type p_PublicUserIdentityList, + SipUrl p_SipUrl) return boolean + { + var integer i; + + for (i:=0; i < lengthof(p_PublicUserIdentityList); i:=i+1) { + if (f_SIP_MatchURI(p_PublicUserIdentityList[i], p_SipUrl)) { + return true; + } + } + return false; + } + + //---------------------------------------------------------------------------- + /* + * @desc return server port of the network side depending on whether it is protected or not + * @return integer + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_GetPort_ps() runs on IMS_PTC return integer + { /* @sic R5s130756 additional changes: p_IsProtected removed (f_IMS_PTC_Security_IsStarted used instead) sic@ */ + var IMS_ProtectedPorts_Type v_Protected; + var integer v_Port_ps := tsc_IMS_PortNumber_5060; + + if (f_IMS_PTC_Security_IsStarted()) { + v_Protected := f_IMS_PTC_Security_GetProtectedPorts(); + v_Port_ps := v_Protected.Port_ps; // @sic R5s120907 change 2 sic@ + } + return v_Port_ps; + } + + /* + * @desc return server port of the UE side depending on whether it is protected or not + * @return integer + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_GetPort_us() runs on IMS_PTC return integer + { + var IMS_ProtectedPorts_Type v_Protected; + var integer v_Port_us := tsc_IMS_PortNumber_5060; + + if (f_IMS_PTC_Security_IsStarted()) { + v_Protected := f_IMS_PTC_Security_GetProtectedPorts(); + v_Port_us := v_Protected.Port_us; + } + return v_Port_us; + } + + //---------------------------------------------------------------------------- + /* + * @desc Usage of tags is described in RFC 3261 clause 19.3: + * when there has been a to-tag in a request the same to-tag is used in the corresponding response; + * when there is no to-tag a new to-tag and the response is for a dialog the stored to-tag is used + * when there still no to-tag a new to-tag is generated for the reponse + * @param p_RequestMessageHeader + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_Response_ToTagTX(template (value) MessageHeader p_RequestMessageHeader) runs on IMS_PTC return charstring + { /* @sic R5-131897, R5-132063 - new generic function sic@ */ + /* @sic R5s140017 MCC160 implementation: f_IMS_PTC_ImsInfo_DialogGetToTag, f_IMS_PTC_ImsInfo_DialogSetToTag replaced by f_IMS_PTC_ImsInfo_DialogGetLocalTag, f_IMS_PTC_ImsInfo_DialogSetLocalTag sic@ */ + var template (omit) charstring v_ToTag := f_MessageHeader_GetToTag(p_RequestMessageHeader); + var charstring v_Method; + + if (not isvalue(v_ToTag)) { + v_Method := valueof(p_RequestMessageHeader.cSeq.method); + if (v_Method == "INVITE") { /* @sic R5s130497 change 1 - MCC160 implementation sic@ */ + // => response belongs to a dialog + v_ToTag := f_IMS_PTC_ImsInfo_DialogGetLocalTag(); // check if there is already a tag generated for this dialog (essential e.g. in case of call-forwarding when the tag changes; see testcase 15.8) + if (not isvalue(v_ToTag)) { + v_ToTag := f_IMS_GenerateTag(v_Method); + f_IMS_PTC_ImsInfo_DialogSetLocalTag(valueof(v_ToTag)); + } + } else { + v_ToTag := f_IMS_GenerateTag(v_Method); + } + } + return valueof(v_ToTag); + } + + //---------------------------------------------------------------------------- + /* + * @desc Generate To header to be used in a response: in general the To header consists of the address and the to-tag + * @param p_RequestMessageHeader + * @param p_ToTag (default value: omit) + * @return template (value) To + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_Response_ToHeaderTX(template (value) MessageHeader p_RequestMessageHeader, + template (omit) charstring p_ToTag := omit) runs on IMS_PTC return template (value) To + { /* @sic R5-153986: parameter p_ToTag to allow different ToTags for different dialogs created by subscription to even packages sic@ */ + var SipUrl v_SipUrl := f_Addr_Union_GetSipUrl(p_RequestMessageHeader.toField.addressField); + var charstring v_ToTag; + + if (ispresent(p_ToTag)) { + v_ToTag := valueof(p_ToTag); + } else { + v_ToTag := f_IMS_Response_ToTagTX(p_RequestMessageHeader); + } + + return cs_ToWithTag(v_SipUrl, v_ToTag); + } + + /* + * @desc generate template for To header depending on whether the previous request has had a to-tog or not + * @param p_RequestMessageHeader + * @param p_Is100Response (default value: false) + * @return template (present) To + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_Response_ToHeaderRX(template (value) MessageHeader p_RequestMessageHeader, + boolean p_Is100Response := false) return template (present) To + { /* @sic R5s130685 change 1: new parameter p_Is100Response sic@ */ + var template (omit) charstring v_ToTagFromRequest := f_MessageHeader_GetToTag(p_RequestMessageHeader); + var template (value) SipUrl v_SipUrl := f_Addr_Union_GetSipUrl(p_RequestMessageHeader.toField.addressField); // @sic R5s130453 change 1 sic@ + var template (present) To v_To; + + if (ispresent(v_ToTagFromRequest)) { + v_To := cr_ToWithTag(v_SipUrl, valueof(v_ToTagFromRequest)); /* @sic R5-132063 sic@ */ + } + else if (not p_Is100Response) { + v_To := cr_ToWithTag(v_SipUrl); + } + else { + v_To := cr_ToDef(v_SipUrl); /* @sic R5s130685 change 1 sic@ */ + } + return v_To; + } + + /* + * @desc generate template for From header (the from-tag has to be the same as in the corresponding request) + * @param p_RequestMessageHeader + * @return template (present) From + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_Response_FromHeaderRX(template (value) MessageHeader p_RequestMessageHeader) return template (present) From + { + var charstring v_FromTagFromRequest := f_MessageHeader_GetFromTag(p_RequestMessageHeader); + var template (value) SipUrl v_SipUrl := f_Addr_Union_GetSipUrl(p_RequestMessageHeader.fromField.addressField); + + return cr_FromWithTag(v_SipUrl, v_FromTagFromRequest); + } + + //---------------------------------------------------------------------------- + /* + * @desc Route set acc. A.2.3 and A.3.1 + * @param p_EmergencyType (default value: NO_EMERGENCY) + * @return template (value) RouteBody_List + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_RouteSet_MO_Call_TX(IMS_Emergency_Type p_EmergencyType := NO_EMERGENCY) runs on IMS_PTC return template (value) RouteBody_List + { /* @sic R5s150692 change 5: parameter p_EmergencyType sic@ */ + var template (omit) GenericParam v_SigCompParam := f_IMS_PTC_ImsInfo_GetSigCompParam(); // Compression parameter to be included in the last route parameter (see 34.229-1 cl. 13.2.4) + var template (omit) integer v_Port_ps := omit; + var template (value) RouteBody_List v_RouteBodyList; + + if (f_IMS_PTC_Security_IsStarted()) { // A1 + v_Port_ps := f_IMS_PTC_GetPort_ps(); + } // else: in case of GIBA or emergency call without registration SS server port in unprotected (and therefore left out) + + select (p_EmergencyType) { + case (NO_EMERGENCY) { + v_RouteBodyList := { + cs_RouteBody(f_SIP_BuildSipUri_lr_TX("sip:pcscf.other.com")), + cs_RouteBody(f_SIP_BuildSipUri_lr_TX("sip:scscf.other.com")), + cs_RouteBody(f_SIP_BuildSipUri_lr_TX("sip:orig@" & px_IMS_Scscf)), + f_RouteBodyWithParamsTX(cs_SipUri_HostPort_lr(f_IMS_PTC_Pcscf_Get(), v_Port_ps), v_SigCompParam) + }; + } + case else { /* @sic R5s150692 change 5, R5-153472 sic@ */ + v_RouteBodyList := { + cs_RouteBody(f_SIP_BuildSipUri_lr_TX("sip:orig@" & tsc_IMS_Ecscf)), + f_RouteBodyWithParamsTX(cs_SipUri_HostPort_lr(f_IMS_PTC_Pcscf_Get(), v_Port_ps), v_SigCompParam) + }; + } + } + return v_RouteBodyList; + } + + /* + * @desc Route set acc. A.2.9 + * @return template (value) RouteBody_List + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_RouteSet_MT_Call_TX() runs on IMS_PTC return template (value) RouteBody_List + { + var template (omit) GenericParam v_SigCompParam := f_IMS_PTC_ImsInfo_GetSigCompParam(); // Compression parameter to be included in the last route parameter (see 34.229-1 cl. 13.2.4) + var integer v_Port_ps := f_IMS_PTC_GetPort_ps(); + var template (value) RouteBody_List v_RouteBodyList; + + v_RouteBodyList := { + f_RouteBodyWithParamsTX(cs_SipUri_HostPort_lr(f_IMS_PTC_Pcscf_Get(), v_Port_ps), v_SigCompParam), + cs_RouteBody(f_SIP_BuildSipUri_lr_TX("sip:term@scscf1.3gpp.org")), + cs_RouteBody(f_SIP_BuildSipUri_lr_TX("sip:orig@scscf2.3gpp.org")), + cs_RouteBody(f_SIP_BuildSipUri_lr_TX("sip:pcscf2.3gpp.org")) + }; + + return v_RouteBodyList; + } + + //============================================================================ + // Check functions + //---------------------------------------------------------------------------- + + type enumerated CheckToTag_Type {noToTag, dialogToTag}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + /* + * @desc check the To header e.g. whether it has unexpected tag + * @param p_MessageHeader + * @param p_CheckType + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_MessageHeader_CheckTo(MessageHeader p_MessageHeader, + CheckToTag_Type p_CheckType) runs on IMS_PTC + { + var SemicolonParam_List v_ToParams := {}; + var template (omit) charstring v_ToTagDialog; + var template (omit) charstring v_ToTagReceived; + + if (ispresent(p_MessageHeader.toField.toParams)) { + v_ToParams := p_MessageHeader.toField.toParams; + } + select (p_CheckType) { + case (noToTag) { + if (match(v_ToParams, cr_SemicolonParam_List_WithAnyTag)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Invalid params in 'To'"); + } + } + case (dialogToTag) { + v_ToTagDialog := f_IMS_PTC_ImsInfo_DialogGetRemoteTag(); /* @sic R5s140017 MCC160 implementation: use remote tag sic@ */ + v_ToTagReceived := f_MessageHeader_GetToTag(p_MessageHeader); + if (not ispresent(v_ToTagReceived)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Missing to-tag"); + } + if (ispresent(v_ToTagDialog) and (valueof(v_ToTagDialog) != valueof(v_ToTagReceived))) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Invalid to-tag"); + } + } + } + } + + /* + * @desc Check Via header + * @param p_MessageHeader + * @param p_Protocol + * @param p_AllowFQDN (default value: true) + * @param p_CheckRport (default value: false) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_MessageHeader_Request_CheckVia(MessageHeader p_MessageHeader, + InternetProtocol_Type p_Protocol, + boolean p_AllowFQDN := true, + boolean p_CheckRport := false) runs on IMS_PTC + { /* p_AllowFQDN .. shall be set to false e.g. for condition A6 of A.2.1 */ + var template integer v_Port := *; + var ViaBody v_ViaBody := p_MessageHeader.via.viaBody[0]; + var charstring v_ProtocolString := f_IMS_ConvertTransportProtocolToString(p_Protocol); + + if (not f_IMS_PTC_CheckHostPortForIPAddrOrFQDN(v_ViaBody.sentBy, v_Port, p_AllowFQDN)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Invalid host and/or port in 'via'"); + } + if (f_StringToLower(v_ProtocolString) != f_StringToLower(v_ViaBody.sentProtocol.transport)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Invalid transport protocol in 'via'"); + } + if (p_CheckRport and (p_Protocol != tcp)) { // @sic R5-133358 rport is optional for tcp sic@ + if (not match(v_ViaBody.viaParams, cr_SemicolonParam_List_OneSpecificParamNoValue("rport"))) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "'rport' is missing in 'via'"); + } + } + } + + /* + * @desc Check whether Via header of a response sent by the UE matches Via header sent to the UE in the corresponding request + * (taking into consideration that the format of IP address representation may change) + * @param p_RequestHeader + * @param p_ResponseHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_MessageHeader_Response_CheckVia(MessageHeader p_RequestHeader, + MessageHeader p_ResponseHeader) runs on IMS_PTC + { + var integer v_LengthOfViaBody_Request := lengthof(p_RequestHeader.via.viaBody); + var integer v_LengthOfViaBody_Response := lengthof(p_ResponseHeader.via.viaBody); + var boolean v_Mismatch := false; + var integer i; + + if (v_LengthOfViaBody_Request != v_LengthOfViaBody_Response) { + v_Mismatch := true; + } else { + for (i:=0; i < v_LengthOfViaBody_Request; i:=i+1) { + if (not f_IPAddresses_Compare(p_RequestHeader.via.viaBody[i].sentBy.host, p_ResponseHeader.via.viaBody[i].sentBy.host)) { + v_Mismatch := true; + break; + } + } + } + if (v_Mismatch) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Mismatch in via header"); + } + } + + /* + * @desc check whether the first entry in the route body matches the P-CSCF address + * @param p_RouteBodyList + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_RouteBody_CheckPcscfAddr(RouteBody_List p_RouteBodyList) runs on IMS_PTC + { /* @sic R5s150039: new function to deal with RecordRoute header as well as with Route header sic@ */ + var charstring v_PcscfAddr := p_RouteBodyList[0].nameAddr.addrSpec.components.sip.hostPort.host; + + if (not f_IMS_PTC_Pcscf_CheckAndSet(v_PcscfAddr)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Invalid host in 'route body'"); + } + } + + /* + * @desc Check Route header of a given request sent by the UE: + * The first entry has to correspond to the IP address of the P-CSCF + * => in case of IPv6 the presentation of the address may differ from the address stored at the IMS PTC + * @param p_RequestHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_MessageHeader_Request_CheckRoute(MessageHeader p_RequestHeader) runs on IMS_PTC + { + fl_RouteBody_CheckPcscfAddr(p_RequestHeader.route.routeBody); /* @sic R5s150039: fl_RouteBody_CheckPcscfAddr sic@ */ + } + + /* + * @desc Check RecordRoute header of a given request sent by the UE: + * The first entry has to correspond to the IP address of the P-CSCF + * => in case of IPv6 the presentation of the address may differ from the address stored at the IMS PTC + * @param p_RequestHeader + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_MessageHeader_Response_CheckRecordRoute(MessageHeader p_RequestHeader) runs on IMS_PTC + { + fl_RouteBody_CheckPcscfAddr(p_RequestHeader.recordRoute.routeBody); /* @sic R5s150039: fl_RouteBody_CheckPcscfAddr sic@ */ + } + + /* + * @desc Check Contact header + * @param p_MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_MessageHeader_CheckContactAddr(MessageHeader p_MessageHeader) runs on IMS_PTC + { /* @sic R5-153760: p_AllowGRUU, p_AllowFQDN removed sic@ */ + var template integer v_Port := *; + var SipUrl v_SipUrl; + + if (not match(p_MessageHeader.contact, cr_Contact_Wildcard)) { // contact may be wildcard for de-registration + v_SipUrl := f_MessageHeader_GetContactSipUrl(p_MessageHeader); + if (not f_IMS_PTC_CheckSipUrlForIPAddrOrFQDNOrGRUU(v_SipUrl, v_Port)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Invalid SipUrl in 'contact'"); + } + } + } + + /* + * @desc Check CSeq of a MessageHeader against expected value + * @param p_MessageHeader + * @param p_ExpectedCSeqValue + * @status APPROVED (IMS) + */ + function f_IMS_MessageHeader_CheckCSeq(template (value) MessageHeader p_MessageHeader, + integer p_ExpectedCSeqValue) runs on IMS_PTC + { + var integer v_CSeqValue := f_MessageHeader_GetCseqValue(p_MessageHeader); + if (v_CSeqValue != p_ExpectedCSeqValue) { // @sic R5s150276 change 2: "==" replaced by "!=" sic@ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "invalid CSeqValue"); + } + } + + //============================================================================ + // Dialog handling + //---------------------------------------------------------------------------- + /* + * @desc returns either next Cseq value of ? if there has been no request sent by the UE so far + * @param p_CseqType (default value: dialogRemote) + * @param p_DialogIndex (default value: omit) + * @return template (present) integer + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_RequestInDialog_CSeqValueRX(IMS_PTC_CseqType_Type p_CseqType := dialogRemote, + template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return template (present) integer + { + var template (present) integer v_CSeqValue := ?; + + if (isvalue(f_IMS_PTC_ImsInfo_CseqGet(p_CseqType, p_DialogIndex))) { + v_CSeqValue := f_IMS_PTC_ImsInfo_CseqIncr(p_CseqType, p_DialogIndex); + } + return v_CSeqValue; + } + + /* + * @desc Build the From header for requests being received within a dialog (e.g. PRACK or BYE) + * @param p_DialogIndex (default value: omit) + * @return template (present) From + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_RequestInDialog_FromHeaderRX(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return template (present) From + { /* @sic R5s140017 MCC160 implementation sic@ */ + /* @sic R5s140121 change 2.1: "runs on" added sic@ */ + var charstring v_FromTag := valueof(f_IMS_PTC_ImsInfo_DialogGetRemoteTag(p_DialogIndex)); // will cause a runtime error when to-tag has not been set before + var template (present) SipUrl v_SipUrl := f_IMS_PTC_ImsInfo_GetSipUriRX(dialogRemoteId); + return cr_FromWithTag(v_SipUrl, v_FromTag); + } + + /* + * @desc Build the To header for requests being received within a dialog (e.g. PRACK or BYE) + * @param p_DialogIndex (default value: omit) + * @return template (present) To + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_RequestInDialog_ToHeaderRX(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return template (present) To + { /* @sic R5s140017 MCC160 implementation sic@ */ + var charstring v_ToTag := valueof(f_IMS_PTC_ImsInfo_DialogGetLocalTag(p_DialogIndex)); /* will cause a runtime error when to-tag has not been set before + NOTE: this runtime error is intended as something else is wrong */ + var template (present) SipUrl v_SipUrl := f_IMS_PTC_ImsInfo_GetSipUriRX(dialogLocalId, -, p_DialogIndex); /* @sic R5s150382 change 1: p_DialogIndex sic@ */ + return cr_ToWithTag(v_SipUrl, v_ToTag); + } + + /* + * @desc Build the From header for requests being sent within a dialog (e.g. PRACK or BYE) + * @param p_DialogIndex (default value: omit) + * @return template (value) From + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_RequestInDialog_FromHeaderTX(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return template (value) From + { /* @sic R5s140017 MCC160 implementation sic@ */ + /* @sic R5s140121 change 4.1: "runs on" added sic@ */ + var charstring v_FromTag := valueof(f_IMS_PTC_ImsInfo_DialogGetLocalTag(p_DialogIndex)); // will cause a runtime error when to-tag has not been set before + var template (value) SipUrl v_SipUrl := f_IMS_PTC_ImsInfo_GetSipUriTX(dialogLocalId); + return cs_From(v_SipUrl, v_FromTag); + } + + /* + * @desc Build the To header for requests being sent within a dialog (e.g. PRACK or BYE) + * @param p_DialogIndex (default value: omit) + * @return template (value) To + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_RequestInDialog_ToHeaderTX(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC return template (value) To + { /* @sic R5s140017 MCC160 implementation sic@ */ + var charstring v_ToTag := valueof(f_IMS_PTC_ImsInfo_DialogGetRemoteTag(p_DialogIndex)); // will cause a runtime error when to-tag has not been set before + var template (value) SipUrl v_SipUrl := f_IMS_PTC_ImsInfo_GetSipUriTX(dialogRemoteId); + return cs_ToWithTag(v_SipUrl, v_ToTag); + } + + /* + * @desc check to-tag of received response and store value if necessary (mainly called after receiving 180 or 183 response) + * @param p_ResponseMessageHeader + * @param p_DialogIndex (default value: omit) + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_Dialog_SetRemoteTag(MessageHeader p_ResponseMessageHeader, + template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit) runs on IMS_PTC + { /* @sic R5s140017 MCC160 implementation: f_IMS_PTC_ImsInfo_DialogGetToTag, f_IMS_PTC_ImsInfo_DialogSetToTag replaced by f_IMS_PTC_ImsInfo_DialogGetRemoteTag, f_IMS_PTC_ImsInfo_DialogSetRemoteTag sic@ */ + var template (omit) charstring v_DialogRemoteTag := f_IMS_PTC_ImsInfo_DialogGetRemoteTag(p_DialogIndex); + var template (omit) charstring v_ReceivedToTag := f_MessageHeader_GetToTag(p_ResponseMessageHeader); + var charstring v_ReceivedToTagValue; + + if (ispresent(v_ReceivedToTag)) { + v_ReceivedToTagValue := valueof(v_ReceivedToTag); + if (ispresent(v_DialogRemoteTag)) { // @sic R5s140173 sic@ + if (not match(v_ReceivedToTagValue, v_DialogRemoteTag)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "invalid To-tag"); + } + } else { + f_IMS_PTC_ImsInfo_DialogSetRemoteTag(v_ReceivedToTagValue); + } + } + } + + //============================================================================ + // Generic Common Messages + //---------------------------------------------------------------------------- + /* + * @desc 200 OK for other requests than REGISTER or SUBSCRIBE (see TS 34.229, A.3.1) + * @param p_MessageHeader_Request + * @param p_ContentType (default value: omit) + * @return template (present) MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_OtherResponse_200_MessageHeaderRX(template (value) MessageHeader p_MessageHeader_Request, + template ContentType p_ContentType := omit) runs on IMS_PTC return template (present) MessageHeader + { /* NOTE: Message is sent by the UE => conditions A2, A4 and A5 are applicable; + * For A4 (GIBA) pAccessNetworkInfo is optional */ + /* @sic R5-130683 sic@ */ + /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + var template (present) MessageHeader v_MessageHeader_Response := cr_MessageHeader_Dummy; + var template (present) PAccessNetworkInfo v_PAccessNetworkInfo := cr_PAccessNetworkInfoDef(f_IMS_PTC_RanType_GetString()); /* acc. to A.3.1 condition A5: access network technology and, if applicable, the cell ID */ + var boolean v_A5 := true; /* true => response sent by the UE within a dialog */ + var boolean v_A2A4 := false; /* true => Response sent by UE for INVITE/UPDATE */ + var boolean v_RequestIsInvite := false; + var boolean v_RequestIsCancel := false; + var charstring v_Method := valueof(p_MessageHeader_Request.cSeq.method); + var integer v_Port_us; + + select (v_Method) { + case ("NOTIFY", "MESSAGE") { + v_A5 := false; + } + case ("UPDATE") { + v_A2A4 := true; + } + case ("INVITE") { + v_A2A4 := true; + v_RequestIsInvite := true; + } + case ("CANCEL") { + v_RequestIsCancel := true; + } + } + v_MessageHeader_Response.via := f_Via_ResponseRX(p_MessageHeader_Request.via); /* @sic R5s140350 sic@ */ + v_MessageHeader_Response.fromField := f_IMS_Response_FromHeaderRX(p_MessageHeader_Request); /* @sic R5s130453 sic@ */ + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderRX(p_MessageHeader_Request); /* @sic R5s130183 change 4 sic@ @sic R5-131897, R5-132063 - new generic function sic@ */ + v_MessageHeader_Response.callId := p_MessageHeader_Request.callId; + v_MessageHeader_Response.sessionId := p_MessageHeader_Request.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Response.cSeq := p_MessageHeader_Request.cSeq; + v_MessageHeader_Response.contentType := p_ContentType; + + if (not f_IMS_PTC_SecurityScheme_IsGiba() and not v_RequestIsCancel) { /* @sic R5-130683: pAccessNetworkInfo is optional for GIBA; R5s140092 change 12: CANCEL sic@ + @sic R5-142223: new condition A8: Any response sent by the UE, except for CANCEL requests sic@ */ + v_MessageHeader_Response.pAccessNetworkInfo := v_PAccessNetworkInfo; + } + else { + v_MessageHeader_Response.pAccessNetworkInfo := v_PAccessNetworkInfo ifpresent; + } + + if (v_RequestIsInvite) { /* @sic R5-135004 Change 3 sic@ + PROSE ISSUE: prose is not clear about whether there shall be any RecordRoute header for responses to requests other than INVITE */ + v_MessageHeader_Response.recordRoute := p_MessageHeader_Request.recordRoute; // @sic R5-135004: same as in the INVITE sent to the UE sic@ + } + if (v_A2A4) { + v_Port_us := f_IMS_PTC_GetPort_us(); /* @sic R5s130985 Change 2 sic@ */ + v_MessageHeader_Response.contact := cr_Contact(f_Contact_SipUri_HostPortRX(?, v_Port_us)); /* host address needs to be checked after receiving + @sic R5s150721, R5-153760: cr_SipUri_HostPort replaced by f_Contact_SipUri_HostPortRX sic@ */ + } + return v_MessageHeader_Response; + } + + /* + * @desc to receive response from the UE and check Via header + * @param p_RequestHeader + * @param p_Protocol + * @param p_Response + * @param p_IMS_DATA_RSP_ByRef (by reference) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + altstep a_IMS_ReceiveResponse(template (value) MessageHeader p_RequestHeader, + template (present) InternetProtocol_Type p_Protocol, + template (present) IMS_Response_Type p_Response, + out IMS_DATA_RSP p_IMS_DATA_RSP_ByRef) runs on IMS_PTC + { + var IMS_DATA_RSP v_IMS_DATA_RSP; + + [] IMS_Client.receive(car_IMS_DATA_RSP(cr_IMS_RoutingInfo(p_Protocol), p_Response)) -> value v_IMS_DATA_RSP + { + f_IMS_MessageHeader_Response_CheckVia(valueof(p_RequestHeader), v_IMS_DATA_RSP.Response.msgHeader); + p_IMS_DATA_RSP_ByRef := v_IMS_DATA_RSP; + } + } + /* + * @desc wrapper function for a_IMS_ReceiveResponse + * @param p_RequestHeader + * @param p_Protocol + * @param p_Response + * @return IMS_DATA_RSP + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_ReceiveResponse(template (value) MessageHeader p_RequestHeader, + template (present) InternetProtocol_Type p_Protocol, + template (present) IMS_Response_Type p_Response) runs on IMS_PTC return IMS_DATA_RSP + { + var IMS_DATA_RSP v_IMS_DATA_RSP_ByRef; + a_IMS_ReceiveResponse(p_RequestHeader, p_Protocol, p_Response, v_IMS_DATA_RSP_ByRef); + return v_IMS_DATA_RSP_ByRef; + } + + /* + * @desc wrapper altstep to receive 200 OK + * @param p_RequestHeader + * @param p_Protocol + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + altstep a_IMS_ReceiveResponse200OK(template (value) MessageHeader p_RequestHeader, + template (present) InternetProtocol_Type p_Protocol) runs on IMS_PTC + { // NOTE: in general the responses e.g. for different NOTIFY messages differ in the CSeq value only + var template (present) MessageHeader v_MessageHeader_Response := f_IMS_OtherResponse_200_MessageHeaderRX(p_RequestHeader); + var IMS_DATA_RSP v_IMS_DATA_RSP_ByRef; // Dummy + + [] a_IMS_ReceiveResponse(p_RequestHeader, p_Protocol, cr_Response(c_statusLine200, v_MessageHeader_Response), v_IMS_DATA_RSP_ByRef); + } + + + + + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_Procedures_Registration.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_Procedures_Registration.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..79ddafc4512976b4b264f140f946f1657cb0251c --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_Procedures_Registration.ttcn @@ -0,0 +1,1960 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-15 21:40:16 +0200 (Tue, 15 Sep 2015) $ +// $Rev: 14433 $ +/******************************************************************************/ + +module IMS_Procedures_Registration { + + import from CommonDefs all; + import from CommonIP all; + import from IMS_CommonDefs all; + import from IMS_Component all; + import from IMS_PTC_CoordMsg all; + import from IP_ASP_TypeDefs all; + import from IMS_ASP_TypeDefs all; + import from IMS_ASP_Templates all; + import from IMS_CommonParameters all; + import from IMS_CommonTemplates all; + import from IMS_SIP_Templates all; + import from IMS_MessageBody_Templates all; + import from IMS_XML_Templates all; + import from IMS_IP_Config all; + import from IMS_CommonFunctions all; + import from IMS_Procedures_Common all; + import from NAS_AuthenticationCommon all; + import from LibSip_Common all; + import from LibSip_SIPTypesAndValues all; + import from Parameters all; + + + //---------------------------------------------------------------------------- + + template (value) charstring cs_IMS_PubGRUU(charstring p_PublicUserIdentity) := p_PublicUserIdentity & ";gr=" & tsc_IMS_PubGRUU_UriParameterValue; /* @sic R5s150721, R5-153760 sic@ + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + /* + * @desc to get a unique and distinct temp gruu (see RFC 5627) for a given URI; + * "sip:user@3gpp.org" shall result in "sip:tgruu.736970-75736572-33677070-6f7267@" &p_HomeDomainName & ";gr"; + * NOTE: for each AOR used in the NOTIFY for reg-event package and/or the 200 OK for REGISTER there shall be a distinct temp-gruu + * @param p_PublicUserIdentity + * @param p_HomeDomainName + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_IMS_TempGRUU(charstring p_PublicUserIdentity, + charstring p_HomeDomainName) return charstring + { /* @sic R5s150721, R5-153760: replaces cs_IMS_TempGRUUForUE sic@ */ + var CharStringList_Type v_CharStringList := f_StringSplit(p_PublicUserIdentity, {":", ".", "@"}); + var CharStringList_Type v_HexStringList; + var integer i; + for (i:=0; i < lengthof(v_CharStringList); i:=i+1) { + v_HexStringList[i] := oct2str(char2oct(v_CharStringList[i])); + } + return "sip:tgruu." & f_StringJoin(v_HexStringList, "-") & "@" & p_HomeDomainName & ";gr"; + } + + //---------------------------------------------------------------------------- + /* + * @desc return security parameters out of register request message + * @param p_RegisterRequest + * @return SecurityClientParams_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_Register_GetSecurityClientParams(REGISTER_Request p_RegisterRequest) runs on IMS_PTC return SecurityClientParams_Type + { + var charstring v_IntegrityAlgStr := f_SIP_IntegrityAlgorithm_String(f_IMS_PTC_Security_GetIntegrityAlgorithm()); + var charstring v_CipheringAlgStr := f_SIP_CipheringAlgorithm_String(f_IMS_PTC_Security_GetCipheringAlgorithm()); + var SecurityMechanism_List v_SecurityMechanism_List := p_RegisterRequest.msgHeader.securityClient.securityMech; + var SemicolonParam_List v_MechParams; + var SecurityClientParams_Type v_SecurityClientParams; + var integer i; + + for (i:=0; i FQDN (fully qualified domain name) + // => Check of the UE's FQDN (if necessary) is FFS + } + } + + /* + * @desc Check the SecurityClient header + * @param p_SecClient + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_IMS_SecurityClient_Check(SecurityClient p_SecClient) runs on IMS_PTC + { /* @sic R5s130710 - MCC160 Implementation: p_Confidentiality removed sic@ */ + + var IPsec_CipheringAlgorithm_Type v_CipheringAlgorithm := f_IMS_PTC_Security_GetCipheringAlgorithm(); /* @sic R5s130710 - MCC160 Implementation sic@ */ + + //Check that mandatory fields are there (normally that should already be done in the receive template of the request message) + if (not match(p_SecClient, cr_SecClientMandatoryFields)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Invalid 'SecurityClient'"); + } + + //Check optional fields + if (match (p_SecClient, cr_SecClientOptionalProtAny) and not match (p_SecClient, cr_SecClientOptionalProt)) { //"prot" parameter is there with a value different to "esp" + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Invalid 'SecurityClient'"); + } + + if (match (p_SecClient, cr_SecClientOptionalModAny) and not match (p_SecClient, cr_SecClientOptionalMod)) { //"mod" parameter is there with a value different to "trans" + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Invalid 'SecurityClient'"); + } + + //Check confidentiality parameter + if (v_CipheringAlgorithm != nociph) { /* @sic R5s130710 - MCC160 Implementation sic@ */ + if (not match(p_SecClient, cr_SecClientEalg)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Invalid 'SecurityClient'"); + } + } + else { + if (not match(p_SecClient, cr_SecClientEalgNull) and match (p_SecClient, cr_SecClientEalgAny)) { //"ealg" parameter is there with a value different to "null" + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Invalid 'SecurityClient'"); + } + } + } + + /* + * @desc check Authorization header sent by the UE + * @param p_Authorization + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_IMS_Authorization_Check(Authorization p_Authorization) runs on IMS_PTC + { + var charstring v_Dresponse; + + if (not ischosen(p_Authorization.body[0].digestResponse)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Invalid 'Authorization'"); + return; + } + v_Dresponse := f_SIP_CommaParamList_GetParamValue(p_Authorization.body[0].digestResponse, "response"); + if (v_Dresponse != "") { // empty value for A1, A3 + if (not f_IMS_Authorization_CheckDigestResponse(-, p_Authorization.body[0].digestResponse, f_IMS_PTC_Security_GetXRES(), f_IMS_PTC_Security_GetXRESLength())) { // @sic R5s120907 sic@ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "DigestResponse not as expected"); + } + } + } + + /* + * @desc check that 'Expires' is included either as header field or as parameter in 'Contact' or in both; + * NOTE: 'contact' may be wildcard e.g. in case of de-registration + * @param p_MessageHeader + * @param p_ExplicitExpiry (default value: omit) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_IMS_MessageHeader_CheckExpires(MessageHeader p_MessageHeader, + template (omit) charstring p_ExplicitExpiry := omit) runs on IMS_PTC + { + var SemicolonParam_List v_ContactParams := {}; + var boolean v_ExpiresFound := false; + var boolean v_MisMatch := false; + var charstring v_DeltaSec := tsc_IMS_ExpiresDef; + + if (isvalue(p_ExplicitExpiry)) { + v_DeltaSec := valueof(p_ExplicitExpiry); + } + + if (ispresent(p_MessageHeader.expires)) { + v_ExpiresFound := true; + v_MisMatch := not match(p_MessageHeader.expires, cr_Expires(v_DeltaSec)); + } + + if (ispresent(p_MessageHeader.contact.contactBody.contactAddresses[0].contactParams)) { + v_ContactParams := p_MessageHeader.contact.contactBody.contactAddresses[0].contactParams; + if (match(v_ContactParams, cr_ExpiresInContactParams)) { + v_ExpiresFound := true; + v_MisMatch := not match(v_ContactParams, cr_ExpiresInContactParams(v_DeltaSec)); // NOTE: 'expires' in ContactParams overrules value of 'Expires' header field + } + } + if (isvalue(p_ExplicitExpiry) and not v_ExpiresFound) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "'expires' found neither in header field nor in contact address"); + } + if (v_MisMatch) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "'expires': wrong value"); + } + } + + /* + * @desc Additional checks of the REGISTER acc. to A.1.1 + * @param p_MessageHeader + * @param p_Protocol + * @param p_CondA7 (default value: false) + * @param p_UE_Address (default value: omit) + * @param p_ExplicitExpiry (default value: omit) + * @param p_CheckAuthorization (default value: true) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_A_1_1_MessageHeader_CommonChecks(MessageHeader p_MessageHeader, + InternetProtocol_Type p_Protocol, + boolean p_CondA7 := false, + template (omit) IP_AddrInfo_Type p_UE_Address := omit, + template (omit) charstring p_ExplicitExpiry := omit, + boolean p_CheckAuthorization := true) runs on IMS_PTC + { + var ContactAddress v_ContactAddress; + var boolean v_IsDeregistration := ispresent(p_ExplicitExpiry) and (str2int(valueof(p_ExplicitExpiry)) == 0); + + f_IMS_MessageHeader_Request_CheckVia(p_MessageHeader, p_Protocol); // @sic R5s120727 change 7, 8 sic@ + f_IMS_MessageHeader_CheckContactAddr(p_MessageHeader); // @sic R5s120727 change 7, 8 sic@ + + // Check 'To' + f_IMS_MessageHeader_CheckTo(p_MessageHeader, noToTag); + + // Check Contact header + if (ispresent(p_MessageHeader.contact.contactBody.contactAddresses[0])) { /* NOTE: is not be present when 'contact' is wildcard e.g. in case of de-registration + * but in this case the respective receive template needs to allow 'cr_ContactWildcard' */ + v_ContactAddress := p_MessageHeader.contact.contactBody.contactAddresses[0]; + + if (pc_IMS_GRUUsInSIP) { // check 'c-p-instance' + // @sic R5-153766: Check of instance-id shall be done for GRUU too sic@ + if (not match(v_ContactAddress.contactParams, cr_CPInstanceInContactParams)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Invalid instance id in Contact header"); + } + } + + if (not v_IsDeregistration) { /* @sic R5-142956: in case of deregistration no further contact parameters need to be checked sic@ */ + fl_IMS_Register_ContactHeader_CheckParams(v_ContactAddress, p_CondA7); + } + if (isvalue(p_UE_Address)) { + fl_IMS_ContactAddress_CheckHostname(v_ContactAddress, valueof(p_UE_Address)); + } + } + + // Check 'SecurityClient' + if (ispresent(p_MessageHeader.securityClient)) { /* 'SecurityClient' is only included for A1, A2 but not for A3 */ + fl_IMS_SecurityClient_Check(p_MessageHeader.securityClient); + } + + // Check 'Authorization' + if (p_CheckAuthorization and ispresent(p_MessageHeader.authorization)) { /* 'Authorization' is only included for A2 but optional for A1, A3 */ + fl_IMS_Authorization_Check(p_MessageHeader.authorization); + } + + fl_IMS_MessageHeader_CheckExpires(p_MessageHeader, p_ExplicitExpiry); + } + + /* + * @desc Check whether message header contains parameter for sig compression + * @param p_MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_MessageHeader_CheckSigComp(MessageHeader p_MessageHeader) runs on IMS_PTC + { + var ViaBody v_ViaBody0; + var ContactAddress v_ContactAddress0; + + // Check sigcomp Test 13.1 + v_ViaBody0 := p_MessageHeader.via.viaBody[0]; + if (not (match (v_ViaBody0.viaParams, cr_SigCompParam))){ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "No SigComp parameter in Via header"); + } + v_ContactAddress0 := p_MessageHeader.contact.contactBody.contactAddresses[0]; + if (not (match (v_ContactAddress0.contactParams, cr_SigCompParam))){ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "No SigComp parameter in Contact header"); + } + } + + /* + * @desc check correctness of the public user id used by the UE for registration + * @param p_SipUrl + * @param p_CondA7 (default value: false) + * @param p_CondA3 (default value: false) + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_PublicUserIdentity_Check(SipUrl p_SipUrl, + boolean p_CondA7 := false, + boolean p_CondA3 := false) runs on IMS_PTC return boolean + { /* p_CondA7 .. In case of emergency registration acc. 24.229 cl. 5.1.1.1A "The first public user identity in the list stored in the ISIM is used in emergency registration requests" + p_CondA3 .. REGISTER for the case UE supports GIBA; @sic R5s140356: p_CondA3 sic@ */ + + if (px_UEwithISIM and not p_CondA3) { + if (not p_CondA7) { // no emergency registration + if (f_IMS_PublicUserId_Match(f_IMS_PTC_ImsInfo_GetAllIMPUs(), p_SipUrl)) { + return true; + } + } else { // emergency registration + if (f_SIP_MatchURI(f_IMS_PTC_ImsInfo_GetURI(emergencyId), p_SipUrl)) { + return true; + } + } + } else { + /* @sic R5-133628: check of temporary user id sic@ */ + if (f_SIP_MatchURI(f_IMS_PTC_ImsInfo_GetURI(temporaryId), p_SipUrl)) { + return true; + } + } + return false; + } + + /* + * @desc check whether at intial registration the UE sends a correct PublicUserIdentity in 'From' and 'To' + * @param p_MessageHeader + * @param p_CondA7 (default value: false) + * @param p_CondA3 (default value: false) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_A_1_1_MessageHeader_CheckPublicUserIdentity(MessageHeader p_MessageHeader, + boolean p_CondA7 := false, + boolean p_CondA3 := false) runs on IMS_PTC + { /* p_CondA7 .. Initial IMS emergency registration (see fl_PublicUserIdentity_Check) + p_CondA3 .. REGISTER for the case UE supports GIBA; @sic R5s140356: p_CondA3 sic@ */ + var SipUrl v_SipUrlFrom := f_Addr_Union_GetSipUrl(p_MessageHeader.fromField.addressField); /* @sic R5s130235 additional changes sic@ */ + var SipUrl v_SipUrlTo := f_Addr_Union_GetSipUrl(p_MessageHeader.toField.addressField); /* @sic R5s130235 additional changes sic@ */ + + if (not fl_PublicUserIdentity_Check(v_SipUrlTo, p_CondA7, p_CondA3)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Invalid public user identity in 'toField' of the REGISTER request"); + } + + if (f_SIP_SipUrl2Str(v_SipUrlFrom) != f_SIP_SipUrl2Str(v_SipUrlTo)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "public user identity is different in From and To header of the REGISTER request"); + } + } + + } // group + + //============================================================================ + + group SendReceiveFunctions { + + + /* + * @desc wait for REGISTER when it has not been received yet + * @param p_IMS_DATA_REQ + * @return IMS_DATA_REQ + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_IMS_ReceiveOrGetRegisterRequest(template (omit) IMS_DATA_REQ p_IMS_DATA_REQ) runs on IMS_PTC return IMS_DATA_REQ + { + var IMS_DATA_REQ v_IMS_DATA_REQ; + var template (present) SipUrl v_SipUrl := cr_SipUri_HostPort(f_IMS_PTC_ImsInfo_GetHomeDomainName()); + + if (not isvalue(p_IMS_DATA_REQ)) { + IMS_Server.receive(car_IMS_Register_Request(cr_REGISTER_Request(v_SipUrl))) -> value v_IMS_DATA_REQ; // receive any REGISTER + } else { + v_IMS_DATA_REQ := valueof(p_IMS_DATA_REQ); + } + return v_IMS_DATA_REQ; + } + + //---------------------------------------------------------------------------- + /* + * @desc 200 OK for Register (see TS 34.229, A.1.3) + * @param p_RegisterRequest + * @param p_CondA3 (default value: false) + * @param p_RegisterExpiration (default value: tsc_IMS_RegisterExpiration) + * @param p_CondA4 (default value: (pc_IMS_CS_PS_SRVCCAlert or pc_IMS_CS_PS_SRVCC)) + * @return template (value) MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_RegisterResponse_200_MessageHeaderTX(REGISTER_Request p_RegisterRequest, + boolean p_CondA3 := false, + charstring p_RegisterExpiration := tsc_IMS_RegisterExpiration, + boolean p_CondA4 := (pc_IMS_CS_PS_SRVCCAlert or pc_IMS_CS_PS_SRVCC)) runs on IMS_PTC return template (value) MessageHeader + { /* p_CondA3 .. condition A3 (Response for an emergency registration) */ + /* @sic R5-130750 change 1, 4: specific IMPU for messages sent in DL; P-Associated-URI sic@ */ + var MessageHeader v_MessageHeader_Register := p_RegisterRequest.msgHeader; + var template (value) MessageHeader v_MessageHeader_Response := cs_MessageHeader_Dummy; + var CharStringList_Type v_PublicUserIdList := f_IMS_PTC_ImsInfo_GetAllIMPUs(); + var CharStringList_Type v_AssociatedUriList; + var template (value) NameAddrParam_List v_NameAddrParamList; + var template (omit) ServiceRoute v_ServiceRoute := omit; + var integer i; + + if (p_CondA3) { // emergency registration + v_AssociatedUriList[0] := f_IMS_PTC_ImsInfo_GetURI(emergencyId); + } + else { + for (i:=0; i < lengthof(v_PublicUserIdList); i := i+1) { + v_AssociatedUriList[i] := v_PublicUserIdList[i]; + } + v_AssociatedUriList[i] := px_IMS_AssociatedTelUri; + + v_ServiceRoute := cs_ServiceRouteDef(px_IMS_Scscf); + } + + for (i:=0; i < lengthof(v_AssociatedUriList); i := i+1) { + v_NameAddrParamList[i] := cs_NameAddrParam(f_SIP_BuildSipUri_TX(v_AssociatedUriList[i])); + } + + v_MessageHeader_Response.via := v_MessageHeader_Register.via; + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderTX(v_MessageHeader_Register); /* @sic R5s130235 additional changes sic@ @sic R5-131897, R5-132063 - generic handling of to-tags sic@ */ + v_MessageHeader_Response.fromField := v_MessageHeader_Register.fromField; + v_MessageHeader_Response.callId := v_MessageHeader_Register.callId; + v_MessageHeader_Response.sessionId := v_MessageHeader_Register.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Response.cSeq := v_MessageHeader_Register.cSeq; + v_MessageHeader_Response.contact := f_SIP_RegisterResponse_BuildContactHeader(v_MessageHeader_Register, p_RegisterExpiration); + v_MessageHeader_Response.pAssociatedURI := cs_PAssociatedURI(v_NameAddrParamList); + v_MessageHeader_Response.serviceRoute := v_ServiceRoute; + v_MessageHeader_Response.path := cs_PathDef(f_IMS_PTC_Pcscf_Get()); + + if (p_CondA4) { // @sic R5-145796 sic@ + v_MessageHeader_Response.featureCaps := cs_FeatureCaps({ cs_GenericParam_Common("+g.3gpp.atcf", cs_GenValueQuoted("tel:+1-237-888-999")), + cs_GenericParam_Common("+g.3gpp.cs2ps-srvcc", cs_GenValueQuoted(""))}); + } + + return v_MessageHeader_Response; + } + + /* + * @desc 401 Unauthorized for Register (see TS 34.229, A.1.2) + * @param p_RegisterRequest + * @param p_Nonce (default value: omit) + * @return template (value) MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_RegisterResponse_401_MessageHeaderTX(REGISTER_Request p_RegisterRequest, + template (omit) charstring p_Nonce := omit) runs on IMS_PTC return template (value) MessageHeader + { + var MessageHeader v_MessageHeader_Register := p_RegisterRequest.msgHeader; + var charstring v_Nonce; + var template (value) SecurityMechanism_List v_SecurityMech := f_IMS_PTC_BuildSecurityServerParam(); + var template (value) MessageHeader v_MessageHeader_Response := cs_MessageHeader_Dummy; + + if (not isvalue(p_Nonce)) { + v_Nonce := f_IMS_PTC_Security_GetNonce(); + } else { + v_Nonce := valueof(p_Nonce); + } + + v_MessageHeader_Response.via := v_MessageHeader_Register.via; + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderTX(v_MessageHeader_Register); /* @sic R5s130235 additional changes sic@ @sic R5-131897, R5-132063 - generic handling of to-tags sic@ */ + v_MessageHeader_Response.fromField := v_MessageHeader_Register.fromField; + v_MessageHeader_Response.callId := v_MessageHeader_Register.callId; + v_MessageHeader_Response.sessionId := v_MessageHeader_Register.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Response.cSeq := v_MessageHeader_Register.cSeq; + v_MessageHeader_Response.wwwAuthenticate := cs_WwwAuthChallenge(f_IMS_PTC_ImsInfo_GetHomeDomainName(), v_Nonce); // @sic R5s120727 change 2 sic@ + v_MessageHeader_Response.securityServer := cs_SecServerDef(v_SecurityMech); + + return v_MessageHeader_Response; + } + + /* + * @desc 403 Forbidden (see TS 34.229, A.3.2) + * @param p_RegisterRequest + * @return template (value) MessageHeader + * @status APPROVED (IMS_IRAT) + */ + function f_IMS_RegisterResponse_403_MessageHeaderTX(REGISTER_Request p_RegisterRequest) runs on IMS_PTC return template (value) MessageHeader + { + var MessageHeader v_MessageHeader_Register := p_RegisterRequest.msgHeader; + var template (value) MessageHeader v_MessageHeader_Response := cs_MessageHeader_Dummy; + + v_MessageHeader_Response.via := v_MessageHeader_Register.via; + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderTX(v_MessageHeader_Register); /* @sic R5s130235 additional changes sic@ @sic R5-131897, R5-132063 - generic handling of to-tags sic@ */ + v_MessageHeader_Response.fromField := v_MessageHeader_Register.fromField; + v_MessageHeader_Response.callId := v_MessageHeader_Register.callId; + v_MessageHeader_Response.sessionId := v_MessageHeader_Register.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Response.cSeq := v_MessageHeader_Register.cSeq; + + return v_MessageHeader_Response; + } + + /* + * @desc 200 OK for Subscribe (see TS 34.229, A.1.5) + * @param p_SubscribeRequest + * @param p_RecordRoute + * @param p_ExpireTime (default value: "600000") + * @param p_ContactHostname (default value: px_IMS_Scscf) + * @param p_ToTag (default value: omit) + * @return template (value) MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_SubscribeResponse_200_MessageHeaderTX(SUBSCRIBE_Request p_SubscribeRequest, + template (value) RecordRoute p_RecordRoute, + charstring p_ExpireTime := "600000", + charstring p_ContactHostname := px_IMS_Scscf, + template (omit) charstring p_ToTag := omit) runs on IMS_PTC return template (value) MessageHeader + { /* NOTE: acc. to A.1.5 this message does not have a Session-ID */ + /* @sic R5-153986: parameter p_ToTag to allow different ToTags for different dialogs created by subscription to even packages sic@ */ + var MessageHeader v_MessageHeader_Subscribe := p_SubscribeRequest.msgHeader; + var template (value) MessageHeader v_MessageHeader_Response := cs_MessageHeader_Dummy; + + v_MessageHeader_Response.via := v_MessageHeader_Subscribe.via; + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderTX(p_SubscribeRequest.msgHeader, p_ToTag); /* @sic R5-130750 same as in SUBSCRIBE, R5s130235 additional changes sic@ + @sic R5-131897, R5-132063 - generic handling of to-tags sic@ */ + v_MessageHeader_Response.fromField := v_MessageHeader_Subscribe.fromField; + v_MessageHeader_Response.callId := v_MessageHeader_Subscribe.callId; + v_MessageHeader_Response.cSeq := v_MessageHeader_Subscribe.cSeq; + v_MessageHeader_Response.contact := cs_Contact(cs_SipUri_HostPort(p_ContactHostname)); // @sic R5s120727 change 3 sic@ + v_MessageHeader_Response.expires := cs_Expires (p_ExpireTime); // @sic R5-130548 sic@ + v_MessageHeader_Response.recordRoute := p_RecordRoute; + + return v_MessageHeader_Response; + } + + /* + * @desc 503 Service Unavailable (see TS 34.229, A.4.2) + * @param p_MessageHeader_Request + * @param p_RetryAfter + * @return template (value) MessageHeader + * @status APPROVED (IMS) + */ + function f_IMS_CommonResponse_503_MessageHeaderTX(MessageHeader p_MessageHeader_Request, + template (value) RetryAfter p_RetryAfter) runs on IMS_PTC return template (value) MessageHeader + { + var template (value) MessageHeader v_MessageHeader_Response := cs_MessageHeader_Dummy; + + v_MessageHeader_Response.via := p_MessageHeader_Request.via; + v_MessageHeader_Response.fromField := p_MessageHeader_Request.fromField; + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderTX(p_MessageHeader_Request); + v_MessageHeader_Response.callId := p_MessageHeader_Request.callId; + v_MessageHeader_Response.sessionId := p_MessageHeader_Request.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Response.cSeq := p_MessageHeader_Request.cSeq; + v_MessageHeader_Response.retryAfter := p_RetryAfter; + + return v_MessageHeader_Response; + } + + //---------------------------------------------------------------------------- + /* + * @desc used for initialisation of f_IMS_RegisterRequest_MessageHeaderRX_Initial/Subsequent with headers being common + * @param p_CondA3 + * @param p_CseqValue + * @param p_SessionIdSupported (default value: pc_IMS_SessionIdSupported) + * @return template (present) MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_IMS_RegisterRequest_MessageHeaderRX_Base(boolean p_CondA3, + template (present) integer p_CseqValue, + boolean p_SessionIdSupported := pc_IMS_SessionIdSupported) return template (present) MessageHeader + { /* @sic R5s150086 - p_SessionIdSupported: pc_IMS_SessionIdSupported per default sic@ */ + var template (present) MessageHeader v_MessageHeader_Register := cr_MessageHeader_Dummy; + + v_MessageHeader_Register.cSeq := cr_CseqDef(p_CseqValue, "REGISTER"); + v_MessageHeader_Register.expires := *; // as the 'expires' information can be included in 'expires' as well as in 'contact' (or in both) it needs to be checked seperately + v_MessageHeader_Register.supported := cr_Supported_Register; + v_MessageHeader_Register.callId := cr_CallId(?); // per default call id itself is not checked at all + v_MessageHeader_Register.sessionId := f_IMS_SessionId_RX_IfSupported(p_SessionIdSupported); /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Register.maxForwards := cr_MaxForwardsDef; + + if (p_CondA3) { + v_MessageHeader_Register.require := omit; + v_MessageHeader_Register.proxyRequire := omit; + v_MessageHeader_Register.securityClient := omit; + v_MessageHeader_Register.securityVerify := omit; + v_MessageHeader_Register.authorization := omit; + } + else { + v_MessageHeader_Register.require := cr_RequireSecAgree; + v_MessageHeader_Register.proxyRequire := cr_ProxyRequireDef; + v_MessageHeader_Register.securityClient := cr_SecClientMandatoryFields; + } + return v_MessageHeader_Register; + } + + /* + * @desc initial REGISTER (condition A1 or A3) acc. to 34.229-1 Annex A.1.1 + * @param p_Protocol + * @return template (present) MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_RegisterRequest_MessageHeaderRX_Initial(InternetProtocol_Type p_Protocol) runs on IMS_PTC return template (present) MessageHeader + { /* NOTE: several checks are done explicitly in the respective check functions applied on the receive messages (the same for sigcomp) */ + /* @sic R5s130XXX: p_CondA3 removed sic@ */ + + var boolean v_CondA3 := f_IMS_PTC_SecurityScheme_IsGiba(); + var template (present) SipUrl v_SipUrlPublicUserId := ?; /* Acc. to 24.229 cl. 5.1.1.2.1 for initial registration the UE shall populate + 'To' and 'From' with the public user identity to be registered; + Normally this is one of the IMPUs stored on the ISIM; + The public user identity is explicitly checked after matching the REGISTER message */ + var template (present) integer v_CseqValue := ?; + var template (present) MessageHeader v_MessageHeader_Register := fl_IMS_RegisterRequest_MessageHeaderRX_Base(v_CondA3, v_CseqValue); + var template (present) Via v_Via; + + if (p_Protocol == tcp) { + v_Via := cr_ViaDef; // @sic R5s120858 change 2; R5s130369; R5-133358: "rport" is optional for tcp (independent from A3) sic@ + } else { + v_Via := cr_ViaInitialReg; + } + + v_MessageHeader_Register.via := v_Via; + v_MessageHeader_Register.route := omit; // @sic R5-134659 sic@ + v_MessageHeader_Register.fromField := cr_FromWithTag(v_SipUrlPublicUserId); // checked in f_IMS_A_1_1_MessageHeader_CheckPublicUserIdentity + v_MessageHeader_Register.toField := cr_ToDef(v_SipUrlPublicUserId); // checked in f_IMS_A_1_1_MessageHeader_CheckPublicUserIdentity + v_MessageHeader_Register.contact := cr_Contact(cr_SipUri_HostPort(?, *)); // checked in fl_IMS_Register_ContactHeader_CheckParams, f_IMS_A_1_1_MessageHeader_CommonChecks + + v_MessageHeader_Register.pAccessNetworkInfo := cr_PAccessNetworkInfoDef(f_IMS_PTC_RanType_GetString()) ifpresent; // optional for A1, A3; cellId is not checked + + if (not v_CondA3) { // => 34.229-1 A.1.1 condition A1 + v_MessageHeader_Register.securityVerify := omit; + v_MessageHeader_Register.authorization := cr_AuthorizationInitial(f_IMS_PTC_ImsInfo_GetPrivateUserId(), f_IMS_PTC_ImsInfo_GetHomeDomainName()); + } + return v_MessageHeader_Register; + } + + /* + * @desc subsequent REGISTER (condition A2) acc. to 34.229-1 Annex A.1.1 + * @param p_NonceCount + * @param p_Protocol + * @return template (present) MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_RegisterRequest_MessageHeaderRX_Subsequent(integer p_NonceCount, + InternetProtocol_Type p_Protocol) runs on IMS_PTC return template (present) MessageHeader + { /* p_NonceCount .. Acc. to A.1.1 "counter to indicate how many times UE has sent the same value of nonce within successive REGISTERs, initial value shall be 1" + * => during initial registration "1" is used per default; for each re-authentication (=> new nonce) the nonce-counter is reset to "1" + * @sic R5-142727: new parameter p_Protocol sic@ */ + var template (present) MessageHeader v_MessageHeader_Register; + var template (present) SipUrl v_SipUrlPublicUserId; + var charstring v_Nonce := f_IMS_PTC_Security_GetNonce(); + var charstring v_NonceCountStr := "0000000" & int2str(p_NonceCount); // assuming p_NonceCount < 9 + var IMS_ProtectedPorts_Type v_Protected := f_IMS_PTC_Security_GetProtectedPorts(); + var integer v_CseqValue := f_IMS_PTC_ImsInfo_CseqIncr(register); + var boolean v_IsGiba := false; + var template integer v_ViaPort := *; + + if (p_Protocol == udp) { // @sic R5-145727 sic@ + v_ViaPort := v_Protected.Port_us; + } + + v_SipUrlPublicUserId := f_SIP_BuildSipUri_RX(f_IMS_PTC_ImsInfo_GetURI(registrationId)); /* public user identity is checked against what the UE has sent in initial REGISTER + (in case the UE does not have an ISIM this is the temporary user id) + => we don't need to consider A7 (emergency registration) */ + v_MessageHeader_Register := fl_IMS_RegisterRequest_MessageHeaderRX_Base(v_IsGiba, v_CseqValue); + + v_MessageHeader_Register.route := omit; // @sic R5-134659 sic@ + v_MessageHeader_Register.via := cr_ViaDef(-, cr_HostPort(?, v_ViaPort)); // @sic R5s120727 change 7; R5-145727 sic@ + v_MessageHeader_Register.fromField := cr_FromWithTag(v_SipUrlPublicUserId); + v_MessageHeader_Register.toField := cr_ToDef(v_SipUrlPublicUserId); + v_MessageHeader_Register.contact := cr_Contact(cr_SipUri_HostPort(?, v_Protected.Port_us)); // checked in f_IMS_A_1_1_MessageHeader_CommonChecks; @sic R5s120727 change 7 sic@ + + v_MessageHeader_Register.pAccessNetworkInfo := cr_PAccessNetworkInfoDef(f_IMS_PTC_RanType_GetString()); // cell id only if applicable + v_MessageHeader_Register.securityVerify := f_IMS_PTC_BuildSecurityVerifyHeader(); + v_MessageHeader_Register.authorization := cr_AuthorizationDef(f_IMS_PTC_ImsInfo_GetPrivateUserId(), f_IMS_PTC_ImsInfo_GetHomeDomainName(), v_Nonce, v_NonceCountStr); + + return v_MessageHeader_Register; + } + + /* + * @desc REGISTER to de-register + * @return template (present) MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_RegisterRequest_MessageHeaderRX_Derregister() runs on IMS_PTC return template (present) MessageHeader + { + var boolean v_CondA3 := f_IMS_PTC_SecurityScheme_IsGiba(); // condition A3 acc. to 34.229-1 Annex A.1.1 (REGISTER for the case UE supports GIBA) + var template (present) MessageHeader v_MessageHeader_Register; + var template (present) SipUrl v_SipUrlPublicUserId := f_SIP_BuildSipUri_RX(f_IMS_PTC_ImsInfo_GetURI(registrationId)); /* public user identity is checked against what the UE has sent in initial REGISTER + NOTE: there is no indication in 34.229-1 to check this */ + var template (present) integer v_CseqValue := f_IMS_PTC_ImsInfo_CseqIncr(register); + var IMS_ProtectedPorts_Type v_Protected; + var charstring v_Nonce; + + v_MessageHeader_Register := fl_IMS_RegisterRequest_MessageHeaderRX_Base(v_CondA3, v_CseqValue); + + // common parameters for A2 and A3: + v_MessageHeader_Register.fromField := cr_FromWithTag(v_SipUrlPublicUserId); + v_MessageHeader_Register.toField := cr_ToDef(v_SipUrlPublicUserId); + v_MessageHeader_Register.supported := *; // Supported: header may be missing or it may contain any value + v_MessageHeader_Register.route := omit; // @sic R5-134659 sic@ + + if (v_CondA3) { + v_MessageHeader_Register.via := cr_ViaDef; + v_MessageHeader_Register.contact := (cr_Contact_Wildcard, cr_Contact(cr_SipUri_HostPort(?, *))); + } + else { + v_Protected := f_IMS_PTC_Security_GetProtectedPorts(); + v_Nonce := f_IMS_PTC_Security_GetNonce(); + + v_MessageHeader_Register.via := cr_ViaDef(-, cr_HostPort(?, v_Protected.Port_us)); // address will be checked in f_IMS_A_1_1_MessageHeader_CommonChecks (@sic R5s120727 sic@) + v_MessageHeader_Register.contact := (cr_Contact_Wildcard, cr_Contact(cr_SipUri_HostPort(?, v_Protected.Port_us))); // address will be checked in f_IMS_A_1_1_MessageHeader_CommonChecks (@sic R5s120727 sic@) + + v_MessageHeader_Register.pAccessNetworkInfo := cr_PAccessNetworkInfoDef(f_IMS_PTC_RanType_GetString()); // cell id only if applicable + v_MessageHeader_Register.securityVerify := f_IMS_PTC_BuildSecurityVerifyHeader(); + v_MessageHeader_Register.authorization := cr_AuthorizationDef(f_IMS_PTC_ImsInfo_GetPrivateUserId(), f_IMS_PTC_ImsInfo_GetHomeDomainName(), v_Nonce, ?); + } + return v_MessageHeader_Register; + } + + //---------------------------------------------------------------------------- + /* + * @desc SUBSCRIBE acc. to 34.229-1 Annex A.1.4, A.5.1 or A.6.1 + * @param p_EventType (default value: "reg") + * @param p_SipUrlTo (default value: omit) + * @param p_ExpireTime (default value: "600000") + * @param p_SessionIdSupported (default value: pc_IMS_SessionIdSupported) + * @return template (present) MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_SubscribeRequest_MessageHeaderRX(EventType p_EventType := "reg", + template SipUrl p_SipUrlTo := omit, + template (present) charstring p_ExpireTime := "600000", + boolean p_SessionIdSupported := pc_IMS_SessionIdSupported) runs on IMS_PTC return template (present) MessageHeader + { /* p_EventType: + * "reg" - normal case acc. A.1.4 + * "conference" - "SUBSCRIBE for conference event package" acc. annex A.5.1; NOTE in this case p_SipUrlTo shall be present and set acc. to "px_FinalConferenceUri" + * "message-summary" - "SUBSCRIBE for Message Waiting Indication package" acc. annex A.6.1 */ + /* @sic R5-130750 change 4: specific IMPU for messages sent in DL sic@ */ + /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5s150086 - p_SessionIdSupported: pc_IMS_SessionIdSupported per default sic@ */ + var template (present) MessageHeader v_MessageHeader_Subscribe := cr_MessageHeader_Dummy; + var IMS_ProtectedPorts_Type v_Protected; + var template (present) PAccessNetworkInfo v_PAccessNetworkInfo := cr_PAccessNetworkInfoDef(f_IMS_PTC_RanType_GetString()); + var template (present) SipUrl v_SipUrlFrom := f_IMS_PTC_ImsInfo_GetSipUriSubscriptionRX(); + var template (present) SipUrl v_SipUrlTo; + var template integer v_Port_ps := *; + var template integer v_Port_us_Via := *; + var template integer v_Port_us_Contact := ?; + + if (ispresent(p_SipUrlTo)) { + v_SipUrlTo := p_SipUrlTo; // NOTE: compiler warning cannot be avoided here + } else { + v_SipUrlTo := v_SipUrlFrom; + } + + v_MessageHeader_Subscribe.cSeq := cr_CseqDef(?, "SUBSCRIBE"); + v_MessageHeader_Subscribe.fromField := cr_FromWithTag(v_SipUrlFrom); + v_MessageHeader_Subscribe.toField := cr_ToDef(v_SipUrlTo); + v_MessageHeader_Subscribe.expires := cr_Expires(p_ExpireTime); // @sic R5-130548 sic@ + v_MessageHeader_Subscribe.callId := cr_CallId(?); + v_MessageHeader_Subscribe.sessionId := f_IMS_SessionId_RX_IfSupported(p_SessionIdSupported); /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Subscribe.maxForwards := cr_MaxForwardsDef; + v_MessageHeader_Subscribe.event := cr_EventDef(p_EventType); + + if (f_IMS_PTC_SecurityScheme_IsGiba()) { + v_MessageHeader_Subscribe.require := omit; + v_MessageHeader_Subscribe.proxyRequire := omit; + v_MessageHeader_Subscribe.securityVerify := omit; + v_MessageHeader_Subscribe.pAccessNetworkInfo := v_PAccessNetworkInfo ifpresent; + } + else { + v_Protected := f_IMS_PTC_Security_GetProtectedPorts(); + v_Port_ps := v_Protected.Port_ps; + v_Port_us_Via := v_Protected.Port_us; + v_Port_us_Contact := v_Protected.Port_us; + v_MessageHeader_Subscribe.require := cr_RequireSecAgree; + v_MessageHeader_Subscribe.proxyRequire := cr_ProxyRequireDef; + v_MessageHeader_Subscribe.securityVerify := f_IMS_PTC_BuildSecurityVerifyHeader(); + v_MessageHeader_Subscribe.pAccessNetworkInfo := v_PAccessNetworkInfo + } + + v_MessageHeader_Subscribe.route := cr_Route(cr_RouteBodyList_InitialReq(v_Port_ps)); /* @sic R5s140934 change 1 sic@ */ + v_MessageHeader_Subscribe.via := cr_ViaDef(-, cr_HostPort(?, v_Port_us_Via)); /* host address needs to be checked after receiving @sic R5s120727 change 6.1 sic@ */ + v_MessageHeader_Subscribe.contact := cr_Contact(f_Contact_SipUri_HostPortRX(?, v_Port_us_Contact)); /* host address needs to be checked after receiving @sic R5s120727 change 6.1 sic@ + @sic R5s130925 change 1: UE may use any port as server port sic@ + @sic R5s150721, R5-153760: cr_SipUri_HostPort replaced by f_Contact_SipUri_HostPortRX sic@ */ + select (p_EventType) { + case ("reg") { // normal case + v_MessageHeader_Subscribe.accept := cr_AcceptDef(c_xmlreginfoApplication) ifpresent; + } + case ("conference") { // "SUBSCRIBE for conference event package" acc. annex A.5.1 + v_MessageHeader_Subscribe.accept := cr_AcceptDef("application/conference-info+xml"); + v_MessageHeader_Subscribe.expires := cr_Expires(?); + } + case ("message-summary") { // "SUBSCRIBE for Message Waiting Indication package" acc. annex A.6.1 + v_MessageHeader_Subscribe.accept := cr_AcceptDef("application/simple-message-summary") + } + } + + return v_MessageHeader_Subscribe; + } + + + + + + + + + } // group + + //============================================================================ + + group RegistrationFunctions { + + /* + * @desc Receive initial REGISTER (condition A1 or A3) acc. to 34.229-1 Annex A.1.1 + * @param p_IMS_DATA_REQ (default value: omit) + * @param p_ExplicitExpiry (default value: omit) + * @param p_SigCompIsActive (default value: false) + * @param p_CondA7 (default value: false) + * @param p_CondA3 (default value: false) + * @return IMS_DATA_REQ + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_REGISTER_InitialRequest(template (omit) IMS_DATA_REQ p_IMS_DATA_REQ := omit, + template (omit) charstring p_ExplicitExpiry := omit, + boolean p_SigCompIsActive := false, + boolean p_CondA7 := false, + boolean p_CondA3 := false) runs on IMS_PTC return IMS_DATA_REQ + { /* p_CondA7 .. condition A7 acc. to 34.229-1 Annex A.1.1 (Initial IMS emergency registration) + p_CondA3 .. REGISTER for the case UE supports GIBA; @sic R5s140356: p_CondA3 sic@ */ + /* @sic R5s130756 additional changes: p_CondA3 removed sic@ */ + /* @sic R5-134659: check of Route header removed sic@ */ + var IPCAN_INFO_Type v_IpcanInfo; + var IMS_DATA_REQ v_IMS_DATA_REQ; + var IMS_RoutingInfo_Type v_RoutingInfo_UL; + var InternetProtocol_Type v_Protocol; + var IP_AddrInfo_Type v_UE_Address; + var IP_AddrInfo_Type v_NW_Address; + var MessageHeader v_MessageHeader; + var boolean v_Match := false; + + v_IMS_DATA_REQ := fl_IMS_ReceiveOrGetRegisterRequest(p_IMS_DATA_REQ); + v_MessageHeader := v_IMS_DATA_REQ.Request.Register.msgHeader; + v_Protocol := v_IMS_DATA_REQ.RoutingInfo.Protocol; + + v_IpcanInfo := f_IMS_IPCAN_Query(IPCAN); + f_IMS_PTC_SetIpcanInfo(v_IpcanInfo); + + v_Match := match(v_MessageHeader, f_IMS_RegisterRequest_MessageHeaderRX_Initial(v_Protocol)); // @sic R5s130369 sic@ + if (not v_Match) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "invalid REGISTER Request"); + } + v_RoutingInfo_UL := v_IMS_DATA_REQ.RoutingInfo; + v_UE_Address := v_RoutingInfo_UL.UE_Address; + v_NW_Address := v_RoutingInfo_UL.NW_Address; + v_Protocol := v_RoutingInfo_UL.Protocol; + + f_IMS_PTC_ImsInfo_Init(v_UE_Address, v_NW_Address, v_IMS_DATA_REQ.Request.Register, p_SigCompIsActive); + + // additional checks + f_IMS_A_1_1_MessageHeader_CommonChecks(v_MessageHeader, v_Protocol, p_CondA7, v_UE_Address, p_ExplicitExpiry); + f_IMS_A_1_1_MessageHeader_CheckPublicUserIdentity(v_MessageHeader, p_CondA7, p_CondA3); // check 'To' and 'From' field (needed for initial registration only); @sic R5s140356: p_CondA3 sic@ + if (p_SigCompIsActive) { + f_IMS_MessageHeader_CheckSigComp(v_MessageHeader); + } + + return v_IMS_DATA_REQ; + } + + + /* + * @desc local initialisation of ports and spis at the IMS PTC + * @param p_RegisterReq + * @param p_AuthenticationParams + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_Register_SecurityInitPortsAndSPIs(REGISTER_Request p_RegisterReq, + Common_AuthenticationParams_Type p_AuthenticationParams) runs on IMS_PTC + { /* @sic R5s131004 - MCC160 implementation: new function sic@ */ + var SecurityClientParams_Type v_SecurityClientParams := f_IMS_Register_GetSecurityClientParams(p_RegisterReq); // @sic R5s140266 sic@ + + /* initialise or re-initialise SPIs and protected ports of the network side: */ + f_IMS_PTC_Security_Init(p_AuthenticationParams, v_SecurityClientParams.Port_us, v_SecurityClientParams.Port_uc, v_SecurityClientParams.SPI_us, v_SecurityClientParams.SPI_uc); + } + + + /* + * @desc Initialise security during registration procedure + * @param p_RegisterReq + * @param p_Rand (default value: tsc_IMS_AuthRAND) + * @param p_Unprotected (default value: false) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_Register_SecurityInit(REGISTER_Request p_RegisterReq, + B128_Type p_Rand := tsc_IMS_AuthRAND, + boolean p_Unprotected := false) runs on IMS_PTC + { /* @sic R5s120858 change 6..8 - MCC160 implementation: additional parameter p_Unprotected to deal with GIBA sic@ */ + /* @sic R5s130266 change 1.3, 4, 5 - MCC160 Implementation: SPIs for re-authentication sic@ */ + var Common_AuthenticationParams_Type v_AuthenticationParams := f_IMS_AuthenticationInit(p_Rand); + var IP_AddrInfo_Type v_UE_Address := f_IMS_PTC_UE_Address_Get(); + var IP_AddrInfo_Type v_NW_Address := f_IMS_PTC_NW_Address_Get(); + var SipUrl v_ContactUrl := f_MessageHeader_GetContactSipUrl(p_RegisterReq.msgHeader); + + if (p_Unprotected) { + f_IMS_PortsAndSecurityConfig(f_SIP_ContactUrl_GetPort(v_ContactUrl), // may be omit in which case 5060 is chosen by the IP PTC + cs_IMS_RegistrationInfo(v_NW_Address, v_UE_Address)); // @sic R5s150268 change 2 sic@ + } + else { + f_IMS_InstallIPsecKeys(v_AuthenticationParams.IK, v_AuthenticationParams.CK); + + f_IMS_Register_SecurityInitPortsAndSPIs(p_RegisterReq, v_AuthenticationParams); /* @sic R5s131004 - MCC160 implementation: use of f_IMS_Register_SecurityInitPortsAndSPIs sic@ */ + + /* configure IMS security; any existing security context will be released + * NOTE: release of the security context is not done at the end of the deregistration since it is not sure that the deregistration really happens and + * when realeasing the security directly after sending the deregistration it may lead to timing issues */ + f_IMS_PortsAndSecurityConfig(f_SIP_ContactUrl_GetPort(v_ContactUrl), // may be omit in which case 5060 is chosen by the IP PTC + cs_IMS_RegistrationInfo(v_NW_Address, // @sic R5s150268 change 2 sic@ + v_UE_Address, + cs_IMS_SecurityInfo(f_IMS_PTC_Security_GetProtectedPorts(), + f_IMS_PTC_Security_GetSPIs(), + f_IMS_PTC_Security_GetIntegrityAlgorithm(), + f_IMS_PTC_Security_GetCipheringAlgorithm()))); + + } + } + + /* + * @desc Receive subsequent REGISTER (condition A2) acc. to 34.229-1 Annex A.1.1 + * @param p_IMS_DATA_REQ (default value: omit) + * @param p_CondA7 (default value: false) + * @param p_NonceCount (default value: 1) + * @param p_ExplicitExpiry (default value: omit) + * @return IMS_DATA_REQ + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_REGISTER_SubsequentRequest(template (omit) IMS_DATA_REQ p_IMS_DATA_REQ := omit, + boolean p_CondA7 := false, + integer p_NonceCount := 1, + template (omit) charstring p_ExplicitExpiry := omit) runs on IMS_PTC return IMS_DATA_REQ + { /* p_CondA7 .. condition A7 acc. to 34.229-1 Annex A.1.1 (Initial IMS emergency registration) + * p_NonceCount .. Acc. to A.1.1 "counter to indicate how many times UE has sent the same value of nonce within successive REGISTERs, initial value shall be 1" + * => during initial registration "1" is used per default; for each re-authentication (=> new nonce) the nonce-counter is reset to "1" + */ + var IP_AddrInfo_Type v_UE_Address := f_IMS_PTC_UE_Address_Get(); + var IMS_DATA_REQ v_IMS_DATA_REQ; + var REGISTER_Request v_RegisterReq; + var MessageHeader v_MessageHeader; + var InternetProtocol_Type v_Protocol; + var boolean v_Match := false; + + // Receive/Get second REGISTER on secure port: + v_IMS_DATA_REQ := fl_IMS_ReceiveOrGetRegisterRequest(p_IMS_DATA_REQ); + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + v_Protocol := v_IMS_DATA_REQ.RoutingInfo.Protocol; + v_MessageHeader := v_RegisterReq.msgHeader; + + v_Match := match(v_MessageHeader, f_IMS_RegisterRequest_MessageHeaderRX_Subsequent(p_NonceCount, v_Protocol)); + if (not v_Match) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "invalid REGISTER Request"); + } + else { + f_IMS_A_1_1_MessageHeader_CommonChecks(v_MessageHeader, v_Protocol, p_CondA7, v_UE_Address, p_ExplicitExpiry); // @sic R5s120945 sic@ + + if (f_IMS_PTC_ImsInfo_SigCompStarted()) { + f_IMS_MessageHeader_CheckSigComp(v_MessageHeader); + } + } + f_IMS_PTC_ImsInfo_SetContactUrl(f_MessageHeader_GetContactSipUrl(v_MessageHeader)); + return v_IMS_DATA_REQ; + } + + /* + * @desc receive REGISTER (non GIBA) and send reponse + * @param p_IMS_DATA_REQ (default value: omit) + * @param p_RegisterExpiration (default value: tsc_IMS_RegisterExpiration) + * @param p_SigCompIsActive (default value: false) + * @param p_IsEmergency (default value: false) + * @return REGISTER_Request + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_Register_NonGIBA(template (omit) IMS_DATA_REQ p_IMS_DATA_REQ := omit, + charstring p_RegisterExpiration := tsc_IMS_RegisterExpiration, + boolean p_SigCompIsActive := false, + boolean p_IsEmergency := false) runs on IMS_PTC return REGISTER_Request + { /* Note: + - In case the the function is called in a default handler the Register message has been already received + - When used in the IMS CC tests the PTC needs to wait for the reception of the Register message */ + var IMS_DATA_REQ v_IMS_DATA_REQ; + var REGISTER_Request v_RegisterReq; + + v_IMS_DATA_REQ := f_IMS_REGISTER_InitialRequest(p_IMS_DATA_REQ, -, p_SigCompIsActive, p_IsEmergency); // check REGISTER and init GlobalInfo + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + + f_IMS_Register_SecurityInit(v_RegisterReq); + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo), cs_Response(c_statusLine401, f_IMS_RegisterResponse_401_MessageHeaderTX(v_RegisterReq)))); + + v_IMS_DATA_REQ := f_IMS_REGISTER_SubsequentRequest(-, p_IsEmergency); + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo), cs_Response(c_statusLine200, f_IMS_RegisterResponse_200_MessageHeaderTX(v_RegisterReq, p_IsEmergency, p_RegisterExpiration)))); // @sic R5s130561 sic@ + + return v_RegisterReq; + } + + /* + * @desc common function for IMS registration (GIBA) + * @param p_IMS_DATA_REQ (default value: omit) + * @param p_RegisterExpiration (default value: tsc_IMS_RegisterExpiration) + * @return REGISTER_Request + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_Register_GIBA(template (omit) IMS_DATA_REQ p_IMS_DATA_REQ := omit, + charstring p_RegisterExpiration := tsc_IMS_RegisterExpiration) runs on IMS_PTC return REGISTER_Request + { /* Note: + - In case the the function is called in a default handler the Register message has been already received + - When used in the IMS CC tests the PTC needs to wait for the reception of the Register message */ + + var IMS_DATA_REQ v_IMS_DATA_REQ; + var REGISTER_Request v_RegisterReq; + var boolean v_CondA3 := true; + + v_IMS_DATA_REQ := f_IMS_REGISTER_InitialRequest(p_IMS_DATA_REQ, -, -, -, v_CondA3); // check REGISTER and init GlobalInfo; @sic R5s140356: v_CondA3 sic@ + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + + f_IMS_Register_SecurityInit(v_RegisterReq, -, v_CondA3); // @sic R5s120858 change 6..8 - MCC160 implementation sic@ + + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo), cs_Response(c_statusLine200, f_IMS_RegisterResponse_200_MessageHeaderTX(v_RegisterReq, -, p_RegisterExpiration)))); + return v_RegisterReq; + } + + /* + * @desc common function for IMS registration + * @param p_IMS_DATA_REQ (default value: omit) + * @param p_SigCompIsActive (default value: false) + * @param p_RegisterExpiration (default value: tsc_IMS_RegisterExpiration) + * @return REGISTER_Request + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_Register(template (omit) IMS_DATA_REQ p_IMS_DATA_REQ := omit, + boolean p_SigCompIsActive := false, + charstring p_RegisterExpiration := tsc_IMS_RegisterExpiration) runs on IMS_PTC return REGISTER_Request + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5-151769 additional parameter p_RegisterExpiration sic@ */ + var REGISTER_Request v_RegisterRequest; + + if (f_IMS_PTC_SecurityScheme_IsGiba()) { + if (p_SigCompIsActive) { + FatalError(__FILE__, __LINE__, "sigcomp is not supported for GIBA"); + } + v_RegisterRequest := f_IMS_Register_GIBA(p_IMS_DATA_REQ, p_RegisterExpiration); + } else { + v_RegisterRequest := f_IMS_Register_NonGIBA(p_IMS_DATA_REQ, p_RegisterExpiration, p_SigCompIsActive); + } + return v_RegisterRequest; + } + + //============================================================================ + /* + * @desc Receive SUBSCRIBE acc. to 34.229-1 Annex A.1.4 + * @param p_IMS_DATA_REQ (by reference) + * @param p_EventType + * @param p_SipUrlRequestUri + * @param p_SipUrlTo (default value: omit) + * @param p_ExpireTime (default value: "600000") + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + altstep a_IMS_SUBSCRIBE_Request(out IMS_DATA_REQ p_IMS_DATA_REQ, + EventType p_EventType, + template (present) SipUrl p_SipUrlRequestUri, + template SipUrl p_SipUrlTo := omit, + template (present) charstring p_ExpireTime := "600000") runs on IMS_PTC + { /* NOTE: applicable only if the SUBSCRIBE creates a new dialog (i.e. is ot sent within existing dialog */ + var IMS_DATA_REQ v_IMS_DATA_REQ; + var MessageHeader v_MessageHeader; + var InternetProtocol_Type v_Protocol; + var charstring v_ToTag := f_IMS_GenerateTag("SUBSCRIBE-to-" & p_EventType & "-package"); /* @sic R5-153756: dialog for subscribe sic@ */ + var template (present) MessageHeader v_ExpectedMessageHeader := f_IMS_SubscribeRequest_MessageHeaderRX(p_EventType, p_SipUrlTo, p_ExpireTime); + var IMS_PTC_DialogIndex_Type v_DialogIndex; + + [] IMS_Server.receive(car_IMS_Subscribe_Request(cr_SUBSCRIBE_Request(p_SipUrlRequestUri, v_ExpectedMessageHeader))) -> value v_IMS_DATA_REQ + { + v_MessageHeader := v_IMS_DATA_REQ.Request.Subscribe.msgHeader; + v_Protocol := v_IMS_DATA_REQ.RoutingInfo.Protocol; + + f_IMS_MessageHeader_CheckTo(v_MessageHeader, noToTag); // This cannot be checked in the template + + f_IMS_MessageHeader_Request_CheckVia(v_MessageHeader, v_Protocol); // @sic R5s120727 change 9 sic@ + f_IMS_MessageHeader_CheckContactAddr(v_MessageHeader); // @sic R5s120727 change 9 sic@ + f_IMS_MessageHeader_Request_CheckRoute(v_MessageHeader); // @sic R5s140934 change 2 sic@ + + if (f_IMS_PTC_ImsInfo_SigCompStarted()) { + f_IMS_MessageHeader_CheckSigComp(v_MessageHeader); + } + + select (p_EventType) { + case ("reg") { v_DialogIndex := regEventDialog; } + case ("message-summary") { v_DialogIndex := msgSummayDialog; } + case ("conference") { v_DialogIndex := confEventDialog; } + case else { FatalError(__FILE__, __LINE__, "invalid event type"); } + } + f_IMS_PTC_ImsInfo_DialogInit(dialogRemote, v_MessageHeader, v_DialogIndex); /* @sic R5-153756: dialog for subscribe sic@ */ + f_IMS_PTC_ImsInfo_DialogSetLocalTag(v_ToTag, v_DialogIndex); /* @sic R5-153756: dialog for subscribe sic@ */ + + p_IMS_DATA_REQ := v_IMS_DATA_REQ; + } + } + + /* + * @desc Receive SUBSCRIBE acc. to 34.229-1 Annex A.1.4 + * @param p_EventType (default value: "reg") + * @param p_SipUrlTo (default value: omit) + * @param p_ExpireTime (default value: "600000") + * @return IMS_DATA_REQ + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_SUBSCRIBE_Request(EventType p_EventType := "reg", + template SipUrl p_SipUrlTo := omit, + template (present) charstring p_ExpireTime := "600000") runs on IMS_PTC return IMS_DATA_REQ + { /* @sic R5-130750 change 4: specific IMPU for messages sent in DL sic@ */ + /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + var IMS_DATA_REQ v_IMS_DATA_REQ; + var template (present) SipUrl v_SipUrlRequestUri := f_IMS_PTC_ImsInfo_GetSipUriSubscriptionRX(); + + a_IMS_SUBSCRIBE_Request(v_IMS_DATA_REQ, p_EventType, v_SipUrlRequestUri, p_SipUrlTo, p_ExpireTime); /* @sic R5-150705: altstep a_IMS_SUBSCRIBE_Request sic@ */ + + return v_IMS_DATA_REQ; + } + + /* + * @desc Send 200 OK for SUBSCRIBE acc. to 34.229-1 Annex A.1.5 or Annex 5.2 + * @param p_DialogIndex + * @param p_IMS_Subscribe_Request + * @param p_ExpireTime (default value: "600000") + * @param p_ContactHostname (default value: px_IMS_Scscf) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_SUBSCRIBE_Response(IMS_PTC_DialogIndex_Type p_DialogIndex, + IMS_DATA_REQ p_IMS_Subscribe_Request, + charstring p_ExpireTime := "600000", + charstring p_ContactHostname := px_IMS_Scscf) runs on IMS_PTC + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + /* @sic R5-153756, R5-153986: new parameter p_DialogIndex to use to-tag as stored for the respective "subscribe-dialog" sic@ */ + var IMS_RoutingInfo_Type v_RoutingInfo_UL; + var SUBSCRIBE_Request v_SubscribeRequest; + var template (value) RouteBody_List v_RouteBodyList; + var charstring v_RouteHost := f_IMS_PTC_Pcscf_Get(); + var integer v_Port_ps := f_IMS_PTC_GetPort_ps(); + var template (omit) GenericParam v_SigCompParam := f_IMS_PTC_ImsInfo_GetSigCompParam(); + var template (omit) charstring v_ToTag := f_IMS_PTC_ImsInfo_DialogGetLocalTag(p_DialogIndex); /* @sic R5-153756, R5-153986 sic@ */ + + v_RoutingInfo_UL := p_IMS_Subscribe_Request.RoutingInfo; + v_SubscribeRequest := p_IMS_Subscribe_Request.Request.Subscribe; + v_RouteBodyList := { f_RouteBodyWithParamsTX(cs_SipUri_HostPort_lr(v_RouteHost, v_Port_ps), v_SigCompParam) }; + + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_RoutingInfo_UL), + cs_Response(c_statusLine200, f_IMS_SubscribeResponse_200_MessageHeaderTX(v_SubscribeRequest, + cs_RecordRoute(v_RouteBodyList), + p_ExpireTime, + p_ContactHostname, + v_ToTag)))); + } + + /* + * @desc receive SUBSCRIBE and send response + * @return SUBSCRIBE_Request + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_Register_Subscribe() runs on IMS_PTC return SUBSCRIBE_Request + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + var IMS_DATA_REQ v_IMS_DATA_REQ; + + v_IMS_DATA_REQ := f_IMS_SUBSCRIBE_Request(); + f_IMS_SUBSCRIBE_Response(regEventDialog, v_IMS_DATA_REQ); + + return v_IMS_DATA_REQ.Request.Subscribe; + } + + //---------------------------------------------------------------------------- + /* + * @desc Generate Via header for NOTIFY request + * @param p_ViaAddressList + * @return template (value) Via + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_NotifyRequest_ViaTX(CharStringList_Type p_ViaAddressList) runs on IMS_PTC return template (value) Via + { + var charstring v_ProtocolString := f_IMS_ConvertTransportProtocolToString(f_IMS_PTC_ImsInfo_GetTransportProtocol()); + var template (omit) integer v_Port_ps := f_IMS_PTC_GetPort_ps(); // @sic R5s120907 change 5 - Port_ps instead of Port_us sic@ + var template (omit) GenericParam v_SigCompParam := f_IMS_PTC_ImsInfo_GetSigCompParam(); + var template (value) ViaBody_List v_ViaBodyList; + var charstring v_NextBranch; + var integer i; + + for (i:=0; i < lengthof(p_ViaAddressList); i:=i+1) { + v_NextBranch := f_IMS_PTC_ImsInfo_GetNextBranch(); + v_ViaBodyList[i] := cs_ViaBody(v_ProtocolString, cs_HostPort(p_ViaAddressList[i], v_Port_ps), f_ViaParamsTX(v_NextBranch, v_SigCompParam)); + if (i == 0) { + v_Port_ps := omit; + v_SigCompParam := omit; + } + } + return cs_Via(v_ViaBodyList); + } + + /* + * @desc Common function for NOTIFY message + * @param p_DialogIndex + * @param p_Via + * @param p_ContactSipUrl + * @param p_EventType + * @param p_SubscriptionState + * @param p_ContentType + * @return template (value) MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_NotifyRequest_MessageHeader_Common(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex, + template (value) Via p_Via, + template (value) SipUrl p_ContactSipUrl, + EventType p_EventType, + template (value) SubscriptionState p_SubscriptionState, + template (omit) ContentType p_ContentType) + runs on IMS_PTC return template (value) MessageHeader + { /* NOTE: acc. to A.1.6 this message does not have a Session-ID */ + /* NOTE: function is independent of whether the subscription has been done creating a new dialog or within an existing dialog + * => in general p_DialogIndex and p_EventType are not correlated to each other */ + /* @sic R5s130756 additional changes: p_CondA2 removed sic@ */ + /* @sic R5-153756, R5-153986: new parameter p_DialogIndex to use respective dialog; p_SubscribeRequest and p_CseqValue removed sic@ */ + /* @sic R5-153756, R5-153986: dialog information as stored at the IMS PTC is used rather than SUBSCRIBE sic@ */ + /* @sic R5-153756, R5-153986: p_Via instead of p_ViaAddressList sic@ */ + /* @sic R5-153756: p_ContentType sic@ */ + var template (value) MessageHeader v_MessageHeader_Notify := cs_MessageHeader_Dummy; + var integer v_CseqValue := f_IMS_PTC_ImsInfo_CseqIncr(dialogLocal, p_DialogIndex); + + v_MessageHeader_Notify.via := p_Via; /* @sic R5-153986: p_Via sic@ */ + v_MessageHeader_Notify.toField := f_IMS_RequestInDialog_ToHeaderTX(p_DialogIndex); + v_MessageHeader_Notify.fromField := f_IMS_RequestInDialog_FromHeaderTX(p_DialogIndex); + v_MessageHeader_Notify.callId := f_IMS_PTC_ImsInfo_DialogGetCallId(p_DialogIndex); + if (p_EventType != "reg") { /* PROSE ISSUE: session id is not specified in A.1.6 => to be added by appropriate CR */ + v_MessageHeader_Notify.sessionId := f_IMS_PTC_ImsInfo_DialogGetSessionId(p_DialogIndex); + } + v_MessageHeader_Notify.cSeq := cs_CseqDef(v_CseqValue, "NOTIFY"); + v_MessageHeader_Notify.contact := cs_Contact(p_ContactSipUrl); + v_MessageHeader_Notify.contentType := p_ContentType; + v_MessageHeader_Notify.event := cs_EventDef(p_EventType); + v_MessageHeader_Notify.maxForwards := cs_MaxForwardsDef(69); + v_MessageHeader_Notify.subscriptionState := p_SubscriptionState; + + return v_MessageHeader_Notify; + } + + /* + * @desc Send NOTIFY acc. to 34.229-1 Annex A.1.6 + * @param p_SubscriptionState + * @return template (value) MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_NotifyRequest_MessageHeader_A16(template (value) SubscriptionState p_SubscriptionState) runs on IMS_PTC return template (value) MessageHeader + { /* NOTE: acc. to A.1.6 this message does not have a Session-ID */ + /* @sic R5s130756 additional changes: p_CondA2 removed sic@ */ + /* @sic R5s130768 additional MCC160 change: use of new function f_IMS_NotifyRequest_MessageHeader_Common sic@ */ + /* @sic R5-153756, R5-153986: p_SubscribeRequest and p_CseqValue removed sic@ */ + var charstring v_NW_AddrStr := f_IMS_PTC_NW_Address_GetAddrStr(); /* @sic R5s130133 change 6: f_IMS_PTC_NW_Address_GetHostFormat replaced by f_IMS_PTC_NW_Address_GetAddrStr sic@ */ + var CharStringList_Type v_ViaAddressList := {v_NW_AddrStr, px_IMS_Scscf}; + var template (value) Via v_Via := f_IMS_NotifyRequest_ViaTX(v_ViaAddressList); /* @sic R5-153986: new function f_IMS_NotifyRequest_ViaTX sic@ */ + var template (value) SipUrl v_ContactSipUrl := cs_SipUri_HostPort(px_IMS_Scscf); /* @sic R5s120727 change 10 sic@ */ + var template (value) ContentType v_ContentType := cs_ContentType(c_xmlreginfoApplication); /* @sic R5-153756 sic@ */ + + return f_IMS_NotifyRequest_MessageHeader_Common(regEventDialog, v_Via, v_ContactSipUrl, "reg", p_SubscriptionState, v_ContentType); + } + + //---------------------------------------------------------------------------- + /* + * @desc Send NOTIFY acc. to 34.229-1 Annex A.1.6 + * @param p_ContactUrl + * @param p_XmlMessage + * @param p_SubscriptionState (default value: cs_SubscriptionState_Active) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_Register_Notify(SipUrl p_ContactUrl, + template (value) Reginfo_Type p_XmlMessage, + template (value) SubscriptionState p_SubscriptionState := cs_SubscriptionState_Active) runs on IMS_PTC + { /* @sic R5s130756 additional changes: p_CondA2 removed sic@ */ + /* @sic R5-153756, R5-153986: p_SubscribeRequest and p_CseqValue removed sic@ */ + var template (value) MessageHeader v_MessageHeader_Notify; + var template (present) MessageHeader v_MessageHeader_Response; + var InternetProtocol_Type v_Protocol := f_IMS_PTC_ImsInfo_GetTransportProtocol(); + + v_MessageHeader_Notify := f_IMS_NotifyRequest_MessageHeader_A16(p_SubscriptionState); /* @sic R5-153756, R5-153986 sic@ */ + IMS_Client.send(cas_IMS_Notify_Request(cs_IMS_RoutingInfo(v_Protocol), cs_NOTIFY_Request(p_ContactUrl, v_MessageHeader_Notify, cs_MessageBody_RegInfo(p_XmlMessage)))); + + v_MessageHeader_Response := f_IMS_OtherResponse_200_MessageHeaderRX(v_MessageHeader_Notify); + f_IMS_ReceiveResponse(v_MessageHeader_Notify, v_Protocol, cr_Response(c_statusLine200, v_MessageHeader_Response)); /* @sic R5s140350 sic@ */ + } + + //---------------------------------------------------------------------------- + /* + * @desc return RegInfo.Registration + * @param p_RegisterRequest + * @param p_Aor + * @param p_RegistrationId + * @param p_ContactId + * @param p_ContactState (default value: active) + * @param p_ContactEvent (default value: registered) + * @param p_Expires (default value: omit) + * @param p_ApplyGRUU (default value: pc_IMS_GRUUsInSIP) + * @param p_IsTelUri (default value: false) + * @return template (value) RegInfo_Registration_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_XML_RegistrationInfo(REGISTER_Request p_RegisterRequest, + charstring p_Aor, + charstring p_RegistrationId, + charstring p_ContactId, + RegInfo_Contact_State_Type p_ContactState := active, + RegInfo_Contact_Event_Type p_ContactEvent := registered, + template (omit) integer p_Expires := omit, + boolean p_ApplyGRUU := pc_IMS_GRUUsInSIP, + boolean p_IsTelUri := false) + runs on IMS_PTC return template (value) RegInfo_Registration_Type + { + var charstring v_ContactUri := f_SIP_SipUrl2Str(f_MessageHeader_GetContactSipUrl(p_RegisterRequest.msgHeader)); // same value as in Contact header of REGISTER request + var template (omit) charstring v_CallId := omit; + var template (omit) integer v_Cseq := omit; + var template (omit) PubGruu_Type v_PubGruu := omit; + var template (omit) TempGruu_Type v_TempGruu := omit; + var template (value) RegInfo_Contact_UnknownParams_Type v_UnknownParams := {}; + var RegInfo_Registration_State_Type v_RegistrationState; + var charstring v_InstanceId; + + if (p_ContactState == active) { + v_RegistrationState := active; + } else { + v_RegistrationState := terminated; + } + + if (p_ApplyGRUU) { /* @sic R5-153760: support of GRUU sic@ */ + v_PubGruu := cs_XML_PubGruu(cs_IMS_PubGRUU(p_Aor)); /* !!!! PROSE ISSUE: acc. to RFC 5628 each contact (i.e. aor) has its own pub-gruu !!!! + !!!! but 34.229-1 A.1.6 says "public GRUU for the UE" for all entries !!!! */ + v_TempGruu := cs_XML_TempGruu(fl_IMS_TempGRUU(p_Aor, f_IMS_PTC_ImsInfo_GetHomeDomainName()), + p_RegisterRequest.msgHeader.cSeq.seqNumber); /* !!!! PROSE ISSUE: acc. to RFC 5628 each contact (i.e. aor) has its own temp-gruu !!!! + !!!! but 34.229-1 A.1.6 says "temporary GRUU for the UE" !!!! */ + v_InstanceId := f_SIP_InstanceId(); + v_UnknownParams := { cs_XML_UEInstance(v_InstanceId) }; + if (not p_IsTelUri) { + v_CallId := p_RegisterRequest.msgHeader.callId.callid; // Call-Id of most recent REGISTER + v_Cseq := p_RegisterRequest.msgHeader.cSeq.seqNumber; // CSeq value of most recent REGISTER + } + } + return cs_XML_RegistrationInfo(cs_XML_RegistrationContact(v_ContactUri, p_ContactId, p_ContactState, p_ContactEvent, v_CallId, v_Cseq, p_Expires, v_UnknownParams, v_PubGruu, v_TempGruu), + p_Aor, + p_RegistrationId, + v_RegistrationState); + } + + template (value) RegInfo_RegistrationList_Type cs_RegistrationList (template (value) RegInfo_Registration_Type p_Reg1, + template (value) RegInfo_Registration_Type p_Reg2, + template (value) RegInfo_Registration_Type p_Reg3, + template (value) RegInfo_Registration_Type p_Reg4) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + { p_Reg1, p_Reg2, p_Reg3, p_Reg4 }; + + template (value) RegInfo_RegistrationList_Type cs_RegistrationListOf3 (template (value) RegInfo_Registration_Type p_Reg1, + template (value) RegInfo_Registration_Type p_Reg2, + template (value) RegInfo_Registration_Type p_Reg3) := + { p_Reg1, p_Reg2, p_Reg3}; + + /* + * @desc return default Reginfo for NOTIFY message + * @param p_RegisterRequest + * @return template (value) Reginfo_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_XmlMessageForNotify_Def(REGISTER_Request p_RegisterRequest) runs on IMS_PTC return template (value) Reginfo_Type + { /* @sic R5-130750 sic@ */ + var CharStringList_Type v_PublicUeserIdList := f_IMS_PTC_ImsInfo_GetAllIMPUs(); + var template (value) RegInfo_Registration_Type v_Registration1 := f_XML_RegistrationInfo(p_RegisterRequest, v_PublicUeserIdList[0], "a100", "980", active, registered); + var template (value) RegInfo_Registration_Type v_Registration2 := f_XML_RegistrationInfo(p_RegisterRequest, px_IMS_AssociatedTelUri, "a101", "981", active, created, -, -, true); + var template (value) RegInfo_Registration_Type v_Registration3 := f_XML_RegistrationInfo(p_RegisterRequest, v_PublicUeserIdList[1], "a102", "982", active, registered); + var template (value) RegInfo_Registration_Type v_Registration4 := f_XML_RegistrationInfo(p_RegisterRequest, v_PublicUeserIdList[2], "a103", "983", active, registered); + + return f_XML_RegInfo(-, -, cs_RegistrationList (v_Registration1, v_Registration2, v_Registration3, v_Registration4)); + } + + //---------------------------------------------------------------------------- + /* + * @desc C.2 / C.2a Generic Registration Test Procedure - IMS support + * This is the second half of the generic Registration procedure (Steps 8 to 11) + * @param p_RegisterRequest + * @return SUBSCRIBE_Request + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_Register_SubscribeNotify(REGISTER_Request p_RegisterRequest) runs on IMS_PTC return SUBSCRIBE_Request + { /* @sic R5s130756 additional changes: p_IsGIBA removed sic@ */ + var SUBSCRIBE_Request v_SubscribeReq; + var SipUrl v_ContactUrl := f_MessageHeader_GetContactSipUrl(p_RegisterRequest.msgHeader); + + // Steps 8 and 9 + v_SubscribeReq := f_IMS_Register_Subscribe(); + + // Steps 10 and 11 + f_IMS_Register_Notify(v_ContactUrl, f_IMS_XmlMessageForNotify_Def(p_RegisterRequest)); /* @sic R5-153756, R5-153986: p_SubscribeRequest and p_CseqValue removed sic@ */ + + return v_SubscribeReq; + } + + //---------------------------------------------------------------------------- + /* + * @desc procedure to de-register UE acc. to 34.229-1 C.30 + * @param p_IMS_DATA_REQ (default value: omit) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_PTC_Deregistration(template (omit) IMS_DATA_REQ p_IMS_DATA_REQ := omit) runs on IMS_PTC + { /* @sic R5-140902: no delay needed anymore to wait for TCP close sic@ */ + var IMS_DATA_REQ v_IMS_DATA_REQ; + var MessageHeader v_MessageHeader; + var IP_AddrInfo_Type v_UE_Address := f_IMS_PTC_UE_Address_Get(); + var InternetProtocol_Type v_Protocol; + var charstring v_Expires := "0"; + var boolean v_Match := false; + + v_IMS_DATA_REQ := fl_IMS_ReceiveOrGetRegisterRequest(p_IMS_DATA_REQ); + v_MessageHeader := v_IMS_DATA_REQ.Request.Register.msgHeader; + v_Protocol := v_IMS_DATA_REQ.RoutingInfo.Protocol; + + v_Match := match(v_MessageHeader, f_IMS_RegisterRequest_MessageHeaderRX_Derregister()); + if (not v_Match) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "invalid REGISTER Request for de-registration"); + } + else { + f_IMS_A_1_1_MessageHeader_CommonChecks(v_MessageHeader, v_Protocol, -, v_UE_Address, v_Expires); // check expires: to be 0 and present either in Expires or in contact or in both (-> 8.3.4/8.13.4) + } + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo), + cs_Response(c_statusLine200, f_IMS_RegisterResponse_200_MessageHeaderTX(v_IMS_DATA_REQ.Request.Register, -, v_Expires)))); // @sic R5s130274: v_Expires sic@ + + f_IMS_TCP_CloseHandling(waitAndClose); /* @sic R5s140219 - MCC160 implementation sic@ */ + } + + //============================================================================ + // re-registration: used e.g. for test cases 8.2 and 11.2 + + type record SecurityClientParams_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + PortNumber_Type Port_us, + PortNumber_Type Port_uc, + IPsec_SPI_Type SPI_us, + IPsec_SPI_Type SPI_uc + }; + + /* + * @desc Get Security Client parameters for re-registration (if re-authentication is applicable) + * @return SecurityClientParams_Type + * @status APPROVED (IMS) + */ + function f_IMS_PTC_ReRegistration_SecurityClientParamsGet() + runs on IMS_PTC return SecurityClientParams_Type + { + var SecurityClientParams_Type v_SecurityClientParams; + var IMS_ProtectedPorts_Type v_Protected := f_IMS_PTC_Security_GetProtectedPorts(); + var IMS_SPIs_Type v_SPIs := f_IMS_PTC_Security_GetSPIs(); + + v_SecurityClientParams.Port_us := v_Protected.Port_us; + v_SecurityClientParams.Port_uc := v_Protected.Port_uc; + v_SecurityClientParams.SPI_us := v_SPIs.SPI_us; + v_SecurityClientParams.SPI_uc := v_SPIs.SPI_uc; + + return v_SecurityClientParams; + } + + /* + * @desc check port numbers and SPIs sent by the UE for re-registration + * @param p_RegisterReq + * @param p_PrevSecurityClientParams + * @return SecurityClientParams_Type + * @status APPROVED (IMS) + */ + function f_IMS_PTC_ReRegistration_SecurityClientParamsCheck(REGISTER_Request p_RegisterReq, + SecurityClientParams_Type p_PrevSecurityClientParams) + runs on IMS_PTC return SecurityClientParams_Type + { /* p_PrevSecurityClientParams .. security parameters as being used for configuration of the security at the SS side + * i.e. as used for the latest (re-)authentication */ + var SecurityClientParams_Type v_SecurityClientParams := f_IMS_Register_GetSecurityClientParams(p_RegisterReq); // @sic R5s140266 sic@ + + if ((v_SecurityClientParams.SPI_uc == p_PrevSecurityClientParams.SPI_uc) or + (v_SecurityClientParams.SPI_us == p_PrevSecurityClientParams.SPI_us) or + (v_SecurityClientParams.Port_uc == p_PrevSecurityClientParams.Port_uc) or + (v_SecurityClientParams.Port_us != p_PrevSecurityClientParams.Port_us)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, ""); + } else { + f_IMS_PreliminaryPass(__FILE__, __LINE__, ""); + } + return v_SecurityClientParams; + } + + /* + * @desc Wait for the UE to do re-registration + * @param p_TRegExpireMin + * @param p_TRegExpireMax + * @param p_Nc + * @return IMS_DATA_REQ + * @status APPROVED (IMS) + */ + function f_IMS_PTC_ReRegistration_WaitForRegistration(timer p_TRegExpireMin, + timer p_TRegExpireMax, + integer p_Nc) + runs on IMS_PTC return IMS_DATA_REQ + { /* @sic R5s130266 change 1.2 - MCC160 Implementation: upper, lower bound for TRegExpire sic@ */ + var IMS_DATA_REQ v_IMS_DATA_REQ; + var template (present) SipUrl v_SipUrl := cr_SipUri_HostPort(f_IMS_PTC_ImsInfo_GetHomeDomainName()); + + alt { // @sic R5s130266 change 1.2 - MCC160 Implementation sic@ + [] IMS_Server.receive(car_IMS_Register_Request(cr_REGISTER_Request)) + { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "re-registration before timeout of expiry timer"); + } + [] p_TRegExpireMin.timeout {} + } + + alt { + [] IMS_Server.receive(car_IMS_Register_Request(cr_REGISTER_Request(v_SipUrl))) // receive any REGISTER + -> value v_IMS_DATA_REQ + { + p_TRegExpireMax.stop; + f_IMS_REGISTER_SubsequentRequest(v_IMS_DATA_REQ, -, p_Nc); + + } + [] p_TRegExpireMax.timeout + { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "timeout while waiting for re-registration"); + } + } + return v_IMS_DATA_REQ; + } + + //============================================================================ + // Generic Procedures acc. to 34.229-1 Annex C (and derivations) + + /* + * @desc Generic procedure to register IMS + * @param p_IMS_DATA_REQ (default value: omit) + * @param p_SigCompIsActive (default value: false) + * @param p_RegisterExpiration (default value: tsc_IMS_RegisterExpiration) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_Registration(template (omit) IMS_DATA_REQ p_IMS_DATA_REQ := omit, + boolean p_SigCompIsActive := false, + charstring p_RegisterExpiration := tsc_IMS_RegisterExpiration) runs on IMS_PTC + { /* NOTE: + * - In case the the function is called in a default handler, the Register message has been already received + * - When used in the IMS CC tests, the PTC needs to wait for the reception of the Register message */ + /* @sic R5s130756 additional changes: p_IsGIBA removed as security scheme is managed at the IMS PTC (-> f_IMS_PTC_SecurityScheme_IsGiba()) sic@ */ + var REGISTER_Request v_RegisterRequest; + + v_RegisterRequest := f_IMS_Register(p_IMS_DATA_REQ, p_SigCompIsActive, p_RegisterExpiration); + f_IMS_Register_SubscribeNotify(v_RegisterRequest); + } + + /* + * @desc Emergency registration according to 34.229-1 Annex C.20 + * @param p_IMS_DATA_REQ (default value: omit) + * @param p_RegisterExpiration (default value: tsc_IMS_RegisterExpiration) + * @return REGISTER_Request + * @status APPROVED (IMS_IRAT, IMS, LTE) + */ + function f_IMS_EmergencyRegistration_C20(template (omit) IMS_DATA_REQ p_IMS_DATA_REQ := omit, + charstring p_RegisterExpiration := tsc_IMS_RegisterExpiration) runs on IMS_PTC return REGISTER_Request + { + var boolean v_IsEmergency := true; + return f_IMS_Register_NonGIBA(p_IMS_DATA_REQ, p_RegisterExpiration, -, v_IsEmergency); + } + + /* + * @desc Emergency registration Forbidden + * @return REGISTER_Request + * @status APPROVED (IMS_IRAT) + */ + function f_IMS_EmergencyCallRegistration_403Forbidden() runs on IMS_PTC return REGISTER_Request + { + var IMS_DATA_REQ v_IMS_DATA_REQ; + var REGISTER_Request v_RegisterReq; + var boolean v_IsEmergency := true; + + v_IMS_DATA_REQ := f_IMS_REGISTER_InitialRequest(-, -, -, v_IsEmergency); + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + + f_IMS_Register_SecurityInit(v_RegisterReq); + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo), cs_Response(c_statusLine401, f_IMS_RegisterResponse_401_MessageHeaderTX(v_RegisterReq)))); + + v_IMS_DATA_REQ := f_IMS_REGISTER_SubsequentRequest(-, v_IsEmergency); + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; /* @sic R5s140123 change 3 sic@ */ + + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo), cs_Response(c_statusLine403, f_IMS_RegisterResponse_403_MessageHeaderTX(v_RegisterReq)))); + + return v_IMS_DATA_REQ.Request.Register; + } + + //---------------------------------------------------------------------------- + /* + * @desc Unsubscribe from event package for given dialog + * @param p_DialogIndex + * @return template (present) MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_SubscribeRequest_MessageHeaderRX_C30(IMS_PTC_DialogIndex_Type p_DialogIndex) runs on IMS_PTC return template (present) MessageHeader + { /* !!!! PROSE ISSUE: + !!!! R5-153756 has specified for SUBSCRIBE (step 0A) + !!!! "Use the default message 'SUBSCRIBE for reg-event package' in annex A.1.4 or + !!!! 'SUBSCRIBE for conference event package' in annex A.5.1 or + !!!! 'SUBSCRIBE for message-summary event package' in annex A.6.1 with the following exceptions ..." + !!!! => at least for reg-event package and message-summary event package this does not work as there will be a To-tag. + !!!! Furthermore it should be clearly specified up to which degree the SUBSCRIBE shall be checked + !!!! => for now we keep it simple but check for the To-tag to be absent to force a fail */ + var template (present) MessageHeader v_MessageHeader_Subscribe := cr_MessageHeader_Dummy; + var template (present) integer v_CSeqValue := f_IMS_RequestInDialog_CSeqValueRX(dialogRemote, p_DialogIndex); + var EventType v_EventType; + + select (p_DialogIndex) { + case (confEventDialog) { v_EventType := "conference"; } + case (regEventDialog) { v_EventType := "reg"; } + case (msgSummayDialog) { v_EventType := "message-summary"; } + case else { FatalError(__FILE__, __LINE__, "invalid dialog"); } + } + + v_MessageHeader_Subscribe.cSeq := cr_CseqDef(v_CSeqValue, "SUBSCRIBE"); + v_MessageHeader_Subscribe.fromField := f_IMS_RequestInDialog_FromHeaderRX(); // !!!! PROSE ISSUE !!!! + v_MessageHeader_Subscribe.toField := f_IMS_RequestInDialog_ToHeaderRX(); // !!!! PROSE ISSUE !!!! + v_MessageHeader_Subscribe.callId := f_IMS_PTC_ImsInfo_DialogGetCallId(); // !!!! PROSE ISSUE !!!! + v_MessageHeader_Subscribe.sessionId := f_IMS_PTC_ImsInfo_DialogGetSessionId(); // !!!! PROSE ISSUE !!!! + v_MessageHeader_Subscribe.expires := cr_Expires("0"); + v_MessageHeader_Subscribe.event := cr_EventDef(v_EventType); + + return v_MessageHeader_Subscribe; + } + + /* + * @desc Notfiy the UE of being unsubscribed + * @param p_DialogIndex + * @param p_SubscribeRequest + * @return template (value) MessageHeader + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_NotifyRequest_MessageHeader_C30(IMS_PTC_DialogIndex_Type p_DialogIndex, + SUBSCRIBE_Request p_SubscribeRequest) runs on IMS_PTC return template (value) MessageHeader + { + var charstring v_NW_AddrStr := f_IMS_PTC_NW_Address_GetAddrStr(); + var CharStringList_Type v_ViaAddressList := {v_NW_AddrStr, px_IMS_Scscf}; + var template (value) SubscriptionState v_SubscriptionState := cs_SubscriptionState_Terminated; + var template (omit) ContentType v_ContentType := omit; + var template (value) SipUrl v_ContactSipUrl; + var template (value) Via v_Via; + var EventType v_EventType; + + select (p_DialogIndex) { + case (regEventDialog) { // A3 + v_EventType := "reg"; + v_ContactSipUrl := cs_SipUri_HostPort(px_IMS_Scscf); + } + case (confEventDialog) { // A4 + v_EventType := "conference"; + v_ContactSipUrl := p_SubscribeRequest.requestLine.requestUri; /* the UE shall use the FinalConferenceUri in the request line of the SUBSCRIBE message */ + } + case (msgSummayDialog) { // A5 + v_EventType := "message-summary"; + // v_ViaAddressList[lengthof(v_ViaAddressList)] := f_IMS_PTC_ImsInfo_GetHomeDomainName(); !!!! PROSE ISSUE: acc. to A.6.2 the via header for message-summary has 3 entries !!!! + v_ContactSipUrl := cs_SipUri_HostPort(px_IMS_Scscf); + } + case else { + FatalError(__FILE__, __LINE__, "invalid dialog"); + } + } + v_Via := f_IMS_NotifyRequest_ViaTX(v_ViaAddressList); + + return f_IMS_NotifyRequest_MessageHeader_Common(p_DialogIndex, v_Via, v_ContactSipUrl, v_EventType, v_SubscriptionState, v_ContentType); + } + + /* + * @desc to let the UE unsubscribe from event package before de-registration + * @param p_DialogIndex + * @param p_Protocol + * @param p_MessageHeader_Notify (by reference) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + altstep a_IMS_Deregister_Unsubcribe(IMS_PTC_DialogIndex_Type p_DialogIndex, + InternetProtocol_Type p_Protocol, + out template (value) MessageHeader p_MessageHeader_Notify) runs on IMS_PTC + { + var template (present) SipUrl v_SubscribeRequestUri := ?; /* @sic R5s150647 sic@ */ + var template (present) MessageHeader v_MessageHeader_Subscribe := f_IMS_SubscribeRequest_MessageHeaderRX_C30(p_DialogIndex); + var template (value) MessageHeader v_MessageHeader_Notify; + var IMS_DATA_REQ v_IMS_SUBSCRIBE_REQ; + var SUBSCRIBE_Request v_SubscribeRequest; + var SipUrl v_ContactUrl; + + [] IMS_Server.receive(car_IMS_Subscribe_Request(cr_SUBSCRIBE_Request(v_SubscribeRequestUri, v_MessageHeader_Subscribe))) /* @sic R5s150647 sic@ */ + -> value v_IMS_SUBSCRIBE_REQ + { + v_SubscribeRequest := v_IMS_SUBSCRIBE_REQ.Request.Subscribe; + f_IMS_MessageHeader_CheckTo(v_SubscribeRequest.msgHeader, noToTag); /* !!!! PROSE ISSUE: + !!!! acc. to R5-153756 the SUBSCRIBE shall be as e.g. in A.1.4 + !!!! => it shall not have a To-tag what seems to be wrong */ + f_IMS_SUBSCRIBE_Response(p_DialogIndex, v_IMS_SUBSCRIBE_REQ, "0"); + v_MessageHeader_Notify := f_IMS_NotifyRequest_MessageHeader_C30(p_DialogIndex, v_SubscribeRequest); + v_ContactUrl := f_MessageHeader_GetContactSipUrl(v_SubscribeRequest.msgHeader); + IMS_Client.send(cas_IMS_Notify_Request(cs_IMS_RoutingInfo(p_Protocol), cs_NOTIFY_Request(v_ContactUrl, v_MessageHeader_Notify))); + p_MessageHeader_Notify := v_MessageHeader_Notify; + } + } + + //---------------------------------------------------------------------------- + /* + * @desc handle optional de-registration + * @param p_Port + * @param p_AllowRetransmission (default value: false) + * @param p_WaitForDeRegistration (default value: true) + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_IpcanReleaseWithOptionalDeregistrationOnAnyPTC(IMS_IPCAN_CO_ORD_PORT p_Port, + boolean p_AllowRetransmission := false, + boolean p_WaitForDeRegistration := true) runs on IMS_PTC return boolean + { /* @sic R5s140710 - MCC160 Implementation: parameter p_AllowRetransmission sic@ */ + var IMS_DATA_REQ v_IMS_REGISTER_REQ; + var template (present) SipUrl v_SipUrl := cr_SipUri_HostPort(f_IMS_PTC_ImsInfo_GetHomeDomainName()); + var InternetProtocol_Type v_ProtocolForRequestInDL := f_IMS_PTC_ImsInfo_GetTransportProtocol(); + var boolean v_WaitForDeRegistration := p_WaitForDeRegistration; + var boolean v_WaitForUnsubscribe_RegEvent := f_IMS_PTC_ImsInfo_DialogIsStarted(regEventDialog); /* @sic R5-153756 sic@ */ + var boolean v_WaitForUnsubscribe_MsgSummary := f_IMS_PTC_ImsInfo_DialogIsStarted(msgSummayDialog); /* @sic R5-153756 sic@ */ + var boolean v_WaitForUnsubscribe_ConfEvent := f_IMS_PTC_ImsInfo_DialogIsStarted(confEventDialog); /* @sic R5-153756 sic@ */ + var template (value) MessageHeader v_MessageHeader_Notify_ByRef; + + var default v_RetransmissionHandler := null; + var default v_NotifyResponseHandler_RegEvent := null; /* @sic R5-153756 sic@ */ + var default v_NotifyResponseHandler_ConfEvent := null; /* @sic R5-153756 sic@ */ + var default v_NotifyResponseHandler_MsgSummary := null; /* @sic R5-153756 sic@ */ + + alt { // @sic R5-141113: de-registration is not mandatory sic@ + [v_WaitForDeRegistration and v_WaitForUnsubscribe_RegEvent] a_IMS_Deregister_Unsubcribe(regEventDialog, v_ProtocolForRequestInDL, v_MessageHeader_Notify_ByRef) /* @sic R5-153756 sic@ */ + { + v_NotifyResponseHandler_RegEvent := activate(a_IMS_ReceiveResponse200OK(v_MessageHeader_Notify_ByRef, v_ProtocolForRequestInDL)); + v_WaitForUnsubscribe_RegEvent := false; + repeat; + } + [v_WaitForDeRegistration and v_WaitForUnsubscribe_ConfEvent] a_IMS_Deregister_Unsubcribe(confEventDialog, v_ProtocolForRequestInDL, v_MessageHeader_Notify_ByRef) /* @sic R5-153756 sic@ */ + { + v_NotifyResponseHandler_ConfEvent := activate(a_IMS_ReceiveResponse200OK(v_MessageHeader_Notify_ByRef, v_ProtocolForRequestInDL)); + v_WaitForUnsubscribe_ConfEvent := false; + repeat; + } + [v_WaitForDeRegistration and v_WaitForUnsubscribe_MsgSummary] a_IMS_Deregister_Unsubcribe(msgSummayDialog, v_ProtocolForRequestInDL, v_MessageHeader_Notify_ByRef) /* @sic R5-153756 sic@ */ + { + v_NotifyResponseHandler_MsgSummary := activate(a_IMS_ReceiveResponse200OK(v_MessageHeader_Notify_ByRef, v_ProtocolForRequestInDL)); + v_WaitForUnsubscribe_MsgSummary := false; + repeat; + } + [v_WaitForDeRegistration] IMS_Server.receive(car_IMS_Register_Request(cr_REGISTER_Request(v_SipUrl))) + -> value v_IMS_REGISTER_REQ + { + if (p_AllowRetransmission) { + v_RetransmissionHandler := activate(a_IMS_RetransmissionHandler(v_IMS_REGISTER_REQ)); /* when re-transmissions are allowed they may colide with f_Delay in f_IMS_TCP_CloseHandling + or with the confirmation in f_IMS_CloseTCP (if any); */ + } + deactivate(v_NotifyResponseHandler_RegEvent); + deactivate(v_NotifyResponseHandler_MsgSummary); + deactivate(v_NotifyResponseHandler_ConfEvent); + f_IMS_PTC_Deregistration(v_IMS_REGISTER_REQ); + v_WaitForDeRegistration := false; + repeat; /* @sic R5s140175 sic@ */ + } + [] p_Port.receive(cmr_IMS_IPCAN_Trigger) // @sic R5-142919 sic@ + { + } + } + deactivate(v_RetransmissionHandler); + return not v_WaitForDeRegistration; // @sic R5-154047 sic@ + } + + /* + * @desc handle optional de-registration + * @param p_WaitForDeRegistration (default value: true) + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_IpcanReleaseWithOptionalDeregistration(boolean p_WaitForDeRegistration := true) runs on IMS_PTC return boolean + { + return f_IMS_IpcanReleaseWithOptionalDeregistrationOnAnyPTC(IPCAN, -, p_WaitForDeRegistration); // @sic R5-154047 sic@ + } + + /* + * @desc handle optional de-registration on "other RAT" + * @param p_WaitForDeRegistration (default value: true) + * @return boolean + * @status APPROVED (IMS_IRAT, LTE_A, LTE_IRAT) + */ + function f_IMS_IpcanReleaseWithOptionalDeregistrationOtherIPCAN(boolean p_WaitForDeRegistration := true) runs on IMS_PTC return boolean + { + var boolean v_AllowRetransmission := true; + return f_IMS_IpcanReleaseWithOptionalDeregistrationOnAnyPTC(OtherIPCAN, v_AllowRetransmission, p_WaitForDeRegistration); // @sic R5-154047 sic@ + } + + + } // group + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_Procedures_Video.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_Procedures_Video.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..52fa637184fce8938f9ddefd53959383e4d39d81 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_Procedures_Video.ttcn @@ -0,0 +1,248 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-08 19:13:26 +0200 (Tue, 08 Sep 2015) $ +// $Rev: 14241 $ +/******************************************************************************/ + +module IMS_Procedures_Video { + import from LibSip_Common all; + import from LibSip_SDPTypes all; + import from LibSip_SIPTypesAndValues all; + import from IMS_Component all; + import from IMS_SDP_Templates all; + import from IMS_SDP_Messages all; + import from IMS_SDP_MessagesVideo all; + import from IMS_MessageBody_Templates all; + import from IMS_ASP_TypeDefs all; + import from IMS_ASP_Templates all; + import from IMS_SIP_Templates all; + import from IMS_CommonFunctions all; + import from IMS_Procedures_CallControl all; + import from IMS_CommonParameters all; + + //============================================================================ + /* + * @desc Check whether media description contains valid attributes for tcap and pcfg + * @param p_SDP_Media_Desc + * @status APPROVED (IMS) + */ + function f_IMS_SDP_CheckMediaDescr_TcapPcfg(SDP_media_desc p_SDP_Media_Desc) runs on IMS_PTC + { + var template (omit) SDP_attribute v_Attribute; + if (fl_IMS_Video_TcapPcfgRequired(p_SDP_Media_Desc)) { + v_Attribute := f_SDP_AttributeList_GetAttribute(p_SDP_Media_Desc.attributes, cr_SDP_Attribute_tcap(1, c_rtpAvpf)); + if (not isvalue (v_Attribute)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "missing tcap attribute"); + } + v_Attribute := f_SDP_AttributeList_GetAttribute (p_SDP_Media_Desc.attributes, cr_SDP_Attribute_pcfg(1, "t=1")); + if (not isvalue (v_Attribute)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "missing pcfg attribute"); + } + } + } + //============================================================================ + // Video - MO Call setup + //---------------------------------------------------------------------------- + /* + * @desc Step 2 of C.25 or test case 17.1 + * @param p_VideoCallType + * @param p_OtherCalleeUri (default value: omit) + * @return IMS_InviteRequestWithSdp_Type + * @status APPROVED (IMS) + */ + function f_IMS_MOCallSetup_Video_Step2(VideoCallTypeMO_Type p_VideoCallType, + template SipUrl p_OtherCalleeUri := omit) runs on IMS_PTC return IMS_InviteRequestWithSdp_Type + { /* @sic R5w140112: return type changed to IMS_InviteRequestWithSdp_Type to carry decoded SDP offer */ + /* @sic R5s150204: p_OtherCalleeUri charstring -> SipUrl sic@ */ + var template (present) SDP_Message v_SDP_Message_Step2; + var INVITE_A_2_1_Context_Type v_Context; + var IMS_DATA_REQ v_IMS_INVITE_REQ; + var SDP_Message v_SDP_Message; + var boolean v_A11 := pc_IMS_Video_FeatureTag; + var boolean v_A12 := false; // as we have video but not voice + + select (p_VideoCallType) { + case (C25) { + v_SDP_Message_Step2 := f_IMS_BuildSDP_AnnexC25_Step2(); + v_Context := A_2_1_A4; + } + case (AddVideo) { + v_SDP_Message_Step2 := f_IMS_BuildSDP_AddVideoMO_Step2(); + v_Context := A_2_1_A5; + } + } + + // Step 2. Receive INVITE Request + v_IMS_INVITE_REQ := f_IMS_INVITE_ReceiveRequest(v_Context, tsc_OptionTagList_precondition, p_OtherCalleeUri, -, -, -, v_A11, v_A12); /* @sic R5s150180: p_A10 removed sic@ */ + v_SDP_Message := f_IMS_SIP_SdpMessageBody_DecodeMatchAndCheckSDP(v_IMS_INVITE_REQ.Request.Invite.messageBody, v_SDP_Message_Step2); + + // check media description: + f_IMS_SDP_CheckMediaDescr_AMR_8000_1(v_SDP_Message.media_list[0]); + f_IMS_SDP_CheckMediaDescr_H264_90000(v_SDP_Message.media_list[1]); + f_IMS_SDP_CheckMediaDescr_TcapPcfg(v_SDP_Message.media_list[1]); + + return f_IMS_InviteRequestWithSdpMO(v_IMS_INVITE_REQ, v_SDP_Message); + } + + //---------------------------------------------------------------------------- + /* + * @desc Steps 3..4 of C.25 or test case 17.1 + * @param p_VideoCallType + * @param p_InviteRequestWithSdp + * @param p_ContactUri (default value: px_IMS_CalleeContactUri) + * @param p_AditionalContactParams (default value: omit) + * @return MessageHeader + * @status APPROVED (IMS) + */ + function f_IMS_MOCallSetup_Video_Step3_4(VideoCallTypeMO_Type p_VideoCallType, + IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + charstring p_ContactUri := px_IMS_CalleeContactUri, + template (omit) SemicolonParam_List p_AditionalContactParams := omit) runs on IMS_PTC return MessageHeader + { /* return MessageHeader of the 183 response */ + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(p_InviteRequestWithSdp.RoutingInfo); + var INVITE_Request v_InviteRequest := p_InviteRequestWithSdp.Invite; + var SDP_Message v_SDP_MessageStep2 := p_InviteRequestWithSdp.SdpOffer; + var SDP_media_desc v_SDP_Media_AudioRx := v_SDP_MessageStep2.media_list[0]; + var SDP_media_desc v_SDP_Media_VideoRx := v_SDP_MessageStep2.media_list[1]; + var template (value) SDP_Message v_SDP_MessageStep4 := f_IMS_BuildSDP_MOCallAudioVideo_Step4(p_VideoCallType, v_SDP_Media_AudioRx, v_SDP_Media_VideoRx); + var template (value) MessageHeader v_MessageHeader_Response183; + + // Step 3. SS sends a 100 Trying provisional response. + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine100, f_IMS_InviteResponse_100_MessageHeaderTX(v_InviteRequest)))); + + // Step 4. Send 183 Session In Progress. + + select (p_VideoCallType) { + case (C25) { + v_MessageHeader_Response183 := f_IMS_InviteResponse_183_MessageHeaderTX(v_InviteRequest, tsc_OptionTagList_precondition, p_ContactUri, p_AditionalContactParams); /* @sic R5-142951 sic@ */ + } + case (AddVideo) { + v_MessageHeader_Response183 := f_IMS_InviteResponse_183_MessageHeaderTX(v_InviteRequest, -, p_ContactUri, p_AditionalContactParams); + v_MessageHeader_Response183.supported := cs_Supported(tsc_OptionTagList_precondition); + } + } + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine183, v_MessageHeader_Response183, cs_MessageBody_SDP(v_SDP_MessageStep4)))); + + return valueof(v_MessageHeader_Response183); + } + + /* + * @desc steps 5-8 of video call setup procedure acc. to C.25 + * @param p_VideoCallType + * @param p_InviteRequestWithSdp + * @param p_MessageHeader_Prev183Response + * @return SDP_Message + * @status APPROVED (IMS) + */ + function f_IMS_MOCallSetup_Video_Steps5_8(VideoCallTypeMO_Type p_VideoCallType, + IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + template (value) MessageHeader p_MessageHeader_Prev183Response) + runs on IMS_PTC return SDP_Message + { + var SDP_Message v_SDP_LatestOffer; + var SDP_Message v_SDP_Offer := p_InviteRequestWithSdp.SdpOffer; + var template (present) SDP_Message v_SDP_Message_Step5or7 := f_IMS_BuildSDP_MOCallAudioVideo_Step5or7(p_VideoCallType, v_SDP_Offer); + + v_SDP_LatestOffer := f_IMS_MOCallSetup_AnnexC21C25_Steps5_8(p_InviteRequestWithSdp, p_MessageHeader_Prev183Response, -, v_SDP_Message_Step5or7); + return v_SDP_LatestOffer; + } + + //============================================================================ + // Annex C25 - Steps + //---------------------------------------------------------------------------- + /* + * @desc steps 5..13 of C.25 + * @param p_InviteRequestWithSdp + * @param p_MessageHeader_Prev183Response + * @param p_ContactUri (default value: px_IMS_CalleeContactUri) + * @return SDP_Message + * @status APPROVED (IMS) + */ + function f_IMS_MOCallSetup_AnnexC25_Steps5_13(IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + MessageHeader p_MessageHeader_Prev183Response, + charstring p_ContactUri := px_IMS_CalleeContactUri) + runs on IMS_PTC return SDP_Message + { + var SDP_Message v_SDP_LatestOffer; + var boolean v_SrvccAlerting := false; /* as we have no voice call */ + + v_SDP_LatestOffer := f_IMS_MOCallSetup_Video_Steps5_8(C25, p_InviteRequestWithSdp, p_MessageHeader_Prev183Response); + f_IMS_MOCallSetup_AnnexC21C25_Step9_11(p_InviteRequestWithSdp, p_ContactUri, v_SrvccAlerting); + f_IMS_MOCallSetup_AnnexC21C25_Step12_13(p_InviteRequestWithSdp, p_ContactUri); + return v_SDP_LatestOffer; + } + + //============================================================================ + // Video - MT Call setup + //---------------------------------------------------------------------------- + /* + * @desc send INVITE for MT video call + * @param p_VideoCallType + * @param p_MessageType + * @param p_FmtAudio + * @param p_FmtVideo + * @param p_ContactUrl (default value: omit) + * @return IMS_InviteRequestWithSdp_Type + * @status APPROVED (IMS) + */ + function f_IMS_MTCallSetup_Video_SendInvite(VideoCallTypeMT_Type p_VideoCallType, + VideoCallMT_MessageTX_Type p_MessageType, + charstring p_FmtAudio, + charstring p_FmtVideo, + template (omit) SipUrl p_ContactUrl := omit) runs on IMS_PTC return IMS_InviteRequestWithSdp_Type + { + var boolean v_SrvccAlerting := false; + var SipUrl v_ContactUrl; + var template (value) SDP_Message v_SDP_Message_Invite; + var template (value) MessageHeader v_MessageHeader_Invite; + var template (value) INVITE_Request v_InviteRequest; + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var INVITE_A_2_1_Context_Type v_Context := A_2_1_A4; + + select (p_VideoCallType) { + case (C26) { v_Context := A_2_1_A4; } + case else { v_Context := A_2_1_A5; } + } + if (isvalue(p_ContactUrl)) { + v_ContactUrl := valueof(p_ContactUrl); + } else { + v_ContactUrl := f_IMS_PTC_ImsInfo_GetContactUrl(); + } + + v_SDP_Message_Invite := f_IMS_BuildSDP_MTCallAudioVideo_TX(p_VideoCallType, p_MessageType, p_FmtAudio, p_FmtVideo); + v_MessageHeader_Invite := f_IMS_InviteRequest_MessageHeaderTX(tsc_OptionTagList_precondition, v_Context, v_SrvccAlerting); + v_InviteRequest := cs_INVITE_Request(v_ContactUrl, v_MessageHeader_Invite, cs_MessageBody_SDP(v_SDP_Message_Invite)); + v_InviteRequestWithSdp := f_IMS_InviteRequestWithSdpMT(v_InviteRequest, v_SDP_Message_Invite); + + // Step 1 - Send INVITE + IMS_Client.send(cas_IMS_Invite_Request(v_InviteRequestWithSdp.RoutingInfo, v_InviteRequest)); + + return v_InviteRequestWithSdp; + } + + /* + * @desc return SessionInProgress183 and its SDP message received in step 4 (C.26) or step 3 (17.2) + * @param p_VideoCallType + * @param p_InviteRequestWithSdp + * @param p_FmtAudio + * @param p_FmtVideo + * @return IMS_ResponseWithSdp_Type + * @status APPROVED (IMS) + */ + function f_IMS_MTCallSetup_Video_Receive183(VideoCallTypeMT_Type p_VideoCallType, + IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + charstring p_FmtAudio, + charstring p_FmtVideo) runs on IMS_PTC return IMS_ResponseWithSdp_Type + { + var INVITE_Request v_InviteRequest := p_InviteRequestWithSdp.Invite; + var template (present) SDP_Message v_SDP_Message183 := f_IMS_BuildSDP_MTCallAudioVideo_RX(p_VideoCallType, Response183, p_FmtAudio, p_FmtVideo); + + return f_IMS_MTCallSetup_Common_Steps3_4(v_InviteRequest, v_SDP_Message183, p_InviteRequestWithSdp.RoutingInfo.Protocol); + } + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_SDP_Messages.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_SDP_Messages.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..44e1af775ccf3a7afca368d6841bdacb1e4319b7 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_SDP_Messages.ttcn @@ -0,0 +1,782 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-16 20:33:09 +0200 (Wed, 16 Sep 2015) $ +// $Rev: 14474 $ +/******************************************************************************/ + +module IMS_SDP_Messages { + import from LibSip_SDPTypes all; + import from IMS_CommonDefs all; + import from IMS_Component all; + import from CommonDefs all; + import from IMS_SDP_Templates all; + import from IMS_CommonTemplates all; + import from IMS_CommonParameters all; + import from LibSip_MessageBodyTypes all; + + type enumerated SDP_Message_Check_Type {asPreviousSDP, newSDP}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + + /* + * @desc Wrapper function to encode SDP message + * @param p_SDP_Message + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + + function f_IMS_SDP_Message_Encode(template (value) SDP_Message p_SDP_Message) return charstring + { + var bitstring v_BitStr := encvalue(p_SDP_Message); + return oct2char(bit2oct(v_BitStr)); + } + + /* + * @desc Wrapper function to decode SDP message and to assign fail verdict in case of syntactically wrong SDP message + * @param p_SdpBody + * @return SDP_Message + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function fl_IMS_SDP_Message_Decode(SdpBody p_SdpBody) runs on IMS_PTC return SDP_Message + { + var SDP_Message v_SDP_Message; + var bitstring v_BitStr := oct2bit(char2oct(p_SdpBody)); + var integer v_Result := decvalue(v_BitStr, v_SDP_Message); + + if (v_Result != 0) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Invalid SDP message"); + } + return v_SDP_Message; + } + + /* + * @desc check that 'Connections' is included either at the top level or in the media description(s) or in both + * @param p_SDP_Message + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_SDP_CheckConnections(SDP_Message p_SDP_Message) runs on IMS_PTC + { + var boolean v_ConnectionFound := false; + var integer i; + + if (ispresent(p_SDP_Message.connection)) { + v_ConnectionFound := true; + } + + if (not v_ConnectionFound) { + // no connection specified in session description => there shall be at least one connection per media description + v_ConnectionFound := true; + for (i := 0; i < lengthof(p_SDP_Message.media_list); i := i + 1) { + if (not ispresent(p_SDP_Message.media_list[i].connections)) { // @sic R5s130586 change 12 sic@ + v_ConnectionFound := false; + break; + } + } + } + + if (not v_ConnectionFound) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "'Connections found neither in session description nor in media description"); + } + } + + /* + * @desc Wrapper function to decode and match SDP message + * @param p_SdpBody + * @param p_SDP_Message_Template + * @param p_SdpCheck (default value: newSDP) + * @param p_CheckConnections (default value: true) + * @return SDP_Message + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_SIP_DecodeMatchAndCheckSDP(template (omit) SdpBody p_SdpBody, + template SDP_Message p_SDP_Message_Template, + SDP_Message_Check_Type p_SdpCheck := newSDP, + boolean p_CheckConnections := true) runs on IMS_PTC return SDP_Message + { /* @sic R5-150702: generic check of origin sic@ */ + var SDP_Message v_SDP_Message; + var template (omit) SDP_Message v_PrevSdpMessage; + var integer v_CurrSessionVersion; + var integer v_PrevSessionVersion; + var template SDP_Origin v_ExpectedOrigin := *; + + if (not ispresent(p_SdpBody)) { /* there is no SDP message */ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Missing sdpMessageBody"); + } + else { /* => MessageBody is present and contains an SDP message */ + v_SDP_Message := fl_IMS_SDP_Message_Decode(valueof(p_SdpBody)); + if (not match(v_SDP_Message, p_SDP_Message_Template)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "received sdpMessageBody does not match"); + } + + /* @sic R5-150702: sic@ */ + v_PrevSdpMessage := f_IMS_PTC_ImsInfo_DialogGetPrevSdpMessageRX(); + select (p_SdpCheck) { /* @sic R5-150702 sic@ */ + case (asPreviousSDP) { /* current SDP shall be identically as previous SDP (i.e. even the session version has to be the same) */ + if (not match(v_SDP_Message, v_PrevSdpMessage)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "received SDP message is different than previous one"); + } + } + case (newSDP) { + if (p_CheckConnections) { // check at least one connections field is sent + f_IMS_SDP_CheckConnections(v_SDP_Message); + } + if (ispresent(v_PrevSdpMessage)) { + if (not match(v_SDP_Message, v_PrevSdpMessage)) { /* @sic R5s150497: SDP may be the same as previous SDP sic@ + NOTE: whether or not it shall be allowed to have the same SDP depends on the given template */ + v_CurrSessionVersion := str2int(v_SDP_Message.origin.session_version); + v_PrevSessionVersion := str2int(valueof(v_PrevSdpMessage.origin.session_version)); + v_ExpectedOrigin := v_PrevSdpMessage.origin; + v_ExpectedOrigin.session_version := int2str(v_PrevSessionVersion + 1); + + if (not match(v_SDP_Message.origin, v_ExpectedOrigin)) { /* @sic R5-143201, R5-151684 sic@ */ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "session version not incremented or o-line changed"); + } + } + } + f_IMS_PTC_ImsInfo_DialogSetPrevSdpMessageRX(v_SDP_Message); + } + } + } + return v_SDP_Message; + } + + /* + * @desc wrapper function to decode and match optional SDP message + * @param p_MessageBody + * @param p_SDP_Message_Template + * @return template (omit) SDP_Message + * @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_SIP_SdpMessageBody_DecodeMatchAndCheckSDP_Ifpresent(template (omit) MessageBody p_MessageBody, + template SDP_Message p_SDP_Message_Template) runs on IMS_PTC return template (omit) SDP_Message + { + var template (omit) SdpBody v_SdpBody := omit; + var SDP_Message v_SDP_Message; + + if (ischosen(p_MessageBody.sdpMessageBody)) { /* there is an SDP message */ + v_SdpBody := p_MessageBody.sdpMessageBody; + } + if (not ispresent(v_SdpBody) and not ispresent(p_SDP_Message_Template)) { /* NOTE: + not ispresent(p_SDP_Message_Template) does not mean that p_SDP_Message_Template is omit + but p_SDP_Message_Template can be e.g. "cr_SomeSDP ifpresent" + nevertheless when we have "not ispresent(p_SDP_Message_Template)" the SDP message may be omitted */ + return omit; + } else { + v_SDP_Message := f_IMS_SIP_DecodeMatchAndCheckSDP(v_SdpBody, p_SDP_Message_Template); + return v_SDP_Message; + } + } + + /* + * @desc wrapper function to decode and match SDP message + * @param p_MessageBody + * @param p_SDP_Message_Template + * @return SDP_Message + * @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_SIP_SdpMessageBody_DecodeMatchAndCheckSDP(template (omit) MessageBody p_MessageBody, + template (present) SDP_Message p_SDP_Message_Template) runs on IMS_PTC return SDP_Message + { + var template (omit) SDP_Message v_SDP_Message := f_IMS_SIP_SdpMessageBody_DecodeMatchAndCheckSDP_Ifpresent(p_MessageBody, p_SDP_Message_Template); + return valueof(v_SDP_Message); + } + + //============================================================================ + // Common functions + //---------------------------------------------------------------------------- + /* + * @desc build SDP message to be sent as response to an offer e.g. at the end of C.21 or C.8 + * the function does + * "IP address on "c=" lines and transport port on "m=" lines changed to indicate to which IP address and port the UE should send the media" + * "o-line as in preceding SDP sent by SS, but with sess-version being incremented" + * @param p_SDP_Message_PrevOffer + * @param p_SessionVersion (default value: omit) + * @return template (value) SDP_Message + * @status APPROVED (IMS, LTE, LTE_A) + */ + function f_IMS_BuildSDP_CommonResponseToOfferTX(SDP_Message p_SDP_Message_PrevOffer, + template (omit) charstring p_SessionVersion := omit) runs on IMS_PTC return template (value) SDP_Message + { + var integer i; + var charstring v_AddrType := f_IMS_PTC_NW_Address_GetTypeStr(); + var charstring v_IPAddrOrigin := f_IMS_PTC_RemoteAddress_GetAddrStr(); + var IntegerList_Type v_IMS_MediaPortList := {tsc_IMS_MediaPort_M1, tsc_IMS_MediaPort_M2, tsc_IMS_MediaPort_M3}; + var template (value) SDP_Message v_SDP_Message := p_SDP_Message_PrevOffer; + var template (value) SDP_media_desc_list v_Media_Desc_List := p_SDP_Message_PrevOffer.media_list; + var template (value) SDP_connection v_SDP_Connection := cs_SDP_Connection(v_AddrType, v_IPAddrOrigin); + var template (value) SDP_media_desc v_SDP_Media_Desc; + var charstring v_SessionVersion; + var charstring v_SessionId := f_IMS_PTC_ImsInfo_DialogGetSessIdTX(); /* @sic R5-150707 sic@ */ + + if (ispresent(p_SessionVersion)) { + v_SessionVersion := valueof(p_SessionVersion); + } else { + v_SessionVersion := f_IMS_PTC_ImsInfo_DialogIncrAndGetSessVersionTX(); + } + + v_SDP_Message.origin := cs_SDP_Origin(v_SessionId, v_SessionVersion, v_AddrType, v_IPAddrOrigin); // @sic R5s141244: "o=" line sic@ + v_SDP_Message.connection := v_SDP_Connection; // IP address on "c=" line + + for (i:=0; i < lengthof(v_Media_Desc_List); i:=i+1) { + v_SDP_Media_Desc := v_Media_Desc_List[i]; + v_SDP_Media_Desc.media_field.ports.port_number := v_IMS_MediaPortList[i]; + v_SDP_Media_Desc.connections := { v_SDP_Connection }; // IP address on "c=" line + v_Media_Desc_List[i] := v_SDP_Media_Desc; + } + v_SDP_Message.media_list := v_Media_Desc_List; + return v_SDP_Message; + } + + /* + * @desc exchange attribute in all media streams of the given media list + * @param p_Media_Desc_List + * @param p_AttributeToBeChanged + * @param p_NewAttribute + * @return template (omit) SDP_media_desc_list + * @status APPROVED (IMS, LTE, LTE_A) + */ + function f_IMS_SDP_MediaList_ExchangeAttribute(template (omit) SDP_media_desc_list p_Media_Desc_List, + template (present) SDP_attribute p_AttributeToBeChanged, + template (value) SDP_attribute p_NewAttribute) return template (omit) SDP_media_desc_list + { + var template (omit) SDP_media_desc_list v_Media_Desc_List := p_Media_Desc_List; + var integer i; + + if (ispresent(p_Media_Desc_List)) { + for (i:=0; i < lengthof(v_Media_Desc_List); i:=i+1) { + v_Media_Desc_List[i].attributes := f_SDP_ExchangeAttribute(v_Media_Desc_List[i].attributes, p_AttributeToBeChanged, p_NewAttribute); + } + } + return v_Media_Desc_List; + } + + //============================================================================ + // Common SDP Messages + //---------------------------------------------------------------------------- + /* + * @desc generic function to build up SDP message + * @param p_TimeDescription (default value: cr_SDP_Time_0_0) + * @param p_SDP_Media_Field + * @param p_SDP_MediaAttributes + * @param p_SDP_PrecondionAttributes + * @param p_MediaBW_AS + * @param p_MediaBW_RS + * @param p_MediaBW_RR + * @return template (present) SDP_Message + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_BuildSDP_RX(template (present) SDP_time p_TimeDescription := cr_SDP_Time_0_0, + template (present) SDP_media_field p_SDP_Media_Field, + template (present) SDP_attribute_list p_SDP_MediaAttributes := {}, + template (present) SDP_attribute_list p_SDP_PrecondionAttributes := {}, + template (present) integer p_MediaBW_AS := ?, + template (present) integer p_MediaBW_RS := ?, + template (present) integer p_MediaBW_RR := ?) runs on IMS_PTC return template (present) SDP_Message + { /* @sic R5s150704, R5s150751 - additional changes: new parameters p_MediaBW_AS, p_MediaBW_RS, p_MediaBW_RR sic@ */ + var charstring v_AddrType := f_IMS_PTC_NW_Address_GetTypeStr(); + var template (present) charstring v_IPAddrOrigin := ?; + var template (present) charstring v_IPAddrConnection := ?; + var template SDP_attribute_list v_SDP_Attribute_List := f_SDP_Attributes_Concat_RX(p_SDP_MediaAttributes, p_SDP_PrecondionAttributes); + var template SDP_bandwidth_list v_Media_Desc_BandwidthList := f_SDP_SDP_Media_Desc_BandwidthList(p_SDP_Media_Field, p_MediaBW_AS, p_MediaBW_RS, p_MediaBW_RR); /* results in * if the stream shall be released (port number == 0) + @sic R5s150704, R5s150751 - additional changes sic@ */ + var template (present) SDP_media_desc v_SDP_Media_Desc; + var template (present) SDP_media_desc_list v_SDP_Media_Desc_List; + + if (lengthof(v_SDP_Attribute_List) > 0) { + v_SDP_Attribute_List := superset(all from v_SDP_Attribute_List); + } else { + v_SDP_Attribute_List := *; + } + + v_SDP_Media_Desc := cr_SDP_Media_Desc(p_SDP_Media_Field, + cr_SDP_Connection(v_AddrType, v_IPAddrConnection), + v_Media_Desc_BandwidthList, + v_SDP_Attribute_List); + v_SDP_Media_Desc_List := { v_SDP_Media_Desc }; + + return cr_SDP_Message_Common(v_AddrType, v_IPAddrOrigin, v_IPAddrConnection, -, p_TimeDescription, v_SDP_Media_Desc_List); + } + + /* + * @desc generic function to build up SDP message + * @param p_Media + * @param p_MediaBandwidth_List + * @param p_SDP_MediaAttributes + * @param p_SDP_PrecondionAttributes + * @param p_SessionBandwidthAS (default value: omit) + * @param p_ConnectionInSessionDesc (default value: true) + * @return template (value) SDP_Message + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_BuildSDP_TX(template (value) SDP_media_field p_Media, + template (omit) SDP_bandwidth_list p_MediaBandwidth_List, + template (omit) SDP_attribute_list p_SDP_MediaAttributes, + template (omit) SDP_attribute_list p_SDP_PrecondionAttributes, + template (omit) integer p_SessionBandwidthAS := omit, + boolean p_ConnectionInSessionDesc := true) runs on IMS_PTC return template (value) SDP_Message + { + var charstring v_SessionId := f_IMS_PTC_ImsInfo_DialogGetSessIdTX(); /* @sic R5-150707 sic@ */ + var charstring v_SessionVersion := f_IMS_PTC_ImsInfo_DialogIncrAndGetSessVersionTX(); + var template (omit) SDP_attribute_list v_SDP_Attribute_List := f_SDP_Attributes_Concat_TX(p_SDP_MediaAttributes, p_SDP_PrecondionAttributes); + var charstring v_AddrType := f_IMS_PTC_NW_Address_GetTypeStr(); + var charstring v_IPAddrConnection := f_IMS_PTC_RemoteAddress_GetAddrStr(); + var charstring v_IPAddrOrigin := v_IPAddrConnection; + var template (omit) SDP_connection v_SDP_Connection := cs_SDP_Connection(v_AddrType, v_IPAddrConnection); + var template (omit) SDP_connection v_SDP_ConnectionInSession := omit; + var template (omit) SDP_connection_list v_SDP_ConnectionListInMedia := omit; + var template (omit) SDP_bandwidth_list v_SessionBandwidthList := omit; + var template (value) SDP_media_desc_list v_SDP_Media_Desc_List; + var integer v_SessionBandwidthAS; + + if (isvalue(p_SessionBandwidthAS)) { + v_SessionBandwidthList := cs_SDP_Bandwidth_List_AS(valueof(p_SessionBandwidthAS)); + } else if (isvalue(p_MediaBandwidth_List)) { /* @sic R5s150704, R5s150751 - Additional changes: p_MediaBandwidth_List may be omit sic@ */ + v_SessionBandwidthAS := f_SDP_BandwidthList_GetBandwidth(valueof(p_MediaBandwidth_List), "AS"); + v_SessionBandwidthList := cs_SDP_Bandwidth_List_AS(v_SessionBandwidthAS); + } + + if (p_ConnectionInSessionDesc) { + v_SDP_ConnectionInSession := v_SDP_Connection; + } else { + v_SDP_ConnectionListInMedia := { v_SDP_Connection }; + } + v_SDP_Media_Desc_List := { cs_SDP_Media_Desc(p_Media, p_MediaBandwidth_List, v_SDP_Attribute_List, v_SDP_ConnectionListInMedia) }; + + return cs_SDP_Message_Common(cs_SDP_Origin(v_SessionId, v_SessionVersion, v_AddrType, v_IPAddrOrigin), /* Session description - o=line */ + v_SDP_ConnectionInSession, /* Session description - c=line */ + v_SessionBandwidthList, /* Session description - b=line */ + -, /* Time description - t=line */ + v_SDP_Media_Desc_List); /* Media description */ + } + + //============================================================================ + // Annex C11 - SDP Messages + //---------------------------------------------------------------------------- + /* + * @desc Build SDP record to be sent to the UE at step 1 according to 34.229-1 Annex C.11 + * @param p_SDP_Message183 (default value: omit) + * @param p_IsC45 (default value: false) + * @return template (value) SDP_Message + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_BuildSDP_AnnexC11_Step1or7(template (omit) SDP_Message p_SDP_Message183 := omit, + boolean p_IsC45:= false) + runs on IMS_PTC + return template (value) SDP_Message + { /* @sic R5s141244: use of f_IMS_BuildSDP_TX sic@ */ + /* @sic R5-153610: "sendrecv" media attribute removed from SDP message for C.11 step 7 sic@ */ + /* @sic R5-153798: p_SDP_Message183 replacing p_SDP_Attribute_curr_qos_remote and p_Step; p_IsC45 sic@ */ + var boolean v_IsUPDATE := isvalue(p_SDP_Message183); /* @sic R5-153798: if there has been a 183 response it must be UPDATE (but not INVITE) sic@ */ + var charstring v_FmtAudio := tsc_SDP_FmtAudio; + var charstring v_FmtEVS := "97"; + var SDP_fmt_list v_FmtList; + var template (value) SDP_bandwidth_list v_MediaBandwidth_List; + var template (omit) SDP_attribute_list v_SDP_MediaAttributes := {}; + var template (omit) SDP_attribute_list v_SDP_PrecondionAttributes; + var charstring v_DirectionRemote := c_none; + var charstring v_DirectionLocal := c_none; + var template (omit) SDP_attribute v_FmtpAttributeEVS; + var charstring v_BrSendVal; + var charstring v_BrRecvVal; + + if (p_IsC45) { /* @sic R5-153798 sic@*/ + v_MediaBandwidth_List := cs_SDP_Bandwidth_List_Media(65, 0, 2000); + + if (not v_IsUPDATE) { /* => INVITE */ + v_FmtList := {v_FmtEVS, "98", "99"}; + f_SDP_Attributes_Concat_TX(v_SDP_MediaAttributes, f_SDP_MediaAttributes_EVS_AudioCommon(v_FmtEVS, cs_EVS_Fmtp_AudioParamsExt)); + f_SDP_Attributes_Concat_TX(v_SDP_MediaAttributes, f_SDP_MediaAttributes_AMR_WB_AudioCommon("98")); + f_SDP_Attributes_Concat_TX(v_SDP_MediaAttributes, f_SDP_MediaAttributes_AudioDef("99")); + } + else { /* => UPDATE */ + v_FmtpAttributeEVS := f_SDP_AttributeList_GetAttribute(p_SDP_Message183.media_list[0].attributes, cr_SDP_Attribute_fmtp(v_FmtEVS)); + v_BrSendVal := f_SIP_SemicolonParamList_GetParamValue(v_FmtpAttributeEVS.fmtp.params.paramList, "br-send"); + v_BrRecvVal := f_SIP_SemicolonParamList_GetParamValue(v_FmtpAttributeEVS.fmtp.params.paramList, "br-recv"); + v_SDP_MediaAttributes := f_SDP_MediaAttributes_EVS_AudioDef(v_FmtEVS, cs_EVS_Fmtp_AudioParamsExt(v_BrSendVal, v_BrRecvVal)); + } + } + else { /* => C.11 */ + v_MediaBandwidth_List := cs_SDP_Bandwidth_List_Media(37, 0, 2500); /* @sic R5-130751; R5-134270: RR=2500; R5-144700: AS=37 sic@ */ + v_FmtList := {v_FmtAudio}; + v_SDP_MediaAttributes := f_SDP_MediaAttributes_AudioDef(v_FmtAudio); /* @sic R5-144693: new function f_SDP_MediaAttributes_AudioDef sic@ */ + } + + v_SDP_MediaAttributes := f_SDP_Attributes_Add_TX(v_SDP_MediaAttributes, cs_SDP_Attribute_sendrecv, v_IsUPDATE); + + + // Pre condition attributes: + if (v_IsUPDATE) { // @sic R5-153798: step 7 (C.11) or step 6 (C.45) + + v_DirectionLocal := c_sendrecv; + + // get curr:qos remote for SDP message in step 7 + if (isvalue(p_SDP_Message183.media_list[0]) and + f_SDP_AttributeList_CheckAttribute(p_SDP_Message183.media_list[0].attributes, cr_SDP_Attribute_curr_qos(c_local, c_none))) { // see C.11 step 7 Note 1 + v_DirectionRemote := c_none; + } else { + v_DirectionRemote := c_sendrecv; + } + } + + v_SDP_PrecondionAttributes := cs_SDP_PrecondionAttributes(v_DirectionLocal, v_DirectionRemote, c_mandatory, c_optional); /* @sic R5-153798: usage of cs_SDP_PrecondionAttributes sic@*/ + + return f_IMS_BuildSDP_TX(cs_SDP_Media_MultiAudio(v_FmtList), v_MediaBandwidth_List, v_SDP_MediaAttributes, v_SDP_PrecondionAttributes); + } + + //---------------------------------------------------------------------------- + /* + * @desc to receive SDP answer sent by the UE in C.11 step 8 (200 OK sent by the SS) or 2nd SDP sent by the UE in C.21 step 5/7 + * @param p_Step + * @param p_IsC45 (default value: false) + * @return template (present) SDP_Message + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_BuildSDP_AnnexC11_Step4or8(charstring p_Step, + boolean p_IsC45:= false) + runs on IMS_PTC return template (present) SDP_Message + { /* @sic R5-123077 change 3: 'inactive' removed from 'Attributes for media' for step 4 sic@ */ + /* @sic R5s150704, R5s150751 - Additional changes: f_IMS_BuildSDP_RX used instead of cr_SDP_Message_Def sic@ */ + /* @sic R5-153798: p_IsC45 sic@ */ + var template (present) SDP_media_field v_SDP_Media_Field := cr_SDP_Media_Audio; + var template (present) SDP_attribute_list v_SDP_PrecondionAttributes; + var template (present) SDP_attribute_list v_SDP_MediaAttributes; + var template (present) SDP_attribute_rtpmap_codec v_RtpmapCodec; + + if (p_IsC45) { /* @sic R5-153798 sic@*/ + v_RtpmapCodec := cr_RTPMAP_EVS_16000; + } else{ + v_RtpmapCodec := cr_RTPMAP_AMR_8000; + } + + v_SDP_MediaAttributes := { + cr_SDP_Attribute_rtpmap(cr_SDP_AnyMediaFormatDescr, v_RtpmapCodec), // @sic R5s130681 change 2 sic@ + cr_SDP_Attribute_fmtp(cr_SDP_AnyMediaFormatDescr) + }; + + select (p_Step) { + case ("step 4") { + v_SDP_PrecondionAttributes := cr_SDP_PrecondionAttributes((c_none, c_sendrecv), c_none, c_mandatory, c_mandatory); // @sic R5s120530 change 3.15 sic@ + v_SDP_PrecondionAttributes := f_SDP_Attributes_Add_RX(v_SDP_PrecondionAttributes, cr_SDP_Attribute_conf_qos); // @sic R5s140204 sic@ + } + case ("step 8") { + /* @sic R5-150709: cr_SDP_Attribute_sendrecv removed sic@ */ + v_SDP_PrecondionAttributes := cr_SDP_PrecondionAttributes(c_sendrecv, c_sendrecv, c_mandatory, c_mandatory); + } + case else { + FatalError(__FILE__, __LINE__, ""); + } + } + return f_IMS_BuildSDP_RX(-, v_SDP_Media_Field, v_SDP_MediaAttributes, v_SDP_PrecondionAttributes); + } + + //============================================================================ + // Annex C21 - SDP Messages + //---------------------------------------------------------------------------- + /* + * @desc return template for SDP message at step 2 according to 34.229-1 Annex C.21 + * @param p_RtcpDuringVoiceSession (default value: pc_IMS_RtcpDuringVoiceSession) + * @param p_PreconditionsRequired (default value: true) + * @return template (present) SDP_Message + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) + */ + function f_IMS_BuildSDP_AnnexC21_Step2(boolean p_RtcpDuringVoiceSession := pc_IMS_RtcpDuringVoiceSession, + boolean p_PreconditionsRequired := true) runs on IMS_PTC return template (present) SDP_Message + { /* @sic R5-135020, R5-135021: new PICS pc_IMS_RtcpDuringVoiceSession sic@ */ + /* @sic R5w140113, R5w140009: new SDP type definitions */ + /* @sic R5s150704, R5s150751 - Additional changes: parameter p_PreconditionsRequired, f_IMS_BuildSDP_RX used instead of cr_SDP_Message_AnySession sic@ */ + var template (present) integer v_BandwidthRS := 0; + var template (present) integer v_BandwidthRR := 0; + var template (present) SDP_attribute_list v_SDP_MediaAttributes := { + cr_SDP_Attribute_rtpmap(-, cr_RTPMAP_AMR_8000), // @sic R5s130681 change 2 sic@ + cr_SDP_Attribute_fmtp(-, cr_AMR_Fmtp_DefaultParameters), /* @sic R5w140113, R5w140009: cr_AMR_Fmtp_DefaultParameters replaces tsc_AMR_Fmtp_DefaultParameters_RX sic@ */ + cr_SDP_Attribute_rtpmap(-, cr_RTPMAP_TelephoneEvent), // @sic R5s130333 change 14.2 - pattern needs to include a rate; R5s130798 change 5 - MCC160 Comment: rate is optional sic@ + cr_SDP_Attribute_ptime, + cr_SDP_Attribute_maxptime + /* @sic R5-150709: cr_SDP_Attribute_inactive removed sic@ */ + }; + var template (present) SDP_attribute_list v_SDP_PrecondionAttributes := {}; + + if (p_PreconditionsRequired) { /* @sic R5s150704, R5s150751 - Additional changes sic@ */ + v_SDP_PrecondionAttributes := cr_SDP_PrecondionAttributes(c_none, c_none, c_mandatory, c_optional); + } + if (p_RtcpDuringVoiceSession) { /* @sic R5-135020 sic@ */ + v_BandwidthRS := ?; + v_BandwidthRR := (1..infinity); + } + return f_IMS_BuildSDP_RX(cr_SDP_Time_Any, cr_SDP_Media_Audio, v_SDP_MediaAttributes, v_SDP_PrecondionAttributes, -, v_BandwidthRS, v_BandwidthRR); + } + + //---------------------------------------------------------------------------- + /* + * @desc return template for SDP message at step 4 according to 34.229-1 Annex C.21 and C.44 + * @param p_SDP_MessageInvite + * @param p_PreconditionsRequired (default value: true) + * @param p_CodecName (default value: "AMR-8000") + * @return template (value) SDP_Message + * @status APPROVED (IMS, LTE, LTE_A) + */ + function f_IMS_BuildSDP_AnnexC21_Step4(SDP_Message p_SDP_MessageInvite, + boolean p_PreconditionsRequired := true, + charstring p_CodecName := "AMR-8000") + runs on IMS_PTC + return template (value) SDP_Message + { /* @sic R5-135020: parameter p_SDP_MessageInvite to get RR and RS values sic@ */ + /* @sic R5-144402: p_IPAddrOrigin removed sic@ */ + /* @sic R5s141244: use of f_IMS_BuildSDP_TX sic@ */ + /* @sic R5-151968: p_IsC44 sic@ */ + /* @sic R5s150704, R5s150751 - Additional changes: p_PreconditionsRequired sic@ */ + /* @sic R5-153999: p_IsC44 renamed to p_CodecName sic@ */ + var integer i; + var template (omit) SDP_attribute v_Attribute; + var SDP_media_desc v_SDP_Media_Invite := p_SDP_MessageInvite.media_list[0]; + var charstring v_FmtAudio; + var integer v_BandwidthRS := f_SDP_BandwidthList_GetBandwidth(v_SDP_Media_Invite.bandwidth, "RS"); + var integer v_BandwidthRR := f_SDP_BandwidthList_GetBandwidth(v_SDP_Media_Invite.bandwidth, "RR"); + var template (value) SDP_bandwidth_list v_Bandwidth_List_Media := cs_SDP_Bandwidth_List_Media(37, v_BandwidthRS, v_BandwidthRR); // @sic R5-123505, R5-135020; R5-144700: AS=37 sic@ + var template (omit) SDP_attribute_list v_SDP_MediaAttributes; + var template (value) SDP_attribute_list v_AdditionalOptionalAttributes; + var template (omit) SDP_attribute_list v_SDP_PrecondionAttributes := omit; + + + select (p_CodecName) { // @sic R5-151968, R5-153999 sic@ + case ("EVS-16000"){ // @sic R5-153999 sic@ + /* !!!! prose acc to R5-153999 says: "All present br, br-send and br-recv parameter=value pairs are copied from step 2" !!!! + !!!! this is missing so far (FFS) !!!! */ + v_FmtAudio := f_SDP_MediaDescr_GetEVS_16000_1(v_SDP_Media_Invite); + v_SDP_MediaAttributes := f_SDP_MediaAttributes_EVS_AudioDef(v_FmtAudio); + } + case ("AMR-WB"){ // @sic R5-153950 sic@ + v_FmtAudio := f_SDP_MediaDescr_GetAMR_16000_1(v_SDP_Media_Invite); + v_SDP_MediaAttributes := f_SDP_MediaAttributes_EVS_AudioDef(v_FmtAudio); + v_Bandwidth_List_Media := cs_SDP_Bandwidth_List_Media(38, v_BandwidthRS, v_BandwidthRR); + } + case ("AMR-8000"){ + v_FmtAudio := f_SDP_MediaDescr_GetAMR_8000_1(v_SDP_Media_Invite); + v_SDP_MediaAttributes := f_SDP_MediaAttributes_AudioDef(v_FmtAudio); /* @sic R5-144693: new function f_SDP_MediaAttributes_AudioDef sic@ */ + } + case else { + FatalError(__FILE__, __LINE__, "") + } + } + if (f_SDP_AttributeList_CheckAttribute(v_SDP_Media_Invite.attributes, cr_SDP_Attribute_inactive)) { /* @sic R5-150694 sic@ */ + v_SDP_MediaAttributes := f_SDP_Attributes_Add_TX(v_SDP_MediaAttributes, cs_SDP_Attribute_inactive); + } + + // additional attributes to be added (using f_SDP_Attributes_Add_TX): + // a=ecn-capable-rtp: leap; ect=0 [Note 3] + // a=rtcp-fb:* nack ecn [Note 3] + // a=rtcp-xr:ecn-sum [Note 3] + // a=3ge2ae: requested [Note 1] + // a=crypto:1 AES_CM_128_HMAC_SHA1_80inline:PS1uQCVeeCFCanVmcjkpPywjNWhcYD0mXXtxaVBR|2^20|1:4 [Note 4] + v_AdditionalOptionalAttributes := { /* @sic R5s140359 - Additional Changes sic@ */ + cs_SDP_Attribute_ecn_capable_rtp("leap", "ect=0"), + cs_SDP_Attribute_rtcp_fb("*", "nack ecn"), + cs_SDP_Attribute_rtcp_xr("ecn-sum"), + cs_SDP_Attribute_3ge2ae("requested"), + cs_SDP_Attribute_crypto("1", "AES_CM_128_HMAC_SHA1_80", "inline:PS1uQCVeeCFCanVmcjkpPywjNWhcYD0mXXtxaVBR|2^20|1:4") + }; + for (i := 0; i < lengthof(v_AdditionalOptionalAttributes); i := i + 1) { + v_Attribute := f_SDP_AttributeList_GetAttribute(p_SDP_MessageInvite.attributes, v_AdditionalOptionalAttributes[i]); + v_SDP_MediaAttributes := f_SDP_Attributes_Add_TX(v_SDP_MediaAttributes, v_Attribute); + } + + if (p_PreconditionsRequired) { /* @sic R5s150704, R5s150751 - Additional changes sic@ */ + v_SDP_PrecondionAttributes := cs_SDP_PrecondionAttributes(c_none, c_none, c_mandatory, c_mandatory); + v_SDP_PrecondionAttributes := f_SDP_Attributes_Add_TX(v_SDP_PrecondionAttributes, cs_SDP_Attribute_conf_qos); // @sic R5s120530 change 3.5 sic@ + } + return f_IMS_BuildSDP_TX(cs_SDP_Media_Audio(v_FmtAudio), v_Bandwidth_List_Media, v_SDP_MediaAttributes, v_SDP_PrecondionAttributes); + } + + //---------------------------------------------------------------------------- + /* + * @desc to receive SDP answer sent by the UE in C.11 step 8 (200 OK sent by the SS) or 2nd SDP sent by the UE in C.21/C.44 step 5/7 + * @param p_SDP_MessageInvite + * @param p_CallHoldC8 (default value: true) + * @param p_IsC44 (default value: true) + * @return template (present) SDP_Message + * @status APPROVED (IMS, LTE, LTE_A) + */ + function f_IMS_BuildSDP_AnnexC21_Step5or7(SDP_Message p_SDP_MessageInvite, + boolean p_CallHoldC8 := false, + boolean p_IsC44 := false) + runs on IMS_PTC + return template (present) SDP_Message + { /* @sic R5-145726: function restructured to allow it to be used by e.g. f_IMS_BuildSDP_AnnexC8_Step1; new parameter p_CallHoldC8 sic@ */ + /* @sic R5-151968 new parameter: p_IsC44 sic@ */ + /* @sic R5-153610: p_SDP_MessageInvite instead of p_Fmt sic@ */ + var SDP_media_desc v_SDP_Media_Invite := p_SDP_MessageInvite.media_list[0]; + var charstring v_Fmt := f_SDP_MediaDescr_GetAMR_8000_1(v_SDP_Media_Invite); // @sic R5-153610 sic@ + var template (present) SDP_media_field v_SDP_Media_Field := cr_SDP_Media_Audio(v_Fmt); + var template (present) SDP_attribute_list v_SDP_MediaAttributes; + var template (present) charstring v_DirectionRemote; + var template (present) SDP_attribute_list v_SDP_PrecondionAttributes; + var template (present) SDP_attribute_rtpmap_codec v_RtpmapAttr; + + if (not p_IsC44) { /* @sic R5-1551968 sic@ */ + v_RtpmapAttr := cr_RTPMAP_AMR_8000; + } + else { + v_RtpmapAttr := cr_RTPMAP_EVS_16000; + } + + v_SDP_MediaAttributes := { + cr_SDP_Attribute_rtpmap(v_Fmt, v_RtpmapAttr), // @sic R5s130681 change 2 sic@ + cr_SDP_Attribute_fmtp(v_Fmt) /* @sic R5s130497 change 2: format parameters added; R5s130586 change 4: format parameters changed back to any parameters sic@ */ + }; + + if (not p_CallHoldC8) { + if (f_SDP_AttributeList_CheckAttribute(v_SDP_Media_Invite.attributes, cr_SDP_Attribute_inactive)) { /* @sic R5-153610 sic@ */ + v_SDP_MediaAttributes := f_SDP_Attributes_Add_RX(v_SDP_MediaAttributes, cr_SDP_Attribute_sendrecv); + } + v_DirectionRemote := c_none; + } else { + v_DirectionRemote := c_sendrecv; + } + v_SDP_PrecondionAttributes := cr_SDP_PrecondionAttributes(c_sendrecv, v_DirectionRemote, c_mandatory, (c_optional, c_mandatory)); + return f_IMS_BuildSDP_RX(-, v_SDP_Media_Field, v_SDP_MediaAttributes, v_SDP_PrecondionAttributes); + } + + //---------------------------------------------------------------------------- + /* + * @desc build SDP message to be sent in step 6 or 8 of 34.229-1 Annex C.21 + * NOTE: function is not specific for C.21 but can be used for C.25 as well + * @param p_SDP_Message_PrevOffer + * @return template (value) SDP_Message + * @status APPROVED (IMS, LTE, LTE_A) + */ + function f_IMS_BuildSDP_AnnexC21C25_Step6or8(SDP_Message p_SDP_Message_PrevOffer) + runs on IMS_PTC + return template (value) SDP_Message + { + var template (value) SDP_Message v_SDP_Message := f_IMS_BuildSDP_CommonResponseToOfferTX(p_SDP_Message_PrevOffer); + + v_SDP_Message.media_list := f_IMS_SDP_MediaList_ExchangeAttribute(v_SDP_Message.media_list, + cs_SDP_Attribute_curr_qos(c_remote, c_none), // value sent by the UE in step 5/7 + cs_SDP_Attribute_curr_qos(c_remote, c_sendrecv)); // ... to be replaced + return v_SDP_Message; + } + + //============================================================================ + // Annex C22 - SDP Messages + //---------------------------------------------------------------------------- + /* + * @desc Build SDP record to be received from the UE at step 1 according to 34.229-1 Annex C.22 + * @return template (present) SDP_Message + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_IRAT) + */ + function f_IMS_BuildSDP_AnnexC22_Step1() runs on IMS_PTC return template (present) SDP_Message + { + var charstring v_AddrType := f_IMS_PTC_NW_Address_GetTypeStr(); + var template (present) charstring v_IPAddrOrigin := ?; + var template (present) charstring v_IPAddrConnection := ?; + var template (present) SDP_media_desc v_SDP_Media_Desc; + var template SDP_bandwidth_list v_Bandwidth := *; + var template SDP_attribute_list v_SDP_Attribute_List := *; //acc. to annex C.22 there shall be at least one AMR codec ("AMR/*" of "AMR-WB/*"); + // this will be checked later-on when the fmt value for the AMR codec is extracted (-> f_IMS_EmergencyCallSetup_AnnexC22, f_SDP_MediaDescr_GetAMR_Any) + v_SDP_Media_Desc := cr_SDP_Media_Desc(cr_SDP_Media_Audio, + cr_SDP_Connection(v_AddrType, v_IPAddrOrigin), + cr_SDP_Bandwidth_List_AS, + v_SDP_Attribute_List); + return cr_SDP_Message_Common(v_AddrType, v_IPAddrOrigin, v_IPAddrConnection, v_Bandwidth, cr_SDP_Time_Any, { v_SDP_Media_Desc }); /* @sic R5s130495 change 21 sic@ */ + } + + //---------------------------------------------------------------------------- + /* + * @desc Build SDP record to be sent to the UE at step 4 according to 34.229-1 Annex C.22 + * NOTE: the "payload type" of the rtpmap attribute and the "format" of the fmtp atribute refer to the format in the media description (RFC 4566) + * => as long as there is only one media description, the fmt, payload type and format have the same value + * @param p_Fmt + * @return template (value) SDP_Message + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_IRAT) + */ + function f_IMS_BuildSDP_AnnexC22_Step4(charstring p_Fmt) runs on IMS_PTC return template (value) SDP_Message + { /* @sic R5s141244: use of f_IMS_BuildSDP_TX; p_IPAddrOrigin removed sic@ */ + var template (value) SDP_bandwidth_list v_Bandwidth_List_Media := cs_SDP_Bandwidth_List_Media(37, 0, 0); /* @sic R5-144700: AS=37 sic@ */ + var template (omit) SDP_attribute_list v_SDP_MediaAttributes := f_SDP_MediaAttributes_AudioDef(p_Fmt); /* @sic R5-144693: new function f_SDP_MediaAttributes_AudioDef sic@ */ + var template (omit) SDP_attribute_list v_SDP_PrecondionAttributes := omit; + + return f_IMS_BuildSDP_TX(cs_SDP_Media_Audio(p_Fmt), v_Bandwidth_List_Media, v_SDP_MediaAttributes, v_SDP_PrecondionAttributes); + } + + //============================================================================ + // Annex C24 - SDP Messages + //---------------------------------------------------------------------------- + /* + * @desc Build SDP message to be received from the UE according to 34.229-1 Annex C.24 step 1 + * @return template (present) SDP_Message + * @status APPROVED (LTE_IRAT) + */ + function f_IMS_BuildSDP_AnnexC24_Step1() runs on IMS_PTC return template (present) SDP_Message + { /* @sic R5s150704, R5s150751 - Additional changes: f_IMS_BuildSDP_RX used instead of cr_SDP_Message_AnySession sic@ */ + var integer v_PortNumber := 0; + return f_IMS_BuildSDP_RX(cr_SDP_Time_Any, cr_SDP_Media_Audio(-, v_PortNumber)); + } + + /* + * @desc Build SDP answer to be sent to the UE according to 34.229-1 Annex C.24 step 3 + * @param p_SDP_Offer + * @return template (value) SDP_Message + * @status APPROVED (LTE_IRAT) + */ + function f_IMS_BuildSDP_AnnexC24_Step3(SDP_Message p_SDP_Offer) runs on IMS_PTC return template (value) SDP_Message + { /* @sic R5s150704, R5s150751 - Additional changes, R5-153755: use of f_IMS_BuildSDP_TX sic@ */ + + var template (omit) SDP_bandwidth_list v_MediaBandwidth_List := omit; + var template (omit) SDP_attribute_list v_SDP_MediaAttributes := omit; + var template (omit) SDP_attribute_list v_SDP_PrecondionAttributes := omit; + var SDP_media_desc v_SDP_Media_Offer := p_SDP_Offer.media_list[0]; + var charstring v_FmtAudio := f_SDP_MediaDescr_GetAMR_8000_1(v_SDP_Media_Offer); + var integer v_LocalPort := 0; + var integer v_SessionBandwidthAS := 37; /* @sic R5s150704, R5s150751 - Additional changes sic@ */ + + return f_IMS_BuildSDP_TX(cs_SDP_Media_Audio(v_FmtAudio, v_LocalPort), v_MediaBandwidth_List, v_SDP_MediaAttributes, v_SDP_PrecondionAttributes, v_SessionBandwidthAS); + } + + //============================================================================ + // Annex C31 - SDP Messages + //---------------------------------------------------------------------------- + /* + * @desc Build SDP record to be sent to the UE at step 1 according to 34.229-1 Annex C.31 + * @return template (present) SDP_Message + * @status APPROVED (LTE_IRAT) + */ + function f_IMS_BuildSDP_AnnexC31_Step1() runs on IMS_PTC return template (present) SDP_Message + { /* @sic R5s150704, R5s150751 - Additional changes: f_IMS_BuildSDP_RX used instead of cr_SDP_Message_AnySession sic@ */ + var template (present) SDP_attribute_list v_SDP_PrecondionAttributes := {}; // precondition attributes: none @sic R5s140263 change 4, R5-142995 sic@ + var template (present) SDP_attribute_list v_SDP_MediaAttributes := { + cr_SDP_Attribute_rtpmap(-, cr_RTPMAP_AMR_8000), + cr_SDP_Attribute_fmtp + // @sic R5-153610: "sendrecv" media attribute removed sic@ + }; + return f_IMS_BuildSDP_RX(cr_SDP_Time_Any, cr_SDP_Media_Audio, v_SDP_MediaAttributes, v_SDP_PrecondionAttributes); + } + + /* + * @desc Build SDP to be sent to the UE at step 3 according to 34.229-1 Annex C.31 + * @param p_SDP_Offer + * @return template (value) SDP_Message + * @status APPROVED (LTE_IRAT) + */ + function f_IMS_BuildSDP_AnnexC31_Step3(SDP_Message p_SDP_Offer) runs on IMS_PTC return template (value) SDP_Message + { /* @sic R5s141244: use of f_IMS_BuildSDP_TX sic@ */ + var SDP_media_desc v_SDP_Media_Offer := p_SDP_Offer.media_list[0]; + var charstring v_FmtAudio := f_SDP_MediaDescr_GetAMR_8000_1(v_SDP_Media_Offer); + var integer v_BandwidthRS := f_SDP_BandwidthList_GetBandwidth(v_SDP_Media_Offer.bandwidth, "RS"); + var integer v_BandwidthRR := f_SDP_BandwidthList_GetBandwidth(v_SDP_Media_Offer.bandwidth, "RR"); + var template (value) SDP_bandwidth_list v_Bandwidth_List_Media := cs_SDP_Bandwidth_List_Media(37, v_BandwidthRS, v_BandwidthRR); /* @sic R5-144700: AS=37 sic@ */ + var template (omit) SDP_attribute_list v_SDP_MediaAttributes := f_SDP_MediaAttributes_AudioCommon(v_FmtAudio); /* @sic R5-144693: new function f_SDP_MediaAttributes_AudioCommon sic@ */ + var template (value) SDP_attribute_list v_SDP_PrecondionAttributes; + + if (f_SDP_AttributeList_CheckAttribute(v_SDP_Media_Offer.attributes, cr_SDP_Attribute_sendrecv)) { /* @sic R5-153610: "sendrecv" only if included in the INVITE too sic@ */ + v_SDP_MediaAttributes := f_SDP_Attributes_Add_TX(v_SDP_MediaAttributes, cs_SDP_Attribute_sendrecv); + } + + v_SDP_PrecondionAttributes := cs_SDP_PrecondionAttributes(c_sendrecv, c_sendrecv, c_mandatory, c_mandatory); /* @sic R5s150704, R5s150751 - Additional changes: cs_SDP_PrecondionAttributes sic@ */ + return f_IMS_BuildSDP_TX(cs_SDP_Media_Audio(v_FmtAudio), v_Bandwidth_List_Media, v_SDP_MediaAttributes, v_SDP_PrecondionAttributes); + } + + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_SDP_MessagesVideo.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_SDP_MessagesVideo.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..57eaad96fe11cf4f5849c5873b41435e1dcda14d --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_SDP_MessagesVideo.ttcn @@ -0,0 +1,477 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-15 19:05:27 +0200 (Tue, 15 Sep 2015) $ +// $Rev: 14431 $ +/******************************************************************************/ + +module IMS_SDP_MessagesVideo { + import from LibSip_Common all; + import from LibSip_SDPTypes all; + import from IMS_Component all; + import from IMS_SDP_Templates all; + + type enumerated VideoCallTypeMO_Type {C25, AddVideo, CallHold}; /* @status APPROVED (IMS) */ + type enumerated VideoCallTypeMT_Type {C26, AddVideo}; /* @status APPROVED (IMS) */ + type enumerated VideoCallMT_MessageTX_Type {Invite, Update, InviteRemoveVideo}; /* @status APPROVED (IMS) */ + type enumerated VideoCallMT_MessageRX_Type {Response183, Response200}; /* @status APPROVED (IMS) */ + + /* + * @desc returns true if media attributes for tcap and pcfg are needed in DL + * @param p_SDP_Media_Desc + * @return boolean + * @status APPROVED (IMS) + */ + function fl_IMS_Video_TcapPcfgRequired(SDP_media_desc p_SDP_Media_Desc) return boolean + { + return (p_SDP_Media_Desc.media_field.transport == c_rtpAvp); + } + + //============================================================================ + // Video - SDP Messages Common + //---------------------------------------------------------------------------- + /* + * @desc Common function for video SDP messges in UL + * @param p_TimeDescription (default value: cr_SDP_Time_0_0) + * @param p_SDP_Media_Field_Audio + * @param p_SDP_MediaAttributes_Audio + * @param p_SDP_PrecondionAttributes_Audio + * @param p_SDP_Media_Field_Video + * @param p_SDP_MediaAttributes_Video + * @param p_SDP_PrecondionAttributes_Video + * @return template (present) SDP_Message + * @status APPROVED (IMS) + */ + function f_IMS_BuildSDP_AudioVideo_RX(template (present) SDP_time p_TimeDescription := cr_SDP_Time_0_0, + template (present) SDP_media_field p_SDP_Media_Field_Audio, + template (present) SDP_attribute_list p_SDP_MediaAttributes_Audio, + template (present) SDP_attribute_list p_SDP_PrecondionAttributes_Audio, + template (present) SDP_media_field p_SDP_Media_Field_Video, + template (present) SDP_attribute_list p_SDP_MediaAttributes_Video, + template (present) SDP_attribute_list p_SDP_PrecondionAttributes_Video) runs on IMS_PTC return template (present) SDP_Message + { + var charstring v_AddrType := f_IMS_PTC_NW_Address_GetTypeStr(); + var template (present) charstring v_IPAddrOrigin := ?; + var template (present) charstring v_IPAddrAudio := ?; + var template (present) charstring v_IPAddrVideo := ?; + var template (present) SDP_attribute_list v_SDP_Attribute_List_Audio := f_SDP_Attributes_Concat_RX(p_SDP_MediaAttributes_Audio, p_SDP_PrecondionAttributes_Audio); + var template (present) SDP_attribute_list v_SDP_Attribute_List_Video := f_SDP_Attributes_Concat_RX(p_SDP_MediaAttributes_Video, p_SDP_PrecondionAttributes_Video); + var template (present) SDP_media_desc v_SDP_Media_Desc_Audio; + var template (present) SDP_media_desc v_SDP_Media_Desc_Video; + var template SDP_bandwidth_list v_BandwidthList_Audio := f_SDP_SDP_Media_Desc_BandwidthList(p_SDP_Media_Field_Audio); /* results in * if the audio stream shall be released */ + var template SDP_bandwidth_list v_BandwidthList_Video := f_SDP_SDP_Media_Desc_BandwidthList(p_SDP_Media_Field_Video); /* results in * if the video stream shall be released */ + var template (present) SDP_media_desc_list v_SDP_Media_Desc_List; + + v_SDP_Attribute_List_Audio := superset(all from v_SDP_Attribute_List_Audio); + v_SDP_Attribute_List_Video := superset(all from v_SDP_Attribute_List_Video); + + v_SDP_Media_Desc_Audio := cr_SDP_Media_Desc(p_SDP_Media_Field_Audio, + cr_SDP_Connection(v_AddrType, v_IPAddrAudio), + v_BandwidthList_Audio, + v_SDP_Attribute_List_Audio); + v_SDP_Media_Desc_Video := cr_SDP_Media_Desc(p_SDP_Media_Field_Video, + cr_SDP_Connection(v_AddrType, v_IPAddrVideo), + v_BandwidthList_Video, + v_SDP_Attribute_List_Video); + v_SDP_Media_Desc_List := { v_SDP_Media_Desc_Audio, v_SDP_Media_Desc_Video }; + + return cr_SDP_Message_Common(v_AddrType, v_IPAddrOrigin, ?, -, p_TimeDescription, v_SDP_Media_Desc_List); + } + + /* + * @desc Common function for video SDP messges in DL + * @param p_SessionBandwidthAS (default value: 30) + * @param p_MediaAudio + * @param p_Bandwidth_List_Audio + * @param p_SDP_MediaAttributes_Audio + * @param p_SDP_PrecondionAttributes_Audio + * @param p_MediaVideo + * @param p_Bandwidth_List_Video + * @param p_SDP_MediaAttributes_Video + * @param p_SDP_PrecondionAttributes_Video + * @return template (value) SDP_Message + * @status APPROVED (IMS) + */ + function f_IMS_BuildSDP_AudioVideo_TX(integer p_SessionBandwidthAS := 30, + template (value) SDP_media_field p_MediaAudio, + template (value) SDP_bandwidth_list p_Bandwidth_List_Audio, + template (omit) SDP_attribute_list p_SDP_MediaAttributes_Audio, + template (omit) SDP_attribute_list p_SDP_PrecondionAttributes_Audio, + template (value) SDP_media_field p_MediaVideo, + template (value) SDP_bandwidth_list p_Bandwidth_List_Video, + template (omit) SDP_attribute_list p_SDP_MediaAttributes_Video, + template (omit) SDP_attribute_list p_SDP_PrecondionAttributes_Video) + runs on IMS_PTC + return template (value) SDP_Message + { + var charstring v_SessionId := f_IMS_PTC_ImsInfo_DialogGetSessIdTX(); /* @sic R5-150707 sic@ */ + var charstring v_SessionVersion := f_IMS_PTC_ImsInfo_DialogIncrAndGetSessVersionTX(); + var charstring v_AddrType := f_IMS_PTC_NW_Address_GetTypeStr(); + var charstring v_IPAddrConnection := f_IMS_PTC_RemoteAddress_GetAddrStr(); + var charstring v_IPAddrOrigin := v_IPAddrConnection; + var template (omit) SDP_attribute_list v_SDP_Attribute_List_Audio := f_SDP_Attributes_Concat_TX(p_SDP_MediaAttributes_Audio, p_SDP_PrecondionAttributes_Audio); + var template (omit) SDP_attribute_list v_SDP_Attribute_List_Video := f_SDP_Attributes_Concat_TX(p_SDP_MediaAttributes_Video, p_SDP_PrecondionAttributes_Video); + var template (value) SDP_media_desc v_SDP_Media_Desc_AudioTx; + var template (value) SDP_media_desc v_SDP_Media_Desc_VideoTx; + var template (value) SDP_media_desc_list v_SDP_Media_Desc_List; + + v_SDP_Media_Desc_AudioTx := cs_SDP_Media_Desc(p_MediaAudio, + p_Bandwidth_List_Audio, + v_SDP_Attribute_List_Audio); + v_SDP_Media_Desc_VideoTx := cs_SDP_Media_Desc(p_MediaVideo, + p_Bandwidth_List_Video, + v_SDP_Attribute_List_Video); + + v_SDP_Media_Desc_List := { v_SDP_Media_Desc_AudioTx, v_SDP_Media_Desc_VideoTx }; + + return cs_SDP_Message_Common(cs_SDP_Origin(v_SessionId, v_SessionVersion, v_AddrType, v_IPAddrOrigin), + cs_SDP_Connection(v_AddrType, v_IPAddrConnection), + cs_SDP_Bandwidth_List_AS(p_SessionBandwidthAS), + -, + v_SDP_Media_Desc_List); + } + + //============================================================================ + // Video - SDP Messages MO Call (C.25 and 17.1) + //---------------------------------------------------------------------------- + /* + * @desc Build SDP record to be received from the UE at step 2 according to 34.229-1 Annex C.25 + * @return template (present) SDP_Message + * @status APPROVED (IMS) + */ + function f_IMS_BuildSDP_AnnexC25_Step2() runs on IMS_PTC return template (present) SDP_Message + { /* @sic R5-151796: "a=inactive" removed from media attributes for audio and video sic@ */ + var template (present) SDP_attribute_list v_SDP_MediaAttributes_Audio := { + cr_SDP_Attribute_rtpmap(-, cr_RTPMAP_AMR_8000), + cr_SDP_Attribute_fmtp(-, cr_AMR_Fmtp_DefaultParameters), + cr_SDP_Attribute_rtpmap(-, cr_RTPMAP_TelephoneEvent), + cr_SDP_Attribute_ptime, + cr_SDP_Attribute_maxptime + }; + var template (present) SDP_attribute_list v_SDP_MediaAttributes_Video := { + // The tcap/pcfg attributes need to be checked later when we know whether we have RTP/AVP or RTP/AVPF + cr_SDP_Attribute_rtpmap(-, cr_RTPMAP_H264_90000), + cr_SDP_Attribute_fmtp(-, cr_Video_Fmtp_DefaultParametersMO) + }; + var template (present) SDP_attribute_list v_SDP_PrecondionAttributes := cr_SDP_PrecondionAttributes(c_none, c_none, c_mandatory, c_optional); + + return f_IMS_BuildSDP_AudioVideo_RX(cr_SDP_Time_Any, + cr_SDP_Media_Audio, + v_SDP_MediaAttributes_Audio, + v_SDP_PrecondionAttributes, + cr_SDP_Media_Video(-, (c_rtpAvp, c_rtpAvpf)), + v_SDP_MediaAttributes_Video, + v_SDP_PrecondionAttributes); + } + + /* + * @desc Build SDP record to be received from the UE at step 2 according to 34.229-1 test case 17.1 + * @return template (present) SDP_Message + * @status APPROVED (IMS) + */ + function f_IMS_BuildSDP_AddVideoMO_Step2() runs on IMS_PTC return template (present) SDP_Message + { + var template (present) SDP_attribute_list v_SDP_MediaAttributes_Audio := { + cr_SDP_Attribute_rtpmap(-, cr_RTPMAP_AMR_8000), + cr_SDP_Attribute_fmtp // => any parameters for audio + }; + var template (present) SDP_attribute_list v_SDP_PrecondionAttributes_Audio := cr_SDP_PrecondionAttributes(c_sendrecv, c_sendrecv, c_mandatory, c_optional); + + var template (present) SDP_attribute_list v_SDP_MediaAttributes_Video := { + // The tcap/pcfg attributes need to be checked later when we know whether we have RTP/AVP or RTP/AVPF + cr_SDP_Attribute_rtpmap(-, cr_RTPMAP_H264_90000), + cr_SDP_Attribute_fmtp(-, cr_Video_Fmtp_DefaultParametersMO) + }; + var template (present) SDP_attribute_list v_SDP_PrecondionAttributes_Video := cr_SDP_PrecondionAttributes(c_none, c_none, c_mandatory, c_optional); + + return f_IMS_BuildSDP_AudioVideo_RX(cr_SDP_Time_Any, + cr_SDP_Media_Audio, + v_SDP_MediaAttributes_Audio, + v_SDP_PrecondionAttributes_Audio, + cr_SDP_Media_Video(-, (c_rtpAvp, c_rtpAvpf)), + v_SDP_MediaAttributes_Video, + v_SDP_PrecondionAttributes_Video); + } + + //---------------------------------------------------------------------------- + /* + * @desc Build SDP record to be sent to the UE at step 4 according to 34.229-1 Annex C.25 or test case 17.1 + * @param p_VideoCallType + * @param p_SDP_Media_AudioRx + * @param p_SDP_Media_VideoRx + * @return template (value) SDP_Message + * @status APPROVED (IMS) + */ + function f_IMS_BuildSDP_MOCallAudioVideo_Step4(VideoCallTypeMO_Type p_VideoCallType, + SDP_media_desc p_SDP_Media_AudioRx, + SDP_media_desc p_SDP_Media_VideoRx) + runs on IMS_PTC return template (value) SDP_Message + { /* @sic R5-144402: p_IPAddrOrigin removed sic@ */ + var boolean v_TcapPcfg := fl_IMS_Video_TcapPcfgRequired(p_SDP_Media_VideoRx); + var charstring v_FmtAudio := f_SDP_MediaDescr_GetAMR_8000_1(p_SDP_Media_AudioRx); + var charstring v_FmtVideo := f_SDP_MediaDescr_GetH264_90000(p_SDP_Media_VideoRx); + var template (omit) SDP_attribute v_FmtpAttributeVideo; + var template (value) SDP_bandwidth_list v_Bandwidth_List_Audio := p_SDP_Media_AudioRx.bandwidth; + var template (value) SDP_bandwidth_list v_Bandwidth_List_Video := p_SDP_Media_VideoRx.bandwidth; + var template (omit) SDP_attribute_list v_SDP_MediaAttributes_Audio := f_SDP_MediaAttributes_AudioDef(v_FmtAudio); /* @sic R5-144693: new function f_SDP_MediaAttributes_AudioDef sic@ */ + var template (omit) SDP_attribute_list v_SDP_MediaAttributes_Video := {}; + var template (omit) SDP_attribute_list v_SDP_PrecondionAttributes_Audio; + var template (omit) SDP_attribute_list v_SDP_PrecondionAttributes_Video; + var template (value) SemicolonParam_List v_FmtpParamListVideo := {}; + + v_SDP_PrecondionAttributes_Video := f_SDP_Attributes_Add_TX(cs_SDP_PrecondionAttributes(c_none, c_none, c_mandatory, c_mandatory), cs_SDP_Attribute_conf_qos); + + select (p_VideoCallType) { + case (C25) { + v_SDP_PrecondionAttributes_Audio := v_SDP_PrecondionAttributes_Video; // same preconditions for audio and video + } + case (AddVideo) { + v_SDP_PrecondionAttributes_Audio := cs_SDP_PrecondionAttributes(c_sendrecv, c_sendrecv, c_mandatory, c_mandatory); + } + } + + v_FmtpAttributeVideo := f_SDP_AttributeList_GetAttribute(p_SDP_Media_VideoRx.attributes, cr_SDP_Attribute_fmtp(v_FmtVideo)); // @sic R5s141336 change 2.2 - MCC160 implementation sic@ */ + if (isvalue(v_FmtpAttributeVideo)) { + v_FmtpParamListVideo := valueof(v_FmtpAttributeVideo.fmtp.params.paramList); /* @sic R5-150734, R5-150736 sic@ */ + } + + v_SDP_MediaAttributes_Video := f_SDP_Attributes_Add_TX(v_SDP_MediaAttributes_Video, cs_SDP_Attribute_rtpmap(v_FmtVideo, cs_RTPMAP_H264_90000)); + v_SDP_MediaAttributes_Video := f_SDP_Attributes_Add_TX(v_SDP_MediaAttributes_Video, cs_SDP_Attribute_fmtp(v_FmtVideo, cs_Fmtp_ParamList(v_FmtpParamListVideo))); + v_SDP_MediaAttributes_Video := f_SDP_Attributes_Add_TX(v_SDP_MediaAttributes_Video, cs_SDP_Attribute_acfg(1, "t=1"), v_TcapPcfg); + + if (p_VideoCallType == C25) { /* NOTE: there is nothing specified in 17.1 regarding "a=inactive" yet */ + if (f_SDP_AttributeList_CheckAttribute(p_SDP_Media_VideoRx.attributes, cr_SDP_Attribute_inactive)) { /* @sic R5-150694 sic@ */ + v_SDP_MediaAttributes_Video := f_SDP_Attributes_Add_TX(v_SDP_MediaAttributes_Video, cs_SDP_Attribute_inactive); + } + if (f_SDP_AttributeList_CheckAttribute(p_SDP_Media_AudioRx.attributes, cr_SDP_Attribute_inactive)) { /* @sic R5-151796/R5-151797 sic@ */ + v_SDP_MediaAttributes_Audio := f_SDP_Attributes_Add_TX(v_SDP_MediaAttributes_Audio, cs_SDP_Attribute_inactive); + } + } + + return f_IMS_BuildSDP_AudioVideo_TX(-, + cs_SDP_Media_Audio(v_FmtAudio), + v_Bandwidth_List_Audio, + v_SDP_MediaAttributes_Audio, + v_SDP_PrecondionAttributes_Audio, + cs_SDP_Media_Video(v_FmtVideo), + v_Bandwidth_List_Video, + v_SDP_MediaAttributes_Video, + v_SDP_PrecondionAttributes_Video); + } + + //---------------------------------------------------------------------------- + /* + * @desc to receive 2nd SDP answer sent by the UE in C.25 step 5/7 + * @param p_VideoCallType + * @param p_SDP_MessageInvite + * @return template (present) SDP_Message + * @status APPROVED (IMS) + */ + function f_IMS_BuildSDP_MOCallAudioVideo_Step5or7(VideoCallTypeMO_Type p_VideoCallType, + SDP_Message p_SDP_MessageInvite) runs on IMS_PTC return template (present) SDP_Message + { /* @sic R5-153610: p_SDP_MessageInvite instead of p_FmtAudio, p_FmtVideo sic@ */ + + var SDP_media_desc v_SDP_Media_InviteAudio := p_SDP_MessageInvite.media_list[0]; + var SDP_media_desc v_SDP_Media_InviteVideo := p_SDP_MessageInvite.media_list[1]; + var charstring v_FmtAudio := f_SDP_MediaDescr_GetAMR_8000_1(v_SDP_Media_InviteAudio); // @sic R5-153610 sic@ + var charstring v_FmtVideo := f_SDP_MediaDescr_GetH264_90000(v_SDP_Media_InviteVideo); // @sic R5-153610 sic@ + + var template (present) SDP_attribute_list v_SDP_MediaAttributes_Audio := { + cr_SDP_Attribute_rtpmap(v_FmtAudio, cr_RTPMAP_AMR_8000), // @sic R5s130681 change 2 sic@ + cr_SDP_Attribute_fmtp(v_FmtAudio) + }; + var template (present) SDP_attribute_list v_SDP_MediaAttributes_Video; + var template (present) SDP_attribute_list v_SDP_PrecondionAttributes_Audio; + var template (present) SDP_attribute_list v_SDP_PrecondionAttributes_Video; + var template (present) charstring v_DirectionRemote_Audio; + var template (present) charstring v_DirectionRemote_Video; + var template (present) charstring v_StrengthRemote := c_optional; + + v_SDP_MediaAttributes_Video := { /* @sic R5s141336 change 3 sic@ */ + cr_SDP_Attribute_rtpmap(v_FmtVideo, cr_RTPMAP_H264_90000), + cr_SDP_Attribute_fmtp(v_FmtVideo, cr_Video_Fmtp_DefaultParametersMO) /* @sic R5-150734, R5-150736: same parameters for C.25 and 17.1 sic@ */ + }; + + select (p_VideoCallType) { + case (C25) { + if (f_SDP_AttributeList_CheckAttribute(v_SDP_Media_InviteAudio.attributes, cr_SDP_Attribute_inactive)) { /* @sic R5-153610 sic@ */ + v_SDP_MediaAttributes_Audio := f_SDP_Attributes_Add_RX(v_SDP_MediaAttributes_Audio, cr_SDP_Attribute_sendrecv); + } + if (f_SDP_AttributeList_CheckAttribute(v_SDP_Media_InviteVideo.attributes, cr_SDP_Attribute_inactive)) { /* @sic R5-153610 sic@ */ + v_SDP_MediaAttributes_Video := f_SDP_Attributes_Add_RX(v_SDP_MediaAttributes_Video, cr_SDP_Attribute_sendrecv); + } + v_DirectionRemote_Audio := c_none; + v_DirectionRemote_Video := c_none; + v_StrengthRemote := (c_optional, c_mandatory); /* @sic R5s141221 change 4.1; R5s150236 sic@ */ + } + case (AddVideo) { + v_DirectionRemote_Audio := c_sendrecv; + v_DirectionRemote_Video := c_none; + } + case (CallHold) { + v_DirectionRemote_Audio := c_sendrecv; + v_DirectionRemote_Video := c_sendrecv; + v_StrengthRemote := (c_optional, c_mandatory); /* @sic R5s150775 sic@ */ + } + } + v_SDP_PrecondionAttributes_Video := cr_SDP_PrecondionAttributes(c_sendrecv, v_DirectionRemote_Audio, c_mandatory, v_StrengthRemote); + v_SDP_PrecondionAttributes_Audio := cr_SDP_PrecondionAttributes(c_sendrecv, v_DirectionRemote_Video, c_mandatory, v_StrengthRemote); + + return f_IMS_BuildSDP_AudioVideo_RX(-, + cr_SDP_Media_Audio(v_FmtAudio), + v_SDP_MediaAttributes_Audio, + v_SDP_PrecondionAttributes_Audio, + cr_SDP_Media_Video(v_FmtVideo), + v_SDP_MediaAttributes_Video, + v_SDP_PrecondionAttributes_Video); + } + + //============================================================================ + // Video - SDP Messages MT Call (C.26 and 17.2) + //---------------------------------------------------------------------------- + /* + * @desc Build SDP message to be sent to the UE at step 1/7 of Annex C.26 or at step 1/6 of 17.2 + * @param p_VideoCallType + * @param p_MessageType + * @param p_FmtAudio + * @param p_FmtVideo + * @param p_DirectionRemote (default value: c_none) + * @return template (value) SDP_Message + * @status APPROVED (IMS) + */ + function f_IMS_BuildSDP_MTCallAudioVideo_TX(VideoCallTypeMT_Type p_VideoCallType, + VideoCallMT_MessageTX_Type p_MessageType, + charstring p_FmtAudio, + charstring p_FmtVideo, + charstring p_DirectionRemote := c_none) + runs on IMS_PTC + return template (value) SDP_Message + { + var template (value) SDP_media_field v_MediaVideo := cs_SDP_Media_Video(p_FmtVideo); + var template (omit) SDP_attribute_list v_SDP_MediaAttributes_Audio := f_SDP_MediaAttributes_AudioCommon(p_FmtAudio); /* @sic R5-144693: new function f_SDP_MediaAttributes_AudioCommon sic@ */ + var template (omit) SDP_attribute_list v_SDP_MediaAttributes_Video := { + cs_SDP_Attribute_rtpmap(p_FmtVideo, cs_RTPMAP_H264_90000), + cs_SDP_Attribute_fmtp(p_FmtVideo, cs_Fmtp_ParamList(cs_Fmtp_VideoParamsDef)) + }; + var integer v_SessionBandwidthAS; + var template (value) SDP_bandwidth_list v_Bandwidth_List_Audio; + var template (value) SDP_bandwidth_list v_Bandwidth_List_Video := cs_SDP_Bandwidth_List_Media(315, 0, 2500); + var template (value) SDP_attribute_list v_SDP_PrecondionAttributes_Audio; + var template (value) SDP_attribute_list v_SDP_PrecondionAttributes_Video; + var boolean v_IsNotRemoveVideo := (p_MessageType != InviteRemoveVideo); + var boolean v_IsUpdate := false; + + if (p_MessageType != InviteRemoveVideo) { + v_SDP_MediaAttributes_Video := f_SDP_Attributes_Add_TX(v_SDP_MediaAttributes_Video, cs_SDP_Attribute_rtcp_fb("*", "trr-int 5000"), v_IsNotRemoveVideo); /* @sic R5s141329 change 2.2: attribute is for video sic@ */ + v_SDP_MediaAttributes_Video := f_SDP_Attributes_Add_TX(v_SDP_MediaAttributes_Video, cs_SDP_Attribute_rtcp_fb("*", "nack"), v_IsNotRemoveVideo); /* @sic R5s141329 change 2.2: attribute is for video sic@ */ + v_SDP_MediaAttributes_Video := f_SDP_Attributes_Add_TX(v_SDP_MediaAttributes_Video, cs_SDP_Attribute_rtcp_fb("*", "nack pli"), v_IsNotRemoveVideo); /* @sic R5s141329 change 2.2: attribute is for video sic@ */ + v_SDP_MediaAttributes_Video := f_SDP_Attributes_Add_TX(v_SDP_MediaAttributes_Video, cs_SDP_Attribute_rtcp_fb("*", "ccm fir"), v_IsNotRemoveVideo); /* @sic R5s141329 change 2.2: attribute is for video sic@ */ + v_SDP_MediaAttributes_Video := f_SDP_Attributes_Add_TX(v_SDP_MediaAttributes_Video, cs_SDP_Attribute_rtcp_fb("*", "ccm tmmbr"), v_IsNotRemoveVideo); /* @sic R5s141329 change 2.2: attribute is for video sic@ */ + } + + select (p_MessageType) { + case (Invite) { + v_SDP_PrecondionAttributes_Video := cs_SDP_PrecondionAttributes(c_none, c_none, c_mandatory, c_mandatory); + } + case (Update) { + v_SDP_PrecondionAttributes_Video := cs_SDP_PrecondionAttributes(c_sendrecv, p_DirectionRemote, c_mandatory, c_mandatory); + v_IsUpdate := true; + } + case (InviteRemoveVideo) { + v_SDP_PrecondionAttributes_Video := cs_SDP_PrecondionAttributes(c_sendrecv, c_sendrecv, c_mandatory, c_mandatory); + v_MediaVideo.ports.port_number := 0; + } + } + + if (not (v_IsUpdate and (p_VideoCallType == AddVideo))) { // @sic R5-151956: there are no ptime, maxptime for UPDATE of 17.2 sic@ + // additional attributes for audio: ptime, maxptime + v_SDP_MediaAttributes_Audio := f_SDP_Attributes_Add_TX(v_SDP_MediaAttributes_Audio, cs_SDP_Attribute_ptime); + v_SDP_MediaAttributes_Audio := f_SDP_Attributes_Add_TX(v_SDP_MediaAttributes_Audio, cs_SDP_Attribute_maxptime); + } + + select (p_VideoCallType) { + case (C26) { + v_SessionBandwidthAS := 30; // @sic R5-151956 sic@ + v_Bandwidth_List_Audio := cs_SDP_Bandwidth_List_Media(30, 0, 2000); // @sic R5-151956 sic@ + // @sic R5-153610: "sendrecv" media attribute removed from UPDATE (Step 7) for audio and Video sic@ + v_SDP_PrecondionAttributes_Audio := v_SDP_PrecondionAttributes_Video; // same precondions for video and audio + } + case (AddVideo) { + v_SessionBandwidthAS := 37; // @sic R5-151956 sic@ + v_Bandwidth_List_Audio := cs_SDP_Bandwidth_List_Media(37, 0, 2500); // @sic R5-151956 sic@ + // acc. 34.229-1 in contrast to C.26 there is no sendrecv attribute for audio or video + v_SDP_PrecondionAttributes_Audio := cs_SDP_PrecondionAttributes(c_sendrecv, c_sendrecv, c_mandatory, c_mandatory); // audio is already there + } + } + + return f_IMS_BuildSDP_AudioVideo_TX(v_SessionBandwidthAS, + cs_SDP_Media_Audio(p_FmtAudio), + v_Bandwidth_List_Audio, + v_SDP_MediaAttributes_Audio, + v_SDP_PrecondionAttributes_Audio, + v_MediaVideo, + v_Bandwidth_List_Video, + v_SDP_MediaAttributes_Video, + v_SDP_PrecondionAttributes_Video); + } + + /* + * @desc SDP message received in step 4 (C.26) or step 3 (17.2) + * @param p_VideoCallType + * @param p_MessageType + * @param p_FmtAudio + * @param p_FmtVideo + * @return template (present) SDP_Message + * @status APPROVED (IMS) + */ + function f_IMS_BuildSDP_MTCallAudioVideo_RX(VideoCallTypeMT_Type p_VideoCallType, + VideoCallMT_MessageRX_Type p_MessageType, + charstring p_FmtAudio, + charstring p_FmtVideo) + runs on IMS_PTC + return template (present) SDP_Message + { + var template (present) SDP_attribute_list v_SDP_MediaAttributes_Audio := { + cr_SDP_Attribute_rtpmap(p_FmtAudio, cr_RTPMAP_AMR_8000), + cr_SDP_Attribute_fmtp(p_FmtAudio) + }; + var template (present) SDP_attribute_list v_SDP_MediaAttributes_Video := { + cr_SDP_Attribute_rtpmap(p_FmtVideo, cr_RTPMAP_H264_90000), + cr_SDP_Attribute_fmtp(p_FmtVideo, cr_Video_Fmtp_DefaultParametersMT) /* @sic R5s141329 - MCC160 implementation sic@ + @sic R5-150703: same parameters for C.26 and 17.2 sic@ */ + }; + var template (present) SDP_attribute_list v_SDP_PrecondionAttributes_Audio; + var template (present) SDP_attribute_list v_SDP_PrecondionAttributes_Video; + + select (p_MessageType) { + case (Response183) { + v_SDP_PrecondionAttributes_Video := f_SDP_Attributes_Add_RX(cr_SDP_PrecondionAttributes((c_none, c_sendrecv), c_none, c_mandatory, c_mandatory), cr_SDP_Attribute_conf_qos); + } + case (Response200) { + v_SDP_PrecondionAttributes_Video := cr_SDP_PrecondionAttributes(c_sendrecv, c_sendrecv, c_mandatory, c_mandatory); + } + } + + select (p_VideoCallType) { + case (C26) { + v_SDP_PrecondionAttributes_Audio := v_SDP_PrecondionAttributes_Video; + } + case (AddVideo) { + v_SDP_PrecondionAttributes_Audio := cr_SDP_PrecondionAttributes(c_sendrecv, c_sendrecv, c_mandatory, c_mandatory); + } + } + + return f_IMS_BuildSDP_AudioVideo_RX(-, + cr_SDP_Media_Audio(p_FmtAudio), + v_SDP_MediaAttributes_Audio, + v_SDP_PrecondionAttributes_Audio, + cr_SDP_Media_Video(p_FmtVideo), + v_SDP_MediaAttributes_Video, + v_SDP_PrecondionAttributes_Video); + } + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_SDP_Templates.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_SDP_Templates.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..72824d5616108c253015e3dbad5baee7795ed244 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_SDP_Templates.ttcn @@ -0,0 +1,1160 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-17 13:17:48 +0200 (Thu, 17 Sep 2015) $ +// $Rev: 14487 $ +/******************************************************************************/ + +module IMS_SDP_Templates { + import from LibSip_Common all; + import from LibSip_SDPTypes all; + import from IMS_CommonDefs all; + import from IMS_CommonTemplates all; + import from CommonDefs all; + + const charstring tsc_SDP_NoSessionname := "-"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + @sic R5-144402: tsc_SDP_Sessionname -> tsc_SDP_NoSessionname sic@ */ + + // RTPMAP - Codecs: + + template (present) SDP_attribute_rtpmap_codec cr_RTPMAP_Codec(template (present) charstring p_Encoding, + template (present) charstring p_ClockRate := ?, + template charstring p_Parameters := *) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + encoding := p_Encoding, + clockrate := p_ClockRate, + parameters := p_Parameters + }; + + template (present) SDP_attribute_rtpmap_codec cr_RTPMAP_AMR_AnyCodec := cr_RTPMAP_Codec(pattern "AMR*"); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_IRAT) + any AMR codec ("AMR[/]*" or "AMR-WB[/]*") + @sic R5w140113, R5w140009: replaces tsc_CODEC_AMR_Any_RX_Pattern sic@ */ + template (present) SDP_attribute_rtpmap_codec cr_RTPMAP_AMR_8000 := cr_RTPMAP_Codec("AMR", "8000", "1" ifpresent); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + @sic R5w140113, R5w140009: replaces tsc_CODEC_AMR_8000_RX_Pattern sic@ */ + template (present) SDP_attribute_rtpmap_codec cr_RTPMAP_AMR_16000 := cr_RTPMAP_Codec("AMR-WB", "16000", "1" ifpresent); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) + @sic R5w140113, R5w140009: replaces tsc_CODEC_AMR_16000_RX_Pattern sic@ */ + template (present) SDP_attribute_rtpmap_codec cr_RTPMAP_EVS_16000 := cr_RTPMAP_Codec("EVS", "16000", "1" ifpresent); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + template (present) SDP_attribute_rtpmap_codec cr_RTPMAP_TelephoneEvent := + cr_RTPMAP_Codec("telephone-event", pattern "([0-9]+)", pattern "([0-9]+)" ifpresent); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) + @sic R5s130798 change 5 - MCC160 Comment sic@ + @sic R5w140113, R5w140009: replaces tsc_CODEC_TelephoneEvent_RX_Pattern sic@ */ + template (present) SDP_attribute_rtpmap_codec cr_RTPMAP_H264_90000 := cr_RTPMAP_Codec("H264", "90000"); /* @status APPROVED (IMS) */ + + template (value) SDP_attribute_rtpmap_codec cs_RTPMAP_Codec(template (value) charstring p_Encoding, + template (value) charstring p_ClockRate, + template (omit) charstring p_Parameters := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + encoding := p_Encoding, + clockrate := p_ClockRate, + parameters := p_Parameters + }; + + template (value) SDP_attribute_rtpmap_codec cs_RTPMAP_AMR_8000 := cs_RTPMAP_Codec("AMR", "8000", "1"); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + @sic R5w140113, R5w140009: replaces tsc_CODEC_AMR_8000_TX sic@ */ + template (value) SDP_attribute_rtpmap_codec cs_RTPMAP_AMR_16000 := cs_RTPMAP_Codec("AMR-WB", "16000", "1"); /* @status APPROVED (IMS, LTE_A, LTE_IRAT) + @sic R5w140113, R5w140009: replaces tsc_CODEC_AMR_16000_TX sic@ */ + template (value) SDP_attribute_rtpmap_codec cs_RTPMAP_H264_90000 := cs_RTPMAP_Codec("H264", "90000"); /* @status APPROVED (IMS) */ + + template (value) SDP_attribute_rtpmap_codec cs_RTPMAP_EVS_16000 := cs_RTPMAP_Codec("EVS", "16000", "1"); /* @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT) */ + + // FMTP: + + template (value) SDP_attribute_fmtp_format_specific_params cs_Fmtp_ParamList(template (value) SemicolonParam_List p_ParamList) := {paramList := p_ParamList}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + template (present) SDP_attribute_fmtp_format_specific_params cr_Fmtp_ParamList(template (present) SemicolonParam_List p_ParamList) := {paramList := p_ParamList}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + template (value) SDP_attribute_fmtp_format_specific_params crs_Fmtp_UnstructuredParams(charstring p_ParamString) := {unstructured := p_ParamString}; + + // audio - format specific parameters + template (value) GenericParam cs_AMR_ModeChangeCapability := cs_GenericParam("mode-change-capability", "2"); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + template (present) GenericParam cr_AMR_ModeChangeCapability := f_GenericParam_AsTX(cs_AMR_ModeChangeCapability); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + template (value) GenericParam cs_AMR_MaxRed := cs_GenericParam("max-red", "220"); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + template (present) GenericParam cr_AMR_MaxRed := cr_GenericParam("max-red", pattern "[0-9]+"); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + @sic R5-141114: in UL max-red can be any value within 0..220 sic@ */ + template (value) GenericParam cs_EVS_BrSend(charstring p_Value) := cs_GenericParam("br-send", p_Value); /* @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT) */ + template (value) GenericParam cs_EVS_BrRecv(charstring p_Value) := cs_GenericParam("br-recv", p_Value); /* @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT) */ + template (value) GenericParam cs_EVS_Bw := cs_GenericParam("bw", "swb"); /* @sic R5-153999 sic@ + @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT) */ + template (value) GenericParam cs_EVS_BwSend := cs_GenericParam("bw-send", "swb"); /* @sic R5-153999 sic@ + @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT) */ + template (value) GenericParam cs_EVS_BwRecv := cs_GenericParam("bw-recv", "swb"); /* @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT) */ + + template (value) SemicolonParam_List cs_Fmtp_AudioParamsDef := {cs_AMR_ModeChangeCapability, cs_AMR_MaxRed}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + template (value) SemicolonParam_List cs_EVS_Fmtp_AudioParamsDef := {cs_EVS_Bw, cs_EVS_BwSend, cs_EVS_BwRecv, cs_AMR_MaxRed}; /* @sic R5-153999 sic@ + @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT) */ + template (value) SemicolonParam_List cs_EVS_Fmtp_AudioParamsExt(charstring p_BrSendVal := "8-48", + charstring p_BrRecvVal := "32-48") := + { /* @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT) */ + cs_EVS_BrSend(p_BrSendVal), + cs_EVS_BrRecv(p_BrRecvVal), + cs_EVS_Bw, + cs_EVS_BwSend, + cs_EVS_BwRecv, + cs_AMR_MaxRed + }; + + template (present) SemicolonParam_List cr_Fmtp_AudioParamsDef := {cr_AMR_ModeChangeCapability, cr_AMR_MaxRed, *}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + template (present) SemicolonParam_List cr_EVS_Fmtp_AudioParamsDef := {cr_AMR_MaxRed, *}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) */ + + template (value) SDP_attribute_fmtp_format_specific_params cs_AMR_Fmtp_DefaultParameters := cs_Fmtp_ParamList(cs_Fmtp_AudioParamsDef); /* @sic R5w140113, R5w140009: replaces tsc_AMR_Fmtp_DefaultParameters_TX sic@ + @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT)*/ + + template (present) SDP_attribute_fmtp_format_specific_params cr_AMR_Fmtp_DefaultParameters := cr_Fmtp_ParamList(cr_Fmtp_AudioParamsDef); /* @sic R5w140113, R5w140009: replaces tsc_AMR_Fmtp_DefaultParameters_RX sic@ + @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + + template (present) SDP_attribute_fmtp_format_specific_params cr_EVS_Fmtp_DefaultParameters := cr_Fmtp_ParamList(cr_EVS_Fmtp_AudioParamsDef); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) */ + // video - format specific parameters + const charstring tsc_IMS_Video_Fmtp_ProfileLevelId_Def := "42e00c"; /* @status APPROVED (IMS) */ + const charstring tsc_IMS_Video_Fmtp_SpropParameterSets_Def := "J0LgDJWgUH6Af1A=,KM46gA=="; /* @status APPROVED (IMS) */ + const charstring tsc_IMS_Video_Fmtp_PacketizationMode_Def := "0"; /* @status APPROVED (IMS) */ + + template (value) GenericParam cs_Video_Fmtp_ProfileLevelId(charstring p_Value := tsc_IMS_Video_Fmtp_ProfileLevelId_Def) := cs_GenericParam("profile-level-id", p_Value); /* @status APPROVED (IMS) */ + template (present) GenericParam cr_Video_Fmtp_ProfileLevelId(template (present) charstring p_Value := ?) := cr_GenericParam("profile-level-id", p_Value); /* @sic R5-144595 sic@ + @status APPROVED (IMS)*/ + template (value) GenericParam cs_Video_Fmtp_SpropParameterSets(charstring p_Value := tsc_IMS_Video_Fmtp_SpropParameterSets_Def) := cs_GenericParam("sprop-parameter-sets", p_Value); /* @status APPROVED (IMS) */ + + template (value) GenericParam cs_Video_Fmtp_PacketizationMode(charstring p_Value := tsc_IMS_Video_Fmtp_PacketizationMode_Def) := cs_GenericParam("packetization-mode", p_Value); /* @status APPROVED (IMS) */ + template (present) GenericParam cr_Video_Fmtp_PacketizationMode(template (present) charstring p_Value := ?) := cr_GenericParam("packetization-mode", p_Value); /* @status APPROVED (IMS) */ + + template (value) SemicolonParam_List cs_Fmtp_VideoParamsDef := {cs_Video_Fmtp_PacketizationMode, cs_Video_Fmtp_ProfileLevelId, cs_Video_Fmtp_SpropParameterSets}; /* @status APPROVED (IMS) */ + + template (present) SemicolonParam_List cr_Fmtp_VideoParamsMO_Def := + { /* @status APPROVED (IMS) + @sic R5-150703: any ProfileLevelId; all other parameters are optional sic@ */ + cr_Video_Fmtp_ProfileLevelId, + * + }; + + template (present) SemicolonParam_List cr_Fmtp_VideoParamsMT_Def := + { /* @status APPROVED (IMS) */ + /* @sic R5s141329 - MCC160 implementation sic@ + @sic R5-150703: any ProfileLevelId; SpropParameterSets not mandatory sic@ */ + cr_Video_Fmtp_PacketizationMode(tsc_IMS_Video_Fmtp_PacketizationMode_Def), + cr_Video_Fmtp_ProfileLevelId, + * + }; + + template (present) SDP_attribute_fmtp_format_specific_params cr_Video_Fmtp_DefaultParametersMO := cr_Fmtp_ParamList(cr_Fmtp_VideoParamsMO_Def); /* @status APPROVED (IMS) */ + template (present) SDP_attribute_fmtp_format_specific_params cr_Video_Fmtp_DefaultParametersMT := cr_Fmtp_ParamList(cr_Fmtp_VideoParamsMT_Def); /* @status APPROVED (IMS) */ + + const charstring tsc_SDP_FmtAudio := "97"; /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + const charstring tsc_SDP_FmtVideo := "98"; /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + + template (present) charstring cr_SDP_AnyMediaFormatDescr := pattern "[0-9]#(2,3)"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + + //---------------------------------------------------------------------------- + /* + * @desc add further attribute to given list + * @param p_SDP_Attribute_List + * @param p_SDP_Attribute + * @param p_Condition (default value: true) + * @return template (omit) SDP_attribute_list + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_SDP_Attributes_Add_TX(template (omit) SDP_attribute_list p_SDP_Attribute_List, + template (omit) SDP_attribute p_SDP_Attribute, + boolean p_Condition := true) return template (omit) SDP_attribute_list + { /* @sic R5s130510: additional parameter p_Condition sic@ */ + var template (omit) SDP_attribute_list v_SDP_Attribute_List := p_SDP_Attribute_List; + var integer i := 0; + + if (p_Condition) { + if (isvalue(p_SDP_Attribute)) { + if (isvalue(v_SDP_Attribute_List)) { + i := lengthof(v_SDP_Attribute_List); + } + v_SDP_Attribute_List[i] := p_SDP_Attribute; + } + } + return v_SDP_Attribute_List; + } + + /* + * @desc concatinate list of SDP attributes + * @param p_SDP_Attribute_List1 + * @param p_SDP_Attribute_List2 + * @return template (omit) SDP_attribute_list + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_SDP_Attributes_Concat_TX(template (omit) SDP_attribute_list p_SDP_Attribute_List1, + template (omit) SDP_attribute_list p_SDP_Attribute_List2) return template (omit) SDP_attribute_list + { + var template (omit) SDP_attribute_list v_SDP_Attribute_List := p_SDP_Attribute_List1; + var SDP_attribute_list v_SDP_Attribute_List2; + var integer n; + var integer k; + + if (isvalue(p_SDP_Attribute_List2)) { + v_SDP_Attribute_List2 := valueof(p_SDP_Attribute_List2); + n := lengthof(v_SDP_Attribute_List2); + for (k:=0; k < n; k:=k+1) { + v_SDP_Attribute_List := f_SDP_Attributes_Add_TX(v_SDP_Attribute_List, v_SDP_Attribute_List2[k]); + } + } + return v_SDP_Attribute_List; + } + + /* + * @desc add attribute to list of attributes + * @param p_SDP_Attribute_List + * @param p_SDP_Attribute + * @param p_Condition (default value: true) + * @return template (present) SDP_attribute_list + * @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT) + */ + function f_SDP_Attributes_Add_RX(template (present) SDP_attribute_list p_SDP_Attribute_List, + template (present) SDP_attribute p_SDP_Attribute, + boolean p_Condition := true) return template (present) SDP_attribute_list + { + var template (present) SDP_attribute_list v_SDP_Attribute_List := p_SDP_Attribute_List; + var integer i := 0; + + if (p_Condition) { + i := lengthof(v_SDP_Attribute_List); + v_SDP_Attribute_List[i] := p_SDP_Attribute; + } + return v_SDP_Attribute_List; + } + + /* + * @desc concatinate list of SDP attributes + * @param p_SDP_Attribute_List1 + * @param p_SDP_Attribute_List2 + * @return template (present) SDP_attribute_list + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_SDP_Attributes_Concat_RX(template (present) SDP_attribute_list p_SDP_Attribute_List1, + template (present) SDP_attribute_list p_SDP_Attribute_List2) return template (present) SDP_attribute_list + { + var template (present) SDP_attribute_list v_SDP_Attribute_List := p_SDP_Attribute_List1; + var integer i := lengthof(p_SDP_Attribute_List1); + var integer k; + + for (k:=0; k < lengthof(p_SDP_Attribute_List2); k:=k+1) { + v_SDP_Attribute_List[i+k] := p_SDP_Attribute_List2[k]; + } + return v_SDP_Attribute_List; + } + + /* + * @desc exchange attribute in given attribute list + * @param p_AttributeList + * @param p_AttributeToBeChanged + * @param p_NewAttribute + * @return template (omit) SDP_attribute_list + * @status APPROVED (IMS, LTE, LTE_A) + */ + function f_SDP_ExchangeAttribute(template (omit) SDP_attribute_list p_AttributeList, + template (present) SDP_attribute p_AttributeToBeChanged, + template (value) SDP_attribute p_NewAttribute) return template (omit) SDP_attribute_list + { // @sic R5s120530 change 3.17 sic@ + var template (omit) SDP_attribute_list v_AttributeList := p_AttributeList; + var integer i := 0; + if (isvalue(v_AttributeList)) { + for (i:=0; i rtpmap attributes are not checked + * when p_FmtpParameters == omit => fmtp attributes are not checked + * when both are omit the first element of fmts is return (if any); + * returns the first fmt in the fmts list of the media description (RFC 4566 cl. 5.14) matching the given rtpmap and the given fmtp attributes; + * returns "" if no fmt is found + * @param p_SDP_Media_Desc + * @param p_RtpmapCodecInfo + * @param p_FmtpParameters (default value: omit) + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_SDP_MediaDescr_GetMediaFormat(SDP_media_desc p_SDP_Media_Desc, + template SDP_attribute_rtpmap_codec p_RtpmapCodecInfo, + template SDP_attribute_fmtp_format_specific_params p_FmtpParameters := omit) return charstring + { + var charstring v_Fmt; + var integer i; + var boolean v_RtpmapMatch; + var boolean v_FmtpMatch; + + for (i := 0; i < lengthof(p_SDP_Media_Desc.media_field.fmts); i := i + 1) { + v_Fmt := p_SDP_Media_Desc.media_field.fmts[i]; + + v_RtpmapMatch := not ispresent(p_RtpmapCodecInfo); // -> p_RtpmapCodecInfo is omit + v_FmtpMatch := not ispresent(p_FmtpParameters); // -> p_FmtpParameters is omit + + if (not v_RtpmapMatch) { // -> p_RtpmapCodecInfo is + v_RtpmapMatch := f_SDP_AttributeList_CheckAttribute(p_SDP_Media_Desc.attributes, cr_SDP_Attribute_rtpmap(v_Fmt, p_RtpmapCodecInfo)); // compiler warning cannot be avoided + } + + if (not v_FmtpMatch) { // -> p_FmtpParameters is value + v_FmtpMatch := f_SDP_AttributeList_CheckAttribute(p_SDP_Media_Desc.attributes, cr_SDP_Attribute_fmtp(v_Fmt, p_FmtpParameters)); // compiler warning cannot be avoided + } + + if (v_RtpmapMatch and v_FmtpMatch) { + return v_Fmt; + } + } + return ""; + } + + /* + * @desc get default audio codec + * @param p_SDP_Media_Desc + * @param p_FmtpParameters (default value: cr_AMR_Fmtp_DefaultParameters) + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_SDP_MediaDescr_GetAMR_8000_1(SDP_media_desc p_SDP_Media_Desc, + template SDP_attribute_fmtp_format_specific_params p_FmtpParameters := cr_AMR_Fmtp_DefaultParameters) return charstring + { /* @sic R5w140113, R5w140009: cr_AMR_Fmtp_DefaultParameters replaces tsc_AMR_Fmtp_DefaultParameters_RX sic@ */ + return f_SDP_MediaDescr_GetMediaFormat(p_SDP_Media_Desc, cr_RTPMAP_AMR_8000, p_FmtpParameters); + } + + /* + * @desc get AMR-WB/16000 audio codec + * @param p_SDP_Media_Desc + * @param p_FmtpParameters (default value: cr_AMR_Fmtp_DefaultParameters) + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) + */ + function f_SDP_MediaDescr_GetAMR_16000_1(SDP_media_desc p_SDP_Media_Desc, + template SDP_attribute_fmtp_format_specific_params p_FmtpParameters := cr_AMR_Fmtp_DefaultParameters) return charstring + { /* @sic R5w140113, R5w140009: cr_AMR_Fmtp_DefaultParameters replaces tsc_AMR_Fmtp_DefaultParameters_RX sic@ */ + return f_SDP_MediaDescr_GetMediaFormat(p_SDP_Media_Desc, cr_RTPMAP_AMR_16000, p_FmtpParameters); + } + + /* + * @desc get EVS audio codec + * @param p_SDP_Media_Desc + * @param p_FmtpParameters (default value: cr_EVS_Fmtp_DefaultParameters) + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) + */ + function f_SDP_MediaDescr_GetEVS_16000_1(SDP_media_desc p_SDP_Media_Desc, + template SDP_attribute_fmtp_format_specific_params p_FmtpParameters := cr_EVS_Fmtp_DefaultParameters) + return charstring + { + return f_SDP_MediaDescr_GetMediaFormat(p_SDP_Media_Desc, cr_RTPMAP_EVS_16000, p_FmtpParameters); + } + + /* + * @desc return (first) AMR of given media description + * @param p_SDP_Media_Desc + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_IRAT) + */ + function f_SDP_MediaDescr_GetAMR_Any(SDP_media_desc p_SDP_Media_Desc) return charstring + { + return f_SDP_MediaDescr_GetMediaFormat(p_SDP_Media_Desc, cr_RTPMAP_AMR_AnyCodec); + } + + /* + * @desc return video codec of given media description + * @param p_SDP_Media_Desc + * @param p_FmtpParameters (default value: cr_Video_Fmtp_DefaultParametersMO) + * @return charstring + * @status APPROVED (IMS) + */ + function f_SDP_MediaDescr_GetH264_90000(SDP_media_desc p_SDP_Media_Desc, + template SDP_attribute_fmtp_format_specific_params p_FmtpParameters := cr_Video_Fmtp_DefaultParametersMO) return charstring + { /* get default video codec */ + return f_SDP_MediaDescr_GetMediaFormat(p_SDP_Media_Desc, cr_RTPMAP_H264_90000, p_FmtpParameters); + } + + + //---------------------------------------------------------------------------- + /* + * @desc get specific bandwidth (specified by p_Modifier) + * @param p_BandwidthList + * @param p_Modifier + * @return integer + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_SDP_BandwidthList_GetBandwidth(SDP_bandwidth_list p_BandwidthList, + charstring p_Modifier) return integer + { + var integer i; + + for (i := 0; i < lengthof(p_BandwidthList); i := i + 1) { + if (p_BandwidthList[i].modifier == p_Modifier) { + return p_BandwidthList[i].bandwidth; + } + } + FatalError(__FILE__, __LINE__, "no bandwidth found for " & p_Modifier); + return 0; + } + + //---------------------------------------------------------------------------- + /* + * @desc return BandwidthList: if the given SDP_media_field refers to a port number of 0 (=> release of the media stream) the UE does not need to provide and bandwidth information + * @param p_SDP_Media_Field + * @param p_AS + * @param p_RS + * @param p_RR + * @return template SDP_bandwidth_list + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_SDP_SDP_Media_Desc_BandwidthList(template (present) SDP_media_field p_SDP_Media_Field, + template (present) integer p_AS := ?, + template (present) integer p_RS := ?, + template (present) integer p_RR := ?) return template SDP_bandwidth_list + { /* @sic R5s150704, R5s150751 - additional changes: new parameters p_AS, p_RS, p_RR sic@ */ + var template SDP_bandwidth_list v_BandwidthList := cr_SDP_Bandwidth_List_Media(p_AS, p_RS, p_RR); + var integer v_PortNumber; + + if (isvalue(p_SDP_Media_Field.ports.port_number)) { + v_PortNumber := valueof(p_SDP_Media_Field.ports.port_number); + if (v_PortNumber == 0) { // => release of the media stream + v_BandwidthList := *; + } + } + return v_BandwidthList; + } + + //---------------------------------------------------------------------------- + + template (value) SDP_attribute cs_SDP_Attribute_rtpmap(charstring p_PayloadType, + template (value) SDP_attribute_rtpmap_codec p_Codec) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + rtpmap := { + payload_type := p_PayloadType, + codec := p_Codec + } + }; + + template (present) SDP_attribute cr_SDP_Attribute_rtpmap(template (present) charstring p_PayloadType := cr_SDP_AnyMediaFormatDescr, + template (present) SDP_attribute_rtpmap_codec p_Codec) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + rtpmap := { + payload_type := p_PayloadType, + codec := p_Codec + } + }; + + template (value) SDP_attribute cs_SDP_Attribute_fmtp(charstring p_Fmt, + template (value) SDP_attribute_fmtp_format_specific_params p_FormatSpecificParameters) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + /* @sic R5w140113, R5w140009: new type definition sic@ */ + fmtp := { + format := p_Fmt, + params := p_FormatSpecificParameters + } + }; + + template (present) SDP_attribute cr_SDP_Attribute_fmtp(template (present) charstring p_Fmt := cr_SDP_AnyMediaFormatDescr, + template (present) SDP_attribute_fmtp_format_specific_params p_FormatSpecificParameters := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + /* @sic R5w140113, R5w140009: new type definition sic@ */ + fmtp := { + format := p_Fmt, + params := p_FormatSpecificParameters + } + }; + + template (value) SDP_attribute cs_SDP_Attribute_ptime(charstring p_Value := "20") := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + ptime := { + attr_value := p_Value + } + }; + + template (present) SDP_attribute cr_SDP_Attribute_ptime(template (present) charstring p_Value := "20") := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) */ + ptime := { + attr_value := p_Value + } + }; + + template (value) SDP_attribute cs_SDP_Attribute_maxptime(charstring p_Value := "240") := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + /* @sic R5w140113, R5w140009 sic@ */ + maxptime := { + attr_value := p_Value + } + }; + + template (present) SDP_attribute cr_SDP_Attribute_maxptime(template (present) charstring p_Value := "240") := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) */ + /* @sic R5w140113, R5w140009 sic@ */ + maxptime := { + attr_value := p_Value + } + }; + + template (value) SDP_attribute cs_SDP_Attribute_sendrecv := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + sendrecv := {} + }; + + template (value) SDP_attribute cs_SDP_Attribute_recvonly := + { /* @status APPROVED (IMS) */ + recvonly := {} + }; + + template (value) SDP_attribute cs_SDP_Attribute_sendonly := + { /* @status APPROVED (IMS) */ + sendonly := {} + }; + + template (value) SDP_attribute cs_SDP_Attribute_inactive := + { /* @status APPROVED (IMS, LTE, LTE_A) */ + inactive := {} + }; + + template (value) SDP_attribute cs_SDP_Attribute_content(template (value) charstring p_Value) := + { /* @status APPROVED (IMS) */ + content := { + { + p_Value + } + } + }; + + template (present) SDP_attribute cr_SDP_Attribute_sendrecv := + { /* @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT) */ + sendrecv := {} // @sic R5s130586 change 2 sic@ + }; + + template (present) SDP_attribute cr_SDP_Attribute_recvonly := + { /* @status APPROVED (IMS) */ + recvonly := {} + }; + + template (present) SDP_attribute cr_SDP_Attribute_sendonly := + { /* @status APPROVED (IMS) */ + sendonly := {} + }; + + template (present) SDP_attribute cr_SDP_Attribute_inactive := + { /* @status APPROVED (IMS, LTE, LTE_A) */ + inactive := {} // @sic R5s130586 change 1 sic@ + }; + + template (present) SDP_attribute cr_SDP_Attribute_AnySendRecvMode := (cr_SDP_Attribute_sendrecv, cr_SDP_Attribute_recvonly, cr_SDP_Attribute_sendonly, cr_SDP_Attribute_inactive); /* @status APPROVED (IMS) */ + + //---------------------------------------------------------------------------- + // precondition attributes + //---------------------------------------------------------------------------- + + template (value) SDP_attribute cs_SDP_Attribute_conf_qos(charstring p_StatusType := c_remote, + charstring p_Direction := c_sendrecv) := + { /* @status APPROVED (IMS, LTE, LTE_A) */ + conf := { + preconditionType := c_qos, + statusType := p_StatusType, + direction := p_Direction + } + }; + + template (present) SDP_attribute cr_SDP_Attribute_conf_qos(template (present) charstring p_StatusType := c_remote, + template (present) charstring p_Direction := c_sendrecv) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + conf := { + preconditionType := c_qos, + statusType := p_StatusType, + direction := p_Direction + } + }; + + template (value) SDP_attribute cs_SDP_Attribute_curr_qos(charstring p_StatusType, + charstring p_Direction := c_none) := + { /* @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT) */ + curr := { + preconditionType := c_qos, + statusType := p_StatusType, + direction := p_Direction + } + }; + + template (present) SDP_attribute cr_SDP_Attribute_curr_qos(template (present) charstring p_StatusType, + template (present) charstring p_Direction := c_none) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + curr := { + preconditionType := c_qos, + statusType := p_StatusType, + direction := p_Direction + } + }; + + template (value) SDP_attribute cs_SDP_Attribute_des_qos(charstring p_Strength, + charstring p_StatusType, + charstring p_Direction := c_sendrecv) := + { /* @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT) */ + des := { + preconditionType := c_qos, + strength := p_Strength, // @sic R5s120530 change 3.4 sic@ + statusType := p_StatusType, + direction := p_Direction + } + }; + + template (present) SDP_attribute cr_SDP_Attribute_des_qos(template (present) charstring p_Strength, + template (present) charstring p_StatusType, + template (present) charstring p_Direction := c_sendrecv) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + des := { + preconditionType := c_qos, + strength := p_Strength, + statusType := p_StatusType, + direction := p_Direction + } + }; + + template (value) SDP_attribute_list cs_SDP_PrecondionAttributes(charstring p_DirectionLocal, + charstring p_DirectionRemote, + charstring p_StrengthLocal := c_mandatory, + charstring p_StrengthRemote := c_mandatory) := + { /* @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT) */ + cs_SDP_Attribute_curr_qos(c_local, p_DirectionLocal), + cs_SDP_Attribute_curr_qos(c_remote, p_DirectionRemote), + cs_SDP_Attribute_des_qos(p_StrengthLocal, c_local), + cs_SDP_Attribute_des_qos(p_StrengthRemote, c_remote) + }; + + template (present) SDP_attribute_list cr_SDP_PrecondionAttributes(template (present) charstring p_DirectionLocal, + template (present) charstring p_DirectionRemote, + template (present) charstring p_StrengthLocal := c_mandatory, + template (present) charstring p_StrengthRemote := c_mandatory) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + cr_SDP_Attribute_curr_qos(c_local, p_DirectionLocal), + cr_SDP_Attribute_curr_qos(c_remote, p_DirectionRemote), + cr_SDP_Attribute_des_qos(p_StrengthLocal, c_local), + cr_SDP_Attribute_des_qos(p_StrengthRemote, c_remote) + }; + + /* + * @desc returns default attributes for audio (at least rtpmap, fmtp) + * @param p_FmtAudio + * @param p_AddMediaAttributes (default value: omit) + * @return template (value) SDP_attribute_list + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_SDP_MediaAttributes_AudioCommon(charstring p_FmtAudio, + template (omit) SDP_attribute_list p_AddMediaAttributes := omit) return template (value) SDP_attribute_list + { + var template (value) SDP_attribute_list v_MediaAttributes := { + cs_SDP_Attribute_rtpmap(p_FmtAudio, cs_RTPMAP_AMR_8000), + cs_SDP_Attribute_fmtp(p_FmtAudio, cs_AMR_Fmtp_DefaultParameters) + }; + return valueof(f_SDP_Attributes_Concat_TX(v_MediaAttributes, p_AddMediaAttributes)); + } + + /* + * @desc returns default attributes for EVS audio (at least rtpmap, fmtp) + * @param p_FmtAudio + * @param p_FmtpParameterList (default value: cs_EVS_Fmtp_AudioParamsDef) + * @param p_AddMediaAttributes (default value: omit) + * @return template (omit) SDP_attribute_list + * @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT) + */ + function f_SDP_MediaAttributes_EVS_AudioCommon(charstring p_FmtAudio, + template (value) SemicolonParam_List p_FmtpParameterList := cs_EVS_Fmtp_AudioParamsDef, + template (omit) SDP_attribute_list p_AddMediaAttributes := omit) return template (omit) SDP_attribute_list + { + var template (value) SDP_attribute_list v_MediaAttributes; + var template (value) SDP_attribute_fmtp_format_specific_params v_FmtpParameters := cs_Fmtp_ParamList(p_FmtpParameterList); + + v_MediaAttributes:= { + cs_SDP_Attribute_rtpmap(p_FmtAudio, cs_RTPMAP_EVS_16000), + cs_SDP_Attribute_fmtp(p_FmtAudio, v_FmtpParameters) + }; + return f_SDP_Attributes_Concat_TX(v_MediaAttributes, p_AddMediaAttributes); + } + + /* + * @desc returns default media attributes for audio (rtpmap, fmtp, ptime, maxptime) + * @param p_FmtAudio + * @param p_FmtpParameterList (default value: cs_EVS_Fmtp_AudioParamsDef) + * @param p_FmtpParameters (default value: cs_EVS_Fmtp_DefaultParameters) + * @return template (omit) SDP_attribute_list + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_SDP_MediaAttributes_AudioDef(charstring p_FmtAudio) return template (omit) SDP_attribute_list + { + var template (value) SDP_attribute_list v_AddMediaAttributes := {cs_SDP_Attribute_ptime, cs_SDP_Attribute_maxptime}; + return f_SDP_MediaAttributes_AudioCommon(p_FmtAudio, v_AddMediaAttributes); + } + + /* + * @desc returns default media attributes for audio (rtpmap, fmtp, ptime, maxptime) + * @param p_FmtAudio + * @param p_FmtpParameters (default value: cs_EVS_Fmtp_DefaultParameters) + * @return template (omit) SDP_attribute_list + * @status APPROVED (IMS, LTE, LTE_A) + */ + function f_SDP_MediaAttributes_EVS_AudioDef(charstring p_FmtAudio, + template (value) SemicolonParam_List p_FmtpParameterList := cs_EVS_Fmtp_AudioParamsDef) return template (omit) SDP_attribute_list + { + var template (value) SDP_attribute_list v_AddMediaAttributes := {cs_SDP_Attribute_ptime, cs_SDP_Attribute_maxptime}; + return f_SDP_MediaAttributes_EVS_AudioCommon(p_FmtAudio, p_FmtpParameterList, v_AddMediaAttributes); + } + + /* + * @desc returns default attributes for audio (at least rtpmap, fmtp) + * @param p_FmtAudio + * @param p_AddMediaAttributes (default value: omit) + * @return template (omit) SDP_attribute_list + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_SDP_MediaAttributes_AMR_WB_AudioCommon(charstring p_FmtAudio, + template (omit) SDP_attribute_list p_AddMediaAttributes := omit) + return template (omit) SDP_attribute_list + { + var template (value) SDP_attribute_list v_MediaAttributes := { + cs_SDP_Attribute_rtpmap(p_FmtAudio, cs_RTPMAP_AMR_16000), + cs_SDP_Attribute_fmtp(p_FmtAudio, cs_AMR_Fmtp_DefaultParameters) + }; + return f_SDP_Attributes_Concat_TX(v_MediaAttributes, p_AddMediaAttributes); + } + + //---------------------------------------------------------------------------- + // other attributes + //---------------------------------------------------------------------------- + + template (value) SDP_attribute cs_SDP_Attribute_ecn_capable_rtp(charstring p_InitVal, + charstring p_ParmVal) := + { /* @status APPROVED (IMS, LTE, LTE_A) */ + ecn_capable_rtp := { + init_list := { p_InitVal }, + parm_list := { p_ParmVal } + } + }; + + template (value) SDP_attribute cs_SDP_Attribute_rtcp_fb(charstring p_Rtcp_fb_pt, + charstring p_Rtcp_fb_val) := + { /* @status APPROVED (IMS, LTE, LTE_A) */ + rtcp_fb := { + rtcp_fb_pt := p_Rtcp_fb_pt, + rtcp_fb_val := p_Rtcp_fb_val + } + }; + + template (value) SDP_attribute cs_SDP_Attribute_rtcp_xr(charstring p_XR_Format) := + { /* @status APPROVED (IMS, LTE, LTE_A) */ + rtcp_xr := { + xr_format_list := { + p_XR_Format + } + } + }; + + template (value) SDP_attribute cs_SDP_Attribute_3ge2ae(charstring p_Indicator) := + { /* @status APPROVED (IMS, LTE, LTE_A) */ + e2ae := { + indicator := p_Indicator + } + }; + + template (value) SDP_attribute cs_SDP_Attribute_crypto(charstring p_Tag, + charstring p_Suite, + charstring p_KeyParams) := + { /* @status APPROVED (IMS, LTE, LTE_A) */ + crypto := { + tag := p_Tag, + crypto_suite := p_Suite, + key_params := p_KeyParams, + session_params := omit + } + }; + + template (value) SDP_attribute cs_SDP_Attribute_pcfg(integer p_ConfigNumber, + charstring p_PotCfg) := + { + pcfg := { + config_number := p_ConfigNumber, + pot_cfg_list := { p_PotCfg } + } + }; + + template (present) SDP_attribute cr_SDP_Attribute_pcfg(integer p_ConfigNumber, + charstring p_PotCfg) := + { /* @status APPROVED (IMS) */ + pcfg := { + config_number := p_ConfigNumber, + pot_cfg_list := { p_PotCfg, * } + } + }; + + template (present) SDP_attribute cr_SDP_Attribute_tcap(integer p_TrprCapNumber, + charstring p_Proto) := + { /* @status APPROVED (IMS) */ + tcap := { + trpr_cap_num := p_TrprCapNumber, + proto_list := { p_Proto, * } + } + }; + + template (value) SDP_attribute cs_SDP_Attribute_acfg(integer p_ConfigNumber, + charstring p_SelCfg) := + { /* @status APPROVED (IMS) */ + acfg := { + config_number := p_ConfigNumber, + sel_cfg_list := { p_SelCfg } + } + }; + + //---------------------------------------------------------------------------- + + template (value) SDP_bandwidth cs_SDP_Bandwidth(charstring p_Modifier, + integer p_Bandwidth) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + modifier := p_Modifier, + bandwidth := p_Bandwidth + }; + + template (present) SDP_bandwidth cr_SDP_Bandwidth(template charstring p_Modifier, + template integer p_Bandwidth) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + modifier := p_Modifier, + bandwidth := p_Bandwidth + }; + + template (value) SDP_bandwidth_list cs_SDP_Bandwidth_List_Media(integer p_AS := 37, + integer p_RS := 0, + integer p_RR := 0) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + /* @sic R5-144700: AS=37 per default sic@ */ + cs_SDP_Bandwidth("AS", p_AS), + cs_SDP_Bandwidth("RS", p_RS), + cs_SDP_Bandwidth("RR", p_RR) + }; + + template (present) SDP_bandwidth_list cr_SDP_Bandwidth_List_Media(template (present) integer p_AS := ?, + template (present) integer p_RS := ?, + template (present) integer p_RR := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + cr_SDP_Bandwidth("AS", p_AS), + cr_SDP_Bandwidth("RS", p_RS), + cr_SDP_Bandwidth("RR", p_RR) + }; + + template (value) SDP_bandwidth_list cs_SDP_Bandwidth_List_AS(integer p_Bandwidth) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + cs_SDP_Bandwidth("AS", p_Bandwidth) + }; + + template (present) SDP_bandwidth_list cr_SDP_Bandwidth_List_AS(template (present) integer p_Bandwidth := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + cr_SDP_Bandwidth("AS", p_Bandwidth), + * // @sic R5s130495 change 12 sic@ + }; + + //---------------------------------------------------------------------------- + + template (value) SDP_conn_addr cs_SDP_Conn_Addr(template (value) charstring p_IPAddr) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + addr := p_IPAddr, + ttl := omit, + num_of_addr := omit + }; + + template (present) SDP_conn_addr cr_SDP_Conn_Addr(template (present) charstring p_IPAddr) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + addr := p_IPAddr, + ttl := *, + num_of_addr := * + }; + + //---------------------------------------------------------------------------- + + template (value) SDP_connection cs_SDP_Connection(template (value) charstring p_AddrType, + template (value) charstring p_IPAddr) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + net_type := c_in, + addr_type := p_AddrType, + conn_addr := cs_SDP_Conn_Addr(p_IPAddr) + }; + + template (present) SDP_connection cr_SDP_Connection(template (present) charstring p_AddrType := ?, + template (present) charstring p_IPAddr := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + net_type := c_in, + addr_type := p_AddrType, + conn_addr := cr_SDP_Conn_Addr(p_IPAddr) + }; + + //---------------------------------------------------------------------------- + + template (value) SDP_media_field cs_SDP_Media(charstring p_Media, + integer p_LocalPort, + charstring p_Transport, + SDP_fmt_list p_Fmts) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + media := p_Media, + ports := { + port_number := p_LocalPort, + num_of_ports := omit + }, + transport := p_Transport, + fmts := p_Fmts + }; + + template (value) SDP_media_field cs_SDP_Media_MultiAudio(SDP_fmt_list p_Fmts, + integer p_LocalPort := tsc_IMS_MediaPort_M1, + charstring p_Transport := c_rtpAvp) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + cs_SDP_Media(c_audio, p_LocalPort, p_Transport, p_Fmts); + + template (value) SDP_media_field cs_SDP_Media_Audio(charstring p_Fmt, + integer p_LocalPort := tsc_IMS_MediaPort_M1, + charstring p_Transport := c_rtpAvp) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + cs_SDP_Media_MultiAudio({p_Fmt}, p_LocalPort, p_Transport); + + template (value) SDP_media_field cs_SDP_Media_Text(SDP_fmt_list p_Fmts, + integer p_LocalPort := tsc_IMS_MediaPort_M1, + charstring p_Transport := c_rtpAvp) := + cs_SDP_Media(c_text, p_LocalPort, p_Transport, p_Fmts); + + template (value) SDP_media_field cs_SDP_Media_Video(charstring p_Fmt, + integer p_LocalPort := tsc_IMS_MediaPort_M2, + charstring p_Transport := c_rtpAvpf) := + /* @status APPROVED (IMS) */ + /* @sic R5s141329 change 2.1 and R5s141336 change 2.3: c_rtpAvpf instead of c_rtpAvp as default value for p_Transport sic@ */ + cs_SDP_Media(c_video, p_LocalPort, p_Transport, {p_Fmt}); + + + + + template (present) SDP_fmt_list cr_SDP_FmtList_AtLeastOne(template (present) charstring p_Fmt) := { p_Fmt, * }; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + template (present) SDP_fmt_list cr_SDP_FmtList_AtLeastTwo(template (present) charstring p_Fmt1, + template (present) charstring p_Fmt2) := { p_Fmt1, p_Fmt2, * }; + + template (present) SDP_media_field cr_SDP_Media(charstring p_Media, + template (present) integer p_LocalPort := ?, + template (present) charstring p_Transport := c_rtpAvp, + template (present) SDP_fmt_list p_FmtList) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + media := p_Media, + ports := { + port_number := p_LocalPort, + num_of_ports := omit + }, + transport := p_Transport, + fmts := p_FmtList + }; + + template (present) SDP_media_field cr_SDP_Media_Audio(template (present) charstring p_Fmt := cr_SDP_AnyMediaFormatDescr, + template (present) integer p_LocalPort := ?, + template (present) charstring p_Transport := c_rtpAvp) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + cr_SDP_Media(c_audio, p_LocalPort, p_Transport, cr_SDP_FmtList_AtLeastOne(p_Fmt)); + + template (present) SDP_media_field cr_SDP_Media_Text(template (present) charstring p_Fmt1 := cr_SDP_AnyMediaFormatDescr, + template (present) charstring p_Fmt2 := cr_SDP_AnyMediaFormatDescr) := + cr_SDP_Media(c_text, -, -, cr_SDP_FmtList_AtLeastTwo(p_Fmt1, p_Fmt2)); + + template (present) SDP_media_field cr_SDP_Media_Video(template (present) charstring p_Fmt := cr_SDP_AnyMediaFormatDescr, + template (present) charstring p_Transport := c_rtpAvpf) := + /* @status APPROVED (IMS) */ + /* @sic R5s141221 change 2.3: p_Transport sic@ */ + /* @sic R5s141329 change 1 and R5s141336 change 1: c_rtpAvpf as default value for p_Transport sic@ */ + cr_SDP_Media(c_video, -, p_Transport, cr_SDP_FmtList_AtLeastOne(p_Fmt)); + + //---------------------------------------------------------------------------- + + template (value) SDP_Origin cs_SDP_Origin(charstring p_SessionId, + charstring p_SessionVersion, + template (value) charstring p_AddrType, + template (value) charstring p_IPAddr) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + /* @sic R5-150707: new parameter p_SessionId sic@ */ + user_name := "-", + session_id := p_SessionId, + session_version := p_SessionVersion, + net_type := c_in, + addr_type := p_AddrType, + addr := p_IPAddr + }; + + template (present) SDP_Origin cr_SDP_Origin(template (present) charstring p_AddrType := ?, + template (present) charstring p_IPAddr := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + user_name := ?, + session_id := ?, + session_version := ?, + net_type := c_in, + addr_type := p_AddrType, + addr := p_IPAddr + }; + + //---------------------------------------------------------------------------- + + template (value) SDP_time cs_SDP_Time(charstring p_Start, + charstring p_Stop) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + time_field := { + start_time := p_Start, + stop_time := p_Stop + }, + time_repeat := omit + }; + template (value) SDP_time cs_SDP_Time_0_0 := cs_SDP_Time("0", "0"); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + + + template (present) SDP_time cr_SDP_Time(template (present) charstring p_Start, + template (present) charstring p_Stop) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + time_field := { + start_time := p_Start, + stop_time := p_Stop + }, + time_repeat := omit + }; + template (present) SDP_time cr_SDP_Time_0_0 := cr_SDP_Time("0", "0"); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + template (present) SDP_time cr_SDP_Time_Any := cr_SDP_Time(?, ?); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + + //============================================================================ + + template (value) SDP_media_desc cs_SDP_Media_Desc(template (value) SDP_media_field p_SDP_Media_Field, + template (omit) SDP_bandwidth_list p_SDP_Bandwidth_List := omit, + template (omit) SDP_attribute_list p_SDP_Attribute_List := omit, + template (omit) SDP_connection_list p_SDP_Connection_List := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + media_field := p_SDP_Media_Field, + information := omit, + connections := p_SDP_Connection_List, + bandwidth := p_SDP_Bandwidth_List, + key := omit, + attributes := p_SDP_Attribute_List + }; + + template (present) SDP_media_desc cr_SDP_Media_Desc(template (present) SDP_media_field p_SDP_Media_Field, + template SDP_connection p_SDP_Connection, + template SDP_bandwidth_list p_SDP_Bandwidth_List, + template SDP_attribute_list p_SDP_Attribute_List) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + media_field := p_SDP_Media_Field, + information := omit, + connections := { p_SDP_Connection, * } ifpresent, + bandwidth := p_SDP_Bandwidth_List, + key := omit, + attributes := p_SDP_Attribute_List + }; + + //============================================================================ + + template (value) SDP_Message cs_SDP_Message_Common(template (value) SDP_Origin p_SDP_Origin, + template (omit) SDP_connection p_SDP_Connection, + template (omit) SDP_bandwidth_list p_Bandwidth, + template (value) SDP_time p_Time := cs_SDP_Time_0_0, + template (omit) SDP_media_desc_list p_SDP_Media_Desc_List := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + /* @sic R5s130510 change 4 - additional change sic@ */ + /* @sic R5-144700: default value removed for p_Bandwidth sic@ */ + /* @sic R5-150386: there is no reason anymore to provide a parameter for session_name anymore sic@ */ + protocol_version := 0, // v-line + origin := p_SDP_Origin, // o-line + session_name := tsc_SDP_NoSessionname, // s-line + information := omit, + uri := omit, + emails := omit, + phone_numbers := omit, + connection := p_SDP_Connection, // c-line + bandwidth := p_Bandwidth, // b-line + times := { p_Time }, // t-line + timezone_adjustments := omit, + key := omit, + attributes := omit, + media_list := p_SDP_Media_Desc_List + }; + + template (present) SDP_Message cr_SDP_Message_Common(template (present) charstring p_AddrType := ?, + template (present) charstring p_IPAddrOrigin := ?, + template (present) charstring p_IPAddrConnection := ?, + template SDP_bandwidth_list p_Bandwidth := cr_SDP_Bandwidth_List_AS, + template (present) SDP_time p_Time := cr_SDP_Time_0_0, + template SDP_media_desc_list p_SDP_Media_Desc_List := *) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + /* @sic R5-150386: there is no reason anymore to provide a parameter for session_name anymore sic@ */ + protocol_version := 0, // v-line + origin := cr_SDP_Origin(p_AddrType, p_IPAddrOrigin), // o-line + session_name := ?, // s-line + information := omit, + uri := omit, + emails := omit, + phone_numbers := omit, + connection := cr_SDP_Connection(p_AddrType, p_IPAddrConnection) ifpresent, // c-line + bandwidth := p_Bandwidth, // b-line + times := { p_Time }, // t-line + timezone_adjustments := omit, + key := omit, + attributes := omit, + media_list := p_SDP_Media_Desc_List + }; + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_SIP_Templates.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_SIP_Templates.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b78240256a7617693613025c29207950643946cc --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_SIP_Templates.ttcn @@ -0,0 +1,2380 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-15 19:05:27 +0200 (Tue, 15 Sep 2015) $ +// $Rev: 14431 $ +/******************************************************************************/ + +module IMS_SIP_Templates { + import from CommonDefs all; + import from CommonIP all; + import from IMS_CommonParameters all; + import from IMS_CommonDefs all; + import from IMS_CommonTemplates all; + import from IP_ASP_TypeDefs all; + import from Parameters all; + + import from LibSip_Common all; + import from LibSip_MessageBodyTypes all; + import from LibSip_SIPTypesAndValues all; + + const charstring tsc_SEC_MECHANISM := "ipsec-3gpp"; /* Security Mechanism name + @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + // Securiity algorithms for IPSEC + const charstring tsc_HMAC_MD5_96 := "hmac-md5-96"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + const charstring tsc_HMAC_SHA_1_96 := "hmac-sha-1-96"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + const charstring tsc_AKAv1_MD5 := "AKAv1-MD5"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + const charstring tsc_HTTP_MD5 := "MD5"; /* @status APPROVED (IMS) */ + const octetstring tsc_COLON_HEX := '3A'O; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + const integer tsc_MESSAGE_CSeqValue := 42; /* @status APPROVED (IMS, LTE_A) */ + + /* + * @desc generate URN acc. to rules given by RFC 7254 + * @param p_IMEI (default value: px_IMEI_Def) + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SIP_InstanceId(hexstring p_IMEI := px_IMEI_Def) return charstring + { + var charstring v_ImeiString := hex2str(p_IMEI); + var charstring v_InstanceId := ""; + + return v_InstanceId; + } + + template (present) GenericParam cr_FeatureParam_3gpp_icsi_ref := /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + cr_GenericParam_Common(tsc_IMS_FeatureParamId_3gpp_icsi_ref, cr_GenValueQuoted(cs_IMS_EncodedFeatureParamValue_3gpp_icsi_ref)); // @sic R5s120530 change 3.1, R5w140111, R5-142247 sic@ + + template (present) GenericParam cr_FeatureParam_Video := cr_GenericParam_Common("video", omit); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + template (present) SemicolonParam_List cr_SemicolonParam_List_WithAnyTag := /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + cr_SemicolonParam_List_OneSpecificParam(c_tagId, *); + + template (present) SemicolonParam_List cr_ExpiresInContactParams(template (present) charstring p_Expires := ?) := /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + cr_SemicolonParam_List_OneSpecificParamWithValue("expires", p_Expires); + + template (present) SemicolonParam_List cr_CPInstanceInContactParams := /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + cr_SemicolonParam_List_OneSpecificParamWithValue("+sip.instance", f_SIP_InstanceId()); /* @sic R5s141212, R5s150446 sic@ */ + + template (present) SemicolonParam_List cr_SMSParamInContactParams := /* @sic R5s120530 change 2.1 sic@ + @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + cr_SemicolonParam_List_OneSpecificParamNoValue("+g.3gpp.smsip"); + + template (present) SemicolonParam_List cr_VideoInContactParams := superset(cr_FeatureParam_Video); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + template (present) SemicolonParam_List cr_UriParameters_lr := superset(cr_GenericParam_Common("lr", omit)); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + template (present) SemicolonParam_List cr_UriParameters_gruu := superset(cr_GenericParam_Common("gr", cr_GenValueQuoted(tsc_IMS_PubGRUU_UriParameterValue))); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + + template (present) SemicolonParam_List cr_FeatureParamList_3gpp_icsi_ref := superset(cr_FeatureParam_3gpp_icsi_ref); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + template (present) SemicolonParam_List cr_RSRVCCInContactParams := /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + cr_SemicolonParam_List_OneSpecificParamNoValue("+g.3gpp.cs2ps-srvcc"); + + template (present) SemicolonParam_List cr_RSRVCCAlertInContactParams := /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + cr_SemicolonParam_List_OneSpecificParamNoValue("+g.3gpp.cs2ps-srvcc-alerting"); + + template (present) SemicolonParam_List cr_AccessTypeInContactParams := /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + cr_SemicolonParam_List_OneSpecificParamWithValue("+g.3gpp.accesstype", "cellular2"); + + template (present) SemicolonParam_List cr_SigCompParam := /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + cr_SemicolonParam_List_OneSpecificParamWithValue("comp", "sigcomp"); + + template (present) SemicolonParam_List cr_SecurityMechParams_IPsec(charstring p_Algorithm) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + cr_GenericParam("alg", p_Algorithm), + cr_GenericParam("spi-c", ?), + cr_GenericParam("spi-s", ?), + cr_GenericParam("port-c", ?), + cr_GenericParam("port-s", ?), + * + }; + + template (value) GenericParam cs_SigCompParam := cs_GenericParam("comp", "sigcomp"); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + //---------------------------------------------------------------------------- + const charstring c_norefersub := "norefersub"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + + const OptionTag_List tsc_OptionTagList_norefersub := {c_norefersub}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + const OptionTag_List tsc_OptionTagList_100rel := {c_tag100rel}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + // const OptionTag_List tsc_OptionTagList_geolocation := {"geolocation"}; /* @status APPROVED (IMS, LTE) */ + const OptionTag_List tsc_OptionTagList_precondition := {c_tagPrecond}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + const OptionTag_List tsc_OptionTagList_sec_agree := {"sec-agree"}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + const OptionTag_List tsc_OptionTagList_Empty := {}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + + /* + * @desc generate receive template expection all given option tags and any further ones + * @param p_RequestedTags + * @return template (present) OptionTag_List + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SIP_OptionTagListRX(OptionTag_List p_RequestedTags) return template (present) OptionTag_List + { /* @sic R5s141020 - MCC160 change: workarounds for "superset(all from p_TagList)" removed sic@ */ + var template (present) OptionTag_List v_TagList; + + v_TagList := superset(all from p_RequestedTags); // this is the solution acc. to V4.5.1 of the core language ... + + return v_TagList; + } + + //---------------------------------------------------------------------------- + + template (present) DisplayName cr_DisplayNameToken(charstring p_DisplayName) := {token := f_TokenPattern(p_DisplayName)}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + template (present) DisplayName cr_DisplayNameQuotedString(charstring p_DisplayName) := {quotedString := p_DisplayName}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + template (present) DisplayName cr_DisplayName(charstring p_DisplayName) := (cr_DisplayNameToken(p_DisplayName), cr_DisplayNameQuotedString(p_DisplayName)); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + + + template (present) NameAddr cr_NameAddr(template DisplayName p_DisplayName, + template (present) SipUrl p_SipUrl) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + /* @sic R5w140111: p_DisplayName - type changed from charstring to DisplayName sic@ */ + displayName := p_DisplayName, + addrSpec := p_SipUrl + }; + + template (present) NameAddr cr_NameAddr_NoDisplayName(template (present) SipUrl p_SipUrl) := cr_NameAddr(omit, p_SipUrl); + + template (value) NameAddr cs_NameAddr(template (value) SipUrl p_SipUrl) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + displayName := omit, + addrSpec := p_SipUrl + }; + + //---------------------------------------------------------------------------- + + //**************************************************************************** + // IEs (in alphatic order) + //---------------------------------------------------------------------------- + + template (present) Accept cr_AcceptDef (charstring p_MediaRange) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := ACCEPT_E, + acceptArgs := { + { + mediaRange := p_MediaRange, + acceptParam := omit + } + } + }; + + //---------------------------------------------------------------------------- + + template (value) AcceptBody cs_AcceptBody(charstring p_MediaRange) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + mediaRange := p_MediaRange, + acceptParam := omit + }; + + template (value) Accept cs_Accept(template (value) AcceptBody_List p_AcceptBodyList) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + fieldName := ACCEPT_E, + acceptArgs := p_AcceptBodyList + }; + + template (present) AcceptBody cr_AcceptBody(template (present) charstring p_MediaRange) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + mediaRange := p_MediaRange, + acceptParam := * + }; + + template (present) Accept cr_Accept(template (present) AcceptBody_List p_AcceptBodyList) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + fieldName := ACCEPT_E, + acceptArgs := p_AcceptBodyList + }; + + //---------------------------------------------------------------------------- + + template (present) AcceptContact cr_AcceptContact(template (present) GenericParam p_GenericParam := cr_GenericParam_Any) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + fieldName := ACCEPT_CONTACT_E, + acValues := { + { + wildcard := c_WILDCARD, + acRcParams := { p_GenericParam, * } + } + } + }; + + template (value) AcceptContact cs_AcceptContact(template (value) SemicolonParam_List p_ParamList) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + fieldName := ACCEPT_CONTACT_E, + acValues := { + { + wildcard := c_WILDCARD, + acRcParams := p_ParamList + } + } + }; + + //---------------------------------------------------------------------------- + + template (present) Addr_Union cr_Addr_Union_NameAddr(template (present) SipUrl p_SipUrl, + template DisplayName p_DisplayName := *) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + nameAddr := cr_NameAddr(p_DisplayName, p_SipUrl) + }; + + template (present) Addr_Union cr_Addr_Union_AddrSpecUnion(template (present) SipUrl p_SipUrl) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + addrSpecUnion := p_SipUrl + }; + + /* + * @desc return 'Addr_Union' to be used in receive templates + * @param p_SipUrl + * @param p_DisplayName (default value: *) + * @return template (present) Addr_Union + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_Addr_Union_RX(template (present) SipUrl p_SipUrl, + template DisplayName p_DisplayName := *) return template (present) Addr_Union + { + var template (present) Addr_Union v_Addr_Union; + + if (ispresent(p_DisplayName)) { + v_Addr_Union := cr_Addr_Union_NameAddr(p_SipUrl, p_DisplayName); + } else { + v_Addr_Union := (cr_Addr_Union_NameAddr(p_SipUrl, p_DisplayName), cr_Addr_Union_AddrSpecUnion(p_SipUrl)); + } + return v_Addr_Union; + } + + /* + * @desc get SipUrl from 'Addr_Union' union + * @param p_Addr_Union + * @return SipUrl + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_Addr_Union_GetSipUrl(template (omit) Addr_Union p_Addr_Union) return SipUrl + { + var SipUrl v_SipUrl; + + if (ischosen(p_Addr_Union.addrSpecUnion)) { + v_SipUrl := valueof(p_Addr_Union.addrSpecUnion); + } else { + v_SipUrl := valueof(p_Addr_Union.nameAddr.addrSpec); + } + return v_SipUrl; + } + + //---------------------------------------------------------------------------- + + template (present) AlertInfo cr_AlertInfo (template charstring p_AlertInfoUrl) := + { /* @status APPROVED (IMS) */ + fieldName := ALERT_INFO_E, + alertInfoBody := { + { + url := p_AlertInfoUrl, + genericParams := * + } + } + }; + + //---------------------------------------------------------------------------- + + template (present) Allow cr_Allow(template (present) charstring p_Method) := + { + fieldName := ALLOW_E, + methods := { p_Method } + }; + + template (value) Allow cs_Allow(charstring p_Method) := + { + fieldName := ALLOW_E, + methods := { p_Method } + }; + + //---------------------------------------------------------------------------- + + template (present) Authorization cr_AuthorizationInitial(charstring p_UserName, + charstring p_Realm, + template GenValue p_Nonce := cr_GenValue_None, + template GenValue p_Response := cr_GenValue_None) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + /* @sic R5w140111: GenValue sic@ */ + fieldName := AUTHORIZATION_E, + body := { + { + digestResponse := { + cr_GenericParam("username", p_UserName), + cr_GenericParam("realm", p_Realm), + cr_GenericParam_Common("nonce", p_Nonce), + cr_GenericParam("uri", "sip:" & p_Realm), + cr_GenericParam_Common("response", p_Response), // Response calculated by UE + * + } + } + } + }; + + template (present) Authorization cr_AuthorizationCommon(charstring p_UserName, + charstring p_Realm, + charstring p_Nonce, + template (present) charstring p_Uri, + charstring p_Algorithm, + template (present) charstring p_Nc := "00000001", + charstring p_Opaque := tsc_IMS_Opaque, + charstring p_Qop := "auth", + template (present) charstring p_Cnonce := ?, + template (present) charstring p_Response := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + /* @sic R5s130794 change 2: new parameters p_Algorithm, p_Uri; renamed to cr_AuthorizationCommon sic@ */ + fieldName := AUTHORIZATION_E, + body := { + { + digestResponse := { + cr_GenericParam("username", p_UserName), + cr_GenericParam("realm", p_Realm), + cr_GenericParam("nonce", p_Nonce), + cr_GenericParam("opaque", p_Opaque), + cr_GenericParam("uri", p_Uri), + cr_GenericParam("qop", p_Qop), + cr_GenericParam("cnonce", p_Cnonce), + cr_GenericParam("nc", p_Nc), + cr_GenericParam("response", p_Response), // Response calculated by UE + cr_GenericParam("algorithm", p_Algorithm), + * + } + } + } + }; + + template (present) Authorization cr_AuthorizationDef(charstring p_UserName, + charstring p_Realm, + charstring p_Nonce, + template (present) charstring p_Nc) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + /* @sic R5s130794 change 2: wrapper template sic@ */ + cr_AuthorizationCommon(p_UserName, p_Realm, p_Nonce, "sip:" & p_Realm, tsc_AKAv1_MD5, p_Nc); + + //---------------------------------------------------------------------------- + + template (present) CallId cr_CallId (template (present) charstring p_CallId) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := CALL_ID_E, + callid := p_CallId + }; + + template (value) CallId cs_CallId (charstring p_CallId) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := CALL_ID_E, + callid := p_CallId + }; + + //---------------------------------------------------------------------------- + + template (present) ContactAddress cr_ContactAddress(template DisplayName p_DisplayName, + template (present) SipUrl p_SipUrl, + template SemicolonParam_List p_ContactParams := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + /* @sic R5s140676 Change 1 sic@ */ + addressField := f_Addr_Union_RX(p_SipUrl, p_DisplayName), + contactParams := p_ContactParams + }; + + template (present) Contact cr_Contact(template (present) SipUrl p_SipUrl, + template SemicolonParam_List p_ContactParams := *) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := CONTACT_E, + contactBody := { + contactAddresses := { + cr_ContactAddress(*, p_SipUrl, p_ContactParams), + * + } + } + }; + + template (value) Contact cs_Contact(template (value) SipUrl p_SipUrl, + template (omit) SemicolonParam_List p_ContactParams := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := CONTACT_E, + contactBody := { + contactAddresses := { + { + addressField := { + nameAddr := cs_NameAddr(p_SipUrl) + }, + contactParams := p_ContactParams + } + } + } + }; + + template (present) Contact cr_Contact_Wildcard := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := CONTACT_E, + contactBody := { + wildcard := "*" + } + }; + + //---------------------------------------------------------------------------- + + template (present) ContentLength cr_ContentLength(template (present) integer p_Length := 0) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + fieldName := CONTENT_LENGTH_E, + len := p_Length + }; + + template (value) ContentLength cs_ContentLength(integer p_Length := -1) := + { // Note: The actual length shall be set by the encoder, see 34.229-3 clause 7.3.4 + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := CONTENT_LENGTH_E, + len := p_Length + }; + + //---------------------------------------------------------------------------- + + template (present) ContentType cr_ContentType(template (present) charstring p_MediaType) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + fieldName := CONTENT_TYPE_E, + mediaType := p_MediaType + }; + + template (present) ContentType cr_ContentTypeSDP := cr_ContentType("application/sdp"); /* @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT) */ + + template (value) ContentType cs_ContentType(charstring p_MediaType) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := CONTENT_TYPE_E, + mediaType := p_MediaType + }; + + template (value) ContentType cs_ContentTypeSDP := cs_ContentType("application/sdp"); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + + //---------------------------------------------------------------------------- + + template (present) CSeq cr_CseqDef(template (present) integer p_SeqNo, + charstring p_Method) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := CSEQ_E, + seqNumber := p_SeqNo, + method := p_Method + }; + + template (value) CSeq cs_CseqDef(template (value) integer p_SeqNo, + charstring p_Method) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := CSEQ_E, + seqNumber := p_SeqNo, + method := p_Method + }; + + //---------------------------------------------------------------------------- + + template (present) Event cr_EventDef (template (present) EventType p_EventType) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := EVENT_E, + eventType := p_EventType, + eventParams := omit + }; + + template (value) Event cs_EventDef (template (value) EventType p_EventType) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := EVENT_E, + eventType := p_EventType, + eventParams := omit + }; + + //---------------------------------------------------------------------------- + + template (present) Expires cr_Expires(template (present) charstring p_DeltaSec) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := EXPIRES_E, + deltaSec := p_DeltaSec + }; + + template (value) Expires cs_Expires(charstring p_DeltaSec) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := EXPIRES_E, + deltaSec := p_DeltaSec + }; + + //---------------------------------------------------------------------------- + + template (value) FeatureCaps cs_FeatureCaps(template (value) SemicolonParam_List p_ParamList) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := FEATURE_CAPS_E, + fcValues := { + { + wildcard := c_WILDCARD, + fcParams := p_ParamList // @sic R5-145796 sic@ + } + } + }; + + //---------------------------------------------------------------------------- + + template (present) From cr_From(template DisplayName p_DisplayName, + template (present) SipUrl p_SipUrl, + template (present) charstring p_Tag := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := FROM_E, + addressField := f_Addr_Union_RX(p_SipUrl, p_DisplayName), /* @sic R5s130378 change 3 sic@ */ + fromParams := { cr_GenericParam(c_tagId, p_Tag), * } + }; + + template (present) From cr_FromWithTag(template (present) SipUrl p_SipUrl, + template (present) charstring p_Tag := ?) := cr_From(*, p_SipUrl, p_Tag); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) @sic R5s130256 sic@ */ + + template (value) From cs_From(template (value) SipUrl p_SipUrl, + template (omit) charstring p_Tag := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := FROM_E, + addressField := { + nameAddr := cs_NameAddr(p_SipUrl) + }, + fromParams := { cs_GenericParam(c_tagId, p_Tag) } + }; + + //---------------------------------------------------------------------------- + + template (present) Geolocation cr_GeolocationAny := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + /* @sic R5-133151 update of header field structure sic@ */ + fieldName := GEOLOCATION_E, + addrSpec := ?, + geolocParam := * // @sic R5-133151 optinal parameter sic@ + }; + + template (present) GeolocationRouting cr_GeolocationRoutingAny := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + /* @sic R5-133151 sic@ */ + fieldName := GEOLOCATION_ROUTING_E, + state := ?, + genericValue := * + }; + + template (present) GeolocationRouting cr_GeolocationRoutingSupported := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + /* @sic R5-134798 sic@ */ + fieldName := GEOLOCATION_ROUTING_E, + state := ?, + genericValue := cr_GenericParam(?, "yes") /* @sic R5w140111: GenValue sic@ */ + }; + //---------------------------------------------------------------------------- + + template (value) HistoryInfoEntry cs_HistoryInfoEntry(template (value) SipUrl p_SipUrl) := + { /* @status APPROVED (IMS) */ + nameAddr := cs_NameAddr(p_SipUrl), + hiIndex := { 1 }, /* @sic R5s130195 BASELINE MOVING 2013 sic@ + @sic LibSip v.3.0.0: hiIndex changed to IntegerList sic@ */ + hiExtention := omit + }; + + template (value) HistoryInfo cs_HistoryInfo(template (value) SipUrl p_SipUrl) := + { /* @status APPROVED (IMS) */ + fieldName := HISTORY_INFO_E, + historyInfoList := { + cs_HistoryInfoEntry(p_SipUrl) + } + }; + + //---------------------------------------------------------------------------- + + template (present) HostPort cr_HostPort(template (present) charstring p_Host := ?, + template integer p_Port := *) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + host := p_Host, + portField := p_Port + }; + + template (value) HostPort cs_HostPort(charstring p_Host, + template (omit) integer p_Port := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + host := p_Host, + portField := p_Port + }; + + //---------------------------------------------------------------------------- + + template (present) MaxForwards cr_MaxForwardsDef(template (present) integer p_Value := (1..255)) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := MAX_FORWARDS_E, + forwards := p_Value + }; + + template (value) MaxForwards cs_MaxForwardsDef (template (value) integer p_Value := 67) := + { // p_Value := 67 -> any value + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := MAX_FORWARDS_E, + forwards := p_Value + }; + + //---------------------------------------------------------------------------- + template (value) NameAddrParam cs_NameAddrParam(template (value) SipUrl p_SipUrl) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + nameAddr := cs_NameAddr(p_SipUrl), + genericParams := omit + }; + + //---------------------------------------------------------------------------- + + template (present) PAccessNetworkInfo cr_PAccessNetworkInfoDef (template (present) charstring p_AccessType, + template GenValue p_GenValueCellId := *) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := P_ACCESS_NETWORK_INFO_E, + accessType := p_AccessType, + genericParams := { + cr_GenericParam_Common("utran-cell-id-3gpp", p_GenValueCellId), + * + } + }; + + //---------------------------------------------------------------------------- + + template (value) PAssertedID cs_PAssertedId (template (value) SipUrl p_SipUrl) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + fieldName := P_ASSERTED_ID_E, + pAssertedIDValueList := { + { + nameAddr := cs_NameAddr(p_SipUrl) + } + } + }; + + //---------------------------------------------------------------------------- + + template (present) PAssertedID cr_PAssertedId (template (present) SipUrl p_SipUrl) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + fieldName := P_ASSERTED_ID_E, + pAssertedIDValueList := { + { + nameAddr := cr_NameAddr(*, p_SipUrl) + } + } + }; + + //---------------------------------------------------------------------------- + + template (value) PAssertedService cs_PAssertedService(template (value) PAssertedServiceValue p_PAssertedServiceValue) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + fieldName := P_ASSERTED_SERVICE_E, + pAssertedServiceValue := p_PAssertedServiceValue + }; + + //---------------------------------------------------------------------------- + + template (value) PAssociatedURI cs_PAssociatedURI(template (value) NameAddrParam_List p_NameAddrParam) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := P_ASSOCIATED_URI_E, + nameAddrList := p_NameAddrParam + }; + + //---------------------------------------------------------------------------- + + template (value) Path cs_PathDef(charstring p_Host) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := PATH_E, + pathValues := { + { + nameAddr := cs_NameAddr(cs_SipUri_HostPort_lr(p_Host)), + rrParam := omit + } + } + }; + + //---------------------------------------------------------------------------- + + template (value) PCalledPartyID cs_PCalledPartyId(template (value) SipUrl p_SipUrl) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + fieldName := P_CALLED_PARTY_E, + nameAddParams := cs_NameAddrParam(p_SipUrl) + }; + + //---------------------------------------------------------------------------- + + template (value) PEarlyMedia cs_PEarlyMedia(template (value) EM_List p_EmList) := + { /* @status APPROVED (IMS, LTE, LTE_A) */ + fieldName := P_EARLY_MEDIA_E, + em_param := p_EmList + }; + + //---------------------------------------------------------------------------- + + template (present) PPreferredID cr_PPreferredID(template (present) PPreferredIDValue_List p_PPreferredIDList := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + fieldName := P_PREFERRED_ID_E, + pPreferredIDValueList := p_PPreferredIDList + }; + + //---------------------------------------------------------------------------- + + template (present) PPreferredService cr_PPreferredService(template (present) charstring p_ServiceId := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + fieldName := P_PREFERRED_SERVICE_E, + serviceId := p_ServiceId + }; + + //---------------------------------------------------------------------------- + + template (present) ProxyRequire cr_ProxyRequireDef := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := PROXY_REQUIRE_E, + optionsTags := { "sec-agree", *} + }; + + //---------------------------------------------------------------------------- + + template (value) RAck cs_RAckDef(template (value) integer p_RSeq, + template (value) integer p_CSeq, + template (value) charstring p_Method) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + fieldName := RACK_E, + responseNum := p_RSeq, + seqNumber := p_CSeq, + method := p_Method + }; + + template (present) RAck cr_RAckDef(template (present) integer p_RSeq, + template (present) integer p_CSeq, + template (present) charstring p_Method) := + { /* @status APPROVED (IMS, LTE, LTE_A) */ + fieldName := RACK_E, + responseNum := p_RSeq, + seqNumber := p_CSeq, + method := p_Method + }; + + //---------------------------------------------------------------------------- + + template (present) ReasonValue cr_ReasonValue(template (present) SemicolonParam_List p_ReasonParams) := + { /* @status APPROVED (LTE_A, LTE_IRAT) */ + token := "SIP", + reasonParams := p_ReasonParams + }; + + /* + * @desc local function to set the parameters + * @param p_CauseValue + * @param p_Text + * @return template (present) ReasonValue + * @status APPROVED (LTE_A, LTE_IRAT) + */ + function fl_ReasonValues(integer p_CauseValue, + template charstring p_Text) return template (present) ReasonValue + { + var template (present) SemicolonParam_List v_ReasonParams; + + if (ispresent(p_Text)) { + v_ReasonParams := { + cr_GenericParam("cause", int2str(p_CauseValue)), + cr_GenericParam("text", p_Text), // complier warning cannot be avoided + * + }; + } else { + v_ReasonParams := { + cr_GenericParam("cause", int2str(p_CauseValue)), + * + }; + } + return cr_ReasonValue(v_ReasonParams); + }; + + template (present) Reason cr_Reason(integer p_CauseValue, + template charstring p_Text := omit) := + { /* @status APPROVED (LTE_A, LTE_IRAT) */ + fieldName := REASON_E, + reasonValues := { + fl_ReasonValues(p_CauseValue, p_Text) + } + }; + + //---------------------------------------------------------------------------- + + template (value) RecordRoute cs_RecordRoute(template (value) RouteBody_List p_RouteBodyList) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := RECORD_ROUTE_E, + routeBody := p_RouteBodyList + }; + + template (present) RecordRoute cr_RecordRoute(template (present) RouteBody_List p_RouteBodyList) := + { + fieldName := RECORD_ROUTE_E, + routeBody := p_RouteBodyList + }; + + //---------------------------------------------------------------------------- + + template (value) InfoPackage_Type cs_InfoPackage_Type(charstring p_Name, + template (omit) SemicolonParam_List p_InfoPackageParams := omit) := + { + infoPackageName := p_Name, + infoPackageParams := p_InfoPackageParams + }; + + template (value) RecvInfo cs_RecvInfo (template (value) InfoPackage_List p_InfoPackage_List) := + { + fieldName := RECV_INFO_E, + infoPackageList := p_InfoPackage_List + }; + + template (present) InfoPackage_Type cr_InfoPackage_Type(charstring p_Name, + template SemicolonParam_List p_InfoPackageParams := *) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + infoPackageName := p_Name, + infoPackageParams := p_InfoPackageParams + }; + + template (present) RecvInfo cr_RecvInfo (template (present) InfoPackage_List p_InfoPackage_List) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + fieldName := RECV_INFO_E, + infoPackageList := p_InfoPackage_List + }; + + //---------------------------------------------------------------------------- + template (value) ReferredBy cs_ReferredBy (template (value) SipUrl p_SipUrl) := + { + fieldName := REFERRED_BY_E, + nameAddr := cs_NameAddr(p_SipUrl), + referredbyIdParams := omit + }; + + template (present) ReferredBy cr_ReferredBy (template (present) SipUrl p_SipUrl) := + { + fieldName := REFERRED_BY_E, + nameAddr := cr_NameAddr(*, p_SipUrl), + referredbyIdParams := * + }; + + //---------------------------------------------------------------------------- + + template (present) ReferTo cr_ReferTo(template (present) SipUrl p_SipUrl) := + { /* @status APPROVED (IMS) */ + fieldName := REFER_TO_E, + nameAddr := cr_NameAddr(*, p_SipUrl), + referToParams := omit + }; + + template (value) ReferTo cs_ReferTo (template (value) SipUrl p_SipUrl, + template (omit) SemicolonParam_List p_ReferToParams := omit) := + { + fieldName := REFER_TO_E, + nameAddr := cs_NameAddr(p_SipUrl), + referToParams := p_ReferToParams + }; + + //---------------------------------------------------------------------------- + + template (present) RequestDisposition cr_RequestDisposition(template (present) Directive_List p_Directives) := + { + fieldName := REQUEST_DISPOSITION_E, + directives := p_Directives + }; + + template (value) RequestDisposition cs_RequestDisposition(template (value) Directive_List p_Directives) := + { /* @status APPROVED (IMS) */ + fieldName := REQUEST_DISPOSITION_E, + directives := p_Directives + }; + + //---------------------------------------------------------------------------- + + template (present) RequestLine cr_RequestLineSip(Method p_Method, + template (present) SipUrl p_URI) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + method := p_Method, + requestUri := p_URI, + sipVersion := c_sipNameVersion + }; + + template (value) RequestLine cs_RequestLineSip(Method p_Method, + template (value) SipUrl p_URI) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + method := p_Method, + requestUri := p_URI, + sipVersion := c_sipNameVersion + }; + + //---------------------------------------------------------------------------- + + template (present) Require cr_Require(OptionTag_List p_OptionTags) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := REQUIRE_E, + optionsTags := f_SIP_OptionTagListRX(p_OptionTags) // @sic R5-133629 sic@ + }; + + template (present) Require cr_RequireSecAgree := cr_Require(tsc_OptionTagList_sec_agree); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + @sic R5-133629 sic@ */ + + template (value) Require cs_Require(OptionTag_List p_OptionTags) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE_A, LTE, LTE_IRAT) */ + fieldName := REQUIRE_E, + optionsTags := p_OptionTags + }; + + //---------------------------------------------------------------------------- + + template (value) RetryAfter cs_RetryAfter (integer p_Secs) := + { /* @status APPROVED (IMS) */ + fieldName := RETRY_AFTER_E, + deltaSec := int2str(p_Secs), + comment := omit, + retryParams := omit + }; + + //---------------------------------------------------------------------------- + + template (present) RouteBody cr_RouteBody(template DisplayName p_DisplayName, + template (present) SipUrl p_SipUrl, + template SemicolonParam_List p_RRParam := *) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + nameAddr := cr_NameAddr(p_DisplayName, p_SipUrl), + rrParam := p_RRParam + }; + + template (present) RouteBody_List cr_RouteBodyList_InitialReq(template integer p_PcscfPort := *, + template (present) charstring p_PcscfHost := ?, + charstring p_ScscfHost := px_IMS_Scscf) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + cr_RouteBody(omit, cr_SipUri_HostPort_lr(p_PcscfHost, p_PcscfPort)), + cr_RouteBody(omit, cr_SipUri_HostPort_lr(p_ScscfHost)) + }; + + template (value) RouteBody cs_RouteBody(template (value) SipUrl p_SipUrl, + template (omit) SemicolonParam_List p_RRParam := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + nameAddr := cs_NameAddr(p_SipUrl), + rrParam := p_RRParam + }; + + /* + * @desc return RouteBody with given parameters + * @param p_SipUrl + * @param p_SigCompParam (default value: omit) + * @return template (value) RouteBody + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_RouteBodyWithParamsTX(template (value) SipUrl p_SipUrl, + template (omit) GenericParam p_SigCompParam := omit) return template (value) RouteBody + { + var template (omit) SemicolonParam_List v_RRParamList := omit; + if (isvalue(p_SigCompParam)) { + v_RRParamList[0] := p_SigCompParam; + } + return cs_RouteBody(p_SipUrl, v_RRParamList); + } + + //---------------------------------------------------------------------------- + + template (present) Route cr_Route(template RouteBody_List p_RouteBodyList) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := ROUTE_E, + routeBody := p_RouteBodyList + }; + + template (value) Route cs_Route(template (value) RouteBody_List p_RouteBodyList) := + { + fieldName := ROUTE_E, + routeBody := p_RouteBodyList + }; + + //---------------------------------------------------------------------------- + + template (present) RSeq cr_RSeq(template (present) integer p_ResponseNum) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + fieldName := RSEQ_E, + responseNum := p_ResponseNum + }; + + template (value) RSeq cs_RSeq(integer p_ResponseNum) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE_A, LTE, LTE_IRAT) */ + fieldName := RSEQ_E, + responseNum := p_ResponseNum + }; + + //---------------------------------------------------------------------------- + + template (present) SecurityClient cr_SecClientMandatoryFields := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := SECURITY_CLIENT_E, + securityMech := { + // cr_SecurityMechanism(cr_SecurityMechParams_IPsec(tsc_HMAC_MD5_96)), @sic R5-144131 sic@ + cr_SecurityMechanism(cr_SecurityMechParams_IPsec(tsc_HMAC_SHA_1_96)), + * + } + }; + + template (present) SecurityClient cr_SecClientOptionalFields(charstring p_Id, + template GenValue p_GenValue := *) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + /* @sic R5w140111: GenValue sic@ */ + fieldName := SECURITY_CLIENT_E, + securityMech := { + cr_SecurityMechanism(cr_SemicolonParam_List_OneSpecificParam(p_Id, p_GenValue)), + cr_SecurityMechanism(cr_SemicolonParam_List_OneSpecificParam(p_Id, p_GenValue)), + * + } + }; + + template (present) SecurityClient cr_SecClientOptionalProt := cr_SecClientOptionalFields("prot", cr_GenValue("esp")); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + template (present) SecurityClient cr_SecClientOptionalProtAny := cr_SecClientOptionalFields("prot"); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + template (present) SecurityClient cr_SecClientOptionalMod := cr_SecClientOptionalFields("mod", cr_GenValue("trans")); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + template (present) SecurityClient cr_SecClientOptionalModAny := cr_SecClientOptionalFields("mod"); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + template (present) SecurityClient cr_SecClientEalg := cr_SecClientOptionalFields("ealg", cr_GenValue(("des-ede3-cbc", "aes-cbc"))); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + template (present) SecurityClient cr_SecClientEalgNull := cr_SecClientOptionalFields("ealg", cr_GenValue("null")); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + template (present) SecurityClient cr_SecClientEalgAny := cr_SecClientOptionalFields("ealg"); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + //---------------------------------------------------------------------------- + + template (present) SecurityMechanism cr_SecurityMechanism(template SemicolonParam_List p_MechParams) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + mechName := tsc_SEC_MECHANISM, + mechParams := p_MechParams + }; + + //---------------------------------------------------------------------------- + + template (value) SecurityServer cs_SecServerDef(template (value) SecurityMechanism_List p_SecurityMech) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := SECURITY_SERVER_E, + securityMech := p_SecurityMech + }; + + //---------------------------------------------------------------------------- + + template (present) SecurityVerify cr_SecVerifyDef (template (present) SecurityMechanism_List p_SecurityMech) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := SECURITY_VERIFY_E, + securityMech := p_SecurityMech + }; + + //---------------------------------------------------------------------------- + + template (value) ServiceRoute cs_ServiceRouteDef (charstring p_Host) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := SERVICE_ROUTE_E, + routeBody := { + cs_RouteBody(cs_SipUri_HostPort_lr(p_Host)) + } + }; + + //---------------------------------------------------------------------------- + + template (present) SessIdString cr_SessIdString_Any := pattern "[0-9a-f]#32"; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + template (present) SessionId cr_SessionId(template (present) SessIdString p_SessIdString := cr_SessIdString_Any) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := SESSION_ID_E, + sessid := p_SessIdString, + sessidParam := * + }; + + /* + * @desc return either omit or cr_SessionId (any session id) + * @param p_SessionIdSupported + * @return template SessionId + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IMS_SessionId_RX_IfSupported(boolean p_SessionIdSupported) return template SessionId + { + var template SessionId v_SessionId := omit; + if (p_SessionIdSupported) { + v_SessionId := cr_SessionId + } + return v_SessionId; + } + + template (value) SessionId cs_SessionId(SessIdString p_SessIdString) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := SESSION_ID_E, + sessid := p_SessIdString, + sessidParam := omit + }; + + /* + * @desc return Session-ID (see RFC 7329) + * @param p_CallId + * @return SessIdString + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_IMS_SessionId_TX_Generate(charstring p_CallId) return SessIdString + { /* NOTE: in terms of UE conformance testing there seems to be no requirement on the session ID rather than that is is unique for different call ids + * => we use a simplified algorithm to get the 32 digit session id out from the given call id (rather than SHA-1 hashing acc. to RFC 7329) */ + /* @sic R5s150086 sic@ */ + var B128_Type v_B128 := int2bit(0, 128); + var octetstring v_OctetString := char2oct(p_CallId); + var SessIdString v_SessIdString; + var integer v_Len; + var integer i; + + for (i := 0; i < 15; i := i + 1) { v_OctetString := v_OctetString & '5C'O; } // 15 octets padding + + while (true) { + v_Len := lengthof(v_OctetString); + if (v_Len < 16) {break;} + v_B128 := v_B128 xor4b oct2bit(substr(v_OctetString, 0, 16)); + v_OctetString := substr(v_OctetString, 16, v_Len - 16); + } + v_SessIdString := oct2str(bit2oct(v_B128)); + return f_StringToLower(v_SessIdString); // acc. RFC 7329 the Session-ID Value has to be lowercase hex representation + } + + //---------------------------------------------------------------------------- + + template (value) SIP_ETag cs_SIP_ETag(EntityTag p_EntityTag) := { + fieldName := SIP_ETAG_E, + entityTag := p_EntityTag + }; + + //---------------------------------------------------------------------------- + + template (present) UriComponents cr_SipUriComponent(template UserInfo p_UserInfo := *, + template (present) charstring p_Host, + template integer p_Port := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + sip := { + userInfo := p_UserInfo, + hostPort := { + host := p_Host, + portField := p_Port + } + } + }; + + template (present) UriComponents cr_SipUrl_SOS := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + urn := { + namespaceId := "service", + namespaceSpecificString := pattern "sos*" + } + }; + + template (present) SipUrl cr_SipUrl_Common(template (present) charstring p_Scheme, + template (present) UriComponents p_UriComponents, + template SemicolonParam_List p_Params := *) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + scheme := p_Scheme, + components := p_UriComponents, + urlParameters := p_Params, + headers := omit + }; + + template (present) SipUrl cr_SipUri_HostPort_lr(template (present) charstring p_Host, + template integer p_Port := omit) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + /* @sic R5s130195 BASELINE MOVING 2013: change of SipUrl sic@ */ + cr_SipUrl_Common(c_sipScheme, cr_SipUriComponent(*, p_Host, p_Port), cr_UriParameters_lr); /* @sic R5s120858 change 4, 5 sic@ + @sic R5-153760: cr_UriParameters_lr sic@ */ + + template (present) SipUrl cr_SipUri_HostPort(template (present) charstring p_Host, + template integer p_Port := omit) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + /* @sic R5s130195 BASELINE MOVING 2013: change of SipUrl sic@ */ + cr_SipUrl_Common(c_sipScheme, cr_SipUriComponent(*, p_Host, p_Port)); /* @sic R5s120858 change 4, 5 sic@ */ + + /* + * @desc Build up SipUri to be used in Contact header depending on whether or not GRUU shall be used by the UE + * @param p_Host + * @param p_Port + * @return template (present) SipUrl + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_Contact_SipUri_HostPortRX(template (present) charstring p_Host, + template integer p_Port := *) return template (present) SipUrl + { + var template integer v_Port := p_Port; + if (pc_IMS_GRUUsInSIP) { + v_Port := *; + } + return cr_SipUri_HostPort(p_Host, v_Port); + } + + template (value) UriComponents cs_SipUriComponent(template (omit) UserInfo p_UserInfo := omit, + template (value) charstring p_Host, + template (omit) integer p_Port := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + sip := { + userInfo := p_UserInfo, + hostPort := { + host := p_Host, + portField := p_Port + } + } + }; + + template (value) UriComponents cs_TelUriComponent(template (value) charstring p_Subscriber) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + tel := { + subscriber := p_Subscriber + } + }; + + template (value) UriComponents cs_UrnUriComponent(template (value) charstring p_NamespaceId, + template (value) charstring p_NamespaceSpecificString) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + urn := { + namespaceId := p_NamespaceId, + namespaceSpecificString := p_NamespaceSpecificString + } + }; + + template (value) UriComponents cs_OtherComponent(charstring p_Other) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + other := p_Other + }; + + template (value) SipUrl cs_SipUrl_Common(template (value) charstring p_Scheme, + template (value) UriComponents p_UriComponents, + template (omit) SemicolonParam_List p_Params := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + scheme := p_Scheme, + components := p_UriComponents, + urlParameters := p_Params, + headers := omit + }; + + template (value) SipUrl cs_SipUri_HostPort_lr(template (value) charstring p_Host, + template (omit) integer p_Port := omit) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + /* @sic R5s130195 BASELINE MOVING 2013: change of SipUrl sic@ */ + cs_SipUrl_Common(c_sipScheme, cs_SipUriComponent(-, p_Host, p_Port), {cs_GenericParam("lr")} ); + + template (value) SipUrl cs_SipUri_HostPort(template (value) charstring p_Host, + template (omit) integer p_Port := omit) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + /* @sic R5s130195 BASELINE MOVING 2013: change of SipUrl sic@ */ + cs_SipUrl_Common(c_sipScheme, cs_SipUriComponent(-, p_Host, p_Port)); + + template (value) SipUrl cs_SipUri_UserHostPort(charstring p_UserName, + template (value) charstring p_Host, + template (omit) integer p_Port := omit) := + /* @status APPROVED (IMS) */ + cs_SipUrl_Common(c_sipScheme, cs_SipUriComponent(cs_UserInfo(p_UserName), p_Host, p_Port)); + + //---------------------------------------------------------------------------- + + template (value) SubscriptionState cs_SubscriptionState(charstring p_SubstateValue, + template (value) SemicolonParam_List p_SubStateParams) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := SUBSCRIPTION_STATE_E, + subState := p_SubstateValue, + substateParams := p_SubStateParams + }; + + template (value) SubscriptionState cs_SubscriptionStateDef(charstring p_SubstateValue, + charstring p_Expires) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + cs_SubscriptionState(p_SubstateValue, { cs_GenericParam("expires", p_Expires) } ); + + template (value) SubscriptionState cs_SubscriptionState_Active(charstring p_Expires := "600000") := cs_SubscriptionStateDef("active", p_Expires); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + template (value) SubscriptionState cs_SubscriptionState_Terminated := cs_SubscriptionStateDef("terminated", "0"); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + + + template (present) SubscriptionState cr_SubscriptionState(charstring p_SubstateValue, + template SemicolonParam_List p_SubStateParams) := + { + fieldName := SUBSCRIPTION_STATE_E, + subState := p_SubstateValue, + substateParams := p_SubStateParams + }; + + //---------------------------------------------------------------------------- + + template (present) Supported cr_Supported(OptionTag_List p_RequestedTags) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + /* @sic R5-133629: handling of option tags in Supported and Require headers sic@ */ + fieldName := SUPPORTED_E, + optionsTags := f_SIP_OptionTagListRX(p_RequestedTags) + }; + + template (present) Supported cr_Supported_Register := cr_Supported(f_SIP_Register_SupportedTagList(pc_IMS_GRUUsInSIP)); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + template (value) Supported cs_Supported(template (value) OptionTag_List p_TagList) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + fieldName := SUPPORTED_E, + optionsTags := p_TagList + }; + + //---------------------------------------------------------------------------- + + template (present) To cr_ToCommon(template (present) SipUrl p_SipUrl, + template SemicolonParam_List p_Params := *) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := TO_E, + addressField := f_Addr_Union_RX(p_SipUrl), + toParams := p_Params + }; + + template (present) To cr_ToDef(template (present) SipUrl p_SipUrl, + template SemicolonParam_List p_Params := *) := cr_ToCommon(p_SipUrl, p_Params); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + @sic R5s130378 change 3 sic@ */ + + template (present) To cr_ToWithTag(template (present) SipUrl p_SipUrl, + template (present) charstring p_Tag := ?) := cr_ToCommon(p_SipUrl, {cr_GenericParam(c_tagId, p_Tag), *}); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + @sic R5s130183 sic@ */ + + template (value) To cs_ToDef(template (value) SipUrl p_SipUrl, + template (omit) SemicolonParam_List p_Params := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := TO_E, + addressField := { + nameAddr := cs_NameAddr(p_SipUrl) + }, + toParams := p_Params + }; + + template (value) To cs_ToWithTag(template (value) SipUrl p_SipUrl, + template (value) charstring p_Tag) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + cs_ToDef(p_SipUrl, { cs_GenericParam(c_tagId, p_Tag) }); + + //---------------------------------------------------------------------------- + /* + * @desc build up receive template for paramter list to be used in the Via header + * @param p_Rport (default value: omit) + * @return template (present) SemicolonParam_List + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_ViaParamsRX(template GenericParam p_Rport := omit) return template (present) SemicolonParam_List + { /* @sic R5s130187 change 6: "*" needed at the end of the list sic@ */ + var template (present) SemicolonParam_List v_ParamList; + var template (present) GenericParam v_Branch := cr_GenericParam(c_branchId, pattern c_branchCookie & "*"); // @sic R5s120530 change 1.9 sic@ + + if (ispresent(p_Rport)) { + v_ParamList := { v_Branch, p_Rport, * }; + } else { + v_ParamList := { v_Branch, * }; + } + + return v_ParamList; + } + + template (present) ViaBody cr_ViaBody(template (present) charstring p_Transport, + template (present) HostPort p_SendBy, + template (present) SemicolonParam_List p_ViaParams := f_ViaParamsRX()) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + sentProtocol := { + protocolName := c_sipName, + protocolVersion := c_sipVersion, + transport := p_Transport + }, + sentBy := p_SendBy, + viaParams := p_ViaParams + }; + + template (present) Via cr_ViaDef(template (present) charstring p_Transport := ?, + template (present) HostPort p_HostPort := cr_HostPort(?, *), + template GenericParam p_Rport := omit) := + { /* for initial request p_Rport may need to be set to "cr_GenericParam("rport", ?)" see 34.229-1 A.1.1 condition A1 */ + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := VIA_E, + viaBody := { + cr_ViaBody(p_Transport, p_HostPort, f_ViaParamsRX(p_Rport)) + } + }; + + template (present) Via cr_ViaInitialReg(template (present) charstring p_Transport := ?, + template (present) HostPort p_HostPort := cr_HostPort(?, *)) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + cr_ViaDef(p_Transport, p_HostPort, cr_GenericParam_Common("rport", omit)); // @sic R5s120907 change 8 - rport has no value sic@ + + + /* + * @desc Via header to be used for responses sent by the UE + * @param p_ViaRequest + * @return template (present) Via + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_Via_ResponseRX(template (value) Via p_ViaRequest) return template (present) Via + { /* @sic R5s140350: as format of IPv6 addresses may change we need to check host addresses seperately sic@ */ + var template (present) Via v_ViaRespone := p_ViaRequest; + var integer i; + + for (i:=0; i < lengthof(v_ViaRespone.viaBody); i:=i+1) { + v_ViaRespone.viaBody[i].sentBy.host := ?; + } + return v_ViaRespone; + } + + /* + * @desc return Via parameters to be sent to the UE + * @param p_Branch + * @param p_SigCompParam (default value: omit) + * @return template (value) SemicolonParam_List + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_ViaParamsTX(template (value) charstring p_Branch, + template (omit) GenericParam p_SigCompParam := omit) return template (value) SemicolonParam_List + { + var template (value) SemicolonParam_List v_ParamList; + v_ParamList[0] := cs_GenericParam(c_branchId, p_Branch); + if (isvalue(p_SigCompParam)) { + v_ParamList[1] := valueof(p_SigCompParam); + } + return v_ParamList; + } + + template (value) ViaBody cs_ViaBody(template (value) charstring p_Transport, + template (value) HostPort p_SendBy, + template (omit) SemicolonParam_List p_ViaParams := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + sentProtocol := { + protocolName := c_sipName, + protocolVersion := c_sipVersion, + transport := p_Transport + }, + sentBy := p_SendBy, + viaParams := p_ViaParams + }; + + template (value) Via cs_Via(template (value) ViaBody_List p_BodyList) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + fieldName := VIA_E, + viaBody := p_BodyList + }; + + //---------------------------------------------------------------------------- + + template (value) WwwAuthenticate cs_WwwAuthChallenge(charstring p_Realm, + charstring p_Nonce, + charstring p_Opaque := tsc_IMS_Opaque, + charstring p_Algorithm := tsc_AKAv1_MD5) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + /* @sic R5s130794 change 2: new parameter p_Algorithm sic@ */ + fieldName := WWW_AUTHENTICATE_E, + challenge := { + digestCln := { + cs_GenericParamQuoted("realm", p_Realm), // acc. to RFC 3261 cl. 25.1 realm-value is quoted-string + cs_GenericParamToken("algorithm", p_Algorithm), // acc. to RFC 3261 cl. 25.1 algorithm is token + cs_GenericParamQuoted("qop", "auth"), // acc. to RFC 3261 cl. 25.1 qop-options are quoted-string (even though qop-value is token; @sic R5s140565 change 4 sic@) + cs_GenericParamQuoted("nonce", p_Nonce), // acc. to RFC 3261 cl. 25.1 nonce-value is quoted-string + cs_GenericParamQuoted("opaque", p_Opaque) // acc. to RFC 3261 cl. 25.1 opaque is quoted-string + } + } + }; + + /******************************************************************************/ + /* AuxiliaryFunctions */ + /******************************************************************************/ + + /* + * @desc returns the tag from the From header (NOTE: there has to be a from-tag) + * @param p_MessageHeader + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_MessageHeader_GetFromTag(template (value) MessageHeader p_MessageHeader) return charstring + { + return f_SIP_SemicolonParamList_GetParamValue(p_MessageHeader.fromField.fromParams, c_tagId); + } + + /* + * @desc returns the tag from the To header or omit when there is no to-tag + * (in contrast to the From header the tag may be missing in the To header) + * @param p_MessageHeader + * @return template (omit) charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_MessageHeader_GetToTag(template (value) MessageHeader p_MessageHeader) return template (omit) charstring + { /* @sic R5w140111: GenValue sic@ */ + var template (omit) GenericParam v_GenericParam := f_SIP_SemicolonParamList_GetParam(p_MessageHeader.toField.toParams, c_tagId); + var template (omit) charstring v_ToTag := omit; + + if (ispresent(v_GenericParam)) { + v_ToTag := f_GenericParam_GetValue(v_GenericParam); + } + return v_ToTag; + } + + //**************************************************************************** + // auxilliary functions to build templates + //---------------------------------------------------------------------------- + /* + * @desc return string representing given IntegrityAlgorithm + * @param p_IntegrityAlgorithm + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SIP_IntegrityAlgorithm_String(IPsec_IntegrityAlgorithm_Type p_IntegrityAlgorithm) return charstring + { + var charstring v_String := ""; + + select (p_IntegrityAlgorithm) { + case (hmac_md5_96) { + v_String := tsc_HMAC_MD5_96; + } + case (hmac_sha_1_96) { + v_String := tsc_HMAC_SHA_1_96; + } + } + return v_String; + } + + /* + * @desc return string representing given CipheringAlgorithm + * @param p_CipheringAlgorithm + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SIP_CipheringAlgorithm_String(IPsec_CipheringAlgorithm_Type p_CipheringAlgorithm) return charstring + { + var charstring v_String := ""; + + select (p_CipheringAlgorithm) { + case (des_ede3_cbc) { + v_String := "des-ede3-cbc"; + } + case (aes_cbc) { + v_String := "aes-cbc"; + } + case (nociph) { + v_String := "null"; // @sic R5s130586 change 14 sic@ + } + } + return v_String; + } + + //---------------------------------------------------------------------------- + + template (value) UserInfo cs_UserInfo(charstring p_UserName, + template (omit) charstring p_Password := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + userOrTelephoneSubscriber := p_UserName, + password := p_Password + }; + + template (present) UserInfo cr_UserInfo(charstring p_UserName, + template charstring p_Password := *) := + { + userOrTelephoneSubscriber := p_UserName, + password := p_Password + }; + + /* + * @desc Build a SipUrl structure based on an URI which is either a tel or sip identity, + * e.g. "sip:PublicId1@3gpp.org" or "tel:+358-555-1234567" + * where scheme is "sip" or "tel" or "urn". + * The returned SipUrl structure is used for building send or receive templates. + * (see RFC 3261 cl. 19.1.1, examples in cl. 19.1.3 for sip uri; + * see RFC 3986 for URIs in general) + * @param p_URI + * @return template (value) SipUrl + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_SIP_ParseURI(charstring p_URI) return template (value) SipUrl + { /* @sic R5s130195 BASELINE MOVING 2013: change of SipUrl sic@ */ + var template (present) charstring v_Pattern; + var template (value) UriComponents v_UriComponents; + var template (omit) UserInfo v_UserInfo := omit; + var charstring v_Host; + var charstring v_Scheme; + var charstring v_HierPart; + var charstring v_UserInfoString; + var charstring v_UserName; + + v_Pattern := pattern "([a-z]#(3,4)):(*)"; // @sic R5s130187 change 8: "pattern" sic@ + v_Scheme := regexp(p_URI, v_Pattern, 0); + v_HierPart := regexp(p_URI, v_Pattern, 1); + + select (v_Scheme) { + case (c_sipScheme) { // sip uri acc. to RFC 3261 cl. 19.1.1 + v_Pattern := pattern "(*)@(*)"; // @sic R5s130187 change 8: "pattern" sic@ + v_UserInfoString := regexp(v_HierPart, v_Pattern, 0); + if (v_UserInfoString == "") { // sip uri does not have user info e.g. "sip:biloxi.com" or sip:[2001:db8:1::139] + v_Host := v_HierPart; + } else { // sip uri has user info + v_Host := regexp(v_HierPart, v_Pattern, 1); + v_Pattern := pattern "(*):(*)"; // @sic R5s130187 change 8: "pattern" sic@ + v_UserName := regexp(v_UserInfoString, v_Pattern, 0); + if (v_UserName == "") { // user info but no password e.g. "sip:alice@atlanta.com" + v_UserInfo := cs_UserInfo(v_UserInfoString); + } else { // user info with password e.g. "sip:alice:secretword@atlanta.com" + v_UserInfo := cs_UserInfo(v_UserName, regexp(v_UserInfoString, v_Pattern, 1)); + } + } + v_UriComponents := cs_SipUriComponent(v_UserInfo, v_Host); + } + case (c_telScheme) { // tel uri acc. to RFC 3966 + v_UriComponents := cs_TelUriComponent(v_HierPart); + } + case (c_urnScheme) { // urn uri for emergency calls e.g. "urn:service:sos" + v_Pattern := pattern "(*):(*)"; // @sic R5s130495 Change 11 sic@ + v_UriComponents := cs_UrnUriComponent(regexp(v_HierPart, v_Pattern, 0), regexp(v_HierPart, v_Pattern, 1)); + } + case else { + v_UriComponents := cs_OtherComponent(v_HierPart); + } + } + return cs_SipUrl_Common(v_Scheme, v_UriComponents); + } + + /* + * @desc Built receive template for SipUrl + * @param p_URI + * @param p_Port (default value: omit) + * @param p_UrlParameters (default value: *) + * @param p_Headers (default value: omit) + * @return template (present) SipUrl + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SIP_BuildSipUri_RX(charstring p_URI, + template integer p_Port := omit, + template SemicolonParam_List p_UrlParameters := *, + template AmpersandParam_List p_Headers := omit) return template (present) SipUrl + { + var template (present) SipUrl v_SipUrl := fl_SIP_ParseURI(p_URI); + + if (ischosen(v_SipUrl.components.sip)) { /* @sic R5s130195 BASELINE MOVING 2013: change of SipUrl sic@ + @sic R5s140020 change 11: p_Port may be * therefore shall not be checked to be present sic@ */ + v_SipUrl.components.sip.hostPort.portField := p_Port; + } + v_SipUrl.urlParameters := p_UrlParameters; + v_SipUrl.headers := p_Headers; /* @sic R5s150382 change 4 sic@ */ + return v_SipUrl; + } + + /* + * @desc Build SipUrl template to be used for receiving + * the URI gets the "lr" parameter indication "loose rooting" acc. to RFC 3261: + * to be used in the Route or Record-Route headers to indicate that the network element separates the destination of the request (present in the Request-URI) + * @param p_URI + * @param p_Port (default value: omit) + * @return template (present) SipUrl + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_SIP_BuildSipUri_lr_RX(charstring p_URI, + template integer p_Port := omit) return template (present) SipUrl + { + return f_SIP_BuildSipUri_RX(p_URI, p_Port, cr_UriParameters_lr); /* @sic R5-153760: cr_UriParameters_lr sic@ */ + } + + /* + * @desc Build SipUrl template to be used for sending + * @param p_URI + * @param p_Port (default value: omit) + * @param p_LrParam (default value: omit) + * @return template (value) SipUrl + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SIP_BuildSipUri_TX(charstring p_URI, + template (omit) integer p_Port := omit, + template (omit) GenericParam p_LrParam := omit) return template (value) SipUrl + { + var template (value) SipUrl v_SipUrl := fl_SIP_ParseURI(p_URI); + + if (isvalue(p_Port) and ischosen(v_SipUrl.components.sip)) { /* @sic R5s130195 BASELINE MOVING 2013: change of SipUrl sic@ */ + v_SipUrl.components.sip.hostPort.portField := p_Port; + } + if (isvalue(p_LrParam)) { + v_SipUrl.urlParameters := {p_LrParam}; + } + return v_SipUrl; + } + + /* + * @desc Build SipUrl template to be used for sending + * the URI gets the "lr" parameter indication "loose rooting" acc. to RFC 3261: + * to be used in the Route or Record-Route headers to indicate that the network element separates the destination of the request (present in the Request-URI) + * from the set of proxies that need to be visited along the way (present in the Route header field) + * @param p_URI + * @param p_Port (default value: omit) + * @return template (value) SipUrl + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_SIP_BuildSipUri_lr_TX(charstring p_URI, + template (omit) integer p_Port := omit) return template (value) SipUrl + { + return f_SIP_BuildSipUri_TX(p_URI, p_Port, cs_GenericParam("lr")); + } + + /* + * @desc convert SipUrl to string + * @param p_SipUrl + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SIP_SipUrl2Str(SipUrl p_SipUrl) return charstring + { /* @sic R5s130195 BASELINE MOVING 2013: change of SipUrl sic@ */ + var SipUriComponents v_SipUriComponents; + var charstring v_String := p_SipUrl.scheme & ":"; + var charstring v_Host; + + select (p_SipUrl.scheme) { + case (c_sipScheme) { + v_SipUriComponents := p_SipUrl.components.sip; + if (ispresent(v_SipUriComponents.userInfo)) { + v_String := v_String & v_SipUriComponents.userInfo.userOrTelephoneSubscriber & "@" ; // @sic R5s120530 change 1.3 sic@ + } + v_Host := v_SipUriComponents.hostPort.host; + if (f_IpAddressIsIPv6(v_Host)) { v_Host := "[" & v_Host & "]"; } // @sic R5s130586 change 15 sic@ + v_String := v_String & v_Host; // @sic R5s120530 change 1.3 sic@ + if (ispresent(v_SipUriComponents.hostPort.portField)) { + v_String := v_String & ":" & int2str(v_SipUriComponents.hostPort.portField); + } + } + case (c_telScheme) { + v_String := v_String & p_SipUrl.components.tel.subscriber; + } + case (c_urnScheme) { + v_String := v_String & p_SipUrl.components.urn.namespaceId & ":" & p_SipUrl.components.urn.namespaceSpecificString; // @sic R5s140169 change 2 sic@ + } + case else { + v_String := v_String & p_SipUrl.components.other; + } + } + return v_String; + } + + /* + * @desc encode SipUrl as string + * @param p_SipUrl + * @return charstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SIP_SipUrl_GetPublicUserIdentity(SipUrl p_SipUrl) return charstring + { /* @sic R5s130195 BASELINE MOVING 2013: change of SipUrl sic@ */ + var SipUriComponents v_SipUriComponents; + var charstring v_PublicUserIdentity := ""; + + if (not ischosen(p_SipUrl.components.sip)) { + f_ErrorLog(__FILE__, __LINE__, "SipUrl is not a SIP URI"); + } + else { + v_SipUriComponents := p_SipUrl.components.sip; + if (not ispresent(v_SipUriComponents.userInfo)) { + f_ErrorLog(__FILE__, __LINE__, "SipUrl does not have user info"); + } + else { + v_PublicUserIdentity := p_SipUrl.scheme & ":" & v_SipUriComponents.userInfo.userOrTelephoneSubscriber & "@" & v_SipUriComponents.hostPort.host; + } + } + return v_PublicUserIdentity; + } + + + /* + * @desc Compare two URLs + * @param p_SipUrl1 + * @param p_SipUrl2 + * @return boolean + * @status APPROVED (IMS) + */ + function f_SIP_SipUrl_Compare(SipUrl p_SipUrl1, + SipUrl p_SipUrl2) return boolean + { + return match(p_SipUrl1, cr_SipUrl_Common(p_SipUrl2.scheme, p_SipUrl2.components, p_SipUrl2.urlParameters)); + } + + /* + * @desc return sequence number of given message + * @param p_MessageHeader + * @return integer + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_MessageHeader_GetCseqValue(template (value) MessageHeader p_MessageHeader) return integer + { + return valueof(p_MessageHeader.cSeq.seqNumber); + } + + /* + * @desc get SipUrl from Contact header + * @param p_MessageHeader + * @return SipUrl + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_MessageHeader_GetContactSipUrl(template (value) MessageHeader p_MessageHeader) return SipUrl + { + var template (omit) Addr_Union v_Addr_Union := p_MessageHeader.contact.contactBody.contactAddresses[0].addressField; + return f_Addr_Union_GetSipUrl(v_Addr_Union); /* @sic R5s130235 - additional changes sic@ */ + } + + /* + * @desc Check Require header + * @param p_MessageHeader + * @param p_OptionTag (default value: c_tag100rel) + * @return boolean + * @status APPROVED (IMS, LTE_A, LTE_IRAT) + */ + function f_MessageHeader_CheckRequire(MessageHeader p_MessageHeader, + OptionTag p_OptionTag := c_tag100rel) return boolean + { + var OptionTag_List v_OptionTags := {p_OptionTag}; + return (ispresent(p_MessageHeader.require) and match(p_MessageHeader.require, cr_Require(v_OptionTags))); + } + + //---------------------------------------------------------------------------- + /* + * @desc Build SecurityMechanism + * @param p_IntegrityAlgorithm + * @param p_CipheringAlgorithm + * @param p_Spi_Client + * @param p_Spi_Server + * @param p_SSProtClientPort + * @param p_SSProtServerPort + * @return template (value) SecurityMechanism_List + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SIP_BuildSecurityServerParam(IPsec_IntegrityAlgorithm_Type p_IntegrityAlgorithm, + IPsec_CipheringAlgorithm_Type p_CipheringAlgorithm, + charstring p_Spi_Client, + charstring p_Spi_Server, + charstring p_SSProtClientPort, + charstring p_SSProtServerPort) return template (value) SecurityMechanism_List + { /* @sic R5s130710 - MCC160 Implementation: p_Confidentiality removed sic@ */ + var template (value) SecurityMechanism_List v_SecurityMechanism; + var integer v_ListLength1; + var integer v_ListLength2; + var template (value) SemicolonParam_List v_ParamList1; + var template (value) SemicolonParam_List v_ParamList2; + var charstring v_IntAlg := f_SIP_IntegrityAlgorithm_String(p_IntegrityAlgorithm); + var charstring v_CyphAlg := f_SIP_CipheringAlgorithm_String(p_CipheringAlgorithm); + var charstring v_OtherIntAlg; + + select (p_IntegrityAlgorithm) { + case (hmac_md5_96) { + v_OtherIntAlg := tsc_HMAC_SHA_1_96; + } + case (hmac_sha_1_96) { + v_OtherIntAlg := tsc_HMAC_MD5_96; + } + } + + v_ParamList1 := { + cs_GenericParam("alg", v_IntAlg), + cs_GenericParam("spi-c", p_Spi_Client), + cs_GenericParam("spi-s", p_Spi_Server), + cs_GenericParam("port-c", p_SSProtClientPort), + cs_GenericParam("port-s", p_SSProtServerPort), + cs_GenericParam("q", "0.9") + }; + + v_ParamList2 := { + cs_GenericParam("alg", v_OtherIntAlg), + cs_GenericParam("spi-c", p_Spi_Client), + cs_GenericParam("spi-s", p_Spi_Server), + cs_GenericParam("port-c", p_SSProtClientPort), + cs_GenericParam("port-s", p_SSProtServerPort), + cs_GenericParam("q", "0.7") + }; + + if (p_CipheringAlgorithm != nociph) { /* @sic R5s130710 - MCC160 Implementation sic@ */ + v_ListLength1 := lengthof(v_ParamList1); + v_ParamList1[v_ListLength1] := cs_GenericParam("ealg", v_CyphAlg); + v_ListLength2 := lengthof(v_ParamList2); + v_ParamList2[v_ListLength2] := cs_GenericParam("ealg", v_CyphAlg); + } + + v_SecurityMechanism := { + { + mechName := tsc_SEC_MECHANISM, + mechParams := v_ParamList1 + }, + { + mechName := tsc_SEC_MECHANISM, + mechParams := v_ParamList2 + } + }; + + return v_SecurityMechanism; + } + + //---------------------------------------------------------------------------- + /* + * @desc Function used to create a template for SecurityVerify header with same content as SecurityServer header + * @param p_IntegrityAlgorithm + * @param p_CipheringAlgorithm + * @param p_Spi_Client + * @param p_Spi_Server + * @param p_SSProtClientPort + * @param p_SSProtServerPort + * @return template (present) SecurityVerify + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SIP_BuildSecurityVerifyHeader(IPsec_IntegrityAlgorithm_Type p_IntegrityAlgorithm, + IPsec_CipheringAlgorithm_Type p_CipheringAlgorithm, + charstring p_Spi_Client, + charstring p_Spi_Server, + charstring p_SSProtClientPort, + charstring p_SSProtServerPort) return template (present) SecurityVerify + { /* @sic R5s130710 - MCC160 Implementation: p_Confidentiality removed sic@ */ + var template (present) SecurityMechanism_List v_SecurityMechanism := f_SIP_BuildSecurityServerParam(p_IntegrityAlgorithm, + p_CipheringAlgorithm, + p_Spi_Client, + p_Spi_Server, + p_SSProtClientPort, + p_SSProtServerPort); + return cr_SecVerifyDef(v_SecurityMechanism); + } + + //---------------------------------------------------------------------------- + /* + * @desc Return the correct tag to be included in the Supported header of REGISTER messages + * @param p_GRUUsInSIP + * @return OptionTag_List + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SIP_Register_SupportedTagList(boolean p_GRUUsInSIP) return OptionTag_List + { /* @sic R5-133629: handling of option tags in Supported and Require headers sic@ */ + /* @sic R5s150721 - Additional change: "path" shall always be included sic@ */ + var OptionTag_List v_SupportedTagList; + + v_SupportedTagList[0] := "path"; + if (p_GRUUsInSIP) { + v_SupportedTagList[1] := "gruu"; + } + return v_SupportedTagList; + } + + //**************************************************************************** + // auxilliary functions to access SIP mesages + //---------------------------------------------------------------------------- + /* + * @desc return portnumber given in ContactUrl (if any) + * @param p_ContactUrl + * @return template (omit) PortNumber_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SIP_ContactUrl_GetPort(SipUrl p_ContactUrl) return template (omit) PortNumber_Type + { /* @sic R5s130195 BASELINE MOVING 2013: change of SipUrl sic@ */ + var template (omit) PortNumber_Type v_PortNumber := omit; + + if (ischosen(p_ContactUrl.components.sip)) { + v_PortNumber := p_ContactUrl.components.sip.hostPort.portField; + } + return v_PortNumber; + } + + //**************************************************************************** + // auxilliary function to match URI + //---------------------------------------------------------------------------- + /* + * @desc check whether public user id represented by given SipUrl matches with public user id given as string + * @param p_UriString + * @param p_SipUrl + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_SIP_MatchURI(charstring p_UriString, + SipUrl p_SipUrl) return boolean + { + return (f_SIP_SipUrl_GetPublicUserIdentity(p_SipUrl) == p_UriString); + } + + //**************************************************************************** + // MessageHeader 'dummy' templates + //---------------------------------------------------------------------------- + + template (value) MessageHeader cs_MessageHeader_Dummy := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + accept := omit, + acceptContact := omit, + acceptEncoding := omit, + acceptLanguage := omit, + alertInfo := omit, + allow := omit, + allowEvents := omit, + authenticationInfo := omit, + authorization := omit, + callId := c_empty_CallId, + callInfo := omit, + contact := omit, + contentDisposition := omit, + contentEncoding := omit, + contentLanguage := omit, + contentLength := cs_ContentLength(0), // NOTE: may be changed to -1 to force the codec always to calculate the length (even when there is no message body at all) + contentType := omit, + cSeq := c_empty_cSeq, + date := omit, + errorInfo := omit, + event := omit, + expires := omit, + featureCaps := omit, + fromField := c_empty_From, + geolocation := omit, + geolocationRouting := omit, // @sic R5-133151 sic@ + historyInfo := omit, + infoPackage := omit, // @sic R5s150339 sic@ + inReplyTo := omit, + maxForwards := c_maxForwards70, + mimeVersion := omit, + minExpires := omit, + minSE := omit, + organization := omit, + pAccessNetworkInfo := omit, + pAssertedID := omit, + pAssertedService := omit, + pAssociatedURI := omit, + path := omit, + pCalledPartyID := omit, + pChargingFunctionAddresses := omit, + pChargingVector := omit, + pEarlyMedia := omit, + pMediaAuthorization := omit, + pPreferredID := omit, + pPreferredService := omit, + priority := omit, + privacy := omit, + proxyAuthenticate := omit, + proxyAuthorization := omit, + proxyRequire := omit, + pVisitedNetworkID := omit, + rAck := omit, + rSeq := omit, + reason := omit, + recordRoute := omit, + recvInfo := omit, // @sic R5s150339 sic@ + requestDisposition := omit, + referredBy := omit, + referTo := omit, + referSub := omit, + replaces := omit, + replyTo := omit, + require := omit, + retryAfter := omit, + route := omit, + securityClient := omit, + securityServer := omit, + securityVerify := omit, + server := omit, + serviceRoute := omit, + sessionExpires := omit, + sessionId := omit, + sipETag := omit, + sipIfMatch := omit, + subject := omit, + subscriptionState := omit, + supported := omit, + timestamp := omit, + toField := c_empty_To, + unsupported := omit, + userToUser := omit, + userAgent := omit, + via := c_empty_Via, + warning := omit, + wwwAuthenticate := omit, + undefinedHeader_List := omit + }; + + template (present) MessageHeader cr_MessageHeader_Dummy := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + accept := *, + acceptContact := *, + acceptEncoding := *, + acceptLanguage := *, + alertInfo := *, + allow := *, + allowEvents := *, + authenticationInfo := *, + authorization := *, + callId := ?, + callInfo := *, + contact := *, + contentDisposition := *, + contentEncoding := *, + contentLanguage := *, + contentLength := ?, + contentType := *, + cSeq := ?, + date := *, + errorInfo := *, + event := *, + expires := *, + featureCaps := *, + fromField := ?, + geolocation := *, + geolocationRouting := *, // @sic R5-133151 sic@ + historyInfo := *, + infoPackage := *, // @sic R5s150339 sic@ + inReplyTo := *, + maxForwards := *, + mimeVersion := *, + minExpires := *, + minSE := *, + organization := *, + pAccessNetworkInfo := *, + pAssertedID := *, + pAssertedService := *, + pAssociatedURI := *, + path := *, + pCalledPartyID := *, + pChargingFunctionAddresses := *, + pChargingVector := *, + pEarlyMedia := *, + pMediaAuthorization := *, + pPreferredID := *, + pPreferredService := *, + priority := *, + privacy := *, + proxyAuthenticate := *, + proxyAuthorization := *, + proxyRequire := *, + pVisitedNetworkID := *, + rAck := *, + rSeq := *, + reason := *, + recordRoute := *, + recvInfo := *, // @sic R5s150339 sic@ + requestDisposition := *, + referredBy := *, + referTo := *, + referSub := *, + replaces := *, + replyTo := *, + require := *, + retryAfter := *, + route := *, + securityClient := *, + securityServer := *, + securityVerify := *, + server := *, + serviceRoute := *, + sessionExpires := *, + sessionId := *, + sipETag := *, + sipIfMatch := *, + subject := *, + subscriptionState := *, + supported := *, + timestamp := *, + toField := ?, + unsupported := *, + userToUser := *, + userAgent := *, + via := ?, + warning := *, + wwwAuthenticate := *, + undefinedHeader_List := * + }; + + //**************************************************************************** + // SIPMessages + //---------------------------------------------------------------------------- + + template (present) REGISTER_Request cr_REGISTER_Request(template (present) SipUrl p_SipUrl := ?, + template (present) MessageHeader p_MessageHeader := ?, + template MessageBody p_MessageBody := omit, + template Payload p_Payload := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + requestLine := cr_RequestLineSip(REGISTER_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := p_MessageBody, + payload := p_Payload + }; + + template (present) SUBSCRIBE_Request cr_SUBSCRIBE_Request(template (present) SipUrl p_SipUrl, + template (present) MessageHeader p_MessageHeader := ?, + template MessageBody p_MessageBody := omit, + template Payload p_Payload := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + requestLine := cr_RequestLineSip(SUBSCRIBE_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := p_MessageBody, + payload := p_Payload + }; + + template (present) INVITE_Request cr_INVITE_Request(template (present) SipUrl p_SipUrl, + template (present) MessageHeader p_MessageHeader := ?, + template MessageBody p_MessageBody := *, + template Payload p_Payload := *) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + requestLine := cr_RequestLineSip(INVITE_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := p_MessageBody, + payload := p_Payload + }; + + template (present) PUBLISH_Request cr_PUBLISH_Request(template (present) SipUrl p_SipUrl, + template (present) MessageHeader p_MessageHeader := ?, + template MessageBody p_MessageBody := *, + template Payload p_Payload := *) := + { + requestLine := cr_RequestLineSip(PUBLISH_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := p_MessageBody, + payload := p_Payload + }; + + template (present) PRACK_Request cr_PRACK_Request(template (present) SipUrl p_SipUrl, + template (present) MessageHeader p_MessageHeader := ?, + template MessageBody p_MessageBody := *, + template Payload p_Payload := *) := + { /* @status APPROVED (IMS, LTE, LTE_A) */ + requestLine := cr_RequestLineSip(PRACK_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := p_MessageBody, + payload := p_Payload + }; + + template (present) UPDATE_Request cr_UPDATE_Request(template (present) SipUrl p_SipUrl, + template (present) MessageHeader p_MessageHeader := ?, + template MessageBody p_MessageBody := ?, + template Payload p_Payload := *) := + { /* @status APPROVED (IMS, LTE, LTE_A) */ + requestLine := cr_RequestLineSip(UPDATE_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := p_MessageBody, + payload := p_Payload + }; + + template (present) ACK_Request cr_ACK_Request(template (present) SipUrl p_SipUrl, + template (present) MessageHeader p_MessageHeader := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + requestLine := cr_RequestLineSip(ACK_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := omit, + payload := omit + }; + + template (present) BYE_Request cr_BYE_Request(template (present) SipUrl p_SipUrl, + template (present) MessageHeader p_MessageHeader := ?, + template MessageBody p_MessageBody := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A) */ + requestLine := cr_RequestLineSip(BYE_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := p_MessageBody, + payload := omit // @sic R5s120530 change 3.11 sic@ + }; + + template (present) MESSAGE_Request cr_MESSAGE_Request(template (present) SipUrl p_SipUrl, + template (present) MessageHeader p_MessageHeader := ?, + template MessageBody p_MessageBody := ?, + template Payload p_Payload := *) := + { /* @status APPROVED (IMS, LTE_A) */ + requestLine := cr_RequestLineSip(MESSAGE_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := p_MessageBody, + payload := p_Payload + }; + + template (present) REFER_Request cr_REFER_Request(template (present) SipUrl p_SipUrl, + template (present) MessageHeader p_MessageHeader := ?) := + { /* @status APPROVED (IMS) */ + requestLine := cr_RequestLineSip(REFER_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := omit, + payload := omit + }; + + template (present) NOTIFY_Request cr_NOTIFY_Request(template (present) SipUrl p_SipUrl, + template (present) MessageHeader p_MessageHeader, + template (present) MessageBody p_MessageBody) := + { + requestLine := cr_RequestLineSip(NOTIFY_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := p_MessageBody, + payload := omit + }; + + //---------------------------------------------------------------------------- + + template (value) CANCEL_Request cs_CANCEL_Request(template (value) SipUrl p_SipUrl, + template (value) MessageHeader p_MessageHeader) := + { /* @status APPROVED (IMS, LTE_A) */ + requestLine := cs_RequestLineSip(CANCEL_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := omit, + payload := omit + }; + + + template (value) NOTIFY_Request cs_NOTIFY_Request(template (value) SipUrl p_SipUrl, + template (value) MessageHeader p_MessageHeader, + template (omit) MessageBody p_MessageBody := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + requestLine := cs_RequestLineSip(NOTIFY_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := p_MessageBody, + payload := omit + }; + + template (value) INVITE_Request cs_INVITE_Request(template (value) SipUrl p_SipUrl, + template (value) MessageHeader p_MessageHeader, + template (omit) MessageBody p_MessageBody := omit) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + requestLine := cs_RequestLineSip(INVITE_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := p_MessageBody, + payload := omit + }; + + template (value) PRACK_Request cs_PRACK_Request(template (value) SipUrl p_SipUrl, + template (value) MessageHeader p_MessageHeader, + template (omit) MessageBody p_MessageBody := omit) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + requestLine := cs_RequestLineSip(PRACK_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := p_MessageBody, + payload := omit + }; + + template (value) UPDATE_Request cs_UPDATE_Request(template (value) SipUrl p_SipUrl, + template (value) MessageHeader p_MessageHeader, + template (value) MessageBody p_MessageBody) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + requestLine := cs_RequestLineSip(UPDATE_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := p_MessageBody, + payload := omit + }; + + template (value) ACK_Request cs_ACK_Request(template (value) SipUrl p_SipUrl, + template (value) MessageHeader p_MessageHeader) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + requestLine := cs_RequestLineSip(ACK_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := omit, + payload := omit + }; + + template (value) BYE_Request cs_BYE_Request(template (value) SipUrl p_SipUrl, + template (value) MessageHeader p_MessageHeader) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT) */ + requestLine := cs_RequestLineSip(BYE_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := omit, + payload := omit + }; + + template (value) MESSAGE_Request cs_MESSAGE_Request(template (value) SipUrl p_SipUrl, + template (value) MessageHeader p_MessageHeader, + template (value) MessageBody p_MessageBody) := + { /* @status APPROVED (IMS, LTE_A) */ + requestLine := cs_RequestLineSip(MESSAGE_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := p_MessageBody, + payload := omit + }; + + template (value) REFER_Request cs_REFER_Request(template (value) SipUrl p_SipUrl, + template (value) MessageHeader p_MessageHeader) := + { + requestLine := cs_RequestLineSip(REFER_E, p_SipUrl), + msgHeader := p_MessageHeader, + messageBody := omit, + payload := omit + }; + + //============================================================================ + // Responses: + //---------------------------------------------------------------------------- + + template (value) Response cs_Response(template (value) StatusLine p_StatusLine, + template (value) MessageHeader p_MessageHeader, + template (omit) MessageBody p_MessageBody := omit, + template (omit) Payload p_Payload := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + statusLine := p_StatusLine, + msgHeader := p_MessageHeader, + messageBody := p_MessageBody, + payload := p_Payload + }; + + + template (present) Response cr_Response(template (present) StatusLine p_StatusLine, + template (present) MessageHeader p_MessageHeader, + template MessageBody p_MessageBody := omit, + template Payload p_Payload := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + statusLine := p_StatusLine, + msgHeader := p_MessageHeader, + messageBody := p_MessageBody, + payload := p_Payload + }; + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_SMS_Messages.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_SMS_Messages.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4e22159693bf96af56570498a9bb16d6aaa6d9a9 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_SMS_Messages.ttcn @@ -0,0 +1,509 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-15 19:05:27 +0200 (Tue, 15 Sep 2015) $ +// $Rev: 14431 $ +/******************************************************************************/ + +module IMS_SMS_Messages { + + import from CommonDefs all; + import from LibSip_Common all; + import from LibSip_SIPTypesAndValues all; + import from SMS_TypeDefs all; + import from SMS_Templates all; + import from IMS_CommonTemplates all; + import from IMS_SIP_Templates all; + import from IMS_Component all; + import from IMS_CommonDefs all; + import from IMS_CommonFunctions all; + import from IMS_Procedures_CallControl all; + import from IMS_Procedures_Common all; + import from IMS_ASP_TypeDefs all; + import from IMS_ASP_Templates all; + import from IMS_MessageBody_Templates all; + import from IP_ASP_TypeDefs all; + import from IMS_CC_Parameters all; + import from IMS_CommonParameters all; + + //============================================================================ + + template (present) RP_DATA_ul_Type cr_SMS_RP_DATA_ul_SUBMIT_IMS := + /* @status APPROVED (IMS) */ + /* @sic R5-133632 change 7: px_SMS_SMSC_InternationalNumber sic@ */ + cr_RP_DATA_ul_SUBMIT(cr_RP_UserData_SUBMIT(cr_SMS_SUBMIT), f_CharPacking_IA5toBCD(px_SMS_SMSC_InternationalNumber)); // @sic R5s141400 sic@ + + //============================================================================ + + template (value) InReplyTo cs_InReplyTo(CallidString p_CallidString) := + { /* @status APPROVED (IMS) */ + fieldName := IN_REPLY_TO_E, + callids := {p_CallidString} + }; + + template (present) InReplyTo cr_InReplyTo(CallidString p_CallidString) := + { /* @status APPROVED (IMS) */ + fieldName := IN_REPLY_TO_E, + callids := {p_CallidString, *} + }; + + template (value) SemicolonParam_List cs_AcRcParamsSMS := + { /* @status APPROVED (IMS) */ + cs_GenericParam("+g.3gpp.smsip"), + cs_GenericParam("require"), + cs_GenericParam("explicit") + }; + + template (value) RP_DATA_dl_Type cs_RP_DATA_dl_STATUS_REPORT(TP_MessageReference_Type p_MessageRef, + TP_Address_Type p_RecipientAddress, + template (omit) TP_ServiceCentreTimeStamp_Type p_SCTP) := + { /* @status APPROVED (IMS) */ + spare5 := '00000'B, + rP_MessageTypeIndicator := tsc_MT_RP_DATA_dl, + rP_MessageReference := '00'O, + rP_OriginatorAddress := cs_RP_OriginatorAddress_dl, + rP_DestinationAddress := cs_RP_DestinationAddress_dl, + rP_UserData := cs_RP_UserData_STATUS_REPORT (p_MessageRef, p_RecipientAddress, p_SCTP) + }; + + template (omit) RP_UserData cs_RP_UserData_STATUS_REPORT(TP_MessageReference_Type p_MessageRef, + TP_Address_Type p_RecipientAddress, + template (omit) TP_ServiceCentreTimeStamp_Type p_SCTP) := + { /* @status APPROVED (IMS) */ + // @sic R5s120530 change 2.9 sic@ + spare := omit, + iei := omit, + iel := int2oct(lengthof(p_RecipientAddress.digits) + 21, 1), + tP_PDU := { + SMS_STATUS_REPORT := cs_SMS_STATUS_REPORT(p_MessageRef, p_RecipientAddress, p_SCTP) + } + }; + + template (value) SMS_STATUS_REPORT_Type cs_SMS_STATUS_REPORT(TP_MessageReference_Type p_MessageRef, + TP_Address_Type p_RA, + template (omit) TP_ServiceCentreTimeStamp_Type p_SCTP):= + { // TS 34.229-1 clause A.7.5 + /* @status APPROVED (IMS) */ + spare1 := '0'B, + tP_UserDataHeaderIndicator := '0'B, + tP_StatusReportQualifier := '0'B, + spare2 := '00'B, + tP_MoreMessagesToSend := '0'B, + tP_MessageTypeIndicator := tsc_MT_SMS_STATUS_REPORT, + tP_MessageReference := p_MessageRef, + tP_RecipientAddress := p_RA, + tP_ServiceCentreTimeStamp := p_SCTP, + tP_DischargeTime := '00000000000000'H, + tP_Status := { + reserved := '0'B, + status := '0000000'B + }, + tP_ParameterIndicator := cs_TP_ParameterIndicator, + tP_ProtocolIdentifier := cs_TP_ProtocolIdentifier, + tP_DataCodingScheme_Type := omit, + tP_UserDataLength := omit, + tP_UserData := omit + }; + + //============================================================================ + /* + * @desc encode SMS-RP-DATA + * @param p_RP_PDU + * @return octetstring + * @status APPROVED (IMS) + */ + function f_SMS_PDU_EncodeRPDATA(template (value) RP_DATA_dl_Type p_RP_PDU) return octetstring + { + var bitstring v_Bitstring := encvalue(p_RP_PDU); + var octetstring v_Octetstring := bit2oct(v_Bitstring); + return v_Octetstring; + } + + /* + * @desc decode received RP Date PDU and match against expected PDU + * @param p_EncodedSMS_Message + * @param p_ExpectedRP_DATA_ul + * @return RP_DATA_ul_Type + * @status APPROVED (IMS) + */ + function f_SMS_PDU_DecodeAndMatchRPDATA(octetstring p_EncodedSMS_Message, + template (present) RP_DATA_ul_Type p_ExpectedRP_DATA_ul) runs on IMS_PTC return RP_DATA_ul_Type + { + var bitstring v_Bitstring := oct2bit(p_EncodedSMS_Message); + var RP_DATA_ul_Type v_RP_DATA_ul; + + if (decvalue(v_Bitstring, v_RP_DATA_ul) != 0) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "cannot decode RP_DATA_ul_Type"); + } + if (not match(v_RP_DATA_ul, p_ExpectedRP_DATA_ul)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "RP_DATA_ul does not match"); + } + return v_RP_DATA_ul; + } + + /* + * @desc encode RP ACK + * @param p_RP_PDU + * @return octetstring + * @status APPROVED (IMS) + */ + function f_SMS_PDU_EncodeRPACK(template (value) RP_ACK_Type p_RP_PDU) return octetstring + { + var bitstring v_Bitstring := encvalue(p_RP_PDU); + var octetstring v_Octetstring := bit2oct(v_Bitstring); + return v_Octetstring; + }; + + /* + * @desc decode and match SMS RP-ACK + * @param p_EncodedSMS_Message + * @param p_ExpectedRP_ACK + * @return RP_ACK_Type + * @status APPROVED (IMS) + */ + function f_SMS_PDU_DecodeAndMatchRPACK(octetstring p_EncodedSMS_Message, + template (present) RP_ACK_Type p_ExpectedRP_ACK) runs on IMS_PTC return RP_ACK_Type + { + var bitstring v_Bitstring := oct2bit(p_EncodedSMS_Message); + var RP_ACK_Type v_RP_ACK; + + if (decvalue(v_Bitstring, v_RP_ACK) != 0) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "cannot decode RP_ACK_Type"); + } + + if (not match(v_RP_ACK, p_ExpectedRP_ACK)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "RP_ACK does not match"); + } + return v_RP_ACK; + }; + + //---------------------------------------------------------------------------- + /* + * @desc common MESSAGE for A.7.1, A.7.4, A.7.5 + * @param p_Protocol + * @param p_CSeqValue + * @param p_RequestDispositionDirective + * @param p_SessionIdSupported (default value: pc_IMS_SessionIdSupported) + * @return template (value) MessageHeader + * @status APPROVED (IMS) + */ + function f_IMS_MessageRequest_MessageHeaderTX_Common(InternetProtocol_Type p_Protocol, + integer p_CSeqValue, + Directive p_RequestDispositionDirective, + boolean p_SessionIdSupported := pc_IMS_SessionIdSupported) + runs on IMS_PTC return template (value) MessageHeader + { /* @sic R5-131269: new function to be used for A.7.1, A.7.4, A.7.5; R5-133705 sic@ */ + /* @sic R5s150086 - p_SessionIdSupported: pc_IMS_SessionIdSupported per default sic@ */ + var charstring v_P_CSCF_Address := f_IMS_PTC_Pcscf_Get(); + var template (value) SipUrl v_IP_SM_GW_SipUrl := cs_SipUri_UserHostPort("SMSGateway", v_P_CSCF_Address); + var template (value) SipUrl v_SipUrlTo := f_IMS_PTC_ImsInfo_GetSipUriTX(defaultId); + var charstring v_ProtocolString := f_IMS_ConvertTransportProtocolToString(p_Protocol); + var integer v_Port_ps := f_IMS_PTC_GetPort_ps(); + var template (value) MessageHeader v_MessageHeader_Message := cs_MessageHeader_Dummy; + var charstring v_CallIdString := f_IMS_PTC_GenerateCallId("MESSAGE"); /* @sic R5-131269: unique call id different from Call-Id received in the original MO SMS sic@ */ + var template (value) ViaBody_List v_ViaBodyList := { cs_ViaBody(v_ProtocolString, cs_HostPort(v_P_CSCF_Address, v_Port_ps), f_ViaParamsTX(f_IMS_PTC_ImsInfo_GetNextBranch())) }; + + v_MessageHeader_Message.via := cs_Via(v_ViaBodyList); + v_MessageHeader_Message.fromField := cs_From(v_IP_SM_GW_SipUrl, f_IMS_GenerateTag("MESSAGE", "From")); + v_MessageHeader_Message.toField := cs_ToDef(v_SipUrlTo); + v_MessageHeader_Message.callId := cs_CallId(v_CallIdString); + v_MessageHeader_Message.cSeq := cs_CseqDef(p_CSeqValue, "MESSAGE"); + v_MessageHeader_Message.maxForwards := cs_MaxForwardsDef; + v_MessageHeader_Message.requestDisposition := cs_RequestDisposition({p_RequestDispositionDirective}); + v_MessageHeader_Message.contentType := cs_ContentType("application/vnd.3gpp.sms"); + v_MessageHeader_Message.pCalledPartyID := cs_PCalledPartyId(v_SipUrlTo); /* @sic R5-131269, R5s130370 change 8: same value as in the To header sic@ */ + + if (p_SessionIdSupported) { /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Message.sessionId := cs_SessionId(f_IMS_SessionId_TX_Generate(v_CallIdString)); + } + + return v_MessageHeader_Message; + } + + /* + * @desc MESSAGE acc. to TS 34.229 A.7.1 + * @param p_Protocol + * @param p_CSeqValue (default value: tsc_MESSAGE_CSeqValue) + * @return template (value) MessageHeader + * @status APPROVED (IMS) + */ + function f_IMS_MessageRequest_MessageHeaderTX_MT_SMS(InternetProtocol_Type p_Protocol, + integer p_CSeqValue := tsc_MESSAGE_CSeqValue) runs on IMS_PTC return template (value) MessageHeader + { /* @sic R5-131269 R5-133705 sic@ */ + var template (value) MessageHeader v_MessageHeader_Message; + + v_MessageHeader_Message := f_IMS_MessageRequest_MessageHeaderTX_Common(p_Protocol, p_CSeqValue, "no-fork"); + v_MessageHeader_Message.pAssertedID := cs_PAssertedId(f_Addr_Union_GetSipUrl(v_MessageHeader_Message.fromField.addressField)); // same as in From header + v_MessageHeader_Message.acceptContact := cs_AcceptContact(cs_AcRcParamsSMS); + + return v_MessageHeader_Message; + } + + /* + * @desc MESSAGE acc. to TS 34.229 A.7.4 + * @param p_Protocol + * @param p_SipUrl_PAssertedId + * @param p_CallIdMO + * @param p_CSeqValue (default value: tsc_MESSAGE_CSeqValue) + * @return template (value) MessageHeader + * @status APPROVED (IMS) + */ + function f_IMS_MessageRequest_MessageHeaderTX_SubmissionReport(InternetProtocol_Type p_Protocol, + template (value) SipUrl p_SipUrl_PAssertedId, + CallidString p_CallIdMO, + integer p_CSeqValue := tsc_MESSAGE_CSeqValue) runs on IMS_PTC return template (value) MessageHeader + { /* @sic R5-131269 R5-133705 sic@ */ + /* @sic R5-152094: parameter p_SipUrl_PAssertedId sic@ */ + var template (value) MessageHeader v_MessageHeader_Message; + + v_MessageHeader_Message := f_IMS_MessageRequest_MessageHeaderTX_Common(p_Protocol, p_CSeqValue, "fork"); + v_MessageHeader_Message.pAssertedID := cs_PAssertedId(p_SipUrl_PAssertedId); + v_MessageHeader_Message.inReplyTo := cs_InReplyTo(p_CallIdMO); /* @sic R5-131269: The value of the Call-Id received in the original MO SMS sic@ */ + + return v_MessageHeader_Message; + } + + /* + * @desc MESSAGE acc. to TS 34.229 A.7.5 + * @param p_Protocol + * @param p_SipUrl_PAssertedId + * @param p_CSeqValue + * @return template (value) MessageHeader + * @status APPROVED (IMS) + */ + function f_IMS_MessageRequest_MessageHeaderTX_StatusReport(InternetProtocol_Type p_Protocol, + template (value) SipUrl p_SipUrl_PAssertedId, + integer p_CSeqValue) runs on IMS_PTC return template (value) MessageHeader + { /* @sic R5-131269 R5-133705 sic@ */ + /* @sic R5-152094: parameter p_SipUrl_PAssertedId sic@ */ + var template (value) MessageHeader v_MessageHeader_Message; + + v_MessageHeader_Message := f_IMS_MessageRequest_MessageHeaderTX_Common(p_Protocol, p_CSeqValue, "no-fork"); + v_MessageHeader_Message.pAssertedID := cs_PAssertedId(p_SipUrl_PAssertedId); + v_MessageHeader_Message.acceptContact := cs_AcceptContact(cs_AcRcParamsSMS); + + return v_MessageHeader_Message; + } + + //---------------------------------------------------------------------------- + /* + * @desc common MESSAGE for A.7.2, A.7.3, A.7.6 + * @param p_SipUrl_To + * @param p_SessionIdSupported (default value: pc_IMS_SessionIdSupported) + * @return template (present) MessageHeader + * @status APPROVED (IMS) + */ + function f_IMS_MessageRequest_MessageHeaderRX_Common(template (present) SipUrl p_SipUrl_To, + boolean p_SessionIdSupported := pc_IMS_SessionIdSupported) runs on IMS_PTC return template (present) MessageHeader + { /* @sic R5s130370 change 3 - additional parameter p_SipUrl_To; R5-133705 sic@ */ + /* @sic R5s150086 - p_SessionIdSupported: pc_IMS_SessionIdSupported per default sic@ */ + var template (present) MessageHeader v_MessageHeader_Message := cr_MessageHeader_Dummy; + var integer v_Port_us := f_IMS_PTC_GetPort_us(); + // @sic R5s120530 changes 2.3, 2.5, 2.6 sic@ + v_MessageHeader_Message.via := cr_ViaDef(-, cr_HostPort(?, v_Port_us)); + v_MessageHeader_Message.fromField := cr_FromWithTag(?); + v_MessageHeader_Message.toField := cr_ToDef(p_SipUrl_To); /* @sic R5s130370 change 3 sic@ */ + v_MessageHeader_Message.callId := cr_CallId(?); /* to be checked when message has been received */ + v_MessageHeader_Message.sessionId := f_IMS_SessionId_RX_IfSupported(p_SessionIdSupported); /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Message.cSeq := cr_CseqDef(?, "MESSAGE"); + v_MessageHeader_Message.maxForwards := cr_MaxForwardsDef; + v_MessageHeader_Message.contentType := cr_ContentType("application/vnd.3gpp.sms"); + + return v_MessageHeader_Message; + } + + /* + * @desc MESSAGE for MO SMS (see TS 34.229, A.7.3) + * @param p_SipUrl_To (default value: ?) + * @return template (present) MessageHeader + * @status APPROVED (IMS) + */ + function f_IMS_MessageRequest_MessageHeaderRX_MO_SMS(template (present) SipUrl p_SipUrl_To := ?) runs on IMS_PTC return template (present) MessageHeader + { /* @sic R5s130370 change 3 - additional parameter p_SipUrl_To; R5-133705 sic@ */ + var template (present) MessageHeader v_MessageHeader_Message; + var integer v_Port_ps := f_IMS_PTC_GetPort_ps(); + var charstring v_Pcscf := f_IMS_PTC_Pcscf_Get(); + + v_MessageHeader_Message := f_IMS_MessageRequest_MessageHeaderRX_Common(p_SipUrl_To); + + if (f_IMS_PTC_SecurityScheme_IsGiba()) { + v_MessageHeader_Message.pAccessNetworkInfo := cr_PAccessNetworkInfoDef(f_IMS_PTC_RanType_GetString()); + } + v_MessageHeader_Message.route := cr_Route(cr_RouteBodyList_InitialReq(v_Port_ps, v_Pcscf)); + + return v_MessageHeader_Message; + } + + + /* + * @desc MESSAGE for SMS Delivery Report acc. to TS 34.229, A.7.6 or A.7.2 + * @param p_SipUrl_To + * @param p_CallidString + * @return template (present) MessageHeader + * @status APPROVED (IMS) + */ + function f_IMS_MessageRequest_MessageHeaderRX_DeliveryReport(template (present) SipUrl p_SipUrl_To, + CallidString p_CallidString) runs on IMS_PTC return template (present) MessageHeader + { /* @sic R5s130370 change 3 - additional parameter p_SipUrl_To; R5-133705: "InReplyTo" sic@ */ + var template (present) MessageHeader v_MessageHeader_Message; + + v_MessageHeader_Message := f_IMS_MessageRequest_MessageHeaderRX_Common(p_SipUrl_To); + if (f_IMS_PTC_UE_ReleaseGreaterOrEqual(11)) { /* @sic R5s130739 MCC160 implementation; R5s150630: f_IMS_PTC_UE_ReleaseGreaterOrEqual sic@ */ + v_MessageHeader_Message.inReplyTo := cr_InReplyTo(p_CallidString); + } + + return v_MessageHeader_Message; + } + + //---------------------------------------------------------------------------- + /* + * @desc To receive and check MESSAGE request + * @param p_SipUrlRequestLine + * @param p_MessageHeader + * @param p_PrevCallIdList (default value: {}) + * @return IMS_DATA_REQ + * @status APPROVED (IMS) + */ + function f_IMS_MessageRequest_Receive(template (present) SipUrl p_SipUrlRequestLine, + template (present) MessageHeader p_MessageHeader, + CharStringList_Type p_PrevCallIdList := {}) runs on IMS_PTC return IMS_DATA_REQ + { + var IMS_DATA_REQ v_IMS_DATA_REQ; + var MessageHeader v_MessageHeader; + var InternetProtocol_Type v_Protocol; + + IMS_Server.receive(car_IMS_Message_Request(cr_MESSAGE_Request(p_SipUrlRequestLine, p_MessageHeader, cr_MessageBody_SMS(?)))) -> value v_IMS_DATA_REQ; + v_MessageHeader := v_IMS_DATA_REQ.Request.Message.msgHeader; + v_Protocol := v_IMS_DATA_REQ.RoutingInfo.Protocol; + f_IMS_MessageHeader_Request_CheckVia(v_MessageHeader, v_Protocol); // check whether via contains "SIP URI with IP address or FQDN" (see @sic R5s120727 sic@) + f_IMS_MessageHeader_CheckCallId(v_MessageHeader, p_PrevCallIdList); // @sic R5-133705: check that Call-ID is different from the Call-ID values used in preceding requests of this test case sic@ + + return v_IMS_DATA_REQ; + } + + /* + * @desc To receive and check MESSAGE request + * @return IMS_DATA_REQ + * @status APPROVED (IMS) + */ + function f_IMS_MO_SMS_Step1() runs on IMS_PTC return IMS_DATA_REQ + { + var IMS_DATA_REQ v_IMS_DATA_REQ; + var MessageHeader v_MessageHeader; + var MESSAGE_Request v_MESSAGE_RequestRX; + var RP_DATA_ul_Type v_MoSMS; + var octetstring v_EncodedSMS; + var template (present) SipUrl v_SipUrl_PsiSmsc := ?; /* @sic R5s140304, R5-142157 sic@ + @sic R5-152094: Request URI not to be checked sic@ */ + var SipUrl v_RequestURI_MO; + + // Step 1. UE sends a short message + // @siclog "Step 1" siclog@ + // Contents in 34.229-1 Annex A.7.3 + v_IMS_DATA_REQ := f_IMS_MessageRequest_Receive(v_SipUrl_PsiSmsc, f_IMS_MessageRequest_MessageHeaderRX_MO_SMS(v_SipUrl_PsiSmsc)); /* @sic R5s130370 change 4 sic@ */ + v_MESSAGE_RequestRX := v_IMS_DATA_REQ.Request.Message; + v_MessageHeader := v_MESSAGE_RequestRX.msgHeader; + v_RequestURI_MO := v_MESSAGE_RequestRX.requestLine.requestUri; + + if (not f_SIP_SipUrl_Compare(v_RequestURI_MO, f_Addr_Union_GetSipUrl(v_MessageHeader.toField.addressField))) { /* @sic R5-152094: Request URI and To URI shall be the same sic@ */ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "addr-spec of To header shall be the same as Request URI") + } + v_EncodedSMS := v_MESSAGE_RequestRX.messageBody.smsMessage; + v_MoSMS := f_SMS_PDU_DecodeAndMatchRPDATA(v_EncodedSMS, cr_SMS_RP_DATA_ul_SUBMIT_IMS); + return v_IMS_DATA_REQ; + } + + /* + * @desc To continue expected sequence of 18.1 after initial MESSAGE request + * @param p_IMS_DATA_REQ + * @status APPROVED (IMS) + */ + function f_IMS_MO_SMS_Step2to8(IMS_DATA_REQ p_IMS_DATA_REQ) runs on IMS_PTC + { + var IMS_DATA_REQ v_IMS_DATA_REQ; + var MESSAGE_Request v_MESSAGE_RequestRX := p_IMS_DATA_REQ.Request.Message; + var template (value) MessageHeader v_MessageHeader_MessageMT; + var MessageHeader v_MessageHeader := v_MESSAGE_RequestRX.msgHeader; + var RP_DATA_ul_Type v_MoSMS; + var template (value) RP_ACK_Type v_RPAck_TX; + var RP_ACK_Type v_RPAck; + var octetstring v_EncodedSMS; + var template (value) RP_DATA_dl_Type v_SMSdl_StatusReport; + var SipUrl v_ContactUrl; + var integer v_Port_us; + var InternetProtocol_Type v_Protocol; + var SipUrl v_PAssertedIDUrl; + var bitstring v_Bitstring; + var integer v_CSeqValue := tsc_MESSAGE_CSeqValue; + var SipUrl v_RequestURI_MO := v_MESSAGE_RequestRX.requestLine.requestUri; + var CallidString v_PrevCallId := v_MessageHeader.callId.callid; + var CharStringList_Type v_PrevCallIdList := {}; + + v_PrevCallIdList := f_CharStringList_Add(v_PrevCallIdList, v_PrevCallId); + + v_ContactUrl := f_IMS_PTC_ImsInfo_GetContactUrl(); + v_Port_us := f_IMS_PTC_GetPort_us(); + + v_EncodedSMS := v_MESSAGE_RequestRX.messageBody.smsMessage; + v_Bitstring := oct2bit(v_EncodedSMS); + if (decvalue(v_Bitstring, v_MoSMS) != 0) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "cannot decode v_MoSMS"); + } + + // Step 2. SS responds with 202 Accepted + // @siclog "Step 2" siclog@ + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(p_IMS_DATA_REQ.RoutingInfo), cs_Response(c_statusLine202, f_IMS_Accepted_202_MessageHeaderTX(v_MessageHeader)))); + + // Step 3. SS sends a short message submission report indicating + // a positive acknowledgement of the short message sent by the UE at Step 1 + // Contents in 34.229-1 Annex A.7.4 + // @siclog "Step 3" siclog@ + v_RPAck_TX := cs_RP_ACK_SUBMIT_REPORT(v_MoSMS.rP_MessageReference); + v_EncodedSMS := f_SMS_PDU_EncodeRPACK(v_RPAck_TX); + v_Protocol := f_IMS_PTC_ImsInfo_GetTransportProtocol(); // @sic R5s130514 change 2 sic@ + v_MessageHeader_MessageMT := f_IMS_MessageRequest_MessageHeaderTX_SubmissionReport(v_Protocol, v_RequestURI_MO, v_PrevCallId, v_CSeqValue); /* @sic R5s130235 change 4a R5-131269 sic@ */ + IMS_Client.send(cas_IMS_Message_Request(cs_IMS_RoutingInfo(v_Protocol), cs_MESSAGE_Request(v_ContactUrl, v_MessageHeader_MessageMT, cs_MessageBody_SMS(v_EncodedSMS)))); + v_PrevCallId := valueof(v_MessageHeader_MessageMT.callId.callid); + v_PrevCallIdList := f_CharStringList_Add(v_PrevCallIdList, v_PrevCallId); + + // Step 4. UE responds with 200 OK + // @siclog "Step 4" siclog@ + f_IMS_ReceiveResponse(v_MessageHeader_MessageMT, v_Protocol, cr_Response(c_statusLine200, f_IMS_OtherResponse_200_MessageHeaderRX(v_MessageHeader_MessageMT))); /* @sic R5s140350 sic@ */ + + // Step 5. SS sends a SIP MESSAGE request including a vnd.3gpp.sms payload that contains a status report + // Contents in 34.229-1 Annex A.7.5 + // @siclog "Step 5" siclog@ + v_SMSdl_StatusReport := cs_RP_DATA_dl_STATUS_REPORT(v_MoSMS.rP_UserData.tP_PDU.SMS_SUBMIT.tP_MessageReference, // Use reference of SMS received in step 1 + v_MoSMS.rP_UserData.tP_PDU.SMS_SUBMIT.tP_DestinationAddress, + v_RPAck_TX.rP_UserData.tP_PDU.SMS_SUBMIT_REPORT.tP_ServiceCentreTimeStamp); + v_EncodedSMS := f_SMS_PDU_EncodeRPDATA(v_SMSdl_StatusReport); + v_MessageHeader_MessageMT := f_IMS_MessageRequest_MessageHeaderTX_StatusReport(v_Protocol, v_RequestURI_MO, v_CSeqValue + 1); /* @sic R5s130235 change 4 R5-131269 sic@ */ + IMS_Client.send(cas_IMS_Message_Request(cs_IMS_RoutingInfo(v_Protocol), cs_MESSAGE_Request(v_ContactUrl, v_MessageHeader_MessageMT, cs_MessageBody_SMS(v_EncodedSMS)))); + v_PrevCallId := valueof(v_MessageHeader_MessageMT.callId.callid); + v_PrevCallIdList := f_CharStringList_Add(v_PrevCallIdList, v_PrevCallId); + + // @siclog "Step 6" siclog@ + f_IMS_ReceiveResponse(v_MessageHeader_MessageMT, v_Protocol, cr_Response(c_statusLine200, f_IMS_OtherResponse_200_MessageHeaderRX(v_MessageHeader_MessageMT))); /* @sic R5s140350 sic@ */ + + // Step 7. UE sends a delivery report for the status report sent at Step 5 + // Contents in 34.229-1 Annex A.7.6 + // @siclog "Step 7" siclog@ + v_PAssertedIDUrl := f_Addr_Union_GetSipUrl(v_MessageHeader_MessageMT.pAssertedID.pAssertedIDValueList[0]); // @sic R5-130685 R5s130235 sic@ + v_IMS_DATA_REQ := f_IMS_MessageRequest_Receive(v_PAssertedIDUrl, + f_IMS_MessageRequest_MessageHeaderRX_DeliveryReport(v_PAssertedIDUrl, v_PrevCallId), + v_PrevCallIdList); /* @sic R5s130235 change 4d R5-131269 sic@ */ + v_MESSAGE_RequestRX := v_IMS_DATA_REQ.Request.Message; + v_MessageHeader := v_MESSAGE_RequestRX.msgHeader; + v_EncodedSMS := v_MESSAGE_RequestRX.messageBody.smsMessage; + v_RPAck := f_SMS_PDU_DecodeAndMatchRPACK(v_EncodedSMS, cr_RP_ACK_ul); // @sic R5-130685 sic@ + f_IMS_PreliminaryPass(__FILE__, __LINE__, "Step 7"); + + // Step 8. SS responds with 202 Accepted + // @siclog "Step 8" siclog@ + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo), cs_Response(c_statusLine202, f_IMS_Accepted_202_MessageHeaderTX(v_MessageHeader)))); + } +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_XML_PIDF_Templates.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_XML_PIDF_Templates.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5d2ea429912147997a3e560b166e9ef6a6b6a7da --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_XML_PIDF_Templates.ttcn @@ -0,0 +1,78 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-05-22 21:31:08 +0200 (Fri, 22 May 2015) $ +// $Rev: 13593 $ +/******************************************************************************/ + +module IMS_XML_PIDF_Templates { + import from urn_ietf_params_xml_ns_pidf language "XSD" all; + import from urn_ietf_params_xml_ns_pidf_geopriv10 language "XSD" all; + // import from urn_ietf_params_xml_ns_pidf all; +// import from urn_ietf_params_xml_ns_pidf_geopriv10 all; + import from XSD all; + + group Alias_Definitions { + + type Geopriv_1 Geolocation_Type; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + + type Presence_1 PIDF_Presence_Type; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + type Tuple PIDF_Tuple_Type; /* @status */ + type Tuple.note_list PIDF_Tuple_Note_List_Type; /* @status */ + // type Presence.tuple_list PIDF_Presence_Tuple_List_Type; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + type Status PIDF_Status_Type; /* @status */ + type Status.elem_list PIDF_Status_ElemList_Type; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + type Basic PIDF_Basic_Type; /* @status */ + // type Presence.note_list PIDF_Presence_Note_List_Type; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + + + + } with { encode "XML"}; + + //---------------------------------------------------------------------------- + + template (present) Geolocation_Type cr_Geolocation_Any := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + location_info := ?, + usage_rules := ?, + method := *, + provided_by := *, + elem_list := ? + }; + + //---------------------------------------------------------------------------- + + template (present) PIDF_Status_Type cr_PIDF_Status_Any (template PIDF_Basic_Type p_PIDF_Basic := *, + template (present) PIDF_Status_ElemList_Type p_PIDF_Status_ElemList := ?) := + { /* @status */ + basic := p_PIDF_Basic, + elem_list := p_PIDF_Status_ElemList + }; + + template (present) PIDF_Tuple_Type cr_PIDF_Tuple_Any (template AnyURI p_Id := ?, + template (present) PIDF_Status_Type p_PIDF_Status := ?, + template Contact p_Contact := *, + template (present) PIDF_Tuple_Note_List_Type p_PIDF_Notes := ?, + template DateTime p_Timestamp := *) := + { /* @status */ + id := p_Id, + status := p_PIDF_Status, + elem_list := {}, + contact := p_Contact, + note_list := p_PIDF_Notes, + timestamp := p_Timestamp + }; + + template (present) PIDF_Presence_Type cr_PIDF_Presence_Any (template AnyURI p_Entity := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + entity := p_Entity, + tuple_list := ?, + note_list := ?, + elem_list := {} + }; + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS/IMS_XML_Templates.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_XML_Templates.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..64a05041e0a15c9d64c6e42c0d014eb8f2fc8283 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS/IMS_XML_Templates.ttcn @@ -0,0 +1,214 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-04 18:05:38 +0200 (Fri, 04 Sep 2015) $ +// $Rev: 14182 $ +/******************************************************************************/ + +module IMS_XML_Templates { + import from CommonDefs all; + import from IMS_CommonDefs all; + import from urn_ietf_params_xml_ns_reginfo language "XSD" all; + import from urn_ietf_params_xml_ns_gruuinfo language "XSD" all; + import from NoTargetNamespace language "XSD" all; +// import from urn_ietf_params_xml_ns_reginfo all; +// import from urn_ietf_params_xml_ns_gruuinfo all; +// import from NoTargetNamespace all; + + group Alias_Definitions { + + type Ims_3gpp Ims_3gpp_Type; /* @status APPROVED (IMS, IMS_IRAT) + @sic R5s141138 sic@ */ + type Tstate_and_event_info State_and_event_info_Type; + + type Contact.state RegInfo_Contact_State_Type; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + type Contact.event RegInfo_Contact_Event_Type; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + type Contact.unknown_param_list RegInfo_Contact_UnknownParams_Type; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + type Contact.unknown_param_list[-] RegInfo_Contact_UnknownParam_Type; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + type Contact.elem_list RegInfo_Contact_ElemList_Type; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + type Reginfo.registration_list RegInfo_RegistrationList_Type; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + type Registration RegInfo_Registration_Type; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + type Reginfo Reginfo_Type with { encode "XML"}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + @sic R5s130474: encoding rule sic@ */ + + type Reginfo_Type.state Reginfo_State_Type; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + type Registration.state RegInfo_Registration_State_Type; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + type PubGruu PubGruu_Type; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + type TempGruu TempGruu_Type; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + } with { encode "XML"}; // @sic R5s130474 sic@ + + //---------------------------------------------------------------------------- + + template (value) Pub_gruu cs_XML_PubGruu(template (value) charstring p_PubGruuUri) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + uri := p_PubGruuUri + }; + + template (value) Temp_gruu cs_XML_TempGruu(template (value) charstring p_TempGruuUri, + integer p_Cseq) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + first_cseq := p_Cseq, + uri := p_TempGruuUri + }; + + /* + * @desc return GruuExtension + * @param p_PubGruu (default value: omit) + * @param p_TempGruu (default value: omit) + * @return RegInfo_Contact_ElemList_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_RegInfo_GruuExtension(template (omit) PubGruu_Type p_PubGruu := omit, + template (omit) TempGruu_Type p_TempGruu := omit) return RegInfo_Contact_ElemList_Type + { + var RegInfo_Contact_ElemList_Type v_ElemList := {}; + + if (isvalue(p_PubGruu) and isvalue(p_TempGruu)) { + v_ElemList[0] := oct2char(bit2oct(encvalue(p_PubGruu))); // NOTE: bit2str would return string cntaining '0' and '1' only + v_ElemList[1] := oct2char(bit2oct(encvalue(p_TempGruu))); // NOTE: bit2str would return string cntaining '0' and '1' only + } + else if (isvalue(p_PubGruu) xor isvalue(p_TempGruu)) { + FatalError(__FILE__, __LINE__, ""); + } + return v_ElemList; + } + + //---------------------------------------------------------------------------- + + template (value) RegInfo_Contact_UnknownParam_Type cs_XML_UEInstance(charstring p_UEInstanceId) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + /* @sic R5-153760 - Support of GRUU: base is the content, name is "+sip.instance" sic@ */ + name := "+sip.instance", + base := f_HTML_Encoding(p_UEInstanceId) /* @sic R5-153760: f_HTML_Encoding sic@ */ + }; + + template (value) Registration cs_XML_RegistrationInfo(template (value) Contact p_Contact, + charstring p_Aor, + charstring p_Id, + RegInfo_Registration_State_Type p_State) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + aor := p_Aor, + id := p_Id, + state := p_State, + contact_list := { + p_Contact + }, + elem_list := {} + }; + + //---------------------------------------------------------------------------- + + template (value) Contact cs_XML_RegistrationContact(charstring p_ContactUri, + charstring p_Id, + RegInfo_Contact_State_Type p_State, + RegInfo_Contact_Event_Type p_Event, + template (omit) charstring p_CallId := omit, + template (omit) integer p_Cseq := omit, + template (omit) integer p_Expires := omit, + template (value) RegInfo_Contact_UnknownParams_Type p_UnknownParams := {}, + template (omit) Pub_gruu p_PubGruu := omit, + template (omit) Temp_gruu p_TempGruu := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + callid := p_CallId, + cseq := p_Cseq, + duration_registered := omit, + event := p_Event, + expires := p_Expires, + id := p_Id, + q := omit, + retry_after := omit, + state := p_State, + uri := p_ContactUri, + display_name := omit, + unknown_param_list := p_UnknownParams, + elem_list := fl_RegInfo_GruuExtension(p_PubGruu, p_TempGruu) + }; + + //---------------------------------------------------------------------------- + + template (value) Reginfo cs_XML_Reginfo(Reginfo_State_Type p_State, + integer p_Version, + template (value) RegInfo_RegistrationList_Type p_Registrations) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + state := p_State, + version := p_Version, + registration_list := p_Registrations, + elem_list := {} + }; + + /* + * @desc return RegInfo + * @param p_State (default value: full) + * @param p_Version (default value: 0) + * @param p_Registrations + * @return template (value) Reginfo + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_XML_RegInfo(Reginfo_State_Type p_State := full, + integer p_Version := 0, + template (value) RegInfo_RegistrationList_Type p_Registrations) return template (value) Reginfo + { + var template (value) Reginfo v_Reginfo := cs_XML_Reginfo(p_State, p_Version, p_Registrations); + return v_Reginfo; + } + + /* + * @desc build up XML for alternative service + * @param p_Type + * @param p_Reason (default value: "") + * @param p_Action (default value: omit) + * @return template (value) Ims_3gpp_Type + * @status APPROVED (IMS, IMS_IRAT) + */ + function f_IMS_Ims_3gpp_TX(Type p_Type, + charstring p_Reason := "", + template (omit) Action p_Action := omit) return template (value) Ims_3gpp_Type + { // @sic R5s141138 sic@ + var template (value) Ims_3gpp_Type v_Ims3gpp; + var TAlternativeService.elem_list v_AnyElements := {}; + + if (ispresent(p_Action)) { + v_AnyElements := {oct2char(bit2oct(encvalue(p_Action)))}; // @sic R5s140490 sic@ @sic R5s140856r1 sic@ + } + + v_Ims3gpp := { + version := 1.0, + attr := omit, + choice := { + alternative_service := { + attr := omit, + type_ := p_Type, + reason := p_Reason, + elem_list := v_AnyElements + } + }, + elem_list := {} + }; + return v_Ims3gpp; + } + + // @sic R5s141138 sic@ + template (value) Ims_3gpp_Type cs_Ims_3gpp_Emergency(template (omit) Action p_Action := omit) := f_IMS_Ims_3gpp_TX("emergency", -, p_Action); /* @status APPROVED (IMS, IMS_IRAT) */ + template (value) Ims_3gpp_Type cs_Ims_3gpp_Restoration(template (omit) Action p_Action := "initial-registration") := f_IMS_Ims_3gpp_TX("restoration", -, p_Action); /* @status APPROVED (IMS) */ + + template (value) State_and_event_info_Type cs_State_and_event_info(template (omit) charstring p_State, + template (value) DirectionType p_Direction, + template (omit) charstring p_Event) := + { + attr := omit, + state_info := p_State, + direction := p_Direction, + event := p_Event, + anyExt := omit, + elem_list := {} + } + + template (value) DirectionType cs_DirectionReceiver := receiver; + template (present) DirectionType cr_DirectionInitiator := initiator; +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS_LibSip/LibSip_Common.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS_LibSip/LibSip_Common.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c12a83b4286cdd304f9e42638219ff81c70f9c3b --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS_LibSip/LibSip_Common.ttcn @@ -0,0 +1,48 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +/******************************************************************************/ + +/** + * @author STF160, STF471 + * @version $Id: LibSip_Common.ttcn 12281 2014-09-23 14:32:36Z seka $ + * @desc This module provides the common definitions for SIP messages. + * This module is part of LibSipV3. +*/ +module LibSip_Common { + + type set length (1..infinity) of charstring Charstring_List; + + // [20.1, 20.3, 20.4, 20.7, 20.9, 20.10, 20.11, 20.18, 20.20, 20.27, 20.28, 20.30, 20.31, + // 20.33, 20.34, 20.39, 20.42, 20.44] + + + type union GenValue { + charstring tokenOrHost, + charstring quotedString + } + + type record GenericParam + { + charstring id, + GenValue paramValue optional + } + + // [?] + type set of GenericParam SemicolonParam_List; + + // [?] + type set of GenericParam AmpersandParam_List; + + // [?] + type set of GenericParam CommaParam_List; + //------------------------------------------------------------------------------ + +} +with { + encode "LibSip V3"; +} // end module LibSip_Common diff --git a/IMS_PART4_IWD_15wk38/Common/IMS_LibSip/LibSip_MessageBodyTypes.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS_LibSip/LibSip_MessageBodyTypes.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..82725992b8c3eb4a58ef123174cb95e9d082ec61 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS_LibSip/LibSip_MessageBodyTypes.ttcn @@ -0,0 +1,53 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2014-09-19 10:54:18 +0200 (Fri, 19 Sep 2014) $ +// $Rev: 12255 $ +/******************************************************************************/ + +module LibSip_MessageBodyTypes +{ + import from LibSip_SimpleMsgSummaryTypes all; + + type charstring XmlBody; + type charstring SdpBody; + + group MIMETypes { + type union MIME_Encapsulated_Parts { + SdpBody sdpMessageBody, // @sic R5w140112: sdpMessageBody changed back to charstring sic@ + XmlBody xmlBody // if there is XML body + // XMLMessage xmlMessage // if there is XML message (with header and body) + }; + + type record MIME_Encapsulated_Part { + charstring content_type, + charstring content_disposition optional, + MIME_Encapsulated_Parts mime_encapsulated_part + }; + + type record MIME_Message { + charstring boundary, // len: + MimeEncapsulatedList mimeEncapsulatedList + }; + + type record of MIME_Encapsulated_Part MimeEncapsulatedList; + + } // group MIMETypes + + type union MessageBody { + SdpBody sdpMessageBody, // if there is only SDP part @sic R5w140112: sdpMessageBody changed back to charstring sic@ +// XMLMessage xmlMessage, // if there is XML message (with header and body) + XmlBody xmlBody, // if there is XML body + MIME_Message mimeMessageBody, // if there is SDP and encapsulated ISUP part + charstring sipfrag, // if content-Type is message/sipfrag (cp. NOTIFY, cp TS124147 A.4.3.1.2) + charstring textplain, // if content type is text/plain (for testing long messages) + SimpleMsgSummary simpleMsgSummary, // RFC 3842 + octetstring smsMessage // encoded SMS message 3GPP 23.040, 24.011 + }; + + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS_LibSip/LibSip_SDPTypes.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS_LibSip/LibSip_SDPTypes.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6e1f6911423244b1f8c1f5fddda73fbf9bf8d1ee --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS_LibSip/LibSip_SDPTypes.ttcn @@ -0,0 +1,405 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +/******************************************************************************/ + +/** + * @author STF 346, STF366, STF368, STF369, STF450, STF471 + * @version $Id: LibSip_SDPTypes.ttcn 636 2014-09-18 11:44:10Z rennoch $ + * @desc This module defines message, attribute, structured and simple + * SDP types as well constants used by LipSip constructs.
+ * Note that any changes made to the definitions in this module + * may be overwritten by future releases of this library + * End users are encouraged to contact the distributers of this + * module regarding their modifications or additions + * This module is part of LibSipV3. + * @remark Adding of new attributes types is ok; Adding of new optional attributes in @see SDP_attribute type is ok; Existing attribute types shall not be changed or removed - change requests shall be made to http://t-ort.etsi.org + */ +module LibSip_SDPTypes { + import from LibSip_Common all; + group Constants { + group SimpleConstants { + // SDP net_type + const charstring c_in := "IN"; + + // SDP addr_type + const charstring c_ip4 := "IP4"; + const charstring c_ip6 := "IP6"; + + // SDP_media_desc: media + const charstring c_audio := "audio"; + const charstring c_image := "image"; + const charstring c_video := "video"; + const charstring c_text := "text"; + const charstring c_msrp := "msrp"; + + // SDP_media_desc: transport + const charstring c_rtpAvp := "RTP/AVP"; + const charstring c_rtpAvpf := "RTP/AVPF"; + const charstring c_msrpTcp := "TCP/MSRP"; + const charstring c_udptl := "Udptl"; + + // SDP_attribute_list constants: + const charstring c_local := "local"; + const charstring c_mandatory := "mandatory"; + const charstring c_optional := "optional"; + const charstring c_none := "none"; + const charstring c_qos := "qos"; + const charstring c_remote := "remote"; + const charstring c_sendrecv := "sendrecv"; + const charstring c_sendonly := "sendonly"; + const charstring c_inactive := "inactive"; + const charstring c_send := "send"; + const charstring c_recv := "recv"; + const charstring c_e2e := "e2e"; + } + } + group Types { + group SubTypes { + group AttributeTypes { + type record SDP_attribute_cat { + charstring attr_value + } + + type record SDP_attribute_keywds { + charstring attr_value + } + + type record SDP_attribute_tool { + charstring attr_value + } + + type record SDP_attribute_ptime { + charstring attr_value + } + + type record SDP_attribute_recvonly { + } + + type record SDP_attribute_sendrecv { + } + + type record SDP_attribute_sendonly { + } + + type record SDP_attribute_inactive { + } + + type record SDP_attribute_orient { + charstring attr_value + } + + type record SDP_attribute_type { + charstring attr_value + } + + type record SDP_attribute_charset { + charstring attr_value + } + + type record SDP_attribute_sdplang { + charstring attr_value + } + + type record SDP_attribute_lang { + charstring attr_value + } + + type record SDP_attribute_framerate { + charstring attr_value + } + + type record SDP_attribute_quality { + charstring attr_value + } + + type union SDP_attribute_fmtp_format_specific_params { + SemicolonParam_List paramList, + charstring unstructured + } + + type record SDP_attribute_fmtp { + charstring format, + SDP_attribute_fmtp_format_specific_params params + } + + type record SDP_attribute_curr { + charstring preconditionType, + charstring statusType, + charstring direction + } + + type record SDP_attribute_des { + charstring preconditionType, + charstring strength, + charstring statusType, + charstring direction + } + + type record SDP_attribute_conf { + charstring preconditionType, + charstring statusType, + charstring direction + } + + type record SDP_attribute_rtpmap_codec { + charstring encoding, + charstring clockrate, + charstring parameters optional + } + + type record SDP_attribute_rtpmap { + charstring payload_type, + SDP_attribute_rtpmap_codec codec + } + + type record SDP_attribute_rtcp { + integer portnumber, + SDP_connection connection optional + } + + type record SDP_attribute_msrp { + charstring attr_value + } + + type record SDP_attribute_unknown { + charstring name, + charstring attr_value optional + } + + type record SDP_attribute_maxptime { + charstring attr_value + } + + type record SDP_attribute_tcap { + integer trpr_cap_num, + Charstring_List proto_list + } + + type record SDP_attribute_pcfg { + integer config_number, + Charstring_List pot_cfg_list optional + } + + type record SDP_attribute_acfg { + integer config_number, + Charstring_List sel_cfg_list optional + } + + type record SDP_attribute_ecn_capable_rtp { + Charstring_List init_list, + Charstring_List parm_list optional + } + + type record SDP_attribute_rtcp_fb { + charstring rtcp_fb_pt, + charstring rtcp_fb_val + } + + type record SDP_attribute_rtcp_xr { + Charstring_List xr_format_list optional + } + + type record SDP_attribute_rtcp_rsize { + } + + type record SDP_attribute_3ge2ae { + charstring indicator + } + + type record SDP_attribute_crypto { + charstring tag, + charstring crypto_suite, + charstring key_params, + Charstring_List session_params optional + } + + type record SDP_attribute_content { + Charstring_List content_params + } + + type union SDP_attribute { + SDP_attribute_cat cat, + SDP_attribute_keywds keywds, + SDP_attribute_tool tool, + SDP_attribute_ptime ptime, + SDP_attribute_recvonly recvonly, + SDP_attribute_sendrecv sendrecv, + SDP_attribute_sendonly sendonly, + SDP_attribute_inactive inactive, + SDP_attribute_orient orient, + SDP_attribute_type sdp_type, + SDP_attribute_charset charset, + SDP_attribute_sdplang sdplang, + SDP_attribute_lang lang, + SDP_attribute_framerate framerate, + SDP_attribute_quality quality, + SDP_attribute_fmtp fmtp, + SDP_attribute_curr curr, + SDP_attribute_des des, + SDP_attribute_conf conf, + SDP_attribute_rtpmap rtpmap, + SDP_attribute_rtcp rtcp, + SDP_attribute_msrp msrp, + SDP_attribute_maxptime maxptime, + SDP_attribute_tcap tcap, + SDP_attribute_pcfg pcfg, + SDP_attribute_acfg acfg, + SDP_attribute_ecn_capable_rtp ecn_capable_rtp, + SDP_attribute_rtcp_fb rtcp_fb, + SDP_attribute_rtcp_xr rtcp_xr, + SDP_attribute_rtcp_rsize rtcp_rsize, + SDP_attribute_3ge2ae e2ae, + SDP_attribute_crypto crypto, + SDP_attribute_content content, + //* unknown has to be the last else encoding/decoding won't work! + SDP_attribute_unknown unknown + } + + } //* group AttributeTypes + + type set of SDP_attribute SDP_attribute_list; + + type record SDP_bandwidth { + charstring modifier, + integer bandwidth + } + + type set of SDP_bandwidth SDP_bandwidth_list; + + type record SDP_connection { + charstring net_type, + charstring addr_type, + SDP_conn_addr conn_addr + } + + type record SDP_conn_addr { + charstring addr, + integer ttl optional, + integer num_of_addr optional + } + + type set of SDP_connection SDP_connection_list; + + type record SDP_contact { + charstring addr_or_phone, + charstring disp_name optional + } + + type SDP_contact SDP_contact_tel; + + type SDP_contact SDP_contact_email; + + type set of SDP_contact_email SDP_email_list; + + type record of charstring SDP_fmt_list; + + type record SDP_key { + charstring method, + charstring key optional + } + + type record SDP_media_desc { + SDP_media_field media_field, + charstring information optional, + SDP_connection_list connections optional, + SDP_bandwidth_list bandwidth optional, + SDP_key key optional, + SDP_attribute_list attributes optional + } + + type set of SDP_media_desc SDP_media_desc_list; + + type record SDP_media_port { + integer port_number, + integer num_of_ports optional + } + + type record SDP_media_field { + charstring media, + SDP_media_port ports, + charstring transport, + SDP_fmt_list fmts + } + + type record SDP_time { + SDP_time_field time_field, + SDP_repeat_list time_repeat optional + } + + type record SDP_time_field { + charstring start_time, + //* field is numeric strings that may not fit into 32-bit signed int + charstring + stop_time //* field is numeric strings that may not fit into 32-bit signed int + } + + type record SDP_repeat { + SDP_typed_time repeat_interval, + SDP_typed_time active, + SDP_typed_time_list offsets + } + + type set of SDP_repeat SDP_repeat_list; + + type record SDP_typed_time { + integer time, + charstring unit optional + } + + type set of SDP_typed_time SDP_typed_time_list; + + type set of SDP_time SDP_time_list; + + type record SDP_timezone { + charstring adjustment_time, + SDP_typed_time offset + } + + type set of SDP_timezone SDP_timezone_list; + + type record SDP_Origin { + charstring user_name, + charstring session_id, + //* field is numeric strings that may not fit into 32-bit signed int + charstring session_version, + //* field is numeric strings that may not fit into 32-bit signed int + charstring net_type, + charstring addr_type, + charstring addr + } + + type set of SDP_contact_tel SDP_phone_list; + + } //* group SubTypes + + + group MessageTypes { + type record SDP_Message { + integer protocol_version, + SDP_Origin origin, + charstring session_name, + charstring information optional, + charstring uri optional, + SDP_email_list emails optional, + SDP_phone_list phone_numbers optional, + SDP_connection connection optional, + SDP_bandwidth_list bandwidth optional, + SDP_time_list times, + SDP_timezone_list timezone_adjustments optional, + SDP_key key optional, + SDP_attribute_list attributes optional, + SDP_media_desc_list media_list optional + } + with { + encode "SDPCodec"; + } + + } // group MessageTypes + + } // group Types +} // end module LibSip_SDPTypes diff --git a/IMS_PART4_IWD_15wk38/Common/IMS_LibSip/LibSip_SIPTypesAndValues.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS_LibSip/LibSip_SIPTypesAndValues.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..73511793a106f888f2448e3c5463e1a2a570e894 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS_LibSip/LibSip_SIPTypesAndValues.ttcn @@ -0,0 +1,1924 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +/******************************************************************************/ + +/** + * @author STF 346, STF366, STF368, STF369, STF450, STF471, STF160 + * @version $Id: LibSip_SIPTypesAndValues.ttcn 636 2014-09-18 11:44:10Z rennoch $ + * @desc This module defines message, header, structured and simple SIP + * types as well constants used by LipSip constructs.
+ * Note that any changes made to the definitions in this module + * may be overwritten by future releases of this library + * End users are encouraged to contact the distributers of this + * module regarding their modifications or additions + * This module is part of LibSipV3. + * @remark Adding of new message and header types is ok; Adding of new optional header fields in + * @see MessageHeader type is ok but should be done at same time as dummy template updates; Existing message or header types shall not be changed or removed - change requests shall be made to http://t-ort.etsi.org + */ +module LibSip_SIPTypesAndValues { + import from LibSip_MessageBodyTypes all; + import from LibSip_Common all; + + group Constants { + group SimpleConstants { + // SIP name protocol plus version + const charstring c_sipNameVersion := "SIP/2.0"; + + // SIP name protocol + const charstring c_sipName := "SIP"; + + // SIP version + const charstring c_sipVersion := "2.0"; + + // SIP scheme + const charstring c_sipScheme := "sip"; + + // TEL scheme + const charstring c_telScheme := "tel"; + + // URN schema + const charstring c_urnScheme := "urn"; + + // TAG_ID + const charstring c_tagId := "tag"; + + // BRANCH_ID + const charstring c_branchId := "branch"; + + // BRANCH_COOKIE + const charstring c_branchCookie := "z9hG4bK"; + + // EXPIRES_ID + const charstring c_expiresId := "expires"; + + // MADDR_ID + const charstring c_maddrId := "maddr"; + + // METHOD_ID + const charstring c_methodId := "method"; + + // RECEIVED_ID + const charstring c_receivedId := "received"; + + // TTL_ID + const charstring c_ttlId := "ttl"; + + // USER_ID + const charstring c_userId := "user"; + + // SDP name application + const charstring c_sdpApplication := "application/sdp"; + + // XML name application + const charstring c_xmlApplication := "application/xml"; + + // XML name application + const charstring c_xmlreginfoApplication := "application/reginfo+xml"; + + // XML name resource-list + const charstring c_xmlresourcelistApplication := "application/resource-lists+xml"; + + // IMS 3GPP name application + const charstring c_ims3gppApplication := "application/3gpp-ims+xml"; + + // IMS 3GPP name CW application + const charstring c_ims3gppCwApplication := "application/vnd.3gpp.cw+xml"; + + // IMS ETSI name MCID application + const charstring c_imsEtsiMcidApplication := "application/vnd.etsi.mcid+xml"; + + // IMS ETSI name CUG application + const charstring c_imsEtsiCugApplication := "application/vnd.etsi.cug+xml"; + + // IMS ETSI name Simservs application(TIP/TIR, ACR, CDIV, OIP/OIR, CUG) + const charstring c_imsEtsiSimservsApplication := "application/vnd.etsi.simservs+xml"; + + // OCTET-STREAM name application + const charstring c_octetApplication := "application/octet-stream"; + + // PLAIN-TEXT name application + const charstring c_plainText := "text/plain"; + + // SIP fragment message + const charstring c_sipfragMessage := "message/sipfrag"; + + // text content of 1300 bytes for messages with message body + const charstring c_longMessageContent_1300Bytes := + "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & + "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & oct2char('0D'O) & oct2char('0A'O); // CRLF + // Default SIP port number : 5060 + const integer c_defaultSipPort := 5060; + + // Default SIP protocol : UDP + const charstring c_defaultSipProt := "UDP"; + + // Fixed IP multicast address + const charstring c_mcastSipIpaddr := "224.0.1.75"; + + // Short delta-second used in expires parameter to acknowledge a registration + const charstring c_shortRegistration := "3600"; + + // ([RFC3891 ] Sec 6.1) + const charstring c_earlyFlag := "early-only"; + + // option tag replaces ([RFC3261 ] ) + const charstring c_replaces := "replaces"; + + // option tag 100rel (reliable provisional response [RFC3262 ] ) + const charstring c_tag100rel := "100rel"; + + // option tag from-change ([RFC4916 ] ) + const charstring c_tagFromChange := "from-change"; + + // option tag precondition (ch.11 [RFC3312 ] ) + const charstring c_tagPrecond := "precondition"; + + // due to problem with TAU compiler because hardcoded return statement constant is created + const HostPort c_hostport_dummy := { + host := "", + portField := c_defaultSipPort + }; + + // CLIP/CLIR information + const PrivacyValue c_privacy_none := "none"; + const PrivacyValue c_privacy_id := "id"; + const PrivacyValue c_privacy_header := "header"; + const PrivacyValue c_privacy_user := "user"; + const PrivacyValue c_privacy_critical := "critical"; + const PrivacyValue c_privacy_session := "session"; + + // + const charstring c_AT := "@"; // MRO + const charstring c_SP := oct2char('20'O); + const charstring c_SLASH := oct2char('2F'O); + const charstring c_LT := oct2char('3C'O); + const charstring c_GT := oct2char('3E'O); + + // * (wildchard) sign + const charstring c_WILDCARD := "*"; + + const integer c_CRlen := 2; + // length of new line (0d0a) + const GenericParam c_Integrity_protected_yes := {"integrity-protected", {tokenOrHost := "yes"}}; + const GenericParam c_Integrity_protected_no := {"integrity-protected", {tokenOrHost := "no"}}; + const GenericParam c_Integrity_protected_ip_assoc_pending := {"integrity-protected", {tokenOrHost := "ip-assoc-pending"}}; + + const charstring c_algorithm := "MD5"; + + } // end group SimpleConstants + + group AuthorizationConstants { + + const charstring c_ik := ""; + const charstring c_ck := ""; + const charstring c_nonce := ""; + const charstring c_nonce_value := "0edff6c521cc3f407f2d9e01cf6ed82b"; + + + } // end group AuthorizationConstants + + group PChargingVectorConstants { + + const charstring c_icid := "icid-value"; + const charstring c_icid_value := "123abc"; + const charstring c_icid_generated_at := "icid-generated-at"; + const charstring c_orig_ioi := "orig-ioi"; + const charstring c_term_ioi := "term-ioi"; + const charstring c_access_network_charging_info := "access-network-charging-info"; + + + } // end group PChargingVectorConstants + + group HeaderFieldConstants { + + const CallId c_empty_CallId := { + fieldName := CALL_ID_E, + callid := "" + }; + + const ContentType c_empty_ContentType := { + fieldName := CONTENT_TYPE_E, + mediaType := "" + }; + + const CSeq c_empty_cSeq := { + fieldName := CSEQ_E, + seqNumber := 0, + method := "EMPTY" + }; + + const From c_empty_From := { + fieldName := FROM_E, + addressField := { + nameAddr := { + displayName := omit, + addrSpec := { + scheme := c_sipScheme, + components := { + sip := { + userInfo := omit, + hostPort := { + host := "127.0.0.1", + portField := c_defaultSipPort + } + } + }, + urlParameters := omit, + headers := omit + } + } + }, + fromParams := omit + }; + + const MaxForwards c_maxForwards70 := { + fieldName := MAX_FORWARDS_E, + forwards := 70 + }; + + const SipUrl c_empty_RequestUri := { + scheme := c_sipScheme, + components := { + sip := { + userInfo := omit, + hostPort := { + host := "127.0.0.1", + portField := c_defaultSipPort + } + } + }, + urlParameters := omit, + headers := omit + }; + + const SipUrl c_unavailableUri := { + scheme := c_sipScheme, + components := { + sip := { + userInfo := { + userOrTelephoneSubscriber := "unavailable", + password := omit + }, + hostPort := { + host := "anonymous.invalid", + portField := c_defaultSipPort + } + } + }, + urlParameters := omit, + headers := omit + }; + + const To c_empty_To := { // value of To header + fieldName := TO_E, + addressField := { + nameAddr := { + displayName := omit, + addrSpec := { + scheme := c_sipScheme, + components := { + sip := { + userInfo := omit, + hostPort := { + host := "127.0.0.1", + portField := c_defaultSipPort + } + } + }, + urlParameters := omit, + headers := omit + } + } + }, + toParams := omit + }; + + const Via c_empty_Via := { + fieldName := VIA_E, + viaBody := { + { + sentProtocol := { + protocolName := c_sipName, + protocolVersion := c_sipVersion, + transport := c_defaultSipProt + }, + sentBy := { + host := "127.0.0.1", + portField := c_defaultSipPort + }, + viaParams := omit + } + } + }; + + + } + + + group UserProfileConstants { + // number of user profile from 1-10 for SIP profile + const integer c_userProfile_SIP1_home := 1; + const integer c_userProfile_SIP2_home := 2; + + + } // end group UserProfileConstants + + group StatusLines { + const StatusLine c_statusLine100 := {c_sipNameVersion, 100, "Trying"}; + const StatusLine c_statusLine180 := {c_sipNameVersion, 180, "Ringing"}; + const StatusLine c_statusLine181 := {c_sipNameVersion, 181, "Call Is Being Forwarded"}; + const StatusLine c_statusLine182 := {c_sipNameVersion, 182, "Queued"}; + const StatusLine c_statusLine183 := {c_sipNameVersion, 183, "Session Progress"}; + + const StatusLine c_statusLine200 := {c_sipNameVersion, 200, "OK"}; + const StatusLine c_statusLine202 := {c_sipNameVersion, 202, "Accepted"}; + + const StatusLine c_statusLine300 := {c_sipNameVersion, 300, "Multiple Choices"}; + const StatusLine c_statusLine301 := {c_sipNameVersion, 301, "Moved Permanently"}; + const StatusLine c_statusLine302 := {c_sipNameVersion, 302, "Moved Temporarily"}; + const StatusLine c_statusLine305 := {c_sipNameVersion, 305, "Use Proxy"}; + const StatusLine c_statusLine380 := {c_sipNameVersion, 380, "Alternative Service"}; + + const StatusLine c_statusLine400 := {c_sipNameVersion, 400, "Bad Request"}; + const StatusLine c_statusLine401 := {c_sipNameVersion, 401, "Unauthorized"}; + const StatusLine c_statusLine402 := {c_sipNameVersion, 402, "Payment Required"}; + const StatusLine c_statusLine403 := {c_sipNameVersion, 403, "Forbidden"}; + const StatusLine c_statusLine404 := {c_sipNameVersion, 404, "Not Found"}; + const StatusLine c_statusLine405 := {c_sipNameVersion, 405, "Method Not Allowed"}; + const StatusLine c_statusLine406 := {c_sipNameVersion, 406, "Not Acceptable"}; + const StatusLine c_statusLine407 := {c_sipNameVersion, 407, "Proxy Authentication Required"}; + const StatusLine c_statusLine408 := {c_sipNameVersion, 408, "Request Timeout"}; + const StatusLine c_statusLine410 := {c_sipNameVersion, 410, "Gone"}; + const StatusLine c_statusLine413 := {c_sipNameVersion, 413, "Request Entity Too Large"}; + const StatusLine c_statusLine414 := {c_sipNameVersion, 414, "Request-URI Too Long"}; + const StatusLine c_statusLine415 := {c_sipNameVersion, 415, "Unsupported Media Type"}; + const StatusLine c_statusLine416 := {c_sipNameVersion, 416, "Unsupported URI Scheme"}; + const StatusLine c_statusLine420 := {c_sipNameVersion, 420, "Bad Extension"}; + const StatusLine c_statusLine421 := {c_sipNameVersion, 421, "Extension Required"}; + const StatusLine c_statusLine422 := {c_sipNameVersion, 422, "Session Interval Too Small"}; + const StatusLine c_statusLine423 := {c_sipNameVersion, 423, "Interval Too Brief"}; + const StatusLine c_statusLine433 := {c_sipNameVersion, 433, "Anonymity Disallowed"}; + const StatusLine c_statusLine480 := {c_sipNameVersion, 480, "Temporarily Unavailable"}; + const StatusLine c_statusLine481 := {c_sipNameVersion, 481, "Call/Transaction Does Not Exist"}; + const StatusLine c_statusLine482 := {c_sipNameVersion, 482, "Loop Detected"}; + const StatusLine c_statusLine483 := {c_sipNameVersion, 483, "Too Many Hops"}; + const StatusLine c_statusLine484 := {c_sipNameVersion, 484, "Address Incomplete"}; + const StatusLine c_statusLine485 := {c_sipNameVersion, 485, "Ambiguous"}; + const StatusLine c_statusLine486 := {c_sipNameVersion, 486, "Busy Here"}; + const StatusLine c_statusLine487 := {c_sipNameVersion, 487, "Request Terminated"}; + const StatusLine c_statusLine488 := {c_sipNameVersion, 488, "Not Acceptable Here"}; + const StatusLine c_statusLine493 := {c_sipNameVersion, 493, "Undecipherable"}; + const StatusLine c_statusLine500 := {c_sipNameVersion, 500, "Server Internal Error"}; + const StatusLine c_statusLine501 := {c_sipNameVersion, 501, "Not implemented"}; + const StatusLine c_statusLine502 := {c_sipNameVersion, 502, "Bad Gateway"}; + const StatusLine c_statusLine503 := {c_sipNameVersion, 503, "Service Unavailable"}; + const StatusLine c_statusLine504 := {c_sipNameVersion, 504, "Server Time-out"}; + const StatusLine c_statusLine505 := {c_sipNameVersion, 505, "Version Not Supported"}; + const StatusLine c_statusLine513 := {c_sipNameVersion, 513, "Message Too Large"}; + const StatusLine c_statusLine580 := {c_sipNameVersion, 580, "Precondition Failure"}; + const StatusLine c_statusLine600 := {c_sipNameVersion, 600, "Busy Everywhere"}; + const StatusLine c_statusLine603 := {c_sipNameVersion, 603, "Decline"}; + const StatusLine c_statusLine604 := {c_sipNameVersion, 604, "Does Not Exist Anywhere"}; + const StatusLine c_statusLine606 := {c_sipNameVersion, 606, "Not Acceptable"}; + + + } // end StatusLines + + group SIPSyncPointNames { + const charstring c_Ringing := "Ringing"; + const charstring c_uPlane := "uPlane"; + const charstring c_sync1 := "sync1"; + const charstring c_sync2 := "sync2"; + const charstring c_sync3 := "sync3"; + const charstring c_sync4 := "sync4"; + const charstring c_uPlaneStop := "uPlaneStop"; + const charstring c_annoucA := "announcementA"; + const charstring c_annoucB := "announcementB"; + const charstring c_annouc := "announcement"; + const charstring c_voicem := "voiceMessage"; + } + + + } // end group Constants + + group Types { + group SubTypes { + // Subtypes + group TokenTypes // TokensTypes + { + // [20 ] + type enumerated FieldName { + ACCEPT_E, + ACCEPT_ENCODING_E, + ACCEPT_LANGUAGE_E, + ALERT_INFO_E, + ALLOW_E, + AUTHENTICATION_INFO_E, + AUTHORIZATION_E, + CALL_ID_E, + CALL_INFO_E, + CONTACT_E, + CONTENT_DISPOSITION_E, + CONTENT_ENCODING_E, + CONTENT_LANGUAGE_E, + CONTENT_LENGTH_E, + CONTENT_TYPE_E, + CSEQ_E, + DATE_E, + ERROR_INFO_E, + EXPIRES_E, + FROM_E, + IN_REPLY_TO_E, + MAX_FORWARDS_E, + MIME_VERSION_E, + MIN_EXPIRES_E, + ORGANIZATION_E, + PRIORITY_E, + PROXY_AUTHENTICATE_E, + PROXY_AUTHORIZATION_E, + PROXY_REQUIRE_E, + RECORD_ROUTE_E, + REPLY_TO_E, + REQUIRE_E, + RETRY_AFTER_E, + ROUTE_E, + SERVER_E, + SUBJECT_E, + SUPPORTED_E, + TIMESTAMP_E, + TO_E, + UNSUPPORTED_E, + USER_AGENT_E, + VIA_E, + WARNING_E, + WWW_AUTHENTICATE_E, + // [3262/7.1 ] + RACK_E, + RSEQ_E, + // [3265/7.2 ] + ALLOW_EVENTS_E, + EVENT_E, + SUBSCRIPTION_STATE_E, + // [3313 ] + P_MEDIA_AUTHORIZATION_E, + // [3323 ] + PRIVACY_E, + // [3325 ] + P_ASSERTED_ID_E, + P_PREFERRED_ID_E, + P_PREFERRED_SERVICE_E, + // [3326 ] + REASON_E, + // [3515 ] - REFER method + REFER_TO_E, + // [4488 ] - REFER method + REFER_SUB_E, + // [3891 ] + REPLACES_E, + // [3892 ] - REFER method + REFERRED_BY_E, + // [4244 ] + HISTORY_INFO_E, + // [3313 ] + P_MEDIA_AUTH_E, + // [3327 ] + PATH_E, + // [3329 ] + SECURITY_CLIENT_E, + SECURITY_SERVER_E, + SECURITY_VERIFY_E, + // [3455 ] + P_ACCESS_NETWORK_INFO_E, + P_ASSOCIATED_URI_E, + P_CALLED_PARTY_E, + P_CHARGING_FUNCTION_ADDRESSES_E, + P_CHARGING_VECTOR_E, + P_VISITED_NETWORK_E, + // [3608 ] + SERVICE_ROUTE_E, + // [3841 ] + ACCEPT_CONTACT_E, + REQUEST_DISPOSITION_E, + // [4028 ] + MIN_SE_E, + SESSION_EXPIRES_E, + P_ASSERTED_SERVICE_E, + // [5009 ] + P_EARLY_MEDIA_E, + // http://tools.ietf.org/html/draft-johnston-sipping-cc-uui-07 + // Transporting User to User Call Control Information in SIP for ISDN Interworking + USER_TO_USER_E, + // [6442 ] /* + // @sic R5-133151 update of header fields sic@ */ + GEOLOCATION_E, + GEOLOCATION_ROUTING_E, + SESSION_ID_E, + SIP_ETAG_E, + SIP_IF_MATCH_E, + FEATURE_CAPS_E, + // 6086 + RECV_INFO_E, + INFO_PACKAGE_E + } + + // [7.1 ] + type enumerated Method { + ACK_E, + BYE_E, + CANCEL_E, + INVITE_E, + OPTIONS_E, + REGISTER_E, + PRACK_E // Note: this element is not defined in [5 ] + , + SUBSCRIBE_E, + NOTIFY_E // [3265 ] + , + PUBLISH_E // [3903/12 ] + , + REFER_E // [3515 ] + , + UPDATE_E // [3311 ] + , + MESSAGE_E // [3428 ] + , + INFO_E // [2976 ] + , + UNKNOWN_METHOD_E + } + + // [20.10, 20.20, 20.30, 20.31, 20.34, 20.39, 20.42, 20.43 ] + type record HostPort { + charstring host optional, // hostname, IPv4 or IPv6 + integer portField optional // represented as an integer + } + + // [20.10, 20.20, 20.30, 20.31, 20.34, 20.39 ] + /** + * @desc identifier for user or telephone subscriber + * @member userOrTelephoneSubscriber provides the username or a phone name identifying the subscriber + * @member password related password information + */ + type record UserInfo { + charstring userOrTelephoneSubscriber, + charstring password optional + } + + // [19.1.1 ;used in: 20.10, 20.20, 20.30, 20.31, 20.34, 20.39 ] + /** + * @desc Uniform Resource Identifier (URI) + * @member scheme distinguishes call types, e.g. voice, fax etc. or related address scheme, e.g. tel, sip + * @member userInfo Contains user information (also in non-SIP URLs) with optional parameter as passwords + * @member hostPort Hostname or IP address information and port identifier of the target + * @member urlParameters Contains either SIP or TEL URL parameters, separated by semicolons, e.g. transport=tcp or user=phone + * @member headers Additional information added after the parameters, e.g. priority=urgent + */ + type record SipUriComponents { // sip-uri acc. to RFC 3261 cl. 19.1 + UserInfo userInfo optional, + HostPort hostPort + } + + type record TelUriComponents { // tel-uri acc. to RFC 3966 + charstring subscriber + } + + type record UrnUriComponents { // urn-uri acc. to RFC 2141 + charstring namespaceId, // e.g. "service" as acc. to RFC 5031 + charstring namespaceSpecificString // e.g. "sos" + } + + type union UriComponents { + SipUriComponents sip, // scheme: "sip" or sips" + TelUriComponents tel, // scheme: "tel" + UrnUriComponents urn, // scheme: "urn" + charstring other // scheme: none of the above schemes + } + + type record SipUrl { + charstring scheme, // e.g "sip" or "tel" + UriComponents components, // corresponding to the scheme + SemicolonParam_List urlParameters optional, + AmpersandParam_List headers optional + } + + // [20.1, RFC2616 14.1 ] + type record AcceptBody { + charstring mediaRange, + SemicolonParam_List acceptParam optional + } + + // [20.1, RFC2616 14.1 ] + type set of AcceptBody AcceptBody_List; + + // [20.4 ] + type record AlertInfoBody { + charstring url, // any URI + SemicolonParam_List genericParams optional + } + + // [20.4 ] + type set of AlertInfoBody AlertInfoBody_List; + + // [20.8 ] + type charstring CallidString; + // token [" + // [20.8 ] + type set of CallidString CallidString_List; + + // [20.9 ] + type record CallInfoBody { + charstring url, // any URI + SemicolonParam_List infoParams optional + } + + // [20.9 ] + type set of CallInfoBody CallInfoBody_List; + + // [20.27, 20.44, .......10.32, 10.48; RFC2616 14.33, 14.47; RFC2617 1.2 ] + type union Challenge { + CommaParam_List digestCln, + OtherAuth otherChallenge + } + + // [20.10, 20.20, 20.30, 20.31, 20.34, 20.39 ] + type union DisplayName + { + charstring token, + charstring quotedString + } + + // [20.10, 20.20, 20.30, 20.31, 20.34, 20.39 ] + type record NameAddr { + DisplayName displayName optional, + SipUrl addrSpec + } + + // [20.10, 20.20, 20.31, 20.39 ] + type union Addr_Union { + NameAddr nameAddr, + SipUrl addrSpecUnion // STS: "Union" added to filed name to avoid dangerous name equivalence with 2nd NameAddr field + } + + // [20.10 ] + type record ContactAddress { + Addr_Union addressField, + SemicolonParam_List contactParams optional + } + + // [20.10 ] + type set of ContactAddress ContactAddress_List; // 1 or more elements + // [20.10 ] + type union ContactBody { + charstring wildcard, + ContactAddress_List contactAddresses + } + + // [20.2, 20.12; RFC2616 14.3, 14.11 ] + type charstring ContentCoding; + + // [20.2, 20.12; RFC2616 14.3, 14.11 ] + type set of ContentCoding ContentCoding_List; + + // [20.7, 20.28; RFC2616 14.35 RFC2617 1.2 ] + type union Credentials { + CommaParam_List digestResponse, + OtherAuth otherResponse + } + + // allow multiple Authorization headers due to RFC3261 ch. 20.7 and 20.28 + type record of Credentials CredentialsList; + + // [20.19, 20.23, 20.33 ] + type charstring DeltaSec; // an external operation can handle this field + // [20.18 ] + type record ErrorInfoBody { + charstring uri, // any URI + SemicolonParam_List genericParams optional + } + + // [20.18 ] + type set of ErrorInfoBody ErrorInfoBody_List; + + // [20.3 RFC2616 14.4 ] + type record LanguageBody { + charstring languageRange, + SemicolonParam_List acceptParam optional + } + + // [20.3 RFC2616 14.4 ] + type set of LanguageBody LanguageBody_List; + + // [20.13; RFC2616 14.12 ] + type charstring LanguageTag; + + // [20.13; RFC2616 14.12 ] + type set of LanguageTag LanguageTag_List; + + // [20.5 ] + type set of charstring Method_List; + + // [20.29, 20.32, 20.37, 20.40 ] + type charstring OptionTag; + + // [20.29, 20.32, 20.37, 20.40 ] + type set of OptionTag OptionTag_List; + + // [20.7, 20.27, 20.28, 20.44 ; RFC2616 14.33, 14.47; RFC2617 1.2 ] + type record OtherAuth { + charstring authScheme, + CommaParam_List authParams + } + + type record Payload { + integer payloadlength, + charstring payloadvalue + } + + // [20.30,20.34 ] + type record RouteBody { + NameAddr nameAddr, + SemicolonParam_List rrParam optional + } + + // [20.30,20.34 ] + type record of RouteBody RouteBody_List; + + // [20.42 ] + type record SentProtocol { + charstring protocolName, + charstring protocolVersion, + charstring transport + } + + // [20.35, 20.41; RFC2616 14.43 ] + type charstring ServerVal; + + // [20.35, 20.41; RFC2616 14.43 ] + type set of ServerVal ServerVal_List; + + // [20.38 ] + type record TimeValue { + integer majorDigit, // represented as an integer + integer minorDigit optional // represented as an integer + } + + // [20.42 ] + type record ViaBody { + SentProtocol sentProtocol, + HostPort sentBy, + SemicolonParam_List viaParams optional + } + + // [20.42 ] + type record of ViaBody ViaBody_List; + + // [20.43 ] + type union WarnAgent { + HostPort hostPort, + charstring pseudonym + } + + // [20.43 ] + type record WarningValue { + integer warnCode, // represented as an integer + WarnAgent warnAgent, + charstring warnText + } + + // [20.43 ] + type set of WarningValue WarningValue_List; + + type Addr_Union PAssertedIDValue; + + type record of PAssertedIDValue PAssertedIDValue_List; + + type charstring PAssertedServiceValue; + + type Addr_Union PPreferredIDValue; + + type record of PPreferredIDValue PPreferredIDValue_List; + + type charstring PrivacyValue; + + type record of PrivacyValue PrivacyValue_List; + + type set of FcValue FcValue_List; + type record FcValue { + charstring wildcard(c_WILDCARD), + SemicolonParam_List fcParams optional + } + + + } // end group TokensType + + + group HeaderFieldTypes // Header Fields + { + group CommonHeaderFieldTypes { + // [20.1, RFC2616 14.1 ] + type record Accept { + FieldName fieldName (ACCEPT_E) , + AcceptBody_List acceptArgs optional + } + + // [20.2, RFC2616 14.3 ] + type record AcceptEncoding { + FieldName fieldName (ACCEPT_ENCODING_E) , + ContentCoding_List contentCoding optional + } + + // [20.3, RFC2616 14.4 ] + type record AcceptLanguage { + FieldName fieldName (ACCEPT_LANGUAGE_E) , + LanguageBody_List languageBody optional + } + + // [20.4 ] + type record AlertInfo { + FieldName fieldName (ALERT_INFO_E) , + AlertInfoBody_List alertInfoBody optional + } + + // [20.5 ] + type record Allow { + FieldName fieldName (ALLOW_E) , + Method_List methods optional + } + + // [20.6 ] + type record AuthenticationInfo { + FieldName fieldName (AUTHENTICATION_INFO_E) , + CommaParam_List ainfo + } + + // [20.7 RFC2617 3.2.2 ] + type record Authorization { + FieldName fieldName (AUTHORIZATION_E) , + CredentialsList body // changed from Credentials to allow multiple Authorization headers + } + + // [20.8 ] + type record CallId { + FieldName fieldName (CALL_ID_E) , + CallidString callid + } + + // [20.9 ] + type record CallInfo { + FieldName fieldName (CALL_INFO_E) , + CallInfoBody_List callInfoBody optional + } + + // [20.10 ] + type record Contact { + FieldName fieldName (CONTACT_E) , + ContactBody contactBody + } + + // [20.11 ] + type record ContentDisposition { + FieldName fieldName (CONTENT_DISPOSITION_E) , + charstring dispositionType, + SemicolonParam_List dispositionParams optional + } + + // [20.12 RFC2616 14.11 ] + type record ContentEncoding { + FieldName fieldName (CONTENT_ENCODING_E) , + ContentCoding_List contentCoding + } + + // [20.13 RFC2616 14.12 ] + type record ContentLanguage { + FieldName fieldName (CONTENT_LANGUAGE_E) , + LanguageTag_List languageTag + } + + // [20.14 ] + type record ContentLength { + FieldName fieldName (CONTENT_LENGTH_E) , + integer len // this field is represented as an integer + } + + // [20.15 ] + type record ContentType { + FieldName fieldName (CONTENT_TYPE_E) , + charstring mediaType + } + + // [20.16 ] + type record CSeq { + FieldName fieldName (CSEQ_E) , + integer seqNumber, // this field is represented as an integer + charstring method + } + + // [20.17 ] + type record Date { + FieldName fieldName (DATE_E) , + charstring sipDate + } + + // [20.18 ] + type record ErrorInfo { + FieldName fieldName (ERROR_INFO_E) , + ErrorInfoBody_List errorInfo optional + } + + // [20.19 ] + type record Expires { + FieldName fieldName (EXPIRES_E) , + DeltaSec deltaSec + } + + //[6809] + type record FeatureCaps { + FieldName fieldName(FEATURE_CAPS_E), + FcValue_List fcValues + } + + // [20.20 ] + type record From { + FieldName fieldName (FROM_E) , + Addr_Union addressField, + SemicolonParam_List fromParams optional + } + + // [20.21 ] + type record InReplyTo { + FieldName fieldName (IN_REPLY_TO_E) , + CallidString_List callids + } + + // [20.22 ] + type record MaxForwards { + FieldName fieldName (MAX_FORWARDS_E) , + integer forwards // this field is represented as an integer + } + + // [20.23 ] + type record MinExpires { + FieldName fieldName (MIN_EXPIRES_E) , + DeltaSec deltaSec + } + + // [20.24 RFC2616 19.4.1 ] + type record MimeVersion { + FieldName fieldName (MIME_VERSION_E) , + integer majorNumber, // this field is represented as an integer + integer minorNumber // this field is represented as an integer + } + + // [20.25 ] + type record Organization { + FieldName fieldName (ORGANIZATION_E) , + charstring organization + } + + // [20.26 ] + type record Priority { + FieldName fieldName (PRIORITY_E) , + charstring priorityValue + } + + // [20.27 RFC2616 14.33 RFC2617 1.2 ] + type record ProxyAuthenticate { + FieldName fieldName (PROXY_AUTHENTICATE_E) , + Challenge challenge + } + + // [20.28 RFC2616 14.35 RFC2617 1.2 ] + type record ProxyAuthorization { + FieldName fieldName (PROXY_AUTHORIZATION_E) , + CredentialsList + credentials // changed from Credentials to allow multiple Authorization headers + } + + // [20.29 ] + type record ProxyRequire { + FieldName fieldName (PROXY_REQUIRE_E) , + OptionTag_List optionsTags + } + + // [20.30 ] + type record RecordRoute { + FieldName fieldName (RECORD_ROUTE_E) , + RouteBody_List routeBody + } + + type set of InfoPackage_Type InfoPackage_List; + + type record InfoPackage_Type { + charstring infoPackageName, + SemicolonParam_List infoPackageParams optional + + } + + //[6086] + type record RecvInfo { + FieldName fieldName(RECV_INFO_E), + InfoPackage_List infoPackageList + } + + //[6086] + type record InfoPackage { + FieldName fieldName(INFO_PACKAGE_E), + InfoPackage_Type infoPackageType + } + + // [20.31 ] + type record ReplyTo { + FieldName fieldName (REPLY_TO_E) , + Addr_Union addressField, + SemicolonParam_List replyToParams optional + } + + // [20.32 ] + type record Require { + FieldName fieldName (REQUIRE_E) , + OptionTag_List optionsTags + } + + // [20.33 ] + type record RetryAfter { + FieldName fieldName (RETRY_AFTER_E) , + DeltaSec deltaSec, + charstring comment optional, + SemicolonParam_List retryParams optional + } + + // [20.34 ] + type record Route { + FieldName fieldName (ROUTE_E) , + RouteBody_List routeBody + } + + // [20.35 RFC2616 14.38 ] + type record Server { + FieldName fieldName (SERVER_E) , + ServerVal_List serverBody + } + + // [20.36 ] + type record Subject { + FieldName fieldName (SUBJECT_E) , + charstring summary + } + + // [20.37 ] + type record Supported { + FieldName fieldName (SUPPORTED_E) , + OptionTag_List optionsTags optional + } + + // [20.38 ] + type record Timestamp { + FieldName fieldName (TIMESTAMP_E) , + TimeValue timeValue optional, + TimeValue delay optional + } + + // [20.39 ] + type record To { + FieldName fieldName (TO_E) , + Addr_Union addressField, + SemicolonParam_List toParams optional + } + + // [20.40 ] + type record Unsupported { + FieldName fieldName (UNSUPPORTED_E) , + OptionTag_List optionsTags + } + + // Undefined header field + type record UndefinedHeader { + charstring headerName, + charstring headerValue + } + + type set of UndefinedHeader UndefinedHeader_List; + + // [20.41 RFC2616 14.43 ] + type record UserAgent { + FieldName fieldName (USER_AGENT_E) , + ServerVal_List userAgentBody + } + + // [20.42 ] + type record Via { + FieldName fieldName (VIA_E) , + ViaBody_List viaBody + } + + // [20.43 ] + type record Warning { + FieldName fieldName (WARNING_E) , + WarningValue_List warningValue + } + + // [20.44 RFC2616 14.47 RFC2617 1.2 ] + type record WwwAuthenticate { + FieldName fieldName (WWW_AUTHENTICATE_E) , + Challenge challenge + } + + } // end group CommonHeaderFieldTypes + group RFC3262HeaderFieldTypes { + // [3262/7.1 ] + type record RSeq { + FieldName fieldName (RSEQ_E) , + integer responseNum + } + + // [3262/7.2 ] + type record RAck { + FieldName fieldName (RACK_E) , + integer responseNum, + integer seqNumber, + charstring method + } + + } // end group RFC3262HeaderFieldTypes + + group RFC3265HeaderFieldTypes { + // [3265/7.2 ] + type record AllowEvents { + FieldName fieldName (ALLOW_EVENTS_E) , + EventType_List eventTypes + } + + type set of EventType EventType_List; + type charstring EventType; + + // [3265/7.2 ] + type record Event { + FieldName fieldName (EVENT_E) , + EventType eventType, + SemicolonParam_List eventParams optional + } + + // [3265/7.2 ] + type record SubscriptionState { + FieldName fieldName (SUBSCRIPTION_STATE_E) , + SubState subState, + SemicolonParam_List substateParams optional + } + + type charstring SubState; + + } // end group RFC3265HeaderFieldTypes + + group RFC3313HeaderFieldTypes { + // [3313/5 ] + type record PMediaAuthorization { + FieldName fieldName (P_MEDIA_AUTHORIZATION_E) , + PMediaAuthorization_List pMediaAuthorizations + } + + type charstring PMediaAuthValue; // HEXDIG "0"-"9", "A"-"F" + type record of PMediaAuthValue PMediaAuthorization_List; + + + } // end group RFC3265HeaderFieldTypes + + group RFC3323HeaderFieldTypes { + // [3323 ] + type record Privacy { + FieldName fieldName (PRIVACY_E) , + PrivacyValue_List privValueList + } + + } // end group RFC3323HeaderFieldTypes + + group RFC3325HeaderFieldTypes { + // [3325 ] + type record PAssertedID { + FieldName fieldName (P_ASSERTED_ID_E) , + PAssertedIDValue_List pAssertedIDValueList + } + + // [3325 ] + type record PPreferredID { + FieldName fieldName (P_PREFERRED_ID_E) , + PPreferredIDValue_List pPreferredIDValueList + } + // draft-drage-sipping-service-identification-01 (July 2007) + type record PPreferredService { + FieldName fieldName (P_PREFERRED_SERVICE_E) , + charstring serviceId + } + + + } // end group RFC3325HeaderFieldTypes + + group RFC3326HeaderFieldTypes { + // [3326 ] + type record of ReasonValue ReasonValues; + + type record ReasonValue { + charstring token, + SemicolonParam_List reasonParams optional + } + + type record Reason { + FieldName fieldName (REASON_E) , + ReasonValues reasonValues + } + + } // end group RFC3326HeaderFieldTypes + + group RFC3327HeaderFieldTypes { + // [3327 ] + type record Path { + FieldName fieldName (PATH_E) , + PathValues pathValues + } + + type record of PathValue PathValues; + + type record PathValue { + NameAddr nameAddr, + SemicolonParam_List rrParam optional + } + + } // end group RFC3515HeaderFieldTypes + + + group RFC4488HeaderFieldTypes { + // [4488 ] + type record ReferSub { + FieldName fieldName (REFER_SUB_E) , + boolean referSubValue, + SemicolonParam_List referSubParams optional + } + + } // end group RFC4488HeaderFieldTypes + + group RFC3329HeaderFieldTypes { + // [RFC3329/2.2 ] + type record SecurityMechanism { + charstring mechName, + SemicolonParam_List mechParams optional + } + + type set of SecurityMechanism SecurityMechanism_List; + + type record SecurityClient { + FieldName fieldName (SECURITY_CLIENT_E) , + SecurityMechanism_List securityMech + } + + type record SecurityServer { + FieldName fieldName (SECURITY_SERVER_E) , + SecurityMechanism_List securityMech + } + + type record SecurityVerify { + FieldName fieldName (SECURITY_VERIFY_E) , + SecurityMechanism_List securityMech + } + + } // end group RFC3329HeaderFieldTypes + + group RFC3455HeaderFieldTypes { + type record of NameAddrParam NameAddrParam_List; + + type record NameAddrParam { + NameAddr nameAddr, + SemicolonParam_List genericParams optional + } + // [3455/5.1 ] + type record PAssociatedURI { + FieldName fieldName (P_ASSOCIATED_URI_E) , + NameAddrParam_List nameAddrList + } + // [3455/5.2 ] + type record PCalledPartyID { + FieldName fieldName (P_CALLED_PARTY_E) , + NameAddrParam nameAddParams + } + + type record of VnetworkSpec VnetworkSpec_List; + + type record VnetworkSpec { + charstring vNetworkSpecToken, + SemicolonParam_List genericParams optional + } + + // [3455/5.3 ] + type record PVisitedNetworkID { + FieldName fieldName (P_VISITED_NETWORK_E) , + VnetworkSpec_List vNetWorkSpec + } + + // [3455/5.4 ] + type record PAccessNetworkInfo { + FieldName fieldName (P_ACCESS_NETWORK_INFO_E) , + charstring accessType, + SemicolonParam_List genericParams optional + } + + // [3455/5.5 ] + type record PChargingFunctionAddresses { + FieldName fieldName (P_CHARGING_FUNCTION_ADDRESSES_E) , + SemicolonParam_List chargeAddrParams optional + } + + // [3455/5.6 ] + type record PChargingVector { + FieldName fieldName (P_CHARGING_VECTOR_E) , + charstring icidValue, + SemicolonParam_List chargeParams optional + } + + } // end group RFC33455HeaderFieldTypes + + group RFC3515HeaderFieldTypes { + // [3515 ] + type record ReferTo { + FieldName fieldName (REFER_TO_E) , + NameAddr nameAddr, + SemicolonParam_List referToParams optional + } + + } // end group RFC3515HeaderFieldTypes + + group RFC3608HeaderFieldTypes { + // [3608 ] + type record ServiceRoute { + FieldName fieldName (SERVICE_ROUTE_E) , + RouteBody_List routeBody + } + + } // end group RFC33608HeaderFieldTypes + + + group RFC3841HeaderFieldTypes { + // [3841 ] + type record AcceptContact { + FieldName fieldName (ACCEPT_CONTACT_E) , + AcRcValue_List acValues + } + + type set of AcRcValue AcRcValue_List; + + type record AcRcValue { + charstring wildcard (c_WILDCARD) , + SemicolonParam_List acRcParams optional + } + // [RFC 3841 ] + type charstring Directive; + type set of Directive Directive_List; + type record RequestDisposition { + FieldName fieldName (REQUEST_DISPOSITION_E) , + Directive_List directives + } + + + } // end group RFC3841HeaderFieldTypes + + group RFC3891HeaderFieldTypes { + // [3891 ] + type record Replaces { + FieldName fieldName (REPLACES_E) , + CallidString callid, + SemicolonParam_List replacesParams optional + } + + } // end group RFC3891HeaderFieldTypes + + group RFC3892HeaderFieldTypes { + // [3892 ] + type record ReferredBy { + FieldName fieldName (REFERRED_BY_E) , + NameAddr nameAddr, + SemicolonParam_List referredbyIdParams optional + } + + } // end group RFC3892HeaderFieldTypes + + group RFC4028HeaderFieldTypes { + // [4028 ] + type record MinSE { + FieldName fieldName (MIN_SE_E) , + DeltaSec deltaSec, + SemicolonParam_List minSeParam optional + } + // [4028 ] + type record SessionExpires { + FieldName fieldName (SESSION_EXPIRES_E) , + DeltaSec deltaSec, + SemicolonParam_List seParam optional + } + + } // end group RFC4028HeaderFieldTypes + + group RFC4244HeaderFieldTypes { + // [4244 ] + type record HistoryInfo { + FieldName fieldName (HISTORY_INFO_E) , + HistoryInfo_List historyInfoList + } + + type record of HistoryInfoEntry HistoryInfo_List; + + type record of integer IntegerList; + + type record HistoryInfoEntry { + NameAddr nameAddr, + IntegerList hiIndex optional, + SemicolonParam_List hiExtention optional + } + + type record of charstring StringList; + + } // end group RFC4244HeaderFieldTypes + + group RFC5009PEarlyMediaHeader { + // [5009 ] + type record PEarlyMedia { + FieldName fieldName (P_EARLY_MEDIA_E) , + EM_List em_param + } + type record of charstring EM_List; + + } // end group RFC5009PEarlyMediaHeader + + // http://tools.ietf.org/html/draft-johnston-sipping-cc-uui-07, expires 16.Aug.2009 + // Transporting User to User Call Control Information in SIP for ISDN Interworking + // type definition of SIP header mechanism + group UserToUser_PreliminaryRFCDraft { + type record UserToUser { + FieldName fieldName (USER_TO_USER_E) , + charstring uuiData length(256), + /*length limitation due to ISDN, max of allowed 128 hex digits are represented by 256 characters*/ + GenericParam uuiParam + } + + + } // end group UserToUser_PreliminaryRFCDraft + + type record PAssertedService { + FieldName fieldName (P_ASSERTED_SERVICE_E) , + PAssertedServiceValue pAssertedServiceValue + } + + group RFC6442GeolocationConveyance { + /* @sic R5-133151 update of header fields sic@ */ + // [6442 ] + type record Geolocation { + // RFC6442 clause 4.1 + FieldName fieldName (GEOLOCATION_E) , + SipUrl addrSpec, + SemicolonParam_List geolocParam optional + } + type enumerated GeolocationRoutingState { + GEOLOCATION_ROUTING_YES_E, GEOLOCATION_ROUTING_NO_E, GEOLOCATION_ROUTING_OTHER_E + } + type record GeolocationRouting { + // RFC6442 clause 4.2 + FieldName fieldName (GEOLOCATION_ROUTING_E) , + GeolocationRoutingState state, + GenericParam genericValue optional + } + + } // end group RFC6442GeolocationConveyance + + type charstring SessIdString length(32); + + type record SessionId { + FieldName fieldName (SESSION_ID_E) , + SessIdString sessid, + GenericParam sessidParam optional + } + + type charstring EntityTag; + + type record SIP_ETag { + FieldName fieldName (SIP_ETAG_E) , + EntityTag entityTag + } + + type record SIP_If_Match { + FieldName fieldName (SIP_IF_MATCH_E) , + EntityTag entityTag + } + + + } // end group HeaderFieldTypes + + group MessageHeaderTypes { + + // Message-Header for all SIP requests and responses [20 ] + type set MessageHeader { + Accept accept optional, + AcceptContact acceptContact optional, + AcceptEncoding acceptEncoding optional, + AcceptLanguage acceptLanguage optional, + AlertInfo alertInfo optional, + Allow allow optional, + AllowEvents allowEvents optional, + // 3265/7.2 + AuthenticationInfo authenticationInfo optional, + // only in responses + Authorization authorization optional, + // only in requests + CallId callId optional, + // optional only in Invalid test cases mandatory otherwise + CallInfo callInfo optional, + Contact contact optional, + // optional in response and all requests except INVITE where mandatory + ContentDisposition contentDisposition optional, + ContentEncoding contentEncoding optional, + ContentLanguage contentLanguage optional, + ContentLength contentLength optional, + // optional in responses and all requests except ACK where mandatory + ContentType contentType optional, + CSeq cSeq optional, + // optional only in Invalid test cases mandatory otherwise + Date date optional, + ErrorInfo errorInfo optional, + // only in responses + Event event optional, + // 3265/7.2 + Expires expires optional, + FeatureCaps featureCaps optional, // 6809 + From fromField, + Geolocation geolocation optional, + // 6442 + GeolocationRouting geolocationRouting optional, + // 6442 + // @sic R5-133151 update of header fields sic@ + HistoryInfo historyInfo optional, + // 4244 + InfoPackage infoPackage optional, //6086 + InReplyTo inReplyTo optional, + // only in requests + MaxForwards maxForwards optional, + // mandatory in requests not required in responses! + MimeVersion mimeVersion optional, + MinExpires minExpires optional, + // only in responses + MinSE minSE optional, + // 4028 + Organization organization optional, + PAccessNetworkInfo pAccessNetworkInfo optional, + // 3455 + PAssertedID pAssertedID optional, + // 3325 + PAssertedService pAssertedService optional, + PAssociatedURI pAssociatedURI optional, + // 3455 + Path path optional, + // 3327 + PCalledPartyID pCalledPartyID optional, + // 3455 + PChargingFunctionAddresses pChargingFunctionAddresses optional, + // 3455 + PChargingVector pChargingVector optional, + // 3455 + PEarlyMedia pEarlyMedia optional, + // 5009 + PMediaAuthorization pMediaAuthorization optional, + // 3313 + PPreferredID pPreferredID optional, + // 3325 + PPreferredService pPreferredService optional, + // draft-drage-sipping-service-identification-01 (July 2007) + Priority priority optional, + // only in requests + Privacy privacy optional, + // 3323 + ProxyAuthenticate proxyAuthenticate optional, + // only in responses + ProxyAuthorization proxyAuthorization optional, + // only in requests + ProxyRequire proxyRequire optional, + // only in requests + PVisitedNetworkID pVisitedNetworkID optional, + // 3455 + RAck rAck optional, + // 3262/7.1 + RSeq rSeq optional, + // 3262/7.1 + Reason reason optional, + // 3326 + RecordRoute recordRoute optional, + RecvInfo recvInfo optional, //6086 + RequestDisposition requestDisposition optional, + // 3841 + ReferredBy referredBy optional, + // 3892 - REFER method + ReferTo referTo optional, + // 3515 - REFER method + ReferSub referSub optional, + // 4488 - REFER method + Replaces replaces optional, + // 3891 + ReplyTo replyTo optional, + // optional in responses and INVITE requests + Require require optional, + RetryAfter retryAfter optional, + // only in responses + Route route optional, + // only in requests + SecurityClient securityClient optional, + // 3329 + SecurityServer securityServer optional, + // 3329 + SecurityVerify securityVerify optional, + // 3329 + Server server optional, + // only in responses + ServiceRoute serviceRoute optional, + // 3608 + SessionExpires sessionExpires optional, + // 4028 + SessionId sessionId optional, + SIP_ETag sipETag optional, + SIP_If_Match sipIfMatch optional, + Subject subject optional, + // only in requests + SubscriptionState subscriptionState optional, + // 3265/7.2 + Supported supported optional, + Timestamp timestamp optional, + To toField, + Unsupported unsupported optional, + // only in responses + UserToUser userToUser optional, + UserAgent userAgent optional, + Via via, + Warning warning optional, + // only in responses + WwwAuthenticate wwwAuthenticate optional, + // only in responses + UndefinedHeader_List undefinedHeader_List optional + } + + + } // end group MessageHeaderTypes + + group StartLineTypes { + // Request-Line [7.1 ] + type record RequestLine { + Method method, + SipUrl requestUri, + charstring sipVersion + } + + // Status-Line [7.2 ] + type record StatusLine { + charstring sipVersion, + integer statusCode, + charstring reasonPhrase + } + + + } // end group StartLineTypes + + + group otherTypes { + + type record SipUserProfile { + /** + * @desc integer for the userprofile identifier + */ + integer id, + /** + * @desc integer for Port number to exchange SIP messages + */ + integer currPort, + /** + * @desc charstring for IP address to exchange SIP messages + */ + charstring currIpaddr, + /** + * @desc integer for Port number to exchange SIP messages + */ + integer contactPort, + /** + * @desc charstring for IP address to exchange SIP messages + */ + charstring contactIpaddr, + /** + * @desc charstring for IP address used by the TS to exchange media streams + */ + charstring bearerIpaddr, + /** + * @desc charstring for identity of the tester local domain + */ + charstring homeDomain, + /** + * @desc charstring for identity of the tester local user + */ + charstring publUsername, + /** + * @desc charstring for RFC 2617 3.2.1 qop options: Quoted string of one or more tokens indicating the "quality of protection" values supported by the server. The value "auth" indicates authentication; the value "auth-int" indicates authentication with integrity protection. + */ + charstring qop, + /** + * @desc charstring for RFC 2617 3.2.2 username for authentication The name of user in the specified realm + */ + charstring privUsername, + /** + * @desc charstring for RFC 2617 3.2.2.2 passwd: A known shared secret, the password of user of the specified username + */ + charstring passwd, + /** + * @desc charstring for registrar domain for authentication and request line + */ + charstring registrarDomain + } + + + + } // end group otherTypes + + + } // end group Subtypes + + + + group MSGtypes { + + group RequestTypes { + // [7.1 ] + /** + * @desc generic type of a SIP request message + * @member statusLine contains a method name, a Request-URI, and the protocol version + * @member msgHeader include all possible header fields that are allowed to be present according to RFCs and other standards + * @member messageBody depends on the request method, includes e.g. SDP message. + * @member payload contains the whole message as it has been received in its text format + */ + type record Request { + RequestLine requestLine, + MessageHeader msgHeader, + MessageBody messageBody optional, + Payload payload optional + } with { encode "SIPCodec"} + + // Note: the introduction of the following specific types is to enable better means for logging + // on the other side the generic type is useful for functions dealing with multiple SIP message types + type record REGISTER_Request { + RequestLine requestLine, + MessageHeader msgHeader, + MessageBody messageBody optional, + Payload payload optional + } with { encode "SIPCodec"} + + type record INVITE_Request { + RequestLine requestLine, + MessageHeader msgHeader, + MessageBody messageBody optional, + Payload payload optional + } with { encode "SIPCodec"} + + type record OPTIONS_Request { + RequestLine requestLine, + MessageHeader msgHeader, + MessageBody messageBody optional, + Payload payload optional + } with { encode "SIPCodec"} + + type record BYE_Request { + RequestLine requestLine, + MessageHeader msgHeader, + MessageBody messageBody optional, + Payload payload optional + } with { encode "SIPCodec"} + + type record CANCEL_Request { + RequestLine requestLine, + MessageHeader msgHeader, + MessageBody messageBody optional, + Payload payload optional + } with { encode "SIPCodec"} + + type record ACK_Request { + RequestLine requestLine, + MessageHeader msgHeader, + MessageBody messageBody optional, + Payload payload optional + } with { encode "SIPCodec"} + + // [3262/7.1 ] + type record PRACK_Request { + RequestLine requestLine, + MessageHeader msgHeader, + MessageBody messageBody optional, + Payload payload optional + } with { encode "SIPCodec"} + + // [3265/7.1 ] + type record NOTIFY_Request { + RequestLine requestLine, + MessageHeader msgHeader, + MessageBody messageBody optional, + Payload payload optional + } with { encode "SIPCodec"} + + // [3265/7.1 ] + type record SUBSCRIBE_Request { + RequestLine requestLine, + MessageHeader msgHeader, + MessageBody messageBody optional, + Payload payload optional + } with { encode "SIPCodec"} + + // [3903/11.1 ] + type record PUBLISH_Request { + RequestLine requestLine, + MessageHeader msgHeader, + MessageBody messageBody optional, + Payload payload optional + } with { encode "SIPCodec"} + + // [3311/7 ] + type record UPDATE_Request { + RequestLine requestLine, + MessageHeader msgHeader, + MessageBody messageBody optional, + Payload payload optional + } with { encode "SIPCodec"} + + type record REFER_Request { + RequestLine requestLine, + MessageHeader msgHeader, + MessageBody messageBody optional, + Payload payload optional + } with { encode "SIPCodec"} + + type record MESSAGE_Request { + RequestLine requestLine, + MessageHeader msgHeader, + MessageBody messageBody optional, + Payload payload optional + } with { encode "SIPCodec"} + + type record INFO_Request { + RequestLine requestLine, + MessageHeader msgHeader, + MessageBody messageBody optional, + Payload payload optional + } with { encode "SIPCodec"} + + type union RequestUnion { + REGISTER_Request Register, + INVITE_Request Invite, + OPTIONS_Request Options, + BYE_Request Bye, + CANCEL_Request Cancel, + ACK_Request Ack, + PRACK_Request Prack, + NOTIFY_Request Notify, + SUBSCRIBE_Request Subscribe, + PUBLISH_Request Publish, + UPDATE_Request Update, + REFER_Request Refer, + MESSAGE_Request Message, + INFO_Request Info// [2976 ] + } with { encode "SIPCodec"} + + } // end group RequestTypes + + group ResponseTypes { + // [7.2 ] + /** + * @desc generic type of a SIP response message + * @member statusLine consists of the protocol version followed by a numeric Status-Code and its associated textual phrase + * @member msgHeader include all possible header fields that are allowed to be present according to RFCs and other standards + * @member messageBody depends on the response method, includes e.g. SDP message. + * @member payload contains the whole message as it has been received in its text format + */ + type record Response { + StatusLine statusLine, + MessageHeader msgHeader, + MessageBody messageBody optional, + Payload payload optional + } with { encode "SIPCodec"} + + } // end group ResponseTypes + + // This MSG type is defined for sending synctactic variations, ans syntactically + // erroneous messages, and receving messages failed parsing. + group SyntacticTypes { + type charstring Raw; + + } // end group SyntacticTypes + + + // This type is defined for particular SIP message body types like SDP + } // end group MSGTypes + + } // end group Types +} +with { + encode "LibSip V3"; +} // end module LibSip_TypesAndValues diff --git a/IMS_PART4_IWD_15wk38/Common/IMS_LibSip/LibSip_SimpleMsgSummaryTypes.ttcn b/IMS_PART4_IWD_15wk38/Common/IMS_LibSip/LibSip_SimpleMsgSummaryTypes.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c0372461f0528d96d8a03846ffe06729d5a3bc07 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS_LibSip/LibSip_SimpleMsgSummaryTypes.ttcn @@ -0,0 +1,66 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +/******************************************************************************/ + +/** + * @author STF 406, 471 + * @version $Id: LibSip_SimpleMsgSummaryTypes.ttcn 488 2010-11-08 10:17:19Z pintar $ + * @desc This module provides the SMS type system for SIP tests. + * This module is part of LibSipV3. +*/ +module LibSip_SimpleMsgSummaryTypes { + // RFC 3842 + group SMSConstants { + + // IMS ETSI name MWI application + const charstring c_imsEtsiMwiApplication := "application/simple-message-summary"; + + // msg_status line := "Message-Waiting" + const charstring c_messageWaiting := "Message-Waiting"; + + // msg_status line := "Message-Account" + const charstring c_messageAccount := "Message-Account"; + + // msg_summary line := "Voice-Message" + const charstring c_voiceMessage := "Voice-Message"; + + } + + group SMSTypes { + type record SimpleMsgSummary { + // Simple_message_summary + Msg_status_line msg_status_line, + Msg_account msg_account optional, + Msg_summary_line_list msg_summary_line_list optional, + Opt_msg_headers opt_msg_headers optional + } + + type record Msg_status_line { + charstring msg_type, + charstring msg_status + } + + type record Msg_account { + charstring msg_type_account, + charstring account_URI + } + + type set of Msg_summary_line Msg_summary_line_list; + + type record Msg_summary_line { + charstring msg_context_class, + charstring msgs, + charstring urgent_msgs optional + } + + type set of charstring Opt_msg_headers; + + + // type integer msgcount length(1); //msgs and urgent_msgs can be dividet into subtypes + } +} diff --git a/IMS_PART4_IWD_15wk38/Common/IMS_XSD/AlternativeService.xsd b/IMS_PART4_IWD_15wk38/Common/IMS_XSD/AlternativeService.xsd new file mode 100644 index 0000000000000000000000000000000000000000..7082225cad26730a76fa3e3a091fe007a84efb84 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS_XSD/AlternativeService.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IMS_PART4_IWD_15wk38/Common/IMS_XSD/RFC3680_reginfo.xsd b/IMS_PART4_IWD_15wk38/Common/IMS_XSD/RFC3680_reginfo.xsd new file mode 100644 index 0000000000000000000000000000000000000000..9eef360f669e51165e033cbc2d85f168a38ec842 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS_XSD/RFC3680_reginfo.xsd @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IMS_PART4_IWD_15wk38/Common/IMS_XSD/RFC3863_pdif.xsd b/IMS_PART4_IWD_15wk38/Common/IMS_XSD/RFC3863_pdif.xsd new file mode 100644 index 0000000000000000000000000000000000000000..81bcc2b6f21e8186d582c9f05f5598975a0c717f --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS_XSD/RFC3863_pdif.xsd @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This attribute may be used on any element within an optional + PIDF extension to indicate that the corresponding element must + be understood by the PIDF processor if the enclosing optional + element is to be handled. + + + + \ No newline at end of file diff --git a/IMS_PART4_IWD_15wk38/Common/IMS_XSD/RFC4119_pdif_geopriv10.xsd b/IMS_PART4_IWD_15wk38/Common/IMS_XSD/RFC4119_pdif_geopriv10.xsd new file mode 100644 index 0000000000000000000000000000000000000000..416845e58e459013f1c5f2243d8bcac52bf2b56d --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS_XSD/RFC4119_pdif_geopriv10.xsd @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IMS_PART4_IWD_15wk38/Common/IMS_XSD/RFC4119_pdif_geopriv10_basicPolicy.xsd b/IMS_PART4_IWD_15wk38/Common/IMS_XSD/RFC4119_pdif_geopriv10_basicPolicy.xsd new file mode 100644 index 0000000000000000000000000000000000000000..bb9c622e3aa15a2a285404bee64c2e5b7994abe4 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS_XSD/RFC4119_pdif_geopriv10_basicPolicy.xsd @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IMS_PART4_IWD_15wk38/Common/IMS_XSD/RFC4575_conference_info.xsd b/IMS_PART4_IWD_15wk38/Common/IMS_XSD/RFC4575_conference_info.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c63a9e0b5e1806fccb6ec4ccb85e452e6efa3410 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS_XSD/RFC4575_conference_info.xsd @@ -0,0 +1,387 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IMS_PART4_IWD_15wk38/Common/IMS_XSD/RFC5628_gruuinfo.xsd b/IMS_PART4_IWD_15wk38/Common/IMS_XSD/RFC5628_gruuinfo.xsd new file mode 100644 index 0000000000000000000000000000000000000000..b57e0feb5fe0a6f161b9884e77ca735fa53923ec --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS_XSD/RFC5628_gruuinfo.xsd @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IMS_PART4_IWD_15wk38/Common/IMS_XSD/SRVCC.xsd b/IMS_PART4_IWD_15wk38/Common/IMS_XSD/SRVCC.xsd new file mode 100644 index 0000000000000000000000000000000000000000..e70917b29f967de2945eb645b7023653bbe68ff9 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS_XSD/SRVCC.xsd @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IMS_PART4_IWD_15wk38/Common/IMS_XSD/xml.xsd b/IMS_PART4_IWD_15wk38/Common/IMS_XSD/xml.xsd new file mode 100644 index 0000000000000000000000000000000000000000..5f9b4164c7f3d34e441643e001fb72c16f8f7561 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IMS_XSD/xml.xsd @@ -0,0 +1,117 @@ + + + + + + + See http://www.w3.org/XML/1998/namespace.html and + http://www.w3.org/TR/REC-xml for information about this namespace. + + This schema document describes the XML namespace, in a form + suitable for import by other schema documents. + + Note that local names in this namespace are intended to be defined + only by the World Wide Web Consortium or its subgroups. The + following names are currently defined in this namespace and should + not be used with conflicting semantics by any Working Group, + specification, or document instance: + + base (as an attribute name): denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification. + + lang (as an attribute name): denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification. + + space (as an attribute name): denotes an attribute whose + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification. + + Father (in any context at all): denotes Jon Bosak, the chair of + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: + + In appreciation for his vision, leadership and dedication + the W3C XML Plenary on this 10th day of February, 2000 + reserves for Jon Bosak in perpetuity the XML name + xml:Father + + + + + This schema defines attributes and an attribute group + suitable for use by + schemas wishing to allow xml:base, xml:lang or xml:space attributes + on elements they define. + + To enable this, such a schema must import this schema + for the XML namespace, e.g. as follows: + <schema . . .> + . . . + <import namespace="http://www.w3.org/XML/1998/namespace" + schemaLocation="http://www.w3.org/2001/03/xml.xsd"/> + + Subsequently, qualified reference to any of the attributes + or the group defined below will have the desired effect, e.g. + + <type . . .> + . . . + <attributeGroup ref="xml:specialAttrs"/> + + will define a type which will schema-validate an instance + element with any of those attributes + + + + In keeping with the XML Schema WG's standard versioning + policy, this schema document will persist at + http://www.w3.org/2001/03/xml.xsd. + At the date of issue it can also be found at + http://www.w3.org/2001/xml.xsd. + The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XML Schema + itself. In other words, if the XML Schema namespace changes, the version + of this document at + http://www.w3.org/2001/xml.xsd will change + accordingly; the version at + http://www.w3.org/2001/03/xml.xsd will not change. + + + + + + In due course, we should install the relevant ISO 2- and 3-letter + codes as the enumerated possible values . . . + + + + + + + + + + + + + + + See http://www.w3.org/TR/xmlbase/ for + information about this attribute. + + + + + + + + + + diff --git a/IMS_PART4_IWD_15wk38/Common/IP_PTC/HTTP_ASP_TypeDefs.ttcn b/IMS_PART4_IWD_15wk38/Common/IP_PTC/HTTP_ASP_TypeDefs.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c7a868de7b1c2ab7cde0f4299b84dd3e6f5b5f69 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IP_PTC/HTTP_ASP_TypeDefs.ttcn @@ -0,0 +1,122 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-06-04 19:23:42 +0200 (Thu, 04 Jun 2015) $ +// $Rev: 13657 $ +/******************************************************************************/ + +module HTTP_ASP_TypeDefs { + import from CommonDefs all; + import from IP_ASP_TypeDefs all; + import from LibSip_SIPTypesAndValues all; // NOTE: the same header definitions are used for HTTP as for SIP (Authorization, ContentType, WwwAuthenticate, AuthenticationInfo, Expires) + + group HTTP_ASP_Definitions { + + //---------------------------------------------------------------------------- + // HTTP Control + + type record HttpServerInfo_Type { + IP_AddrInfo_Type serverAddr, /* IP address of simulated server */ + PortNumber_Type serverPort, /* Port number of simulated server */ + IP_DrbInfo_Type drbInfo, /* DRB info as used by the IP PTC (LTE model, see TS 36.523-3 [30]) */ + TLSInfo_Type tlsInfo optional /* Description of the TLS connection to be used */ + }; + + type record length (1 .. infinity) of HttpServerInfo_Type HttpServerList_Type; + + type record HTTP_CTRL_REQ { /* ASP type to configure the http layer; + when any of the optional fields is omitted the previous configuration of this field is kept */ + HttpServerList_Type httpServerList optional /* IP address and port of simulated HTTP servers */ + }; + + type record HTTP_CTRL_CNF { /* ASP type to confirm HTTP_CTRL_REQ */ + charstring errorInfo optional /* string indicating a system error */ + }; + + //---------------------------------------------------------------------------- + // HTTP Data + + type record HTTP_DATA_IND { /* ASP type for sending a message from the http layer to TTCN; + it transports relevant information of a http Request from the UE to the Tester */ + IP_Connection_Type routingInfo, /* TCP connection from which the request has been received; + => response shall use the same */ + HttpRequest_Type httpRequest + }; + + type record HttpRequest_Type { + HttpRequestLine_Type requestLine, /* RFC 2616 clause 5.1 */ + UserAgent userAgent optional, /* User Agent according to RFC 2616 [27] clause 14.43 */ + Authorization authorization optional, /* Authorization in RFC 2616 [27] clause 14.8 (optional; NOTE: Same type definition as for SIP type definitions) */ + ContentType contentType optional, /* Content-Type in RFC 2616 [27] clause 14.17 (optional, NOTE: Same type definition as for SIP type definitions) */ + charstring x3GPPIntendedIdentity optional, /* 3GPP TS 24.109 [33] clause G.2 */ + charstring messageBody optional /* MTSI XCAP Message */ + }; + + type record HttpResponse_Type { + HttpStatusLine_Type statusLine, /* Status-Line in RFC 2616 [27] clause 6.1 */ + Date date optional, /* Date according to RFC 2616 [27] clause 14.18 */ + SIP_ETag eTag optional, /* ETag according to RFC 2616 [27] clause 14.19 */ + Server server optional, /* Server according to RFC 2616 [27] clause 14.38 */ + WwwAuthenticate wwwauthenticate optional, /* WWW-Authenticate in RFC 2616 [27] clause 14.47 (NOTE: Same type definition as for SIP type definitions) */ + AuthenticationInfo authenticationInfo optional, /* Authentication-Info in RFC 2617 [37] clause 3.2.3 (NOTE: Same type definition as for SIP type definitions) */ + ContentType contentType optional, /* Content-Type in RFC 2616 [27] clause 14.17 (NOTE: Same type definition as for SIP type definitions) */ + ContentLength contentLength optional, /* Content-Length in RFC 2616 [27] clause 14.13 (NOTE: Same type definition as for SIP type definitions) */ + Expires expires optional, /* Expires in RFC 2616 [27] clause 14.21 (NOTE: Same type definition as for SIP type definitions) */ + charstring messageBody optional /* MTSI XCAP Message (XML document or XML fragment) */ + }; + + type record HTTP_DATA_REQ { /* ASP type for sending messages from TTCN to the http layer; + it transports information needed by the http layer to generate a http Response to the UE */ + IP_Connection_Type routingInfo, /* TCP connection to be used in DL: shall be the same as for corresponding request */ + HttpResponse_Type httpResponse + }; + + type record HttpRequestLine_Type { /* request line according to RFC 2616 [27] clause 5.1 */ + charstring method, + charstring uri, /* XCAP selection expression, RFC 4825 [26] */ + charstring version + }; + + type record HttpStatusLine_Type { /* status line according to RFC 2616 [27] clause 5.1 */ + charstring version, + integer code, + charstring reasonPhrase + }; + + } with { encode "HttpCodec" } + + //============================================================================ + + group HTTP_Port_Definitions { + + type port HTTP_CTRL_PORT message + { + out HTTP_CTRL_REQ; + in HTTP_CTRL_CNF; + }; + + type port HTTP_DATA_PORT message + { + in HTTP_DATA_IND; + out HTTP_DATA_REQ; + }; + + type port IP_HTTP_CTRL_PORT message + { + in HTTP_CTRL_REQ; + out HTTP_CTRL_CNF; + }; + + type port IP_HTTP_DATA_PORT message + { + out HTTP_DATA_IND; + in HTTP_DATA_REQ; + }; + + } // group HTTP_Port_Definitions + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IP_PTC/IP_ASP_Common.ttcn b/IMS_PART4_IWD_15wk38/Common/IP_PTC/IP_ASP_Common.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..72aeda3dd9cdfce9b624c99ca562c5f2dad5139a --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IP_PTC/IP_ASP_Common.ttcn @@ -0,0 +1,55 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2013-08-25 20:30:56 +0200 (Sun, 25 Aug 2013) $ +// $Rev: 9371 $ +/******************************************************************************/ + +module IP_ASP_Common { + import from IP_ASP_TypeDefs all; + import from CommonIP all; + + //**************************************************************************** + // Auxiliary functions + //---------------------------------------------------------------------------- + + function f_IP_AddrInfo_AddrStr(IP_AddrInfo_Type p_AddrInfo) return charstring + { + var charstring v_AddrStr := ""; + if (ischosen(p_AddrInfo.V4)) { v_AddrStr := p_AddrInfo.V4.Addr; } + if (ischosen(p_AddrInfo.V6)) { v_AddrStr := p_AddrInfo.V6.Addr; } + return v_AddrStr; + } + + function f_IP_AddrInfo_TypeStr(IP_AddrInfo_Type p_AddrInfo) return charstring + { /* @sic R5s130333 change 29: IPv4 -> IP6, IPv6 -> IP4 sic@ */ + var charstring v_TypeStr := ""; + if (ischosen(p_AddrInfo.V4)) { v_TypeStr := "IP4"; } + if (ischosen(p_AddrInfo.V6)) { v_TypeStr := "IP6"; } + return v_TypeStr; + } + + /* + * @desc match IP address sent by the UE in IMS message against given address + * @param p_AddrInfo + * @param p_ReceivedAddrString + * @return boolean + * @status APPROVED (IMS, LTE, LTE_A, LTE_IRAT) + */ + function f_IMS_IpAddrMatch(IP_AddrInfo_Type p_AddrInfo, + charstring p_ReceivedAddrString) return boolean + { /* @sic R5w130106 - square brackets to be handled by codec sic@ */ + + if (ischosen(p_AddrInfo.V4)) { + return match(p_ReceivedAddrString, p_AddrInfo.V4.Addr); + } + if (ischosen(p_AddrInfo.V6)) { + return (f_Convert_IPv6Addr2OctString(p_ReceivedAddrString) == f_Convert_IPv6Addr2OctString(p_AddrInfo.V6.Addr)); + } + return false; + } +} diff --git a/IMS_PART4_IWD_15wk38/Common/IP_PTC/IP_ASP_TypeDefs.ttcn b/IMS_PART4_IWD_15wk38/Common/IP_PTC/IP_ASP_TypeDefs.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6b6140320bfe0d72e2faa4de70e0e9b9e0193ef1 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IP_PTC/IP_ASP_TypeDefs.ttcn @@ -0,0 +1,792 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-09 14:11:58 +0200 (Wed, 09 Sep 2015) $ +// $Rev: 14251 $ +/******************************************************************************/ + +module IP_ASP_TypeDefs { + /* General Notes: + * NOTE 1: + * In general the handling of IP data shall be independent from the RAT being used on lower layers. + * NOTE 2: + * It shall be possible for SS implementation to reuse existing IP stack implementations in the system adaptor; + * therefore the well-known concept of socket programming shall be supported + * (regardless of whether those are used in the system adaptor implementation or not) + * NOTE 3: + * Since in general at the network side there are several different IP addresses the SS needs to simulate more than one IP address; + * that can be based on a concept of multiple virtual network adaptors + * NOTE 4: + * There is no easy way to control the routing of IP data for an IP connection from above the IP stack + * i.e. there are no parameters at the socket interface to determine e.g. cell id and DRB id + * => another independent logical entity (DRB-MUX) is needed below the IP stack which is responsible to control the routing of IP packets from/to DRBs in different cells of different RATs + * + * Reference: + * An introduction to socket programming can be found in + * UNIX Network Programming Volume 1, Third Edition: The Sockets Networking API + * by W. Richard Stevens, Bill Fenner, Andrew M. Rudoff + */ + + import from CommonDefs all; + + //---------------------------------------------------------------------------- + + group IP_Common { + + type UInt16_Type PortNumber_Type; + + type record IPv4_AddrInfo_Type { /* IPv4 specific info of the socket addr (AF_INET) */ + charstring Addr /* IP Address as string (IP v4 dot notation) to be converted to 32-bit unsigned integer */ + }; + + type record IPv6_AddrInfo_Type { /* IPv6 specific info of the socket addr (AF_INET6); + * NOTE: sin6_flowinfo can be ignored and set to 0 */ + charstring Addr, /* to be converted to sin6_addr */ + UInt32_Type ScopeId optional /* sin6_scope_id + * in general an IPv6 address is like "fe80::1%eth0" with eth0 being the network adaptor mapped to a scope id (Unix) + * assumption: + * for UE conformance testing it is not necessary to distiguish different scopes and the scope id in general can be determined by the system adaptor => omit */ + }; + + type union IP_AddrInfo_Type { + IPv4_AddrInfo_Type V4, + IPv6_AddrInfo_Type V6 + }; + + type record IP_Socket_Type { /* Socket */ + IP_AddrInfo_Type IpAddr optional, /* IP address */ + PortNumber_Type Port optional /* port number */ + }; + + type record of IP_Socket_Type IP_SocketList_Type; + + type enumerated InternetProtocol_Type { + udp, + tcp, + icmp, + icmpv6 + }; + + type record IP_Connection_Type { + /* A connection between peer-to-peer entities is unambiguously defined by the protocol (udp/tcp/icmp/icmpv4), the local socket and the remote socket */ + InternetProtocol_Type Protocol, + IP_Socket_Type Local optional, + IP_Socket_Type Remote optional + }; + + } // End of group IP_Common + + //**************************************************************************** + // Configuration of the IP routing table (DRB-MUX) + //---------------------------------------------------------------------------- + + group IP_Config { + /* Configuration of the routing table managed be the system adaptor's DRB-MUX: + * foreach IP connection it is specified which + * - RAT + * - Cell + * - DRB + * to be used. + * The IP connection does not need to be fully specified depending on the role SS plays (e.g. in case of a server role the port number of the remote side is not known in advance). + * The configurations of DRBs within the same cell shall be mutual exclusive. + * + * With the configuration of the IP routing the DRB is configured either in IP or in raw mode: + * either there are entries for the DRB in the routing table (IP mode) or not (raw mode) + * => It is not necessary to reconfigure this for the respective RAT. + * + * Behaviour of the DRB-MUX in UL: + * - SS gets data packet from the lower layers (e.g. PDCP SDU) + * - SS checks whether there is any IP connection configured for this DRB (identified by {RAT, CellId, DrbId}) + * if YES => packet is routed to the IP stack (IP mode) + * if NO => packet is handed over to the DRB port (raw mode) + * NOTE 1: + * If there is any entry for a DRB in the routing table this DRB is considered as being in IP mode and all UL IP packets are sent to the IP stack regardless of whether their addresses match the DRB's routing entries or not (in general 'unknown' packets are discarded by the IP stack) + * => a DRB can be either in IP or in raw mode + * NOTE 2: + * => The SS does not need to evaluate any IP headers to decide whether data shall be routed to the DRB port or to the IP stack (i.e. there is no conflict with unstructured loopback data) + * + * Behaviour of the DRB-MUX in DL: + * - SS gets IP packets from the IP stack for an IP connection + * - SS compares the IP connection (protocol, local/remote IP Addr) against the IP routing table and + * checks whether the corresponding protocol stack is configured at the lower layers => + * 1. no match: + * no entry in the routing table fits to the address in the IP packet + * or the corresponding RB is not configured + * => SS shall raise an error (DRBMUX_COMMON_IND_CNF.Error) + * 2. one match: + * There is exactly one possibility to route the IP packet + * => SS shall send the packet to this RB + * 3. several matches: + * There are more than one DRBs, cells or RATs to which the packet may be routed + * => SS shall raise an error if there is more than one DRB in one cell matching; + * if the DRBs belong to different cells or RATS SS shall send the data to all of them + * (whether this may occur in test cases is FFS) + * + * General notes: + * NOTE 1: + * SS may use the information of the routing table to determine which network adaptors it needs to simulate (implementation dependent); + * in general there will be more than one IP address at the network side. + * NOTE 2: + * In general the routing table is a simplified DL TFT implementation + * NOTE 3: + * When the routing table is empty all DRBs are in raw mode; this shall be the initial condition at the DRB-MUX; + * => for L2 testing in general (and apart from the preamble) there is no need to use/configure the IP_PTC; the configuration of the RAT specific U-plane stacks is not affected + */ + + type enumerated IP_DataMode_Type { + discard, + loopbackRTP, + loopbackRTCP + }; + + type record IP_RoutingInfo_Type { + IP_Connection_Type IpInfo, /* IP connection tuple: protocol, local socket, remote socket + * depending on the role the SS plays the following information may be provided + * (informative; even less information can be sufficient): + * 1. TCP/UDP server + * - local IP addr -- provided + * - local port -- provided + * - remote IP addr -- omit + * - remote port -- omit + * 2. TCP/UDP client + * - local IP addr -- provided + * (to inform SS about the local IP addr for this service) + * - local port -- omit; + * for UDP a well-defined port may be defined + * (protocol dependent, e.g. DHCP) + * - remote IP addr -- provided + * - remote port -- provided + * 3. ICMP (in general ICMP may be mapped only to a single DRB) + * - local IP addr -- provided + * (to inform SS about the local IP addr for this service) + * - local port -- n/a (shall be set to omit) + * - remote IP addr -- omit + * - remote port -- n/a (shall be set to omit) + * + * NOTE: + * In case of broadcasts in UL the broadcast address shall match any local IP address; + * in DL for broadcast services typically no remote IP address is specified in the routing table + */ + IP_DrbInfo_Type DRB, + IP_DataMode_Type DataMode optional /* present when IP packets matching this entry shall be discarded or be looped back to the UE as defined for RTP or RTCP */ + }; + + type record of IP_RoutingInfo_Type IP_RoutingTable_Type; /* NOTE: configurations of DRBs within the same cell shall be mutual exclusive */ + + + } // End of group IP_Config + + + //**************************************************************************** + // Handling of IPsec + //---------------------------------------------------------------------------- + + group IPsec_Config { + const integer tsc_IPsec_SPI_Max := 4294967295; + type integer IPsec_SPI_Type (0..tsc_IPsec_SPI_Max); /* security parameter index for IPsec; + According to RFC 2406, SPI values from 0 to 255 are reserved */ + + type enumerated IPsec_IntegrityAlgorithm_Type { + hmac_md5_96, + hmac_sha_1_96 + }; + + type enumerated IPsec_CipheringAlgorithm_Type { + des_ede3_cbc, + aes_cbc, + nociph /* no ciphering */ + }; + + type record IPsec_SecurityKeys_Type { /* to install the security keys */ + bitstring MD5_96Key length (128), + bitstring SHA_1_96Key length (160), + bitstring DES_EDE3_CBCKey length (192), + bitstring AES_CBCKey length (128) + }; + + type record IPsec_SecurityAssociation_Type { /* single security association (SA); + for configuration of an SA at the SS all fields are mandatory; + to release an SA the optional information is omitted */ + IPsec_SPI_Type SPI, + charstring SrcAddress, + charstring DestAddress, + UInt16_Type SrcPort, + UInt16_Type DestPort, + IPsec_IntegrityAlgorithm_Type IntegrityAlgorithm optional, /* mandatory to set-up an SA */ + IPsec_CipheringAlgorithm_Type CipheringAlgorithm optional /* mandatory to set-up an SA */ + }; + + type record of IPsec_SecurityAssociation_Type IPsec_SecurityAssociationList_Type; + + type record IPsec_Configure_Type { /* add new security associations; existing SAs are not affected */ + IPsec_SecurityAssociationList_Type SA_List, + IPsec_SecurityKeys_Type SecurityKeys + }; + + type record IPsec_Release_Type { /* release security associations; + * NOTE: + * in context with multiple PDNs it cannot be ensured that all SPIs are unique; + * e.g. the UE may use the same SPI values in different PDNs in which case uniqueness cannot be achieved + * furthermore it depends on the system implementation how entries in the IPsec SAD and SPD are administrated + * => to release SAs the SS gets the same information as for configuration but without the security algorithms */ + IPsec_SecurityAssociationList_Type SA_List + }; + + } // end of group IPsec_Config + + //**************************************************************************** + // Handling of IP data and IP connections + //---------------------------------------------------------------------------- + + group IP_SocketHandling { + /* Handling of IP data and IP connections + * NOTE 1: + * In general IP connections are distuished by the tuple {protocol, local socket, remote socket}; + * this information is used at the interface between TTCN and the system adaptor. + * It is up the the system adaptor implementation to associate the IP connection with the internal socket (file descriptor; implementation dependent) + * NOTE 2: + * In general the association of the IP connections to (internal) sockets and the routing table for the DRB mpping (as configured with IP_RoutingTable_Type) are independent from each other */ + + group Socket_Common { + + type union IP_SockOpt_Type { /* socket options acc. to the setsockopt system call (i.e. for level=SOL_SOCKET in case of Berkeley socket API); + * NOTE: + * only options being relevant for a specific applications (upon a socket) are configured by TTCN + * other options (e.g. SO_REUSEADDR) are out of TTCN and therefore a matter of system adaptor implementation */ + boolean SO_BROADCAST, /* set to true when IP broadcast messages shall be allowed for a port; + * this is required e.g. in case of DHCP */ + integer IP_MTU_SIZE /* MTU size to be used for IP data; + * NOTEs: + * - Even though the MTU size is defined as socket option it shall be the same for all sockets of a given interface (i.e. at least within one PDN the MTU size shall be the same) + * - in general a PIXIT is used as constant value for all sockets */ + }; + + type record of IP_SockOpt_Type IP_SockOptList_Type; + + type union IP_SocketError_Type { /* used to indicate errors related to sockets; + * the IP_Connection shall contain as much address information as available at the system adaptor */ + Null_Type InvalidAddress, /* TTCN error: e.g. invalid or incomplete address information */ + integer System /* system error caused by system call; + * the integer value may be used for validation but shall not be evaluated by TTCN */ + }; + + } // end of sub-group Socket_Common + + group Socket_Datagram { + + type octetstring Datagram_Content_Type; /* data as sent/received with sendto()/recvfrom() on UDP or ICMP socket; + * NOTE: + * For ICMP the data may depend on the socket options (FFS); + * in general it does not include the IP header and + * the checksum of the ICMP packet needs to be calculated/checked in TTCN */ + + type record Datagram_DL_Type { /* datagram to be sent at a UDP or ICMP socket */ + Datagram_Content_Type Buffer /* content of the IP packet */ + }; + + type record Datagram_UL_Type { /* datagram as received on a UDP or ICMP socket */ + Datagram_Content_Type Buffer, /* content of the IP packet */ + IP_DrbInfo_Type DrbInfo optional /* "interface id" where the data comes from in case of broadcast or multicast packets: + * for the LTE test model this is the DRB on which the IP packet has been received; + * the information is necessary when the SS cannot resolve an IP address being assigned to that DRB. + * => when the SS provides a brodacst or multicast address as local address in the ConnectionId of the ASP, the SS shall provide the DRB information in this field + * When the ConnectionId of the ASP is fully specified and unique (unicast address at least for local address) the DrbId is ignored by TTCN */ + }; + + } // end of sub-group Socket_Datagram + + //============================================================================ + + group TCP_Socket { /* TCP primitives used on the IP port */ + + type enumerated InternetApplication_Type { ims, http }; /* as TCP is stream oriented SS may need information about which criteria to be applied to get start/end of an application message */ + + type enumerated TLS_Type { /* Type of TLS connection to be used (if any) */ + noTLS, + pskTLS, + certTLS + }; + + type enumerated TLS_CIPHER_Type { /* Cipher suite to be used */ + noCipher, + psk_3DES_EDE_CBC_SHA, + psk_AES_128_CBC_SHA + }; + + type record TLSInfo_Type { + TLS_Type tlsType, /* Type of TLS connection to be used (if any) */ + octetstring psk optional, /* Pre shared key for TLS ciphering */ + TLS_CIPHER_Type cipherSuite /* Cipher suite to be used */ + }; + + type record TCP_ConnectRequest_Type { /* TCP client: -> 'connect' system call */ + IP_SockOptList_Type SockOptList, /* when there are no options to configure the list is empty */ + InternetApplication_Type Application /* to specify start/end criteria for application messages */ + }; + + type record TCP_Listen_Type { /* TCP server: -> 'listen' system call */ + IP_SockOptList_Type SockOptList, /* when there are no options to configure the list is empty */ + InternetApplication_Type Application, /* to specify start/end criteria for application messages */ + TLSInfo_Type TLSInfo optional /* to support TLS for HTTP server implementation */ + }; + + type octetstring TCP_Data_Type; /* data as sent/received with send()/recv() on a TCP socket */ + + type union TCP_CtrlRequest_Type { + TCP_ConnectRequest_Type ConnectReq, /* request a 'connect' to a remote server + * + * system calls (informative) + * socket -- get file descriptor + * (setsockopt) -- normally not needed + * bind -- assign local IP addr (to cope with multiple IP addresses) and dedicated port number (if local port is given) + * connect -- connect to the client + * + * IP_Connection: + * protocol -- tcp + * local IP addr -- mandatory to distinguish different network adaptors + * local port -- omit (ephemeral port will be assigned by the system) or specific port to be used for this connection (e.g. to bind a given port number to the IMS client) + * remote IP addr -- mandatory + * remote port -- mandatory + */ + TCP_Listen_Type Listen, /* establish a server at the local (SS) side + * + * system calls (informative) + * socket -- get file descriptor + * (setsockopt) -- if needed + * bind -- assign local IP addr and port + * listen -- await incoming connection + * + * IP_Connection: + * protocol -- tcp + * local IP addr -- mandatory to distinguish different network adaptors + * local port -- mandatory + * remote IP add -- omit + * remote port -- omit + */ + Null_Type Close /* close a connection + * + * system calls (informative): + * close + * + * IP_Connection: + * protocol -- tcp + * local IP addr -- mandatory + * local port -- mandatory + * remote IP addr -- mandatory for TCP connections, omit for TCP server + * remote port -- mandatory for TCP connections, omit for TCP server + */ + }; + + type union TCP_DataRequest_Type { + TCP_Data_Type Send /* send data + * + * system calls (informative): + * send or write + * + * IP_Connection: + * protocol -- tcp + * local IP addr -- mandatory + * local port -- mandatory + * remote IP addr -- mandatory + * remote port -- mandatory + */ + }; + + type union TCP_CtrlIndication_Type { + Null_Type ConnectCnf, /* confirm a 'connect' to a remote server + * + * system calls (informative): + * getsockname -- get local port (ephemeral port assiged by the system) + * + * IP_Connection: + * protocol -- tcp + * local IP addr -- mandatory (as in corresponding TCP_ConnectRequest) + * local port -- mandatory (if there is more than one connection to the same server the local port is necessary to distinguish the connections) + * remote IP addr -- mandatory (as in corresponding TCP_ConnectRequest) + * remote port -- mandatory (as in corresponding TCP_ConnectRequest) + */ + Null_Type Accept, /* sent by the SS when it 'accepts' an incoming connection + * + * system calls (informative): + * accept + * + * IP_Connection: + * protocol -- tcp + * local IP addr -- mandatory (as in corresponding TCP_ListenRequest) + * local port -- mandatory (as in corresponding TCP_ListenRequest) + * remote IP addr -- mandatory (as gotten from 'accept') + * remote port -- mandatory (as gotten from 'accept') + */ + Null_Type Close, /* indicate 'close' by the remote side + * + * system calls (informative): + * indicated by recv or read + * + * IP_Connection: + * protocol -- tcp + * local IP addr -- mandatory + * local port -- mandatory + * remote IP addr -- mandatory + * remote port -- mandatory + */ + Null_Type CloseCnf /* Confirmation for 'close' request; necessary since for TCP there are IP packets to release the connection + * + * system calls (informative): + * close + * + * IP_Connection: + * protocol -- tcp + * local IP addr -- mandatory + * local port -- mandatory + * remote IP addr -- mandatory for TCP connections, omit for TCP server + * remote port -- mandatory for TCP connections, omit for TCP server + */ + }; + + type union TCP_DataIndication_Type { + TCP_Data_Type Recv /* receive data + * + * system calls (informative): + * recv or read + * + * IP_Connection: + * protocol -- tcp + * local IP addr -- mandatory + * local port -- mandatory + * remote IP addr -- mandatory + * remote port -- mandatory + */ + }; + + } // end of sub-group TCP_Socket + + //============================================================================ + + group UDP_Socket { /* UDP primitives used on the IP port + * NOTE: + * In principle a UDP socket may communicate with different remote entities; + * therefore the system adaptor may associate the socket handle with the local socket only + * (local IP address and local port) + */ + + type record UDP_SocketReq_Type { /* to establish a UDP server or to bind local port number */ + IP_SockOptList_Type SockOptList /* e.g. to allow broadcast messages; + * when there are no options to configure the list is empty */ + }; + + type union UDP_CtrlRequest_Type { + UDP_SocketReq_Type SocketReq, /* request the system adaptor to bind a socket to a local address; + * this is needed in general when the system adaptor acts as + * 1. UDP server + * 2. UDP client when it uses a well-known port rather than an ephemeral port (this is e.g. for DHCP) + * 3. UDP client when a local address needs to be bond (e.g. when there are several local addresses) + * + * system calls (informative): + * socket -- get file descriptor + * (setsockopt) -- needed e.g. to allow broad cast message + * bind -- assign local IP address (to cope with multiple IP addresses) and local port (in case of well-known local port) + * + * IP_Connection: + * protocol -- udp + * local IP addr -- mandatory (to distiguish multiple IP addresses) + * local port -- optional (mandatory in case of a UDP server) + * remote IP addr -- omit + * remote port -- omit + */ + Null_Type Close /* release local socket + * + * system calls (informative): + * close + * + * IP_Connection: + * protocol -- udp + * local IP addr -- mandatory (to identify local socket) + * local port -- mandatory (to identify local socket) + * remote IP addr -- omit + * remote port -- omit + */ + }; + + type union UDP_DataRequest_Type { + Datagram_DL_Type SendTo /* send data to (any) remote socket; + * NOTE: + * To simplify implementation of the system adaptor the local socket shall be bond in any case (using 'SocketReq') to specify the local IP address before sending data; + * (in general the sendto system call can be used without explicitly binding the socket before; + * in this case the port gets implicitly bond to an ephemeral port and the default IP address is used) + * + * system calls (informative): + * sendto + * + * IP_Connection: + * protocol -- udp + * local IP addr -- mandatory (to identify local socket) + * local port -- mandatory (to identify local socket) + * remote IP addr -- mandatory (to address remote socket) + * remote port -- mandatory (to address remote socket) + */ + }; + + type union UDP_CtrlIndication_Type { + Null_Type SocketCnf /* confirm 'SocketReq' and tell TTCN about assignment of ephemeral port; + * + * system calls (informative): + * getsockname -- get local port (ephemeral port assigned by the system; not needed if local port is well-known) + * + * IP_Connection: + * protocol -- udp + * local IP addr -- mandatory + * local port -- mandatory (well-known or ephemeral port asssigned by the system) + * remote IP addr -- omit + * remote port -- omit + */ + }; + + type union UDP_DataIndication_Type { + Datagram_UL_Type RecvFrom /* receive data; + * + * system calls (informative): + * recvfrom -- get data and src addr + * + * IP_Connection: + * protocol -- udp + * local IP addr -- mandatory (see note) + * local port -- mandatory + * remote IP addr -- mandatory (as gotten from recvfrom) + * remote port -- mandatory (as gotten from recvfrom) + * + * NOTE: + * The UE may send a UDP packet as broadcast (IP Addr 255.255.255.255 - e.g. in case of DHCP) or multicast (e.g. ICMPv6) + * SS shall consider a broadcast address as matching every IP for UL and DL; + * the SS shall not replace the broadcast/multicast address by the local unicast address, but shall provide DRB information in RecvFrom; + * example: + * - SS gets DHCPDISCOVER with DEST_Addr=255.255.255.255 DEST_Port=67, SRC_Addr=0.0.0.0 SRC_Port=68 + * - TTCN gets DHCPDISCOVER with local Addr=(255.255.255.255 Port=67), remote Addr=(0.0.0.0 Port=68), DrbId=(LTE, cell1, DRB1) + * - TTCN sends DHCPOFFER with local Addr=(local IP Addr Port=67), remote Addr=(255.255.255.255 Port=68) + */ + }; + + } // end of sub-group UDP_Socket + + //============================================================================ + + group ICMP_Socket { /* ICMP primitives used on the IP port + * NOTE: + * the local side is identified by the protocol and in general by the local IP address + */ + + type record ICMP_SocketReq_Type { /* to establish a raw socket to send/receive ICMP packets */ + IP_SockOptList_Type SockOptList /* e.g. to set the IP_HDRINCL socket option (to include the IP header in the data buffer) -> FFS + * when there are no options to configure the list is empty */ + }; + + type union ICMP_CtrlRequest_Type { + ICMP_SocketReq_Type SocketReq, /* request the system adaptor to open a raw socket (IPv4 or IPv6) + * + * system calls (informative): + * socket -- get file descriptor (IPPROTO_ICMP or IPPROTO_IPV6); + * (setsockopt) -- optional; to set socket options + * bind -- assign local IP address (to cope with multiple IP addresses) + * + * IP_Connection: + * protocol -- icmp or icmpv6 + * local IP addr -- mandatory (to distiguish multiple IP addresses) + * local port -- omit (not applicable for ICMP) + * remote IP addr -- omit + * remote port -- omit (not applicable for ICMP) + */ + Null_Type Close /* release local socket + * + * system calls (informative): + * close + * + * IP_Connection: + * protocol -- icmp or icmpv6 + * local IP addr -- mandatory (to identify local socket) + * local port -- omit + * remote IP addr -- omit + * remote port -- omit + */ + }; + + type union ICMP_DataRequest_Type { + Datagram_DL_Type SendTo /* send datagram + * + * system calls (informative): + * sendto + * + * IP_Connection: + * protocol -- icmp or icmpv6 + * local IP addr -- mandatory (to identify local socket) + * local port -- omit + * remote IP addr -- mandatory + * remote port -- omit + */ + }; + + type union ICMP_CtrlIndication_Type { + Null_Type SocketCnf /* confirm 'SocketReq' + * + * system calls (informative): + * (SocketCnf is sent when all system calls for SocketReq have been successful) + * + * IP_Connection: + * protocol -- icmp or icmpv6 + * local IP addr -- mandatory + * local port -- omit + * remote IP addr -- omit + * remote port -- omit + */ + }; + + type union ICMP_DataIndication_Type { + Datagram_UL_Type RecvFrom /* receive datagram + * + * system calls (informative): + * recvfrom -- get data and src addr + * + * IP_Connection: + * protocol -- icmp or icmpv6 + * local IP addr -- mandatory (see note) + * local port -- omit + * remote IP addr -- mandatory (as gotten from recvfrom) + * remote port -- omit + * + * NOTE: + * As for UDP there may be multicast/broadcast packets. + * In this case - as for UDP - the SS shall provide the DRB information in RecvFrom. + */ + }; + + } // end of sub-group ICMP_Socket + + //---------------------------------------------------------------------------- + + group Socket_Primitives { + + type union IP_CtrlRequest_Type { + TCP_CtrlRequest_Type TCP, + UDP_CtrlRequest_Type UDP, + ICMP_CtrlRequest_Type ICMP + }; + + type union IP_DataRequest_Type { + TCP_DataRequest_Type TCP, + UDP_DataRequest_Type UDP, + ICMP_DataRequest_Type ICMP + }; + + type union IP_CtrlIndication_Type { + TCP_CtrlIndication_Type TCP, + UDP_CtrlIndication_Type UDP, + ICMP_CtrlIndication_Type ICMP, + IP_SocketError_Type Error + }; + + type union IP_DataIndication_Type { + TCP_DataIndication_Type TCP, + UDP_DataIndication_Type UDP, + ICMP_DataIndication_Type ICMP + }; + + } // end of sub-group Socket_Primitives + + } // end of group IP_SocketHandling + + //---------------------------------------------------------------------------- + + + group System_Interface { + + //**************************************************************************** + // ASP definitions + //**************************************************************************** + + type union DRBMUX_CONFIG_REQ { + /* NOTE 1: + * There is just one primitive to configure the whole routing table. + * It is not foreseen to add, remove or manipulate single entries but the table is managed in TTCN and completely configured on any change; (otherwise it might get complicated to identify single entries) + * NOTE 2: + * the SS's routing table shall be empty at the beginning and can be cleared by an empty record (DRBMUX_CONFIG_REQ.RoutingInfo = {}) + * NOTE 3: + * In general a reconfiguration of the routing table during a test case would be necessary only if an ephemeral port is needed to distinguish different routing + * (e.g. when there are several TCP connections of the same service routed to different DRBs) */ + IP_RoutingTable_Type RoutingInfo + }; + + + type union DRBMUX_COMMON_IND_CNF { + Null_Type Confirm, /* confirm DRBMUX_CONFIG_REQ */ + Null_Type Error /* indication of errors at the DRB-MUX: + * An Error shall be raised by the DRB-MUX e.g. in the following cases: + * - in DL when there are IP packets which cannot be routed to any DRB + * i.e. the IP packet does not match to any entry in the routing table or the corresponding RB is not configured + * - in DL when there are several DRBs possible for routing in the same cell + */ + }; + + type union IPSEC_CONFIG_REQ { + IPsec_Configure_Type Configure, + IPsec_Release_Type Release + }; + + type union IPSEC_CONFIG_CNF { + Null_Type Confirm, /* confirm IPSEC_CONFIG_REQ */ + Null_Type Error /* to indicate invalid configuration of IPsec */ + }; + + type record IP_SOCKET_CTRL_REQ { + IP_Connection_Type ConnectionId, + IP_CtrlRequest_Type Req + }; + + type record IP_SOCKET_DATA_REQ { + IP_Connection_Type ConnectionId, + IP_DataRequest_Type Req + }; + + type record IP_SOCKET_CTRL_IND { + IP_Connection_Type ConnectionId, + IP_CtrlIndication_Type Ind + }; + + type record IP_SOCKET_DATA_IND { + IP_Connection_Type ConnectionId, + IP_DataIndication_Type Ind + }; + + type union IP_SOCKET_REQ { + IP_SOCKET_CTRL_REQ CTRL, + IP_SOCKET_DATA_REQ DATA + }; + + type union IP_SOCKET_IND { + IP_SOCKET_CTRL_IND CTRL, + IP_SOCKET_DATA_IND DATA + }; + + //**************************************************************************** + // Port definitions + //**************************************************************************** + + type port IP_CONTROL_PORT message { + out DRBMUX_CONFIG_REQ; + in DRBMUX_COMMON_IND_CNF; + }; + + type port IPSEC_CONTROL_PORT message { + out IPSEC_CONFIG_REQ; + in IPSEC_CONFIG_CNF; + }; + + type port IP_SOCKET_PORT message { + out IP_SOCKET_REQ; + in IP_SOCKET_IND; + }; + + } // End group System_Interface + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IP_PTC/IP_PTC_CtrlMsgs.ttcn b/IMS_PART4_IWD_15wk38/Common/IP_PTC/IP_PTC_CtrlMsgs.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..74a8357035148ea42532120916f22248d6db9fe2 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IP_PTC/IP_PTC_CtrlMsgs.ttcn @@ -0,0 +1,349 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-15 21:39:48 +0200 (Tue, 15 Sep 2015) $ +// $Rev: 14432 $ +/******************************************************************************/ + + +module IP_PTC_CtrlMsgs { + /* definition of coordination messages to be used by EUTRA_PTC/UTRAN_PTC/GERAN_PTC do configure + routing table for the IP data */ + + import from CommonDefs all; + import from IP_ASP_TypeDefs all; + import from IP_PTC_Templates all; + + //============================================================================ + + type record IP_Start_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + PDN_Index_Type PdnId, + IP_DrbInfo_Type DrbInfo + }; + + type union IP_Stop_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + Null_Type All, + PDN_Index_Type PdnId + }; + + type record IP_ChangeDrbInfo_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + PDN_Index_Type PdnId, + IP_DrbInfo_Type DrbInfo + }; + + type record IP_SendRouterAdvertisement_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + PDN_Index_Type PdnId + }; + + //============================================================================ + + type union IP_ConfigReq_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + IP_Start_Type StartIP, + IP_Stop_Type StopIP, /* @sic R5s131000: Null_Type replaced by IP_Stop_Type sic@ */ + Null_Type GeranCnf, /* e.g. to confirm GeranTrigger */ + IP_ChangeDrbInfo_Type ChangeDrbInfo, /* @sic R5s150648 Change 5.1 sic@ */ + EUTRA_CellId_Type ChangeEutraCell, /* @sic R5s150648 Change 5.1 sic@ */ + IP_SendRouterAdvertisement_Type SendRouterAdvertisement, + IP_RoutingInfo_Type ExplicitRouting, /* @sic R5s130681 change 3: handling of RTP data sic@ */ + Null_Type ChangeToRawmode /* @sic R5s150074 - Additional change sic@ */ + }; + + type record IP_GeranTrigger_Type { + integer CellId + }; + + type union IP_Indication_Type { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) + @sic R5-133612: trigger to GERAN sic@ */ + Null_Type Cnf, + IP_DrbInfo_Type GeranTrigger + }; + + + //============================================================================ + + type port IP_RAT_CTRL_PORT message { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + out IP_ConfigReq_Type; + in IP_Indication_Type; + }; + + type port IP_PTC_CTRL_PORT message { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + in IP_ConfigReq_Type; + out IP_Indication_Type; + }; + + //**************************************************************************** + // EUTRA/UTRAN/GERAN side + //---------------------------------------------------------------------------- + // Commands: + + template (value) IP_ConfigReq_Type cs_IP_StartReq(PDN_Index_Type p_PdnId, + template (value) IP_DrbInfo_Type p_DrbInfo) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + StartIP := { + PdnId := p_PdnId, + DrbInfo := p_DrbInfo + } + }; + + template (value) IP_ConfigReq_Type cs_IP_ChangeToRawmode := {ChangeToRawmode := true}; /* @status APPROVED (LTE, LTE_A, LTE_IRAT) */ + + template (value) IP_Stop_Type cs_IP_StopAll := {All := true}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + template (value) IP_Stop_Type cs_IP_StopPDN(PDN_Index_Type p_PdnId) := {PdnId := p_PdnId}; /* @status APPROVED (IMS, LTE_A, IMS_IRAT, LTE, LTE_IRAT, POS) */ + + template (value) IP_ConfigReq_Type cs_IP_StopReq(template (value) IP_Stop_Type p_IP_Stop) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + /* @sic R5s131000: new parameter p_IP_Stop sic@ */ + StopIP := p_IP_Stop + }; + + template (value) IP_ConfigReq_Type cs_IP_GeranCnf := + { /* @status APPROVED (IMS_IRAT, LTE_A, LTE_IRAT) */ + GeranCnf := true + }; + + template (value) IP_ConfigReq_Type cs_IP_ChangeEutraCellReq(EUTRA_CellId_Type p_EutraCellId) := + { /* @sic R5-125676: new parameter p_DrbId sic@ */ + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + ChangeEutraCell := p_EutraCellId /* @sic R5s150648 Change 5.2 sic@ */ + }; + + template (value) IP_ConfigReq_Type cs_IP_ChangeDrbInfoReq(PDN_Index_Type p_PdnId, + template (value) IP_DrbInfo_Type p_DrbInfo) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + ChangeDrbInfo := { + PdnId := p_PdnId, + DrbInfo := p_DrbInfo + } + }; + + template (value) IP_ConfigReq_Type cs_IP_SendRouterAdvertisementReq(PDN_Index_Type p_PdnId) := + { + SendRouterAdvertisement := { + PdnId := p_PdnId + } + }; + + template (value) IP_ConfigReq_Type cs_IP_ConfigureDiscardDataLoopbackDataReq(InternetProtocol_Type p_Protocol, + PortNumber_Type p_MediaPort, + template (omit) IP_AddrInfo_Type p_IpAddrRemoteUE, + template (value) IP_DrbInfo_Type p_DrbInfo, + IP_DataMode_Type p_DataMode) := + { /* NOTE: p_IpAddrRemoteUE the IP address of the simulated remote UE (i.e. a 'local' (SS) address in terms of the routing table) */ + /* @sic R5-153746: p_DataMode (discard, loopbackRTP, loopbackRTCP) sic@ */ + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) */ + ExplicitRouting := { + IpInfo := cs_IP_ConnectionId(p_Protocol, cs_IP_Socket(p_IpAddrRemoteUE, p_MediaPort)), + DRB := p_DrbInfo, + DataMode := p_DataMode // @sic R5-150356, R5w150008; R5-153746 sic@ + } + }; + + + template (present) IP_Indication_Type cr_IP_CommonCnf := {Cnf := true}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + template (present) IP_Indication_Type cr_IP_GeranTrigger := + { /* @status APPROVED (IMS_IRAT, LTE_A, LTE_IRAT) */ + GeranTrigger := { + Geran := ? + } + }; + + //**************************************************************************** + // IP PTC side + //---------------------------------------------------------------------------- + + template (present) IP_ConfigReq_Type cr_IP_CtrlAnyReq := ?; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + template (value) IP_Indication_Type cs_IP_CommonCnf := {Cnf := true}; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + + template (value) IP_Indication_Type cs_IP_GeranTrigger(template (value) IP_DrbInfo_Type p_DrbInfo) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + GeranTrigger := p_DrbInfo + }; + + //**************************************************************************** + // templates for DRB info + //---------------------------------------------------------------------------- + + template (value) IP_DrbInfo_Type cs_DrbInfo_EUTRA(EUTRA_CellId_Type p_CellId, + IP_DrbId_Type p_DrbId) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + /* @sic R5w110204: change of IP_EUTRA_DrbInfo_Type sic@ */ + Eutra := { + CellId := p_CellId, + DrbId := p_DrbId + } + }; + + template (value) IP_DrbInfo_Type cs_DrbInfo_UTRAN(UTRAN_CellId_Type p_CellId, + IP_DrbId_Type p_DrbId) := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT, UTRAN) */ + Utran := { + CellId := f_UtranCellId2Int(p_CellId), + DrbId := p_DrbId + } + }; + + template (value) IP_DrbInfo_Type cs_DrbInfo_GERAN(integer p_CellId, + IP_DrbId_Type p_DrbId) := + { /* @status APPROVED (IMS_IRAT, LTE_A, LTE_IRAT) */ + Geran := { + CellId := p_CellId, + DrbId := p_DrbId + } + }; + + //**************************************************************************** + // Functions to be called from the test cases + //---------------------------------------------------------------------------- + + /* + * @desc RAT independent function to start DHCP and ICMPv6 server for given PDN + * @param p_Port + * @param p_PdnIndex .. index of the PDN + * @param p_DrbInfo .. DRB on which user plane signalling happens for this PDN + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) + */ + function f_IP_Handling_Start(IP_RAT_CTRL_PORT p_Port, + PDN_Index_Type p_PdnIndex, + template (value) IP_DrbInfo_Type p_DrbInfo) + { /* @sic R5-113734 change 8: replacing former f_DHCPv4_Start, f_ICMPv6_Start sic@ */ + p_Port.send(cs_IP_StartReq(p_PdnIndex, p_DrbInfo)); + p_Port.receive(cr_IP_CommonCnf); + } + + /* + * @desc RAT independent function to stop all DHCP and ICMPv6 servers + * @param p_Port + * @param p_IP_Stop (default value: cs_IP_StopAll) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) + */ + function f_IP_Handling_Stop(IP_RAT_CTRL_PORT p_Port, + template (value) IP_Stop_Type p_IP_Stop := cs_IP_StopAll) + { /* @sic R5-113734 change 8: replacing former f_DHCPv4_Stop, f_ICMPv6_Stop sic@ */ + /* @sic R5s131000: new parameter p_IP_Stop sic@ */ + p_Port.send(cs_IP_StopReq(p_IP_Stop)); + p_Port.receive(cr_IP_CommonCnf); + } + + /* + * @desc to remove all entries in the routing table + * NOTE: this has no impact on any existing sockets + * @param p_Port + * @status APPROVED (LTE, LTE_A, LTE_IRAT) + */ + function f_IP_Routing_ChangeToRawmode(IP_RAT_CTRL_PORT p_Port) + { + p_Port.send(cs_IP_ChangeToRawmode); + p_Port.receive(cr_IP_CommonCnf); + } + + /* + * @desc Function to change the EUTRA cell for all entries of the routing table + * @param p_Port + * @param p_EutraCellId .. new cell + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IP_ChangeEutraCell(IP_RAT_CTRL_PORT p_Port, + EUTRA_CellId_Type p_EutraCellId) + { /* @sic R5-125676: new parameter p_DrbId sic@ */ + /* @sic R5s150648 Change 5.3: p_DrbId removed sic@ */ + p_Port.send(cs_IP_ChangeEutraCellReq(p_EutraCellId)); + p_Port.receive(cr_IP_CommonCnf); + } + + /* + * @desc change DRB mapping for given PDN + * @param p_Port + * @param p_DrbInfo + * @param p_PdnIndex (default value: PDN_1) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IP_ChangeDrbMapping(IP_RAT_CTRL_PORT p_Port, + template (value) IP_DrbInfo_Type p_DrbInfo, + PDN_Index_Type p_PdnIndex := PDN_1) + { + p_Port.send(cs_IP_ChangeDrbInfoReq(p_PdnIndex, p_DrbInfo)); + p_Port.receive(cr_IP_CommonCnf); + } + + /* + * @desc EUTRA: change DRB mapping for given PDN + * @param p_Port + * @param p_EutraCellId + * @param p_DrbId + * @param p_PdnIndex (default value: PDN_1) + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_IP_ChangeDrbMappingEUTRA(IP_RAT_CTRL_PORT p_Port, + EUTRA_CellId_Type p_EutraCellId, + IP_DrbId_Type p_DrbId, + PDN_Index_Type p_PdnIndex := PDN_1) + { /* @sic R5s150648 Change 5.3 sic@ */ + f_IP_ChangeDrbMapping(p_Port, cs_DrbInfo_EUTRA(p_EutraCellId, p_DrbId), p_PdnIndex); + } + + /* + * @desc Function to change the UTRAN cell for all entries of the routing table + * @param p_Port + * @param p_UtranCellId + * @param p_DrbId + * @status APPROVED (LTE_A, LTE_IRAT) + */ + function f_IP_ChangeDrbMappingUTRAN(IP_RAT_CTRL_PORT p_Port, + UTRAN_CellId_Type p_UtranCellId, + IP_DrbId_Type p_DrbId) + { /* @sic R5s150648 Change 5.3 sic@ */ + f_IP_ChangeDrbMapping(p_Port, cs_DrbInfo_UTRAN(p_UtranCellId, p_DrbId)); + } + + /* + * @desc Function to change the GERAN cell for all entries of the routing table + * @param p_Port + * @param p_GeranCellId + * @param p_DrbId + */ + function f_IP_ChangeDrbMappingGERAN(IP_RAT_CTRL_PORT p_Port, + integer p_GeranCellId, + IP_DrbId_Type p_DrbId) + { + f_IP_ChangeDrbMapping(p_Port, cs_DrbInfo_GERAN(p_GeranCellId, p_DrbId)); + } + + /* + * @desc Function to trigger the IP PTC to sent out an (unsolicited) router advertisement + * @param p_Port + * @param PDN_Index_Type .. index of the PDN + * @status + */ + function f_IP_RouterAdvertisement(IP_RAT_CTRL_PORT p_Port, + PDN_Index_Type p_PdnIndex) + { + p_Port.send(cs_IP_SendRouterAdvertisementReq(p_PdnIndex)); + p_Port.receive(cr_IP_CommonCnf); + } + + /* + * @desc configure routing of e.g. RTP data on media port + * @param p_Port + * @param p_MediaPort + * @param p_IpAddrRemoteUE + * @param p_EutraCellId + * @param p_DrbId + * @param p_DataMode + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT) + */ + function f_IP_ConfigureDiscardDataLoopbackData_EUTRA(IP_RAT_CTRL_PORT p_Port, + PortNumber_Type p_MediaPort, + template (omit) IP_AddrInfo_Type p_IpAddrRemoteUE, + EUTRA_CellId_Type p_EutraCellId, + IP_DrbId_Type p_DrbId, + IP_DataMode_Type p_DataMode) + { /* @sic R5-153746: p_DataMode (discard, loopbackRTP, loopbackRTCP) sic@ */ + p_Port.send(cs_IP_ConfigureDiscardDataLoopbackDataReq(udp, p_MediaPort, p_IpAddrRemoteUE, cs_DrbInfo_EUTRA(p_EutraCellId, p_DrbId), p_DataMode)); + p_Port.receive(cr_IP_CommonCnf); + } + +} diff --git a/IMS_PART4_IWD_15wk38/Common/IP_PTC/IP_PTC_Templates.ttcn b/IMS_PART4_IWD_15wk38/Common/IP_PTC/IP_PTC_Templates.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..debab260e9b542f7c2073b3adf7b66c57a28ac6b --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/IP_PTC/IP_PTC_Templates.ttcn @@ -0,0 +1,428 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2014-11-23 16:30:47 +0100 (Sun, 23 Nov 2014) $ +// $Rev: 12502 $ +/******************************************************************************/ + +module IP_PTC_Templates { + + import from IP_ASP_TypeDefs all; + import from CommonIP all; + import from Parameters all; + + //**************************************************************************** + // IP Connections + //---------------------------------------------------------------------------- + + template (value) IP_AddrInfo_Type cs_IPv4Addr(template (value) charstring p_IPv4Addr) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + V4 := { + Addr := p_IPv4Addr + } + }; + + template (value) IP_AddrInfo_Type cs_IPv6Addr(template (value) charstring p_IPv6Addr) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + V6 := { + Addr := p_IPv6Addr, + ScopeId := omit + } + }; + + template (value) IP_Socket_Type cs_IP_Socket(template (omit) IP_AddrInfo_Type p_IpAddr, + template (omit) PortNumber_Type p_PortNumber) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + IpAddr := p_IpAddr, + Port := p_PortNumber + }; + + template (present) IP_Socket_Type cr_IP_Socket(template IP_AddrInfo_Type p_IpAddr, + template PortNumber_Type p_PortNumber) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + IpAddr := p_IpAddr, + Port := p_PortNumber + }; + + template (present) IP_Socket_Type cr_IP_Socket_Any := cr_IP_Socket(?, ?); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + template (present) IP_Socket_Type cr_IP_Socket_Omit := cr_IP_Socket(omit, omit); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + template (present) IP_Socket_Type cr_IP_Socket_AnyICMP := cr_IP_Socket(?, omit); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + + template (value) IP_Connection_Type cs_IP_ConnectionId(InternetProtocol_Type p_Protocol, + template (omit) IP_Socket_Type p_LocalSocket := omit, + template (omit) IP_Socket_Type p_RemoteSocket := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + Protocol := p_Protocol, + Local := p_LocalSocket, + Remote := p_RemoteSocket + }; + + template (present) IP_Connection_Type cr_IP_ConnectionId(InternetProtocol_Type p_Protocol, + template IP_Socket_Type p_LocalSocket, + template IP_Socket_Type p_RemoteSocket) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + Protocol := p_Protocol, + Local := p_LocalSocket, + Remote := p_RemoteSocket + }; + + template (value) IP_Connection_Type cs_UDP_ConnectionId(template (omit) IP_Socket_Type p_LocalSocket, + template (omit) IP_Socket_Type p_RemoteSocket := omit) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + cs_IP_ConnectionId(udp, p_LocalSocket, p_RemoteSocket); + + + template (present) IP_Connection_Type cr_UDP_ConnectionId(template IP_Socket_Type p_LocalSocket, + template IP_Socket_Type p_RemoteSocket) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + cr_IP_ConnectionId(udp, p_LocalSocket, p_RemoteSocket); + + template (value) IP_Connection_Type cs_ICMPv6_ConnectionId(template (omit) IP_Socket_Type p_LocalSocket, + template (omit) IP_Socket_Type p_RemoteSocket := omit) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + cs_IP_ConnectionId(icmpv6, p_LocalSocket, p_RemoteSocket); + + + template (present) IP_Connection_Type cr_ICMPv6_ConnectionId(template IP_Socket_Type p_LocalSocket, + template IP_Socket_Type p_RemoteSocket) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + cr_IP_ConnectionId(icmpv6, p_LocalSocket, p_RemoteSocket); + + template (value) IP_Connection_Type cs_TCP_ConnectionId(template (omit) IP_Socket_Type p_LocalSocket, + template (omit) IP_Socket_Type p_RemoteSocket := omit) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + cs_IP_ConnectionId(tcp, p_LocalSocket, p_RemoteSocket); + + + template (present) IP_Connection_Type cr_TCP_ConnectionId(template IP_Socket_Type p_LocalSocket, + template IP_Socket_Type p_RemoteSocket) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + cr_IP_ConnectionId(tcp, p_LocalSocket, p_RemoteSocket); + + /* + * @desc convert charstring to a the IMS_PTC's type 'IP_AddrInfo_Type' + * @param p_IpAddress + * @return template (value) IP_AddrInfo_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) + */ + function f_Char2IpAddress(charstring p_IpAddress) return template (value) IP_AddrInfo_Type + { + var template (value) IP_AddrInfo_Type v_AddrInfo; + + if (f_IpAddressIsIPv4(p_IpAddress)) { + v_AddrInfo := cs_IPv4Addr(p_IpAddress); + } + else { + v_AddrInfo := cs_IPv6Addr(p_IpAddress); + } + return v_AddrInfo; + } + + //**************************************************************************** + // Requests + //---------------------------------------------------------------------------- + /* + * @desc Build-up list of socket options + * @param p_AllowBroadcast (default value: false) + * @return IP_SockOptList_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) + */ + function fl_IP_SockOptList(boolean p_AllowBroadcast:= false ) return IP_SockOptList_Type + { /* @sic R5w130307: MTU size sic@ */ + var IP_SockOptList_Type v_SockOptList; + var integer i := 0; + + v_SockOptList := {}; + if (p_AllowBroadcast) { + v_SockOptList[i] := {SO_BROADCAST := true}; + i := i + 1; + } + + v_SockOptList[i] := {IP_MTU_SIZE := px_IP_MTU_Size}; + + return v_SockOptList; + } + + // UDP: + + template (value) IP_SOCKET_REQ cs_UDP_SOCKET_REQ(template (value) IP_Socket_Type p_LocalSocket, + boolean p_AllowBroadcast) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + CTRL := { + ConnectionId := cs_UDP_ConnectionId(p_LocalSocket, omit), + Req := { + UDP := { + SocketReq := { + SockOptList := fl_IP_SockOptList(p_AllowBroadcast) + } + } + } + } + }; + + template (value) IP_SOCKET_REQ cs_UDP_DATA_REQ(template (value) IP_Socket_Type p_LocalSocket, + template (value) IP_Socket_Type p_RemoteSocket, + template (value) octetstring p_UDP_Data) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + /* @sic R5-113734 change 8 sic@ */ + DATA := { + ConnectionId := cs_UDP_ConnectionId(p_LocalSocket, p_RemoteSocket), + Req := { + UDP := { + SendTo := { + Buffer := p_UDP_Data + } + } + } + } + }; + + template (value) IP_SOCKET_REQ cs_UDP_CLOSE_REQ(template (value) IP_Socket_Type p_LocalSocket) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + CTRL := { + ConnectionId := cs_UDP_ConnectionId(p_LocalSocket, omit), + Req := { + UDP := { + Close := true + } + } + } + }; + + // ICMPv6: + + template (value) IP_SOCKET_REQ cs_ICMPv6_SOCKET_REQ(template (value) IP_Socket_Type p_LocalSocket, + boolean p_AllowBroadcast) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + CTRL := { + ConnectionId := cs_ICMPv6_ConnectionId(p_LocalSocket, omit), + Req := { + ICMP := { + SocketReq := { + SockOptList := fl_IP_SockOptList(p_AllowBroadcast) + } + } + } + } + }; + + template (value) IP_SOCKET_REQ cs_ICMPv6_DATA_REQ(template (value) IP_Socket_Type p_LocalSocket, + template (value) IP_Socket_Type p_RemoteSocket, + template (value) Datagram_Content_Type p_ICMP_Data) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) + * @sic R5-113734 change 8 sic@ */ + DATA := { + ConnectionId := cs_ICMPv6_ConnectionId(p_LocalSocket, p_RemoteSocket), + Req := { + ICMP := { + SendTo := { + Buffer := p_ICMP_Data + } + } + } + } + }; + + template (value) IP_SOCKET_REQ cs_ICMPv6_CLOSE_REQ(template (value) IP_Socket_Type p_LocalSocket) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + CTRL := { + ConnectionId := cs_ICMPv6_ConnectionId(p_LocalSocket, omit), + Req := { + ICMP := { + Close := true + } + } + } + }; + + // TCP: + + template (value) IP_SOCKET_REQ cs_TCP_CONNECT_REQ(template (value) IP_Socket_Type p_LocalSocket, + template (value) IP_Socket_Type p_RemoteSocket, + InternetApplication_Type p_Application := ims) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + CTRL := { + ConnectionId := cs_TCP_ConnectionId(p_LocalSocket, p_RemoteSocket), + Req := { + TCP := { + ConnectReq := { + SockOptList := fl_IP_SockOptList(), /* @sic R5w130307: MTU size sic@ */ + Application := p_Application + } + } + } + } + }; + + template (value) IP_SOCKET_REQ cs_TCP_LISTEN_REQ(template (value) IP_Socket_Type p_LocalSocket, + InternetApplication_Type p_Application := ims, + template (omit) TLSInfo_Type p_TLSInfo := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + /* @sic R5w140125: additional parameter p_TLSInfo sic@ */ + CTRL := { + ConnectionId := cs_TCP_ConnectionId(p_LocalSocket, omit), + Req := { + TCP := { + Listen := { + SockOptList := fl_IP_SockOptList(), /* @sic R5w130307: MTU size sic@ */ + Application := p_Application, + TLSInfo := p_TLSInfo + } + } + } + } + }; + + template (value) IP_SOCKET_REQ cs_TCP_DATA_REQ(template (value) IP_Connection_Type p_IP_Connection, + template (value) TCP_Data_Type p_TCP_Data) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + DATA := { + ConnectionId := p_IP_Connection, + Req := { + TCP := { + Send := p_TCP_Data + } + } + } + }; + + template (value) IP_SOCKET_REQ cs_TCP_CLOSE_REQ(template (value) IP_Connection_Type p_IP_Connection) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + CTRL := { + ConnectionId := p_IP_Connection, + Req := { + TCP := { + Close := true + } + } + } + }; + + + //**************************************************************************** + // Indications + //---------------------------------------------------------------------------- + + // UDP: + + template (present) IP_SOCKET_IND cr_UDP_SOCKET_CNF(template IP_Socket_Type p_LocalSocket) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + CTRL := { + ConnectionId := cr_UDP_ConnectionId(p_LocalSocket, cr_IP_Socket_Omit), + Ind := { + UDP := { + SocketCnf := true + } + } + } + }; + + template (present) IP_SOCKET_IND cr_UDP_DATA_IND(template IP_Socket_Type p_LocalSocket, + template IP_Socket_Type p_RemoteSocket := cr_IP_Socket_Any) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + /* @sic R5-113734 change 8 sic@ */ + DATA := { + ConnectionId := cr_UDP_ConnectionId(p_LocalSocket, p_RemoteSocket), + Ind := { + UDP := { + RecvFrom := ? + } + } + } + }; + + // ICMPv6: + + template (present) IP_SOCKET_IND cr_ICMPv6_SOCKET_CNF(template IP_Socket_Type p_LocalSocket) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + CTRL := { + ConnectionId := cr_ICMPv6_ConnectionId(p_LocalSocket, cr_IP_Socket_Omit), + Ind := { + ICMP := { + SocketCnf := true + } + } + } + }; + + template (present) IP_SOCKET_IND cr_ICMPv6_DATA_IND(template IP_Socket_Type p_LocalSocket) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + /* @sic R5-113734 change 8 sic@ */ + DATA := { + ConnectionId := cr_ICMPv6_ConnectionId(p_LocalSocket, cr_IP_Socket_AnyICMP), + Ind := { + ICMP := { + RecvFrom := ? + } + } + } + }; + + // TCP: + + template (present) IP_SOCKET_IND cr_TCP_CONNECT_CNF(template (present) IP_Connection_Type p_IP_Connection) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + CTRL := { + ConnectionId := p_IP_Connection, + Ind := { + TCP := { + ConnectCnf := true + } + } + } + }; + + template (present) IP_SOCKET_IND cr_TCP_DATA_IND(template (present) IP_Connection_Type p_IP_Connection) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + DATA := { + ConnectionId := p_IP_Connection, + Ind := { + TCP := { + Recv := ? + } + } + } + }; + + template (present) IP_SOCKET_IND cr_TCP_CLOSE_CNF(template (present) IP_Connection_Type p_IP_Connection) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + CTRL := { + ConnectionId := p_IP_Connection, + Ind := { + TCP := { + CloseCnf := true + } + } + } + }; + + template (present) IP_SOCKET_IND cr_TCP_ACCEPT_IND(template IP_Socket_Type p_LocalSocket, + template IP_Socket_Type p_RemoteSocket := cr_IP_Socket_Any) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + CTRL := { + ConnectionId := cr_TCP_ConnectionId(p_LocalSocket, p_RemoteSocket), + Ind := { + TCP := { + Accept := true + } + } + } + }; + + template (present) IP_SOCKET_IND cr_TCP_CLOSE_IND(template (present) IP_Connection_Type p_IP_Connection) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + CTRL := { + ConnectionId := p_IP_Connection, + Ind := { + TCP := { + Close := true + } + } + } + }; + +} diff --git a/IMS_PART4_IWD_15wk38/Common/NAS/NAS_AuthenticationCommon.ttcn b/IMS_PART4_IWD_15wk38/Common/NAS/NAS_AuthenticationCommon.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..209a5c6b56a592c1c933460b9dcbc419b60f6c92 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/NAS/NAS_AuthenticationCommon.ttcn @@ -0,0 +1,129 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-07 11:13:33 +0200 (Mon, 07 Sep 2015) $ +// $Rev: 14196 $ +/******************************************************************************/ + +module NAS_AuthenticationCommon { + import from CommonDefs all; + import from Parameters all; + + type record Common_AuthenticationParams_Type { /* parameters related/used to/by EUTRA/UTRAN/GERAN authentication + @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + B128_Type RandValue, + B128_Type AUTN, + B32_128_Type XRES, + B64_Type KcGSM, + B128_Type Kc128, // @sic R5s150121 sic@ + B3_Type KeySeq, + B128_Type CK, + B128_Type IK, + integer XRESLength optional // @sic R5s120907 sic@ + }; + + type enumerated AuthenticationError_Type {noError, macError, sqnFailure, macErrorPlusSepBit, sepBit0 }; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + + const B32_Type tsc_AuthUndefinedB32 := oct2bit ('FFFFFFFF'O); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const B128_Type tsc_AuthUndefinedB128 := tsc_AuthUndefinedB32 & tsc_AuthUndefinedB32 & tsc_AuthUndefinedB32 & tsc_AuthUndefinedB32; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const B256_Type tsc_AuthUndefinedB256 := tsc_AuthUndefinedB128 & tsc_AuthUndefinedB128; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + template (value) Common_AuthenticationParams_Type cs_CommonAuthParams_Init (template (value) B128_Type p_Rand) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + RandValue := p_Rand, + AUTN := tsc_AuthUndefinedB128, + XRES := tsc_AuthUndefinedB128, + KcGSM := tsc_AuthUndefinedB32 & tsc_AuthUndefinedB32, + Kc128 := tsc_AuthUndefinedB128, // @sic R5s150121 sic@ + KeySeq := '111'B, + CK := tsc_AuthUndefinedB128, + IK := tsc_AuthUndefinedB128, + XRESLength := omit // @sic R5s120907 sic@ + }; + + //---------------------------------------------------------------------------- + /* + * @desc auxiliary function to increment KeySeq and deal with wrap around + * @param p_KeySeq + * @return B3_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) + */ + function f_Authentication_IncrementKeySeq(B3_Type p_KeySeq) return B3_Type + { + var B3_Type v_KeySeq := int2bit(((bit2int(p_KeySeq)+1) mod 8), 3); //@sic R5s140298 R5s140503 sic@ + // The mod 8 is used as initial value is 7, hence results in first value of 0. + // But if in a test case authentication is performed 7th time, it becomes 7 which is an undefined value, hence the check below added to avoid it. + if (v_KeySeq == '111'B) { + v_KeySeq := '000'B; + } + return v_KeySeq; + } + + //---------------------------------------------------------------------------- + /* + * @desc Calculation is done according to 34.108, clause 8.1.2 and 33.102, clause 6.8.1.2 + * Generation of Ck, Ik, AUTN and XRES + * @param p_Auth_Params + * @param p_AuthenticationError (default value: noError) + * @return Common_AuthenticationParams_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) + */ + function f_AuthenticationInit(Common_AuthenticationParams_Type p_Auth_Params, + AuthenticationError_Type p_AuthenticationError := noError) return Common_AuthenticationParams_Type + { /* @sic R5-123085 harmonisation of IMS (AuthenticationInit and the two error variants are needed for IMS too) sic@ */ + var Common_AuthenticationParams_Type v_Auth_Params := p_Auth_Params; + var B128_Type v_XDOut; + var B80_Type v_AUTN_2; + var B64_Type v_CDOut; + var B64_Type v_XDOut_Half; + var B64_Type v_MAC; + var B48_Type v_AK; + var B48_Type v_AUTN_1; + var B48_Type v_AuthSQN := '000000000000000000000000000000000000000000000000'B; + var B16_Type v_AuthAMF := px_AuthAMF; + + if (p_AuthenticationError == sqnFailure) { + v_AuthAMF := '1111111111111111'B; //AMF_resynch value + } + + if (p_AuthenticationError == sepBit0) { + v_AuthAMF := v_AuthAMF and4b '0111111111111111'B; // separation bit forced to 0 (TC 9.1.2.7), the rest unchanged from PIXIT + } + + if (p_AuthenticationError == macErrorPlusSepBit) { // @sic R5s130201 sic@ + v_AuthAMF := v_AuthAMF or4b '1000000000000000'B; // force the separation to 1, leave the rest unchanged + v_AuthSQN := '111111111111111111111111111111111111111111111111'B; // force SQN out of range + } + + v_XDOut := v_Auth_Params.RandValue xor4b px_AuthK; + v_CDOut := v_AuthSQN & v_AuthAMF; + v_XDOut_Half := substr( v_XDOut, 0, 64); + v_AK := substr( v_XDOut, 24, 48); + v_AUTN_1 := v_AuthSQN xor4b v_AK; + v_MAC := v_XDOut_Half xor4b v_CDOut; + + if ((p_AuthenticationError == macError) or (p_AuthenticationError == macErrorPlusSepBit)) { // @sic R5s130201 sic@ + v_MAC := not4b(v_MAC); // @sic R5s110313 sic@ + } + + v_AUTN_2 := v_AuthAMF & v_MAC; + v_Auth_Params.AUTN := v_AUTN_1 & v_AUTN_2; + // v_IKey := 128 bits of v_XDOut, wrapped, starting from offset 16 + v_Auth_Params.IK := substr( v_XDOut, 16, (128 - 16)) & substr( v_XDOut, 0, 16); + // v_CKey := 128 bits of v_XDOut, wrapped, starting from offset 8 + v_Auth_Params.CK := substr( v_XDOut, 8, (128 - 8)) & substr( v_XDOut, 0, 8); + v_Auth_Params.XRES := v_XDOut; + + if (p_AuthenticationError == noError) { + // ((CK1 XOR CK2) XOR (IK1 XOR IK2)) + v_Auth_Params.KcGSM := (substr( v_Auth_Params.CK, 0, 64) xor4b substr( v_Auth_Params.CK, 64, 64)) xor4b (substr( v_Auth_Params.IK, 0, 64) xor4b substr( v_Auth_Params.IK, 64, 64)); + v_Auth_Params.KeySeq := f_Authentication_IncrementKeySeq(v_Auth_Params.KeySeq); // @sic R5s140894 sic@ + v_Auth_Params.Kc128 := substr (fx_KeyDerivationFunction ( tsc_KDF_HMAC_SHA_256, (v_Auth_Params.CK & v_Auth_Params.IK), '32'O ), 0, 128); // @sic R5s150121, R5s150796 sic@ + } + return v_Auth_Params; + } +} diff --git a/IMS_PART4_IWD_15wk38/Common/NAS/NAS_AuxiliaryDefsAndFunctions.ttcn b/IMS_PART4_IWD_15wk38/Common/NAS/NAS_AuxiliaryDefsAndFunctions.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a3c00eb928dc3c784513f05bcb1e4cb5d8af69b3 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/NAS/NAS_AuxiliaryDefsAndFunctions.ttcn @@ -0,0 +1,428 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-17 14:46:41 +0200 (Thu, 17 Sep 2015) $ +// $Rev: 14494 $ +/******************************************************************************/ + +module NAS_AuxiliaryDefsAndFunctions { + + import from CommonDefs all; + import from Parameters all; + import from NAS_CommonTypeDefs all; + import from NAS_CommonTemplates all; + import from CommonIP all; + + //============================================================================ + // Protocol Configuration Options (PCO) + //---------------------------------------------------------------------------- + /* + * @desc Function used to check whether the UE requests in its PCO an address allocation via NAS signalling + * If the UE does not send PCO, then address assignment shall be via DHCP. TS 36.508 table 4.7.3-6. + * @param p_Pco + * @return boolean + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_CheckPCOforIPallocationViaNas(template (omit) ProtocolConfigOptions p_Pco) return boolean + { + var ProtocolConfigOptions v_Pco; + var integer i; + + if (isvalue(p_Pco)) { + v_Pco := valueof (p_Pco); + for (i := 0; i < lengthof(v_Pco.pco); i := i + 1 ) { + if(v_Pco.pco[i].protocolID == '000B'O) { // TS 24.008 clause 10.5.6.3 // @sic R5s090322 sic@ + return false; // @sic R5s090322 sic@ + } + } + } + return true; // @sic R5s090322 sic@ + } + + //------------------------------------ + /* + * @desc Function used to check whether the UE requests a P-CSCF address or DNS server address in its PCO + * If the UE does not support IMS, or doesn't request a P-CSCF address, the function returns the default PCO, PPP + * @param p_ConfigOptionsRX + * @param p_PdnIndex (default value: PDN_1) + * @param p_IgnoreIM_CN_SubsystemSignalingFlag (default value: true) + * @return template (value) NAS_ProtocolConfigOptions_Type + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_NAS_GetProtocolConfigOptionList(NAS_ProtocolConfigOptions_Type p_ConfigOptionsRX, + PDN_Index_Type p_PdnIndex := PDN_1, + boolean p_IgnoreIM_CN_SubsystemSignalingFlag := true) return template (value) NAS_ProtocolConfigOptions_Type + { + var PDN_AddressInfo_Type v_PDN_AddressInfo := f_PDN_AddressInfo_Get(p_PdnIndex); + var template (value) NAS_ProtocolConfigOptions_Type v_ProtocolContainerList := {}; + var integer v_PcoCnt := 0; + var O2_Type v_ProtocolId; + var octetstring v_Contents; + var integer i; + + for (i := 0; i < lengthof(p_ConfigOptionsRX); i := i + 1) { + + v_ProtocolId := p_ConfigOptionsRX[i].protocolID; + v_Contents := ''O; + + select (v_ProtocolId) { // See 24.008 Table 10.5.154 + case ('0001'O) { // P-CSCF IPv6 address + if (pc_IMS) { + v_Contents := f_Convert_IPv6Addr2OctString(v_PDN_AddressInfo.PCSCF_IPAddressIPv6); + } + } + case ('0002'O) { // IM CN Subsystem Signalling Flag, reply with an empty container + if (not p_IgnoreIM_CN_SubsystemSignalingFlag) { + v_ProtocolContainerList[v_PcoCnt] := cs_ProtocolContainer_Common(v_ProtocolId); + v_PcoCnt := v_PcoCnt + 1; + continue; + } + } + case ('0003'O) { // DNS Server IPv6 address + v_Contents := f_Convert_IPv6Addr2OctString(v_PDN_AddressInfo.DNS_ServerAddressIPv6); + } + case ('000C'O) { // P-CSCF IPv4 address + if (pc_IMS) { + v_Contents := f_Convert_IPv4Addr2OctString(v_PDN_AddressInfo.PCSCF_IPAddressIPv4); + } + } + case ('000D'O) { // DNS Server IPv4 address + v_Contents := f_Convert_IPv4Addr2OctString(v_PDN_AddressInfo.DNS_ServerAddressIPv4); + } + } + + if (lengthof(v_Contents) > 0) { + v_ProtocolContainerList[v_PcoCnt] := cs_ProtocolContainer(v_ProtocolId, v_Contents); + v_PcoCnt := v_PcoCnt + 1; + } + } + return v_ProtocolContainerList; + } + + /* + * @desc wrapper for f_GetDefaultProtocolConfigOptionList + * @param p_Pco + * @param p_PdnIndex (default value: PDN_1) + * @return template (value) ProtocolConfigOptions + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_GetDefaultProtocolConfigOptions(template (omit) ProtocolConfigOptions p_Pco, + PDN_Index_Type p_PdnIndex := PDN_1) return template (value) ProtocolConfigOptions + { /* @sic R5s130362 - MCC160 Implementation sic@ */ + /* @sic R5s141127 change 4 - MCC160 Comments: split into f_GetDefaultProtocolConfigOptions and f_GetDefaultProtocolConfigOptionList sic@ */ + var template (value) NAS_ProtocolConfigOptions_Type v_ProtocolContainerList := {}; + var ProtocolConfigOptions v_ProtocolConfigOptionsRX; + + if (isvalue(p_Pco)) { + v_ProtocolConfigOptionsRX := valueof(p_Pco); + v_ProtocolContainerList := f_NAS_GetProtocolConfigOptionList(v_ProtocolConfigOptionsRX.pco, p_PdnIndex); + } + + return f_NAS_ProtocolConfigOptionsTX(v_ProtocolContainerList); + } + + /* + * @desc Decode APN acc. to TS 23.003 cl. 9.1 and RFC 1035 cl. 4.1.2 + * @param p_APN + * @return Charstring + * @status + */ + function f_DomainName_Decode(octetstring p_APN) return charstring + { + var CharStringList_Type v_LabelList; + var integer v_Length; + var integer i; + var integer k := 0; + + for (i := 0; i < lengthof(p_APN); i := i + 1) { + v_Length := oct2int(p_APN[i]); + v_LabelList[k] := oct2char(substr(p_APN, i+1, v_Length)); + i := i + v_Length; + k := k + 1; + } + + return f_StringJoin(v_LabelList, "."); + } + + /* + * @desc Encode APN acc. to TS 23.003 cl. 9.1 and RFC 1035 cl. 4.1.2 + * @param p_LabelList + * @return octetstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_DomainName_EncodeLabels(CharStringList_Type p_LabelList) return octetstring + { + var octetstring v_EncodedAPN := ''O; + var octetstring v_LabelOctets; + var integer v_Length; + var integer i; + + for (i := 0; i < lengthof(p_LabelList); i := i + 1) { + v_LabelOctets := char2oct(p_LabelList[i]); + v_Length := lengthof(v_LabelOctets); + v_EncodedAPN := v_EncodedAPN & int2oct(v_Length, 1) & v_LabelOctets; + } + return v_EncodedAPN; + } + + /* + * @desc Encode APN acc. to TS 23.003 cl. 9.1 and RFC 1035 cl. 4.1.2 + * @param p_DomainName + * @return octetstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_DomainName_Encode(charstring p_DomainName) return octetstring + { + var CharStringList_Type v_LabelList := f_StringSplit(p_DomainName, {"."}); + return f_DomainName_EncodeLabels(v_LabelList); + } + + //============================================================================ + + //---------------------------------------------------------------------------- + /* + * @desc Convert from IMSI, IMEI or IMEISV of type hexstring to octetstring (to be used in f_Imsi2MobileIdentity, f_Imei2MobileIdentity and f_Imeisv2MobileIdentity) + * @param p_MobileId + * @return octetstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) + */ + function fl_ImsiImei2Octetstring(hexstring p_MobileId) return octetstring + { + var integer v_Length := lengthof(p_MobileId); + var integer v_Odd := (v_Length rem 2); + var octetstring v_Other := '00'O; + var integer I; + var integer K; + + if (v_Odd == 0) { // If length is even + v_Length := v_Length + 1; + p_MobileId := p_MobileId & 'F'H; // add '1111' on to the end of the IMSI + } + + // Reverse each pair of digits + // First digit is not included as it is treated differently + K:=0; + for (I:=1; I < v_Length - 1; I:=I+2) { + v_Other[K] := hex2oct(p_MobileId[I+1] & p_MobileId[I]); + K := K + 1; + } + + return v_Other; + } + + //---------------------------------------------------------------------------- + /* + * @desc Convert from IMSI of type hexstring to NAS MobileIdentity + * @param p_IMSI + * @return template (value) MobileIdentity + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) + */ + function f_Imsi2MobileIdentity(hexstring p_IMSI) return template (value) MobileIdentity + { + var integer v_ImsiLength := lengthof(p_IMSI); + var integer v_Odd := (v_ImsiLength rem 2); + var octetstring v_Other := fl_ImsiImei2Octetstring (p_IMSI); // @sic R5s100092 sic@ + var B4_Type v_FirstDigit := hex2bit(p_IMSI[0]); + var B1_Type v_OddEvenInd := int2bit(v_Odd, 1); + + return cds_MobileIdentityImsi_lv(v_FirstDigit, v_OddEvenInd, v_Other); + } + + //---------------------------------------------------------------------------- + /* + * @desc Convert from IMEI of type hexstring to NAS MobileIdentity + * @param p_IMEI + * @param p_NAS_IdType (default value: tsc_IdType_IMEI) + * @return template (present) MobileIdentity + * @status APPROVED (LTE, LTE_A) + */ + function f_Imei2MobileIdentity(hexstring p_IMEI, + NAS_IdType p_NAS_IdType := tsc_IdType_IMEI) return template (present) MobileIdentity // @sic R5s130758 sic@ + { + var integer v_ImeiLength := lengthof(p_IMEI); + var integer v_Odd := (v_ImeiLength rem 2); + var octetstring v_Other := fl_ImsiImei2Octetstring (p_IMEI); + var B4_Type v_FirstDigit := hex2bit(p_IMEI[0]); + var B1_Type v_OddEvenInd := int2bit(v_Odd, 1); + + return cr_MobileIdentityImei(v_FirstDigit, v_OddEvenInd, v_Other, p_NAS_IdType); // @sic R5s130758 sic@ + } + + //---------------------------------------------------------------------------- + /* + * @desc Convert from IMEISV of type hexstring to NAS MobileIdentity + * @param p_IMEISV + * @return template (present) MobileIdentity + * @status APPROVED (LTE) + */ + function f_Imeisv2MobileIdentity(hexstring p_IMEISV) return template (present) MobileIdentity + { // @sic R5-131832 sic@ + var integer v_ImeiLength := lengthof(p_IMEISV); + var integer v_Odd := (v_ImeiLength rem 2); + var octetstring v_Other := fl_ImsiImei2Octetstring (p_IMEISV); + var B4_Type v_FirstDigit := hex2bit(p_IMEISV[0]); + var B1_Type v_OddEvenInd := int2bit(v_Odd, 1); + + return cr_MobileIdentityImeisv(v_FirstDigit, v_OddEvenInd, v_Other); + } + + //---------------------------------------------------------------------------- + /* + * @desc Convert from Emergency Number of type charstring to octetstring (to be used in Emergency Number List in e.g. Attach Accept) + * @param p_EmgNum + * @return octetstring + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function fl_EmgNum2Octetstring(hexstring p_EmgNum) return octetstring + { + var integer v_Length := lengthof(p_EmgNum); + var integer v_Odd := (v_Length rem 2); + var octetstring v_Result := '00'O; + var integer I; + var integer K; + + if (v_Odd == 1) { // If length is odd + v_Length := v_Length + 1; + p_EmgNum := p_EmgNum & 'F'H; // add '1111' on to the end of the Emergency Number + } + + // Reverse each pair of digits, note that v_Length is even + K:=0; + for (I:=0; I < v_Length - 1; I:=I+2) { + v_Result[K] := hex2oct(p_EmgNum[I+1] & p_EmgNum[I]); + K := K + 1; + } + + return v_Result; + } + + /* + * @desc To generate an local emergency number list + * @param p_NoOfNums - To specify how many numbers to be included in the list (max = 10) + * @param p_NumList + * @return template (value) EmergNumList + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_Build_EmergNumList(integer p_NoOfNums, + EmergencyNumList p_NumList) return template (value) EmergNumList + { + var integer i; + var template (value) EmergNumList v_EmergNum; + var octetstring v_LocalNum; + var integer v_LocalLength := 0; + var integer v_TotalLength := 0; + var B7_Type v_ServCat; + + v_EmergNum.iei := '34'O; + for (i := 0; i < p_NoOfNums; i:=i+1) { + v_LocalNum := fl_EmgNum2Octetstring (p_NumList[i]); + v_LocalLength := lengthof(v_LocalNum); + if (i/2 > 0) { + v_ServCat := ('00'B & ('00001'B << i)); + } else { + v_ServCat := ('00'B & ('00001'B << i)); + } + v_EmergNum.emergNum[i]:= cs_EmergencyLocalNumber(int2oct(v_LocalLength + 1, 1), + cs_EmergServCat(v_ServCat), + v_LocalNum); + v_TotalLength := v_TotalLength + 2 + v_LocalLength; // 1 octet for v_LocalLength + 1 for SCValue + length of number + } + v_EmergNum.iel := int2oct (v_TotalLength, 1); + return v_EmergNum; + } + + /* + * @desc Generation of a new list of local emergency numbers different from existing ones + * @param p_NoOfNums .. maximum 20 + * @param p_ExistingNums + * @return EmergencyNumList .. numbers of 3 decimal digits each + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) + */ + function f_Get_EmergencyNumList(integer p_NoOfNums, + template (omit) EmergencyNumList p_ExistingNums) return EmergencyNumList + { + var EmergencyNumList v_NewNumbers; + var integer v_Number := 115; // start as implied by LTE test case 11.2.6 @sic R5s141315 sic@ + var boolean v_NumberExists; + var hexstring v_NumberDigits; + var integer i; + + if ( p_NoOfNums > 20 ) { FatalError(__FILE__, __LINE__, "unsupported number of emg nums") }; // max 20 emg nums may be generated + + for (i:=0; i the text between the most inner quotes is returned */ + var charstring v_Expression := p_Expression; + var charstring v_Result; + var template charstring v_ExpectedString := pattern p_ExpectedString; + var boolean v_MatchResult; + var charstring v_CRLF := oct2char('0D'O) & oct2char('0A'O); + + v_Result := regexp(p_AT_Response, v_Expression, p_Group); + + v_MatchResult := match(v_Result, v_ExpectedString); + + if (v_MatchResult == true) { + f_SetVerdict(pass,__FILE__, __LINE__, p_Text); + } else { + f_ErrorLog(__FILE__, __LINE__, v_CRLF & "Value expected: " & p_ExpectedString & v_CRLF & "Value received: " & v_Result); // if anything went wrong, show it + f_SetVerdict(fail,__FILE__, __LINE__, p_Text); + } + } + +} diff --git a/IMS_PART4_IWD_15wk38/Common/NAS/NAS_CommonTemplates.ttcn b/IMS_PART4_IWD_15wk38/Common/NAS/NAS_CommonTemplates.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..722a493e68d6c62a1e698d894a1fb8ff8a389b7b --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/NAS/NAS_CommonTemplates.ttcn @@ -0,0 +1,1041 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-15 14:17:18 +0200 (Tue, 15 Sep 2015) $ +// $Rev: 14392 $ +/******************************************************************************/ + +module NAS_CommonTemplates { + + import from CommonDefs all; + import from NAS_CommonTypeDefs all; + + //============================================================================== + group NAS_CommonConstants { // Constants being used for NAS_CommonTemplates + + const B1_Type tsc_Spare1 := '0'B; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const B2_Type tsc_Spare2 := '00'B; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + const B3_Type tsc_Spare3 := '000'B; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const B4_Type tsc_Spare4 := '0000'B; + const B5_Type tsc_Spare5 := '00000'B; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + const B6_Type tsc_Spare6 := '000000'B; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const B7_Type tsc_Spare7 := '0000000'B; + const B8_Type tsc_Spare8 := '00000000'B; + const SpareHalfOctet tsc_SpareHalfOctet := '0'H; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + const NAS_IdType tsc_IdType_NoId := '000'B; + const NAS_IdType tsc_IdType_IMSI := '001'B; /* suitable for identity type 24.008 cl. 10.5.3.4 and identiy type 2 24.008 cl. 10.5.5.9 + @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const NAS_IdType tsc_IdType_IMEI := '010'B; /* suitable for identity type 24.008 cl. 10.5.3.4 and identiy type 2 24.008 cl. 10.5.5.9 + @status APPROVED (LTE, LTE_A) */ + const NAS_IdType tsc_IdType_IMEI_24301 := '011'B; /* suitable for identity type 24.301 cl. 9.9.3.12.1 + @status APPROVED (LTE) */ + const NAS_IdType tsc_IdType_IMEISV := '011'B; /* @sic R5s130438 sic@ suitable for identity type 24.008 cl. 10.5.3.4 and identiy type 2 24.008 cl. 10.5.5.9 + @status APPROVED (LTE) */ + const NAS_IdType tsc_IdType_TMSI := '100'B; /* suitable for identity type 24.008 cl. 10.5.3.4 and identiy type 2 24.008 cl. 10.5.5.9 + @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + const NAS_IdType tsc_IdType_TMGI := '101'B; + const NAS_IdType tsc_IdType_GUTI := '110'B; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + const NAS_IdType tsc_IdType_EmergencyIMEI := '011'B; /* To be used when specifying an IMEI when using an emergency bearer @sic R5s110176 Baseline Moving sic@ */ + + const B3_Type tsc_IMEISV_NotRequested := '000'B; /* @sic R5s130438 sic@ suitable for IMEISV request type 24.008 cl. 10.5.5.10 */ + const B3_Type tsc_IMEISV_Requested := '001'B; /* @sic R5s130438 sic@ suitable for IMEISV request type 24.008 cl. 10.5.5.10 + @status APPROVED (LTE) */ + +const TmsiStatusValue tsc_NoValidTmsi := '0'B; + + const GprsTimerUnit tsc_GprsTimerUnit_2sec := '000'B; /* @status APPROVED (LTE) */ + const GprsTimerUnit tsc_GprsTimerUnit_1min := '001'B; /* @status APPROVED (LTE, LTE_A, LTE_IRAT, UTRAN) */ + const GprsTimerUnit tsc_Gprs3TimerUnit_1min := '101'B; /* @status APPROVED (IMS, LTE_A, SSNITZ, UTRAN) */ + const GprsTimerUnit tsc_GprsTimerUnit_6min := '010'B; /* @status APPROVED (LTE, LTE_IRAT) */ + const GprsTimerUnit tsc_GprsTimerUnit_deact := '111'B; /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + const O2_Type tsc_PCO_Id_DSMIPv6 := '0007'O; + const O2_Type tsc_PCO_Id_DSMIPv6_IPv4 := '0009'O; + + const B7_Type tsc_EmergServManual := '0100000'B; /* @status */ + const B7_Type tsc_EmergServAuto := '1000000'B; /* @status */ + const B7_Type tsc_EmergServPolice := '0000001'B; + const B7_Type tsc_EmergServAmbulance := '0000010'B; + const B7_Type tsc_EmergServFire := '0000100'B; + const B7_Type tsc_EmergServMarine := '0001000'B; + const B7_Type tsc_EmergServMountain:= '0010000'B; + + } // end group NAS_CommonConstants + //------------------------------------------------------------------------------ + + template (value) AccessPointName cs_AccessPointName(octetstring p_Name) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + iei := omit, + iel := int2oct(lengthof(p_Name), 1), + nameValue := p_Name + }; + + template (present) AccessPointName cr_AccessPointName(octetstring p_Name) := + { /* @status APPROVED (IMS, LTE, LTE_A) */ + iei := '28'O, + iel := int2oct(lengthof(p_Name), 1), + nameValue := p_Name + }; + + template (present) AccessPointName cr_AccessPointName_Any := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + iei := '28'O, + iel := ?, + nameValue := ? + }; + + template (present) AddUpdateParams cr_AddUpdateParams_Any := + { /* @status APPROVED (IMS, IMS_IRAT, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := ?, // '1100'B + spare:=?, + csmo := ?, // @sic R5s120178 Baseline Moving sic@ + csmt := ? + }; + + template (present) AdditionalUpdateType cr_AdditionalUpdateTypeAny := + { /* 24.301 cl. 9.9.3.0B */ + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + /* @sic R5s100135 sic@ */ + iei := 'F'H, // currently only used as TV + spare3 := tsc_Spare3, + addUpdateTypeValue := ? + }; + + template (present) AuthenticationFailureParameter cr_AuthFailParam_Any := + { /* TLV format to be used in Authentication_Failure */ + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := '30'O, // version 110, and value used in GMM + iel := '0E'O, + auts := ? + }; + + template (present) AuthenticationFailureParameter cdr_AuthFailParamGSM_Any modifies cr_AuthFailParam_Any := + { /* @status APPROVED (IMS, IMS_IRAT, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := '22'O + }; + + template (value) RAND cs_RAND_v(B128_Type p_RAND) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + iei := omit, + randValue := p_RAND + }; + + template (value) RAND cs_GMM_AuthRAND(B128_Type p_Rand) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := '21'O, + randValue := p_Rand + }; + + template (value) AUTN cs_AUTN_lv(B128_Type p_AUTN) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + iei := omit, + iel := '10'O, /* AUTN has length of 128 bits i.e. 16 octets */ + aUTN := p_AUTN + }; + + template (value) AUTN cs_GSM_AUTN(template (value) B128_Type p_AUTN) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := '20'O, + iel := '10'O, // Length of 16 octets + aUTN := p_AUTN // value of Authentication Parameter AUTN + }; + + template (value) AUTN cs_GMM_AUTN(B128_Type p_Autn) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := '28'O, + iel := '10'O, + aUTN := p_Autn + }; + + template (value) CiphKeySeqNum cs_CiphKeySeqNum(template (omit) IEI4_Type p_IEI, + template (value) KeySeq p_KeySeq) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := p_IEI, + spare1 := '0'B, + keySeq := p_KeySeq + }; + + template (present) CiphKeySeqNum cr_CiphKeySeqNum(template (omit) IEI4_Type p_IEI, + template (present) KeySeq p_KeySeq) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := p_IEI, + spare1 := '0'B, + keySeq := p_KeySeq + }; + + // ============================================================================= + // Structured Type Constraint + // Codec + // 3G TS 24.008 cl. 10.5.4.32 + // ----------------------------------------------------------------------------- + template (present) Codec cr_CodecAny := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + sysId := ?, // system identifcation + len := ?, // length + bitMap1to8 := ?, // codec bitmap bits 1-8 + bitMap9to16 := * // codec bitmap bits 9-16 + }; + + // ============================================================================= + // Structured Type Constraint + // Supported Codec List + // 3G TS 24.008 cl. 10.5.3.32 + // ----------------------------------------------------------------------------- + template (present) CodecList cr_CodecListAny := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := '40'O, // '01000000'B (40 hex) + iel := ?, // length + codec := ({cr_CodecAny, cr_CodecAny, cr_CodecAny, *}, {cr_CodecAny, cr_CodecAny, *}, {cr_CodecAny, *}) // Codec list @sic R5s110278 sic@ + }; + + template (value) DetachType cs_DetachType(NAS_AttDetValue_Type p_TypeOfDetach):= + { /* @status APPROVED (LTE) */ + switchOff := '0'B, + typeOfDetach := p_TypeOfDetach + }; + + template (present) DetachType cr_DetachType(template (present) B1_Type p_SwitchOff, + template (present) NAS_AttDetValue_Type p_TypeOfDetach) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + switchOff := p_SwitchOff, + typeOfDetach := p_TypeOfDetach + }; + + template (present) DetachType cr_DetachTypeOnSwitchOff := cr_DetachType('1'B, ?); /* @status APPROVED (IMS, IMS_IRAT, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + + template (present) DeviceProperties cr_DeviceProperties(IEI4_Type p_IEI, + template (present) B1_Type p_LowPriority := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := p_IEI, + spare := tsc_Spare3, + lowPriority := p_LowPriority + }; + + template (present) DRXparameter cr_DRXparameter_Any (template (omit) IEI8_Type p_IEI) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := p_IEI, + splitPGcycleCode := ?, // Split PG cycle code + cnDRXcoef := ?, // CN specific DRX cycle length coefficient + splitOnCCCH := ?, // Split on CCCCH + nonDRXtimer := ? // non-DRX timer + }; + + template (present) EDGE_Struct cr_EDGE_Struct_Any := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + modulationCapability := ?, + pwrMask1 := ?, + eDGE_RF_PowerCapability1 := *, // not present if pwrMask1 = 0 + pwrMask2 := ?, + eDGE_RF_PowerCapability2 := * // not present if pwrMask2 = 0 + }; + + // ============================================================================= + // Structured Type Constraint + // Emergency Service Category + // 3GPP 24.008 / 10.5.4.33 + // ----------------------------------------------------------------------------- + template (present) EmergServCat cr_EmergServCatAny := + { /* @status APPROVED (IMS_IRAT, LTE_IRAT, POS, UTRAN) */ + spare := '0'B, + emergSCValue := ? // Emergency Service Category value + }; + + template (value) EmergServCat cs_EmergServCat(B7_Type p_EmergSCValue) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + spare := '0'B, + emergSCValue := p_EmergSCValue // Emergency Service Category value + }; + + template (value) EmergNum cs_EmergencyLocalNumber(Type4Length_Type p_Length, + template (value) EmergServCat p_EmergSCValue, + octetstring p_Number) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + len := p_Length, // length + emergServCat := p_EmergSCValue, // Emergency Service Category + digits := p_Number // BCD numbers + }; + + // ============================================================================= + // Structured Type Constraint + // ----------------------------------------------------------------------------- + template (value) GPRS_Timer cs_GprsTimer_tv(IEI8_Type p_IEI, // @sic R5s100662 sic@ + B3_Type p_Unit, + B5_Type p_Value) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + iei := p_IEI, // '1E'O + unit := p_Unit, + timerValue := p_Value + }; + + template (value) GPRS_Timer cs_GprsTimer_v(GprsTimerUnit p_Unit, + B5_Type p_Value) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := omit, + unit := p_Unit, + timerValue := p_Value + }; + + template (value) GPRS_Timer cs_GprsTimer_v_deact := cs_GprsTimer_v(tsc_GprsTimerUnit_deact, tsc_Spare5); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + template (value) IdentityType cs_IdentityType(NAS_IdType p_NAS_IdType) := + { /* @status APPROVED (LTE, LTE_A) */ + spare := '0'B, + typeOfId := p_NAS_IdType + }; + + template (present) LocAreaId cr_LAI(template (omit) IEI8_Type p_IEI, + template (present) octetstring p_PLMN := ?, + template (present) octetstring p_LAC := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := p_IEI, + plmn := p_PLMN, // MCC + MNC + lac := p_LAC // location area code + }; + + template (present) LocAreaId cr_LAI_Any := cr_LAI('13'O); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + template (present) LocAreaId cr_LAI_Any_v := cr_LAI(omit); /* @status APPROVED (IMS, IMS_IRAT, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + + template (value) LocAreaId cs_LAI(template (omit) IEI8_Type p_IEI, + template (value) octetstring p_PLMN, + template (value) octetstring p_LAC) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := p_IEI, + plmn := p_PLMN, // MCC + MNC + lac := p_LAC // location area code + }; + + template (value) LLC_SAPI cs_LLC_SAPI(template (omit) IEI8_Type p_IEI := omit, + B4_Type p_LlcSapiValue) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + iei := p_IEI, + spare := '0000'B, + llcSapiValue := p_LlcSapiValue + }; + + template (value) LLC_SAPI cs_LLC_SAPI_11 (template (omit) IEI8_Type p_IEI := omit) := cs_LLC_SAPI(p_IEI, '1011'B); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + template (value) LLC_SAPI cs_LLC_SAPI_03 (template (omit) IEI8_Type p_IEI := omit) := cs_LLC_SAPI(p_IEI, '0011'B); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + + template (present) MobileIdentity cr_MobileIdAny(template (omit) IEI8_Type p_IEI := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := p_IEI, + iel := ?, + idDigit1 := ?, + oddEvenInd := ?, + typeOfId := ?, + otherDigits := ? + }; + + template (value) MobileIdentity cs_MobileIdentityGuti(template (omit) IEI8_Type p_IEI, + octetstring p_Guti) := + { + /* Reference: 24.301 cl. 9.9.3.12; + @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + iei := p_IEI, + iel := int2oct(lengthof(p_Guti) + 1, 1), // 11 octets in case of GUTI + idDigit1 := '1111'B, // in case of the GUTI + oddEvenInd := '0'B, // in case of the GUTI + typeOfId := tsc_IdType_GUTI, // 3 bits + otherDigits := p_Guti // 10 octets acc. to 24.301 + }; + + template (value) MobileIdentity cs_MobileIdentityImsi(B4_Type p_FirstDigit, + B1_Type p_OddEvenInd, + octetstring p_OtherDigits) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := '17'O, + iel := int2oct(lengthof(p_OtherDigits) + 1, 1), + idDigit1 := p_FirstDigit, // 4 bits + oddEvenInd := p_OddEvenInd, // 1 bit + typeOfId := tsc_IdType_IMSI, // 3 bits + otherDigits := p_OtherDigits + }; + + template (value) MobileIdentity cds_MobileIdentityImsi_lv(B4_Type p_FirstDigit, + B1_Type p_OddEvenInd, + octetstring p_OtherDigits) + modifies cs_MobileIdentityImsi := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := omit + }; + + template (value) MobileIdentity cs_MobileIdTMSIorPTMSI(template (omit) IEI8_Type p_IEI, + O4_Type p_TmsiPtmsi) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := p_IEI, // for U/G this is '18'O + iel := '05'O, // TMSI consists of 4 octets + idDigit1 := '1111'B, // special coding for TMSI + oddEvenInd := '0'B, // even + typeOfId := tsc_IdType_TMSI, // TMSI / P-TMSI + otherDigits := p_TmsiPtmsi + }; + + template (value) MobileIdentity cs_MobileIdTMSI(template (omit) IEI8_Type p_IEI, // iei can be '17' (MM) or '13' (GMM) or omit + O4_Type p_Tmsi) := + /* @status APPROVED (LTE_IRAT, SSNITZ) */ + cs_MobileIdTMSIorPTMSI(p_IEI, p_Tmsi); + + template (present) MobileIdentity cr_MobileIdTMSI_lv(template (present) octetstring p_Tmsi := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := omit, + iel := '05'O, // TMSI consists of 4 octets + idDigit1 := '1111'B, // special coding for TMSI + oddEvenInd := '0'B, // even + typeOfId := tsc_IdType_TMSI, // TMSI + otherDigits := p_Tmsi + }; + + template (present) MobileIdentity cdr_MobileIdTMSI_tlv(template (present) octetstring p_Tmsi := ?, + IEI8_Type p_IEI := '18'O) + modifies cr_MobileIdTMSI_lv := + { /* @status APPROVED (IMS_IRAT, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := p_IEI + }; + + template (present) MobileIdentity cr_MobileIdentityImei(B4_Type p_FirstDigit, + B1_Type p_OddEvenInd, + octetstring p_OtherDigits, + NAS_IdType p_NAS_IdType := tsc_IdType_IMEI) := // @sic R5s130758 sic@ + { /* @status APPROVED (LTE, LTE_A) */ + iei := omit, + iel := int2oct(lengthof(p_OtherDigits) + 1, 1), + idDigit1 := p_FirstDigit, // 4 bits + oddEvenInd := p_OddEvenInd, // 1 bit + typeOfId := p_NAS_IdType, // 3 bits // @sic R5s130758 sic@ + otherDigits := p_OtherDigits + }; + + template (present) MobileIdentity cr_MobileIdentityImeisv(B4_Type p_FirstDigit, // @sic R5-131832 sic@ + B1_Type p_OddEvenInd, + octetstring p_OtherDigits) := + { /* @status APPROVED (LTE) */ + iei := omit, + iel := int2oct(lengthof(p_OtherDigits) + 1, 1), + idDigit1 := p_FirstDigit, // 4 bits + oddEvenInd := p_OddEvenInd, // 1 bit + typeOfId := tsc_IdType_IMEISV, // 3 bits + otherDigits := p_OtherDigits + }; + + template (present) MS_Clsmk2 cr_MS_Clsmk2_Any_tlv(template (omit) IEI8_Type p_IEI := '11'O) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := p_IEI, // @sic R5s100662, R5s110112 sic@ + iel := '03'O, + spare1_1 := '0'B, + revLvl := ?, + eSIND := ?, + a5_1 := ?, + rFPwrCap := ?, + spare1_2 := '0'B, + pSCap := ?, + sSSI := ?, + sMCap := ?, + vBS := ?, + vGCS := ?, + fC := ?, + cM3 := ?, + spare1_3 := '0'B, + lCSVA := ?, + uCS2 := ?, + soLSA := ?, + cMSP := ?, + a5_3 := ?, + a5_2 := ? + }; + + template (present) MS_Clsmk2 cr_MS_Clsmk2_Any := + /* @status APPROVED (IMS, IMS_IRAT, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + cr_MS_Clsmk2_Any_tlv (omit); + + template (present) MS_Clsmk3 cr_MSCLSMK3_Any := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := '20'O, /* 0x20 */ + iel := ?, /* OCTETSTRING [1] */ + spareBit := '0'B, // spare bit */ + multibandSupported := ?, + a5_7 := ?, /* a5/7 algorithm supported */ + a5_6 := ?, /* a5/6 algorithm supported */ + a5_5 := ?, /* a5/5 algorithm supported */ + a5_4 := ?, /* a5/4 algorithm supported */ + associatedRadioCapabilty2 := *, /* present if multibandSupported = 101 or 110 */ + spareBits1 := *, /* present if multibandSupported = 001 or 010 or 100 */ + associatedRadioCapabilty1 := *, /* present if multibandSupported = 001 or 010 or 100 or 101 or 110 */ + maskBit1 := ?, + rGSM_RadioCapability := *, /* R-GSM band associated radio capability. + not present if maskB1 = 0 */ + maskBit2 := ?, + multiSlotClass := *, /* multi slot class. + not present if multiSlotClass = 0 */ + uCS2Treatment := ?, + extMeasurementCapability := ?, /* extended measurement capability */ + maskBit3 := ?, + msMeasurementCapability := cr_MS_MeasCapability_Any ifpresent, /* MS measurement capability + // not present if maskB3 = 0 */ + maskBit4 := ?, + msPositioningMethod := *, /* MS positioning method capability + not present if maskB4 = 0 */ + maskBit5 := ?, + eDGE_MultiSlot := *, /* EDGE multi slot capability + not present if maskB5 = 0 */ + maskBit6 := ?, + psk8_Struct := cr_EDGE_Struct_Any ifpresent, /* EDGE struct + not present if maskB6 = 0 */ + maskBit7 := ?, + gSM400BandsSupported := *, /* not present if maskBIt7 = 0 */ + gSM400AssociatedRadioCapability := *, /* not present if gSM400BandsSupported = 00 or maskB7 = 0 */ + maskBit8 := ?, + gSM850AssociatedRadiioCapability := *, /* not present if maskBIt8 = 0 */ + maskBit9 := ?, + pCS1900AssociatedRadiioCapability := *, /* not present if maskBIt9 = 0 */ + uMTS_FDD_RAT_Capability := ?, + uMTS384TDD_RAT_Capability := ?, + cDMA2000_RAT_Capability := ?, + maskBit10 := ?, + dTM_GPRS_MultiSlotSubclass := *, /* not present if maskB10 = 0 */ + singleSlotDTM := *, /* not present if maskB10 = 0 */ + maskBit11 := *, /* not present if maskB10 = 0 */ + dTM_EGPRS_MultiSlorSubclass := *, /* not present if maskB10 = 0 or maskB11 = 0 */ + maskBit12 := ?, + singleBandSupport := *, /* not present if maskB12 = 0 */ + maskBit13 := *, + gSM700AssociatedRadioCapability := *, /* not present if maskB13 = 0 */ + uMTS128TDD_RAT_Capability := *, + gERANFeatPack1 := *, + mask14 := *, + extDTM_GPRS_MultiSlotSubclass := *, /* not present if maskB14 = 0 */ + etxDTM_EGPRS_MultiSlotSubclass := *, /* not present if maskB14 = 0 */ + mask15 := *, + highMultislotCap := *, /* not present if mask15 = 0 */ + spare2 := tsc_Spare1, // @sic R5s150329 Baseline Moving sic@ + gERANFeatPack2 := *, + gMSKMultislotPowerProfile := *, + pSKMultislotPowerProfile := *, + mask17 := *, /* rel 6 features */ + tGSM400BandsSupported := *, /* not present if maskB17 = 0 */ + tGSM400AssocRadioCap := *, /* not present if maskB17 = 0 */ + spare := *, // @sic R5s110176 Baseline Moving sic@ + dlAdvancedRxPerf := *, + dTMEhancCap := *, + mask19 := *, + dTMGPRSHighMultislotClass := *, /* not present if maskB19 = 0 */ + offsetReq := *, /* not present if maskB19 = 0 */ + mask20 := *, /* not present if maskB19 = 0 */ + dTMEGPRSHighMultislotClass := *, /* not present if maskB19 and maskB20 = 0 */ + rptdACCHCap := *, + mask21 := *, + gsm710AssocRadioCap := *, /* not present if maskBit21 = 0 */ + mask22 := *, + tgsm810AssocRadioCap := *, /* not present if maskBit22 = 0 */ + cipheringModeSettingCap := *, + addPositionCap := *, + eutraFDDSupport := *, /* rel 8 features */ + eutraTDDSupport := *, + eutraMeasAndReporting := *, /* @sic R5s100135 Baseline moving sic@ */ + priorityBasedReselection:= *, // @sic R5s110176 Baseline Moving sic@ + utraCSGCellsReporting := *, // @sic R5s110176 Baseline Moving sic@ + vamosLevel := *, // @sic R5s110176 Baseline Moving sic@ + tighterCap := *, // @sic R5s120178 Baseline Moving sic@ + selectCipheringDLSACCH := *, // @sic R5s120178 Baseline Moving sic@ + csPS_SRVCC_G2U := *, // @sic R5s130195 Baseline Moving sic@ + csPS_SRVCC_G2E := *, // @sic R5s130195 Baseline Moving sic@ + geranNwkSharing := *, // @sic R5s150329 Baseline Moving sic@ + eutraWidebandRSRQMeas := *, // @sic R5s150329 Baseline Moving sic@ + erBandSupport := *, // @sic R5s150329 Baseline Moving sic@ + utraMultipleFreqBandInd := *, // @sic R5s150329 Baseline Moving sic@ + eutraMultipleFreqBandInd := *, // @sic R5s150329 Baseline Moving sic@ + xtdTSCSetCap := *, // @sic R5s150329 Baseline Moving sic@ + spareBits2 := * + }; + + template (present) MS_Clsmk3 cdr_MSCLSMK3_EutraCheck (template (omit) IEI8_Type p_IEI) modifies cr_MSCLSMK3_Any := + { /* @status APPROVED (LTE) */ + iei := p_IEI, // @sic R5s110244, R5s140493 sic@ + iel := omit, // @sic R5s110244 sic@ + eutraFDDSupport := ?, + eutraTDDSupport := ? + }; + + template (present) MS_MeasCapability cr_MS_MeasCapability_Any := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + sMS_VALUE := ?, + sM_VALUE := ? + }; + + template (present) MS_NetworkCap cr_MS_NetworkCap_Any := + { /* 24.301 cl. 9.9.3.18 -> 24.008 cl. 10.5.5.12; + @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := '31'O, /* present in case of TV; omit in case of V */ + iel := ?, /* present in case of LV or TLV; omit in case of V */ + gea1 := ?, + smCapDedicated := ?, + smCapGPRS := ?, + ucs2 := ?, + ssScreeningIndicator := ?, + soLSACap := ?, + revLevelIndicator := ?, + pfcFeatureMode := ?, + gea2 := ?, + gea3 := ?, + gea4 := ?, + gea5 := ?, + gea6 := ?, + gea7 := ?, + lcsVACap := ?, + psHOtoUTRAN_IuModeCap := ?, + psHOtoEUTRAN_S1ModeCap := ?, + emmCombinedCap := ?, // @sic R5s110176 Baseline Moving sic@ + isrSupport := ?, + srvccToGERAN_UTRANCap := ?, + epcCap := ?, + nfCap := *, // @sic R5s110176 Baseline Moving R5s110242 sic@ + gERANNtwkShareCap := *, // @sic R5s130195 Baseline Moving sic@ + spareBits := * + }; + + template (present) MS_NetworkCap cdr_MS_NetworkCapAss_lv modifies cr_MS_NetworkCap_Any := + { /* @status APPROVED (IMS, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := omit + }; + + template (present) MS_NetworkFeatureSupport cr_MS_NetworkFeatureSupport(IEI4_Type p_IEI, + template (present) B1_Type p_ExtdPeriodicTimers := ?) := + { /* 24.301 cl. 9.9.2.0A -> 24.008 cl. 10.5.5.15 */ + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := p_IEI, + spare := tsc_Spare3, + extdPeriodicTimers := p_ExtdPeriodicTimers + }; + + template (present) NwkResourceId cr_NwkResourceIdAny (IEI8_Type p_IEI := '10'O) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := p_IEI, + iel := ?, + nriContainerValue := ?, + spareBits := tsc_Spare6 // @sic R5s140778 sic@ + }; + + template (value) PacketFlowIdentifier cs_PktFlowId := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + iei := '34'O, + iel := '01'O, + spare := '0'B, + idValue := '0000000'B // Best effort + }; + + template (value) PLMN_List cs_PLMN_List(NAS_PlmnIdList_Type p_PlmnIdList) := + { /* @status APPROVED (LTE, LTE_A) */ + iei := '4A'O, + iel := int2oct(lengthof(p_PlmnIdList) * 3, 1), + plmnList := p_PlmnIdList + }; + + template (value) PLMN_List cs_PLMN_List_1PLMN(NAS_PlmnId p_Plmn1) := + /* @status APPROVED (LTE, LTE_A) */ + cs_PLMN_List({p_Plmn1}); + + template (value) PLMN_List cs_PLMN_List_2PLMNs(NAS_PlmnId p_Plmn1, + NAS_PlmnId p_Plmn2) := + /* @status APPROVED (LTE, LTE_A) */ + cs_PLMN_List({p_Plmn1, p_Plmn2}); + + template (value) PLMN_List cs_PLMN_List_3PLMNs(NAS_PlmnId p_Plmn1, + NAS_PlmnId p_Plmn2, + NAS_PlmnId p_Plmn3) := + /* @status APPROVED (LTE) */ + cs_PLMN_List({p_Plmn1, p_Plmn2, p_Plmn3}); + + template (value) PLMN_List cs_PLMN_List_4PLMNs(NAS_PlmnId p_Plmn1, + NAS_PlmnId p_Plmn2, + NAS_PlmnId p_Plmn3, + NAS_PlmnId p_Plmn4) := + /* @status APPROVED (LTE) */ + cs_PLMN_List({p_Plmn1, p_Plmn2, p_Plmn3, p_Plmn4}); + + template (value) ProtocolContainer cs_ProtocolContainer_Common(O2_Type p_ContainerId, + integer p_ContainerLength := 0, + template (omit) octetstring p_Content := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + protocolID := p_ContainerId, + protocolLength := int2oct(p_ContainerLength, 1), + content := p_Content + }; + + template (value) ProtocolContainer cs_ProtocolContainer(O2_Type p_ProtocolId, + octetstring p_Content) := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + /* @sic R5s141127 change 4 - MCC160 Comments: cs_ProtocolContainer_Common sic@ */ + cs_ProtocolContainer_Common(p_ProtocolId, lengthof(p_Content), p_Content); + + template (value) ProtocolConfigOptions cs_ProtocolConfigOptions_Common(Type4Length_Type p_Type4Length := '01'O, + template (omit) ProtocolConfigOptions.pco p_ProtocolContainers := omit) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + iei := '27'O, + iel := p_Type4Length, + ext := '1'B, + spare := '0000'B, + configProtocol := '000'B, + pco := p_ProtocolContainers + }; + + template (value) ProtocolConfigOptions cs_ProtocolConfigOptions_PPP := cs_ProtocolConfigOptions_Common; /* @status APPROVED (LTE_IRAT) */ + + /* + * @desc Common function to build up ProtocolConfigOptions acc. to 24.008 cl. 10.5.6.3 + * @param p_ProtocolContainers + * @return template (value) ProtocolConfigOptions + * @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) + */ + function f_NAS_ProtocolConfigOptionsTX(template (value) NAS_ProtocolConfigOptions_Type p_ProtocolContainers) return template (value) ProtocolConfigOptions + { + var integer v_Length := 1; // there are at least ext, spare, configProtocol + var integer i; + + for (i:=0; i < lengthof(p_ProtocolContainers); i:=i+1) { + v_Length := v_Length + oct2int(valueof(p_ProtocolContainers[i].protocolLength)) + 3; // 2 octets for protocolID and 1 octet for protocolLength + } + return cs_ProtocolConfigOptions_Common(int2oct(v_Length, 1), p_ProtocolContainers); + } + + template (value) ProtocolConfigOptions cs_ProtocolConfigOptions_OneOption(template (value) ProtocolContainer p_ProtocolContainer) := + /* @status APPROVED (UTRAN) */ + f_NAS_ProtocolConfigOptionsTX({p_ProtocolContainer}); + + template (value) ProtocolConfigOptions cs_ProtocolConfigOptions_TwoOptions(template (value) ProtocolContainer p_ProtocolContainer1, + template (value) ProtocolContainer p_ProtocolContainer2) := + f_NAS_ProtocolConfigOptionsTX({p_ProtocolContainer1, p_ProtocolContainer2}); + + + template (present) ProtocolConfigOptions cr_ProtocolConfigOptionsAny := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, UTRAN) */ + iei := '27'O, + iel := ?, + ext := '1'B, + spare := '0000'B, + configProtocol := ?, + pco := * // @sic R5s100800 sic@ + }; + + template (value) PTMSI_Signature cs_PTMSI_Signature(octetstring p_Ptmsi) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := '19'O, + iel := omit, + signatureValue := p_Ptmsi + }; + + template (present) PTMSI_Signature cr_PTMSI_Signature(template (present) O3_Type p_PtmsiSig) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := '19'O, + iel := omit, + signatureValue := p_PtmsiSig + }; + + template (present) PTMSI_Signature cr_PTMSI_SignatureAny := + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + cr_PTMSI_Signature(?); + + template (present) PTMSI_Signature cr_PTMSI_Signature2Any := // Only used in Detach Request MO + { /* @status APPROVED (IMS, IMS_IRAT, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := '19'O, + iel := '03'O, + signatureValue := ? + }; + + template (value) QualityOfService cs_QoS_Negotiated_1 := + { /* TS 34.123-3 Table 8.10.2 */ + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + iei := '30'O, + iel := '10'O, + spare1 := '00'B, + delayClass := '100'B, + relabilityClass := '011'B, + peakThroughput := '0100'B, + spare2 := '0'B, + precedenceClass := '011'B, + spare3 := '000'B, + meanThroughput := '11111'B, + trafficClass := '100'B, + deliveryOrder := '10'B, + deliveryErrorSDU := '010'B, + maxSduSize := '00100000'B, + maxBitRateUL := '01000000'B, + maxBitRateDL := '01000000'B, + residualBER := '0111'B, + sduErrorRatio := '0100'B, + transferDelay := '000000'B, + trafficHandlingPrio := '00'B, + guaranteedBitRateUL := '00010000'B, + guaranteedBitRateDL := '00010000'B, + spare4 := '000'B, + signallingInd := '0'B, + sourceStatisticsDescriptor := '0000'B, + maxBitRateDL_Ext := '00000000'B, + guaranteedBitRateDL_Ext := '00000000'B, + maxBitRateUL_Ext := '00000000'B, + guaranteedBitRateUL_Ext := '00000000'B, + maxBitRateDL_Ext2 := omit, // @sic R5s1300195 Baseline Moving sic@ + guaranteedBitRateDL_Ext2 := omit, // @sic R5s1300195 Baseline Moving sic@ + maxBitRateUL_Ext2 := omit, // @sic R5s1300195 Baseline Moving sic@ + guaranteedBitRateUL_Ext2 := omit // @sic R5s1300195 Baseline Moving sic@ + }; + + template (value) QualityOfService cds_QoS_Negotiated_2 modifies cs_QoS_Negotiated_1 := + { /* TS 34.123-3 Table 8.10.2 */ + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + maxSduSize := '10010110'B, + maxBitRateUL := '01001000'B, + maxBitRateDL := '01001000'B, + residualBER := '0100'B, + sduErrorRatio := '0011'B + }; + + template (value) QualityOfService cds_QoS_Negotiated_3 modifies cs_QoS_Negotiated_1 := + { /* TS 34.123-3 Table 8.10.2 */ + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + trafficClass := '001'B, + deliveryErrorSDU := '011'B, + maxSduSize := '10001100'B, + maxBitRateUL := '01101110'B, //432 kbps + maxBitRateDL := '01101110'B, //432 kbps + sduErrorRatio := '0010'B, + transferDelay := '001101'B, + guaranteedBitRateUL := '00000000'B, + guaranteedBitRateDL := '00000000'B + }; + + template (value) QualityOfService cds_QoS_Negotiated_4 (template (omit) IEI8_Type p_IEI := '30'O) modifies cs_QoS_PDP2 := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + relabilityClass := '101'B, + trafficClass := '001'B, + deliveryOrder := '10'B, // @sic R5-133509 sic@ + maxSduSize := '00001111'B, + maxBitRateUL := '01101000'B, + maxBitRateDL := '01101000'B, + residualBER := '0001'B, + sduErrorRatio := '0001'B, + transferDelay := '001000'B, + sourceStatisticsDescriptor := '0001'B + }; + + template (value) QualityOfService cs_QoS_PDP2 (template (omit) IEI8_Type p_IEI := '30'O) := + { /* TS 51.010-1 Table 40.5 */ + // @sic R5s120218 sic@ + /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + iei := p_IEI, + iel := '10'O, + spare1 := '00'B, + delayClass := '100'B, + relabilityClass := '011'B, + peakThroughput := '0101'B, + spare2 := '0'B, + precedenceClass := '010'B, + spare3 := '000'B, + meanThroughput := '10000'B, + trafficClass := '100'B, + deliveryOrder := '01'B, + deliveryErrorSDU := '011'B, + maxSduSize := '10010110'B, + maxBitRateUL := '01001000'B, + maxBitRateDL := '01001000'B, + residualBER := '0111'B, + sduErrorRatio := '0100'B, + transferDelay := '000000'B, + trafficHandlingPrio := '00'B, + guaranteedBitRateUL := '00000000'B, + guaranteedBitRateDL := '00000000'B, + spare4 := '000'B, + signallingInd := '0'B, + sourceStatisticsDescriptor := '0000'B, + maxBitRateDL_Ext := '00000000'B, + guaranteedBitRateDL_Ext := '00000000'B, + maxBitRateUL_Ext := '00000000'B, + guaranteedBitRateUL_Ext := '00000000'B, + maxBitRateDL_Ext2 := omit, // @sic R5s1300195 Baseline Moving sic@ + guaranteedBitRateDL_Ext2 := omit, // @sic R5s1300195 Baseline Moving sic@ + maxBitRateUL_Ext2 := omit, // @sic R5s1300195 Baseline Moving sic@ + guaranteedBitRateUL_Ext2 := omit // @sic R5s1300195 Baseline Moving sic@ + }; + + template (value) QualityOfService cds_QoS_PDP3 (template (omit) IEI8_Type p_IEI := '30'O) modifies cs_QoS_PDP2 := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + relabilityClass := '101'B, + deliveryErrorSDU := '010'B, + residualBER := '0100'B, + sduErrorRatio := '0011'B + }; + + template (value) QualityOfService cds_QoS_Converstational (template (omit) IEI8_Type p_IEI := '30'O) modifies cs_QoS_PDP2 := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + relabilityClass := '101'B, + trafficClass := '001'B, + deliveryOrder := '10'B, // @sic R5-133509 sic@ + maxSduSize := '00001111'B, // @sic R5-120632 sic@ + maxBitRateUL := '01101000'B, + maxBitRateDL := '01101000'B, + residualBER := '0001'B, + sduErrorRatio := '0001'B, + transferDelay := '001000'B + }; + + template (present) TrafficFlowTemplate cr_Tft(template IEI8_Type p_IEI := omit, + template (present) B3_Type p_Code := ?) := + { /* 24.301 cl. 9.9.4.13 -> 24.008 cl. 10.5.6.12 */ + /* @status APPROVED (LTE, UTRAN) */ + iei := p_IEI, /* present in case of TLV; omit in case of LV */ + iel := ?, + tftOperationCode := p_Code, + eBit := ?, + noOfPktFilter := complement ('0000'B), // value must be greater than 0 and <= 16 (only 4 bits) + packetFilterList := ?, + parameterList := * + }; + + template (value) TrafficFlowTemplate cs_TrafficFlowTemplate(integer p_IeLength, + template (value) TrafficFlowTemplate.packetFilterList p_PacketFilterList):= + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, UTRAN) */ + iei := omit, + iel := int2oct(p_IeLength, 1), + tftOperationCode := '001'B, // Create new TFT + eBit := '0'B, // Parameter list not included + noOfPktFilter := int2bit(lengthof(p_PacketFilterList), 4), + packetFilterList := p_PacketFilterList, + parameterList := omit + }; + + // ============================================================================= + // A value of 1 is the highest radio priority level + // ----------------------------------------------------------------------------- + + template (value) RadioPriority cs_RadioPriority (template (omit) IEI4_Type p_IEI, + B3_Type p_Val) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := p_IEI, + spare := '0'B, + levelValue := p_Val + }; + + template (value) RadioPriority cs_RadioPriorityHigh (template (omit) IEI4_Type p_IEI) := cs_RadioPriority (p_IEI, '001'B); /* @status APPROVED (IMS, LTE_A, LTE_IRAT, UTRAN) */ + template (value) RadioPriority cs_RadioPriorityLow (template (omit) IEI4_Type p_IEI) := cs_RadioPriority (p_IEI, '100'B); /* @status APPROVED (LTE_IRAT) */ + + template (present) TMSI_Status cr_TMSI_Status(template (present) TmsiStatusValue p_TmsiStatus := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := '9'H, + spare3 := tsc_Spare3, + flag := p_TmsiStatus + }; + + template (present) UE_NetworkCap cr_UENetworkCap_Any (template (omit) IEI8_Type p_IEI) := + { /* 24.301 cl. 9.9.3.34 + @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := p_IEI, /* present in case of TLV; omit in case of LV */ + iel := ?, /* present in case of LV or TLV; omit in case of V */ + eeaCap := ?, // @sic R5s100135 sic@ + eiaCap := ?, // @sic R5s100135 sic@ + ueaCap := *, // @sic R5s100135 sic@ + uiaCap := *, // @sic R5s100135 sic@ + srvcc_LPP_ProSeCap := *, // @sic R5s100135, R5s150329 Baseline Moving sic@ + proSeCap := *, // @sic R5s150329 Baseline Moving sic@ + spare := * // @sic R5s100135 sic@ + }; + + template (present) VoiceDomainPref cr_VoiceDomainPref_Any := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := ?, // 01111110'B + iel := ?, // length + spareBits := ?, + ueUsageSetting := ?, + voiceDomainPrefEUTRA := ? + }; + + template (value) GPRS_Timer2 cs_GPRS_Timer2_3_IEI(template (omit) IEI8_Type p_IEI, // @sic R5s150329 Baseline Moving sic@ + B3_Type p_Unit, + B5_Type p_Value) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := p_IEI, + iel := '01'O, // length + unit := p_Unit, // Unit + gprsTimerValue := p_Value // Timer value + }; + + template (value) GPRS_Timer3 cs_GprsTimer3(template (omit) IEI8_Type p_IEI := '5E'O, // @sic R5s150745 sic@ + GprsTimerUnit p_Unit, + B5_Type p_Value) := cs_GPRS_Timer2_3_IEI(p_IEI, p_Unit, p_Value); /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS) */ + + template (present) GPRS_Timer2 cr_GPRS_Timer2_3(IEI8_Type p_IEI, // @sic R5s150329 Baseline Moving sic@ + template (present) B3_Type p_Unit := ?, + template (present) B5_Type p_Value := ?) := + { /* @status APPROVED (IMS, IMS_IRAT, LTE, LTE_A, LTE_IRAT, POS, SSNITZ, UTRAN) */ + iei := p_IEI, + iel := '01'O, // length + unit := p_Unit, // Unit + gprsTimerValue := p_Value // Timer value + }; + + template (value) TimeZoneAndTime cs_TimeZoneAndTime (O1_Type p_Year, + O1_Type p_Month, + O1_Type p_Day, + O1_Type p_Hour, + O1_Type p_Minute, + O1_Type p_Second, + O1_Type p_TimeZone):= + { /* @status APPROVED (LTE, SSNITZ) */ + iei := '47'O, // @sic R5s110439 sic@ + year := p_Year, + month := p_Month, + day := p_Day, + hour := p_Hour, + minute := p_Minute, + second := p_Second, + timeZone := p_TimeZone + }; + + template (value) TimeZone cs_TimeZone (O1_Type p_TimeZone):= + { /* @status APPROVED (LTE, SSNITZ) */ + iei := '46'O, + timeZone := p_TimeZone + }; + + template (value) NetworkName cs_NetworkName (IEI8_Type p_Iei, + charstring p_Name, + Gsm7BitPacking_Type p_Packing := SMS_Packing, // default: GSM default 7 + B1_Type p_AddCI := '0'B) := // default: do not include the CI + { /* @status APPROVED (LTE, SSNITZ) */ + iei := p_Iei, + iel := int2oct((lengthof(f_CharPacking_IA5toGsm7Bit(p_Name, p_Packing)) + 1),1), + ext := '1'B, + codingScheme := f_ConvertPackingToCodingScheme (p_Packing), + addCI := p_AddCI, + spareBitCnt := int2bit((lengthof(p_Name) mod 8), 3), // @sic R5s140651 sic@ + text := f_CharPacking_IA5toGsm7Bit(p_Name, p_Packing) + }; + + //---------------------------------------------------------------------------- + /* + * @desc Conversion of the packing type per TS 23.040 into the coding scheme parameter used in the Network Name IE + * @param p_Gsm7BitPacking_Type + * @return B3_Type + * @status APPROVED (LTE, SSNITZ) + */ + function f_ConvertPackingToCodingScheme(Gsm7BitPacking_Type p_Gsm7BitPacking_Type) return B3_Type + { + var B3_Type v_CodingScheme := '000'B; + + if (p_Gsm7BitPacking_Type == SMS_Packing) {v_CodingScheme := '000'B } else {FatalError (__FILE__, __LINE__, "Unexpected Packing for conversion to Coding Scheme")}; + //if (p_Gsm7BitPacking_Type == CBS_Packing) {v_CodingScheme := '000'B }; + //if (p_Gsm7BitPacking_Type == USSD_Packing) {v_CodingScheme := '000'B }; + + return v_CodingScheme; + } + + template (value) DaylightSavingTime cs_DaylightSavingTime_tlv (B2_Type p_DaylightSavingTime) := + { /* 24.301 cl. 9.9.3.6; */ + /* @status APPROVED (LTE, SSNITZ) */ + iei := '49'O, + iel := '01'O, // @sic R5s120508 sic@ + spare := tsc_Spare6, + val := p_DaylightSavingTime + }; + +} diff --git a/IMS_PART4_IWD_15wk38/Common/NAS/NAS_CommonTypeDefs.ttcn b/IMS_PART4_IWD_15wk38/Common/NAS/NAS_CommonTypeDefs.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c27d45b1e2c472f91399764ca7f3c0eb3be05dde --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/NAS/NAS_CommonTypeDefs.ttcn @@ -0,0 +1,897 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-16 16:18:39 +0200 (Wed, 16 Sep 2015) $ +// $Rev: 14465 $ +/******************************************************************************/ + +module NAS_CommonTypeDefs { + /* Module containing type definitions for EPS, UTRAN and/or GERAN */ + + import from CommonDefs all; + + //**************************************************************************** + // Common Type definitions: + //---------------------------------------------------------------------------- + + //**************************************************************************** + //**************************************************************************** + + type O1_Type Octet_Type; + type hexstring HalfOctet_Type length(1); + + type HalfOctet_Type IEI4_Type; /* 4 bit info element identifier for type 1 IEs */ + type Octet_Type IEI8_Type; /* 8 bit info element identifier */ + + type O1_Type Type4Length_Type; + type O2_Type Type6Length_Type; + + type HalfOctet_Type SpareHalfOctet; + + type hexstring NAS_Mcc length(3); //* @desc Type which can be used to represent an MCC (as string of 3 decimal digits). + + type record of hexstring EmergencyNumList; + //**************************************************************************** + // NAS PROTOCOL DEFINITIONS: IEs + //---------------------------------------------------------------------------- + // General Info Elements (24.301 cl. 9) + //---------------------------------------------------------------------------- + + type B4_Type ProtocolDiscriminator; /* 24.301 cl. 9.2 and 24.007 cl. 11.2.3.1.1 */ + type B4_Type SkipIndicator; /* 24.007 cl. 11.2.3.1.2 */ + type B8_Type MessageType; /* 24.301 cl. 9.8 */ + + type B3_Type NAS_AttDetValue_Type; + type B3_Type KeySeq; /* ciphering key sequence + 3G TS 24008 cl. 10.5.1.2 */ + type O3_Type NAS_PlmnId; + + type O4_Type NAS_Tmsi; + type O4_Type NAS_P_Tmsi; + + type O2_Type NAS_Lac; + type O1_Type NAS_Rac; + + type hexstring BcdDigit_Hex length(1); + type bitstring BcdDigit_Bit length(4); + + type B3_Type NAS_IdType; + type B8_Type NAS_CauseValue_Type; + + type B1_Type TmsiStatusValue; + + type enumerated PS_MODE {VOICE_CENTRIC, DATA_CENTRIC}; /* @status @sic R5s120274 sic@ */ + type enumerated CS_PS_MODE {VOICE_CENTRIC, DATA_CENTRIC}; /* @status APPROVED */ + // This is here because it's the best place for it + const NAS_Lac tsc_LAC_Def := '0001'O ; /* Default NAS LAC, the value may need to be updated in CS combined/CS fallback test cases + @status APPROVED + @sic R5s090180 sic@ */ + + + //----------------------------------------------------------------------------- + // Defined in 24.008, but also referenced from 24.301 + //----------------------------------------------------------------------------- + + // ============================================================================= + // Structured Type Definition + // 3G TS 24.008, section 10.5.6.1 + // ----------------------------------------------------------------------------- + type record AccessPointName { /* 24.301 cl. 9.9.4.1 -> 24.008 cl. 10.5.6.1 */ + IEI8_Type iei optional, /* present in case of TLV; omit in case of LV */ + Type4Length_Type iel, + octetstring nameValue length(1..100) + }; + + // ============================================================================= + // Structured Type Definition + // 3G TS 24.008, section 10.5.3.14 + // ----------------------------------------------------------------------------- + type record AddUpdateParams { + IEI4_Type iei optional, + B2_Type spare, // @sic R5s120178 Baseline Moving sic@ + B1_Type csmo, // @sic R5s120178 Baseline Moving sic@ + B1_Type csmt + }; + + type record AdditionalUpdateType { /* 24.301 cl. 9.9.3.0B @sic R5s100135 sic@ */ + IEI4_Type iei, // currently only used as TV + B3_Type spare3, + B1_Type addUpdateTypeValue + }; + + // ============================================================================= + // Structured Type Definition + // Ciphering Key Sequence Number + // 3G TS 24.008 cl. 10.5.1.2 + // ----------------------------------------------------------------------------- + type record CiphKeySeqNum { + IEI4_Type iei optional, // '1000'B + B1_Type spare1, + KeySeq keySeq + }; + + // ============================================================================= + // Structured Type Definition + // Priority Level + // 3G TS 24.008 cl. 10.5.6.19 / 24.301 9.9.4.2A + // ----------------------------------------------------------------------------- + type record ConnectivityType { + IEI4_Type iei, + B4_Type connectivityValue + }; + + // ============================================================================= + // Structured Type Definition + // 3G TS 24.008, section 10.5.5.5/ 24.301 cl. 9.9.3.7 + // ----------------------------------------------------------------------------- + type record DetachType { + // IEI is always skipped + B1_Type switchOff, + NAS_AttDetValue_Type typeOfDetach + }; + + // ============================================================================= + // Structured Type Definition + // Device Properties + // 3G TS 24.008 cl. 10.5.7.8 + // ----------------------------------------------------------------------------- + type record DeviceProperties { + IEI4_Type iei, + B3_Type spare, + B1_Type lowPriority + }; + + // ============================================================================= + // Structured Type Definition + // DRX paramter + // 3GPP 24.008 / 10.5.5.6 + // ----------------------------------------------------------------------------- + type record DRXparameter { + IEI8_Type iei optional, // '00100111'B (hex 27) + B8_Type splitPGcycleCode, // Split PG cycle code + B4_Type cnDRXcoef, // CN specific DRX cycle length coefficient + B1_Type splitOnCCCH, // Split on CCCCH + B3_Type nonDRXtimer // non-DRX timer + }; + + // ============================================================================= + // Structured Type Definition + // Emergency Service Category + // 3GPP 24.008 / 10.5.4.33 + // ----------------------------------------------------------------------------- + type record EmergServCat { + B1_Type spare, + B7_Type emergSCValue // Emergency Service Category value + }; + + type record length (1..10) of charstring EmergencyLocalNumberList; + // ============================================================================= + // Structured Type Definition + // Emergency Number + // 3G TS 24.008 cl. 10.5.3.13 + // ----------------------------------------------------------------------------- + type record EmergNum { + Type4Length_Type len, // length + EmergServCat emergServCat, // Emergency Service Category + octetstring digits length(0..10) // BCD numbers + }; + + // ============================================================================= + // Structured Type Definition + // Emergency Number List + // 3G TS 24.008 cl. 10.5.3.13 + // ----------------------------------------------------------------------------- + type record EmergNumList { + IEI8_Type iei, // '00110100'B (34 hex) @sic R5s110420 sic@ + Type4Length_Type iel, // length @sic R5s110420 sic@ + record length (1..10) of EmergNum emergNum // Emergency Number + }; + + // ============================================================================= + // Structured Type Definition + // GPRS timer + // 3GPP 24.008 / 10.5.7.3 + // ----------------------------------------------------------------------------- + type record GPRS_Timer { /* 24.301 cl. 9.9.3.14 -> 24.008 cl. 10.5.7.3 */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + GprsTimerUnit unit, + B5_Type timerValue + }; + + type B3_Type GprsTimerUnit; + + // ============================================================================= + // Structured Type Definition + // GPRS timer 2 or GPRS timer 3 (definition is identical) + // 3GPP 24.008 / 10.5.7.4(a) + // ----------------------------------------------------------------------------- + type record GPRS_Timer2 { + IEI8_Type iei optional, // @sic R5s110420 sic@ + Type4Length_Type iel, // length @sic R5s110420 sic@ + GprsTimerUnit unit, // Unit + B5_Type gprsTimerValue // Timer value + }; + + type GPRS_Timer2 GPRS_Timer3; // definition is identical @sic R5s150329 Baseline Moving sic@ + + // ============================================================================= + // Structured Type Definition + // IMEISV Request + // 3GPP 24.008 / 10.5.5.10 + // ----------------------------------------------------------------------------- + type record IMEISV_Request { /* 24.301 cl. 9.9.3.16 -> 24.008 cl. 10.5.5.10 */ + IEI4_Type iei optional, /* present in case of TV; omit in case of V */ + B1_Type spare, + B3_Type requestValue + }; + + // ============================================================================= + // Structured Type Definition + // Location Area Identification Value + // 3G TS 24.008 cl. 10.5.1.3 + // ----------------------------------------------------------------------------- + type record LocAreaId { + IEI8_Type iei optional, + NAS_PlmnId plmn, // MCC + MNC 3 digits each + NAS_Lac lac // LAC + }; + + // ============================================================================= + // Structured Type Definition + // RoutingAreaId + // 3GPP 24.008 / 10.5.5.15 + // ----------------------------------------------------------------------------- + type record RoutingAreaId { /* 24.301 cl. 9.9.3.24 -> 24.008 cl. 10.5.5.15 */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + LocAreaId lai, /* MCC + MNC + LAC */ + O1_Type rac /* RAC */ + }; + + // ============================================================================= + // Structured Type Definition + // 24.007, clause 10.5.6.9 + // ----------------------------------------------------------------------------- + type record LLC_SAPI { /* 24.301 cl. 9.9.4.4 -> 24.008 cl. 10.5.6.9 */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + B4_Type spare, + B4_Type llcSapiValue + }; + + // ============================================================================= + // Structured Type Definition + // Mobile Identity + // 3G TS 24.008 cl. 10.5.1.4 + // Maximum number of digits is 16 (IMEISV). Filler may be used. + // ----------------------------------------------------------------------------- + type record MobileIdentity { + IEI8_Type iei optional, // '00100011'B + Type4Length_Type iel, + BcdDigit_Bit idDigit1, // 1st identitity digit + B1_Type oddEvenInd, // Odd/even indicator + NAS_IdType typeOfId, // Type of identity + octetstring otherDigits length(0..10) // Other identity digits (10 octets rather than 8 to cover Guti as well) + }; + + // ============================================================================= + // Structured Type Definition + // Mobile Station Classmark 2 + // 3G TS 24.008 cl. 10.5.1.6 + // ----------------------------------------------------------------------------- + type record MS_Clsmk2 { + IEI8_Type iei optional, + Type4Length_Type iel, // @sic R5s110420 sic@ + B1_Type spare1_1, // Spare bit + B2_Type revLvl, // Revision Level + B1_Type eSIND, // Early Sending Indication + B1_Type a5_1, // Algorithm A5/1 Support + B3_Type rFPwrCap, // RF Power Capability + B1_Type spare1_2, // Spare bit + B1_Type pSCap, // Pseudo Synchronisation Capability + B2_Type sSSI, // SS Screen Indicator + B1_Type sMCap, // Short Message Capability + B1_Type vBS, // VBS Capability + B1_Type vGCS, // VGCS Capability + B1_Type fC, // Frequency Capability + B1_Type cM3, // Classmark 3 Indicator + B1_Type spare1_3, // Spare bit + B1_Type lCSVA, // LCS VA Capability + B1_Type uCS2, // UCS2 Encoding Support + B1_Type soLSA, // SoLSA Support + B1_Type cMSP, // CM Service Prompt Support + B1_Type a5_3, // Algorithm A5/3 Support + B1_Type a5_2 // Algorithm A5/2 Support + }; + + // ============================================================================= + // Structured Type Definition + // Mobile station classmark 3 + // 3GPP TS 24.008 clause 10.5.1.7 + // The information element has 34 octets maximum length + // ----------------------------------------------------------------------------- + type record MS_Clsmk3 { + IEI8_Type iei optional, // 0x20 + Type4Length_Type iel optional, // OCTETSTRING [1] + B1_Type spareBit, // spare bit @sic R5s120178 Baseline Moving sic@ + B3_Type multibandSupported, // @sic R5s120178 Baseline Moving sic@ + B1_Type a5_7, // a5/7 algorithm supported @sic R5s120178 Baseline Moving sic@ + B1_Type a5_6, // a5/6 algorithm supported @sic R5s120178 Baseline Moving sic@ + B1_Type a5_5, // a5/5 algorithm supported @sic R5s120178 Baseline Moving sic@ + B1_Type a5_4, // a5/4 algorithm supported @sic R5s120178 Baseline Moving sic@ + B4_Type associatedRadioCapabilty2 optional, // present if multibandSupported = 101 or 110 + B4_Type spareBits1 optional, // present if multibandSupported = 001 or 010 or 100 + B4_Type associatedRadioCapabilty1 optional, // present if multibandSupported = 001 or 010 or 100 or 101 or 110 + B1_Type maskBit1 optional, + B3_Type rGSM_RadioCapability optional, // R-GSM band associated radio capability not present if maskBit1 = 0 + B1_Type maskBit2 optional, + B5_Type multiSlotClass optional, // multi slot class not present if multiSlotClass = 0 + B1_Type uCS2Treatment optional, + B1_Type extMeasurementCapability optional, // extended measurement capability + B1_Type maskBit3 optional, + MS_MeasCapability msMeasurementCapability optional, // MS measurement capability + // not present if maskBit3 = 0 + B1_Type maskBit4 optional, + B5_Type msPositioningMethod optional, // MS positioning method capability + // not present if maskBit4 = 0 + B1_Type maskBit5 optional, + B5_Type eDGE_MultiSlot optional, // EDGE multi slot capability + // not present if maskB5_Type = 0 + B1_Type maskBit6 optional, + EDGE_Struct psk8_Struct optional, // 8PSK struct + // not present if maskB6_Type = 0 + B1_Type maskBit7 optional, + B2_Type gSM400BandsSupported optional, // not present if maskBIt7 = 0 + B4_Type gSM400AssociatedRadioCapability optional, // not present if gSM400BandsSupported = 00 or maskB7_Type = 0 + B1_Type maskBit8 optional, + B4_Type gSM850AssociatedRadiioCapability optional, // not present if maskBIt8 = 0 + B1_Type maskBit9 optional, + B4_Type pCS1900AssociatedRadiioCapability optional, // not present if maskBIt9 = 0 + B1_Type uMTS_FDD_RAT_Capability optional, + B1_Type uMTS384TDD_RAT_Capability optional, + B1_Type cDMA2000_RAT_Capability optional, + B1_Type maskBit10 optional, + B2_Type dTM_GPRS_MultiSlotSubclass optional, // not present if maskBit10 = 0 + B1_Type singleSlotDTM optional, // not present if maskBit10 = 0 + B1_Type maskBit11 optional, // not present if maskBit10 = 0 + B2_Type dTM_EGPRS_MultiSlorSubclass optional, // not present if maskBit10 = 0 or maskBit11 = 0 + B1_Type maskBit12 optional, + B4_Type singleBandSupport optional, // not present if maskBit12 = 0 + B1_Type maskBit13 optional, + B4_Type gSM700AssociatedRadioCapability optional, // not present if maskBit13 = 0 + B1_Type uMTS128TDD_RAT_Capability optional, + B1_Type gERANFeatPack1 optional, + B1_Type mask14 optional, + B2_Type extDTM_GPRS_MultiSlotSubclass optional, // not present if maskBit14 = 0 + B2_Type etxDTM_EGPRS_MultiSlotSubclass optional, // not present if maskBit14 = 0 + B1_Type mask15 optional, + B2_Type highMultislotCap optional, // not present if mask15 = 0 + B1_Type spare2 optional, // value '1' indicated GERAN Iu Mode Capabilities in earlier versions @sic R5s150329 Baseline Moving sic@ + B1_Type gERANFeatPack2 optional, + B2_Type gMSKMultislotPowerProfile optional, + B2_Type pSKMultislotPowerProfile optional, + B1_Type mask17 optional, // rel 6 features + B2_Type tGSM400BandsSupported optional, // not present if maskBit17 = 0 + B4_Type tGSM400AssocRadioCap optional, // not present if maskBit17 = 0 + B1_Type spare optional, // Set to 0 @sic R5s110176 Baseline Moving sic@ + B2_Type dlAdvancedRxPerf optional, + B1_Type dTMEhancCap optional, + B1_Type mask19 optional, + B3_Type dTMGPRSHighMultislotClass optional, // not present if maskBit19 = 0 + B1_Type offsetReq optional, // not present if maskBit19 = 0 + B1_Type mask20 optional, // not present if maskBit19 = 0 + B3_Type dTMEGPRSHighMultislotClass optional, // not present if maskBit19 and maskBit20 = 0 + B1_Type rptdACCHCap optional, + B1_Type mask21 optional, + B4_Type gsm710AssocRadioCap optional, // not present if maskBit21 = 0 + B1_Type mask22 optional, + B4_Type tgsm810AssocRadioCap optional, // not present if maskBit22 = 0 + B1_Type cipheringModeSettingCap optional, + B1_Type addPositionCap optional, + B1_Type eutraFDDSupport optional, // rel 8 features + B1_Type eutraTDDSupport optional, + B1_Type eutraMeasAndReporting optional, // @sic R5s100135 sic@ + B1_Type priorityBasedReselection optional, // @sic R5s110176 Baseline Moving sic@ + B1_Type utraCSGCellsReporting optional, // @sic R5s110176 Baseline Moving sic@ + B2_Type vamosLevel optional, // @sic R5s110176 Baseline Moving sic@ + B2_Type tighterCap optional, // @sic R5s120178 Baseline Moving sic@ + B1_Type selectCipheringDLSACCH optional, // @sic R5s120178 Baseline Moving sic@ + B2_Type csPS_SRVCC_G2U optional, // @sic R5s130195 Baseline Moving sic@ + B2_Type csPS_SRVCC_G2E optional, // @sic R5s130195 Baseline Moving sic@ + B1_Type geranNwkSharing optional, // @sic R5s150329 Baseline Moving sic@ + B1_Type eutraWidebandRSRQMeas optional, // @sic R5s150329 Baseline Moving sic@ + B1_Type erBandSupport optional, // @sic R5s150329 Baseline Moving sic@ + B1_Type utraMultipleFreqBandInd optional, // @sic R5s150329 Baseline Moving sic@ + B1_Type eutraMultipleFreqBandInd optional, // @sic R5s150329 Baseline Moving sic@ + B1_Type xtdTSCSetCap optional, // @sic R5s150329 Baseline Moving sic@ + bitstring spareBits2 optional + }; + + // ============================================================================= + // Structured Type Definition + // Reference : 3GPP TS 24.008 clause 10.5.1.7 + // ----------------------------------------------------------------------------- + type record EDGE_Struct { + B1_Type modulationCapability, + B1_Type pwrMask1, + B2_Type eDGE_RF_PowerCapability1 optional, // not present if pwrMask1 = 0 + B1_Type pwrMask2, + B2_Type eDGE_RF_PowerCapability2 optional // not present if pwrMask2 = 0 + }; + + // ============================================================================= + // Structured Type Definition + // Reference : 3GPP TS 24.008 clause 10.5.1.7 + // ----------------------------------------------------------------------------- + type record MS_MeasCapability { + B4_Type sMS_VALUE, + B4_Type sM_VALUE + }; + + // ============================================================================= + // Structured Type Definition + // MS network capability + // 3GPP 24.008 / 10.5.5.12 + // ----------------------------------------------------------------------------- + type record MS_NetworkCap { /* 24.301 cl. 9.9.3.18 -> 24.008 cl. 10.5.5.12 */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + Type4Length_Type iel, // @sic R5s110420 sic@ + B1_Type gea1, + B1_Type smCapDedicated, + B1_Type smCapGPRS, + B1_Type ucs2, + B2_Type ssScreeningIndicator, + B1_Type soLSACap, + B1_Type revLevelIndicator, + B1_Type pfcFeatureMode, + B1_Type gea2, + B1_Type gea3, + B1_Type gea4, + B1_Type gea5, + B1_Type gea6, + B1_Type gea7, + B1_Type lcsVACap optional, // @sic R5s130477 not present for r99 sic@ + B1_Type psHOtoUTRAN_IuModeCap optional, // @sic R5s130477 not present for r99 sic@ + B1_Type psHOtoEUTRAN_S1ModeCap optional, // @sic R5s130477 not present for r99 sic@ + B1_Type emmCombinedCap optional, // @sic R5s110176 Baseline Moving, R5s130477 not present for r99 sic@ + B1_Type isrSupport optional, // @sic R5s130477 not present for r99 sic@ + B1_Type srvccToGERAN_UTRANCap optional, // @sic R5s130477 not present for r99 sic@ + B1_Type epcCap optional, // @sic R5s130477 not present for r99 sic@ + B1_Type nfCap optional, // @sic R5s110176 Baseline Moving, not present for Rel-8 R5s110242 sic@ + B1_Type gERANNtwkShareCap optional, // @sic R5s130195 Baseline Moving, not present for Rel-8 sic@ + bitstring spareBits length (0..43) optional + }; + + // ============================================================================= + // Structured Type Definition + // Additional Network Feature Support + // 3G TS 24.008 cl. 10.5.5.31 + // ----------------------------------------------------------------------------- + type record NwkResourceId { + IEI8_Type iei, // + Type4Length_Type iel, // + B10_Type nriContainerValue, // @sic R5s140778 sic@ + B6_Type spareBits // @sic R5s140778 sic@ + }; + + // ============================================================================= + // Structured Type Definition + // PacketFlowIdentifier + // 24.008, section 10.5.6.11 + // ----------------------------------------------------------------------------- + type record PacketFlowIdentifier { /* 24.301 cl. 9.9.4.5 -> 24.008 cl. 10.5.6.11 */ + IEI8_Type iei, // @sic R5s110420 sic@ + Type4Length_Type iel, // @sic R5s110420 sic@ + B1_Type spare, + B7_Type idValue + }; + + // ============================================================================= + // Structured Type Definition + // PLMN list + // 3G TS 24.008 cl. 10.5.1.13 + // ----------------------------------------------------------------------------- + type record PLMN_List { /* 24.301 cl. 9.9.2.4 -> 24.008 cl. 10.5.1.13 */ + IEI8_Type iei, // @sic R5s110420 sic@ + Type4Length_Type iel, // @sic R5s110420 sic@ + record length(1..15) of + NAS_PlmnId plmnList /* list of PLMNs */ + }; + + // ============================================================================= + // Structured Type Definition + // MS network feature support + // 3GPP 24.008 / 10.5.5.15 + // ----------------------------------------------------------------------------- + type record MS_NetworkFeatureSupport { /* 24.301 cl. 9.9.2.0A -> 24.008 cl. 10.5.5.15 */ + IEI4_Type iei, + B3_Type spare, + B1_Type extdPeriodicTimers + }; + + type PLMN_List.plmnList NAS_PlmnIdList_Type; + + // ============================================================================= + // Structured Type Definition + // ProtocolConfigOptions + // 3G TS 24.008 cl. 10.5.6.3 + // ----------------------------------------------------------------------------- + type record ProtocolConfigOptions { /* 24.301 cl. 9.9.4.8 -> 24.008 cl. 10.5.6.3 */ + IEI8_Type iei, // @sic R5s110420 sic@ + Type4Length_Type iel, + B1_Type ext, + B4_Type spare, + B3_Type configProtocol, + record length (0..83) of + ProtocolContainer pco optional + }; + + type record ProtocolContainer { + O2_Type protocolID, /* id is always 2 octets */ + Type4Length_Type protocolLength, + octetstring content optional + }; + + type ProtocolConfigOptions.pco NAS_ProtocolConfigOptions_Type; + + // ============================================================================= + // Structured Type Definition + // P-TMSI signature + // 3GPP 24.008 / 10.5.5.8 + // ----------------------------------------------------------------------------- + type record PTMSI_Signature { /* 24.301 cl. 9.9.3.23 -> 24.008 cl. 10.5.5.8 */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + Type4Length_Type iel optional, // only present in 24.008 version of DETACH REQUEST message + O3_Type signatureValue + }; + + // ============================================================================= + // Structured Type Definition + // 24.008, clause 10.5.6.5 + // ----------------------------------------------------------------------------- + type record QualityOfService { /* 24.301 cl. 9.9.4.9 -> 24.008 cl. 10.5.6.5 */ + IEI8_Type iei optional, /* present in case of TLV; omit in case of LV */ + Type4Length_Type iel, + B2_Type spare1, + B3_Type delayClass, + B3_Type relabilityClass, + B4_Type peakThroughput, + B1_Type spare2, + B3_Type precedenceClass, + B3_Type spare3, + B5_Type meanThroughput, + B3_Type trafficClass, + B2_Type deliveryOrder, + B3_Type deliveryErrorSDU, + B8_Type maxSduSize, + B8_Type maxBitRateUL, + B8_Type maxBitRateDL, + B4_Type residualBER, + B4_Type sduErrorRatio, + B6_Type transferDelay, + B2_Type trafficHandlingPrio, + B8_Type guaranteedBitRateUL, + B8_Type guaranteedBitRateDL, + B3_Type spare4, + B1_Type signallingInd, + B4_Type sourceStatisticsDescriptor, + B8_Type maxBitRateDL_Ext optional, + B8_Type guaranteedBitRateDL_Ext optional, + B8_Type maxBitRateUL_Ext optional, + B8_Type guaranteedBitRateUL_Ext optional, + B8_Type maxBitRateDL_Ext2 optional, // @sic R5s1300195 Baseline Moving sic@ + B8_Type guaranteedBitRateDL_Ext2 optional, // @sic R5s1300195 Baseline Moving sic@ + B8_Type maxBitRateUL_Ext2 optional, // @sic R5s1300195 Baseline Moving sic@ + B8_Type guaranteedBitRateUL_Ext2 optional // @sic R5s1300195 Baseline Moving sic@ + }; + + // ============================================================================= + // Structured Type Definition + // Radio priority + // 3GPP 24.008 / 10.5.7.2 + // ----------------------------------------------------------------------------- + type record RadioPriority { /* 24.301 cl. 9.9.4.10 -> 24.008 cl. 10.5.7.2 */ + IEI4_Type iei optional, /* present in case of TV; omit in case of V */ + B1_Type spare, + B3_Type levelValue + }; + + // ============================================================================= + // Structured Type Definition + // Codec + // 3G TS 24.008 cl. 10.5.4.32 + // ----------------------------------------------------------------------------- + type record Codec { + O1_Type sysId, // system identifcation + Type4Length_Type len, // length + B8_Type bitMap1to8, // codec bitmap bits 1-8 + B8_Type bitMap9to16 optional // codec bitmap bits 9-16 + }; + + // ============================================================================= + // Structured Type Definition + // Supported Codec List + // 3G TS 24.008 cl. 10.5.4.32 + // ----------------------------------------------------------------------------- + type record CodecList { + IEI8_Type iei, // '01000000'B (40 hex) @sic R5s110420 sic@ + Type4Length_Type iel, // length @sic R5s110420 sic@ + record of Codec codec// list of codecs + }; + + // ============================================================================= + // Structured Type Definition + // TMSI status + // 3GPP 24.008 cl. 10.5.6.17 + // ----------------------------------------------------------------------------- + type record Request_Type { /* 24.301 cl. 9.9.4.11 */ + // IEI is always skipped + B1_Type spare, + B3_Type typeValue + }; + + // ============================================================================= + // Structured Type Definition + // TMSI status + // 3GPP 24.008 cl. 10.5.5.4 + // ----------------------------------------------------------------------------- + type record TMSI_Status { + IEI4_Type iei optional, + B3_Type spare3, + TmsiStatusValue flag // Flag + }; + + // ============================================================================= + // Structured Type Definition + // TrafficFlowTemplate + // 3GPP 24.008 / 10.5.6.12 + // ----------------------------------------------------------------------------- + type record TrafficFlowTemplate { /* 24.301 cl. 9.9.4.13 -> 24.008 cl. 10.5.6.12 */ + IEI8_Type iei optional, /* present in case of TLV; omit in case of LV */ + Type4Length_Type iel, + B3_Type tftOperationCode, + B1_Type eBit, + B4_Type noOfPktFilter, + record of PacketFilter packetFilterList optional, + record of TftParameter parameterList optional + }; + + type record TftParameter { + IEI8_Type iei, + Type4Length_Type iel, + octetstring contents + }; + + type record PacketFilter { + B2_Type spare, // @sic R5s130195 Baseline Moving sic@ + B2_Type direction, // @sic R5s130195 Baseline Moving sic@ + IEI4_Type iei, // @sic R5s130195 Baseline Moving sic@ + B8_Type precedence optional, + Type4Length_Type iel optional, + PacketFilterContents contents optional + }; + + type record of PacketFilterComponent PacketFilterContents; + + type record PacketFilterComponent { + O1_Type id, + PacketFilterComponentValue packetFilterComponentValue + }; + + type union PacketFilterComponentValue { + O8_Type ipv4RemoteAddress, + O32_Type ipv6RemoteAddress, + O1_Type protocolIdNextHeader, + O2_Type singleLocalPort, + O4_Type localPortRange, + O2_Type singleRemotePort, + O4_Type remotePortRange, + O4_Type securityParameterIndex, + O2_Type typeOfServiceTrafficClass, + O3_Type flowLabel + }; + + type record UE_NetworkCap { // 24.301 cl. 9.9.3.34 + IEI8_Type iei optional, /* present in case of TLV; omit in case of LV */ + Type4Length_Type iel optional, /* present in case of LV or TLV; omit in case of V */ + O1_Type eeaCap, // @sic R5s100135 sic@ + O1_Type eiaCap, // @sic R5s100135 sic@ + O1_Type ueaCap optional, // @sic R5s100135 sic@ + O1_Type uiaCap optional, // @sic R5s100135 sic@ + O1_Type srvcc_LPP_ProSeCap optional, // @sic R5s150329 Baseline Moving sic@ + O1_Type proSeCap optional, // @sic R5s150329 Baseline Moving sic@ + octetstring spare optional // @sic R5s100135 sic@ + }; + + type record ReAttemptIndicator { // 24.301 cl. 9.9.4.13A, 24.008 cl. 10.5.6.5A + // The two definitions are exactly the same. + // The only difference is the meaning of the ratcValue bit + IEI8_Type iei optional, /* present in case of TLV; omit in case of LV */ + Type4Length_Type iel optional, /* present in case of LV or TLV; omit in case of V */ + B7_Type spare, + B1_Type ratcValue +}; + + // ============================================================================= + // Structured Type Definition + // Authentication Parameter AUTN + // 3G TS 24.008 cl. 10.5.3.1.1 + // ----------------------------------------------------------------------------- + type record AUTN { /* 24.301 cl. 9.9.3.2 -> 24.008 cl. 10.5.3.1.1 */ + IEI8_Type iei optional, /* present in case of TLV; omit in case of LV */ + Type4Length_Type iel, // @sic R5s110420 sic@ + B128_Type aUTN /* (as for UMTS) */ + }; + + // ============================================================================= + // Structured Type Definition + // Authentication Failure Parameter (TLV) + // 3G TS 24.008 cl. 10.5.3.2.2 + // ----------------------------------------------------------------------------- + type record AuthenticationFailureParameter { + IEI8_Type iei, // '00100010'B for MM (22 hex) + // '00110000'B for GMM (30 hex) + Type4Length_Type iel, // M 1 octet + B112_Type auts // AUTS, 14 octets + }; + + // ============================================================================= + // Structured Type Definition + // Authentication Parameter RAND (TV, 17 octets) + // 3G TS 24.008 cl. 10.5.3.1 + // ----------------------------------------------------------------------------- + type record RAND { + IEI8_Type iei optional, // '00100001'B (21 hex) + B128_Type randValue // Authentication Parameter RAND value + }; + + type record DaylightSavingTime { /* 24.301 cl. 9.9.3.5 -> 24.008 cl. 10.5.3.12 */ + IEI8_Type iei optional, /* present in case of TLV; omit in case of LV */ + Type4Length_Type iel optional, /* present in case of LV or TLV; omit in case of V */ + B6_Type spare, + B2_Type val + }; + + type record NetworkName { /* 24.301 cl. 9.9.3.21 -> 24.008 cl. 10.5.3.5a */ + IEI8_Type iei optional, /* present in case of TLV; omit in case of LV */ + Type4Length_Type iel, + B1_Type ext, + B3_Type codingScheme, + B1_Type addCI, + B3_Type spareBitCnt, + octetstring text + }; + + type record TimeZone { /* 24.301 cl. 9.9.3.26 -> 24.008 cl. 10.5.3.8 */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + O1_Type timeZone + }; + + type record TimeZoneAndTime { /* 24.301 cl. 9.9.3.27 -> 24.008 cl. 10.5.3.9 */ + IEI8_Type iei optional, /* present in case of TV; omit in case of V */ + O1_Type year, + O1_Type month, + O1_Type day, + O1_Type hour, + O1_Type minute, + O1_Type second, + O1_Type timeZone + }; + + // ============================================================================= + // Structured Type Definition + // 3G TS 24.008 cl. 10.5.5.28 + // @sic R5s110176 Baseline Moving sic@ + // ----------------------------------------------------------------------------- + type record VoiceDomainPref { + IEI8_Type iei optional, // 01111110'B + Type4Length_Type iel optional, // length + B5_Type spareBits, + B1_Type ueUsageSetting, + B2_Type voiceDomainPrefEUTRA // @sic R5s110233 sic@ + }; + + type record IdentityType { /* 24.301 cl. 9.9.3.15 -> 24.008 cl. 10.5.3.4 */ + // IEI is always skipped + B1_Type spare, + NAS_IdType typeOfId + }; + + // ============================================================================= + // Structured Type Definition + // REGISTER + // ue->n or n->ue, 3GPPP TS 24.080, 2.4 + // ----------------------------------------------------------------------------- + type record REGISTER { + TI ti, // transaction identifier BITSTRING [4] + ProtocolDiscriminator sS_ProtocolDiscriminator, // "1011" Protocol discriminator for supplementary services BITSTRING [4] + MessageType msgType, // message type BITSTRING [8] + FacilityIE facility_Str, // M, BER enconded ASN.1 object + SS_VersionInd sS_VersionInd optional // O for ue->n, N/A for n->ue + }; + + // ============================================================================= + // Structured Type Definition + // FACILITY + // n->ue, 3GPPP TS 24.080, 2.3 and 24.008, 10.4 + // ----------------------------------------------------------------------------- + type record FACILITY { + TI ti, // transaction identifier BITSTRING [4] + ProtocolDiscriminator sS_ProtocolDiscriminator, // "1011" Protocol discriminator for supplementary services BITSTRING [4] + MessageType msgType, // message type BITSTRING [8], for n->ue "00111010", for ue->n "xx111010" (see 24.007) + FacilityIE facility_Str // M, BER enconded ASN.1 object + }; + + // ============================================================================= + // Structured Type Definition + // FACILITY + // ue->n 3GPPP TS 24.080, 2.3 and 24.008, 10.4 + // ----------------------------------------------------------------------------- + type record FACILITYul { + TI ti, // transaction identifier BITSTRING [4] + ProtocolDiscriminator sS_ProtocolDiscriminator, // "1011" Protocol discriminator for supplementary services BITSTRING [4] + MessageType msgType, // message type BITSTRING [8], for n->ue "00111010", for ue->n "xx111010" (see 24.007) + FacilityIE facility_Str, // M, BER enconded ASN.1 object + SS_VersionInd sS_VersionInd optional // O @sic R5s140989 sic@ + }; + // ============================================================================= + // Structured Type Definition + // Facility Information Element + // 3GPPP TS 24.080, 3.6 / 24.008, 10.5.4.15 + // ----------------------------------------------------------------------------- + type record FacilityIE { + IEI8_Type iei optional, // Facility IE identifier + Type4Length_Type iel, // length of Facility contents + octetstring components // ASN.1 definitions BER encoded + }; + + // ============================================================================= + // Structured Type Definition + // Transaction identifier + // 3G TS 24.007 cl. 11.2.3.1.3 + // ----------------------------------------------------------------------------- + type record TI { + B1_Type tiFlag, // Flag + B3_Type tiVal // TIO + }; + + // ============================================================================= + // Structured Type Definition + // SS version indicator + // 3G TS 24.008 cl. 10.5.4.24 + // 1. Usually this IE has only one octet of content. + // Exact definition see TS 24.080 + // ----------------------------------------------------------------------------- + type record SS_VersionInd { + IEI8_Type iei, // '01111111'B @sic R5s110420 sic@ + Type4Length_Type iel, // length @sic R5s110420 sic@ + O1_Type sS_VersionInfo // ss version information + }; + + // ============================================================================= + // Structured Type Definition + // RESETUEPOSITIONINGSTOREDINFORMATION + // n->ue, 3GPPP TS 34.109, 6.10/36.509 6.9 + // ----------------------------------------------------------------------------- + type record RESETUEPOSITIONINGSTOREDINFORMATION { + SkipIndicator skipIndicator, // "0000" skip indicator BITSTRING [4] + ProtocolDiscriminator protocolDiscriminator, // M, "1111" Protocol discriminator for test procedure messages BITSTRING [4] + MessageType msgType, // M, message type BITSTRING [8] + B8_Type uePositioningTech // M, BITSTRING [8] + }; + + // ============================================================================= + // Structured Type Definition + // WLANOffloadAcceptability + // 3GPPP TS 24.008 10.5.6.20 + // ----------------------------------------------------------------------------- + type record WLANOffloadAcceptability { + IEI4_Type iei, + B2_Type spare, + B1_Type utranOffload, + B1_Type eutranOffload +}; + +} with { encode "NAS Types" } diff --git a/IMS_PART4_IWD_15wk38/Common/NAS/SMS_Templates.ttcn b/IMS_PART4_IWD_15wk38/Common/NAS/SMS_Templates.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0b05c693cff65a6218a8546dbbcd4b63e7bb2e48 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/NAS/SMS_Templates.ttcn @@ -0,0 +1,482 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-07 11:40:07 +0200 (Mon, 07 Sep 2015) $ +// $Rev: 14197 $ +/******************************************************************************/ + +module SMS_Templates { + + import from CommonDefs all; + import from SMS_TypeDefs all; + + template (value) TransactionIdentifier_Type cs_MT_TI0_FromSS := + { /* @status APPROVED (LTE) */ + tI_Flag := '0'B, + tI_Value := '000'B + }; + + template (present) TransactionIdentifier_Type cr_MT_TI0_FromUE := + { /* @status APPROVED (LTE) */ + tI_Flag := '1'B, + tI_Value := '000'B + }; + + template (present) TransactionIdentifier_Type cr_MO_AnyTI_FromUE := + { /* @status APPROVED (LTE) */ + tI_Flag := '0'B, + tI_Value := '???'B + }; + + template (present) TypeOfNumberingPlan cr_TypeOfNumberingPlanAny := + { /* @status APPROVED (IMS, LTE) */ + extBit := ?, + typeOfNumber := ?, + numberingPlanId := ? + }; + + template (value) TypeOfNumberingPlan cs_TypeOfNumberingPlan := + { /* @status APPROVED (IMS, LTE) */ + extBit := '1'B, + typeOfNumber := '001'B, // international number + numberingPlanId := '0001'B // ISDN/telephony numbering plan (Rec. E.164/E.163) + }; + + template (present) TypeOfNumberingPlan cr_TypeOfNumberingPlan := + { /* @status APPROVED (IMS, LTE) */ + extBit := ?, + typeOfNumber := ?, + numberingPlanId := ? + }; + + /* End Non-SMS Type Constraints */ + + /* SM-CP Type Constraints */ + /* template (omit) CP_UserData_Type cs_CP_UserData (RP_PDU_Type p_RP_PDU, */ + /* integer p_Length) := */ + /* { */ + /* spare := omit, */ + /* iei := omit, */ + /* iel := int2oct (p_Length,1), // size of p_RP_PDU in octets, provided by the caller */ + /* rP_PDU := p_RP_PDU */ + /* }; */ + + + template (omit) CP_UserData_Type cs_CP_UserData_DELIVER (octetstring p_Digits):= + { /* @status APPROVED (LTE) */ + spare := omit, + iei := omit, + iel := int2oct ((162 + lengthof (p_Digits)), 1), // 162 = 153 + 1 + 5 + 3=size of cs_RP_OriginatorAddress_dl + rP_PDU := {RP_DATA_dl := cs_RP_DATA_dl_DELIVER (p_Digits)} + }; + + template (omit) CP_UserData_Type cs_CP_UserData_SUBMIT_REPORT(O1_Type p_MsgRef) := + { + // @sic R5s100604 sic@ + spare := omit, + iei := omit, + iel := '0D'O, // the length of RPDU is 13 + rP_PDU := {RP_ACK := cs_RP_ACK_SUBMIT_REPORT(p_MsgRef)} + }; + + template (omit) CP_UserData_Type cs_CP_UserData_RP_ACK_dl (O1_Type p_MsgRef):= + { /* @status APPROVED (LTE) */ + // @sic R5s100604 sic@ @sic R5s110206 sic@ + spare := omit, + iei := omit, + iel := '02'O, // the length of RPDU is 2 as RP UserData are omitted now + rP_PDU := { + RP_ACK := cs_RP_ACK_dl(p_MsgRef) + } + }; + + +/* template (present) CP_UserData_Type cr_CP_UserData (RP_PDU_Type p_RP_PDU) := */ +/* { */ +/* spare := omit, */ +/* iei := omit, */ +/* iel := ?, */ +/* rP_PDU := p_RP_PDU */ +/* }; */ + + + template (present) CP_UserData_Type cr_CP_UserData_SUBMIT(template (present) RP_DATA_ul_Type p_RP_DATA_ul := cr_RP_DATA_ul_SUBMIT) := + { /* @status APPROVED (LTE) */ + spare := omit, + iei := omit, + iel := ?, + rP_PDU := { + RP_DATA_ul := p_RP_DATA_ul + } + }; + + template (present) CP_UserData_Type cr_CP_UserData_DELIVER_REPORT := + { + spare := omit, + iei := omit, + iel := ?, + rP_PDU := { + RP_ACK := cr_RP_ACK_DELIVER_REPORT + } + }; + + template (present) CP_UserData_Type cr_CP_UserData_RP_ACK_ul := + { /* @status APPROVED (LTE) */ + spare := omit, + iei := omit, + iel := ?, + rP_PDU := { + RP_ACK := cr_RP_ACK_ul + } + }; + /* End SM-CP Type Constraints */ + + /* SM-CP PDU Constraints */ + + template (value) CP_DATA_Type cs_CP_DATA (template (value) TransactionIdentifier_Type p_TransactionIdentifier, + template (omit) CP_UserData_Type p_CP_UserData) := + { /* @status APPROVED (LTE) */ + transactionIdentifier := p_TransactionIdentifier, + protocolDiscriminator := tsc_PD_SMS, + messageType := tsc_MT_CP_DATA, + cP_UserData := p_CP_UserData + }; + + template (present) CP_DATA_Type cr_CP_DATA (template TransactionIdentifier_Type p_TransactionIdentifier, + template CP_UserData_Type p_CP_UserData) := + { /* @status APPROVED (LTE) */ + transactionIdentifier := p_TransactionIdentifier, + protocolDiscriminator := tsc_PD_SMS, + messageType := tsc_MT_CP_DATA, + cP_UserData := p_CP_UserData + }; + + template (value) CP_ACK_Type cs_CP_ACK(template (value) TransactionIdentifier_Type p_TransactionIdentifier) := + { /* @status APPROVED (LTE) */ + transactionIdentifier := p_TransactionIdentifier, + protocolDiscriminator := tsc_PD_SMS, + messageType := tsc_MT_CP_ACK + }; + + template (present) CP_ACK_Type cr_CP_ACK(template TransactionIdentifier_Type p_TransactionIdentifier) := + { /* @status APPROVED (LTE) */ + transactionIdentifier := p_TransactionIdentifier, + protocolDiscriminator := tsc_PD_SMS, + messageType := tsc_MT_CP_ACK + }; + + template (value) CP_ERROR_Type cs_CP_ERROR(TransactionIdentifier_Type p_TransactionIdentifier, + CP_Cause_Type p_CP_Cause) := + { + transactionIdentifier := p_TransactionIdentifier, + protocolDiscriminator := tsc_PD_SMS, + messageType := tsc_MT_CP_ERROR, + cP_Cause := p_CP_Cause + }; + + template (present) CP_ERROR_Type cr_CP_ERROR(template (value) TransactionIdentifier_Type p_TransactionIdentifier, + CP_Cause_Type p_CP_Cause) := + { + transactionIdentifier := p_TransactionIdentifier, + protocolDiscriminator := tsc_PD_SMS, + messageType := tsc_MT_CP_ERROR, + cP_Cause := p_CP_Cause + }; + + template (present) CP_PDU_Type cr_CP_DATA_PDU(template TransactionIdentifier_Type p_TransactionIdentifier, + template CP_UserData_Type p_CP_UserData) := + { /* @status APPROVED (LTE) */ + CP_DATA := cr_CP_DATA (p_TransactionIdentifier, p_CP_UserData) + }; + + template (value) CP_PDU_Type cs_CP_DATA_PDU (template (value) TransactionIdentifier_Type p_TransactionIdentifier, + template (value) CP_UserData_Type p_CP_UserData) := + { /* @status APPROVED (LTE) */ + CP_DATA := cs_CP_DATA (p_TransactionIdentifier, p_CP_UserData) + }; + + template (present) CP_PDU_Type cr_CP_ACK_PDU(template TransactionIdentifier_Type p_TransactionIdentifier) := + { /* @status APPROVED (LTE) */ + CP_ACK := cr_CP_ACK (p_TransactionIdentifier) + }; + + template (value) CP_PDU_Type cs_CP_ACK_PDU(template (value) TransactionIdentifier_Type p_TransactionIdentifier) := + { /* @status APPROVED (LTE) */ + CP_ACK := cs_CP_ACK (p_TransactionIdentifier) + }; + + /* End SM-CP PDU Constraints */ + + /* SM-RP Type Constraints */ + + template (omit) RP_OriginatorAddress_dl cs_RP_OriginatorAddress_dl := + { /* @status APPROVED (IMS, LTE) */ + spare := omit, + iei := omit, + iel := '04'O, // 4 semi-octets @sic R5s100586 sic@ + typeOfNumberingPlan := cs_TypeOfNumberingPlan, + digits := '001122'O + }; + + template (present) RP_OriginatorAddress_ul cr_RP_OriginatorAddress_ul := + { /* @status APPROVED (IMS, LTE) */ + spare := omit, + iei := omit, + iel := '00'O + }; + + template (present) RP_DestinationAddress_ul cr_RP_DestinationAddress_ul(template (present) octetstring p_Digits := ?) := + { /* @status APPROVED (IMS, LTE) */ + spare := omit, + iei := omit, + iel := ?, + typeOfNumberingPlan := cr_TypeOfNumberingPlan, + digits := p_Digits + }; + + template (omit) RP_DestinationAddress_dl cs_RP_DestinationAddress_dl := + { /* @status APPROVED (IMS, LTE) */ + spare := omit, + iei := omit, + iel := '00'O + }; + +/* template (omit) RP_UserData cs_RP_UserData (TP_PDU_Type p_TP_PDU) := */ +/* { */ +/* spare := omit, */ +/* iei := omit, */ +/* iel := '05'O, // to be corrected !!! ??? */ +/* tP_PDU := p_TP_PDU */ +/* }; */ + + template (omit) RP_UserData cs_RP_UserData_DELIVER (octetstring p_Digits) := + { /* @status APPROVED (IMS, LTE) */ + spare := omit, + iei := omit, + iel := int2oct ((153 + lengthof (p_Digits)), 1), + tP_PDU := {SMS_DELIVER := cs_SMS_DELIVER (p_Digits)} + }; + + template (omit) RP_UserData cs_RP_UserData_SUBMIT_REPORT := + { /* @status APPROVED (IMS) */ + spare := tsc_Sparebit, + iei := tsc_IEI_RP_UserData, + iel := '0A'O, // the TPDU data length is 10 octets + tP_PDU := {SMS_SUBMIT_REPORT := cs_SMS_SUBMIT_REPORT} + }; + +/* template RP_UserData cr_RP_UserData (TP_PDU_Type p_TP_PDU) := */ +/* { */ +/* spare := omit, */ +/* iei := omit, */ +/* iel := ?, */ +/* tP_PDU := p_TP_PDU */ +/* }; */ + + template (present) RP_UserData cr_RP_UserData_SUBMIT(template (present) SMS_SUBMIT_Type p_SMS_SUBMIT := cr_SMS_SUBMIT_VPF_REF) := + { /* @status APPROVED (IMS, LTE) */ + /* NOTE: cr_SMS_SUBMIT_VPF_REF fits with AT command !! */ + spare := omit, + iei := omit, + iel := ?, + tP_PDU := { + SMS_SUBMIT := p_SMS_SUBMIT + } + }; + + template (present) RP_UserData cr_RP_UserData_DELIVER_REPORT := + { + spare := tsc_Sparebit, + iei := tsc_IEI_RP_UserData, + iel := ?, + tP_PDU := { + SMS_DELIVER_REPORT := cr_SMS_DELIVER_REPORT + } + }; + + /* End SM-RP Type Constraints */ + + /* SM-RP PDU Constraints */ + + template (value) RP_DATA_dl_Type cs_RP_DATA_dl_DELIVER (octetstring p_Digits) := + { /* @status APPROVED (IMS, LTE) */ + spare5 := '00000'B, + rP_MessageTypeIndicator := tsc_MT_RP_DATA_dl, + rP_MessageReference := int2oct(0, 1), + rP_OriginatorAddress := cs_RP_OriginatorAddress_dl, + rP_DestinationAddress := cs_RP_DestinationAddress_dl, + rP_UserData := cs_RP_UserData_DELIVER(p_Digits) + }; + + template (present) RP_DATA_ul_Type cr_RP_DATA_ul_SUBMIT(template (present) RP_UserData p_RP_UserData := cr_RP_UserData_SUBMIT, + template (present) octetstring p_Digits := ?) := + { /* @status APPROVED (IMS, LTE) */ + spare5 := '00000'B, + rP_MessageTypeIndicator := tsc_MT_RP_DATA_ul, + rP_MessageReference := ?, + rP_OriginatorAddress := cr_RP_OriginatorAddress_ul, + rP_DestinationAddress := cr_RP_DestinationAddress_ul(p_Digits), + rP_UserData := p_RP_UserData + }; + + template (value) RP_ACK_Type cs_RP_ACK_SUBMIT_REPORT(O1_Type p_MsgRef) := + { /* @status APPROVED (IMS) */ + spare5 := '00000'B, + rP_MessageTypeIndicator := tsc_MT_RP_ACK_dl, + rP_MessageReference := p_MsgRef, // @sic R5s100604 sic@ + rP_UserData := cs_RP_UserData_SUBMIT_REPORT + }; + + template (present) RP_ACK_Type cr_RP_ACK_DELIVER_REPORT := + { + spare5 := '00000'B, + rP_MessageTypeIndicator := tsc_MT_RP_ACK_ul, + rP_MessageReference := ?, + rP_UserData := cr_RP_UserData_DELIVER_REPORT + }; + + template (value) RP_ACK_Type cs_RP_ACK_dl(O1_Type p_MsgRef) := + { /* @status APPROVED (LTE) */ + spare5 := '00000'B, + rP_MessageTypeIndicator := tsc_MT_RP_ACK_dl, + rP_MessageReference := p_MsgRef, // @sic R5s100604 sic@ + rP_UserData := omit + }; + + template (present) RP_ACK_Type cr_RP_ACK_ul := + { /* @status APPROVED (IMS, LTE) */ + spare5 := '00000'B, + rP_MessageTypeIndicator := tsc_MT_RP_ACK_ul, + rP_MessageReference := ?, + rP_UserData := * + }; + + /* End SM-RP PDU Constraints */ + + /* SM-TP Type Constraints */ + template (present) TP_ProtocolIdentifier_Type cr_TP_ProtocolIdentifier := + { /* @status APPROVED (IMS, LTE) */ + // @sic R5s100586 sic@ + pidType := '00'B, + interworking := '0'B, + pidValue := '00000'B // @sic R5s100773 sic@ + }; + + template (value) TP_ProtocolIdentifier_Type cs_TP_ProtocolIdentifier := + { /* @status APPROVED (IMS, LTE) */ + // @sic R5s100586 sic@ + pidType := '00'B, + interworking := '0'B, + pidValue := '00000'B // @sic R5s100773 sic@ + }; + + template (value) TP_DataCodingScheme_Type cs_TP_DataCodingScheme := + { /* @status APPROVED (IMS, LTE) */ + codingGroup := '0000'B, + codeValue := '0000'B + }; + + template (present) TP_Address_Type cr_TP_AddressAny := + { /* @status APPROVED (IMS, LTE) */ + iel := ?, + typeOfNumberingPlan := cr_TypeOfNumberingPlanAny, + digits := * + }; + + template (value) TP_Address_Type cs_TP_Address (octetstring p_Digits) := + { /* @status APPROVED (IMS, LTE) */ + iel := int2oct(2 * lengthof(p_Digits), 1), + // length is number of useful semi-octets + // as p_digits is declared as octetstring the number must be even + typeOfNumberingPlan := cs_TypeOfNumberingPlan, + digits := p_Digits + }; + + template (value) TP_ParameterIndicator_Type cs_TP_ParameterIndicator := + { /* @status APPROVED (IMS) */ + extBit1 := '0'B, + spare4 := '0000'B, + tP_UDL := '0'B, + tP_DCS := '0'B, + tP_PID := '1'B + }; + + /* End SM-TP Type Constraints */ + + /* SM-TP PDU Constraints */ + + template (value) SMS_DELIVER_Type cs_SMS_DELIVER (octetstring p_Digits) := + { /* @status APPROVED (IMS, LTE) */ + tP_ReplyPath := '0'B, + tP_UserDataHeaderIndicator := '0'B, + tP_StatusReportIndication := '0'B, + spare2 := '00'B, + tP_MoreMessagesToSend := '1'B, + tP_MessageTypeIndicator := tsc_MT_SMS_DELIVER, + tP_OriginatingAddress := cs_TP_Address (p_Digits), + tP_ProtocolIdentifier := cs_TP_ProtocolIdentifier, + tP_DataCodingScheme_Type := cs_TP_DataCodingScheme, + tP_ServiceCentreTimeStamp := f_BCD_TimestampWithTimezone(), + tP_UserDataLength := int2oct(160,1), + tP_UserData := f_CharPacking_IA5toGsm7Bit(tsc_Fox, SMS_Packing) + }; + + template (present) SMS_DELIVER_REPORT_Type cr_SMS_DELIVER_REPORT := + { + spare1 := '0'B, + tP_UserDataHeaderIndicator := '0'B, + spare4 := '0000'B, + tP_MessageTypeIndicator := tsc_MT_SMS_DELIVER_REPORT, + tP_FailureCause := omit, + tP_ParameterIndicator := ?, + tP_ProtocolIdentifier := cr_TP_ProtocolIdentifier ifpresent, // @sic R5s100773 sic@ + tP_DataCodingScheme_Type := *, + tP_UserDataLength := *, + tP_UserData := * + }; + + template (present) SMS_SUBMIT_Type cr_SMS_SUBMIT(template (present) B2_Type p_ValidityPeriodFormat := '??'B, + template TP_ValidityPeriod_Type p_ValidityPeriod := *, + template (present) TP_UserDataLength_Type p_UserDataLength := ?) := + { /* @status APPROVED (IMS, LTE) */ + tP_ReplyPath := '?'B, + tP_UserDataHeaderIndicator := '?'B, + tP_StatusReportRequest := '?'B, + tP_ValidityPeriodFormat := p_ValidityPeriodFormat, + tP_RejectDuplicates := '?'B, + tP_MessageTypeIndicator := tsc_MT_SMS_SUBMIT, + tP_MessageReference := ?, + tP_DestinationAddress := cr_TP_AddressAny, + tP_ProtocolIdentifier := cr_TP_ProtocolIdentifier, + tP_DataCodingScheme_Type := ?, + tP_ValidityPeriod := p_ValidityPeriod, + tP_UserDataLength := p_UserDataLength, // @sic R5s120530 sic@ + tP_UserData := ? // any data will do + }; + + template (present) SMS_SUBMIT_Type cr_SMS_SUBMIT_VPF_REF := cr_SMS_SUBMIT('10'B, {TP_ValidityPeriodRelative := int2oct(167,1)}, int2oct(160,1)); /* @status APPROVED (IMS, LTE) */ + template (present) SMS_SUBMIT_Type cr_SMS_SUBMIT_AnyVP := cr_SMS_SUBMIT(-, *); /* @status APPROVED (LTE) + @sic R5s141400 sic@ @sic R5s150777 sic@ */ + + template (value) SMS_SUBMIT_REPORT_Type cs_SMS_SUBMIT_REPORT := + { /* @status APPROVED (IMS) */ + spare1 := '0'B, + tP_UserDataHeaderIndicator := '0'B, + spare4 := '0000'B, + tP_MessageTypeIndicator := tsc_MT_SMS_SUBMIT_REPORT, + tP_FailureCause := omit, + tP_ParameterIndicator := cs_TP_ParameterIndicator, + tP_ServiceCentreTimeStamp := f_BCD_TimestampWithTimezone(), + tP_ProtocolIdentifier := cs_TP_ProtocolIdentifier, + tP_DataCodingScheme_Type := omit, + tP_UserDataLength := omit, + tP_UserData := omit + }; + + /* End SM-TP PDU Constraints */ + +} diff --git a/IMS_PART4_IWD_15wk38/Common/NAS/SMS_TypeDefs.ttcn b/IMS_PART4_IWD_15wk38/Common/NAS/SMS_TypeDefs.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e5a26a7145b86f70a9ac5be1c9f694aad969fd1e --- /dev/null +++ b/IMS_PART4_IWD_15wk38/Common/NAS/SMS_TypeDefs.ttcn @@ -0,0 +1,395 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2013-04-02 16:00:54 +0200 (Tue, 02 Apr 2013) $ +// $Rev: 8411 $ +/******************************************************************************/ + +module SMS_TypeDefs { + +import from CommonDefs all; +import from NAS_CommonTypeDefs all; + +group SMS_Declarations { + +/* SMS Constant Declarations */ +const ProtocolDiscriminator tsc_PD_SMS := '1001'B; /* 24.007 cl. 11.2.3.1.1 */ + +const MessageType tsc_MT_CP_DATA := '00000001'B; /* CP_DATA */ +const MessageType tsc_MT_CP_ACK := '00000100'B; /* CP_ACK */ +const MessageType tsc_MT_CP_ERROR := '00010000'B; /* CP_ERROR */ + +const RP_MessageTypeIndicator_Type tsc_MT_RP_DATA_ul := '000'B; /* RP_DATA_ul */ +const RP_MessageTypeIndicator_Type tsc_MT_RP_DATA_dl := '001'B; /* RP_DATA_dl */ +const RP_MessageTypeIndicator_Type tsc_MT_RP_ACK_ul := '010'B; /* RP_ACK_ul */ +const RP_MessageTypeIndicator_Type tsc_MT_RP_ACK_dl := '011'B; /* RP_ACK_dl */ +const RP_MessageTypeIndicator_Type tsc_MT_RP_ERROR_ul := '100'B; /* RP_ERROR_ul */ +const RP_MessageTypeIndicator_Type tsc_MT_RP_ERROR_dl := '101'B; /* RP_ERROR_dl */ +const RP_MessageTypeIndicator_Type tsc_MT_RP_SMMA := '110'B; /* RP_SMMA */ + +const TP_MessageTypeIndicator_Type tsc_MT_SMS_DELIVER := '00'B; /* SMS DELIVER */ +const TP_MessageTypeIndicator_Type tsc_MT_SMS_DELIVER_REPORT := '00'B; /* SMS DELIVER REPORT */ +const TP_MessageTypeIndicator_Type tsc_MT_SMS_STATUS_REPORT := '10'B; /* SMS STATUS REPORT */ +const TP_MessageTypeIndicator_Type tsc_MT_SMS_COMMAND := '10'B; /* SMS COMMAND */ +const TP_MessageTypeIndicator_Type tsc_MT_SMS_SUBMIT := '01'B; /* SMS SUBMIT, SMS SUBMIT REPORT */ +const TP_MessageTypeIndicator_Type tsc_MT_SMS_SUBMIT_REPORT := '01'B; /* SMS SUBMIT, SMS SUBMIT REPORT */ + +const B7_Type tsc_IEI_RP_UserData := '1000001'B; /* 24.011 cl. 8.2.5.3 */ +const B1_Type tsc_Sparebit := '0'B; /* 24.011 cl. 8.2.5.3 */ + + +/* Non-SMS Type Declarations */ + +type record TransactionIdentifier_Type { /* 24.007 cl. 11.2.3.1.3 */ + B1_Type tI_Flag, /* A message has a TI flag set to "0" when it belongs to + transaction initiated by its sender, and to "1" otherwise. */ + B3_Type tI_Value /* Values 0 to 6 allowed, value 7 has a special meaning */ +}; + +type record TypeOfNumberingPlan { /* 24.008 cl. 10.5.4.7, 10.5.4.9, 10.5.4.13 */ + B1_Type extBit, /* Extension Bit */ + B3_Type typeOfNumber, /* Type Of Number */ + B4_Type numberingPlanId /* Numbering Plan Identification */ +}; + +/* End Non-SMS Type Declarations */ + +/* SM-CP Type Declarations */ + +type record CP_UserData_Type { /* 24.011 cl. 8.1.4.1 */ + B1_Type spare optional, /* 0, present in case of TLV; omit in case of LV */ + B7_Type iei optional, /* 0000001, present in case of TLV; omit in case of LV */ + O1_Type iel, /* */ + RP_PDU_Type rP_PDU /* <= 248 octets */ +}; + +type record CP_Cause_Type { /* 24.011 cl. 8.1.4.2 */ + B1_Type spare1 optional, /* 0, present in case of TV; omit in case of V */ + B7_Type iei optional, /* 0000001, present in case of TV; omit in case of V */ + B1_Type spare2, /* 0 */ + B7_Type causeValue /* Table 8.2/3GPP TS 24.011 */ +}; + +/* End SM-CP Type Declarations */ + +/* SM-CP PDU Declarations */ + +type record CP_DATA_Type { /* 24.011 cl. 7.2.1 + Direction: both */ + TransactionIdentifier_Type transactionIdentifier, /* 24.007 cl. 11.2.3.1.3 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* 24.007 cl. 11.2.3.1.1 M V 1/2 */ + MessageType messageType, /* cl. 8.1.3 M V 1 */ + CP_UserData_Type cP_UserData /* cl. 8.1.4.1 M LV <= 249 octets */ +}; + +type record CP_ACK_Type { /* 24.011 cl. 7.2.2 + Direction: both */ + TransactionIdentifier_Type transactionIdentifier, /* 24.007 cl. 11.2.3.1.3 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* 24.007 cl. 11.2.3.1.1 M V 1/2 */ + MessageType messageType /* cl. 8.1.3 M V 1 */ +}; + +type record CP_ERROR_Type { /* 24.011 cl. 7.2.3 + Direction: both */ + TransactionIdentifier_Type transactionIdentifier, /* 24.007 cl. 11.2.3.1.3 M V 1/2 */ + ProtocolDiscriminator protocolDiscriminator, /* 24.007 cl. 11.2.3.1.1 M V 1/2 */ + MessageType messageType, /* cl. 8.1.3 M V 1 */ + CP_Cause_Type cP_Cause /* cl. 8.1.4.2 O LV <= 249 octets */ +}; + +type union CP_PDU_Type { + CP_DATA_Type CP_DATA, + CP_ACK_Type CP_ACK, + CP_ERROR_Type CP_ERROR +}; +/* SM-CP PDU Declarations */ + +/* SM-RP Type Declarations */ + +type B3_Type RP_MessageTypeIndicator_Type; /* 24.011 cl. 8.2.2 */ +type O1_Type RP_MessageReference_Type; /* 24.011 cl. 8.2.3 */ + +type record RP_OriginatorAddress_dl { /* 24.011 cl. 8.2.5.1 */ + B1_Type spare optional, /* 0 */ + B7_Type iei optional, /* 0101 1110 */ + O1_Type iel, /* min value 2 and max value is 11 */ + TypeOfNumberingPlan typeOfNumberingPlan, /* */ + octetstring digits length(1..10) +}; + +type record RP_OriginatorAddress_ul { /* 24.011 cl. 8.2.5.1 */ + B1_Type spare optional, /* 0 */ + B7_Type iei optional, /* 0101 1110 */ + O1_Type iel /* 0 */ +}; + +type record RP_DestinationAddress_ul { /* 24.011 cl. 8.2.5.2 */ + B1_Type spare optional, /* 0 */ + B7_Type iei optional, /* 0101 1110 */ + O1_Type iel, /* min value 2 and max value is 11 */ + TypeOfNumberingPlan typeOfNumberingPlan, /* */ + octetstring digits length(1..10) +}; +type record RP_DestinationAddress_dl { /* 24.011 cl. 8.2.5.2 */ + B1_Type spare optional, /* 0 */ + B7_Type iei optional, /* 0101 1110 */ + O1_Type iel /* 0 */ +}; + +type record RP_UserData { /* 24.011 cl. 8.2.5.3 */ + B1_Type spare optional, /* 0, present in case of TLV; omit in case of LV */ + B7_Type iei optional, /* 1000001, present in case of TLV; omit in case of LV */ + O1_Type iel, /* */ + TP_PDU_Type tP_PDU /* <= 232 octets */ +}; + +type record RP_Cause { /* 24.011 cl. 8.2.5.4 */ + B1_Type spare optional, /* present in case of TLV; omit in case of LV */ + B7_Type iei optional, /* present in case of TLV; omit in case of LV */ + O1_Type iel, /* 2 or 3 */ + B1_Type extBit1, /* 0 */ + B7_Type causeValue1, /* Table 8.4/3GPP TS 24.011 */ + B1_Type extBit2, /* 0 */ + B7_Type causeValue2, /* Table 8.4/3GPP TS 24.011 */ + O1_Type diagnostic optional /* Parameters included in the return error from MAP */ +}; + +/* End SM-RP Type Declarations */ + +/* SM-RP PDU Declarations */ + +type record RP_DATA_dl_Type { /* 24.011 cl. 7.3.1.1 + Direction: n -> ue */ + B5_Type spare5, /* cl. 8.2.2 M V 5 bits */ + RP_MessageTypeIndicator_Type rP_MessageTypeIndicator, /* cl. 8.2.2 M V 3 bits */ + RP_MessageReference_Type rP_MessageReference, /* cl. 8.2.3 M LV 1 */ + RP_OriginatorAddress_dl rP_OriginatorAddress, /* cl. 8.2.5.1 M LV 1-12 octets */ + RP_DestinationAddress_dl rP_DestinationAddress, /* cl. 8.2.5.2 M LV 1 */ + RP_UserData rP_UserData /* cl. 8.2.5.3 M LV <= 233 octets */ +}; + +type record RP_DATA_ul_Type { /* 24.011 cl. 7.3.1.2 + Direction: ue -> n */ + B5_Type spare5, /* cl. 8.2.2 M V 5 bits */ + RP_MessageTypeIndicator_Type rP_MessageTypeIndicator, /* cl. 8.2.2 M V 3 bits */ + RP_MessageReference_Type rP_MessageReference, /* cl. 8.2.3 M LV 1 */ + RP_OriginatorAddress_ul rP_OriginatorAddress, /* cl. 8.2.5.1 M LV 1 */ + RP_DestinationAddress_ul rP_DestinationAddress, /* cl. 8.2.5.2 M LV 1 */ + RP_UserData rP_UserData /* cl. 8.2.5.3 M LV <= 233 octets */ +}; + +type record RP_SMMA_Type { /* 24.011 cl. 7.3.2 + Direction: ue -> n */ + B5_Type spare5, /* cl. 8.2.2 M V 5 bits */ + RP_MessageTypeIndicator_Type rP_MessageTypeIndicator, /* cl. 8.2.2 M V 3 bits */ + RP_MessageReference_Type rP_MessageReference /* cl. 8.2.3 M LV 1 */ +}; + +type record RP_ACK_Type { /* 24.011 cl. 7.3.3 + Direction: ue <-> n */ + B5_Type spare5, /* cl. 8.2.2 M V 5 bits */ + RP_MessageTypeIndicator_Type rP_MessageTypeIndicator, /* cl. 8.2.2 M V 3 bits */ + RP_MessageReference_Type rP_MessageReference, /* cl. 8.2.3 M LV 1 */ + RP_UserData rP_UserData optional /* cl. 8.2.5.3 O TLV <= 234 octets */ +}; + +type record RP_ERROR_Type { /* 24.011 cl. 7.3.4 + Direction: ue <-> n */ + B5_Type spare5, /* cl. 8.2.2 M V 5 bits */ + RP_MessageTypeIndicator_Type rP_MessageTypeIndicator, /* cl. 8.2.2 M V 3 bits */ + RP_MessageReference_Type rP_MessageReference, /* cl. 8.2.3 M LV 1 */ + RP_Cause rP_Cause, /* cl. 8.2.5.4 M LV 2-3 */ + RP_UserData rP_UserData optional /* cl. 8.2.5.3 O TLV <= 234 octets */ +}; + +type union RP_PDU_Type { + RP_DATA_dl_Type RP_DATA_dl, + RP_DATA_ul_Type RP_DATA_ul, + RP_SMMA_Type RP_SMMA, + RP_ACK_Type RP_ACK, + RP_ERROR_Type RP_ERROR +}; + +/* End SM-RP PDU Declarations */ + +/* SM-TP Type Declarations */ + +type record TP_Address_Type { /* 23.040 cl. 9.1.2.5 */ + O1_Type iel, /* min value 2 and max value is 11 */ + TypeOfNumberingPlan typeOfNumberingPlan, + octetstring digits length(0..10) optional +}; + +type B2_Type TP_MessageTypeIndicator_Type; /* 23.040 cl. 9.2.3.1 */ +type O1_Type TP_MessageReference_Type; /* 23.040 cl. 9.2.3.6 */ +type O1_Type TP_UserDataLength_Type; /* 23.040 cl. 9.2.3.16 */ + +type record TP_ProtocolIdentifier_Type { /* 23.040 cl. 9.2.3.9 */ + B2_Type pidType, /* */ + B1_Type interworking, /* */ + B5_Type pidValue /* */ +}; + +type record TP_DataCodingScheme_Type { /* 23.040 cl. 9.2.3.10 + 23.040 cl. 4 */ + B4_Type codingGroup, /* */ + B4_Type codeValue /* */ +}; + +type hexstring TP_ServiceCentreTimeStamp_Type length (14); /* 23.040 cl. 9.2.3.11 */ + +type O1_Type TP_ValidityPeriodRelative_Type; /* 23.040 cl. 9.2.3.12.1 */ + +type hexstring TP_ValidityPeriodAbsolute_Type length (14); /* 23.040 cl. 9.2.3.12.2 */ + +type record TP_ValidityPeriodEnhanced_Type { /* 23.040 cl. 9.2.3.12.3 */ + B1_Type extBit, /* */ + B1_Type singleShot, /* */ + B3_Type spare3, /* */ + B3_Type validityPeriodFormat, /* */ + O6_Type validityPeriod /* */ +}; + +type union TP_ValidityPeriod_Type { /* 23.040 cl. 9.2.3.3 */ + TP_ValidityPeriodRelative_Type TP_ValidityPeriodRelative, /* Relative format */ + TP_ValidityPeriodAbsolute_Type TP_ValidityPeriodAbsolute, /* Absolute format */ + TP_ValidityPeriodEnhanced_Type TP_ValidityPeriodEnhanced /* Enhanced format */ +}; + +type record TP_Status_Type { /* 23.040 cl. 9.2.3.15 */ + B1_Type reserved, /* */ + B7_Type status /* */ +}; + +type B8_Type TP_Command_Type; /* 23.040 cl. 9.2.3.19 */ + +type record TP_ParameterIndicator_Type { /* 23.040 cl. 9.2.3.27 */ + B1_Type extBit1, /* */ + B4_Type spare4, /* */ + B1_Type tP_UDL, /* */ + B1_Type tP_DCS, /* */ + B1_Type tP_PID /* */ +}; + +/* End SM-TP Type Declarations */ + +/* SM-TP PDU Declarations */ + +type record SMS_DELIVER_Type { /* 23.040 cl. 9.2.2.1 + Direction: n -> ue */ + B1_Type tP_ReplyPath, /* 23.040 cl. 9.2.3.17 */ + B1_Type tP_UserDataHeaderIndicator, /* 23.040 cl. 9.2.3.23 */ + B1_Type tP_StatusReportIndication, /* 23.040 cl. 9.2.3.4 */ + B2_Type spare2, /* */ + B1_Type tP_MoreMessagesToSend, /* 23.040 cl. 9.2.3.2 */ + TP_MessageTypeIndicator_Type tP_MessageTypeIndicator, /* 23.040 cl. 9.2.3.1 */ + TP_Address_Type tP_OriginatingAddress, /* 23.040 cl. 9.1.2.5 */ + TP_ProtocolIdentifier_Type tP_ProtocolIdentifier, /* 23.040 cl. 9.2.3.9 */ + TP_DataCodingScheme_Type tP_DataCodingScheme_Type, /* 23.040 cl. 9.2.3.10 */ + TP_ServiceCentreTimeStamp_Type tP_ServiceCentreTimeStamp, /* 23.040 cl. 9.2.3.11 */ + TP_UserDataLength_Type tP_UserDataLength, /* 23.040 cl. 9.2.3.16, derived from SUBMIT */ + octetstring tP_UserData length (0..140) optional /* 23.040 cl. 9.2.3.24, derived from SUBMIT */ +}; + +type record SMS_DELIVER_REPORT_Type { /* 23.040 cl. 9.2.2.1a + Direction: ue -> n */ + B1_Type spare1, /* */ + B1_Type tP_UserDataHeaderIndicator, /* 23.040 cl. 9.2.3.23 */ + B4_Type spare4, /* */ + TP_MessageTypeIndicator_Type tP_MessageTypeIndicator, /* 23.040 cl. 9.2.3.1 */ + O1_Type tP_FailureCause optional, /* 23.040 cl. 9.2.3.22, provided if RP_ERROR, not if RP_ACK */ + TP_ParameterIndicator_Type tP_ParameterIndicator, /* 23.040 cl. 9.2.3.27 */ + TP_ProtocolIdentifier_Type tP_ProtocolIdentifier optional, /* 23.040 cl. 9.2.3.9 */ + TP_DataCodingScheme_Type tP_DataCodingScheme_Type optional, /* 23.040 cl. 9.2.3.10 */ + TP_UserDataLength_Type tP_UserDataLength optional, /* 23.040 cl. 9.2.3.16 */ + octetstring tP_UserData length (0..159) optional /* 23.040 cl. 9.2.3.24 */ +}; + +type record SMS_SUBMIT_Type { /* 23.040 cl. 9.2.2.2 + Direction: ue -> n */ + B1_Type tP_ReplyPath, /* 23.040 cl. 9.2.3.17 */ + B1_Type tP_UserDataHeaderIndicator, /* 23.040 cl. 9.2.3.23 */ + B1_Type tP_StatusReportRequest, /* 23.040 cl. 9.2.3.5 */ + B2_Type tP_ValidityPeriodFormat, /* 23.040 cl. 9.2.3.3 */ + B1_Type tP_RejectDuplicates, /* 23.040 cl. 9.2.3.25 */ + TP_MessageTypeIndicator_Type tP_MessageTypeIndicator, /* 23.040 cl. 9.2.3.1 */ + TP_MessageReference_Type tP_MessageReference, /* 23.040 cl. 9.2.3.6 */ + TP_Address_Type tP_DestinationAddress, /* 23.040 cl. 9.1.2.5 */ + TP_ProtocolIdentifier_Type tP_ProtocolIdentifier, /* 23.040 cl. 9.2.3.9 */ + TP_DataCodingScheme_Type tP_DataCodingScheme_Type, /* 23.040 cl. 9.2.3.10 */ +// one of the subsequent ValidityPeriod solutions has be removed + TP_ValidityPeriod_Type tP_ValidityPeriod optional, /* 23.040 cl. 9.2.3.12 */ +// TP_ValidityPeriodRelative_Type tP_ValidityPeriodRelative optional, /* 23.040 cl. 9.2.3.12.1 */ +// TP_ValidityPeriodAbsolute_Type tP_ValidityPeriodAbsolute optional, /* 23.040 cl. 9.2.3.12.2 */ +// TP_ValidityPeriodEnhanced_Type tP_ValidityPeriodEnhanced optional, /* 23.040 cl. 9.2.3.12.3 */ + TP_UserDataLength_Type tP_UserDataLength, /* 23.040 cl. 9.2.3.16 */ + octetstring tP_UserData length (0..140) optional /* 23.040 cl. 9.2.3.24 */ +}; +type record SMS_SUBMIT_REPORT_Type { /* 23.040 cl. 9.2.2.2a + Direction: n -> ue */ + B1_Type spare1, /* */ + B1_Type tP_UserDataHeaderIndicator, /* 23.040 cl. 9.2.3.23 */ + B4_Type spare4, /* */ + TP_MessageTypeIndicator_Type tP_MessageTypeIndicator, /* 23.040 cl. 9.2.3.1 */ + O1_Type tP_FailureCause optional, /* 23.040 cl. 9.2.3.22, provided if RP_ERROR, not if RP_ACK */ + TP_ParameterIndicator_Type tP_ParameterIndicator, /* 23.040 cl. 9.2.3.27 */ + TP_ServiceCentreTimeStamp_Type tP_ServiceCentreTimeStamp, /* 23.040 cl. 9.2.3.11 */ + TP_ProtocolIdentifier_Type tP_ProtocolIdentifier optional, /* 23.040 cl. 9.2.3.9 */ + TP_DataCodingScheme_Type tP_DataCodingScheme_Type optional, /* 23.040 cl. 9.2.3.10 */ + TP_UserDataLength_Type tP_UserDataLength optional, /* 23.040 cl. 9.2.3.16 */ + octetstring tP_UserData length (0..152) optional /* 23.040 cl. 9.2.3.24 */ +}; + +type record SMS_STATUS_REPORT_Type { /* 23.040 cl. 9.2.2.3 + Direction: n -> ue */ + B1_Type spare1, /* */ + B1_Type tP_UserDataHeaderIndicator, /* 23.040 cl. 9.2.3.23 */ + B1_Type tP_StatusReportQualifier, /* 23.040 cl. 9.2.3.26 */ + B2_Type spare2, /* */ + B1_Type tP_MoreMessagesToSend, /* 23.040 cl. 9.2.3.2 */ + TP_MessageTypeIndicator_Type tP_MessageTypeIndicator, /* 23.040 cl. 9.2.3.1 */ + TP_MessageReference_Type tP_MessageReference, /* 23.040 cl. 9.2.3.6 */ + TP_Address_Type tP_RecipientAddress, /* 23.040 cl. 9.1.2.5 */ + TP_ServiceCentreTimeStamp_Type tP_ServiceCentreTimeStamp, /* 23.040 cl. 9.2.3.11 */ + TP_ServiceCentreTimeStamp_Type tP_DischargeTime, /* 23.040 cl. 9.2.3.12 */ + TP_Status_Type tP_Status, /* 23.040 cl. 9.2.3.15 */ + TP_ParameterIndicator_Type tP_ParameterIndicator optional, /* 23.040 cl. 9.2.3.27 */ + TP_ProtocolIdentifier_Type tP_ProtocolIdentifier optional, /* 23.040 cl. 9.2.3.9 */ + TP_DataCodingScheme_Type tP_DataCodingScheme_Type optional, /* 23.040 cl. 9.2.3.10 */ + TP_UserDataLength_Type tP_UserDataLength optional, /* 23.040 cl. 9.2.3.16 */ + octetstring tP_UserData length (0..143) optional /* 23.040 cl. 9.2.3.24 */ +}; + +type record SMS_COMMAND_Type { /* 23.040 cl. 9.2.2.4 + Direction: ue -> n */ + B1_Type spare1, /* */ + B1_Type tP_UserDataHeaderIndicator, /* 23.040 cl. 9.2.3.23 */ + B1_Type tP_StatRptReq, /* Table 8.4/3GPP TS 24.011 */ + B3_Type spare3, /* */ + TP_MessageTypeIndicator_Type tP_MessageTypeIndicator, /* 23.040 cl. 9.2.3.1 */ + TP_MessageReference_Type tP_MessageReference, /* 23.040 cl. 9.2.3.6 */ + TP_ProtocolIdentifier_Type tP_ProtocolIdentifier, /* 23.040 cl. 9.2.3.9 */ + TP_Command_Type tP_CommandType, /* 23.040 cl. 9.2.3.19 */ + TP_MessageReference_Type tP_MessageNumber, /* 23.040 cl. 9.2.3.18 */ + TP_Address_Type tP_DestinationAddress, /* 23.040 cl. 9.1.2.5 */ + TP_UserDataLength_Type tP_CommandDataLength, /* 23.040 cl. 9.2.3.20 (number of octets) */ + octetstring tP_CommandData length (0..156) optional /* 23.040 cl. 9.2.3.21 */ +}; + +type union TP_PDU_Type { + SMS_DELIVER_Type SMS_DELIVER, + SMS_DELIVER_REPORT_Type SMS_DELIVER_REPORT, + SMS_SUBMIT_Type SMS_SUBMIT, + SMS_SUBMIT_REPORT_Type SMS_SUBMIT_REPORT, + SMS_STATUS_REPORT_Type SMS_STATUS_REPORT, + SMS_COMMAND_Type SMS_COMMAND +}; + +/* End SM-TP PDU Declarations */ + +} with { encode "SMS Types"} // group SMS_Declarations + +} // module diff --git a/IMS_PART4_IWD_15wk38/IMS/10/IMS_CC_SubscriptionTestcases.ttcn b/IMS_PART4_IWD_15wk38/IMS/10/IMS_CC_SubscriptionTestcases.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cd6084a39f27aca575d7a3fc886620b37a7ab1bb --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/10/IMS_CC_SubscriptionTestcases.ttcn @@ -0,0 +1,77 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-15 21:39:48 +0200 (Tue, 15 Sep 2015) $ +// $Rev: 14432 $ +/******************************************************************************/ + +module IMS_CC_SubscriptionTestcases { + + import from CommonDefs all; + import from LibSip_SIPTypesAndValues all; + import from IMS_Component all; + import from IMS_ASP_TypeDefs all; + import from IMS_ASP_Templates all; + + import from IMS_SIP_Templates all; + import from IMS_CC_CommonFunctions all; + import from IMS_CommonFunctions all; + import from IMS_Procedures_Registration all; + + import from IMS_PTC_CoordMsg all; + + //============================================================================ + /* + * @desc REFERENCE TS 34.229-1 clause 10.1 + * @status APPROVED (IMS) + */ + function f_TC_10_1_IMS() runs on IMS_PTC + { + var IMS_DATA_REQ v_IMS_DATA_REQ; + var REGISTER_Request v_RegisterReq; + var SUBSCRIBE_Request v_SubscribeReq; + var charstring v_CallId; + var integer v_RetryT := 60; // seconds + + f_IMS_CC_Preamble(IPCAN_SignallingOnly, IMS_NULL); // @sic R5s150786 sic@ + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + + if (f_IMS_PTC_SecurityScheme_IsGiba()) { + v_RegisterReq := f_IMS_Register_GIBA(); // Annex C.2a steps 1 to 5 + } else { + v_RegisterReq := f_IMS_Register_NonGIBA(); // Annex C.2 steps 1 to 7 + } + + f_IMS_TestBody_Set(true); + + // Steps 1 + // @siclog "Step 1" siclog@ + v_IMS_DATA_REQ := f_IMS_SUBSCRIBE_Request(); + v_SubscribeReq := v_IMS_DATA_REQ.Request.Subscribe; + v_CallId := v_SubscribeReq.msgHeader.callId.callid; + + // Steps 2 + // @siclog "Step 2" siclog@ + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo), + cs_Response(c_statusLine503, f_IMS_CommonResponse_503_MessageHeaderTX(v_SubscribeReq.msgHeader, cs_RetryAfter(v_RetryT))))); + + f_Delay(int2float(v_RetryT) * 0.9); // - 10 % + f_IMS_PreliminaryPass(__FILE__, __LINE__, ""); + + // Steps 4 and 5 + // @siclog "Step 4 - 5" siclog@ + v_SubscribeReq := f_IMS_Register_SubscribeNotify(v_RegisterReq); + if (v_SubscribeReq.msgHeader.callId.callid == v_CallId) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "CallId shall be different"); + } + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_InitialRegistration); + } + +} diff --git a/IMS_PART4_IWD_15wk38/IMS/11/IMS_CC_NotificationTestcases.ttcn b/IMS_PART4_IWD_15wk38/IMS/11/IMS_CC_NotificationTestcases.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..457828c965e72cb541b1e9c754d709731ceaf985 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/11/IMS_CC_NotificationTestcases.ttcn @@ -0,0 +1,164 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-11 10:39:38 +0200 (Fri, 11 Sep 2015) $ +// $Rev: 14283 $ +/******************************************************************************/ +module IMS_CC_NotificationTestcases { + + import from CommonDefs all; + import from LibSip_SIPTypesAndValues all; + import from IMS_Component all; + import from IMS_CommonParameters all; + import from IMS_CommonDefs all; + import from IMS_SIP_Templates all; + import from IMS_XML_Templates all; + import from IMS_ASP_TypeDefs all; + import from IMS_ASP_Templates all; + import from IMS_Procedures_Registration all; + import from IMS_CC_CommonFunctions all; + import from IMS_CommonFunctions all; + import from IMS_PTC_CoordMsg all; + import from IMS_IP_Config all; + import from IMS_Procedures_Common all; + + //============================================================================ + /* + * @desc REFERENCE TS 34.229-1 clause 11.1 + * @status APPROVED (IMS) + */ + function f_TC_11_1_IMS() runs on IMS_PTC + { + var REGISTER_Request v_RegisterReq; + var SipUrl v_ContactUrl; + var template (value) RegInfo_RegistrationList_Type v_Registrations; + var template (value) Reginfo_Type v_Reginfo; + var boolean v_ApplyGRUU := false; /* GRUU is not considered in the test case prose */ + var CharStringList_Type v_PublicUserIdentityList; + timer t_Wait := 60.0; + + f_IMS_CC_Preamble(IPCAN_SignallingOnly, IMS_NULL); + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + + v_RegisterReq := f_IMS_Register(); + f_IMS_Register_SubscribeNotify(v_RegisterReq); + v_ContactUrl := f_MessageHeader_GetContactSipUrl(v_RegisterReq.msgHeader); + v_PublicUserIdentityList := f_IMS_PTC_ImsInfo_GetAllIMPUs(); /* @sic R5s130296 sic@ */ + + // NOTE: RRC connection is kept; this might be an artificial behaviour + + f_IMS_TestBody_Set(true); + + v_Registrations[0] := f_XML_RegistrationInfo(v_RegisterReq, v_PublicUserIdentityList[0], "a100", "980", terminated, rejected, -, v_ApplyGRUU); + v_Registrations[1] := f_XML_RegistrationInfo(v_RegisterReq, px_IMS_AssociatedTelUri, "a101", "981", terminated, rejected, -, v_ApplyGRUU); + v_Registrations[2] := f_XML_RegistrationInfo(v_RegisterReq, v_PublicUserIdentityList[1], "a102", "982", terminated, rejected, -, v_ApplyGRUU); + v_Registrations[3] := f_XML_RegistrationInfo(v_RegisterReq, v_PublicUserIdentityList[2], "a103", "983", terminated, rejected, -, v_ApplyGRUU); + v_Reginfo := f_XML_RegInfo(full, 1, v_Registrations); + + // @siclog "Step 1 - 2" siclog@ + f_IMS_Register_Notify(v_ContactUrl, v_Reginfo, cs_SubscriptionState_Terminated); /* @sic R5-153756, R5-153986: p_SubscribeRequest and p_CseqValue removed sic@ */ + + f_IMS_PreliminaryPass(__FILE__, __LINE__, "Step 2"); + + //Check: does the UE send a REGISTER message after sending 200 OK? @sic R5s140342 sic@ + t_Wait.start; + alt { + [] IMS_Server.receive(car_IMS_Register_Request(cr_REGISTER_Request)) + { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "UE sent a REGISTER message after sending 200 OK"); + } + [] t_Wait.timeout + { + f_IMS_PreliminaryPass(__FILE__, __LINE__, "test case 11.1"); + } + } + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_InitialRegistration, false); /* @sic R5s130901: handling of de-registration sic@ */ + } + + //============================================================================ + /* + * @desc REFERENCE TS 34.229-1 clause 11.2 + * @status APPROVED (IMS) + */ + function f_TC_11_2_IMS() runs on IMS_PTC + { + var SecurityClientParams_Type v_SecurityClientParams; + var IMS_DATA_REQ v_IMS_DATA_REQ; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo; + var REGISTER_Request v_RegisterReq; + var charstring v_NW_AddrStr; + var SipUrl v_ContactUrl; + var template (value) Reginfo_Type v_XmlMessage; + var template (value) RegInfo_RegistrationList_Type v_Registrations; + var charstring v_PublicUserIdentity; + var IMS_TCP_CloseHandling_Type v_TcpCloseHandling := justWait; + var boolean v_ApplyGRUU := false; /* GRUU is not considered in the test case prose */ + var integer v_NonceCount; + var integer v_ExpirationTime := 60; + var float v_ReRegistrationTime := int2float(v_ExpirationTime / 2); + timer t_TRegExpireMin := f_IMS_SetTimerToleranceMin(v_ReRegistrationTime); + timer t_TRegExpireMax := f_IMS_SetTimerToleranceMax(v_ReRegistrationTime); + + f_IMS_CC_Preamble(IPCAN_SignallingOnly, IMS_NULL, IMS_Security); + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + + v_RegisterReq := f_IMS_Register_NonGIBA(); + f_IMS_Register_SubscribeNotify(v_RegisterReq); + v_ContactUrl := f_MessageHeader_GetContactSipUrl(v_RegisterReq.msgHeader); + v_PublicUserIdentity := f_IMS_PTC_ImsInfo_GetURI(firstId); // @sic R5s130266 change 1.1 sic@ + + f_IMS_TestBody_Set(true); + + v_NW_AddrStr := f_IMS_PTC_NW_Address_GetAddrStr(); /* @sic R5s130133 change 6: f_IMS_PTC_NW_Address_GetHostFormat replaced by f_IMS_PTC_NW_Address_GetAddrStr sic@ */ + + // Set the 60 seconds expiration time in the XML body + v_Registrations[0] := f_XML_RegistrationInfo(v_RegisterReq, v_PublicUserIdentity, "a100", "980", active, shortened, v_ExpirationTime, v_ApplyGRUU); + v_XmlMessage := f_XML_RegInfo(partial, 1, v_Registrations); + // @siclog "Step 1 - 2" siclog@ + f_IMS_Register_Notify(v_ContactUrl, v_XmlMessage); /* @sic R5-153756, R5-153986: p_SubscribeRequest and p_CseqValue removed sic@ */ + + t_TRegExpireMin.start; // @sic R5s130266 change 1.2 - MCC160 Implementation sic@ + t_TRegExpireMax.start; // @sic R5s130266 change 1.2 - MCC160 Implementation sic@ + + f_IMS_CC_ReleaseConnection(IPCAN_InitialRegistration); /* @sic R5s140561: needs to be after starting the timers sic@ */ + + f_IMS_CC_StartSignalling(IPCAN_MO_IMS_Signalling); + + // @siclog "Step 3" siclog@ + v_NonceCount := 2; + v_IMS_DATA_REQ := f_IMS_PTC_ReRegistration_WaitForRegistration(t_TRegExpireMin, t_TRegExpireMax, v_NonceCount); + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + + v_SecurityClientParams := f_IMS_PTC_ReRegistration_SecurityClientParamsGet(); + f_IMS_PTC_ReRegistration_SecurityClientParamsCheck(v_RegisterReq, v_SecurityClientParams); + + // @siclog "Step 4" siclog@ + f_IMS_Register_SecurityInit(v_RegisterReq, not4b tsc_IMS_AuthRAND); /* generate a new RAND */ + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo), cs_Response(c_statusLine401, f_IMS_RegisterResponse_401_MessageHeaderTX(v_RegisterReq)))); + + // @siclog "Step 5" siclog@ + v_NonceCount := 1; // nonce counter is reset to 1 due to re-authentication @sic R5s130266 change 2 - MCC160 Implementation sic@ + v_IMS_DATA_REQ := f_IMS_REGISTER_SubsequentRequest(-, -, v_NonceCount); + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + + f_IMS_Register_SecurityRelease(); /* @sic R5s130900 - MCC160 implementation sic@ + @sic R5-145732: for the part 3 model it is not necessary anymore to hand over v_SecurityInfo but it is kept for backward compatibility with the part 4 model sic@ + @sic R5w150015: v_SecurityInfo is removed sic@ */ + // @siclog "Step 6" siclog@ + v_RoutingInfo := f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo); /* @sic R5s141326 sic@ */ + v_RoutingInfo.Security := protectedContext1; /* @sic R5s141326: by releasing the old security context the new one becomes context 1 sic@ */ + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo, cs_Response(c_statusLine200, f_IMS_RegisterResponse_200_MessageHeaderTX(v_RegisterReq)))); + f_IMS_PreliminaryPass(__FILE__, __LINE__, "test case 11.2"); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MO_IMS_Signalling, -, v_TcpCloseHandling); + } +} diff --git a/IMS_PART4_IWD_15wk38/IMS/12/IMS_CC_CallControlTestcases.ttcn b/IMS_PART4_IWD_15wk38/IMS/12/IMS_CC_CallControlTestcases.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6740c58f823cd68a4d951047e4860b60e28cf1d0 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/12/IMS_CC_CallControlTestcases.ttcn @@ -0,0 +1,1190 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-16 20:33:09 +0200 (Wed, 16 Sep 2015) $ +// $Rev: 14474 $ +/******************************************************************************/ +module IMS_CC_CallControlTestcases { + + import from LibSip_SIPTypesAndValues all; + import from LibSip_SDPTypes all; + import from IP_ASP_TypeDefs all; + import from IMS_Component all; + import from IMS_ASP_TypeDefs all; + import from IMS_ASP_Templates all; + import from IMS_CommonParameters all; + import from IMS_SIP_Templates all; + import from IMS_MessageBody_Templates all; + import from IMS_XML_Templates all; + import from IMS_SDP_Templates all; + import from IMS_SDP_Messages all; + import from IMS_SDP_MessagesVideo all; + import from IMS_CC_CommonFunctions all; + import from IMS_Procedures_Registration all; + import from IMS_Procedures_CallControl all; + import from IMS_Procedures_Video all; + import from IMS_Procedures_Common all; + import from IMS_CommonFunctions all; + import from IMS_PTC_CoordMsg all; + import from IMS_CC_IPCAN_Coordination all; + import from CommonDefs all; + import from UpperTesterFunctions all; + + + //============================================================================ + // Annex C13 - SDP Messages + //---------------------------------------------------------------------------- + + function f_IMS_BuildSDP_AnnexC13_Step1(charstring p_Fmt1, + charstring p_Fmt2) runs on IMS_PTC return template (value) SDP_Message + { + // Build SDP record according 34.229-1 Annex C.13 step 1 + var SDP_fmt_list v_Fmts := {p_Fmt1, p_Fmt2}; + var template (value) SDP_bandwidth_list v_Bandwidth_List_Media := cs_SDP_Bandwidth_List_Media(3, 0, 500); + + var template (omit) SDP_attribute_list v_SDP_MediaAttributes := { + cs_SDP_Attribute_rtpmap(p_Fmt1, cs_RTPMAP_Codec("t140", "1000")), + cs_SDP_Attribute_rtpmap(p_Fmt2, cs_RTPMAP_Codec("red", "1000")), + cs_SDP_Attribute_fmtp(p_Fmt2, {unstructured := "99/99/99"}), + cs_SDP_Attribute_ptime, + cs_SDP_Attribute_maxptime + }; + var template (omit) SDP_attribute_list v_SDP_PrecondionAttributes := cs_SDP_PrecondionAttributes(c_sendrecv, c_none, c_mandatory, c_mandatory); + + return f_IMS_BuildSDP_TX(cs_SDP_Media_Text(v_Fmts), v_Bandwidth_List_Media, v_SDP_MediaAttributes, v_SDP_PrecondionAttributes); + } + + function f_IMS_BuildSDP_AnnexC13_Step4(charstring p_Fmt1, + charstring p_Fmt2) runs on IMS_PTC return template (present) SDP_Message + { /* Build SDP record to be received from the UE at step 2 according to 34.229-1 Annex C.13 */ + + var template (present) SDP_attribute_list v_SDP_MediaAttributes := { + cr_SDP_Attribute_rtpmap(p_Fmt1, cr_RTPMAP_Codec("t140", "1000")), + cr_SDP_Attribute_rtpmap(p_Fmt2, cr_RTPMAP_Codec("red", "1000")), + cr_SDP_Attribute_fmtp(p_Fmt2) + }; + var template (present) SDP_attribute_list v_SDP_PrecondionAttributes := cr_SDP_PrecondionAttributes(c_sendrecv, c_sendrecv, c_mandatory, c_optional); + + return f_IMS_BuildSDP_RX(-, cr_SDP_Media_Text(p_Fmt1, p_Fmt2), v_SDP_MediaAttributes, v_SDP_PrecondionAttributes); + } + + //============================================================================ + // Annex C15 - SDP Messages + //---------------------------------------------------------------------------- + + const charstring tsc_Fmtp_Red1000_Params := "99/99/99"; + + function f_IMS_BuildSDP_AnnexC15_Step2() runs on IMS_PTC return template (present) SDP_Message + { /* Build SDP record to be received from the UE at step 2 according to 34.229-1 Annex C.15 */ + var template (present) SDP_attribute_list v_SDP_MediaAttributes := { + cr_SDP_Attribute_rtpmap(-, cr_RTPMAP_Codec("t140", "1000")), + cr_SDP_Attribute_rtpmap(-, cr_RTPMAP_Codec("red", "1000")), + cr_SDP_Attribute_fmtp(-, crs_Fmtp_UnstructuredParams(tsc_Fmtp_Red1000_Params)) + }; + var template (present) SDP_attribute_list v_SDP_PrecondionAttributes := cr_SDP_PrecondionAttributes(c_sendrecv, c_none, c_mandatory, c_optional); + + return f_IMS_BuildSDP_RX(-, cr_SDP_Media_Text, v_SDP_MediaAttributes, v_SDP_PrecondionAttributes); + } + + function f_IMS_BuildSDP_AnnexC15_Step5(SDP_Message p_SDP_MessageRx, + charstring p_Fmt1, + charstring p_Fmt2) runs on IMS_PTC return template (value) SDP_Message + { + var template (value) SDP_Message v_SDP_MessageTx; + var SDP_bandwidth_list v_MediaBandwidth_List := p_SDP_MessageRx.media_list[0].bandwidth; + var integer v_SessionBandwidthAS := f_SDP_BandwidthList_GetBandwidth(p_SDP_MessageRx.bandwidth, "AS"); + var SDP_fmt_list v_Fmts := {p_Fmt1, p_Fmt2}; + var template (omit) SDP_attribute_list v_SDP_MediaAttributes := { + cs_SDP_Attribute_rtpmap(p_Fmt1, cs_RTPMAP_Codec("t140", "1000")), + cs_SDP_Attribute_rtpmap(p_Fmt2, cs_RTPMAP_Codec("red", "1000")), + cs_SDP_Attribute_fmtp(p_Fmt2, crs_Fmtp_UnstructuredParams(tsc_Fmtp_Red1000_Params)) // !!!! NOTE: there are no params specified in the prose (even though being mandatory) !!!! + }; + var template (omit) SDP_attribute_list v_SDP_PrecondionAttributes := cs_SDP_PrecondionAttributes(c_sendrecv, c_sendrecv, c_mandatory, c_mandatory); + + v_SDP_MessageTx := f_IMS_BuildSDP_TX(cs_SDP_Media_Text(v_Fmts), v_MediaBandwidth_List, v_SDP_MediaAttributes, v_SDP_PrecondionAttributes, v_SessionBandwidthAS); + + // prose says these must be the same too + v_SDP_MessageTx.origin.session_id := p_SDP_MessageRx.origin.session_id; + v_SDP_MessageTx.origin.session_version := p_SDP_MessageRx.origin.session_version; + + return v_SDP_MessageTx; + } + + //============================================================================ + // Annex C15 - Steps + //---------------------------------------------------------------------------- + + function f_IMS_MOCallSetup_AnnexC15_Steps2to6() runs on IMS_PTC return INVITE_Request + { + var template (present) SDP_Message v_SDP_MessageStep2 := f_IMS_BuildSDP_AnnexC15_Step2(); + var template (present) MessageHeader v_MessageHeader_Ack; + var template (value) MessageHeader v_MessageHeader_InviteResponse_200; + var template (value) SDP_Message v_SDP_MessageStep5; + var IMS_DATA_REQ v_IMS_INVITE_REQ; + var INVITE_Request v_InviteRequest; + var SDP_Message v_SDP_Message; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL; + var charstring v_Fmt1; + var charstring v_Fmt2; + var boolean v_PrackRequiredFor180Ringing := false; /* => there is no PRACK expected to acknowledge the 180 response */ + var boolean v_SrvccAlerting := false; /* as we have no voice call */ + + // Step 2. Receive INVITE Request + v_IMS_INVITE_REQ := f_IMS_INVITE_ReceiveRequest(A_2_1_A4, tsc_OptionTagList_precondition, -, -, -, -, -, v_SrvccAlerting); + v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(v_IMS_INVITE_REQ.RoutingInfo); + v_InviteRequest := v_IMS_INVITE_REQ.Request.Invite; + v_SDP_Message := f_IMS_SIP_SdpMessageBody_DecodeMatchAndCheckSDP(v_InviteRequest.messageBody, v_SDP_MessageStep2); + + // check media description: + v_Fmt1 := f_SDP_MediaDescr_GetMediaFormat(v_SDP_Message.media_list[0], cr_RTPMAP_Codec("t140", "1000")); + v_Fmt2 := f_SDP_MediaDescr_GetMediaFormat(v_SDP_Message.media_list[0], cr_RTPMAP_Codec("red", "1000"), {unstructured := "99/99/99"}); + if ((v_Fmt1 == "") or (v_Fmt2 == "")) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "invalid codec information"); + } + + // Step 3. SS sends a 100 Trying provisional response. + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine100, f_IMS_InviteResponse_100_MessageHeaderTX(v_InviteRequest)))); + // Step 4. SS sends a 180 Ringing. + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine180, f_IMS_InviteResponse_180_MessageHeaderTX(v_InviteRequest, -, v_PrackRequiredFor180Ringing, -, v_SrvccAlerting)))); + + // Step 5. Send 200 OK (response to INVITE) + v_MessageHeader_InviteResponse_200 := f_IMS_OtherResponse_200_MessageHeaderTX(v_InviteRequest.msgHeader); + v_SDP_MessageStep5 := f_IMS_BuildSDP_AnnexC15_Step5(v_SDP_Message, v_Fmt1, v_Fmt2); + + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine200, v_MessageHeader_InviteResponse_200, cs_MessageBody_SDP(v_SDP_MessageStep5)))); + + // Step 6. Finally, UE acknowledges call setup. + v_MessageHeader_Ack := f_IMS_AckRequest_MessageHeaderRX(v_InviteRequest, c_statusLine200); + IMS_Server.receive(car_IMS_Ack_Request(cr_ACK_Request(f_MessageHeader_GetContactSipUrl(v_InviteRequest.msgHeader), v_MessageHeader_Ack))); + + return v_InviteRequest; + } + + //============================================================================ + // Annex C26 - Steps + //---------------------------------------------------------------------------- + /* + * @desc Signalling according 34.229-1 Annex C.26 steps 5 to 13 + * @param p_InviteRequestWithSdp + * @param p_FmtAudio + * @param p_FmtVideo + * @param p_SessionInProgress183 + * @param p_SDP_MessageStep183 + * @status APPROVED (IMS) + */ + function f_IMS_MTCallSetup_AnnexC26_Steps5_13(IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + charstring p_FmtAudio, + charstring p_FmtVideo, + IMS_Response_Type p_SessionInProgress183, + SDP_Message p_SDP_MessageStep183) runs on IMS_PTC + { + var MessageHeader v_MessageHeader_PrevReliableResponse := p_SessionInProgress183.msgHeader; + var InternetProtocol_Type v_Protocol := p_InviteRequestWithSdp.RoutingInfo.Protocol; + var INVITE_Request v_InviteRequest := p_InviteRequestWithSdp.Invite; + var template (value) SDP_Message v_SDP_MessageStep7; + var template (present) SDP_Message v_SDP_MessageStep8; + var template (omit) SDP_attribute v_SDP_Attribute; + var charstring v_Direction; + + // Step 5 - 6. Send PRACK, Receive 200 OK + f_IMS_MTCallSetup_SendPRACK_ReceiveOK(v_InviteRequest, v_MessageHeader_PrevReliableResponse); + + // Step 7 - 8. Send UPDATE, Receive 200 OK, Receive optional 180 Ringing and send PRACK if requested + v_SDP_Attribute := f_SDP_AttributeList_GetAttribute(p_SDP_MessageStep183.media_list[0].attributes, cr_SDP_Attribute_curr_qos(c_local, ?)); // get curr:qos remote for SDP message in step 7 + v_Direction := valueof(v_SDP_Attribute.curr.direction); + v_SDP_MessageStep7 := f_IMS_BuildSDP_MTCallAudioVideo_TX(C26, Update, p_FmtAudio, p_FmtVideo, v_Direction); + v_SDP_MessageStep8 := f_IMS_BuildSDP_MTCallAudioVideo_RX(C26, Response200, p_FmtAudio, p_FmtVideo); + f_IMS_MTCallSetup_Common_Steps7_11(v_InviteRequest, v_SDP_MessageStep7, v_SDP_MessageStep8, v_Protocol); + + // Step 11A - Make UE accept the speech AMR offer + f_UT_AnswerCall(MMI); // @sic R5-134070 sic@ + + // Step 12. Receive 200 OK, Send ACK + f_IMS_MTCallSetup_Common_Steps12_13(p_InviteRequestWithSdp); + } + + //============================================================================ + /* + * @desc 504 Server Time-out (see TS 34.229, A.4.6) + * @param p_MessageHeader_Request + * @return template (value) MessageHeader + * @status APPROVED (IMS) + */ + function f_IMS_CommonResponse_504_MessageHeaderTX(MessageHeader p_MessageHeader_Request) runs on IMS_PTC return template (value) MessageHeader + { + var template (value) MessageHeader v_MessageHeader_Response := cs_MessageHeader_Dummy; + + v_MessageHeader_Response.via := p_MessageHeader_Request.via; + v_MessageHeader_Response.fromField := p_MessageHeader_Request.fromField; + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderTX(p_MessageHeader_Request); + v_MessageHeader_Response.pAssertedID := cs_PAssertedId(cs_SipUri_HostPort_lr(px_IMS_Scscf)); + v_MessageHeader_Response.callId := p_MessageHeader_Request.callId; + v_MessageHeader_Response.sessionId := p_MessageHeader_Request.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Response.cSeq := p_MessageHeader_Request.cSeq; + v_MessageHeader_Response.contentType := cs_ContentType("application/3gpp-ims+xml"); + + return v_MessageHeader_Response; + } + + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 12.2 + * @status APPROVED (IMS) + */ + function f_TC_12_2_IMS() runs on IMS_PTC + { + var template (present) MessageHeader v_MessageHeader_Ack; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL; + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; /* @sic R5w140112: IMS_InviteRequestWithSdp_Type instead of IMS_DATA_REQ */ + var INVITE_Request v_InviteRequest; + var template (present) SipUrl v_RequestSipUrl := f_SIP_BuildSipUri_RX(px_IMS_CalleeUri); // @sic R5s130580 sic@ + var template (present) SDP_Message v_SDP_Message_Step2; + var integer v_RetryAfter := 60; // seconds + var float v_RetryAfterMin := f_IMS_SetTimerToleranceMin(int2float(v_RetryAfter)); + var float v_RetryAfterMax := f_IMS_SetTimerToleranceMax(int2float(v_RetryAfter)); + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + + f_IMS_TestBody_Set(true); + + // Step 1 - Make the UE attempt an IMS speech call + // @siclog "Step 1" siclog@ + f_IMS_CC_StartCall(IPCAN_MO_SpeechCall); + + // Step 2. Receive INVITE Request + // @siclog "Step 2 - 3" siclog@ + v_InviteRequestWithSdp := f_IMS_MOCallSetup_AnnexC21_Step2_Common(-, A_2_1_A4); + v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(v_InviteRequestWithSdp.RoutingInfo); + v_InviteRequest := v_InviteRequestWithSdp.Invite; + + // Step 4. SS sends 503 Service Unavailable. + // @siclog "Step 4" siclog@ + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine503, f_IMS_CommonResponse_503_MessageHeaderTX(v_InviteRequest.msgHeader, cs_RetryAfter(v_RetryAfter))))); + + // Step 5. Receive ACK + // @siclog "Step 5" siclog@ + v_MessageHeader_Ack := f_IMS_AckRequest_MessageHeaderRX(v_InviteRequest, c_statusLine503); + IMS_Server.receive(car_IMS_Ack_Request(cr_ACK_Request(v_RequestSipUrl, v_MessageHeader_Ack))); + + // @siclog "Step 6" siclog@ + f_Delay(v_RetryAfterMin); + f_IMS_PreliminaryPass(__FILE__, __LINE__, "Step6"); + + // Step 7. Receive INVITE (optional) + // @siclog "Step 7" siclog@ + v_SDP_Message_Step2 := f_IMS_BuildSDP_AnnexC21_Step2(); /* @sic R5s150704 - additional changes sic@ */ + f_IMS_MOCallSetup_AnnexC21_Step2_Optional(v_SDP_Message_Step2, -, A_2_1_A4, (v_RetryAfterMax - v_RetryAfterMin)); // @sic R5s130580 - additional change sic@ + + f_IMS_CC_AbortCall(); // to abort call establishment procedure + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MO_SpeechCall); + } + + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 12.2a + * @status APPROVED (IMS) + */ + function f_TC_12_2a_IMS() runs on IMS_PTC + { + var template (present) MessageHeader v_MessageHeader_Ack; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL; + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; /* @sic R5w140112: IMS_InviteRequestWithSdp_Type instead of IMS_DATA_REQ */ + var INVITE_Request v_InviteRequest; + var template (present) SipUrl v_RequestSipUrl := f_SIP_BuildSipUri_RX(px_IMS_CalleeUri); + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED, IMS_Security); // prose specifies only Annex C.2 => not applicable for GIBA + + f_IMS_TestBody_Set(true); + + // Step 1 - Make the UE attempt an IMS speech call + // @siclog "Step 1" siclog@ + f_IMS_CC_StartCall(IPCAN_MO_SpeechCall); + + // Step 2. Receive INVITE Request + // @siclog "Step 2" siclog@ + v_InviteRequestWithSdp := f_IMS_MOCallSetup_AnnexC21_Step2_A4(); + v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(v_InviteRequestWithSdp.RoutingInfo); + v_InviteRequest := v_InviteRequestWithSdp.Invite; + + // Step 3. SS sends 504 Server Time-out. + // @siclog "Step 3" siclog@ + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine504, + f_IMS_CommonResponse_504_MessageHeaderTX(v_InviteRequest.msgHeader), + cs_MessageBody_XML(cs_Ims_3gpp_Restoration)))); + // Step 4. Receive ACK + // @siclog "Step 4" siclog@ + v_MessageHeader_Ack := f_IMS_AckRequest_MessageHeaderRX(v_InviteRequest, c_statusLine504); + IMS_Server.receive(car_IMS_Ack_Request(cr_ACK_Request(v_RequestSipUrl, v_MessageHeader_Ack))); + + f_IMS_CC_AbortCall(); // to abort call establishment procedure + + f_IMS_GlobalRelease(); // @sic R5s141339 change 2 - additional change sic@ */ + + // Steps 5 to 12. UE performs initial registration Annex C.2 + // @siclog "Step 5 - 12" siclog@ + f_IMS_Registration(); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MO_SpeechCall); + } + + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 12.12 + * @status APPROVED (IMS) + */ + function f_TC_12_12_IMS() runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; /* @sic R5w140112: IMS_InviteRequestWithSdp_Type instead of IMS_DATA_REQ */ + var MessageHeader v_MessageHeader_Response183; + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + + f_IMS_TestBody_Set(true); + + // @siclog "Step 1" siclog@ + f_IMS_CC_StartCall(IPCAN_MO_SpeechCall); + + // @siclog "Step 2" siclog@ + v_InviteRequestWithSdp := f_IMS_MOCallSetup_AnnexC21_Step2_A4(); + + // @siclog "Step 3 - 4" siclog@ + v_MessageHeader_Response183 := f_IMS_MOCallSetup_AnnexC21_Step3_4(v_InviteRequestWithSdp); /* @sic R5w140112 sic@ */ + + // See TS. 36.508 EUTRA/EPS signalling for IMS MO speech call Table 4.5A.6.3-1 Step 9-11 + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MO_SpeechCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + + // @siclog "Step 5 - 13" siclog@ + f_IMS_MOCallSetup_AnnexC21_Steps5_13(v_InviteRequestWithSdp, v_MessageHeader_Response183); + + // @siclog "Step 14 - 15" siclog@ + f_IMS_CallReleaseMO(v_InviteRequestWithSdp.Invite); /* @sic R5-134116: parameter p_RecordRouteOfPrevResponse removed sic@ */ + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MO_SpeechCall); + } + + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 12.13 + * @status APPROVED (IMS) + */ + function f_TC_12_13_IMS() runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; /* @sic R5w140112: v_InviteRequestWithSdp instead of v_InviteRequest sic@ */ + var IMS_ResponseWithSdp_Type v_ResponseWithSdp; /* @sic R5w140112 sic@ */ + var IMS_Response_Type v_SessionInProgress183; + var SipUrl v_ContactUrl; + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + + f_IMS_TestBody_Set(true); + + f_IMS_CC_StartCall(IPCAN_MT_SpeechCall); + + // Steps 1 to 4 as defined in Annex C.11 + // @siclog "Step 1 - 4" siclog@ + v_InviteRequestWithSdp := f_IMS_MTCallSetup_AnnexC11_INVITE(); + v_ResponseWithSdp := f_IMS_MTCallSetup_AnnexC11_Steps1_4(v_InviteRequestWithSdp); + v_SessionInProgress183 := v_ResponseWithSdp.Response; + v_ContactUrl := f_MessageHeader_GetContactSipUrl(v_SessionInProgress183.msgHeader); + + // Establish Dedicated EPS bearer + // See TS. 36.508 EUTRA/EPS signalling for IMS MT speech call Table 4.5A.7.3-1 Step 9-12 + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MT_SpeechCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + + // Steps 5 to 13 as defined in Annex C.11 + // @siclog "Step 5 -13" siclog@ + f_IMS_MTCallSetup_AnnexC11_Steps5_13(v_InviteRequestWithSdp, v_ResponseWithSdp); + + // MT Call is now established + f_Delay(3.0); /* @sic R5s130510 change 1; draft prose CR sic@ */ + + // Step 14-15. SS sends BYE to release the call; UE sends 200 OK for the BYE request and ends the call + // @siclog "Step 14 -15" siclog@ + f_IMS_CallReleaseMT(v_InviteRequestWithSdp.Invite, v_ContactUrl); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MT_SpeechCall); + } + + //---------------------------------------------------------------------------- + // See 34.229-1 clause 12.16 - MO MTSI Text call + function f_TC_12_16_IMS() runs on IMS_PTC + { + var IMS_TestProcedure_Type v_TestProcedure := IPCAN_MO_IMS_Signalling; // NOTE: new value IPCAN_MO_TextCall may be introduced; FFS + var INVITE_Request v_InviteRequest; + + f_IMS_CC_Preamble(IPCAN_SignallingOnly, IMS_REGISTERED); + + f_IMS_TestBody_Set(true); + + // Steps defined in Annex C.15 + // @siclog "Step 1" siclog@ + f_IMS_CC_StartCall(v_TestProcedure); + + // @siclog "Step 2 -6" siclog@ + v_InviteRequest := f_IMS_MOCallSetup_AnnexC15_Steps2to6(); + + // @siclog "Step 7 - 8" siclog@ + f_IMS_CallReleaseMO(v_InviteRequest); + f_IMS_TestBody_Set(false); + f_IMS_CC_Postamble(v_TestProcedure); + } + + //---------------------------------------------------------------------------- + + function f_IMS_MTCallSetup_AnnexC13_Steps1to10(IMS_TestProcedure_Type p_TestProcedure, + template (value) SDP_Message p_SDP_Message_Step1, + template (present) SDP_Message p_SDP_Message_Step4or7) runs on IMS_PTC //return INVITE_Request + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var IMS_ResponseWithSdp_Type v_ResponseWithSdp; + var Response v_Response; + var InternetProtocol_Type v_Protocol; + var IMS_DATA_RSP v_IMS_DATA_RSP; + var template (value) MessageHeader v_MessageHeader_Invite; + var template (value) INVITE_Request v_InviteRequest; + var template (present) MessageHeader v_MessageHeader_180RX_Template; + var MessageHeader v_MessageHeader; + var SipUrl v_ContactUrl := f_IMS_PTC_ImsInfo_GetContactUrl(); + var template SDP_Message v_SDP_Message_Step7 := omit; + var SDP_Message v_SDP_Message_Step4or7; + var boolean v_Trying := false; + var boolean v_SrvccAlerting := false; + + timer t_Timer := 5.0; // as for C.11 (-> f_IMS_MTCallSetup_Common_Steps7_11) + + f_IMS_CC_StartCall(p_TestProcedure); + + // Step 1 - Send INVITE + v_MessageHeader_Invite := f_IMS_InviteRequest_MessageHeaderTX(tsc_OptionTagList_precondition, -, v_SrvccAlerting); + v_InviteRequest := cs_INVITE_Request(v_ContactUrl, v_MessageHeader_Invite, cs_MessageBody_SDP(p_SDP_Message_Step1)); + v_InviteRequestWithSdp := f_IMS_InviteRequestWithSdpMT(v_InviteRequest, p_SDP_Message_Step1); + v_Protocol := v_InviteRequestWithSdp.RoutingInfo.Protocol; + + IMS_Client.send(cas_IMS_Invite_Request(v_InviteRequestWithSdp.RoutingInfo, v_InviteRequest)); + + // Step 2 - Void + + v_MessageHeader_180RX_Template := f_IMS_InviteResponse_180_MessageHeaderRX(v_InviteRequest); + v_MessageHeader_180RX_Template.contentType := cr_ContentTypeSDP ifpresent; + + t_Timer.start; + alt { + // Step 3 - Receive optional 100 Trying + [not v_Trying] a_IMS_ReceiveResponse(v_InviteRequest.msgHeader, + v_Protocol, + cr_Response(c_statusLine100, f_IMS_InviteResponse_100_MessageHeaderRX(v_InviteRequest)), + v_IMS_DATA_RSP) /* @sic R5s140350: v_IMS_DATA_RSP is 'out' parameter sic@ */ + { + v_Trying := true; + repeat; + } + // Step 4 - Receive optional 180 Ringing + [] a_IMS_ReceiveResponse(v_InviteRequest.msgHeader, + v_Protocol, + cr_Response(c_statusLine180, v_MessageHeader_180RX_Template, cr_MessageBody_SDP ifpresent), + v_IMS_DATA_RSP) /* @sic R5s140350: v_IMS_DATA_RSP is 'out' parameter sic@ */ + { + t_Timer.stop; + v_Response := v_IMS_DATA_RSP.Response; + v_MessageHeader := v_Response.msgHeader; + f_IMS_Dialog_SetRemoteTag(v_MessageHeader); + if (ispresent(v_Response.messageBody)) { + v_SDP_Message_Step4or7 := f_IMS_SIP_SdpMessageBody_DecodeMatchAndCheckSDP(v_Response.messageBody, p_SDP_Message_Step4or7); + if (not ispresent(v_MessageHeader.contentType)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Step 4: missing content type"); + } + } + } + [] t_Timer.timeout {} + } + + if (isbound(v_MessageHeader)) { // i.e. there has been a 180 Ringing + f_IMS_MessageHeader_Response_CheckRecordRoute(v_MessageHeader); /* @sic R5s150039 sic@ */ + f_IMS_MessageHeader_CheckContactAddr(v_MessageHeader); // check whether contact contains "SIP URI with IP address or FQDN" (see @sic R5s120727 sic@) + + if (f_MessageHeader_CheckRequire(v_MessageHeader, c_tag100rel)) { + // Step 5 - 6. Send PRACK, Receive 200 OK if the 180 response contains 100rel option tag within the Require header + f_IMS_MTCallSetup_SendPRACK_ReceiveOK(v_InviteRequest, v_MessageHeader); + } + } + + if (p_TestProcedure == IPCAN_MT_SpeechCall) { + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MT_SpeechCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + } + + if (not isbound(v_SDP_Message_Step4or7)) { + v_SDP_Message_Step7 := p_SDP_Message_Step4or7; + } + + // Step 6A - Make UE accept the SDP offer + f_UT_AnswerCall(MMI); // @sic R5-134070, R5-134796, R5-134797 sic@ */ + + // Step 7 - 8. Receive OK for INVITE, Send ACK. The SS acknowledges the receipt of 200 OK for INVITE. + v_ResponseWithSdp := f_IMS_MTCallSetup_Common_Steps12_13(v_InviteRequestWithSdp, v_SDP_Message_Step7); + v_Response := v_ResponseWithSdp.Response; + v_MessageHeader := v_Response.msgHeader; + v_ContactUrl := f_MessageHeader_GetContactSipUrl(v_MessageHeader); + + // f_Delay(3.0); /* as for 12.13 a delay may be useful but that requires prose CR */ + + // Step 9-10 + f_IMS_CallReleaseMT(v_InviteRequest, v_ContactUrl); + f_IMS_CC_ReleaseConnection(p_TestProcedure); + } + + // See 34.229-1 clause 12.17 - MT MTSI Text call + function f_TC_12_17_IMS() runs on IMS_PTC + { + var IMS_TestProcedure_Type v_TestProcedure := IPCAN_MT_IMS_Signalling; // NOTE: new value IPCAN_MT_TextCall may be introduced; FFS + var template (value) SDP_Message v_SDP_MessageStep1; + var template (present) SDP_Message v_SDP_MessageStep4; + var charstring v_Fmt1 := "99"; + var charstring v_Fmt2 := "101"; + + f_IMS_CC_Preamble(IPCAN_SignallingOnly, IMS_REGISTERED); + + f_IMS_TestBody_Set(true); + + v_SDP_MessageStep1 := f_IMS_BuildSDP_AnnexC13_Step1(v_Fmt1, v_Fmt2); + v_SDP_MessageStep4 := f_IMS_BuildSDP_AnnexC13_Step4(v_Fmt1, v_Fmt2); + + f_IMS_MTCallSetup_AnnexC13_Steps1to10(v_TestProcedure, v_SDP_MessageStep1, v_SDP_MessageStep4); + + f_IMS_TestBody_Set(false); + f_IMS_CC_Postamble(v_TestProcedure); + } + + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 12.18 + * @status APPROVED (IMS) + */ + function f_TC_12_18_IMS() runs on IMS_PTC + { /* MTSI MO speech call / SSAC / 0% access probability for MTSI MO speech call */ + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; /* @sic R5w140112: IMS_InviteRequestWithSdp_Type instead of IMS_DATA_REQ */ + var MessageHeader v_MessageHeader_Response183; + + // Initial conditions + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_NULL); // @sic R5s140334 sic@ + // @sic R5s140334 sic@ + f_IMS_IPCAN_ModifyConfig(IPCAN, SIB2_TC_12_18); // @sic R5s141381 sic@ + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + f_IMS_Registration(); + f_IMS_CC_ReleaseConnection(IPCAN_InitialRegistration); + + f_IMS_TestBody_Set(true); + + // @siclog "Step 1" siclog@ + f_UT_RequestIMSCall(MMI, px_IMS_CalleeUri); // @sic R5-134070 sic@ + + // Step 2 - Ue does not send INVITE + // @siclog "Step 2" siclog@ + f_Delay(10.0); + + // @siclog "Step 3 - 4" siclog@ + f_IMS_IPCAN_ModifyConfig(IPCAN, SIB2_Normal); + + // @siclog "Step 5" siclog@ + f_Delay(15.0); + + // @siclog "Step 6" siclog@ + f_UT_RequestIMSCall(MMI, px_IMS_CalleeUri); // @sic R5-134070 sic@ + + // Step 7 + 8 - Ue does not send INVITE and Wait 49s to expire timer Ty + // @siclog "Step 7 - 8" siclog@ + f_Delay(59.0); + + // Steps 9 to 21 - MTSI MO speech call for EPS + // @siclog "Step 9 - 21" siclog@ + f_IMS_CC_StartCall(IPCAN_MO_SpeechCall); + + v_InviteRequestWithSdp := f_IMS_MOCallSetup_AnnexC21_Step2_A4(); + + v_MessageHeader_Response183 := f_IMS_MOCallSetup_AnnexC21_Step3_4(v_InviteRequestWithSdp); /* @sic R5w140112 sic@ */ + + // See TS. 36.508 EUTRA/EPS signalling for IMS MO speech call Table 4.5A.6.3-1 Step 9-11 + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MO_SpeechCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + + f_IMS_MOCallSetup_AnnexC21_Steps5_13(v_InviteRequestWithSdp, v_MessageHeader_Response183); + + f_IMS_CallReleaseMO(v_InviteRequestWithSdp.Invite); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MO_SpeechCall); + } + + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 12.18a + * + */ + function f_TC_12_18a_IMS() runs on IMS_PTC + { /* MTSI MO speech call / SSAC in Connected mode/ 0% access probability for MTSI MO speech call */ + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var MessageHeader v_MessageHeader_Response183; + + // Initial conditions + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_NULL); + f_IMS_IPCAN_ModifyConfig(IPCAN, SIB2_TC_12_18); // same TC 12_18 // @sic R5s141381 sic@ + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + f_IMS_Registration(); + + f_IMS_TestBody_Set(true); + + // @siclog "Step 9" siclog@ + f_UT_RequestIMSCall(MMI, px_IMS_CalleeUri); + + // @siclog "Step 10" siclog@ + f_Delay(10.0); + + // @siclog "Step 11-12" siclog@ + f_IMS_IPCAN_ModifyConfig(IPCAN, SIB2_Normal); + + // @siclog "Step 13" siclog@ + f_Delay(15.0); + + // @siclog "Step 14" siclog@ + f_UT_RequestIMSCall(MMI, px_IMS_CalleeUri); + + // Step 15 + 16 - Ue does not send INVITE and Wait 49s to expire timer Ty + // @siclog "Step 15 + 16" siclog@ + f_Delay(59.0); + + // Steps 17 to 22 - MTSI MO speech call for EPS + // @siclog "Step 17 - 22" siclog@ + + // @sic R5-144279 sic@ + v_InviteRequestWithSdp := f_IMS_MOCallSetup_AnnexC21_Step2_A4(); + + v_MessageHeader_Response183 := f_IMS_MOCallSetup_AnnexC21_Step3_4(v_InviteRequestWithSdp); + + // See TS. 36.508 EUTRA/EPS signalling for IMS MO speech call Table 4.5A.6.3-1 Step 12-14 + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MO_SpeechCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + + f_IMS_MOCallSetup_AnnexC21_Steps5_13(v_InviteRequestWithSdp, v_MessageHeader_Response183); + + f_IMS_CallReleaseMO(v_InviteRequestWithSdp.Invite); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MO_SpeechCall); + } + + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 12.18b + * + */ + function f_TC_12_18b_IMS() runs on IMS_PTC + { /* MTSI MO speech call / SSAC in Connected mode/ 0% access probability for MTSI MO speech call */ + + // Initial conditions + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_NULL); + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + f_IMS_Registration(); + + f_IMS_TestBody_Set(true); + + // @siclog "Step 10-11" siclog@ + f_IMS_IPCAN_ModifyConfig(IPCAN, SIB2_TC_12_18b); // same TC 12_18 + + // @siclog "Step 12" siclog@ + f_Delay(15.0); + + // @siclog "Step 13" siclog@ + f_IMS_CC_StartCall(IPCAN_MO_SpeechCall); + + // Ue does not send INVITE and Wait 10s to expire timer + // @siclog "Step14" siclog@ + f_Delay(10.0); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_InitialRegistration); + } + + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 12.19 + * @status APPROVED (IMS) + */ + function f_TC_12_19_IMS() runs on IMS_PTC + { /* MTSI MO video call / SSAC / 0% access probability for MTSI MO video call */ + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var MessageHeader v_MessageHeader_Response183; + var INVITE_Request v_InviteRequest; + + // Initial conditions + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_NULL); // @sic R5s140334 sic@ + // @sic R5s140334 sic@ + f_IMS_IPCAN_ModifyConfig(IPCAN, SIB2_TC_12_19); // @sic R5s141381 sic@ + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + f_IMS_Registration(); + f_IMS_CC_ReleaseConnection(IPCAN_InitialRegistration); + + f_IMS_TestBody_Set(true); + + // @siclog "Step 1" siclog@ + f_UT_RequestIMSVideoCall(MMI, px_IMS_CalleeUri); + + // Step 2 - Ue does not send INVITE + // @siclog "Step 2" siclog@ + f_Delay(10.0); + + // @siclog "Step 3 - 4" siclog@ + f_IMS_IPCAN_ModifyConfig(IPCAN, SIB2_Normal); + + // @siclog "Step 5" siclog@ + f_Delay(15.0); + + // @siclog "Step 6" siclog@ + f_UT_RequestIMSVideoCall(MMI, px_IMS_CalleeUri); + + // Step 7 + 8 - UE does not send INVITE and Wait 49s to expire timer Ty + // @siclog "Step 7 - 8" siclog@ + f_Delay(59.0); + + // Steps 9 to 21 - MTSI MO video call for EPS + // @siclog "Step 9 - 21" siclog@ + f_IMS_CC_StartCall(IPCAN_MO_VideoCall); + + v_InviteRequestWithSdp := f_IMS_MOCallSetup_Video_Step2(C25); + v_InviteRequest := v_InviteRequestWithSdp.Invite; + + v_MessageHeader_Response183 := f_IMS_MOCallSetup_Video_Step3_4(C25, v_InviteRequestWithSdp); + + // See TS. 36.508 EUTRA/EPS signalling for IMS MO video call Table 4.5A.8.3-1 Step 12-15 + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MO_VideoCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearers + + f_IMS_MOCallSetup_AnnexC25_Steps5_13(v_InviteRequestWithSdp, v_MessageHeader_Response183); + + f_IMS_CallReleaseMO(v_InviteRequest); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MO_SpeechCall); + } + + //---------------------------------------------------------------------------- + + // See 34.229-1 clause 12.19a - MTSI MO video call / SSAC in Connected mode / 0% access probability for MTSI MO video call // @sic R5-144688 sic@ + + function f_TC_12_19a_IMS() runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var MessageHeader v_MessageHeader_Response183; + var INVITE_Request v_InviteRequest; + + // Initial conditions + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_NULL); // @sic R5s140334 sic@ + f_IMS_IPCAN_ModifyConfig(IPCAN, SIB2_TC_12_19); // same TC_12_19 // @sic R5s141381 sic@ + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + f_IMS_Registration(); + + f_IMS_TestBody_Set(true); + + // @siclog "Step 9" siclog@ + f_UT_RequestIMSVideoCall(MMI, px_IMS_CalleeUri); + + // @siclog "Step 10" siclog@ + f_Delay(10.0); + + // @siclog "Step 11 - 12" siclog@ + f_IMS_IPCAN_ModifyConfig(IPCAN, SIB2_Normal); + + // @siclog "Step 13" siclog@ + f_Delay(15.0); + + // @siclog "Step 14" siclog@ + f_UT_RequestIMSVideoCall(MMI, px_IMS_CalleeUri); + + // Step 15 + 16 - UE does not send INVITE and Wait 49s to expire timer Ty + // @siclog "Step 15 + 16" siclog@ + f_Delay(59.0); + + // Steps 17 to 23 - MTSI MO video call for EPS + // @siclog "Step 17 - 23" siclog@ + + // @sic R5-144279 sic@ + v_InviteRequestWithSdp := f_IMS_MOCallSetup_Video_Step2(C25); + v_InviteRequest := v_InviteRequestWithSdp.Invite; + + v_MessageHeader_Response183 := f_IMS_MOCallSetup_Video_Step3_4(C25, v_InviteRequestWithSdp); + + // See TS. 36.508 EUTRA/EPS signalling for IMS MO video call Table 4.5A.8.3-1 Step 12-15 + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MO_VideoCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearers + + f_IMS_MOCallSetup_AnnexC25_Steps5_13(v_InviteRequestWithSdp, v_MessageHeader_Response183); + + f_IMS_CallReleaseMO(v_InviteRequest); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MO_VideoCall); + } + + //---------------------------------------------------------------------------- + + // See 34.229-1 clause 12.19b - MTSI MO video call / SSAC in Connected mode / access probability for MTSI MO video call //@sic R5-144688 sic@ + + function f_TC_12_19b_IMS() runs on IMS_PTC + { + // Initial conditions + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_NULL); + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + f_IMS_Registration(); + + f_IMS_TestBody_Set(true); + + // @siclog "Step 10 + 11" siclog@ + f_IMS_IPCAN_ModifyConfig(IPCAN, SIB2_TC_12_19b); + + // Step 12- Ue does not send INVITE + // @siclog "Step 12" siclog@ + f_Delay(15.0); + + // @siclog "Step 13" siclog@ + f_UT_RequestIMSVideoCall(MMI, px_IMS_CalleeUri); + + // Step 14 - Ue does not send INVITE + // @siclog "Step 14" siclog@ + f_Delay(10.0); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_InitialRegistration); + } + + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 12.20 + * @status APPROVED (IMS) + */ + function f_TC_12_20_IMS1() runs on IMS_PTC + { /* Emergency call / Success / SSAC / 0% access probability for MTSI MO speech call */ + + // Initial conditions + f_IMS_CC_Preamble(IPCAN_EmergencyCall, IMS_NULL, IMS_Security); // prose specifies only Annex C.2 => not applicable for GIBA @sic R5s140334 sic@ + // @sic R5s140334 sic@ + f_IMS_IPCAN_ModifyConfig(IPCAN, SIB2_TC_12_20); // @sic R5s141381 sic@ + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + f_IMS_Registration(); + f_IMS_CC_ReleaseConnection(IPCAN_InitialRegistration); + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); + f_IMS_IMS_WaitForTrigger(OtherPDN); /* @sic R5s140137 sic@ */ + f_IMS_CC_Postamble(IPCAN_EmergencyCall_NormalService); /* @sic R5s140137 sic@ */ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 12.20 + * @status APPROVED (IMS) + */ + function f_TC_12_20_IMS2() runs on IMS_PTC + { + var REGISTER_Request v_RegisterRequest; + var INVITE_Request v_InviteRequest; + + f_IMS_PTC_Init(PDN_2); + + f_IMS_IMS_WaitForTrigger(OtherPDN); + + f_IMS_TestBody_Set(true); + + // @siclog "Step 1 - 12" siclog@ + f_IMS_CC_StartCall(IPCAN_EmergencyCall_NormalService); + + // @siclog "Step 13 - 16" siclog@ + v_RegisterRequest := f_IMS_EmergencyRegistration_C20(); + + // Steps 17-19 - Are executed concurrently on the SS / IPCanEmu + // @siclog "Step 17 - 19" siclog@ + + // @siclog "Step 20 - 24" siclog@ + v_InviteRequest := f_IMS_EmergencyCallSetup_AnnexC22(); + + // @siclog "Step 25 - 26" siclog@ + f_IMS_EmergencyCallRelease(v_InviteRequest); + + f_IMS_TestBody_Set(false); + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); /* @sic R5s140137 sic@ */ + } + + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 12.20a + * + */ + function f_TC_12_20a_IMS1() runs on IMS_PTC + { /* Emergency call / Success / SSAC in connected mode / 0% access probability for MTSI MO speech call */ + //@sic R5-144688 sic@ + + // Initial conditions + f_IMS_CC_Preamble(IPCAN_EmergencyCall, IMS_NULL, IMS_Security); // prose specifies only Annex C.2 => not applicable for GIBA @sic R5s140334 sic@ + f_IMS_IPCAN_ModifyConfig(IPCAN, SIB2_TC_12_20a); // @sic R5s141381 sic@ + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + f_IMS_Registration(); + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); + f_IMS_IMS_WaitForTrigger(OtherPDN); + f_IMS_CC_Postamble(IPCAN_EmergencyCall_NormalService); + } + + /* + * @desc REFERENCE TS 34.229-1 clause 12.20a + * + */ + function f_TC_12_20a_IMS2() runs on IMS_PTC + { + var REGISTER_Request v_RegisterRequest; + var INVITE_Request v_InviteRequest; + + f_IMS_PTC_Init(PDN_2); + + f_IMS_IMS_WaitForTrigger(OtherPDN); + + f_IMS_TestBody_Set(true); + + // @siclog "Step 10 - 13" siclog@ + f_IMS_CC_StartCall(IPCAN_EmergencyCall_NormalService); + + // @siclog "Step 14 - 17" siclog@ + v_RegisterRequest := f_IMS_EmergencyRegistration_C20(); + + // Steps 18-20 - Are executed concurrently on the SS / IPCanEmu + // @siclog "Step 18 - 20" siclog@ + + // @siclog "Step 21 - 25" siclog@ + v_InviteRequest := f_IMS_EmergencyCallSetup_AnnexC22(); + + // @siclog "Step 26 - 27" siclog@ + f_IMS_EmergencyCallRelease(v_InviteRequest); + + f_IMS_TestBody_Set(false); + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); + } + + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 12.21 + * @status APPROVED (IMS) + */ + function f_TC_12_21_IMS() runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var INVITE_Request v_InviteRequest; + var MessageHeader v_MessageHeader_Response183; + + f_IMS_CC_Preamble(IPCAN_VideoCall, IMS_REGISTERED); + + f_IMS_TestBody_Set(true); + + // @siclog "Step 1" siclog@ + f_IMS_CC_StartCall(IPCAN_MO_VideoCall); + + // @siclog "Step 2" siclog@ + v_InviteRequestWithSdp := f_IMS_MOCallSetup_Video_Step2(C25); + v_InviteRequest := v_InviteRequestWithSdp.Invite; + + // @siclog "Step 3 - 4" siclog@ + v_MessageHeader_Response183 := f_IMS_MOCallSetup_Video_Step3_4(C25, v_InviteRequestWithSdp); + + // See TS. 36.508 EUTRA/EPS signalling for IMS MO video call Table 4.5A.8.3-1 Step 12-15 + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MO_VideoCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearers + + // @siclog "Step 5 - 13" siclog@ + f_IMS_MOCallSetup_AnnexC25_Steps5_13(v_InviteRequestWithSdp, v_MessageHeader_Response183); + + // @siclog "Step 14 - 15" siclog@ + f_IMS_CallReleaseMO(v_InviteRequest); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MO_VideoCall); + } + + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 12.22 + * @status APPROVED (IMS) + */ + function f_TC_12_22_IMS() runs on IMS_PTC + { /* MT MTSI Video call */ + var IMS_Response_Type v_SessionInProgress183; + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var IMS_ResponseWithSdp_Type v_ResponseWithSdp; + var template (value) INVITE_Request v_InviteRequest; + var SDP_Message v_SDP_MessageStep4; + var charstring v_FmtAudio := tsc_SDP_FmtAudio; + var charstring v_FmtVideo := tsc_SDP_FmtVideo; + var SipUrl v_ContactUrl; + + f_IMS_CC_Preamble(IPCAN_VideoCall, IMS_REGISTERED); + + f_IMS_TestBody_Set(true); + + f_IMS_CC_StartCall(IPCAN_MT_VideoCall); + + // @siclog "Step 1" siclog@ + v_InviteRequestWithSdp := f_IMS_MTCallSetup_Video_SendInvite(C26, Invite, v_FmtAudio, v_FmtVideo); + v_InviteRequest := v_InviteRequestWithSdp.Invite; + // @siclog "Step 2: Void" siclog@ + + // @siclog "Step 3 - 4" siclog@ + v_ResponseWithSdp := f_IMS_MTCallSetup_Video_Receive183(C26, v_InviteRequestWithSdp, v_FmtAudio, v_FmtVideo); + v_SessionInProgress183 := v_ResponseWithSdp.Response; + v_SDP_MessageStep4 := v_ResponseWithSdp.SdpMessage; + v_ContactUrl := f_MessageHeader_GetContactSipUrl(v_SessionInProgress183.msgHeader); + + // Establish Dedicated EPS bearer + // See TS. 36.508 EUTRA/EPS signalling for IMS MT video call Table 4.5A.9.3-1 Step 13-16 + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MT_VideoCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + + // @siclog "Step 5 - 13" siclog@ + f_IMS_MTCallSetup_AnnexC26_Steps5_13(v_InviteRequestWithSdp, v_FmtAudio, v_FmtVideo, v_SessionInProgress183, v_SDP_MessageStep4); + + // MT Call is now established + + // Step 14-15. SS sends BYE to release the call; UE sends 200 OK for the BYE request and ends the call + // @siclog "Step 14 - 15" siclog@ + f_IMS_CallReleaseMT(v_InviteRequest, v_ContactUrl); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MT_VideoCall); + } + + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 12.23 + */ + function f_TC_12_23_IMS() runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; /* @sic R5w140112: IMS_InviteRequestWithSdp_Type instead of IMS_DATA_REQ */ + var MessageHeader v_MessageHeader_Response183; + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + + f_IMS_TestBody_Set(true); + + // @siclog "Step 1" siclog@ + f_IMS_CC_StartCall(IPCAN_MO_SpeechCall); + + // @siclog "Step 2" siclog@ + v_InviteRequestWithSdp := f_IMS_MOCallSetup_AnnexC21_Step2_A4(-,-,true); + + // @siclog "Step 3 - 4" siclog@ + v_MessageHeader_Response183 := f_IMS_MOCallSetup_AnnexC21_Step3_4(v_InviteRequestWithSdp,-,-,-,true,"EVS-16000"); /* @sic R5w140112 sic@ */ + + // See TS. 36.508 EUTRA/EPS signalling for IMS MO speech call Table 4.5A.6.3-1 Step 9-11 + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MO_SpeechCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + + // @siclog "Step 5 - 13" siclog@ + f_IMS_MOCallSetup_AnnexC21_Steps5_13(v_InviteRequestWithSdp, v_MessageHeader_Response183); + + // @siclog "Step 14 - 15" siclog@ + f_IMS_CallReleaseMO(v_InviteRequestWithSdp.Invite); /* @sic R5-134116: parameter p_RecordRouteOfPrevResponse removed sic@ */ + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MO_SpeechCall); + } + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 12.24 + */ + function f_TC_12_24_IMS() runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; /* @sic R5w140112: v_InviteRequestWithSdp instead of v_InviteRequest sic@ */ + var IMS_ResponseWithSdp_Type v_ResponseWithSdp; /* @sic R5w140112 sic@ */ + var IMS_Response_Type v_SessionInProgress183; + var SipUrl v_ContactUrl; + var boolean v_IsC45:= true; + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + + f_IMS_TestBody_Set(true); + + f_IMS_CC_StartCall(IPCAN_MT_SpeechCall); + + // Steps 1 to 4 as defined in Annex C.11 + // @siclog "Step 1 - 4" siclog@ + v_InviteRequestWithSdp := f_IMS_MTCallSetup_AnnexC11_INVITE(v_IsC45); + v_ResponseWithSdp := f_IMS_MTCallSetup_AnnexC11_Steps1_4(v_InviteRequestWithSdp, v_IsC45); /* @sic R5-153950 sic@ */ + v_SessionInProgress183 := v_ResponseWithSdp.Response; + v_ContactUrl := f_MessageHeader_GetContactSipUrl(v_SessionInProgress183.msgHeader); + + // Establish Dedicated EPS bearer + // See TS. 36.508 EUTRA/EPS signalling for IMS MT speech call Table 4.5A.7.3-1 Step 9-12 + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MT_SpeechCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + + // Steps 5 to 13 as defined in Annex C.11 + // @siclog "Step 5 -13" siclog@ + f_IMS_MTCallSetup_AnnexC11_Steps5_13(v_InviteRequestWithSdp, v_ResponseWithSdp, v_IsC45); /* @sic R5-153950 sic@ */ + + // MT Call is now established + f_Delay(3.0); /* @sic R5s130510 change 1; draft prose CR sic@ */ + + // Step 14-15. SS sends BYE to release the call; UE sends 200 OK for the BYE request and ends the call + // @siclog "Step 14 -15" siclog@ + f_IMS_CallReleaseMT(v_InviteRequestWithSdp.Invite, v_ContactUrl); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MT_SpeechCall); + } + + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 12.25 + */ + function f_TC_12_25_IMS() runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; /* @sic R5w140112: IMS_InviteRequestWithSdp_Type instead of IMS_DATA_REQ */ + var MessageHeader v_MessageHeader_Response183; + var boolean v_IsC44:= true; + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + + f_IMS_TestBody_Set(true); + + // @siclog "Step 1" siclog@ + f_IMS_CC_StartCall(IPCAN_MO_SpeechCall); + + // @siclog "Step 2" siclog@ + v_InviteRequestWithSdp := f_IMS_MOCallSetup_AnnexC21_Step2_A4(-,-,v_IsC44); + + // @siclog "Step 3 - 4" siclog@ + v_MessageHeader_Response183 := f_IMS_MOCallSetup_AnnexC21_Step3_4(v_InviteRequestWithSdp,-,-,-,true, "AMR-WB"); /* @sic R5-153535 sic@ */ + + // See TS. 36.508 EUTRA/EPS signalling for IMS MO speech call Table 4.5A.6.3-1 Step 9-11 + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MO_SpeechCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + + // @siclog "Step 5 - 13" siclog@ + f_IMS_MOCallSetup_AnnexC21_Steps5_13(v_InviteRequestWithSdp, v_MessageHeader_Response183); + + // @siclog "Step 14 - 15" siclog@ + f_IMS_CallReleaseMO(v_InviteRequestWithSdp.Invite); /* @sic R5-134116: parameter p_RecordRouteOfPrevResponse removed sic@ */ + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MO_SpeechCall); + } + +} diff --git a/IMS_PART4_IWD_15wk38/IMS/15/IMS_CC_SSConferencingTestcases.ttcn b/IMS_PART4_IWD_15wk38/IMS/15/IMS_CC_SSConferencingTestcases.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cde53c5f13b821dcd635de8926c8e0c10c7319ec --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/15/IMS_CC_SSConferencingTestcases.ttcn @@ -0,0 +1,1161 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-15 19:05:27 +0200 (Tue, 15 Sep 2015) $ +// $Rev: 14431 $ +/******************************************************************************/ + +module IMS_CC_SSConferencingTestcases { + import from CommonDefs all; + import from IP_ASP_TypeDefs all; + import from LibSip_Common all; + import from LibSip_MessageBodyTypes all; + import from LibSip_SIPTypesAndValues all; + import from LibSip_SDPTypes all; + import from IMS_Component all; + import from IMS_ASP_TypeDefs all; + import from IMS_ASP_Templates all; + import from IMS_CommonParameters all; + import from IMS_CC_Parameters all; + import from IMS_CommonTemplates all; + import from IMS_CommonDefs all; + import from IMS_SIP_Templates all; + import from IMS_MessageBody_Templates all; + import from IMS_SDP_Templates all; + import from IMS_SDP_Messages all; + import from IMS_SDP_MessagesVideo all; + import from IMS_CC_CommonFunctions all; + import from IMS_Procedures_Registration all; + import from IMS_Procedures_CallControl all; + import from IMS_Procedures_CallHold all; + import from IMS_Procedures_Video all; + import from IMS_Procedures_Common all; + import from UpperTesterFunctions all; + import from IMS_PTC_CoordMsg all; + import from IMS_CommonFunctions all; + import from IMS_ConferenceEventPackage all; +// import from urn_ietf_params_xml_ns_conference_info all; + + const float tsc_WaitForConferenceSubscription := 3.0; /* @status APPROVED (IMS) */ + + //---------------------------------------------------------------------------- + /* + * @desc Send NOTIFY acc. to 34.229-1 Annex A.2.11 + * @param p_DialogIndex (default value: omit) + * @param p_ContactUri + * @param p_SubscriptionState + * @return template (value) MessageHeader + * @status APPROVED (IMS) + */ + function f_IMS_NotifyRequest_MessageHeader_A211(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit, + template (value) SipUrl p_ContactUri, + template (value) SubscriptionState p_SubscriptionState) runs on IMS_PTC return template (value) MessageHeader + { /* NOTE: this function requires a second "REFER" dialog being establisehed at the IMS PTC */ + /* @sic R5-153756, R5-153986: use of f_IMS_NotifyRequest_MessageHeader_Common sic@ */ + var template (value) Via v_Via := f_IMS_InviteRequest_ViaTX(); // same as for INVITE + var template (value) ContentType v_ContentType := cs_ContentType("message/sipfrag"); /* @sic R5-153756 sic@ */ + return f_IMS_NotifyRequest_MessageHeader_Common(p_DialogIndex, v_Via, p_ContactUri, "refer", p_SubscriptionState, v_ContentType); + } + + function f_IMS_NotifyRequest_MessageHeader_A213(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit, + charstring p_SubscriptionState_SubstateValue, + template SemicolonParam_List p_SubscriptionState_SubexpParams) runs on IMS_PTC return template (present) MessageHeader + { /* A.2.13 MO NOTIFY for refer package */ + /* NOTE: this function requires a second "REFER" dialog being establisehed at the IMS PTC */ + var template (present) MessageHeader v_MessageHeader_Notify := cr_MessageHeader_Dummy; + var template (present) integer v_CSeqValue := f_IMS_RequestInDialog_CSeqValueRX(dialogRemote, p_DialogIndex); + var template integer v_Port_ps := *; + var template integer v_Port_us := *; + var template (present) RouteBody_List v_RouteBodyList; + var IMS_ProtectedPorts_Type v_Protected; + + if (f_IMS_PTC_Security_IsStarted()) { + v_Protected := f_IMS_PTC_Security_GetProtectedPorts(); + v_Port_us := v_Protected.Port_us; + v_Port_ps := v_Protected.Port_ps; + } + v_RouteBodyList := { + cr_RouteBody(*, cr_SipUri_HostPort_lr(f_IMS_PTC_Pcscf_Get(), v_Port_ps)), + cr_RouteBody(*, cr_SipUri_HostPort_lr(px_IMS_Scscf)) + }; + + v_MessageHeader_Notify.via := f_IMS_InviteRequest_ViaRX(); /* additional checks required after message has been received (-> a_IMS_ReceiveNotifyForReferAndSendOK) */ + v_MessageHeader_Notify.route := cr_Route(v_RouteBodyList); + v_MessageHeader_Notify.toField := f_IMS_RequestInDialog_ToHeaderRX(p_DialogIndex); + v_MessageHeader_Notify.fromField := f_IMS_RequestInDialog_FromHeaderRX(p_DialogIndex); + v_MessageHeader_Notify.callId := f_IMS_PTC_ImsInfo_DialogGetCallId(p_DialogIndex); + v_MessageHeader_Notify.sessionId := f_IMS_PTC_ImsInfo_DialogGetSessionId(p_DialogIndex); + v_MessageHeader_Notify.cSeq := cr_CseqDef(v_CSeqValue, "NOTIFY"); + + v_MessageHeader_Notify.contact := cr_Contact(f_Contact_SipUri_HostPortRX(?, v_Port_us)); /* additional checks required after message has been received (-> a_IMS_ReceiveNotifyForReferAndSendOK) + @sic R5s150721, R5-153760: cr_SipUri_HostPort replaced by f_Contact_SipUri_HostPortRX sic@ */ + v_MessageHeader_Notify.contentType := cr_ContentType("message/sipfrag"); + v_MessageHeader_Notify.event := cr_EventDef("refer"); + + v_MessageHeader_Notify.maxForwards := cr_MaxForwardsDef; + v_MessageHeader_Notify.subscriptionState := cr_SubscriptionState(p_SubscriptionState_SubstateValue, p_SubscriptionState_SubexpParams); + + return v_MessageHeader_Notify; + } + + //============================================================================ + // Receive REFER + //---------------------------------------------------------------------------- + /* + * @desc MO REFER (see TS 34.229, A.2.10, C.19): + * creates new dialog for 15.18 and 15.19 ???; uses existing dialog acc. A.2.10 in C.19, 15.23 and 15.25 + * @param p_RequestUri + * @param p_ReferToUri + * @param p_ReferCreatingDialog + * @param p_CSeqValue + * @param p_SessionIdSupported (default value: pc_IMS_SessionIdSupported) + * @return template (present) MessageHeader + * @status APPROVED (IMS) + */ + function f_IMS_ReferRequest_MessageHeaderRX(template (present) SipUrl p_RequestUri, + template (present) SipUrl p_ReferToUri, + boolean p_ReferCreatingDialog, + template (present) integer p_CSeqValue, + boolean p_SessionIdSupported := pc_IMS_SessionIdSupported) runs on IMS_PTC return template (present) MessageHeader + { /* @sic R5s150086 - p_SessionIdSupported: pc_IMS_SessionIdSupported per default (only relevant in case of dialog creating REFER) sic@ */ + var boolean v_IsGiba := f_IMS_PTC_SecurityScheme_IsGiba(); // => A1/A2 + var template (present) MessageHeader v_MessageHeader_Refer := cr_MessageHeader_Dummy; + var template (present) RouteBody_List v_RouteBodyList; + var template (present) SipUrl v_SipUrlFrom := ?; + var template (present) From v_From; + var template (present) To v_To; + var template SessionId v_SessionId; + var template (present) CallId v_CallId; + var IMS_ProtectedPorts_Type v_Protected; + var template integer v_Port_us := ?; // Acc. A.2.10 mandatory even for GIBA + var template integer v_Port_ps := *; + + if (not v_IsGiba) { + v_Protected := f_IMS_PTC_Security_GetProtectedPorts(); + v_Port_us := v_Protected.Port_us; + v_Port_ps := v_Protected.Port_ps; + } + + if (p_ReferCreatingDialog) { + // FFS: currently not used + v_RouteBodyList := { // same as in INVITE + cr_RouteBody(*, cr_SipUri_HostPort_lr(f_IMS_PTC_Pcscf_Get(), v_Port_ps)), + cr_RouteBody(*, cr_SipUri_HostPort_lr(px_IMS_Scscf)) + }; + v_From := cr_From(*, v_SipUrlFrom); + v_To := cr_ToDef(p_RequestUri); + v_CallId := cr_CallId(?); + v_SessionId := f_IMS_SessionId_RX_IfSupported(p_SessionIdSupported); + + } else { + v_RouteBodyList := f_RouteSet_RouteBodyList_RX(); + v_From := f_IMS_RequestInDialog_FromHeaderRX(); + v_To := f_IMS_RequestInDialog_ToHeaderRX(); + v_CallId := f_IMS_PTC_ImsInfo_DialogGetCallId(); /* @sic R5-151954 sic@ */ + v_SessionId := f_IMS_PTC_ImsInfo_DialogGetSessionId(); + } + v_MessageHeader_Refer.via := f_IMS_InviteRequest_ViaRX(?); // same as for INVITE; but p_Port_us is mandatory + v_MessageHeader_Refer.route := cr_Route(v_RouteBodyList); + v_MessageHeader_Refer.toField := v_To; + v_MessageHeader_Refer.fromField := v_From; + v_MessageHeader_Refer.callId := v_CallId; + v_MessageHeader_Refer.sessionId := v_SessionId; + v_MessageHeader_Refer.cSeq := cr_CseqDef(p_CSeqValue, "REFER"); + + v_MessageHeader_Refer.maxForwards := cr_MaxForwardsDef; + v_MessageHeader_Refer.contact := cr_Contact(f_Contact_SipUri_HostPortRX(?, v_Port_us)); /* additional checks required after message has been received + @sic R5s150721, R5-153760: cr_SipUri_HostPort replaced by f_Contact_SipUri_HostPortRX sic@ */ + v_MessageHeader_Refer.referTo := cr_ReferTo(p_ReferToUri); + + if (not v_IsGiba) { + v_MessageHeader_Refer.require := cr_RequireSecAgree; + v_MessageHeader_Refer.proxyRequire := cr_ProxyRequireDef; + v_MessageHeader_Refer.securityVerify := f_IMS_PTC_BuildSecurityVerifyHeader(); + v_MessageHeader_Refer.pAccessNetworkInfo := cr_PAccessNetworkInfoDef(f_IMS_PTC_RanType_GetString()); + } else { + v_MessageHeader_Refer.securityVerify := omit; + } + + return v_MessageHeader_Refer; + } + + //---------------------------------------------------------------------------- + /* + * @desc Common checks for REFER + * @param p_IMS_REFER_REQ + * @param p_ReferCreatingDialog (default value: true) + * @status APPROVED (IMS) + */ + function f_IMS_A_2_10_Refer_CommonChecks(IMS_DATA_REQ p_IMS_REFER_REQ, + boolean p_ReferCreatingDialog := true) runs on IMS_PTC + { + var MessageHeader v_MessageHeader := p_IMS_REFER_REQ.Request.Refer.msgHeader; + var InternetProtocol_Type v_Protocol := p_IMS_REFER_REQ.RoutingInfo.Protocol; + var SipUrl v_SipUrlFrom := f_Addr_Union_GetSipUrl(v_MessageHeader.fromField.addressField); + + f_IMS_MessageHeader_Request_CheckVia(v_MessageHeader, v_Protocol); // check whether via contains "SIP URI with IP address or FQDN" (see @sic R5s120727 sic@) + f_IMS_MessageHeader_CheckContactAddr(v_MessageHeader); // check whether contact contains "SIP URI with IP address or FQDN" (see @sic R5s120727 sic@) + + if (p_ReferCreatingDialog) { + f_IMS_MessageHeader_CheckTo(v_MessageHeader, noToTag); // check that there is no To tag + + // Additional checks regarding SIP URI in the From header @sic R5-130750 change 3 sic@ + if (not f_IMS_PublicUserId_Match(f_IMS_PTC_ImsInfo_GetAllIMPUs(), v_SipUrlFrom)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "invalid 'From'"); + } + // Check Call-Id + if (match(v_MessageHeader.callId, f_IMS_PTC_ImsInfo_DialogGetCallId())) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "invalid 'CallId' in REFER (has to be different than in previous INVITE)"); + } + } + } + + //---------------------------------------------------------------------------- + /* + * @desc Recieve and check REFER + * @param p_IMS_REFER_REQ (by reference) + * @param p_RequestUriString + * @param p_ReferToUriString + * @param p_ActiveSessionToBeReplaced + * @param p_CSeqValue (default value: ?) + * @param p_ReferCreatingDialog (default value: false) + * @status APPROVED (IMS) + */ + altstep a_IMS_REFER_ReceiveRequest(out IMS_DATA_REQ p_IMS_REFER_REQ, + charstring p_RequestUriString, + charstring p_ReferToUriString, + boolean p_ActiveSessionToBeReplaced, + template (present) integer p_CSeqValue := ?, + boolean p_ReferCreatingDialog := false) runs on IMS_PTC + { /* @sic R5s141343 change 3.1: p_ReferCreatingDialog := false sic@ */ + /* @sic R5-153765: new parameter p_ActiveSessionToBeReplaced sic@ + * NOTE: p_ActiveSessionToBeReplaced==true => there is an active session between the UE and a remote user which shall be replaced (e.g. Three way session creation; 15.121a); + * p_ActiveSessionToBeReplaced==false => there is no active session with the remote user but the REFER is just ot invite the remote user */ + var IMS_DATA_REQ v_IMS_REFER_REQ; + var template (present) SipUrl v_RequestUriRefer := f_SIP_BuildSipUri_RX(p_RequestUriString); + var template AmpersandParam_List v_Headers := *; /* @sic R5-151798: SIP URI may contain a "Replaces" header referring to the dialog ID which has been established before sic@ */ + var template (present) SipUrl v_ReferToUri := f_SIP_BuildSipUri_RX(p_ReferToUriString, -, -, v_Headers); /* @sic R5s150382 change 3 sic@ */ + var template (present) MessageHeader v_MessageHeader_Refer := f_IMS_ReferRequest_MessageHeaderRX(v_RequestUriRefer, v_ReferToUri, p_ReferCreatingDialog, p_CSeqValue); + var template (omit) GenericParam v_Replaces; + var template (value) CallId v_CallId; + var CharStringList_Type v_ReceivedDialogId; + var template (present) CharStringList_Type v_ExpectedDialogId; + var integer v_CSeqValue; + + [] IMS_Server.receive(car_IMS_Refer_Request(cr_REFER_Request(v_RequestUriRefer, v_MessageHeader_Refer))) -> value v_IMS_REFER_REQ + { + f_IMS_A_2_10_Refer_CommonChecks(v_IMS_REFER_REQ, p_ReferCreatingDialog); + if (not isvalue(p_CSeqValue)) { /* when there are multiple REFERs in parallel, we cannot determine CSeq in advance */ + v_CSeqValue := f_IMS_PTC_ImsInfo_CseqIncr(dialogRemote); /* => get next CSeq value; CSeq gets incremented for the remote (UE) side of the current dialog */ + f_IMS_MessageHeader_CheckCSeq(v_IMS_REFER_REQ.Request.Refer.msgHeader, v_CSeqValue); /* @sic R5-151954 sic@ */ + } + // check whether header portion of the SIP URI includes Replaces header if an active session exists @sic R5-153765 sic@ + v_Replaces := f_SIP_AmpersandParamList_GetParam(v_IMS_REFER_REQ.Request.Refer.msgHeader.referTo.nameAddr.addrSpec.headers, "Replaces"); + if (p_ActiveSessionToBeReplaced) { /* @sic R5-153765 sic@ */ + if (ispresent(v_Replaces)) { + v_CallId := f_IMS_PTC_ImsInfo_DialogGetCallId(); + v_ExpectedDialogId := { + v_CallId.callid, + permutation("to-tag=" & valueof(f_IMS_PTC_ImsInfo_DialogGetRemoteTag()), "from-tag=" & valueof(f_IMS_PTC_ImsInfo_DialogGetLocalTag()), *) + }; + v_ReceivedDialogId := f_StringSplit(f_URL_Decoding(valueof(v_Replaces.paramValue.tokenOrHost)), {";"}); // see RFC 3891 6.1 + if (not match(v_ReceivedDialogId, v_ExpectedDialogId)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Invalid dialog id in Replaces header of Refer-To's SipUri"); + } + } else { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Refer-To does not include Replaces header even though there an active session"); + } + + } else { + if (ispresent(v_Replaces)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Refer-To includes Replaces header even though there no active session"); + } + } + p_IMS_REFER_REQ := v_IMS_REFER_REQ; // return message by ref + } + } + + //============================================================================ + // TS 34.229-1 Annex C.10 + //---------------------------------------------------------------------------- + /* + * @desc steps 2 .. 9 of C.10 (or steps 2 ..10 of C.38) + * @param p_TestProcedure + * @param p_ConferenceFactoryUri + * @param p_TemporaryConferenceUri + * @param p_FinalConferenceUri + * @param p_RadioBearersEstablished (default value: false) + * @return IMS_InviteRequestWithSdp_Type + * @status APPROVED (IMS) + */ + function f_IMS_ConferenceCreation_AnnexC10C38_Steps2_9(IMS_TestProcedure_Type p_TestProcedure, + charstring p_ConferenceFactoryUri, + charstring p_TemporaryConferenceUri, + charstring p_FinalConferenceUri, + boolean p_RadioBearersEstablished := false) runs on IMS_PTC return IMS_InviteRequestWithSdp_Type + { + var template (omit) SemicolonParam_List v_AdditionalContactParams := {cs_GenericParam("isfocus")}; // As per C.10 + var template (present) SipUrl v_ExpectedConferenceFactory; + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var INVITE_Request v_InviteRequest; + var MessageHeader v_MessageHeader_183; + var template (value) SipUrl v_ContactUrl; + var template (value) MessageHeader v_MessageHeader_InviteResponse_200; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL; + var template (present) MessageHeader v_MessageHeader_Ack; + var template (present) SipUrl v_ConferenceFactorySipUrl := f_SIP_BuildSipUri_RX(p_ConferenceFactoryUri); + + // @siclog "Step 2" siclog@ UE sends INVITE + select (p_TestProcedure) { // @sic R5s150373 change 1 sic@ + case (IPCAN_MO_SpeechCall) { + v_InviteRequestWithSdp := f_IMS_MOCallSetup_AnnexC21_Step2_Common(v_ConferenceFactorySipUrl); + } + case (IPCAN_MO_VideoCall) { + v_InviteRequestWithSdp := f_IMS_MOCallSetup_Video_Step2(C25, v_ConferenceFactorySipUrl); + } + } + v_InviteRequest := v_InviteRequestWithSdp.Invite; + + // check conference factory URI: + if (f_IMS_PTC_UE_ReleaseGreaterOrEqual(12)) { // @sic R5-150745, R5s150373 change 1; R5s150630: f_IMS_PTC_UE_ReleaseGreaterOrEqual sic@ + v_ExpectedConferenceFactory := f_SIP_BuildSipUri_RX("sip:mmtel@conf-factory." & px_IMS_HomeDomainName); + if (not match(v_InviteRequest.requestLine.requestUri, v_ExpectedConferenceFactory)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "invalid conference factory URI in request line"); + } + if (not match(f_Addr_Union_GetSipUrl(v_InviteRequest.msgHeader.toField.addressField), v_ExpectedConferenceFactory)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "invalid conference factory URI in To header"); + } + } + + // @siclog "Step 3 - 4" siclog@ + select (p_TestProcedure) { + case (IPCAN_MO_SpeechCall) { // same steps as for C.10 what in fact are steps 3 - 4 of C.21 + v_MessageHeader_183 := f_IMS_MOCallSetup_AnnexC21_Step3_4(v_InviteRequestWithSdp, p_TemporaryConferenceUri, v_AdditionalContactParams); + } + case (IPCAN_MO_VideoCall) { // same steps as for C.10 what in fact are steps 3 - 4 of C.25 + v_MessageHeader_183 := f_IMS_MOCallSetup_Video_Step3_4(C25, v_InviteRequestWithSdp, p_TemporaryConferenceUri, v_AdditionalContactParams); + } + } + if (not p_RadioBearersEstablished) { + // See TS. 36.508 EUTRA/EPS signalling for IMS MO speech call Table 4.5A.6.3-1 Step 9-11 + f_IMS_CC_TriggerDedicatedBearerActivation(p_TestProcedure); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + } + + // @siclog "Step 5 - 7a" siclog@ + select (p_TestProcedure) { + case (IPCAN_MO_SpeechCall) { // same steps as steps 5 - 8 of C.21 + f_IMS_MOCallSetup_AnnexC21_Steps5_8(v_InviteRequestWithSdp, v_MessageHeader_183); + } + case (IPCAN_MO_VideoCall) { // same steps as steps 5 - 8 of C.25 + f_IMS_MOCallSetup_Video_Steps5_8(C25, v_InviteRequestWithSdp, v_MessageHeader_183); // @sic R5s150373 change 1: C25 instead of AddVideo sic@ + } + } + // @siclog "Step 8" siclog@ Send 200 OK (response to INVITE) + v_MessageHeader_InviteResponse_200 := f_IMS_OtherResponse_200_MessageHeaderTX(v_InviteRequest.msgHeader); + v_ContactUrl := f_SIP_BuildSipUri_TX(p_FinalConferenceUri); + v_MessageHeader_InviteResponse_200.contact := cs_Contact(v_ContactUrl, v_AdditionalContactParams); /* @sic R5-151681 sic@ */ + v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(v_InviteRequestWithSdp.RoutingInfo); + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine200, v_MessageHeader_InviteResponse_200))); + + // @siclog "Step 9" siclog@ UE sends an ACK to acknowledge receipt of the 200 OK for INVITE + v_MessageHeader_Ack := f_IMS_AckRequest_MessageHeaderRX(v_InviteRequest, c_statusLine200); + IMS_Server.receive(car_IMS_Ack_Request(cr_ACK_Request(v_ContactUrl, v_MessageHeader_Ack))); + + return v_InviteRequestWithSdp; + } + + /* + * @desc steps 1 - 9 of C.10 or C.38 (video) + * @param p_TestProcedure + * @param p_ConferenceFactoryUri + * @param p_TemporaryConferenceUri + * @param p_FinalConferenceUri + * @return IMS_InviteRequestWithSdp_Type + * @status APPROVED (IMS) + */ + function f_IMS_ConferenceCreation_AnnexC10C38_Steps1_9(IMS_TestProcedure_Type p_TestProcedure, + charstring p_ConferenceFactoryUri, + charstring p_TemporaryConferenceUri, + charstring p_FinalConferenceUri) runs on IMS_PTC return IMS_InviteRequestWithSdp_Type + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + + // @siclog "Step 1" siclog@ Trigger UE to create conference call + f_IMS_CC_StartCall(p_TestProcedure, p_ConferenceFactoryUri, conferenceCall); /* @sic R5s150373: p_TestProcedure instead of IPCAN_MO_SpeechCall sic@ + @sic R5s150537: p_ConferenceFactoryUri sic@ */ + + // @siclog "Step 2 - 7a" siclog@ + v_InviteRequestWithSdp := f_IMS_ConferenceCreation_AnnexC10C38_Steps2_9(p_TestProcedure, p_ConferenceFactoryUri, p_TemporaryConferenceUri, p_FinalConferenceUri); + + return v_InviteRequestWithSdp; + } + + /* + * @desc steps 10 - 13 of C.10 or C.38 (video) + * @param p_FinalConferenceUri + * @return template (omit) SUBSCRIBE_Request + * @status APPROVED (IMS) + */ + function f_IMS_ConferenceCreation_AnnexC10C38_Steps10_13(charstring p_FinalConferenceUri) runs on IMS_PTC return template (omit) SUBSCRIBE_Request + { + var ConferenceEventPackage_SubscribeInfo_Type v_ConferenceEventPackage_SubscribeInfo_ByRef := valueof(cs_ConferenceEventPackage_SubscribeInfo_Init); + timer t_Timer; + + // @siclog "Step 10 - 13" siclog@ + t_Timer.start(tsc_WaitForConferenceSubscription); // @sic R5-151681: 3s timer sic@ + alt { + [] a_ConferenceEventPackage_Subscribe(v_ConferenceEventPackage_SubscribeInfo_ByRef, p_FinalConferenceUri) // C.10 step 10 - 13 + { + t_Timer.stop; /* stop timer when the UE comes up with a SUBSCRIBE for the conference event package */ + if (v_ConferenceEventPackage_SubscribeInfo_ByRef.State != subscribed) { + repeat; + } + } + [] t_Timer.timeout {} + } + return v_ConferenceEventPackage_SubscribeInfo_ByRef.SubscribeRequest; + } + + //============================================================================ + // TS 34.229-1 Annex C.19 / C.37 + //---------------------------------------------------------------------------- + + type enumerated AnnexC19C37_State_Type { waitForREFER, waitFor200OK_Step4, waitFor200OK_Step6, waitFor200OK_Step8, finished }; /* @status APPROVED (IMS) */ + + type record AnnexC19C37_StateInfo_Type { /* @status APPROVED (IMS) */ + AnnexC19C37_State_Type State, + charstring CalleeUri, // URI of the remote user to be invited + charstring CalleeContactUri, // Contact URI of the remote user to be invited + SipUrl ContactUriUE optional, // UE's Contact URI + MessageHeader NotifyHeader optional + }; + + template (value) AnnexC19C37_StateInfo_Type cs_AnnexC19C37_StateInfo_Init(charstring p_CalleeUri, + charstring p_CalleeContactUri) := + { /* @status APPROVED (IMS) */ + State := waitForREFER, + CalleeUri := p_CalleeUri, + CalleeContactUri := p_CalleeContactUri, + ContactUriUE := omit, + NotifyHeader := omit + }; + + /* + * @desc wait for the BYE of the given dialog + * @param p_StateInfo + * @return boolean + * @status APPROVED (IMS) + */ + function fl_AnnexC19C37_StateInfo_WaitForBYE(AnnexC19C37_StateInfo_Type p_StateInfo) return boolean + { + select (p_StateInfo.State) { + case (waitFor200OK_Step8, finished) {return true;} + case else {return false;} + } + } + + /* + * @desc procedure acc. to C.19 / C.37 + * @param p_StateInfo (by reference) + * @param p_FinalConferenceUri + * @param p_ActiveSessionToBeReplaced + * @param p_SubscriptionState_Step5 (default value: cs_SubscriptionState_Terminated) + * @param p_SubscribeRequest + * @param p_MediaTypeList + * @param p_ConferenceEventPackage_Version (default value: 1) + * @status APPROVED (IMS) + */ + altstep a_IMS_InviteUserToConference_AnnexC19C37(inout AnnexC19C37_StateInfo_Type p_StateInfo, + charstring p_FinalConferenceUri, + boolean p_ActiveSessionToBeReplaced, + template (value) SubscriptionState p_SubscriptionState_Step5 := cs_SubscriptionState_Terminated, + template (omit) SUBSCRIBE_Request p_SubscribeRequest, + CharStringList_Type p_MediaTypeList, + integer p_ConferenceEventPackage_Version := 1) runs on IMS_PTC + { /* @sic R5-153765: new parameter p_ActiveSessionToBeReplaced sic@ */ + var IMS_DATA_REQ v_IMS_REFER_REQ_ByRef; + var AnnexC19C37_State_Type v_State := p_StateInfo.State; + var MessageHeader v_MessageHeader_Refer; + var template (value) MessageHeader v_MessageHeader_Response; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL; + var SUBSCRIBE_Request v_SubscribeRequest; + var template (value) SipUrl v_ContactUrl; + var InternetProtocol_Type v_ProtocolForRequestInDL := f_IMS_PTC_ImsInfo_GetTransportProtocol(); + + // Step 1. UE sends REFER to SS + [v_State == waitForREFER] a_IMS_REFER_ReceiveRequest(v_IMS_REFER_REQ_ByRef, p_FinalConferenceUri, p_StateInfo.CalleeUri, p_ActiveSessionToBeReplaced) { + v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(v_IMS_REFER_REQ_ByRef.RoutingInfo); + v_MessageHeader_Refer := v_IMS_REFER_REQ_ByRef.Request.Refer.msgHeader; + + // Step 2. The SS responds with 202 Accepted + v_MessageHeader_Response := f_IMS_Accepted_202_MessageHeaderTX(v_MessageHeader_Refer); + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine202, v_MessageHeader_Response))); + + // Step 3. The SS sends initial NOTIFY for the implicit subscription created by the REFER request + p_StateInfo.ContactUriUE := f_MessageHeader_GetContactSipUrl(v_MessageHeader_Refer); // UE's contact to be use in the request line of the NOTIFY messages + v_ContactUrl := f_SIP_BuildSipUri_TX(p_FinalConferenceUri, f_IMS_PTC_GetPort_ps()); // contact uri of the conference focus + + p_StateInfo.NotifyHeader := valueof(f_IMS_NotifyRequest_MessageHeader_A211(-, v_ContactUrl, cs_SubscriptionState_Active("300"))); + IMS_Client.send(cas_IMS_Notify_Request(cs_IMS_RoutingInfo(v_ProtocolForRequestInDL), + cs_NOTIFY_Request(p_StateInfo.ContactUriUE, p_StateInfo.NotifyHeader, cs_MessageBody_SipFrag("SIP/2.0 100 Trying")))); + p_StateInfo.State := waitFor200OK_Step4; + } + // Step 4. UE responds with 200 OK + [v_State == waitFor200OK_Step4] a_IMS_ReceiveResponse200OK(p_StateInfo.NotifyHeader, v_ProtocolForRequestInDL) { + // Step 5. The SS sends a NOTIFY related to REFER request to confirm that the invited user was able to join the conference + p_StateInfo.NotifyHeader := valueof(f_IMS_NotifyRequest_MessageHeader_A211(-, p_StateInfo.ContactUriUE, p_SubscriptionState_Step5)); + IMS_Client.send(cas_IMS_Notify_Request(cs_IMS_RoutingInfo(v_ProtocolForRequestInDL), + cs_NOTIFY_Request(p_StateInfo.ContactUriUE, p_StateInfo.NotifyHeader, cs_MessageBody_SipFrag("SIP/2.0 200 OK")))); + p_StateInfo.State := waitFor200OK_Step6; + } + // Step 6. UE responds with 200 OK + [v_State == waitFor200OK_Step6] a_IMS_ReceiveResponse200OK(p_StateInfo.NotifyHeader, v_ProtocolForRequestInDL) { + if (ispresent(p_SubscribeRequest)) { + v_SubscribeRequest := valueof(p_SubscribeRequest); + + // Step 7. The SS sends a NOTIFY for conference event package to inform that the invited user was able to join the conference + p_StateInfo.NotifyHeader := valueof(f_IMS_ConferenceEventPackage_SendNotify(v_SubscribeRequest, + v_ProtocolForRequestInDL, + p_FinalConferenceUri, + p_StateInfo.CalleeUri, + p_StateInfo.CalleeContactUri, + p_MediaTypeList, + p_ConferenceEventPackage_Version, + partial)); + p_StateInfo.State := waitFor200OK_Step8; + } + else { + p_StateInfo.State := finished; + } + } + // Step 8. UE responds with 200 OK + [v_State == waitFor200OK_Step8] a_IMS_ReceiveResponse200OK(p_StateInfo.NotifyHeader, v_ProtocolForRequestInDL) { + p_StateInfo.State := finished; + } + } + + //**************************************************************************** + // Test case 15.17 + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 15.17 + * @status APPROVED (IMS) + */ + function f_TC_15_17_IMS() runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var charstring v_ConferenceFactoryUri := px_IMS_ConferenceFactoryUri; // @sic R5-150745 sic@ + var charstring v_TemporaryConferenceUri := px_IMS_TemporaryConferenceUri; // @sic R5-150745 sic@ + var charstring v_FinalConferenceUri := px_IMS_FinalConferenceUri; // @sic R5-150745 sic@ + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + + f_IMS_TestBody_Set(true); + + // @siclog "Step 1 - 9" siclog@ same steps as for C.10 + v_InviteRequestWithSdp := f_IMS_ConferenceCreation_AnnexC10C38_Steps1_9(IPCAN_MO_SpeechCall, v_ConferenceFactoryUri, v_TemporaryConferenceUri, v_FinalConferenceUri); /* @sic R5-150745 sic@ */ + + // @siclog "Step 10 - 13" siclog@ same steps as for C.10 + f_IMS_ConferenceCreation_AnnexC10C38_Steps10_13(v_FinalConferenceUri); /* @sic R5-150745 sic@ */ + + // @siclog "Step 14 - 15" siclog@ + f_IMS_CallReleaseMO(v_InviteRequestWithSdp.Invite, f_SIP_BuildSipUri_RX(v_FinalConferenceUri)); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MO_SpeechCall); + } + + //**************************************************************************** + // Test case 15.19 + //---------------------------------------------------------------------------- + /* + * @desc test body for TC_15_19 and TC_15_19a + * @param p_TestProcedure + * @param p_MediaTypeList + * @status APPROVED (IMS) + */ + function f_TC_15_19_TC_15_19a_Body(IMS_TestProcedure_Type p_TestProcedure, + CharStringList_Type p_MediaTypeList) runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var template (omit) SUBSCRIBE_Request v_SubscribeRequest := omit; + var charstring v_ConferenceFactoryUri := px_IMS_ConferenceFactoryUri; // @sic R5-150745 sic@ + var charstring v_TemporaryConferenceUri := px_IMS_TemporaryConferenceUri; // @sic R5-150745 sic@ + var charstring v_FinalConferenceUri := px_IMS_FinalConferenceUri; // @sic R5-150745 sic@ + var boolean v_ActiveSessionToBeReplaced := false; /* @sic R5-153765: there is no active session to any remote user sic@ */ + + var AnnexC19C37_StateInfo_Type v_AnnexC19C37_ByRef := valueof(cs_AnnexC19C37_StateInfo_Init(px_IMS_CalleeUri, px_IMS_CalleeContactUri)); + + var template (value) SubscriptionState v_SubscriptionState_Step5 := cs_SubscriptionState("terminated", { cs_GenericParam("reason", "noresource") } ); /* @sic R5s141343 change 3.3 and 4 sic@ */ + + // C.10 + v_InviteRequestWithSdp := f_IMS_ConferenceCreation_AnnexC10C38_Steps1_9(p_TestProcedure, v_ConferenceFactoryUri, v_TemporaryConferenceUri, v_FinalConferenceUri); // @sic R5-150745 sic@ + v_SubscribeRequest := f_IMS_ConferenceCreation_AnnexC10C38_Steps10_13(v_FinalConferenceUri); /* @sic R5-150745 sic@ */ + + f_IMS_TestBody_Set(true); + + f_UT_InviteToConference(MMI, v_AnnexC19C37_ByRef.CalleeUri); // @sic R5-150745 sic@ + + while (v_AnnexC19C37_ByRef.State != finished) { // @sic R5-150745 sic@ + // @siclog "Step 1 - 8" siclog@ + a_IMS_InviteUserToConference_AnnexC19C37(v_AnnexC19C37_ByRef, v_FinalConferenceUri, v_ActiveSessionToBeReplaced, v_SubscriptionState_Step5, v_SubscribeRequest, p_MediaTypeList); + } + + f_IMS_TestBody_Set(false); + + f_IMS_CallReleaseMO(v_InviteRequestWithSdp.Invite, f_SIP_BuildSipUri_RX(v_FinalConferenceUri)); // @sic R5s141343 change 1.2 sic@ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 15.19 + * @status APPROVED (IMS) + */ + function f_TC_15_19_IMS() runs on IMS_PTC + { + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + + f_TC_15_19_TC_15_19a_Body(IPCAN_MO_SpeechCall, tsc_MediaTypeList_Audio); + + f_IMS_CC_Postamble(IPCAN_MO_SpeechCall); + } + + /* + * @desc REFERENCE TS 34.229-1 clause 15.19a + * @status APPROVED (IMS) + */ + function f_TC_15_19a_IMS() runs on IMS_PTC + { + f_IMS_CC_Preamble(IPCAN_VideoCall, IMS_REGISTERED); + + f_TC_15_19_TC_15_19a_Body(IPCAN_MO_VideoCall, tsc_MediaTypeList_AudioVideo); + + f_IMS_CC_Postamble(IPCAN_MO_VideoCall); + } + + //**************************************************************************** + // Test case 15.21/21b + //---------------------------------------------------------------------------- + + altstep a_IMS_ReceiveNotifyForReferAndSendOK(charstring p_CallerSipAddrStr, + charstring p_SubscriptionState_SubstateValue, + template SemicolonParam_List p_SubscriptionState_SubexpParams := *, + boolean p_SubscriptionState_NoExpires := false, + boolean p_RepeatFlag := false) runs on IMS_PTC + { /* receive NOTIFY acc. to A.2.13 and respond with 200 OK */ + var template (present) MessageHeader v_MessageHeader_Template := f_IMS_NotifyRequest_MessageHeader_A213(-, p_SubscriptionState_SubstateValue, p_SubscriptionState_SubexpParams); + var template (present) MessageBody v_MessageBody := cr_MessageBody_SipFrag("SIP/2.0 100 Trying"); + var MessageHeader v_MessageHeader_Notify; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo; + var template (value) MessageHeader v_MessageHeader_200; + var template (omit) GenericParam v_ExpiresParam; + var IMS_DATA_REQ v_IMS_DATA_REQ; + + [] IMS_Server.receive(car_IMS_Notify_Request(cr_NOTIFY_Request(f_SIP_BuildSipUri_RX(p_CallerSipAddrStr), v_MessageHeader_Template, v_MessageBody))) -> value v_IMS_DATA_REQ + { + v_MessageHeader_Notify := v_IMS_DATA_REQ.Request.Notify.msgHeader; + // additional checks: + f_IMS_MessageHeader_CheckContactAddr(v_MessageHeader_Notify); // check whether contact contains "SIP URI with IP address or FQDN" + f_IMS_MessageHeader_Request_CheckVia(v_MessageHeader_Notify, v_IMS_DATA_REQ.RoutingInfo.Protocol); + if (p_SubscriptionState_NoExpires) { + v_ExpiresParam := f_SIP_SemicolonParamList_GetParam(v_MessageHeader_Notify.subscriptionState.substateParams, "expires"); + if (ispresent(v_ExpiresParam)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "'expires' shall be omitted in NOTIFY.subscriptionState"); + } + } + v_RoutingInfo := f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo); + v_MessageHeader_200 := f_IMS_OtherResponse_200_MessageHeaderTX(v_MessageHeader_Notify); + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo, cs_Response(c_statusLine200, v_MessageHeader_200))); + if (p_RepeatFlag) {repeat;} + } + } + + function fl_TC_15_21_TC_15_21b_Step3(IMS_TestProcedure_Type p_TestProcedure, + template (present) SipUrl p_ConferenceSipUri, + charstring p_ReferredByUri, + boolean p_GeolocationInfoAvailable := pc_IMS_Geolocation) runs on IMS_PTC return IMS_InviteRequestWithSdp_Type + { /* Receive INVITE for MO call setup with specific Referred-by header */ + var template (omit) float v_WaitDuration := omit; // no wait duration + var IMS_DATA_REQ v_IMS_DATA_REQ; + var SDP_Message v_SDP_Message; + var template (present) SDP_attribute_list v_SDP_MediaAttributes_Audio := { // @sic R5-151797/R5-151952: inactive/sendrecv removed sic@ + cr_SDP_Attribute_rtpmap(-, cr_RTPMAP_AMR_8000), + cr_SDP_Attribute_fmtp(-, cr_AMR_Fmtp_DefaultParameters), + cr_SDP_Attribute_rtpmap(-, cr_RTPMAP_TelephoneEvent), + cr_SDP_Attribute_ptime, + cr_SDP_Attribute_maxptime + }; + var template (present) SDP_attribute_list v_SDP_MediaAttributes_Video := { // @sic R5-151797: inactive removed sic@ + // The tcap/pcfg attributes need to be checked later when we know whether we have RTP/AVP or RTP/AVPF + cr_SDP_Attribute_rtpmap(-, cr_RTPMAP_H264_90000), + cr_SDP_Attribute_fmtp(-, cr_Video_Fmtp_DefaultParametersMO) + }; + + var template (present) SDP_attribute_list v_SDP_PrecondionAttributes := cr_SDP_PrecondionAttributes(c_none, c_none, c_mandatory, c_optional); + var template (present) MessageHeader v_MessageHeader_Dummy := cr_MessageHeader_Dummy; + var template (present) SDP_Message v_SDP_MessageRX; + + v_MessageHeader_Dummy.referredBy := cr_ReferredBy(f_SIP_BuildSipUri_RX(p_ReferredByUri)); /* dummy message header with specific Referred-by header; + all other headers are set in f_IMS_INVITE_ReceiveRequest_Common acc. to A_2_1_A4 */ + select (p_TestProcedure) { + case (IPCAN_MT_SpeechCall) { + v_SDP_MessageRX := f_IMS_BuildSDP_RX(cr_SDP_Time_Any, + cr_SDP_Media_Audio, + v_SDP_MediaAttributes_Audio, + v_SDP_PrecondionAttributes); + } + case (IPCAN_MT_VideoCall) { + v_SDP_MessageRX := f_IMS_BuildSDP_AudioVideo_RX(cr_SDP_Time_Any, + cr_SDP_Media_Audio, + v_SDP_MediaAttributes_Audio, + v_SDP_PrecondionAttributes, + cr_SDP_Media_Video(-, (c_rtpAvp, c_rtpAvpf)), + v_SDP_MediaAttributes_Video, + v_SDP_PrecondionAttributes); + } + } + + v_IMS_DATA_REQ := valueof(f_IMS_INVITE_ReceiveRequest_Common(-, v_MessageHeader_Dummy, tsc_OptionTagList_precondition, p_ConferenceSipUri, v_WaitDuration, -, p_GeolocationInfoAvailable)); + v_SDP_Message := f_IMS_MessageBody_CheckSdpMessageAndGeolocation(v_IMS_DATA_REQ.Request.Invite.messageBody, v_SDP_MessageRX, p_GeolocationInfoAvailable); + + // check media description: + f_IMS_SDP_CheckMediaDescr_AMR_8000_1(v_SDP_Message.media_list[0]); + if (p_TestProcedure == IPCAN_MT_VideoCall) { + f_IMS_SDP_CheckMediaDescr_H264_90000(v_SDP_Message.media_list[1]); + f_IMS_SDP_CheckMediaDescr_TcapPcfg(v_SDP_Message.media_list[1]); + } + + return f_IMS_InviteRequestWithSdpMO(v_IMS_DATA_REQ, v_SDP_Message); + } + + function fl_TC_15_21_TC_15_21b_Step5_6(charstring p_InvitingUri) runs on IMS_PTC + { + var template (present) charstring v_NonZeroValue := pattern "[1-9][0-9]#(,)"; + var template (present) SemicolonParam_List v_SubscriptionState_SubexpParams := cr_SemicolonParam_List_OneSpecificParamWithValue("expires", v_NonZeroValue); + + a_IMS_ReceiveNotifyForReferAndSendOK(p_InvitingUri, "active", v_SubscriptionState_SubexpParams); + } + + function fl_IMS_BuildSDP_TC_15_21_Step7(SDP_media_desc p_SDP_Media_AudioRx) runs on IMS_PTC return template (value) SDP_Message + { + var charstring v_FmtAudio := f_SDP_MediaDescr_GetAMR_8000_1(p_SDP_Media_AudioRx); + var template (value) SDP_bandwidth_list v_Bandwidth_List_Audio := p_SDP_Media_AudioRx.bandwidth; + var template (omit) SDP_attribute_list v_SDP_MediaAttributes_Audio := f_SDP_MediaAttributes_AudioDef(v_FmtAudio); + var template (omit) SDP_attribute_list v_SDP_PrecondionAttributes_Audio := f_SDP_Attributes_Add_TX(cs_SDP_PrecondionAttributes(c_none, c_none, c_mandatory, c_mandatory), cs_SDP_Attribute_conf_qos); + var integer v_BandwidthAS := 37; // @sic R5-151952 sic@ + + if (f_SDP_AttributeList_CheckAttribute(p_SDP_Media_AudioRx.attributes, cr_SDP_Attribute_inactive)) { /* @sic R5-151952/R5-151797 sic@ */ + v_SDP_MediaAttributes_Audio := f_SDP_Attributes_Add_TX(v_SDP_MediaAttributes_Audio, cs_SDP_Attribute_inactive); + } + return f_IMS_BuildSDP_TX(cs_SDP_Media_Audio(v_FmtAudio), v_Bandwidth_List_Audio, v_SDP_MediaAttributes_Audio, v_SDP_PrecondionAttributes_Audio, v_BandwidthAS); + } + + function fl_TC_15_21_TC_15_21b_Step7(IMS_TestProcedure_Type p_TestProcedure, + IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + charstring p_ContactUri) runs on IMS_PTC return MessageHeader + { /* Send 183 Session in Progress for INVITE to the UE + p_ContactUri shall be the conference URI */ + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(p_InviteRequestWithSdp.RoutingInfo); + var INVITE_Request v_InviteRequest := p_InviteRequestWithSdp.Invite; + var SDP_media_desc_list v_MediaList := p_InviteRequestWithSdp.SdpOffer.media_list; + var template (value) MessageHeader v_MessageHeader_183; + var template (value) SDP_Message v_SDP_Message; + + select (p_TestProcedure) { + case (IPCAN_MT_SpeechCall) { + v_SDP_Message := fl_IMS_BuildSDP_TC_15_21_Step7(v_MediaList[0]); + } + case (IPCAN_MT_VideoCall) { + v_SDP_Message := f_IMS_BuildSDP_MOCallAudioVideo_Step4(C25, v_MediaList[0], v_MediaList[1]); + } + } + + // Send 183 Session In Progress. + v_MessageHeader_183 := f_IMS_InviteResponse_183_MessageHeaderTX(v_InviteRequest, tsc_OptionTagList_precondition, p_ContactUri); + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine183, v_MessageHeader_183, cs_MessageBody_SDP(v_SDP_Message)))); + + return valueof(v_MessageHeader_183); + } + + function fl_TC_15_21_TC_15_21b_Step8_12(IMS_TestProcedure_Type p_TestProcedure, + IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + template (value) MessageHeader p_MessageHeader_Prev183Response) runs on IMS_PTC + { + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(p_InviteRequestWithSdp.RoutingInfo); + var INVITE_Request v_InviteRequest := p_InviteRequestWithSdp.Invite; + var template (value) MessageHeader v_MessageHeader_InviteResponse_200; + + // Steps 8 to 11 + select (p_TestProcedure) { + case (IPCAN_MT_SpeechCall) { + f_IMS_MOCallSetup_AnnexC21_Steps5_8(p_InviteRequestWithSdp, p_MessageHeader_Prev183Response); + } + case (IPCAN_MT_VideoCall) { + f_IMS_MOCallSetup_Video_Steps5_8(C25, p_InviteRequestWithSdp, p_MessageHeader_Prev183Response); + } + } + + // Step 12. Send 200 OK (response to INVITE) + v_MessageHeader_InviteResponse_200 := f_IMS_OtherResponse_200_MessageHeaderTX(v_InviteRequest.msgHeader); + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine200, v_MessageHeader_InviteResponse_200))); + } + + //---------------------------------------------------------------------------- + + function fl_TC_15_21_TC_15_21b_Body(IMS_TestProcedure_Type p_TestProcedure) runs on IMS_PTC + { /* TC 15.21 - Joining a conference after being invited to it */ + /* TC 15.21b - Joining a conference after being invited to it / video */ + /* Implementation: + * test case needs two dialogs: + * 1. dialog created by REFER between remote (inviting) UE (tsc_IMS_CallerSipAddrStr) and UE under test: UE notifies remote UE of state changes while joining the conference (-> RFC 3515 clause 2.4) + * 2. dialog created by INVITE between UE under test and SS (conference URI) + * this dialog is used by SUBSCRIBE between UE under test and SS (conference URI): conference focus may notify UE about state changes of the conference call + * The 2nd dialog is the "normal" dialog for the (conference) call - i.e. uses state variables to be stored at the IMS PTC as usual, + * and the 1st dialog needs also to store state variables at the IMS PTC as additional NOTIFY messages may occur referring to this dialog + * => We use the IMS PTC's first dialog for the call establishment (as usual) and the IMS PTC's third dialog for the "refer" dialog */ + var ConferenceEventPackage_SubscribeInfo_Type v_ConferenceEventPackage_SubscribeInfo_ByRef := valueof(cs_ConferenceEventPackage_SubscribeInfo_Init); + var charstring v_InvitingUri := tsc_IMS_CallerSipAddrStr; + var charstring v_ReferredByUri := "sip:master@conference.com"; + var charstring v_FinalConferenceUri := px_IMS_FinalConferenceUri; + var template (present) SipUrl v_ConferenceSipUrlRX := f_SIP_BuildSipUri_RX(v_FinalConferenceUri); + var IMS_DATA_RSP v_IMS_DATA_RSP; + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var INVITE_Request v_InviteRequest; + var MessageHeader v_MessageHeader_183; + var template (value) MessageHeader v_MessageHeader_Refer; + var template (value) REFER_Request v_ReferRequest; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL; + var SipUrl v_ContactUrl; + var InternetProtocol_Type v_Protocol; + var template (present) MessageHeader v_MessageHeader_Ack; + var template (present) SemicolonParam_List v_SubscriptionState_SubexpParams; + var boolean v_SubscriptionState_NoExpires; + var boolean v_WaitingForAck; + var boolean v_WaitingForNotify; + var boolean v_WaitingForSubscribe; + var boolean v_Continue; + timer t_Timer; + + f_IMS_TestBody_Set(true); + v_Protocol := f_IMS_PTC_ImsInfo_GetTransportProtocol(); + v_ContactUrl := f_IMS_PTC_ImsInfo_GetContactUrl(); + + // @siclog "Step 1" siclog@ SS sends REFER to UE referring to the conference + v_MessageHeader_Refer := f_IMS_ReferRequest_MessageHeaderTX(-, v_InvitingUri, v_FinalConferenceUri, v_ReferredByUri); + f_IMS_PTC_ImsInfo_DialogInit(dialogLocal, valueof(v_MessageHeader_Refer), referDialog); + v_ReferRequest := cs_REFER_Request(v_ContactUrl, v_MessageHeader_Refer); + IMS_Client.send(cas_IMS_Refer_Request(cs_IMS_RoutingInfo(v_Protocol), v_ReferRequest)); + + // @siclog "Step 2" siclog@ UE responds with a with a 202 Accepted response + v_IMS_DATA_RSP := f_IMS_ReceiveResponse(v_MessageHeader_Refer, v_Protocol, cr_Response(c_statusLine202, f_IMS_Accepted_202_MessageHeaderRX(v_MessageHeader_Refer))); + f_IMS_Dialog_SetRemoteTag(v_IMS_DATA_RSP.Response.msgHeader, referDialog); + + // @siclog "Step 3" siclog@ Receive INVITE + v_InviteRequestWithSdp := fl_TC_15_21_TC_15_21b_Step3(p_TestProcedure, v_ConferenceSipUrlRX, v_ReferredByUri); + v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(v_InviteRequestWithSdp.RoutingInfo); + v_InviteRequest := v_InviteRequestWithSdp.Invite; + + // @siclog "Step 4" siclog@ SS sends 100 Trying + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine100, f_IMS_InviteResponse_100_MessageHeaderTX(v_InviteRequest)))); + + // @siclog "Step 5 - 6" siclog@ UE sends NOTIFY, SS respondes with 200 OK + fl_TC_15_21_TC_15_21b_Step5_6(v_InvitingUri); + + // @siclog "Step 7" siclog@ SS sends 183 Session in Progress + v_MessageHeader_183 := fl_TC_15_21_TC_15_21b_Step7(p_TestProcedure, v_InviteRequestWithSdp, v_FinalConferenceUri); + + f_IMS_CC_TriggerDedicatedBearerActivation(p_TestProcedure); /* trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer; + as we have started the IPCAN as for MT call we also need to continue as if it is an MT call */ + // @siclog "Step 8 - 12" siclog@ UE sends PRACK, SS sends 200 OK; optionally: UE sends UPDATE, SS sends 200 OK; SS sends final 200 OK for INVITE + fl_TC_15_21_TC_15_21b_Step8_12(p_TestProcedure, v_InviteRequestWithSdp, v_MessageHeader_183); + + // @siclog "Step 13 - 15" siclog@ UE sends ACK, NOTIFY and optionally SUBSCRIBE, SS response to ACK with 200 OK and to optionally to SUBSCRIBE with 200 OK + v_MessageHeader_Ack := f_IMS_AckRequest_MessageHeaderRX(v_InviteRequest, c_statusLine200); + + v_WaitingForAck := true; + v_WaitingForNotify := true; + v_WaitingForSubscribe := true; + v_SubscriptionState_SubexpParams := cr_SemicolonParam_List_OneSpecificParamWithValue("reason", "noresource"); + v_SubscriptionState_NoExpires := true; // there shall be no "expires" in the Subscription-State + + t_Timer.start(tsc_WaitForConferenceSubscription); // @sic R5-151952: 3s timer sic@ + do { + alt { + // @siclog "Step 13 (ACK)" siclog@ + [v_WaitingForAck] IMS_Server.receive(car_IMS_Ack_Request(cr_ACK_Request(v_ConferenceSipUrlRX, v_MessageHeader_Ack))) { + v_WaitingForAck := false; + } + // @siclog "Step 13 (NOTIFY), Step 14" siclog@ + [v_WaitingForNotify] a_IMS_ReceiveNotifyForReferAndSendOK(v_InvitingUri, "terminated", v_SubscriptionState_SubexpParams, v_SubscriptionState_NoExpires) { + v_WaitingForNotify := false; + } + // @siclog "Step 13 (SUBSCRIBE), Step 15 - 17" siclog@ + [v_ConferenceEventPackage_SubscribeInfo_ByRef.State != subscribed] a_ConferenceEventPackage_Subscribe(v_ConferenceEventPackage_SubscribeInfo_ByRef, v_FinalConferenceUri) { + v_WaitingForSubscribe := false; + t_Timer.stop; + } + [] t_Timer.timeout { + v_WaitingForSubscribe := false; + } + } + v_Continue := v_WaitingForAck or v_WaitingForNotify or v_WaitingForSubscribe or f_ConferenceEventPackage_SubscriptionOngoing(v_ConferenceEventPackage_SubscribeInfo_ByRef); + } while (v_Continue); + + // @siclog "Step 18 - 19" siclog@ + v_ContactUrl := f_MessageHeader_GetContactSipUrl(v_MessageHeader_183); + f_IMS_CallReleaseMT(v_InviteRequestWithSdp.Invite, v_ContactUrl); + + f_IMS_TestBody_Set(false); + } + + function f_TC_15_21_IMS() runs on IMS_PTC + { /* TC 15.21 - Joining a conference after being invited to it */ + + // Initial conditions + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + + f_IMS_CC_StartCall(IPCAN_MT_SpeechCall); // IPCAN behaviour is as for MT call + + fl_TC_15_21_TC_15_21b_Body(IPCAN_MT_SpeechCall); + + f_IMS_CC_Postamble(IPCAN_MT_SpeechCall); + } + + function f_TC_15_21b_IMS() runs on IMS_PTC + { /* TC 15.21b - Joining a conference after being invited to it / video */ + + // Initial conditions + f_IMS_CC_Preamble(IPCAN_VideoCall, IMS_REGISTERED); + + f_IMS_CC_StartCall(IPCAN_MT_VideoCall); // IPCAN behaviour is as for MT call + + fl_TC_15_21_TC_15_21b_Body(IPCAN_MT_VideoCall); + + f_IMS_CC_Postamble(IPCAN_MT_VideoCall); + } + + //**************************************************************************** + // Test case 15.21a + //---------------------------------------------------------------------------- + /* + * @desc Three way session creation + * @param p_TestProcedure + * @status APPROVED (IMS) + */ + function f_TC_15_21a_TC_15_21c_Body(IMS_TestProcedure_Type p_TestProcedure) runs on IMS_PTC + { + var charstring v_ConferenceFactoryUri := px_IMS_ConferenceFactoryUri; // @sic R5-150745 sic@ + var charstring v_TemporaryConferenceUri := px_IMS_TemporaryConferenceUri; // @sic R5-150745 sic@ + var charstring v_FinalConferenceUri := px_IMS_FinalConferenceUri; // @sic R5-150745 sic@ + + var charstring v_CalleeUri_Dialog1 := px_IMS_CalleeUri; + var charstring v_CalleeUri_Dialog2 := px_IMS_CalleeUri2; // @sic R5-151710 sic@ + var charstring v_CalleeContactUri_Dialog1 := px_IMS_CalleeContactUri; + var charstring v_CalleeContactUri_Dialog2 := px_IMS_CalleeContactUri2; // @sic R5-151710 sic@ + var template (present) SipUrl v_CalleeSipUrl_Dialog1 := f_SIP_BuildSipUri_RX(v_CalleeUri_Dialog1); + var template (present) SipUrl v_CalleeSipUrl_Dialog2 := f_SIP_BuildSipUri_RX(v_CalleeUri_Dialog2); + + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp_Dialog1; + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp_Dialog2; + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp_Dialog3; + + var MessageHeader v_MessageHeader_183_Dialog1; + var MessageHeader v_MessageHeader_183_Dialog2; + + var ConferenceEventPackage_SubscribeInfo_Type v_ConferenceEventPackage_SubscribeInfo_ByRef := valueof(cs_ConferenceEventPackage_SubscribeInfo_Init); + var AnnexC19C37_StateInfo_Type v_AnnexC19C37_Dialog1_ByRef := valueof(cs_AnnexC19C37_StateInfo_Init(v_CalleeUri_Dialog1, v_CalleeContactUri_Dialog1)); + var AnnexC19C37_StateInfo_Type v_AnnexC19C37_Dialog2_ByRef := valueof(cs_AnnexC19C37_StateInfo_Init(v_CalleeUri_Dialog2, v_CalleeContactUri_Dialog2)); + + var SipUrl v_ContactUrl_Dialog1; + var SipUrl v_ContactUrl_Dialog2; + var SipUrl v_ContactUrl_UE; + + var template (omit) SUBSCRIBE_Request v_SubscribeRequest := omit; + var template (present) MessageHeader v_MessageHeader_Bye_Dialog1; + var template (present) MessageHeader v_MessageHeader_Bye_Dialog2; + var SDP_Message v_SDP_OriginalOffer_Dialog1; + var SDP_Message v_SDP_OriginalOffer_Dialog2; + var boolean v_RadioBearersEstablished := false; + var boolean v_WaitForBYE_Dialog1 := false; + var boolean v_WaitForBYE_Dialog2 := false; + var boolean v_Continue; + + var integer v_ConferenceEventPackage_Version := 1; // version used in notifications sent to the UE to inform about remote user has joined the conference + + var boolean v_ActiveSessionToBeReplaced := true; /* @sic R5-153765: there are active sessions to user B and C which shall be replaced by the conference sic@ */ + + //-------------------------------------------- + // DIALOG 1 + //-------------------------------------------- + // Setup MO speech call + f_IMS_CC_StartCall(p_TestProcedure, v_CalleeUri_Dialog1); // C.21/25 Step 1 + + select (p_TestProcedure) { + case (IPCAN_MO_SpeechCall) { + v_InviteRequestWithSdp_Dialog1 := f_IMS_MOCallSetup_AnnexC21_Step2_A4(v_CalleeSipUrl_Dialog1); // C.21 Step 2 + v_MessageHeader_183_Dialog1 := f_IMS_MOCallSetup_AnnexC21_Step3_4(v_InviteRequestWithSdp_Dialog1, v_CalleeContactUri_Dialog1); // C.21 Step 3, 4 + f_IMS_CC_TriggerDedicatedBearerActivation(p_TestProcedure); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + v_SDP_OriginalOffer_Dialog1 := f_IMS_MOCallSetup_AnnexC21_Steps5_13(v_InviteRequestWithSdp_Dialog1, v_MessageHeader_183_Dialog1, v_CalleeContactUri_Dialog1); // C.21 Step 5 .. 13 + } + case (IPCAN_MO_VideoCall) { + v_InviteRequestWithSdp_Dialog1 := f_IMS_MOCallSetup_Video_Step2(C25, v_CalleeSipUrl_Dialog1); // C.25 Step 2 + v_MessageHeader_183_Dialog1 := f_IMS_MOCallSetup_Video_Step3_4(C25, v_InviteRequestWithSdp_Dialog1, v_CalleeContactUri_Dialog1); // C.25 Step 3, 4 + f_IMS_CC_TriggerDedicatedBearerActivation(p_TestProcedure); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + v_SDP_OriginalOffer_Dialog1 := f_IMS_MOCallSetup_AnnexC25_Steps5_13(v_InviteRequestWithSdp_Dialog1, v_MessageHeader_183_Dialog1, v_CalleeContactUri_Dialog1); // C.25 Step 5 .. 13 + } + } + + v_ContactUrl_Dialog1 := f_MessageHeader_GetContactSipUrl(v_MessageHeader_183_Dialog1); + v_RadioBearersEstablished := true; + + f_IMS_TestBody_Set(true); + + //Steps 1 to 4 - Messages in Annex C.8 - Set ongoing call on hold + // @siclog "Step 1 - 4" siclog@ + f_UT_CallHold(MMI); + f_IMS_MOCallHoldResume_AnnexC8(HOLD, v_InviteRequestWithSdp_Dialog1.Invite, v_MessageHeader_183_Dialog1, v_SDP_OriginalOffer_Dialog1, v_CalleeContactUri_Dialog1); + f_IMS_PreliminaryPass(__FILE__, __LINE__, ""); + + //-------------------------------------------- + // DIALOG 2 + //-------------------------------------------- + + f_IMS_PTC_ImsInfo_ActivateDialog(secondDialog); + + // @siclog "Step 5 - 17" siclog@ Steps defined in Annex C.21 - MO call + select (p_TestProcedure) { + case (IPCAN_MO_SpeechCall) { + f_UT_RequestIMSCall(MMI, v_CalleeUri_Dialog2); // C.21 Step 1: There is no IPCAN signalling involved => f_IMS_CC_StartCall shall not be used + v_InviteRequestWithSdp_Dialog2 := f_IMS_MOCallSetup_AnnexC21_Step2_A4(v_CalleeSipUrl_Dialog2); // C.21 Step 2 + v_MessageHeader_183_Dialog2 := f_IMS_MOCallSetup_AnnexC21_Step3_4(v_InviteRequestWithSdp_Dialog2, v_CalleeContactUri_Dialog2); // C.21 Step 3, 4 + // NOTE: the radio bearers are already established + v_SDP_OriginalOffer_Dialog2 := f_IMS_MOCallSetup_AnnexC21_Steps5_13(v_InviteRequestWithSdp_Dialog2, v_MessageHeader_183_Dialog2, v_CalleeContactUri_Dialog2); // C.21 Step 5 .. 13 + } + case (IPCAN_MO_VideoCall) { + f_UT_RequestIMSVideoCall(MMI, v_CalleeUri_Dialog2); // C.25 Step 1: There is no IPCAN signalling involved => f_IMS_CC_StartCall shall not be used + v_InviteRequestWithSdp_Dialog2 := f_IMS_MOCallSetup_Video_Step2(C25, v_CalleeSipUrl_Dialog2); // C.25 Step 2 + v_MessageHeader_183_Dialog2 := f_IMS_MOCallSetup_Video_Step3_4(C25, v_InviteRequestWithSdp_Dialog2, v_CalleeContactUri_Dialog2); // C.25 Step 3, 4 + // NOTE: the radio bearers are already established + v_SDP_OriginalOffer_Dialog2 := f_IMS_MOCallSetup_AnnexC25_Steps5_13(v_InviteRequestWithSdp_Dialog2, v_MessageHeader_183_Dialog2, v_CalleeContactUri_Dialog2); // C.25 Step 5 .. 13 + } + } + v_ContactUrl_Dialog2 := f_MessageHeader_GetContactSipUrl(v_MessageHeader_183_Dialog2); + + f_IMS_PreliminaryPass(__FILE__, __LINE__, ""); + + f_UT_CallMPTY(MMI); // There is no IPCAN signalling involved => f_IMS_CC_StartCall shall not be used + f_IMS_MOCallHoldResume_AnnexC8(HOLD, v_InviteRequestWithSdp_Dialog2.Invite, v_MessageHeader_183_Dialog2, v_SDP_OriginalOffer_Dialog2, v_CalleeContactUri_Dialog2); + + //-------------------------------------------- + // DIALOG 3 + //-------------------------------------------- + + f_IMS_PTC_ImsInfo_ActivateDialog(thirdDialog); + + // @siclog "Step 18 - 30" siclog@ Steps defined in Annex C.10 + v_InviteRequestWithSdp_Dialog3 := f_IMS_ConferenceCreation_AnnexC10C38_Steps2_9(p_TestProcedure, v_ConferenceFactoryUri, v_TemporaryConferenceUri, v_FinalConferenceUri, v_RadioBearersEstablished); + v_ContactUrl_UE := f_MessageHeader_GetContactSipUrl(v_InviteRequestWithSdp_Dialog3.Invite.msgHeader); + + v_MessageHeader_Bye_Dialog1 := f_IMS_ByeRequest_MessageHeaderRX(v_InviteRequestWithSdp_Dialog1.Invite, -, firstDialog); + v_MessageHeader_Bye_Dialog2 := f_IMS_ByeRequest_MessageHeaderRX(v_InviteRequestWithSdp_Dialog2.Invite, -, secondDialog); + + do { + alt { + // @siclog "Step 27 - 30" siclog@ Annex C.10 Step 10 - 13 (UE subscribes the conference event) + [v_ConferenceEventPackage_SubscribeInfo_ByRef.State != subscribed] a_ConferenceEventPackage_Subscribe(v_ConferenceEventPackage_SubscribeInfo_ByRef, v_FinalConferenceUri) + { + v_SubscribeRequest := v_ConferenceEventPackage_SubscribeInfo_ByRef.SubscribeRequest; + } + // @siclog "Step 31 - 38" siclog@ Annex C.19 Step 1 - 8 + [v_AnnexC19C37_Dialog1_ByRef.State != finished] a_IMS_InviteUserToConference_AnnexC19C37(v_AnnexC19C37_Dialog1_ByRef, + v_FinalConferenceUri, + v_ActiveSessionToBeReplaced, + -, + v_SubscribeRequest, + tsc_MediaTypeList_Audio, + v_ConferenceEventPackage_Version) + { + v_WaitForBYE_Dialog1 := fl_AnnexC19C37_StateInfo_WaitForBYE(v_AnnexC19C37_Dialog1_ByRef); /* determine whether to wait for BYE for dialog 1 */ + if (v_AnnexC19C37_Dialog1_ByRef.State == waitFor200OK_Step8) { /* => when then UE has subscribed to the conference event package it gets notify that user 1 has joined the conference ... */ + v_ConferenceEventPackage_Version := v_ConferenceEventPackage_Version + 1; /* ... and the version needs to incremented for next notification */ + } + } + // @siclog "Step 39 - 46" siclog@ Annex C.19 Step 1 - 8 + [v_AnnexC19C37_Dialog2_ByRef.State != finished] a_IMS_InviteUserToConference_AnnexC19C37(v_AnnexC19C37_Dialog2_ByRef, + v_FinalConferenceUri, + v_ActiveSessionToBeReplaced, + -, + v_SubscribeRequest, + tsc_MediaTypeList_Audio, + v_ConferenceEventPackage_Version) + { + v_WaitForBYE_Dialog2 := fl_AnnexC19C37_StateInfo_WaitForBYE(v_AnnexC19C37_Dialog2_ByRef); /* determine whether to wait for BYE for dialog 2 */ + if (v_AnnexC19C37_Dialog2_ByRef.State == waitFor200OK_Step8) { /* => when then UE has subscribed to the conference event package it gets notify that user 2 has joined the conference ... */ + v_ConferenceEventPackage_Version := v_ConferenceEventPackage_Version + 1; /* ... and the version needs to incremented for next notification */ + } + } + //-------------------------------------------- + // DIALOG 1 + //-------------------------------------------- + // @siclog "Step 46A - 46B" siclog@ Step numbers are missing in the prose + [v_WaitForBYE_Dialog1] a_IMS_ReceiveByeSendOK(firstDialog, v_ContactUrl_Dialog1, v_MessageHeader_Bye_Dialog1) + { + v_WaitForBYE_Dialog1 := false; + } + + //-------------------------------------------- + // DIALOG 2 + //-------------------------------------------- + // @siclog "Step 46C - 46D" siclog@ + [v_WaitForBYE_Dialog2] a_IMS_ReceiveByeSendOK(secondDialog, v_ContactUrl_Dialog2, v_MessageHeader_Bye_Dialog2) + { + v_WaitForBYE_Dialog2 := false; + } + } + v_Continue := v_WaitForBYE_Dialog1 or v_WaitForBYE_Dialog2 + or (v_AnnexC19C37_Dialog1_ByRef.State != finished) or (v_AnnexC19C37_Dialog2_ByRef.State != finished) + or (isvalue(v_SubscribeRequest) and (v_ConferenceEventPackage_SubscribeInfo_ByRef.State != subscribed)); + + } while (v_Continue); + + f_IMS_PreliminaryPass(__FILE__, __LINE__, ""); + + // @siclog "Step 47 - 48" siclog@ Terminate conference + f_IMS_CallReleaseMT(v_InviteRequestWithSdp_Dialog3.Invite, v_ContactUrl_UE); + + f_IMS_TestBody_Set(false); + } + + /* + * @desc REFERENCE TS 34.229-1 clause 15.21a + * @status APPROVED (IMS) + */ + function f_TC_15_21a_IMS() runs on IMS_PTC + { // Three way session creation + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + + f_TC_15_21a_TC_15_21c_Body(IPCAN_MO_SpeechCall); + + f_IMS_CC_Postamble(IPCAN_MO_SpeechCall); + } + + /* + * @desc REFERENCE TS 34.229-1 clause 15.21c + * @status APPROVED (IMS) + */ + function f_TC_15_21c_IMS() runs on IMS_PTC + { // Three way session creation / video + + f_IMS_CC_Preamble(IPCAN_VideoCall, IMS_REGISTERED); + + f_TC_15_21a_TC_15_21c_Body(IPCAN_MO_VideoCall); + + f_IMS_CC_Postamble(IPCAN_MO_VideoCall); + } + +} diff --git a/IMS_PART4_IWD_15wk38/IMS/15/IMS_CC_SSTestcases.ttcn b/IMS_PART4_IWD_15wk38/IMS/15/IMS_CC_SSTestcases.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d3438c8528c5affbd3196cb4f6b6b1a6e8dba2ee --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/15/IMS_CC_SSTestcases.ttcn @@ -0,0 +1,876 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-16 20:33:09 +0200 (Wed, 16 Sep 2015) $ +// $Rev: 14474 $ +/******************************************************************************/ + +module IMS_CC_SSTestcases { + import from CommonDefs all; + import from IP_ASP_TypeDefs all; + import from LibSip_MessageBodyTypes all; + import from LibSip_SIPTypesAndValues all; + import from LibSip_SimpleMsgSummaryTypes all; + import from LibSip_SDPTypes all; + import from IMS_Component all; + import from IMS_ASP_TypeDefs all; + import from IMS_ASP_Templates all; + import from IMS_CommonParameters all; + import from IMS_CC_Parameters all; + import from IMS_CommonDefs all; + import from IMS_SIP_Templates all; + import from IMS_MessageBody_Templates all; + import from IMS_SDP_Templates all; + import from IMS_SDP_Messages all; + import from IMS_CC_CommonFunctions all; + import from IMS_Procedures_Registration all; + import from IMS_Procedures_CallControl all; + import from IMS_Procedures_CallHold all; + import from IMS_Procedures_Common all; + import from UpperTesterFunctions all; + import from IMS_PTC_CoordMsg all; + import from IMS_CommonFunctions all; + import from IMS_Procedures_Video all; + + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 15.8 + * @status APPROVED (IMS) + */ + function f_TC_15_8_IMS() runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; /* @sic R5w140112: IMS_InviteRequestWithSdp_Type instead of IMS_DATA_REQ */ + var MessageHeader v_MessageHeader_183; + var template (present) SipUrl v_NewContactUri; + var SDP_Message v_SDP_Message; + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + + f_IMS_TestBody_Set(true); + + // @siclog "Step 1" siclog@ + f_IMS_CC_StartCall(IPCAN_MO_SpeechCall); + + // @siclog "Step 2" siclog@ + v_InviteRequestWithSdp := f_IMS_MOCallSetup_AnnexC21_Step2_A4(); + + // @siclog "Step 3 - 4" siclog@ + v_MessageHeader_183 := f_IMS_MOCallSetup_AnnexC21_Step3_4(v_InviteRequestWithSdp); + + // See TS. 36.508 EUTRA/EPS signalling for IMS MO speech call Table 4.5A.6.3-1 Step 9-11 + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MO_SpeechCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + + // @siclog "Step 5 - 8" siclog@ + v_SDP_Message := f_IMS_MOCallSetup_AnnexC21_Steps5_8(v_InviteRequestWithSdp, v_MessageHeader_183); + + // @siclog "Step 9 - 9B" siclog@ + f_IMS_MOCallSetup_AnnexC21C25_Step9_11(v_InviteRequestWithSdp); + + // @siclog "Step 10 - 16" siclog@ + v_NewContactUri := fl_TC_15_8_Steps10_17(v_InviteRequestWithSdp, v_SDP_Message); /* @sic R5s140905: v_SDP_Message sic@ */ + + // @siclog "Step 17 -18" siclog@ + f_IMS_CallReleaseMO(v_InviteRequestWithSdp.Invite, v_NewContactUri); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MO_SpeechCall); + } + + /* + * @desc steps 10..17 of TC_15_8 + * @param p_InviteRequestWithSdp + * @param p_PreviousSDP_Message + * @return template (present) SipUrl + * @status APPROVED (IMS) + */ + function fl_TC_15_8_Steps10_17(IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + SDP_Message p_PreviousSDP_Message) runs on IMS_PTC return template (present) SipUrl + { /* return contact of the callee to which the call is forwarded to */ + /* @sic R5s140905: new parameter p_PreviousSDP_Message sic@ */ + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(p_InviteRequestWithSdp.RoutingInfo); + var INVITE_Request v_InviteRequest := p_InviteRequestWithSdp.Invite; + var SDP_Message v_SDP_MessageStep2 := p_InviteRequestWithSdp.SdpOffer; + var charstring v_ForwardedToCalleeContactUri := "sip:15.8@" & tsc_IMS_CallerDomain; + var template (present) SipUrl v_NewContactUriRX := f_SIP_BuildSipUri_RX(v_ForwardedToCalleeContactUri); + var template (value) SipUrl v_TargetedTo := f_SIP_BuildSipUri_TX("sip:user@company.com"); + var IMS_DATA_REQ v_IMS_DATA_REQ; + var template (value) MessageHeader v_MessageHeader_Response; + var template (present) MessageHeader v_MessageHeader_Request; + var PRACK_Request v_PrackRequest; + + // 15.8 Step 10 Send 181 Call is being forwarded + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine181, f_IMS_InviteResponse_181_MessageHeaderTX(v_InviteRequest, v_TargetedTo)))); + + // set new tag for the dialog: + f_IMS_PTC_ImsInfo_DialogSetLocalTag(f_IMS_GenerateTag("INVITE-FORWARDED")); /* @sic R5s140621 1st change: in terms of the response the To-tag in the local tag here sic@ */ + // cseq needs to be reset to the value of the INVITE (@sic R5s140621 2nd change sic@) + f_IMS_PTC_ImsInfo_CseqSet(dialogRemote, v_InviteRequest.msgHeader.cSeq.seqNumber); + + // 15.8 Step 11 Send 183 Session in Progress + f_IMS_PTC_ImsInfo_DialogSetSessIdTX("22222222"); /* @sic R5-150707 sic@ */ + f_IMS_PTC_ImsInfo_DialogSetSessVersionTX(22222221); /* @sic R5-150707 (NOTE: session version is incremented before being used in SDP message) sic@ */ + f_IMS_PTC_ImsInfo_DialogSetPrevSdpMessageRX(omit); /* @sic R5s150666, R5-153525 sic@ */ + + v_MessageHeader_Response := f_IMS_InviteResponse_183_MessageHeaderTX(v_InviteRequest, tsc_OptionTagList_precondition, v_ForwardedToCalleeContactUri); + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine183, + v_MessageHeader_Response, + cs_MessageBody_SDP(f_IMS_BuildSDP_AnnexC21_Step4(v_SDP_MessageStep2))))); /* @sic R5-144402 sic@ */ + + // 15.8 Step 12 - 13B (same as steps 5 - 8 of C.21) + f_IMS_MOCallSetup_AnnexC21_Steps5_8(p_InviteRequestWithSdp, v_MessageHeader_Response, -, p_PreviousSDP_Message); /* the procedure uses the (remote) contact address as in the 183 response (v_MessageHeader_Response) + => in fact v_ForwardedToCalleeContactUri is used + @sic R5s140905: p_PreviousSDP_Message sic@ */ + // 15.8 Step 14. 180 Ringing + v_MessageHeader_Response := f_IMS_InviteResponse_180_MessageHeaderTX(v_InviteRequest, v_ForwardedToCalleeContactUri); + v_MessageHeader_Response.historyInfo := cs_HistoryInfo(v_TargetedTo); + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine180, v_MessageHeader_Response))); + + // 15.8 Step 14A. Receive PRACK + v_MessageHeader_Request := f_IMS_PrackRequest_MessageHeaderRX(v_InviteRequest, v_MessageHeader_Response, omit); + IMS_Server.receive(car_IMS_Prack_Request(cr_PRACK_Request(v_NewContactUriRX, v_MessageHeader_Request))) -> value v_IMS_DATA_REQ; + v_PrackRequest := v_IMS_DATA_REQ.Request.Prack; + + // 15.8 Step 14B. Send 200 OK for PRACK + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine200, f_IMS_OtherResponse_200_MessageHeaderTX(v_PrackRequest.msgHeader)))); + + // Step 15. Send 200 OK for INVITE + v_MessageHeader_Response := f_IMS_OtherResponse_200_MessageHeaderTX(v_InviteRequest.msgHeader, -, -, v_ForwardedToCalleeContactUri); + v_MessageHeader_Response.historyInfo := cs_HistoryInfo(v_TargetedTo); + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine200, v_MessageHeader_Response))); + + // Step 16. Finally, UE acknowledges call setup. + v_MessageHeader_Request := f_IMS_AckRequest_MessageHeaderRX(v_InviteRequest, c_statusLine200); + IMS_Server.receive(car_IMS_Ack_Request(cr_ACK_Request(v_NewContactUriRX, v_MessageHeader_Request))); + + return v_NewContactUriRX; + } + + /* ************************************************************************** */ + /* + * @desc REFERENCE TS 34.229-1 clause 15.11 + * @status APPROVED (IMS) + */ + function f_TC_15_11_IMS() runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; /* @sic R5w140112: IMS_InviteRequestWithSdp_Type instead of IMS_DATA_REQ */ + var INVITE_Request v_InviteRequest; + var MessageHeader v_MessageHeader_Response183; + var SDP_Message v_SDP_OriginalOffer; + var SDP_Message v_SDP_HoldResumeOffer; + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + + // setup MO speech call + f_IMS_CC_StartCall(IPCAN_MO_SpeechCall); + + v_InviteRequestWithSdp := f_IMS_MOCallSetup_AnnexC21_Step2_A4(); + v_InviteRequest := v_InviteRequestWithSdp.Invite; + + v_MessageHeader_Response183 := f_IMS_MOCallSetup_AnnexC21_Step3_4(v_InviteRequestWithSdp); /* @sic R5w140112 sic@ */ + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MO_SpeechCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + v_SDP_OriginalOffer := f_IMS_MOCallSetup_AnnexC21_Steps5_13(v_InviteRequestWithSdp, v_MessageHeader_Response183); // v_SDP_OriginalOffer: SDP offer sent by the UE in step 5 or 7 of C.21 + + f_IMS_TestBody_Set(true); + + // @siclog "Step 1 - 4" siclog@ + f_UT_CallHold(MMI); + v_SDP_HoldResumeOffer := f_IMS_MOCallHoldResume_AnnexC8(HOLD, v_InviteRequest, v_MessageHeader_Response183, v_SDP_OriginalOffer); + f_IMS_PreliminaryPass(__FILE__, __LINE__, ""); + + // @siclog "Step 5 - 8" siclog@ + f_UT_CallResume(MMI); + f_IMS_MOCallHoldResume_AnnexC8(RESUME, v_InviteRequest, v_MessageHeader_Response183, v_SDP_OriginalOffer); + f_IMS_PreliminaryPass(__FILE__, __LINE__, ""); + + // @siclog "Step 9 -10" siclog@ + f_IMS_CallReleaseMO(v_InviteRequest); + + f_IMS_TestBody_Set(false); + f_IMS_CC_Postamble(IPCAN_MO_SpeechCall); + } + + /* ************************************************************************** */ + /* + * @desc REFERENCE TS 34.229-1 clause 15.11a + * @status APPROVED (IMS) + */ + function f_TC_15_11a_IMS() runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var INVITE_Request v_InviteRequest; + var MessageHeader v_MessageHeader_Response183; + var SDP_Message v_SDP_Offer; + var SDP_Message v_SDP_HoldResumeOffer; + + f_IMS_CC_Preamble(IPCAN_VideoCall, IMS_REGISTERED); + + // setup MO speech call + f_IMS_CC_StartCall(IPCAN_MO_VideoCall); + + v_InviteRequestWithSdp := f_IMS_MOCallSetup_Video_Step2(C25); + v_InviteRequest := v_InviteRequestWithSdp.Invite; + v_SDP_Offer := v_InviteRequestWithSdp.SdpOffer; + + v_MessageHeader_Response183 := f_IMS_MOCallSetup_Video_Step3_4(C25, v_InviteRequestWithSdp); + + // See TS. 36.508 EUTRA/EPS signalling for IMS MO video call Table 4.5A.8.3-1 Step 12-15 + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MO_VideoCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearers + + v_SDP_Offer := f_IMS_MOCallSetup_AnnexC25_Steps5_13(v_InviteRequestWithSdp, v_MessageHeader_Response183); + + f_IMS_TestBody_Set(true); + + // @siclog "Step 1 - 4" siclog@ + f_UT_CallHold(MMI); + v_SDP_HoldResumeOffer := f_IMS_MOCallHoldResume_AnnexC8(HOLD, v_InviteRequest, v_MessageHeader_Response183, v_SDP_Offer); + f_IMS_PreliminaryPass(__FILE__, __LINE__, ""); + + // @siclog "Step 5 - 8" siclog@ + f_UT_CallResume(MMI); + f_IMS_MOCallHoldResume_AnnexC8(RESUME, v_InviteRequest, v_MessageHeader_Response183, v_SDP_Offer); + f_IMS_PreliminaryPass(__FILE__, __LINE__, ""); + + // @siclog "Step 9 -10" siclog@ + f_IMS_CallReleaseMO(v_InviteRequest); + + f_IMS_TestBody_Set(false); + f_IMS_CC_Postamble(IPCAN_MO_VideoCall); + } + + /****************************************************************************/ + /* + * @desc change bandwidth for hold/resume acc. to C.9 + * @param p_BandwidthList + * @param p_Modifier + * @param p_Value + * @return template (value) SDP_bandwidth_list + * @status APPROVED (IMS) + */ + function fl_IMS_CallHoldResume_AnnexC9_ChangeBandwidth(template (omit) SDP_bandwidth_list p_BandwidthList, + charstring p_Modifier, + integer p_Value) return template (value) SDP_bandwidth_list + { // @sic R5-142993: New function sic@ + var template (value) SDP_bandwidth_list v_BandwidthList; + var template (value) SDP_bandwidth_list v_NewBandwidthList; + var integer i; + var integer k := 0; + + if (isvalue(p_BandwidthList)) { + v_BandwidthList := valueof(p_BandwidthList); + for (i := 0; i < lengthof(v_BandwidthList); i := i+1) { + if (not match(p_Modifier, v_BandwidthList[i].modifier)) { // NOTE: p_BandwidthList may or may not include a bandwidth with the given modifier + v_NewBandwidthList[k] := v_BandwidthList[i]; + k:=k+1; + } + } + } + v_NewBandwidthList[k] := cs_SDP_Bandwidth(p_Modifier, p_Value); + return v_NewBandwidthList; + } + + /* + * @desc build up SDP message for step 1 of C.9 + * @param p_HoldResume + * @param p_SDP_LatestMessageBySSBeforeHold + * @param p_RtcpDuringHold (default value: pc_SendRTCPOnlyOnHold) + * @return template (value) SDP_Message + * @status APPROVED (IMS) + */ + function fl_IMS_BuildSDP_AnnexC9_Step1(IMS_CallHoldResume_Type p_HoldResume, + template (value) SDP_Message p_SDP_LatestMessageBySSBeforeHold, + boolean p_RtcpDuringHold := pc_SendRTCPOnlyOnHold) return template (value) SDP_Message + { + var template (value) SDP_Message v_SDP_Message := p_SDP_LatestMessageBySSBeforeHold; + var integer v_SessionVersion := str2int(valueof(p_SDP_LatestMessageBySSBeforeHold.origin.session_version)); + var template (omit) SDP_bandwidth_list v_BandwidthList := v_SDP_Message.bandwidth; + var template (omit) SDP_media_desc_list v_SDP_Media_Desc_List; + var integer v_BandwidthRR; + + select (p_HoldResume) { + case (HOLD) { + v_SessionVersion := v_SessionVersion + 1; + v_BandwidthRR := 200; // @sic R5-142993 sic@ + v_SDP_Media_Desc_List := f_IMS_SDP_MediaList_ExchangeAttribute(v_SDP_Message.media_list, cr_SDP_Attribute_AnySendRecvMode, cs_SDP_Attribute_sendonly); // @sic R5-142993: -> cr_SDP_Attribute_AnySendRecvMode sic@ + } + case (RESUME) { + v_SessionVersion := v_SessionVersion + 2; + v_BandwidthRR := 0; // @sic R5-142993 sic@ + v_SDP_Media_Desc_List := f_IMS_SDP_MediaList_ExchangeAttribute(v_SDP_Message.media_list, cr_SDP_Attribute_AnySendRecvMode, cs_SDP_Attribute_sendrecv); // @sic R5-142993: -> cr_SDP_Attribute_AnySendRecvMode sic@ + v_BandwidthList := v_SDP_Message.bandwidth; + } + } + if (p_RtcpDuringHold) { + v_BandwidthList := fl_IMS_CallHoldResume_AnnexC9_ChangeBandwidth(v_BandwidthList, "RR", v_BandwidthRR); // @sic R5-142993 sic@ + } + v_SDP_Message.origin.session_version := int2str(v_SessionVersion); + v_SDP_Message.bandwidth := v_BandwidthList; + v_SDP_Message.media_list := v_SDP_Media_Desc_List; + + return v_SDP_Message; + } + + /* + * @desc build up SDP message for step 3 of C.9 + * @param p_LatestSdpBySSBeforeHold + * @return template (present) SDP_Message + * @status APPROVED (IMS) + */ + function fl_IMS_BuildSDP_AnnexC9_Step3(template (value) SDP_Message p_LatestSdpBySSBeforeHold) runs on IMS_PTC return template (present) SDP_Message + { /* @sic R5s150371: parameter p_LatestSdpBySSBeforeHold sic@ */ + var charstring v_AddrType := f_IMS_PTC_NW_Address_GetTypeStr(); + var template (present) charstring v_IPAddrOrigin := ?; + var template (present) charstring v_IPAddrConnection := ?; + var template SDP_bandwidth_list v_SDP_bandwidth_list := *; + var template SDP_attribute_list v_SDP_Attribute_List := *; /* NOTE: direction attribute is checked after message has been received */ + var template (present) SDP_media_desc v_SDP_Media_Desc_Audio := cr_SDP_Media_Desc(cr_SDP_Media_Audio(cr_SDP_AnyMediaFormatDescr, ?, ?), + cr_SDP_Connection(v_AddrType, ?), + v_SDP_bandwidth_list, + v_SDP_Attribute_List); + var template (present) SDP_media_desc v_SDP_Media_Desc_Video := cr_SDP_Media_Desc(cr_SDP_Media_Video(cr_SDP_AnyMediaFormatDescr, ?), + cr_SDP_Connection(v_AddrType, ?), + v_SDP_bandwidth_list, + v_SDP_Attribute_List); + var template (present) SDP_media_desc_list v_SDP_Media_Desc_List; + + select (lengthof(p_LatestSdpBySSBeforeHold.media_list)) { /* @sic R5s150371 change 1 sic@ */ + case (1) { + v_SDP_Media_Desc_List := { v_SDP_Media_Desc_Audio }; + } + case (2) { + v_SDP_Media_Desc_List := { v_SDP_Media_Desc_Audio, v_SDP_Media_Desc_Video }; + } + case else { + FatalError(__FILE__, __LINE__, ""); + } + } + return cr_SDP_Message_Common(v_AddrType, v_IPAddrOrigin, v_IPAddrConnection, -, -, v_SDP_Media_Desc_List); + } + + /* + * @desc Check recv mode for call hold/resume acc. to C.9 + * @param p_HoldResume + * @param p_SDP_Message + * @status APPROVED (IMS) + */ + function fl_IMS_MTCallHoldResume_AnnexC9_CheckSendRecvMode(IMS_CallHoldResume_Type p_HoldResume, + SDP_Message p_SDP_Message) runs on IMS_PTC + { + var template (present) SDP_attribute v_ExpectedDirectionAttribute; + + select (p_HoldResume) { + case (HOLD) { v_ExpectedDirectionAttribute := cr_SDP_Attribute_recvonly; } + case (RESUME) { v_ExpectedDirectionAttribute := cr_SDP_Attribute_sendrecv; } + } + + if (not f_SDP_CheckMediaListAttributes(p_SDP_Message.media_list, v_ExpectedDirectionAttribute) and + not f_SDP_AttributeList_CheckAttribute(p_SDP_Message.attributes, v_ExpectedDirectionAttribute)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "missing expected direction attribute"); + } + } + + /* + * @desc MT call hold according to Annex C.9 (TS 34.229-1) + * @param p_HoldResume + * @param p_ContactUrl + * @param p_LatestSdpBySSBeforeHold + * @status APPROVED (IMS) + */ + function f_IMS_MTCallHoldResume_AnnexC9(IMS_CallHoldResume_Type p_HoldResume, + SipUrl p_ContactUrl, + template (value) SDP_Message p_LatestSdpBySSBeforeHold) runs on IMS_PTC + { + var template (value) MessageHeader v_MessageHeader_Invite := f_IMS_InviteRequest_MessageHeaderTX(-, A_2_1_A5); + var template (value) SDP_Message v_SDP_MessageTX := fl_IMS_BuildSDP_AnnexC9_Step1(p_HoldResume, p_LatestSdpBySSBeforeHold); + var template (value) INVITE_Request v_InviteRequest := cs_INVITE_Request(p_ContactUrl, v_MessageHeader_Invite, cs_MessageBody_SDP(v_SDP_MessageTX)); + var template (value) MessageHeader v_MessageHeader_Ack := f_IMS_AckRequest_MessageHeaderTX(v_InviteRequest); + var InternetProtocol_Type v_Protocol := f_IMS_PTC_ImsInfo_GetTransportProtocol(); + var IMS_DATA_RSP v_IMS_DATA_RSP; + var SDP_Message v_SDP_MessageRX; + var boolean v_Trying := false; + + // Step 1 - Send INVITE + IMS_Client.send(cas_IMS_Invite_Request(cs_IMS_RoutingInfo(v_Protocol), v_InviteRequest)); + alt { + // Step 2 - Receive optional 100 Trying + [not v_Trying] a_IMS_ReceiveResponse(v_MessageHeader_Invite, + v_Protocol, + cr_Response(c_statusLine100, f_IMS_InviteResponse_100_MessageHeaderRX(v_InviteRequest)), + v_IMS_DATA_RSP) /* @sic R5s140350: v_IMS_DATA_RSP is 'out' parameter sic@ */ + { + v_Trying := true; + repeat; + } + // Step 3 - Receive 200 OK + [] a_IMS_ReceiveResponse(v_MessageHeader_Invite, + v_Protocol, + cr_Response(c_statusLine200, f_IMS_OtherResponse_200_MessageHeaderRX(v_MessageHeader_Invite, cr_ContentTypeSDP), cr_MessageBody_SDP), // @sic R5s140571: cr_MessageBody_SDP sic@ + v_IMS_DATA_RSP) /* @sic R5s140350: v_IMS_DATA_RSP is 'out' parameter sic@ */ + { + v_SDP_MessageRX := f_IMS_SIP_SdpMessageBody_DecodeMatchAndCheckSDP(v_IMS_DATA_RSP.Response.messageBody, + fl_IMS_BuildSDP_AnnexC9_Step3(p_LatestSdpBySSBeforeHold)); /* @sic R5s140324 - additional change 1 sic@ + @sic R5s150371: parameter p_LatestSdpBySSBeforeHold sic@ */ + fl_IMS_MTCallHoldResume_AnnexC9_CheckSendRecvMode(p_HoldResume, v_SDP_MessageRX); + // @sic R5-142993: no bandwidth to be checked sic@ + } + } + // Step 4. Send ACK. The SS acknowledges the receipt of 200 OK for INVITE. + IMS_Client.send(cas_IMS_Ack_Request(cs_IMS_RoutingInfo(v_Protocol), cs_ACK_Request(p_ContactUrl, v_MessageHeader_Ack))); + } + + /* ************************************************************************** */ + /* + * @desc REFERENCE TS 34.229-1 clause 15.12 + * @status APPROVED (IMS) + */ + function f_TC_15_12_IMS() runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; /* @sic R5w140112: IMS_InviteRequestWithSdp_Type instead of IMS_DATA_REQ */ + var INVITE_Request v_InviteRequest; + var MessageHeader v_MessageHeader_183; + var SDP_Message v_SDP_LatestMessageByUE; + var template (value) SDP_Message v_SDP_LatestMessageBySS; + var SipUrl v_ContactUrl; + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + + // setup MO speech call + f_IMS_CC_StartCall(IPCAN_MO_SpeechCall); // C.21 Step 1 + + v_InviteRequestWithSdp := f_IMS_MOCallSetup_AnnexC21_Step2_A4(); // C.21 Step 2 + v_InviteRequest := v_InviteRequestWithSdp.Invite; + v_ContactUrl := f_Addr_Union_GetSipUrl(v_InviteRequest.msgHeader.contact.contactBody.contactAddresses[0].addressField); + + v_MessageHeader_183 := f_IMS_MOCallSetup_AnnexC21_Step3_4(v_InviteRequestWithSdp); // C.21 Step 3, 4 + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MO_SpeechCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + v_SDP_LatestMessageByUE := f_IMS_MOCallSetup_AnnexC21_Steps5_13(v_InviteRequestWithSdp, v_MessageHeader_183); // @sic R5s120609 sic@ + v_SDP_LatestMessageBySS := f_IMS_BuildSDP_AnnexC21C25_Step6or8(v_SDP_LatestMessageByUE); // as in f_IMS_MOCallSetup_AnnexC21_Steps5_13 + + f_IMS_TestBody_Set(true); + + // @siclog "Step 1 - 4" siclog@ + f_IMS_MTCallHoldResume_AnnexC9(HOLD, v_ContactUrl, v_SDP_LatestMessageBySS); + f_IMS_PreliminaryPass(__FILE__, __LINE__, ""); + + // @siclog "Step 5 - 8" siclog@ + f_IMS_MTCallHoldResume_AnnexC9(RESUME, v_ContactUrl, v_SDP_LatestMessageBySS); + f_IMS_PreliminaryPass(__FILE__, __LINE__, ""); + + // @siclog "Step 9 -10" siclog@ + f_IMS_CallReleaseMT(v_InviteRequest, v_ContactUrl); + + f_IMS_TestBody_Set(false); + f_IMS_CC_Postamble(IPCAN_MO_SpeechCall); + } + + + /* ************************************************************************** */ + /* + * @desc REFERENCE TS 34.229-1 clause 15.12a + * @status APPROVED (IMS) + */ + function f_TC_15_12a_IMS() runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; /* @sic R5w140112: IMS_InviteRequestWithSdp_Type instead of IMS_DATA_REQ */ + var INVITE_Request v_InviteRequest; + var MessageHeader v_MessageHeader_Response183; + var SDP_Message v_SDP_UE; + var template (value) SDP_Message v_SDP_SS; + var SipUrl v_ContactUrl; + + f_IMS_CC_Preamble(IPCAN_VideoCall, IMS_REGISTERED); + + // setup MO speech call + f_IMS_CC_StartCall(IPCAN_MO_VideoCall); // C.25 Step 1 + + v_InviteRequestWithSdp := f_IMS_MOCallSetup_Video_Step2(C25); + v_InviteRequest := v_InviteRequestWithSdp.Invite; + v_ContactUrl := f_Addr_Union_GetSipUrl(v_InviteRequest.msgHeader.contact.contactBody.contactAddresses[0].addressField); + + v_SDP_UE := v_InviteRequestWithSdp.SdpOffer; + + v_MessageHeader_Response183 := f_IMS_MOCallSetup_Video_Step3_4(C25, v_InviteRequestWithSdp); + + // See TS. 36.508 EUTRA/EPS signalling for IMS MO video call Table 4.5A.8.3-1 Step 12-15 + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MO_VideoCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearers + + v_SDP_UE := f_IMS_MOCallSetup_AnnexC25_Steps5_13(v_InviteRequestWithSdp, v_MessageHeader_Response183); + + f_IMS_TestBody_Set(true); + + // @siclog "Step 1 - 4" siclog@ + v_SDP_SS := f_IMS_BuildSDP_AnnexC21C25_Step6or8(v_SDP_UE); + f_IMS_MTCallHoldResume_AnnexC9(HOLD, v_ContactUrl, v_SDP_SS); + f_IMS_PreliminaryPass(__FILE__, __LINE__, ""); + + // @siclog "Step 5 - 8" siclog@ + f_IMS_MTCallHoldResume_AnnexC9(RESUME, v_ContactUrl, v_SDP_SS); + f_IMS_PreliminaryPass(__FILE__, __LINE__, ""); + + // @siclog "Step 9 -10" siclog@ + f_IMS_CallReleaseMT(v_InviteRequest, v_ContactUrl); + + f_IMS_TestBody_Set(false); + f_IMS_CC_Postamble(IPCAN_MO_VideoCall); + } + + //============================================================================ + + template (value) MessageBody cs_MessageBody_SimpleMsgSummary(template (value) SimpleMsgSummary p_SimpleMsgSummary) := + { /* @status APPROVED (IMS) */ + simpleMsgSummary := p_SimpleMsgSummary + }; + + template (value) SimpleMsgSummary cs_SimpleMsgSummary_MessageWaiting(charstring p_Status, + charstring p_AccountURI, + template (omit) Msg_summary_line_list p_MsgSummaryLineList := omit, + template (omit) Opt_msg_headers p_SetOfOptionalLines := omit) := + { /* @status APPROVED (IMS) */ + // RFC 3842 + msg_status_line := { + msg_type := c_messageWaiting, + msg_status := p_Status + }, + msg_account := { + msg_type_account := c_messageAccount, + account_URI := p_AccountURI + }, + msg_summary_line_list := p_MsgSummaryLineList, + opt_msg_headers := p_SetOfOptionalLines + }; + + template (value) Msg_summary_line cs_MsgSummaryLine_VoiceMessage(charstring p_Msgs, + charstring p_UrgentMsgs := "0/0") := + { /* @status APPROVED (IMS) */ + msg_context_class := c_voiceMessage, + msgs := p_Msgs, + urgent_msgs := p_UrgentMsgs + }; + + /* + * @desc send NOTIFY for Message Waiting Indication event package (34.229-1 A.6.2); receive 200 OK + * @param p_SubscribeRequest + * @param p_MessageServerDomain + * @param p_MessageContent (default value: {}) + * @status APPROVED (IMS) + */ + function fl_IMS_Notify_15_15(SUBSCRIBE_Request p_SubscribeRequest, + charstring p_MessageServerDomain, + Opt_msg_headers p_MessageContent := {}) runs on IMS_PTC + { /* A.6.2 prose issues: A.6.2 specifies a pure DL message + - Via header: there shall be nothing "optional" + - From header: shall be clearly specified (i.e. not "any IMPU" but e.g. "same URI as sent by the UE in the To header of the SUBSCRIBE") + - To header: as From header (e.g. "same URI as sent by the UE in the From header of the SUBSCRIBE") + - Contact header: shall not be a PIXIT + - Message Body: shall refer to "same IMPU as in From header" (@sic see R5-150705 sic@) */ + /* @sic R5-153756, R5-153986: p_CseqValue removed as global msgSummayDialog is used instead sic@ */ + var template (value) MessageHeader v_MessageHeader_Notify; + var template (present) MessageHeader v_MessageHeader_Response; + var charstring v_NW_AddrStr := f_IMS_PTC_NW_Address_GetAddrStr(); + var InternetProtocol_Type v_Protocol := f_IMS_PTC_ImsInfo_GetTransportProtocol(); + var CharStringList_Type v_ViaAddressList := { v_NW_AddrStr, px_IMS_Scscf, p_MessageServerDomain }; + var template (value) Via v_Via := f_IMS_NotifyRequest_ViaTX(v_ViaAddressList); /* @sic R5-153986: new function f_IMS_NotifyRequest_ViaTX sic@ */ + var template (value) SipUrl v_RequestLineUrl := f_MessageHeader_GetContactSipUrl(p_SubscribeRequest.msgHeader); + var template (value) SipUrl v_ContactSipUrl := cs_SipUri_HostPort("Contact@" & p_MessageServerDomain); /* @sic R5-153764 sic@ */ + var template (value) ContentType v_ContentType := cs_ContentType("application/simple-message-summary"); /* @sic R5-153756 sic@ */ + var EventType v_EventType := "message-summary"; + var charstring v_AccountURI; + var template (value) SimpleMsgSummary v_SimpleMsgSummary; + + v_MessageHeader_Notify := f_IMS_NotifyRequest_MessageHeader_Common(msgSummayDialog, v_Via, v_ContactSipUrl, v_EventType, cs_SubscriptionState_Active("7200"), v_ContentType); + v_AccountURI := f_SIP_SipUrl2Str(f_Addr_Union_GetSipUrl(v_MessageHeader_Notify.fromField.addressField)); + + if (lengthof(p_MessageContent) == 0) { + v_SimpleMsgSummary := cs_SimpleMsgSummary_MessageWaiting("no", v_AccountURI); + } else { + v_SimpleMsgSummary := cs_SimpleMsgSummary_MessageWaiting("yes", v_AccountURI, {cs_MsgSummaryLine_VoiceMessage("1/0")}, p_MessageContent); + } + + IMS_Client.send(cas_IMS_Notify_Request(cs_IMS_RoutingInfo(v_Protocol), cs_NOTIFY_Request(v_RequestLineUrl, v_MessageHeader_Notify, cs_MessageBody_SimpleMsgSummary(v_SimpleMsgSummary)))); + + v_MessageHeader_Response := f_IMS_OtherResponse_200_MessageHeaderRX(v_MessageHeader_Notify); + f_IMS_ReceiveResponse(v_MessageHeader_Notify, v_Protocol, cr_Response(c_statusLine200, v_MessageHeader_Response)); /* @sic R5s140350 sic@ */ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 15.15 + * @status APPROVED (IMS) + */ + function f_TC_15_15_IMS() runs on IMS_PTC + { + var REGISTER_Request v_RegisterRequest; + var IMS_DATA_REQ v_IMS_DATA_REQ_ByRef; + var SUBSCRIBE_Request v_SubscribeReq_MsgSummaryEvent; + var CharStringList_Type v_IMPU_List; + var SipUrl v_ContactUrl_RegEvent; + var template (present) SipUrl v_RequestUrl_RegEvent; + var template (present) SipUrl v_RequestUrl_MsgSummaryEvent; + var template (present) SipUrl v_ToUrl_MsgSummaryEvent; + var charstring v_MessageServerDomain; + var Opt_msg_headers v_SetOfOptionalLines; + var template (present) charstring v_ExpireTime := ?; // value not to be checked acc. to A.6.1 + var boolean v_SubcribedToRegEventPackage := false; + var boolean v_SubcribedToMsgSummaryEventPackage := false; + + f_IMS_CC_Preamble(IPCAN_SignallingOnly, IMS_NULL); + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + + v_RegisterRequest := f_IMS_Register(); + + v_RequestUrl_RegEvent := f_IMS_PTC_ImsInfo_GetSipUriSubscriptionRX(); + v_ContactUrl_RegEvent := f_MessageHeader_GetContactSipUrl(v_RegisterRequest.msgHeader); + + v_RequestUrl_MsgSummaryEvent := cr_SipUri_HostPort(?); // to be checked after SUBSCRIBE has been received + v_ToUrl_MsgSummaryEvent := cr_SipUri_HostPort(?); // to be checked after SUBSCRIBE has been received + + v_MessageServerDomain := f_IMS_PTC_ImsInfo_GetHomeDomainName(); + + f_IMS_TestBody_Set(true); + + alt { + // Step 1. UE subscribes to the Message Waiting Indication event package. + [not v_SubcribedToMsgSummaryEventPackage] a_IMS_SUBSCRIBE_Request(v_IMS_DATA_REQ_ByRef, "message-summary", v_RequestUrl_MsgSummaryEvent, v_ToUrl_MsgSummaryEvent, v_ExpireTime) { + v_SubscribeReq_MsgSummaryEvent := v_IMS_DATA_REQ_ByRef.Request.Subscribe; + + if (px_IMS_MessageAccountIdentity != "") { + v_IMPU_List := { px_IMS_MessageAccountIdentity }; /* UE shall use MessageAccountIdentity when configured */ + } else { + v_IMPU_List := f_IMS_PTC_ImsInfo_GetAllIMPUs(); /* any IMPU within the set of IMPUs on ISIM if MessageAccountIdentity is not configured at the UE */ + } + if (not f_IMS_PublicUserId_Match(v_IMPU_List, v_SubscribeReq_MsgSummaryEvent.requestLine.requestUri)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "invalid request URI"); + } + if (not f_IMS_PublicUserId_Match(v_IMPU_List, f_Addr_Union_GetSipUrl(v_SubscribeReq_MsgSummaryEvent.msgHeader.toField.addressField))) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "invalid request URI"); + } + + // Step 2. The SS responds SUBSCRIBE with 200 OK + f_IMS_SUBSCRIBE_Response(msgSummayDialog, v_IMS_DATA_REQ_ByRef); + + v_SubcribedToMsgSummaryEventPackage := true; + if (not v_SubcribedToRegEventPackage) { repeat; } + } + // Step 2a. The UE subscribes to the registration event package. + [not v_SubcribedToRegEventPackage] a_IMS_SUBSCRIBE_Request(v_IMS_DATA_REQ_ByRef, "reg", v_RequestUrl_RegEvent) { + + // Step 2b. The SS responds with 200 OK + f_IMS_SUBSCRIBE_Response(regEventDialog, v_IMS_DATA_REQ_ByRef); + + v_SubcribedToRegEventPackage := true; + if (not v_SubcribedToMsgSummaryEventPackage) { repeat; } + } + } + + // @siclog "Step 3 - 4" siclog@ + fl_IMS_Notify_15_15(v_SubscribeReq_MsgSummaryEvent, v_MessageServerDomain); + + // @siclog "Step 5 - 6" siclog@ + v_SetOfOptionalLines := { + "To: " & f_SIP_SipUrl2Str(f_Addr_Union_GetSipUrl(v_SubscribeReq_MsgSummaryEvent.msgHeader.fromField.addressField)), + "From: ", + "Subject: call me back!", + "Message-ID: 27775334485@" & v_MessageServerDomain, + "Message-Context: voice-message" + }; + fl_IMS_Notify_15_15(v_SubscribeReq_MsgSummaryEvent, v_MessageServerDomain, v_SetOfOptionalLines); + + // @siclog "Step 7 - 8" siclog@ + f_IMS_Register_Notify(v_ContactUrl_RegEvent, f_IMS_XmlMessageForNotify_Def(v_RegisterRequest)); /* @sic R5-153756, R5-153986: p_SubscribeRequest and p_CseqValue removed sic@ */ + + f_IMS_TestBody_Set(false); + f_IMS_CC_Postamble(IPCAN_InitialRegistration); + } + + /* ************************************************************************** */ + /* + * @desc used in 15.27 and 15.28 to check alertInfo + * @param p_MessageHeader_Ringing + * @param p_AlertInfoUrl + * @status APPROVED (IMS) + */ + function fl_IMS_CW_180Ringing_CheckAlertInfo(template (omit) MessageHeader p_MessageHeader_Ringing, + charstring p_AlertInfoUrl) runs on IMS_PTC + { + var template (present) charstring v_AlertInfoUrl := p_AlertInfoUrl; /* @sic R5s140092 change 1.2 - temporary solution: (p_AlertInfoUrl, "<" & p_AlertInfoUrl &">") sic@ + @sic R5w140111, slide 8: "<", ">" shall be handled by the codec sic@ */ + + if (not ispresent(p_MessageHeader_Ringing)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "No 180 Ringing"); + } + if (not match(valueof(p_MessageHeader_Ringing.alertInfo), cr_AlertInfo(v_AlertInfoUrl))) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Invalid 'alertInfo'"); + } + } + + /* + * @desc function for 15.27 and 15.28 to establish incoming call for CW + * @return INVITE_Request + * @status APPROVED (IMS) + */ + function fl_IMS_CW_IncomingCall() runs on IMS_PTC return INVITE_Request + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; /* @sic R5w140112: v_InviteRequestWithSdp instead of v_InviteRequest sic@ */ + var IMS_ResponseWithSdp_Type v_ResponseWithSdp; /* @sic R5w140112 sic@ */ + var IMS_Response_Type v_SessionInProgress183; + var MessageHeader v_MessageHeader_PrevReliableResponse; + var template (omit) MessageHeader v_MessageHeader_Ringing; + + v_InviteRequestWithSdp := f_IMS_MTCallSetup_AnnexC11_INVITE(); + v_ResponseWithSdp := f_IMS_MTCallSetup_AnnexC11_Steps1_4(v_InviteRequestWithSdp); + v_SessionInProgress183 := v_ResponseWithSdp.Response; + // Establish Dedicated EPS bearer + // See TS. 36.508 EUTRA/EPS signalling for IMS MT speech call Table 4.5A.7.3-1 Step 9-12 + + // Step 5 - 6. Send PRACK, Receive 200 OK + v_MessageHeader_PrevReliableResponse := v_SessionInProgress183.msgHeader; + f_IMS_MTCallSetup_SendPRACK_ReceiveOK(v_InviteRequestWithSdp.Invite, v_MessageHeader_PrevReliableResponse); + + // Step 7 - 11. Send UPDATE, Receive 200 OK, Receive 180 Ringing and send PRACK if requested + v_MessageHeader_Ringing := f_IMS_MTCallSetup_AnnexC11_Steps7_11(v_InviteRequestWithSdp, v_ResponseWithSdp); /* @sic R5-153798: parameter v_ResponseWithSdp sic@ */ + fl_IMS_CW_180Ringing_CheckAlertInfo(v_MessageHeader_Ringing, "urn:alert:service:call-waiting"); // Requirement step 9 + + return v_InviteRequestWithSdp.Invite; + } + + //**************************************************************************** + /* + * @desc REFERENCE TS 34.229-1 clause 15.27 + * @status APPROVED (IMS) + */ + function f_TC_15_27_IMS() runs on IMS_PTC + { /* @sic R5-142955: sequence changed for steps 12..15 sic@ */ + var template (value) INVITE_Request v_InviteRequest_Dialog1; + var template (value) INVITE_Request v_InviteRequest_Dialog2; + var template (present) MessageHeader v_MessageHeader_ExpectedBye_Dialog1; + var template (present) MessageHeader v_MessageHeader_Expected200_Dialog2; + var template (present) SipUrl v_ContactUrl_Dialog1; + var SipUrl v_ContactUrl_Dialog2; + var template (value) MessageHeader v_MessageHeader; + var MessageHeader v_MessageHeader_ReceivedBye; + var InternetProtocol_Type v_Protocol; + var IMS_DATA_RSP v_IMS_DATA_RSP; + var IMS_DATA_REQ v_IMS_DATA_REQ; + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + + // Initial conditions - Setup an MO Call according to Annex C.7 + // FFS - we use here the procedures for MO Call Annex C.21 which is identical to Annex C.7 + // => prose shall refer to C.21 instead of C.7 as this is done for 15.28 already + + v_InviteRequest_Dialog1 := f_IMS_CC_MO_SpeechCall(); + + f_IMS_TestBody_Set(true); + + // @siclog "Step 1 - 11" siclog@ + f_IMS_PTC_ImsInfo_ActivateDialog(secondDialog); + v_InviteRequest_Dialog2 := fl_IMS_CW_IncomingCall(); + + // @siclog "Step 11a: terminate previous session and take over waiting call" + f_UT_HangupIMSCall(MMI); // @sic R5-142955, R5s140307 sic@ + + // @siclog "Step 12: Receive BYE corresponding to first call" + /* @sic R5-142955: the BYE comes as reaction of the UE on the UT command at ste 11a sic@ */ + f_IMS_PTC_ImsInfo_ActivateDialog(firstDialog); + v_MessageHeader_ExpectedBye_Dialog1 := f_IMS_ByeRequest_MessageHeaderRX(v_InviteRequest_Dialog1); + v_ContactUrl_Dialog1 := f_SIP_BuildSipUri_RX(px_IMS_CalleeContactUri); /* as used in the C.21 procedure */ + IMS_Server.receive(car_IMS_Bye_Request(cr_BYE_Request(v_ContactUrl_Dialog1, v_MessageHeader_ExpectedBye_Dialog1))) -> value v_IMS_DATA_REQ; + v_MessageHeader_ReceivedBye := v_IMS_DATA_REQ.Request.Bye.msgHeader; + f_IMS_MessageHeader_Request_CheckVia(v_MessageHeader_ReceivedBye, v_IMS_DATA_REQ.RoutingInfo.Protocol); + + // @siclog "Step 13: Send 200 OK" + v_MessageHeader := f_IMS_OtherResponse_200_MessageHeaderTX(v_MessageHeader_ReceivedBye); + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo), cs_Response(c_statusLine200, v_MessageHeader))); + f_IMS_PTC_ImsInfo_DialogRelease(); + + // @siclog "Step 13a: Accept incoming call" + f_UT_AnswerCall(MMI); // @sic R5-142955, R5s140307 sic@ + + // @siclog "Step 14: SS expects and receives 200 OK for INVITE from the UE" + f_IMS_PTC_ImsInfo_ActivateDialog(secondDialog); + v_MessageHeader_Expected200_Dialog2 := f_IMS_OtherResponse_200_MessageHeaderRX(v_InviteRequest_Dialog2.msgHeader); + v_ContactUrl_Dialog2 := f_IMS_PTC_ImsInfo_GetContactUrl(); + v_Protocol := f_IMS_PTC_ImsInfo_GetTransportProtocol(); + v_IMS_DATA_RSP := f_IMS_ReceiveResponse(v_InviteRequest_Dialog2.msgHeader, + v_Protocol, + cr_Response(c_statusLine200, v_MessageHeader_Expected200_Dialog2)); + + // @siclog "Step 15: SS sends ACK to the UE" + v_MessageHeader := f_IMS_AckRequest_MessageHeaderTX(v_InviteRequest_Dialog2); + IMS_Client.send(cas_IMS_Ack_Request(cs_IMS_RoutingInfo(v_Protocol), cs_ACK_Request(v_ContactUrl_Dialog2, v_MessageHeader))); + + f_IMS_TestBody_Set(false); + + f_IMS_CallReleaseMT(v_InviteRequest_Dialog2, v_ContactUrl_Dialog2); // @sic R5s140606 sic@ + + f_IMS_CC_Postamble(IPCAN_MO_SpeechCall); + } + + //**************************************************************************** + /* + * @desc REFERENCE TS 34.229-1 clause 15.28 + * @status APPROVED (IMS) + */ + function f_TC_15_28_IMS() runs on IMS_PTC + { /* 34.229-1 clause 15.28 - Communication Waiting and cancelling the call */ + var IMS_DATA_RSP v_IMS_DATA_RSP; + var INVITE_Request v_InviteRequest_Dialog1; + var template (value) INVITE_Request v_InviteRequest_Dialog2; + var template (value) MessageHeader v_MessageHeader_Cancel; + var template (value) MessageHeader v_MessageHeader_Ack; + var InternetProtocol_Type v_Protocol; + var SipUrl v_ContactUrl; + var boolean v_WaitingFor200 := true; + var boolean v_WaitingFor487 := true; + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + + // Initial conditions - Setup an MO Call according to Annex C.21 + v_InviteRequest_Dialog1 := f_IMS_CC_MO_SpeechCall(); // @sic R5-140909 sic@ + + f_IMS_TestBody_Set(true); + + // @siclog "Step 1 - 11" siclog@ + f_IMS_PTC_ImsInfo_ActivateDialog(secondDialog); /* @sic R5s140092 change 1.5 sic@ */ + v_InviteRequest_Dialog2 := fl_IMS_CW_IncomingCall(); /* @sic R5-140909 sic@ */ + + // Step 12 - SS sends CANCEL request to terminate the INVITE transaction + v_MessageHeader_Cancel := f_IMS_CancelRequest_MessageHeaderTX(v_InviteRequest_Dialog2); /* @sic R5s140178 sic@ */ + v_ContactUrl := f_IMS_PTC_ImsInfo_GetContactUrl(); + v_Protocol := f_IMS_PTC_ImsInfo_GetTransportProtocol(); + IMS_Client.send(cas_IMS_Cancel_Request(cs_IMS_RoutingInfo(v_Protocol), cs_CANCEL_Request(v_ContactUrl, v_MessageHeader_Cancel))); + + while (v_WaitingFor200 or v_WaitingFor487) { + alt { // @sic R5-125773, R5s140350: interleave is not allowed for altsteps sic@ + // Step 13 - The UE acknowledges the CANCEL with 200 OK. + [v_WaitingFor200] a_IMS_ReceiveResponse(v_MessageHeader_Cancel, + v_Protocol, + cr_Response(c_statusLine200, f_IMS_OtherResponse_200_MessageHeaderRX(v_MessageHeader_Cancel)), + v_IMS_DATA_RSP) { + v_WaitingFor200 := false; + } + // Step 14. The UE responds to INVITE with a 487 Request Terminated final response after transaction was terminated. + [v_WaitingFor487] a_IMS_ReceiveResponse(v_InviteRequest_Dialog2.msgHeader, + v_Protocol, + cr_Response(c_statusLine487, f_IMS_InviteResponse_4XX_MessageHeaderRX(v_InviteRequest_Dialog2.msgHeader)), /* @sic R5s140178 sic@ */ + v_IMS_DATA_RSP) { + v_WaitingFor487 := false; + } + } + } + // Step 15. Send ACK. The SS acknowledges the receipt of 200 OK for INVITE. + v_MessageHeader_Ack := f_IMS_AckRequest_MessageHeaderTX(v_InviteRequest_Dialog2, c_statusLine487); /* @sic R5s140092 change 1.3; R5s140178 sic@ */ + IMS_Client.send(cas_IMS_Ack_Request(cs_IMS_RoutingInfo(v_Protocol), cs_ACK_Request(v_ContactUrl, v_MessageHeader_Ack))); + + f_IMS_PTC_ImsInfo_DialogRelease(); /* @sic R5s140092 change 1.5 sic@ */ + f_IMS_PTC_ImsInfo_ActivateDialog(firstDialog); /* @sic R5s140092 change 1.5 sic@ */ + + f_IMS_TestBody_Set(false); + f_IMS_CallReleaseMO(v_InviteRequest_Dialog1); + + f_IMS_CC_Postamble(IPCAN_MO_SpeechCall); + } +} diff --git a/IMS_PART4_IWD_15wk38/IMS/15/IMS_CC_SSXcapTestcases.ttcn b/IMS_PART4_IWD_15wk38/IMS/15/IMS_CC_SSXcapTestcases.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6bf5686dc0f95483e87b7f4a54f75dc78b95dce2 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/15/IMS_CC_SSXcapTestcases.ttcn @@ -0,0 +1,1324 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-16 14:42:41 +0200 (Wed, 16 Sep 2015) $ +// $Rev: 14457 $ +/******************************************************************************/ + +module IMS_CC_SSXcapTestcases { + + import from CommonDefs all; + import from CommonIP all; + import from EPS_NAS_Constants all; + import from IP_ASP_TypeDefs all; + import from IP_PTC_CtrlMsgs all; + import from IP_PTC_Templates all; + import from IMS_Component all; + import from IMS_CC_Component all; + import from IMS_CC_Parameters all; + import from IMS_CC_CommonFunctions all; + import from HTTP_PTC_CoordMsg all; + import from UpperTesterFunctions all; + + import from XSD all; +// import from urn_ietf_params_xml_ns_common_policy all; +// import from http_uri_etsi_org_ngn_params_xml_simservs_xcap all; +// import from urn_oma_xml_xdm_common_policy all; + import from urn_ietf_params_xml_ns_common_policy language "XSD" all; + import from http_uri_etsi_org_ngn_params_xml_simservs_xcap language "XSD" all; + import from urn_oma_xml_xdm_common_policy language "XSD" all; + + const PortNumber_Type tsc_PortNumberHTTP := 80; /* @status APPROVED (IMS) */ + const PortNumber_Type tsc_PortNumberHTTPS := 443; + + type enumerated SupplementaryServiceActivationState_Type {notACTIVATED, ACTIVATED, deACTIVATED}; /* @status APPROVED (IMS) */ + + type Simservs.absService_list Simservs_ServiceList_Type with { encode "XML" }; /* @status APPROVED (IMS) + @sic R5s140975 change 1.2 sic@ */ + + type record SupplementaryServiceInfo_Type + { /* to simplify checks */ + /* @status APPROVED (IMS) */ + AbsService_group service, + boolean active, + Ruleset ruleset + }; + + type record of SupplementaryServiceInfo_Type SupplementaryServiceInfoList_Type; /* @status APPROVED (IMS) */ + + + template (present) ConditionsType cr_ConditionsType_Empty := {choice_list := {{identity_list := {}}}}; /* @status APPROVED (IMS) */ + + template (value) Ruleset cs_Ruleset_Empty := { rule_list := {} }; /* @status APPROVED (IMS) */ + + template (value) SupplementaryServiceInfo_Type cs_SupplementaryService_Info(AbsService_group p_Service, + boolean p_Active, + Ruleset p_Ruleset) := + { /* @status APPROVED (IMS) */ + service := p_Service, + active := p_Active, + ruleset := p_Ruleset + }; + + //---------------------------------------------------------------------------- + + template (present) AbsService_group cr_Communication_diversion(template boolean p_Active := *) := + { /* @status APPROVED (IMS) */ + communication_diversion := { + active := p_Active, + attr := *, + noReplyTimer := *, + ruleset := * + } + }; + + template (present) AbsService_group cr_Originating_identity_presentation_restriction(template boolean p_Active := *) := + { /* @status APPROVED (IMS) */ + originating_identity_presentation_restriction := { + active := p_Active, + attr := *, + default_behaviour := * + } + }; + + template (present) AbsService_group cr_Originating_identity_presentation(template boolean p_Active := *) := + { /* @status APPROVED (IMS) */ + originating_identity_presentation := { + active := p_Active, + attr := * + } + }; + + template (present) AbsService_group cr_Terminating_identity_presentation_restriction(template boolean p_Active := *) := + { /* @status APPROVED (IMS) */ + terminating_identity_presentation_restriction := { + active := p_Active, + attr := *, + default_behaviour := * + } + }; + + template (present) AbsService_group cr_Terminating_identity_presentation(template boolean p_Active := *) := + { /* @status APPROVED (IMS) */ + terminating_identity_presentation := { + active := p_Active, + attr := * + } + }; + + template (present) AbsService_group cr_Incoming_communication_barring(template boolean p_Active := *) := + { /* @status APPROVED (IMS) */ + incoming_communication_barring := { + active := p_Active, + attr := *, + ruleset := * + } + }; + + template (present) AbsService_group cr_Outgoing_communication_barring(template boolean p_Active := *) := + { /* @status APPROVED (IMS) */ + outgoing_communication_barring := { + active := p_Active, + attr := *, + ruleset := * + } + }; + + //---------------------------------------------------------------------------- + + template (value) Simservs cs_Simservs(template (value) Simservs_ServiceList_Type p_AbsServiceList) := + { /* @status APPROVED (IMS) */ + attr := omit, + absService_list := p_AbsServiceList, + extensions := omit + }; + + template (value) AbsService_group cs_Communication_diversion(boolean p_Active := false) := + { /* @status APPROVED (IMS) */ + communication_diversion := { + active := p_Active, + attr := omit, + noReplyTimer := omit, + ruleset := omit + } + }; + + template (value) AbsService_group cs_Originating_identity_presentation_restriction(boolean p_Active := false) := + { /* @status APPROVED (IMS) */ + originating_identity_presentation_restriction := { + active := p_Active, + attr := omit, + default_behaviour := omit + } + }; + + template (value) AbsService_group cs_Originating_identity_presentation(boolean p_Active := false) := + { /* @status APPROVED (IMS) */ + originating_identity_presentation := { + active := p_Active, + attr := omit + } + }; + + template (value) AbsService_group cs_Terminating_identity_presentation_restriction(boolean p_Active := false) := + { /* @status APPROVED (IMS) */ + terminating_identity_presentation_restriction := { + active := p_Active, + attr := omit, + default_behaviour := omit + } + }; + + template (value) AbsService_group cs_Terminating_identity_presentation(boolean p_Active := false) := + { /* @status APPROVED (IMS) */ + terminating_identity_presentation := { + active := p_Active, + attr := omit + } + }; + + template (value) AbsService_group cs_Incoming_communication_barring(boolean p_Active := false) := + { /* @status APPROVED (IMS) */ + incoming_communication_barring := { + active := p_Active, + attr := omit, + ruleset := omit + } + }; + + template (value) AbsService_group cs_Outgoing_communication_barring(boolean p_Active := false) := + { /* @status APPROVED (IMS) */ + outgoing_communication_barring := { + active := p_Active, + attr := omit, + ruleset := omit + } + }; + + //---------------------------------------------------------------------------- + + template (value) HTTP_ConfigurationParams_Type cs_HTTP_ConfigurationParams(template (value) IP_SocketList_Type p_XcapServerAddrAndPort_List, + template (value) IP_SocketList_Type p_BsfServerAddrAndPort_List, + template (value) IP_DrbInfo_Type p_DrbRoutingInfo, + HTTP_AuthenticationMethod_Type p_AuthenticationMethod, + charstring p_PrivateUserId, + charstring p_HomeDomainName, + charstring p_XcapUsername, + charstring p_XcapUserId, + charstring p_XcapRootUri := px_XCAP_RootUri) := + { /* @status APPROVED (IMS) */ + XcapServerAddrAndPort_List := p_XcapServerAddrAndPort_List, // @sic R5s150148 sic@ + BsfServerAddrAndPort_List := p_BsfServerAddrAndPort_List, // @sic R5s150148 sic@ + DrbRoutingInfo := p_DrbRoutingInfo, + AuthenticationMethod := p_AuthenticationMethod, + PrivateUserId := p_PrivateUserId, + HomeDomainName := p_HomeDomainName, + XcapUsername := p_XcapUsername, + XcapUserId := p_XcapUserId, + XcapRootUri := p_XcapRootUri + }; + + template (value) HTTP_TransactionParams_Type cs_HTTP_TransactionParams(float p_MaxDuration, + float p_InactivityDuration) := + { /* @status APPROVED (IMS) */ + MaxDuration := p_MaxDuration, + InactivityDuration := p_InactivityDuration + }; + + //---------------------------------------------------------------------------- + /* + * @desc send command to the HTTP/XCAP PTC and wait until it has been done + * @param p_FileName + * @param p_LineNo + * @param p_Command + * @return charstring + * @status APPROVED (IMS) + */ + function f_IMS_HTTP_RunCommand(charstring p_FileName, + LineNo_Type p_LineNo, + template (value) IMS_HTTP_Command_Type p_Command) runs on IMS_XCAP_PTC return charstring + { + var template (present) IMS_HTTP_Response_Type v_ExpectedResponse := ?; + var IMS_HTTP_Response_Type v_Response; + var charstring v_Result := ""; + + XCAP.send(p_Command); + XCAP.receive(v_ExpectedResponse) -> value v_Response; + + if (ischosen(v_Response.Error)) { + f_IMS_SetVerdictFailOrInconc(p_FileName, p_LineNo, v_Response.Error); + } else { + v_Result := v_Response.Result; + } + return v_Result; + } + + //---------------------------------------------------------------------------- + /* + * @desc return HTTP_AuthenticationMethod_Type acc. to PICS setting and test requirement + * @param p_GbaRequested (default value: omit) + * @return HTTP_AuthenticationMethod_Type + * @status APPROVED (IMS) + */ + function fl_HTTP_AuthenticationMethod(boolean p_GbaRequested := false) runs on IMS_PTC return HTTP_AuthenticationMethod_Type + { + var HTTP_AuthenticationMethod_Type v_AuthMethod; + + if (p_GbaRequested) { + if (not pc_HttpGBAAuthentication) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "UE does not support GBA"); + } + v_AuthMethod := httpDigestAndGbaAuthentication; + } else { + if (pc_HttpDigestAuthentication) { + v_AuthMethod := httpDigestAuthentication; + } else { + v_AuthMethod := noAuthentication; + } + } + return v_AuthMethod; + } + + /* + * @desc configure HTTP/XCAP PTC + * @param p_AuthenticationMethod + * @param p_XcapUserId + * @param p_XcapUsername + * @status APPROVED (IMS) + */ + function f_IMS_HTTP_Configure(HTTP_AuthenticationMethod_Type p_AuthenticationMethod, + charstring p_XcapUserId, + charstring p_XcapUsername) runs on IMS_XCAP_PTC + { + var template (value) IMS_HTTP_Command_Type v_Command; + var template (value) IP_AddrInfo_Type v_XCAP_AddressV4; + var template (value) IP_AddrInfo_Type v_XCAP_AddressV6; + var PDN_AddressInfo_Type v_PDN_AddressInfo := f_PDN_AddressInfo_Get(PDN_2); /* @sic R5s141051 change 8 sic@ */ + var template (value) IP_SocketList_Type v_XcapServerAddrAndPort_List := {}; + var template (value) IP_SocketList_Type v_BsfServerAddrAndPort_List := {}; + var template (value) IP_DrbInfo_Type v_DrbRoutingInfo; + var charstring v_PrivateUserId := f_IMS_PTC_ImsInfo_GetPrivateUserId(); + var charstring v_HomeDomainName := f_IMS_PTC_ImsInfo_GetHomeDomainName(); + var template (present) charstring v_RanType := f_IMS_PTC_RanType_GetString(); + var IP_DrbId_Type v_DrbId; + + v_XCAP_AddressV4 := cs_IPv4Addr(v_PDN_AddressInfo.XCAP_ServerAddressIPv4); /* @sic R5s150148 sic@ */ + v_XCAP_AddressV6 := cs_IPv6Addr(v_PDN_AddressInfo.XCAP_ServerAddressIPv6); /* @sic R5s150148 sic@ */ + + if (isvalue(v_RanType) and match(valueof(v_RanType), pattern "3GPP-E-UTRAN-*")) { + v_DrbId := f_EUTRA_EpsBearerAssociatedDRB(tsc_EpsDefaultBearerId2ndPDN); /* DRB Id for 2nd PDN; @sic R5s141351 change 4 sic@ */ + v_DrbRoutingInfo := cs_DrbInfo_EUTRA(eutra_Cell1, v_DrbId); + } else { + FatalError(__FILE__, __LINE__, "Unknown RAN type"); + } + v_XcapServerAddrAndPort_List[0] := cs_IP_Socket(v_XCAP_AddressV4, tsc_PortNumberHTTP); /* @sic R5s150148 sic@ */ + v_XcapServerAddrAndPort_List[1] := cs_IP_Socket(v_XCAP_AddressV6, tsc_PortNumberHTTP); /* @sic R5s150148 sic@ */ + + if (p_AuthenticationMethod == httpDigestAndGbaAuthentication) { + /* when there shall be a different IP address or port for the BSF server this shall be added here */ + /* v_BsfServerAddrAndPort_List[0] := cs_IP_Socket(v_BSF_AddressV4, tsc_PortNumberHTTP/HTTPS); */ + /* v_BsfServerAddrAndPort_List[1] := cs_IP_Socket(v_BSF_AddressV6, tsc_PortNumberHTTP/HTTPS); */ + } + v_Command := { + Configure := cs_HTTP_ConfigurationParams(v_XcapServerAddrAndPort_List, + v_BsfServerAddrAndPort_List, + v_DrbRoutingInfo, + p_AuthenticationMethod, + v_PrivateUserId, + v_HomeDomainName, + p_XcapUsername, + p_XcapUserId) + }; + f_IMS_HTTP_RunCommand(__FILE__, __LINE__, v_Command); + } + + //---------------------------------------------------------------------------- + /* + * @desc set simservs document at the XCAP server + * @param p_Document + * @status APPROVED (IMS) + */ + function f_IMS_XCAP_SetDocument(charstring p_Document) runs on IMS_XCAP_PTC + { + var template (value) IMS_HTTP_Command_Type v_Command := { DocumentSet := p_Document }; + f_IMS_HTTP_RunCommand(__FILE__, __LINE__, v_Command); + } + + /* + * @desc initialise simservs document for all supplementary services being not activated + * @status APPROVED (IMS) + */ + function f_IMS_XCAP_InitialiseSuplementaryServices() runs on IMS_XCAP_PTC + { + var template (value) Simservs_ServiceList_Type v_AbsServiceList := { + cs_Communication_diversion, + cs_Originating_identity_presentation_restriction, + cs_Originating_identity_presentation, + cs_Terminating_identity_presentation_restriction, + cs_Terminating_identity_presentation, + cs_Incoming_communication_barring, + cs_Outgoing_communication_barring + }; + var template (value) Simservs v_Simservs := cs_Simservs(v_AbsServiceList); + var bitstring v_Bitstring := encvalue(v_Simservs); + var charstring v_Document := oct2char(bit2oct(v_Bitstring)); + f_IMS_XCAP_SetDocument(v_Document); + } + + //---------------------------------------------------------------------------- + /* + * @desc get simservs document from the XCAP server + * @return Simservs + * @status APPROVED (IMS) + */ + function f_IMS_XCAP_GetDocument() runs on IMS_XCAP_PTC return Simservs + { + var Simservs v_Simservs; + var template (value) IMS_HTTP_Command_Type v_Command := {DocumentGet := true}; + var charstring v_Document := f_IMS_HTTP_RunCommand(__FILE__, __LINE__, v_Command); + var bitstring v_Bitstring := oct2bit(char2oct(v_Document)); + if (decvalue(v_Bitstring, v_Simservs) != 0) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "cannot decode simservs document"); + } + return v_Simservs; + } + + //---------------------------------------------------------------------------- + /* + * @desc start transaction and wait until it is done: the UE shall exchange all necessary HTTP messages with the XCAP server + * @param p_MaxDuration + * @param p_InactivityDuration (default value: 20.0) + * @status APPROVED (IMS) + */ + function f_IMS_HTTP_Transaction(float p_MaxDuration, + float p_InactivityDuration := 20.0) runs on IMS_XCAP_PTC + { /* @sic R5s130794 change 20: p_InactivityDuration increased to 20.0 sic@ */ + var template (value) IMS_HTTP_Command_Type v_Command := { + TransactionStart := cs_HTTP_TransactionParams(p_MaxDuration, p_InactivityDuration) + }; + f_IMS_HTTP_RunCommand(__FILE__, __LINE__, v_Command); + } + + //============================================================================ + /* + * @desc return entry for given supplementary service from the given simservs document + * @param p_Simservs + * @param p_RequiredService + * @param p_DefaultForRequiredService + * @return AbsService_group + * @status APPROVED (IMS) + */ + function fl_Simservs_GetService(Simservs p_Simservs, + template (present) AbsService_group p_RequiredService, + template (value) AbsService_group p_DefaultForRequiredService) return AbsService_group + { + var integer i; + var Simservs_ServiceList_Type v_ServiceList := p_Simservs.absService_list; + + for (i:=0; i < lengthof(v_ServiceList); i:=i+1) { + if (match(v_ServiceList[i], p_RequiredService)) { + return v_ServiceList[i]; + } + } + return valueof(p_DefaultForRequiredService); + } + + /* + * @desc return either given ruleset if present or empty ruleset + * @param p_Ruleset + * @return Ruleset + * @status APPROVED (IMS) + */ + function fl_Ruleset(template (omit) Ruleset p_Ruleset) return Ruleset + { + var template (omit) Ruleset v_Ruleset; + if (isvalue(p_Ruleset)) { + v_Ruleset := p_Ruleset; + } else { + v_Ruleset := cs_Ruleset_Empty; + } + return valueof(v_Ruleset); + } + + /* + * @desc return list of SupplementaryServiceInfo_Type which are relevant for a supplementary service; + * in general this list contains only one element but for COMMUNICATION_BARRING_WHILE_ROAMING we need two; + * Note: function always returns specific value even when information is omitted in the given document + * @param p_Simservs + * @param p_SupplementaryService + * @return SupplementaryServiceInfoList_Type + * @status APPROVED (IMS) + */ + function fl_Simservs_GetSpecificService(Simservs p_Simservs, + SS_Type p_SupplementaryService) return SupplementaryServiceInfoList_Type + { + var template (value) SupplementaryServiceInfoList_Type v_ServiceList := {}; + var Ruleset v_Ruleset := fl_Ruleset(omit); + var AbsService_group v_AbsService; + var boolean v_Active; + + select (p_SupplementaryService) { + case (SS_CLIP) { + v_AbsService := fl_Simservs_GetService(p_Simservs, cr_Originating_identity_presentation, cs_Originating_identity_presentation); + v_Active := match(v_AbsService, cr_Originating_identity_presentation(true)); + v_ServiceList[0] := cs_SupplementaryService_Info(v_AbsService, v_Active, v_Ruleset); + } + case (SS_CLIR) { + v_AbsService := fl_Simservs_GetService(p_Simservs, cr_Originating_identity_presentation_restriction, cs_Originating_identity_presentation_restriction); + v_Active := match(v_AbsService, cr_Originating_identity_presentation_restriction(true)); + v_ServiceList[0] := cs_SupplementaryService_Info(v_AbsService, v_Active, v_Ruleset); + } + case (SS_COLP) { + v_AbsService := fl_Simservs_GetService(p_Simservs, cr_Terminating_identity_presentation, cs_Terminating_identity_presentation); + v_Active := match(v_AbsService, cr_Terminating_identity_presentation(true)); + v_ServiceList[0] := cs_SupplementaryService_Info(v_AbsService, v_Active, v_Ruleset); + } + case (SS_TIR) { + v_AbsService := fl_Simservs_GetService(p_Simservs, cr_Terminating_identity_presentation_restriction, cs_Terminating_identity_presentation_restriction); + v_Active := match(v_AbsService, cr_Terminating_identity_presentation_restriction(true)); + v_ServiceList[0] := cs_SupplementaryService_Info(v_AbsService, v_Active, v_Ruleset); + } + case (SS_CFU, + SS_CFNRy, + SS_CFB, + SS_CFNL, + SS_CFNRc) { + v_AbsService := fl_Simservs_GetService(p_Simservs, cr_Communication_diversion, cs_Communication_diversion); + v_Active := match(v_AbsService, cr_Communication_diversion(true)); + v_Ruleset := fl_Ruleset(v_AbsService.communication_diversion.ruleset); + v_ServiceList[0] := cs_SupplementaryService_Info(v_AbsService, v_Active, v_Ruleset); + } + case (SS_BAIC, + SS_BAIC_ANONYMOUS, + SS_BAIC_EXCEPT_SPECIFIC_USER) { + v_AbsService := fl_Simservs_GetService(p_Simservs, cr_Incoming_communication_barring, cs_Incoming_communication_barring); + v_Active := match(v_AbsService, cr_Incoming_communication_barring(true)); + v_Ruleset := fl_Ruleset(v_AbsService.incoming_communication_barring.ruleset); + v_ServiceList[0] := cs_SupplementaryService_Info(v_AbsService, v_Active, v_Ruleset); + } + case (SS_BIC_ROAM) { // @sic R5-153995 sic@ + v_AbsService := fl_Simservs_GetService(p_Simservs, cr_Incoming_communication_barring, cs_Incoming_communication_barring); + v_Active := match(v_AbsService, cr_Incoming_communication_barring(true)); + v_Ruleset := fl_Ruleset(v_AbsService.incoming_communication_barring.ruleset); + v_ServiceList[0] := cs_SupplementaryService_Info(v_AbsService, v_Active, v_Ruleset); + } + case (SS_BARRING_OUT_ROAM) { // @sic R5-153995 sic@ + /* @sic R5s141115 change 1: no support outgoing communication barring; R5-151166: outgoing communication barring re-introduced; R5-153995: split incoming and outgoing sic@ */ + v_AbsService := fl_Simservs_GetService(p_Simservs, cr_Outgoing_communication_barring, cs_Outgoing_communication_barring); + v_Active := match(v_AbsService, cr_Outgoing_communication_barring(true)); + v_Ruleset := fl_Ruleset(v_AbsService.outgoing_communication_barring.ruleset); + v_ServiceList[0] := cs_SupplementaryService_Info(v_AbsService, v_Active, v_Ruleset); + } + case else { + FatalError(__FILE__, __LINE__, "unknown supplementary service"); + } + } + return valueof(v_ServiceList); + } + + /* + * @desc check whether rule-set is explicitly deactivated + * @param p_Ruleset + * @return boolean + * @status APPROVED (IMS) + */ + function fl_Ruleset_CheckDeactivated(Ruleset p_Ruleset) return boolean + { + var integer i; + var RuleType v_Rule; + var charstring v_Condition := "rule-deactivated"; + + for (i := 0; i < lengthof(p_Ruleset.rule_list); i := i + 1) { + v_Rule := p_Ruleset.rule_list[i]; + + if (fl_Rule_CheckCondition(v_Rule, v_Condition)) { + return true; + } + } + return false; + } + + /* + * @desc return true if all given supplementary services are active or not active acc. to parameter p_Activated, false else + * @param p_ServiceList + * @param p_ActivationState + * @return boolean + * @status APPROVED (IMS) + */ + function fl_SupplementaryService_CheckActivated(SupplementaryServiceInfoList_Type p_ServiceList, + SupplementaryServiceActivationState_Type p_ActivationState) return boolean + { /* @sic R5s141113 change 5: handling of "deACTIVATED" sic@ */ + var integer i; + + for (i:=0; i < lengthof(p_ServiceList); i:=i+1) { + select (p_ActivationState) { + case (notACTIVATED) { + if (p_ServiceList[i].active) { + return false; + } + } + case (ACTIVATED) { + if (not p_ServiceList[i].active) { + return false; + } + } + case (deACTIVATED) { + if (not p_ServiceList[i].active or not fl_Ruleset_CheckDeactivated(p_ServiceList[i].ruleset)) { + return false; + } + } + } + } + return true; + } + + //---------------------------------------------------------------------------- + /* + * @desc try to decode the received bitstring acc. to a given condition + * @param p_ConditionsElem + * @param p_GivenCondition + * @return boolean + * @status APPROVED (IMS) + */ + function fl_MatchCondition(XSD.String p_ConditionsElem, + charstring p_GivenCondition) return boolean + { + var bitstring v_Bitstring := oct2bit(char2oct(p_ConditionsElem)); // @sic R5s141351 change 2: char2oct instead of str2oct sic@ + var Anonymous v_Anonymous; + var Roaming v_Roaming; + var No_answer v_No_answer; + var Busy v_Busy; + var Not_registered v_Not_registered; + var Not_reachable v_Not_reachable; + var Rule_deactivated v_Rule_deactivated; + var integer v_DecvalueResult := -1; + + select (p_GivenCondition) { + case ("anonymous") {v_DecvalueResult := decvalue(v_Bitstring, v_Anonymous);} + case ("roaming") {v_DecvalueResult := decvalue(v_Bitstring, v_Roaming);} + case ("no-answer") {v_DecvalueResult := decvalue(v_Bitstring, v_No_answer);} + case ("busy") {v_DecvalueResult := decvalue(v_Bitstring, v_Busy);} + case ("not-registered") {v_DecvalueResult := decvalue(v_Bitstring, v_Not_registered);} + case ("not-reachable") {v_DecvalueResult := decvalue(v_Bitstring, v_Not_reachable);} + case ("rule-deactivated") {v_DecvalueResult := decvalue(v_Bitstring, v_Rule_deactivated);} + case else {FatalError(__FILE__, __LINE__, "Invalid condition");} + } + return (v_DecvalueResult == 0); + } + + //---------------------------------------------------------------------------- + /* + * @desc check condition in given rule + * @param p_Rule + * @param p_Condition + * @return boolean + * @status APPROVED (IMS) + */ + function fl_Rule_CheckCondition(RuleType p_Rule, + template (omit) charstring p_Condition) return boolean + { + var charstring v_Condition; + var integer i; + var integer k; + + if (not ispresent(p_Condition)) { // => "unconditional" + if (match(p_Rule.conditions, cr_ConditionsType_Empty ifpresent)) { // @sic R5s130794 change 26 sic@ + return true; + } + } else { + v_Condition := valueof(p_Condition); + if (ispresent(p_Rule.conditions)) { + for (i := 0; i < lengthof(p_Rule.conditions.choice_list); i := i + 1) { + if (ischosen(p_Rule.conditions.choice_list[i].elem_list)) { + for (k := 0; k < lengthof(p_Rule.conditions.choice_list[i].elem_list); k := k + 1) { + if (fl_MatchCondition(p_Rule.conditions.choice_list[i].elem_list[k], v_Condition)) { /* @sic R5s140975 - Additional MCC160 changes sic@ */ + return true; + } + } + } + } + } + } + return false; + } + + /* + * @desc check forward-to + * @param p_Rule + * @param p_TargetAddress + * @return boolean + * @status APPROVED (IMS) + */ + function fl_ForwardingRule_CheckForwardTo(RuleType p_Rule, + XSD.AnyURI p_TargetAddress) return boolean + { + var integer i; + var bitstring v_Bitstring; + var Forward_to v_Forward_to; + + for (i := 0; i < lengthof(p_Rule.actions.elem_list); i := i + 1) { + v_Bitstring := oct2bit(char2oct(p_Rule.actions.elem_list[i])); // @sic R5s141351 change 2: char2oct instead of str2oct sic@ + if (decvalue(v_Bitstring, v_Forward_to) == 0) { + if (match(v_Forward_to.target, p_TargetAddress)) { + return true; + } + } + } + return false; + } + + /* + * @desc check condition in given ruleset + * @param p_Ruleset + * @param p_Condition + * @param p_TargetAddress (default value: px_XCAP_TargetUri) + * @return boolean + * @status APPROVED (IMS) + */ + function fl_ForwardingRuleset_CheckCondition(Ruleset p_Ruleset, + template (omit) charstring p_Condition, + XSD.AnyURI p_TargetAddress := px_XCAP_TargetUri) return boolean + { + var integer i; + var RuleType v_Rule; + + for (i := 0; i < lengthof(p_Ruleset.rule_list); i := i + 1) { + v_Rule := p_Ruleset.rule_list[i]; + + if (fl_Rule_CheckCondition(v_Rule, p_Condition) and fl_ForwardingRule_CheckForwardTo(v_Rule, p_TargetAddress)) { + return true; + } + } + return false; + } + + /* + * @desc check ruleset regarding forwarding + * @param p_Condition + * @param p_Ruleset + * @return boolean + * @status APPROVED (IMS) + */ + function fl_CommunicationForwarding_CheckRuleset(SS_Type p_Condition, + Ruleset p_Ruleset) return boolean + { + var boolean v_Result := true; + + select (p_Condition) { + case (SS_CFU) { + v_Result := fl_ForwardingRuleset_CheckCondition(p_Ruleset, omit); + } + case (SS_CFNRy) { + v_Result := fl_ForwardingRuleset_CheckCondition(p_Ruleset, "no-answer"); + } + case (SS_CFB) { + v_Result := fl_ForwardingRuleset_CheckCondition(p_Ruleset, "busy"); + } + case (SS_CFNL) { + v_Result := fl_ForwardingRuleset_CheckCondition(p_Ruleset, "not-registered"); + } + case (SS_CFNRc) { + v_Result := fl_ForwardingRuleset_CheckCondition(p_Ruleset, "not-reachable"); // @sic R5s141162 change 1 overruled by R5-145722 and R5s141350 sic@ + } + } + return v_Result; + } + + //---------------------------------------------------------------------------- + /* + * @desc check allow + * @param p_Rule + * @param p_AllowValue + * @return boolean + * @status APPROVED (IMS) + */ + function fl_BarringRule_CheckAllow(RuleType p_Rule, + boolean p_AllowValue) return boolean + { + var integer i; + var bitstring v_Bitstring; + var Allow v_Allow; + + for (i := 0; i < lengthof(p_Rule.actions.elem_list); i := i + 1) { + v_Bitstring := oct2bit(char2oct(p_Rule.actions.elem_list[i])); // @sic R5s141351 change 2: char2oct instead of str2oct sic@ + if (decvalue(v_Bitstring, v_Allow) == 0) { + if (v_Allow == p_AllowValue) { + return true; + } + } + } + return false; + } + + /* + * @desc check for excepted user + * @param p_Rule + * @param p_UserId + * @return boolean + * @status APPROVED (IMS) + */ + function fl_BarringRule_CheckExceptSpecificUser(RuleType p_Rule, + XSD.AnyURI p_UserId) return boolean + { + var IdentityType v_Identity; + var ManyType v_Many; + var integer i; + var integer k; + var integer l; + + if (ispresent(p_Rule.conditions)) { + for (i := 0; i < lengthof(p_Rule.conditions.choice_list); i := i + 1) { + if (ischosen(p_Rule.conditions.choice_list[i].identity_list)) { + if (ispresent(p_Rule.conditions.choice_list[i].identity_list[0])) { + v_Identity := p_Rule.conditions.choice_list[i].identity_list[0]; + + for (k := 0; k < lengthof(v_Identity.choice_list); k := k + 1) { + if (ischosen(v_Identity.choice_list[k].many)) { + v_Many := v_Identity.choice_list[k].many; + for (l := 0; l < lengthof(v_Many.choice_list); l := l + 1) { + if (ischosen(v_Many.choice_list[l].except_)) { + if (v_Many.choice_list[l].except_.id == p_UserId) { + return true; + } + } + } + } + } + } + } + } + } + return false; + } + + /* + * @desc check for specific user + * @param p_Rule + * @param p_UserId + * @return boolean + * @status APPROVED (IMS) + */ + function fl_BarringRule_CheckOneSpecificUser(RuleType p_Rule, + XSD.AnyURI p_UserId) return boolean + { + var IdentityType v_Identity; + var OneType v_One; + var integer i; + var integer k; + + if (ispresent(p_Rule.conditions)) { + for (i := 0; i < lengthof(p_Rule.conditions.choice_list); i := i + 1) { + if (ischosen(p_Rule.conditions.choice_list[i].identity_list)) { + if (ispresent(p_Rule.conditions.choice_list[i].identity_list[0])) { + v_Identity := p_Rule.conditions.choice_list[i].identity_list[0]; + + for (k := 0; k < lengthof(v_Identity.choice_list); k := k + 1) { + if (ischosen(v_Identity.choice_list[k].one)) { + v_One := v_Identity.choice_list[k].one; + if (v_One.id == p_UserId) { + return true; + } + } + } + } + } + } + } + return false; + } + + /* + * @desc check for "other-identity" + * @param p_Rule + * @return boolean + * @status APPROVED (IMS) + */ + function fl_BarringRule_CheckOtherIdentity(RuleType p_Rule) return boolean + { + var XSD.String v_Element; + var bitstring v_Bitstring; + var Other_identity v_Other_identity; + var integer i; + var integer k; + + if (ispresent(p_Rule.conditions)) { + for (i := 0; i < lengthof(p_Rule.conditions.choice_list); i := i + 1) { + if (ischosen(p_Rule.conditions.choice_list[i].elem_list)) { + for (k := 0; k < lengthof(p_Rule.conditions.choice_list[i].elem_list); k := k + 1) { + v_Element := p_Rule.conditions.choice_list[i].elem_list[k]; + v_Bitstring := oct2bit(char2oct(v_Element)); // @sic R5s141351 change 2: char2oct instead of str2oct sic@ + if (decvalue(v_Bitstring, v_Other_identity) == 0) { + return true; + } + } + } + } + } + return false; + } + + /* + * @desc check option 1 at step 2 for testcase 15.13 + * @param p_Ruleset + * @param p_UserId (default value: px_XCAP_TargetUri) + * @return boolean + * @status APPROVED (IMS) + */ + function fl_IncomingCommunicationBarringExceptSpecificUser_CheckRuleset_Option1(Ruleset p_Ruleset, + XSD.AnyURI p_UserId := px_XCAP_TargetUri) return boolean + { + var integer i; + var RuleType v_Rule; + + for (i := 0; i < lengthof(p_Ruleset.rule_list); i := i + 1) { + v_Rule := p_Ruleset.rule_list[i]; + if (fl_BarringRule_CheckAllow(v_Rule, false) and fl_BarringRule_CheckExceptSpecificUser(v_Rule, p_UserId)) { + return true; + } + } + return false; + } + + /* + * @desc check 1st rule of option 2 at step 2 for testcase 15.13 + * @param p_Ruleset + * @param p_UserId (default value: px_XCAP_TargetUri) + * @return boolean + * @status APPROVED (IMS) + */ + function fl_IncomingCommunicationBarringExceptSpecificUser_CheckRuleset_Option2_Rule1(Ruleset p_Ruleset, + XSD.AnyURI p_UserId := px_XCAP_TargetUri) return boolean + { + var integer i; + var RuleType v_Rule; + + for (i := 0; i < lengthof(p_Ruleset.rule_list); i := i + 1) { + v_Rule := p_Ruleset.rule_list[i]; + if (fl_BarringRule_CheckAllow(v_Rule, true) and fl_BarringRule_CheckOneSpecificUser(v_Rule, p_UserId)) { + return true; + } + } + return false; + } + + /* + * @desc check 2nd rule of option 2 at step 2 for testcase 15.13 + * @param p_Ruleset + * @return boolean + * @status APPROVED (IMS) + */ + function fl_IncomingCommunicationBarringExceptSpecificUser_CheckRuleset_Option2_Rule2(Ruleset p_Ruleset) return boolean + { + var integer i; + var RuleType v_Rule; + + for (i := 0; i < lengthof(p_Ruleset.rule_list); i := i + 1) { + v_Rule := p_Ruleset.rule_list[i]; + if (fl_BarringRule_CheckAllow(v_Rule, false) and fl_BarringRule_CheckOtherIdentity(v_Rule)) { + return true; + } + } + return false; + } + + /* + * @desc check rule at step 2 for testcase 15.14 + * @param p_Ruleset + * @return boolean + * @status APPROVED (IMS) + */ + function fl_IncomingCommunicationBarringAnonymousUser_CheckRuleset(Ruleset p_Ruleset) return boolean + { + var integer i; + var RuleType v_Rule; + + for (i := 0; i < lengthof(p_Ruleset.rule_list); i := i + 1) { + v_Rule := p_Ruleset.rule_list[i]; + if (fl_BarringRule_CheckAllow(v_Rule, false) and fl_Rule_CheckCondition(v_Rule, "anonymous")) { + return true; + } + } + return false; + } + + /* + * @desc check ruleset + * @param p_Condition + * @param p_Ruleset + * @return boolean + * @status APPROVED (IMS) + */ + function fl_IncomingCommunicationBarring_CheckRuleset(SS_Type p_Condition, + Ruleset p_Ruleset) return boolean + { + var boolean v_Result := true; + + select (p_Condition) { + case (SS_BAIC_EXCEPT_SPECIFIC_USER) { + v_Result := (fl_IncomingCommunicationBarringExceptSpecificUser_CheckRuleset_Option1(p_Ruleset) or + (fl_IncomingCommunicationBarringExceptSpecificUser_CheckRuleset_Option2_Rule1(p_Ruleset) and + fl_IncomingCommunicationBarringExceptSpecificUser_CheckRuleset_Option2_Rule2(p_Ruleset))); + } + case (SS_BAIC_ANONYMOUS) { + v_Result := fl_IncomingCommunicationBarringAnonymousUser_CheckRuleset(p_Ruleset); + } + } + return v_Result; + } + + /* + * @desc check rule at step 2 for testcase 15.14a + * @param p_Ruleset + * @return boolean + * @status APPROVED (IMS) + */ + function fl_CommunicationBarringWhileRoaming_CheckRuleset(Ruleset p_Ruleset) return boolean + { + var integer i; + var RuleType v_Rule; + + for (i := 0; i < lengthof(p_Ruleset.rule_list); i := i + 1) { + v_Rule := p_Ruleset.rule_list[i]; + if (fl_BarringRule_CheckAllow(v_Rule, false) and fl_Rule_CheckCondition(v_Rule, "roaming")) { + return true; + } + } + return false; + } + + //============================================================================ + /* + * @desc preamble for XCAP test cases; returns XCAP user id (XUI) + * @param p_GbaRequested (default value: omit) + * @return charstring + * @status APPROVED (IMS) + */ + function fl_XCAP_Preamble(boolean p_GbaRequested := false) runs on IMS_XCAP_PTC return charstring + { + var HTTP_AuthenticationMethod_Type v_AuthenticationMethod := fl_HTTP_AuthenticationMethod(p_GbaRequested); + var charstring v_XcapUserId; + var charstring v_XcapUsername; + + f_IMS_CC_Preamble(IPCAN_XCAP, IMS_REGISTERED); + + /* NOTE: f_IMS_CC_StartSignalling triggers IPCAN to start the XCAP signalling but it does not wait for it + * => we can start this in the preamble even though the UE will get triggered later on in the test body */ + f_IMS_CC_StartSignalling(IPCAN_XCAP_Signalling); + + if (pc_XCAP_XUIisDefaultPublicUserId) { /* @sic R5-144689, R5-144531 sic@ */ + v_XcapUserId := f_IMS_PTC_ImsInfo_GetURI(defaultId); + } else { + FatalError(__FILE__, __LINE__, "non-IR.92 configuration not supported yet: XUI has to be default public user id)"); + } + if (pc_XCAP_UsernameIsConfiguredInUE) { /* @sic R5-144689, R5-144531 sic@ */ + v_XcapUsername := px_XCAP_Username; + } else { + v_XcapUsername := v_XcapUserId; + } + + + f_IMS_HTTP_Configure(v_AuthenticationMethod, v_XcapUserId, v_XcapUsername); + + return v_XcapUserId; + } + + //---------------------------------------------------------------------------- + /* + * @desc common test body for XCAP test cases + * @param p_SupplementaryService + * @param p_TargetURI (default value: omit) + * @param p_AllowAndCheckRuleDeactivated (default value: false) + * @status APPROVED (IMS) + */ + function fl_XCAP_SupplementaryService_CommonTestBody(SS_Type p_SupplementaryService, + template (omit) charstring p_TargetURI := omit, + boolean p_AllowAndCheckRuleDeactivated := false) runs on IMS_XCAP_PTC + { /* @sic R5-145720, R5-145721, R5-145722: new parameter p_AllowAndCheckRuleDeactivated sic@ */ + /* @sic R5s150244 change 2: p_PublicUserIdentity replace by template (omit) charstring p_TargetURI sic@ */ + /* @sic R5-151795: p_GbaRequested sic@ */ + var float v_MaxDuration := 300.0; /* @sic R5s130794 change 21: increased to 300.0 sic@ */ + var Simservs v_SimservsDocument; + var SupplementaryServiceInfoList_Type v_ServiceList; + + f_IMS_XCAP_InitialiseSuplementaryServices(); + + f_IMS_TestBody_Set(true); + + // Step 1 - Activate the service + f_UT_IMS_ActivateDeactivateSupplementaryService(MMI, p_SupplementaryService, true, p_TargetURI); /* @sic R5s150244 change 2 sic@ */ + + // Step 2 - HTTP Request / Response exchange + f_IMS_HTTP_Transaction(v_MaxDuration); + v_SimservsDocument := f_IMS_XCAP_GetDocument(); + v_ServiceList := fl_Simservs_GetSpecificService(v_SimservsDocument, p_SupplementaryService); + + if (not fl_SupplementaryService_CheckActivated(v_ServiceList, ACTIVATED)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Step 2 - supplementary service is not activated"); + } + if (p_AllowAndCheckRuleDeactivated and fl_SupplementaryService_CheckActivated(v_ServiceList, deACTIVATED)) { /* @sic R5-145720, R5-145721, R5-145722 sic@ */ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Step 2 - supplementary service is de-activated"); + } + + // check ruleset for communication forwarding, communication barring + select (p_SupplementaryService) { + case (SS_CFU, + SS_CFNRy, + SS_CFB, + SS_CFNL, + SS_CFNRc) { + if (not fl_CommunicationForwarding_CheckRuleset(p_SupplementaryService, v_ServiceList[0].ruleset)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Step 2 - supplementary service: invalid rule set for communication forwarding"); + } + } + case (SS_BAIC_ANONYMOUS, + SS_BAIC_EXCEPT_SPECIFIC_USER) { + if (not fl_IncomingCommunicationBarring_CheckRuleset(p_SupplementaryService, v_ServiceList[0].ruleset)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Step 2 - supplementary service: invalid rule set for incoming communication barring"); + } + } + case (SS_BIC_ROAM) { // @sic R5-153995 sic@ + if (not fl_CommunicationBarringWhileRoaming_CheckRuleset(v_ServiceList[0].ruleset)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Step 2 - supplementary service: invalid rule set for incoming communication barring"); + } + } + case (SS_BARRING_OUT_ROAM) { // @sic R5-153995 sic@ + if (not fl_CommunicationBarringWhileRoaming_CheckRuleset(v_ServiceList[0].ruleset)) { /* @sic R5-151166: outgoing communication barring re-introduced sic@ */ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Step 2 - supplementary service: invalid rule set for outgoing communication barring"); + } + } + } + f_IMS_PreliminaryPass(__FILE__, __LINE__, "Step 2"); + + // Step 3 - Deactivate the service + f_UT_IMS_ActivateDeactivateSupplementaryService(MMI, p_SupplementaryService, false, p_TargetURI); /* @sic R5s150244 change 2 sic@ */ + + // Step 4 + f_IMS_HTTP_Transaction(v_MaxDuration); + v_SimservsDocument := f_IMS_XCAP_GetDocument(); + v_ServiceList := fl_Simservs_GetSpecificService(v_SimservsDocument, p_SupplementaryService); + + if (not (fl_SupplementaryService_CheckActivated(v_ServiceList, notACTIVATED) or + p_AllowAndCheckRuleDeactivated and fl_SupplementaryService_CheckActivated(v_ServiceList, deACTIVATED))) { // @sic R5s141113 change 1; R5-145720, R5-145721, R5-145722 sic@ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Step 4 - supplementary service is still activated"); + } + f_IMS_PreliminaryPass(__FILE__, __LINE__, "Step 4"); + + f_IMS_TestBody_Set(false); + } + + //============================================================================ + /* + * @desc REFERENCE TS 34.229-1 clause 15.1 + * @status APPROVED (IMS) + */ + function f_TC_15_1_IMS() runs on IMS_XCAP_PTC + { + var SS_Type v_SupplementaryService := SS_CLIP; + + fl_XCAP_Preamble(); + + // @siclog "Step 1 - 4" siclog@ + fl_XCAP_SupplementaryService_CommonTestBody(v_SupplementaryService); /* @sic R5s150244 change 2 sic@ */ + + f_IMS_CC_Postamble(IPCAN_XCAP_Signalling); /* @sic R5s141051 change 10 sic@ */ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 15.2 + * @status APPROVED (IMS) + */ + function f_TC_15_2_IMS() runs on IMS_XCAP_PTC + { + var SS_Type v_SupplementaryService := SS_CLIR; + + fl_XCAP_Preamble(); + + // @siclog "Step 1 - 4" siclog@ + fl_XCAP_SupplementaryService_CommonTestBody(v_SupplementaryService); /* @sic R5s150244 change 2 sic@ */ + + f_IMS_CC_Postamble(IPCAN_XCAP_Signalling); /* @sic R5s141051 change 10 sic@ */ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 15.3 + * @status APPROVED (IMS) + */ + function f_TC_15_3_IMS() runs on IMS_XCAP_PTC + { + var SS_Type v_SupplementaryService := SS_COLP; + + fl_XCAP_Preamble(); + + // @siclog "Step 1 - 4" siclog@ + fl_XCAP_SupplementaryService_CommonTestBody(v_SupplementaryService); /* @sic R5s150244 change 2 sic@ */ + + f_IMS_CC_Postamble(IPCAN_XCAP_Signalling); /* @sic R5s141051 change 10 sic@ */ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 15.4 + * @status APPROVED (IMS) + */ + function f_TC_15_4_IMS() runs on IMS_XCAP_PTC + { + var SS_Type v_SupplementaryService := SS_TIR; + + fl_XCAP_Preamble(); + + // @siclog "Step 1 - 4" siclog@ + fl_XCAP_SupplementaryService_CommonTestBody(v_SupplementaryService); /* @sic R5s150244 change 2 sic@ */ + + f_IMS_CC_Postamble(IPCAN_XCAP_Signalling); /* @sic R5s141051 change 10 sic@ */ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 15.5 + * @status APPROVED (IMS) + */ + function f_TC_15_5_IMS() runs on IMS_XCAP_PTC + { + var SS_Type v_SupplementaryService := SS_CFU; + var boolean v_AllowAndCheckRuleDeactivated := true; /* @sic R5-145720 sic@ */ + + fl_XCAP_Preamble(); + + // @siclog "Step 1 - 4" siclog@ + fl_XCAP_SupplementaryService_CommonTestBody(v_SupplementaryService, px_XCAP_TargetUri, v_AllowAndCheckRuleDeactivated); /* @sic R5s150244 change 2 sic@ */ + + f_IMS_CC_Postamble(IPCAN_XCAP_Signalling); /* @sic R5s141051 change 10 sic@ */ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 15.7 + * @status APPROVED (IMS) + */ + function f_TC_15_7_IMS() runs on IMS_XCAP_PTC + { + var SS_Type v_SupplementaryService := SS_CFNRy; + var boolean v_AllowAndCheckRuleDeactivated := true; /* @sic R5-145720 sic@ */ + + fl_XCAP_Preamble(); + + // @siclog "Step 1 - 4" siclog@ + fl_XCAP_SupplementaryService_CommonTestBody(v_SupplementaryService, px_XCAP_TargetUri, v_AllowAndCheckRuleDeactivated); /* @sic R5s150244 change 2 sic@ */ + + f_IMS_CC_Postamble(IPCAN_XCAP_Signalling); /* @sic R5s141051 change 10 sic@ */ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 15.9 + * @status APPROVED (IMS) + */ + function f_TC_15_9_IMS() runs on IMS_XCAP_PTC + { + var SS_Type v_SupplementaryService := SS_CFB; + var boolean v_AllowAndCheckRuleDeactivated := true; /* @sic R5-145720 sic@ */ + + fl_XCAP_Preamble(); + + // @siclog "Step 1 - 4" siclog@ + fl_XCAP_SupplementaryService_CommonTestBody(v_SupplementaryService, px_XCAP_TargetUri, v_AllowAndCheckRuleDeactivated); /* @sic R5s150244 change 2 sic@ */ + + f_IMS_CC_Postamble(IPCAN_XCAP_Signalling); /* @sic R5s141051 change 10 sic@ */ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 15.10 + * @status APPROVED (IMS) + */ + function f_TC_15_10_IMS() runs on IMS_XCAP_PTC + { + var SS_Type v_SupplementaryService := SS_CFNL; + + fl_XCAP_Preamble(); + + // @siclog "Step 1 - 4" siclog@ + fl_XCAP_SupplementaryService_CommonTestBody(v_SupplementaryService, px_XCAP_TargetUri); /* @sic R5s150244 change 2 sic@ */ + + f_IMS_CC_Postamble(IPCAN_XCAP_Signalling); /* @sic R5s141051 change 10 sic@ */ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 15.10a + * @status APPROVED (IMS) + */ + function f_TC_15_10a_IMS() runs on IMS_XCAP_PTC + { + var SS_Type v_SupplementaryService := SS_CFNRc; + var boolean v_AllowAndCheckRuleDeactivated := true; /* @sic R5-145722 sic@ */ + + fl_XCAP_Preamble(); + + // @siclog "Step 1 - 4" siclog@ + fl_XCAP_SupplementaryService_CommonTestBody(v_SupplementaryService, px_XCAP_TargetUri, v_AllowAndCheckRuleDeactivated); /* @sic R5s150244 change 2 sic@ */ + + f_IMS_CC_Postamble(IPCAN_XCAP_Signalling); /* @sic R5s141051 change 10 sic@ */ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 15.13 + * @status APPROVED (IMS) + */ + function f_TC_15_13_IMS() runs on IMS_XCAP_PTC + { + var SS_Type v_SupplementaryService := SS_BAIC_EXCEPT_SPECIFIC_USER; + + fl_XCAP_Preamble(); + + // @siclog "Step 1 - 4" siclog@ + fl_XCAP_SupplementaryService_CommonTestBody(v_SupplementaryService, px_XCAP_TargetUri); /* @sic R5s150244 change 2 sic@ */ + + f_IMS_CC_Postamble(IPCAN_XCAP_Signalling); /* @sic R5s141051 change 10 sic@ */ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 15.14a + * @status APPROVED (IMS) + */ + function f_TC_15_14a_IMS() runs on IMS_XCAP_PTC + { + var SS_Type v_SupplementaryService := SS_BIC_ROAM; // @sic R5-153995 sic@ + var boolean v_AllowAndCheckRuleDeactivated := true; /* @sic R5-145721 sic@ */ + + fl_XCAP_Preamble(); + + // @siclog "Step 1 - 4" siclog@ + fl_XCAP_SupplementaryService_CommonTestBody(v_SupplementaryService, -, v_AllowAndCheckRuleDeactivated); /* @sic R5s150244 change 2 sic@ */ + + f_IMS_CC_Postamble(IPCAN_XCAP_Signalling); /* @sic R5s141051 change 10 sic@ */ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 15.14b + * @status + */ + function f_TC_15_14b_IMS() runs on IMS_XCAP_PTC + { + var SS_Type v_SupplementaryService := SS_BARRING_OUT_ROAM; + var boolean v_AllowAndCheckRuleDeactivated := true; /* @sic R5-145721 sic@ */ + + fl_XCAP_Preamble(); + + // @siclog "Step 1 - 4" siclog@ + fl_XCAP_SupplementaryService_CommonTestBody(v_SupplementaryService, -, v_AllowAndCheckRuleDeactivated); /* @sic R5s150244 change 2 sic@ */ + + f_IMS_CC_Postamble(IPCAN_XCAP_Signalling); /* @sic R5s141051 change 10 sic@ */ + } + + function f_TC_15_29_IMS() runs on IMS_XCAP_PTC + { + var SS_Type v_SupplementaryService := SS_CLIP; + var boolean v_GbaRequested := true; + + fl_XCAP_Preamble(v_GbaRequested); + + // @siclog "Step 1 - 4" siclog@ + fl_XCAP_SupplementaryService_CommonTestBody(v_SupplementaryService); + + f_IMS_CC_Postamble(IPCAN_XCAP_Signalling); + } +} diff --git a/IMS_PART4_IWD_15wk38/IMS/15/IMS_ConferenceEventPackage.ttcn b/IMS_PART4_IWD_15wk38/IMS/15/IMS_ConferenceEventPackage.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4b4189c9b024869baf8e5a28763d5e509e10fa96 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/15/IMS_ConferenceEventPackage.ttcn @@ -0,0 +1,426 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-15 19:05:27 +0200 (Tue, 15 Sep 2015) $ +// $Rev: 14431 $ +/******************************************************************************/ + +module IMS_ConferenceEventPackage { + import from CommonDefs all; + import from IP_ASP_TypeDefs all; + import from LibSip_MessageBodyTypes all; + import from LibSip_SIPTypesAndValues all; + import from IMS_CommonDefs all; + import from IMS_Component all; + import from IMS_ASP_TypeDefs all; + import from IMS_ASP_Templates all; + import from IMS_SIP_Templates all; + import from IMS_Procedures_Common all; + import from IMS_Procedures_CallControl all; + import from IMS_Procedures_Registration all; + import from urn_ietf_params_xml_ns_conference_info language "XSD" all; + import from IMS_CommonParameters all; + import from IMS_CC_Parameters all; + + //---------------------------------------------------------------------------- + + template (value) Media_type cs_Media(charstring p_Id, + charstring p_Type, + charstring p_Label, + charstring p_SsrcId) := + { /* @status APPROVED (IMS) */ + id := p_Id, + attr := omit, + display_text := omit, + type_ := p_Type, + label_ := p_Label, + src_id := p_SsrcId, + status := sendrecv, + elem_list := {} + }; + + const CharStringList_Type tsc_MediaTypeList_Audio := {"audio"}; /* @status APPROVED (IMS) */ + const CharStringList_Type tsc_MediaTypeList_AudioVideo := {"audio", "video"}; /* @status APPROVED (IMS) */ + + /* + * @desc media list used in NOTIFY acc. to A.5.3 + * @param p_MediaTypeList + * @param p_Version + * @param p_State + * @return template (value) Endpoint_type.media_list + * @status APPROVED (IMS) + */ + function fl_ConferenceInfo_MediaList(CharStringList_Type p_MediaTypeList, + integer p_Version, + State_type p_State) return template (value) Endpoint_type.media_list + { + var template (value) Endpoint_type.media_list v_MediaList := {}; + var charstring v_Id; + var charstring v_MediaType; + var integer v_Label; + var integer v_SsrcId; + var integer i; + + select (p_State) { // set Conference Data depending on the kind of notification (see RFC 4575) + case (full) { // state attribute (RFC 4575 cl. 5.2): "full" in case of initial notification + v_Label := 34567; // label (RFC 4575 cl. 5.8.3): value acc. to A.5.3 + } + case (partial) { // state attribute (RFC 4575 cl. 5.2): "full" in case of initial notification + v_Label := 11223 + p_Version - 1; /* label (RFC 4575 cl. 5.8.3): value acc. to C.19 for p_Version==1; !!!! PROSE ISSUE for p_Version > 1 !!!! + NOTE: acc. to RFC 4575 the label has to be unique */ + } + } + + for (i := 0; i < lengthof(p_MediaTypeList); i := i + 1) { + v_Id := int2str(i + 1); + v_MediaType := p_MediaTypeList[i]; + v_SsrcId := v_Label + 1; // src-id (RFC 4575 cl. 5.8.4): value arbitrarily selected + v_MediaList[i] := cs_Media(v_Id, v_MediaType, int2str(v_Label), int2str(v_SsrcId)); + v_Label := v_Label + 1; + } + + return v_MediaList; + } + + template (value) Endpoint_type cs_Endpoint(charstring p_EndPointEntity, + template (value) Endpoint_type.media_list p_MediaList) := + { /* @status APPROVED (IMS) */ + entity := p_EndPointEntity, + state := omit, + attr := omit, + display_text := omit, + referred := omit, + status := connected, // Endpoint_status_type status optional, + joining_method := dialed_in, // Joining_type joining_method optional, + joining_info := omit, // Execution_type joining_info optional, + disconnection_method := omit, // Disconnection_type disconnection_method optional, + disconnection_info := omit, // Execution_type disconnection_info optional, + media_list := p_MediaList, // record of Media_type media_list, + call_info := omit, // Call_type call_info optional, + elem_list := {} + }; + + template (value) Conference_type cs_XmlBody_ConfInfo(charstring p_ConferenceUri, // conference URI: SIP URI that an interested entity needs to SUBSCRIBE to in order to get the conference package information (RFC 4575 clause 5.2) + charstring p_UserEntity, // URI for the user in the conference: corresponds to the call signaling authenticated identity of the participant (RFC 4575 clause 5.6) + charstring p_EndPointEntity, // 'entity' key: e.g. User's contact URI (RFC 4575 clause 5.7) + CharStringList_Type p_MediaTypeList, + integer p_Version, + State_type p_State) := + { /* acc. to RFC 4575 clause 5.2 */ + /* @status APPROVED (IMS) */ + entity := p_ConferenceUri, // XSD.AnyURI entity, + state := p_State, // state_type state optional, + version := p_Version, // XSD.UnsignedInt version optional, + attr := omit, // record (1..infinity) of XSD.String attr optional, + conference_description := omit, // Conference_description_type conference_description optional, + host_info := omit, // optional, + conference_state := omit, // Conference_state_type conference_state optional, + users := { // RFC 4575 clause 5.6 + state := omit, + attr := omit, + user_list := { + { + entity := p_UserEntity, + state := omit, + attr := omit, + display_text := omit, + associated_aors := omit, + roles := omit, + languages := omit, + cascaded_focus := omit, + endpoint_list := {cs_Endpoint(p_EndPointEntity, fl_ConferenceInfo_MediaList(p_MediaTypeList, p_Version, p_State))}, + elem_list := {} + } + }, + elem_list := {} + }, + sidebars_by_ref := omit, // Uris_type sidebars_by_ref optional, + sidebars_by_val := omit, // Sidebars_by_val_type sidebars_by_val optional, + elem_list := {} // record of XSD.String elem_list + }; + + template (value) MessageBody cs_MessageBody_Conference(template (value) Conference_type p_Conference) := + { /* @status APPROVED (IMS) */ + xmlBody := oct2char(bit2oct(encvalue(p_Conference))) + }; + + //============================================================================ + // Subscribtion to conference event package + //---------------------------------------------------------------------------- + /* + * @desc SUBSCRIBE acc. to 34.229 A.5.1 to be used in C.10 + * @param p_SubscribeCreatingDialog + * @param p_RequestUri + * @param p_SessionIdSupported (default value: pc_IMS_SessionIdSupported) + * @return template (present) MessageHeader + * @status APPROVED (IMS) + */ + function fl_ConferenceEventPackage_SubscribeRequest_MessageHeaderRX(boolean p_SubscribeCreatingDialog, + template (present) SipUrl p_RequestUri, + boolean p_SessionIdSupported := pc_IMS_SessionIdSupported) + runs on IMS_PTC return template (present) MessageHeader + { /* @sic R5-153986: function has been reviewed to be strictly according to the prose sic@ */ + /* acc. to RFC 3265 a SUBSCRIBE creates a new dialog or it is sent on a pre-existing dialog */ + var boolean v_IsGiba := f_IMS_PTC_SecurityScheme_IsGiba(); // => A1/A2 + var template (present) MessageHeader v_MessageHeader_Subscribe := cr_MessageHeader_Dummy; + var template (present) PAccessNetworkInfo v_PAccessNetworkInfo := cr_PAccessNetworkInfoDef(f_IMS_PTC_RanType_GetString()); + var template (present) SipUrl v_SipUrlFrom := ?; + var template (present) RouteBody_List v_RouteBodyList; + var template (present) From v_From; + var template (present) To v_To; + var template SessionId v_SessionId; + var template (present) CallId v_CallId; + var template (present) integer v_Port_us := ?; + var template integer v_Port_ps := *; + var IMS_ProtectedPorts_Type v_Protected; + + if (v_IsGiba) { + v_MessageHeader_Subscribe.require := omit; + v_MessageHeader_Subscribe.proxyRequire := omit; + v_MessageHeader_Subscribe.securityVerify := omit; + v_MessageHeader_Subscribe.pAccessNetworkInfo := v_PAccessNetworkInfo ifpresent; + } + else { + v_Protected := f_IMS_PTC_Security_GetProtectedPorts(); + v_Port_us := v_Protected.Port_us; + v_Port_ps := v_Protected.Port_ps; + v_MessageHeader_Subscribe.require := cr_RequireSecAgree; + v_MessageHeader_Subscribe.proxyRequire := cr_ProxyRequireDef; + v_MessageHeader_Subscribe.securityVerify := f_IMS_PTC_BuildSecurityVerifyHeader(); + v_MessageHeader_Subscribe.pAccessNetworkInfo := v_PAccessNetworkInfo + } + + if (p_SubscribeCreatingDialog) { /* @sic R5-153986 sic@ */ + v_RouteBodyList := { // same as in REFER + cr_RouteBody(*, cr_SipUri_HostPort_lr(f_IMS_PTC_Pcscf_Get(), v_Port_ps)), + cr_RouteBody(*, cr_SipUri_HostPort_lr(px_IMS_Scscf)) + }; + v_From := cr_From(*, v_SipUrlFrom); + v_To := cr_ToDef(p_RequestUri); + v_CallId := cr_CallId(?); + v_SessionId := f_IMS_SessionId_RX_IfSupported(p_SessionIdSupported); + } + else { + v_RouteBodyList := f_RouteSet_RouteBodyList_RX(); // !!!! PROSE ISSUE !!!! + v_From := f_IMS_RequestInDialog_FromHeaderRX(); // !!!! PROSE ISSUE !!!! + v_To := f_IMS_RequestInDialog_ToHeaderRX(); // !!!! PROSE ISSUE !!!! + v_CallId := f_IMS_PTC_ImsInfo_DialogGetCallId(); // !!!! PROSE ISSUE !!!! + v_SessionId := f_IMS_PTC_ImsInfo_DialogGetSessionId(); // !!!! PROSE ISSUE !!!! + } + v_MessageHeader_Subscribe.via := f_IMS_InviteRequest_ViaRX(?); /* same as for INVITE; but p_Port_us is mandatory + @sic R5-153986: common review of implementation sic@ */ + v_MessageHeader_Subscribe.route := cr_Route(v_RouteBodyList); + v_MessageHeader_Subscribe.toField := v_To; + v_MessageHeader_Subscribe.fromField := v_From; + v_MessageHeader_Subscribe.callId := v_CallId; + v_MessageHeader_Subscribe.sessionId := v_SessionId; + v_MessageHeader_Subscribe.cSeq := cr_CseqDef(?, "SUBSCRIBE"); + v_MessageHeader_Subscribe.expires := cr_Expires(?); + v_MessageHeader_Subscribe.maxForwards := cr_MaxForwardsDef; + v_MessageHeader_Subscribe.event := cr_EventDef("conference"); + v_MessageHeader_Subscribe.accept := cr_AcceptDef("application/conference-info+xml"); + + v_MessageHeader_Subscribe.contact := cr_Contact(f_Contact_SipUri_HostPortRX(?, v_Port_us)); /* host address needs to be checked after receiving @sic R5s120727 change 6.1 sic@ + @sic R5s150721, R5-153760: cr_SipUri_HostPort replaced by f_Contact_SipUri_HostPortRX sic@ */ + + return v_MessageHeader_Subscribe; + } + + //---------------------------------------------------------------------------- + /* + * @desc UE subscribes to conference event package acc. to 34.229-1 A.5.1 and A.5.2 + * @param p_IMS_SUBSCRIBE_REQ (by reference) + * @param p_SubscribeCreatingDialog + * @param p_ConferenceUri + * @status APPROVED (IMS) + */ + altstep a_ConferenceEventPackage_ReceiveSubscribeA51SendOK(out IMS_DATA_REQ p_IMS_SUBSCRIBE_REQ, + boolean p_SubscribeCreatingDialog, + charstring p_ConferenceUri) runs on IMS_PTC + { /* @sic R5-153986: new parameter p_SubscribeCreatingDialog sic@ */ + var template (present) SipUrl v_ConferenceSipUrlRX := f_SIP_BuildSipUri_RX(p_ConferenceUri); + var template (present) MessageHeader v_MessageHeader_Subscribe := fl_ConferenceEventPackage_SubscribeRequest_MessageHeaderRX(p_SubscribeCreatingDialog, v_ConferenceSipUrlRX); + var MessageHeader v_MessageHeader_SubscribeValue; + var IMS_DATA_REQ v_IMS_SUBSCRIBE_REQ; + var charstring v_ContactHostname; + var integer v_CSeqValue; + var charstring v_ToTag; + + [] IMS_Server.receive(car_IMS_Subscribe_Request(cr_SUBSCRIBE_Request(v_ConferenceSipUrlRX, v_MessageHeader_Subscribe))) -> value v_IMS_SUBSCRIBE_REQ + { + if (not isvalue(v_ConferenceSipUrlRX.components.sip.hostPort.host)) { + FatalError(__FILE__, __LINE__, "invalid conference uri"); + } + v_MessageHeader_SubscribeValue := v_IMS_SUBSCRIBE_REQ.Request.Subscribe.msgHeader; + + f_IMS_MessageHeader_Request_CheckVia(v_MessageHeader_SubscribeValue, v_IMS_SUBSCRIBE_REQ.RoutingInfo.Protocol); + f_IMS_MessageHeader_CheckContactAddr(v_MessageHeader_SubscribeValue); + + if (p_SubscribeCreatingDialog) { /* @sic R5-153986 sic@ */ + f_IMS_MessageHeader_CheckTo(v_MessageHeader_SubscribeValue, noToTag); + v_ToTag := f_IMS_GenerateTag("SUBSCRIBE-to-conference-package"); + f_IMS_PTC_ImsInfo_DialogInit(dialogRemote, v_MessageHeader_SubscribeValue, confEventDialog); + f_IMS_PTC_ImsInfo_DialogSetLocalTag(v_ToTag, confEventDialog); + } else { + v_CSeqValue := f_IMS_PTC_ImsInfo_CseqIncr(dialogRemote); /* => get next CSeq value; CSeq gets incremented for the remote (UE) side of the current dialog */ + f_IMS_MessageHeader_CheckCSeq(v_MessageHeader_SubscribeValue, v_CSeqValue); + f_IMS_MessageHeader_CheckTo(v_MessageHeader_SubscribeValue, dialogToTag); + } + v_ContactHostname := valueof(v_ConferenceSipUrlRX.components.sip.hostPort.host); + f_IMS_SUBSCRIBE_Response(confEventDialog, v_IMS_SUBSCRIBE_REQ, "7200", v_ContactHostname); + + p_IMS_SUBSCRIBE_REQ := v_IMS_SUBSCRIBE_REQ; // return message by ref + } + } + + //============================================================================ + // notifications of conference event package + //---------------------------------------------------------------------------- + /* + * @desc Prepare NOTIFY header according. to 34.229-1 Annex A.5.3 + * @param p_DialogIndex + * @param p_ConferenceUri + * @param p_SubscriptionState + * @return template (value) MessageHeader + * @status APPROVED (IMS) + */ + function f_IMS_NotifyRequest_MessageHeader_A53(template (omit) IMS_PTC_DialogIndex_Type p_DialogIndex := omit, + charstring p_ConferenceUri, + template (value) SubscriptionState p_SubscriptionState) runs on IMS_PTC return template (value) MessageHeader + { /* @sic R5-153986: dialog needs to be considered sic@ */ + /* @sic R5-153756, R5-153986: use of f_IMS_NotifyRequest_MessageHeader_Common sic@ */ + + var charstring v_NW_AddrStr := f_IMS_PTC_NW_Address_GetAddrStr(); + var CharStringList_Type v_ViaAddressList := {v_NW_AddrStr, px_IMS_Scscf}; + var template (value) Via v_Via := f_IMS_NotifyRequest_ViaTX(v_ViaAddressList); /* @sic R5-153986: new function f_IMS_NotifyRequest_ViaTX sic@ */ + var template (value) SipUrl v_ContactSipUrl := f_SIP_BuildSipUri_TX(p_ConferenceUri); + var template (value) ContentType v_ContentType := cs_ContentType("application/conference-info+xml"); + + return f_IMS_NotifyRequest_MessageHeader_Common(p_DialogIndex, v_Via, v_ContactSipUrl, "conference", p_SubscriptionState, v_ContentType); + } + + /* + * @desc send NOTIFY acc. to A.5.3 + * @param p_SubscribeRequest + * @param p_Protocol + * @param p_FinalConferenceUri + * @param p_ParticipantUri + * @param p_ParticipantContactUri + * @param p_MediaTypeList (default value: {"audio"}) + * @param p_Version (default value: 0) + * @param p_State (default value: full) + * @param p_SubscribeCreatingDialog (default value: pc_SubscribeConferenceEvent_OutsideINVITEDialog) + * @return MessageHeader + * @status APPROVED (IMS) + */ + function f_IMS_ConferenceEventPackage_SendNotify(SUBSCRIBE_Request p_SubscribeRequest, + InternetProtocol_Type p_Protocol, + charstring p_FinalConferenceUri, + charstring p_ParticipantUri, + charstring p_ParticipantContactUri, + CharStringList_Type p_MediaTypeList := {"audio"}, + integer p_Version := 0, + State_type p_State := full, + boolean p_SubscribeCreatingDialog := pc_SubscribeConferenceEvent_OutsideINVITEDialog) + runs on IMS_PTC return MessageHeader + { /* PROSE ISSUE: prose specifies hard-coded value for the label of the NOTIFY's message body but it seems that the label shall be different for different users (-> RFC 4575 clause 5.8.3) + => parameter p_Version is used to increment the version for each notification and also to generate distinct labels to distinguish subsequent users joining the conference call */ + /* @sic R5-153986: new parameter p_SubscribeCreatingDialog sic@ */ + var template (value) MessageHeader v_MessageHeader_Notify; + var template (value) Conference_type v_ConferenceBody; + var template (value) SubscriptionState v_SubscriptionState := cs_SubscriptionState_Active("7200"); + var SipUrl v_ContactUrl := f_MessageHeader_GetContactSipUrl(p_SubscribeRequest.msgHeader); + var template (omit) IMS_PTC_DialogIndex_Type v_DialogIndex; + var integer v_CseqValue; + + if (p_SubscribeCreatingDialog) { /* @sic R5-153986 sic@ */ + v_DialogIndex := confEventDialog; /* separate dialog for conf event package */ + } else { + v_DialogIndex := omit; /* the NOTIFY shall be sent on the current dialog what is in general the dialog created by C.10 */ + } + v_CseqValue := f_IMS_PTC_ImsInfo_CseqIncr(dialogLocal); + v_ConferenceBody := cs_XmlBody_ConfInfo(p_FinalConferenceUri, p_ParticipantUri, p_ParticipantContactUri, p_MediaTypeList, p_Version, p_State); + + v_MessageHeader_Notify := f_IMS_NotifyRequest_MessageHeader_A53(v_DialogIndex, p_FinalConferenceUri, v_SubscriptionState); + IMS_Client.send(cas_IMS_Notify_Request(cs_IMS_RoutingInfo(p_Protocol), cs_NOTIFY_Request(v_ContactUrl, v_MessageHeader_Notify, cs_MessageBody_Conference(v_ConferenceBody)))); + + return valueof(v_MessageHeader_Notify); + } + + //============================================================================ + // subscribe and inital notification for conference event package + //---------------------------------------------------------------------------- + + type enumerated ConferenceEventPackage_SubscribeState_Type {notSubscribed, subscribeWaitFor200OK, subscribed}; /* @status APPROVED (IMS) */ + + type record ConferenceEventPackage_SubscribeInfo_Type { /* @status APPROVED (IMS) */ + ConferenceEventPackage_SubscribeState_Type State, + SUBSCRIBE_Request SubscribeRequest optional, + MessageHeader HeaderInitialNotify optional + }; + + template (value) ConferenceEventPackage_SubscribeInfo_Type cs_ConferenceEventPackage_SubscribeInfo_Init := + { /* @status APPROVED (IMS) */ + State := notSubscribed, + SubscribeRequest := omit, + HeaderInitialNotify := omit + }; + + /* + * @desc return true when subscription to conference event package is started but still ongoing + * @param p_SubscribeInfo + * @return boolean + */ + function f_ConferenceEventPackage_SubscriptionOngoing(ConferenceEventPackage_SubscribeInfo_Type p_SubscribeInfo) return boolean + { + return (isvalue(p_SubscribeInfo.SubscribeRequest) and (p_SubscribeInfo.State != subscribed)); + } + + /* + * @desc UE subscribes to conference event package acc. to steps 10 .. 13 of C.10/38 + * @param p_SubscribeInfo (by reference) + * @param p_FinalConferenceUri + * @param p_SubscribeCreatingDialog (default value: pc_SubscribeConferenceEvent_OutsideINVITEDialog) + * @status APPROVED (IMS) + */ + altstep a_ConferenceEventPackage_Subscribe(inout ConferenceEventPackage_SubscribeInfo_Type p_SubscribeInfo, + charstring p_FinalConferenceUri, + boolean p_SubscribeCreatingDialog := pc_SubscribeConferenceEvent_OutsideINVITEDialog) runs on IMS_PTC + { /* @sic R5-153986: new parameter p_SubscribeCreatingDialog sic@ */ + var IMS_DATA_REQ v_IMS_SUBSCRIBE_REQ_ByRef; + var ConferenceEventPackage_SubscribeState_Type v_State := p_SubscribeInfo.State; + var InternetProtocol_Type v_Protocol := f_IMS_PTC_ImsInfo_GetTransportProtocol(); + var MessageHeader v_MessageHeader_Subscribe; + var SipUrl v_ContactUri; + var SipUrl v_FromUri; + var charstring v_ParticipantUri; + var charstring v_ParticipantContactUri; + + [v_State == notSubscribed] a_ConferenceEventPackage_ReceiveSubscribeA51SendOK(v_IMS_SUBSCRIBE_REQ_ByRef, p_SubscribeCreatingDialog, p_FinalConferenceUri) { + + p_SubscribeInfo.SubscribeRequest := v_IMS_SUBSCRIBE_REQ_ByRef.Request.Subscribe; + v_MessageHeader_Subscribe := p_SubscribeInfo.SubscribeRequest.msgHeader; + v_FromUri := f_Addr_Union_GetSipUrl(v_MessageHeader_Subscribe.fromField.addressField); + v_ContactUri := f_MessageHeader_GetContactSipUrl(v_MessageHeader_Subscribe); + v_ParticipantUri := f_SIP_SipUrl_GetPublicUserIdentity(v_FromUri); + v_ParticipantContactUri := f_SIP_SipUrl_GetPublicUserIdentity(v_ContactUri); + + p_SubscribeInfo.HeaderInitialNotify := f_IMS_ConferenceEventPackage_SendNotify(p_SubscribeInfo.SubscribeRequest, + v_Protocol, + p_FinalConferenceUri, + v_ParticipantUri, + v_ParticipantContactUri); + p_SubscribeInfo.State := subscribeWaitFor200OK; + + } + [v_State == subscribeWaitFor200OK] a_IMS_ReceiveResponse200OK(p_SubscribeInfo.HeaderInitialNotify, v_Protocol) { + p_SubscribeInfo.HeaderInitialNotify := omit; // for completeness + p_SubscribeInfo.State := subscribed; // => no further message will be handled by this altstep + } + } + +} diff --git a/IMS_PART4_IWD_15wk38/IMS/16/IMS_CC_CodecSelecting.ttcn b/IMS_PART4_IWD_15wk38/IMS/16/IMS_CC_CodecSelecting.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ba7ca6002aa7c22f60761c1906b09828196d2b85 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/16/IMS_CC_CodecSelecting.ttcn @@ -0,0 +1,380 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-15 19:05:27 +0200 (Tue, 15 Sep 2015) $ +// $Rev: 14431 $ +/******************************************************************************/ +module IMS_CC_CodecSelecting { + + import from LibSip_SIPTypesAndValues all; + import from LibSip_SDPTypes all; + import from LibSip_Common all; + import from IP_ASP_TypeDefs all; + import from IMS_Component all; + import from IMS_CommonTemplates all; + import from IMS_ASP_TypeDefs all; + import from IMS_ASP_Templates all; + import from IMS_SIP_Templates all; + import from IMS_MessageBody_Templates all; + import from IMS_SDP_Templates all; + import from IMS_SDP_Messages all; + import from IMS_CC_CommonFunctions all; + import from IMS_Procedures_CallControl all; + import from IMS_Procedures_Common all; + import from UpperTesterFunctions all; + import from IMS_PTC_CoordMsg all; + + template (value) GenericParam cs_Fmtp_ModesetParam(charstring p_ModeSet) := cs_GenericParam("mode-set", p_ModeSet); /* @status APPROVED (IMS) */ + template (present) GenericParam cr_Fmtp_ModesetParam(charstring p_ModeSet) := cr_GenericParam("mode-set", p_ModeSet); /* @status APPROVED (IMS) */ + + /* + * @desc build SDP message to be used in step 1 of test cases 16.X + * @param p_BandwidthAS + * @param p_Fmts + * @param p_SDP_RtpmapFmtpAttribs + * @param p_ConnectionInSessionDesc (default value: true) + * @return template (value) SDP_Message + * @status APPROVED (IMS) + */ + function fl_IMS_BuildSDP_16_X_Step1(integer p_BandwidthAS, + SDP_fmt_list p_Fmts, + template (value) SDP_attribute_list p_SDP_RtpmapFmtpAttribs, + boolean p_ConnectionInSessionDesc := true) runs on IMS_PTC + return template (value) SDP_Message + { /* @sic R5w140113, R5w140009: enhanced SDP type definitions sic@ */ + /* @sic R5-144700: new parameter p_BandwidthAS sic@ */ + /* @sic R5s141244: use of f_IMS_BuildSDP_TX sic@ */ + var template (omit) SDP_attribute_list v_SDP_MediaAttributes; + var template (omit) SDP_attribute_list v_SDP_PrecondionAttributes; + var template (value) SDP_bandwidth_list v_MediaBandwidth_List := cs_SDP_Bandwidth_List_Media(p_BandwidthAS, 0, 2000); + + // further media attributes: + v_SDP_MediaAttributes := p_SDP_RtpmapFmtpAttribs; + v_SDP_MediaAttributes := f_SDP_Attributes_Add_TX(v_SDP_MediaAttributes, cs_SDP_Attribute_ptime); // "20" per default + v_SDP_MediaAttributes := f_SDP_Attributes_Add_TX(v_SDP_MediaAttributes, cs_SDP_Attribute_maxptime); // "240" per default + // precondition attributes: + v_SDP_PrecondionAttributes := { + cs_SDP_Attribute_curr_qos(c_local, c_sendrecv), + cs_SDP_Attribute_curr_qos(c_remote, c_none), + cs_SDP_Attribute_des_qos(c_mandatory, c_local), + cs_SDP_Attribute_des_qos(c_optional, c_remote) + } + + return f_IMS_BuildSDP_TX(cs_SDP_Media_MultiAudio(p_Fmts), v_MediaBandwidth_List, v_SDP_MediaAttributes, v_SDP_PrecondionAttributes, -, p_ConnectionInSessionDesc); + } + + /* + * @desc build SDP message to be used in step 1 of test cases 16.2 + * @param p_ModeSet + * @return template (value) SDP_Message + * @status APPROVED (IMS) + */ + function fl_IMS_BuildSDP_16_2_Step1(charstring p_ModeSet) runs on IMS_PTC return template (value) SDP_Message + { + var integer v_BandwidthAS := 37; /* @sic R5-144700 sic@ */ + var charstring v_Fmt := "99"; + var template (value) SemicolonParam_List v_MediaFormatParametersTX := f_SemicolonParam_List_Concat_TX({cs_Fmtp_ModesetParam(p_ModeSet)}, cs_Fmtp_AudioParamsDef); + var template (value) SDP_attribute_list v_SDP_RtpmapFmtpAttribsTX := { + cs_SDP_Attribute_rtpmap(v_Fmt, cs_RTPMAP_AMR_8000), + cs_SDP_Attribute_fmtp(v_Fmt, cs_Fmtp_ParamList(v_MediaFormatParametersTX)) + }; + + return fl_IMS_BuildSDP_16_X_Step1(v_BandwidthAS, {v_Fmt}, v_SDP_RtpmapFmtpAttribsTX); /* @sic R5-144700: use default bandwidth for AS sic@ */ + } + + /* + * @desc build SDP message to be used in step 1 of test cases 16.3 and 16.4 + * @param p_BandwidthAS + * @param p_SemicolonParam_List_ModeSet1 (default value: omit) + * @param p_SemicolonParam_List_ModeSet2 (default value: omit) + * @param p_ConnectionInSessionDesc (default value: true) + * @return template (value) SDP_Message + * @status APPROVED (IMS) + */ + function fl_IMS_BuildSDP_16_3and4_Step1(integer p_BandwidthAS, + template (omit) SemicolonParam_List p_SemicolonParam_List_ModeSet1 := omit, + template (omit) SemicolonParam_List p_SemicolonParam_List_ModeSet2 := omit, + boolean p_ConnectionInSessionDesc := true) runs on IMS_PTC return template (value) SDP_Message + { /* @sic R5-144700: new parameter p_BandwidthAS sic@ */ + var charstring v_Fmt1 := "97"; + var charstring v_Fmt2 := "99"; + var template (value) SemicolonParam_List v_MediaFormatParametersTX1 := f_SemicolonParam_List_Concat_TX(p_SemicolonParam_List_ModeSet1, cs_Fmtp_AudioParamsDef); + var template (value) SemicolonParam_List v_MediaFormatParametersTX2 := f_SemicolonParam_List_Concat_TX(p_SemicolonParam_List_ModeSet2, cs_Fmtp_AudioParamsDef); + var template (value) SDP_attribute_list v_SDP_RtpmapFmtpAttribsTX := { + cs_SDP_Attribute_rtpmap(v_Fmt1, cs_RTPMAP_AMR_16000), + cs_SDP_Attribute_fmtp(v_Fmt1, cs_Fmtp_ParamList(v_MediaFormatParametersTX1)), + cs_SDP_Attribute_rtpmap(v_Fmt2, cs_RTPMAP_AMR_8000), + cs_SDP_Attribute_fmtp(v_Fmt2, cs_Fmtp_ParamList(v_MediaFormatParametersTX2)) + }; + + return fl_IMS_BuildSDP_16_X_Step1(p_BandwidthAS, {v_Fmt1, v_Fmt2}, v_SDP_RtpmapFmtpAttribsTX, p_ConnectionInSessionDesc); + } + + /* + * @desc build SDP message to be used in step 4/7 of test cases 16.1 and 16.2 + * @param p_RtpmapCodec + * @param p_MediaFormatParameters (default value: {*}) + * @param p_Direction_curr_qos_local + * @return template (present) SDP_Message + * @status APPROVED (IMS) + */ + function f_IMS_BuildSDP_16_X_RX(template (present) SDP_attribute_rtpmap_codec p_RtpmapCodec, + template (present) SemicolonParam_List p_MediaFormatParameters := {*}, + template (present) charstring p_Direction_curr_qos_local) + runs on IMS_PTC + return template (present) SDP_Message + { // @sic R5-134233 has been withdrawn => p_MediaFormatParameters := {"*"} sic@ + /* @sic R5w140113, R5w140009: enhanced SDP type definitions sic@ */ + /* @sic R5s150704, R5s150751 - Additional changes: f_IMS_BuildSDP_RX used instead of cr_SDP_Message_Def sic@ */ + + var template (present) SDP_attribute_list v_SDP_MediaAttributes := { + cr_SDP_Attribute_rtpmap(-, p_RtpmapCodec), + cr_SDP_Attribute_fmtp(-, cr_Fmtp_ParamList(p_MediaFormatParameters)) + }; + var template (present) SDP_attribute_list v_SDP_PrecondionAttributes := cr_SDP_PrecondionAttributes(p_Direction_curr_qos_local, c_sendrecv, c_mandatory, c_mandatory); + + return f_IMS_BuildSDP_RX(-, cr_SDP_Media_Audio, v_SDP_MediaAttributes, v_SDP_PrecondionAttributes); + } + + /****************************************************************************/ + /* + * @desc common test procedure for 16.X test cases + * @param p_SDP_Message_Invite + * @param p_SDP_Message_183 + * @param p_SDP_Message_180or200 + * @status APPROVED (IMS) + */ + function fl_TC_16_X_CommonProcedure(template (value) SDP_Message p_SDP_Message_Invite, + template (present) SDP_Message p_SDP_Message_183, + template (present) SDP_Message p_SDP_Message_180or200) runs on IMS_PTC + { /* @sic R5-142994: Reimplementation - in fact there is the same sequence for 16.2 and 16.3/4 sic@ */ + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var SipUrl v_ContactUrl := f_IMS_PTC_ImsInfo_GetContactUrl(); + var InternetProtocol_Type v_Protocol; + var IMS_DATA_RSP v_IMS_DATA_RSP; + var IMS_ResponseWithSdp_Type v_ResponseWithSdp; /* @sic R5w140112 sic@ */ + var template (value) INVITE_Request v_InviteRequest; + var template (value) MessageHeader v_MessageHeader_Invite; + var template (present) MessageHeader v_MessageHeader_183RX; + var template (present) MessageHeader v_MessageHeader_180RX; + var template (present) Response v_ExpectedResponse_183RX; + var template (present) Response v_ExpectedResponse_180RX; + var Response v_Response; + var Response v_Response183; + var Response v_Response180; + var template (omit) Response v_OptionalResponse180; + var MessageHeader v_MessageHeader; + var template SDP_Message v_ExpectedSDP_200 := omit; + var SDP_Message v_SDP_Message180; + + var boolean v_Trying := false; + var boolean v_SrvccAlerting := false; + + timer t_Timer := 5.0; // as for C.11 (-> f_IMS_MTCallSetup_Common_Steps7_11) + + f_IMS_CC_StartCall(IPCAN_MT_SpeechCall); // @sic R5s140567 sic@ + + // Step 1 - Send INVITE + v_MessageHeader_Invite := f_IMS_InviteRequest_MessageHeaderTX(tsc_OptionTagList_precondition, -, v_SrvccAlerting); + + v_InviteRequest := cs_INVITE_Request(v_ContactUrl, v_MessageHeader_Invite, cs_MessageBody_SDP(p_SDP_Message_Invite)); + v_InviteRequestWithSdp := f_IMS_InviteRequestWithSdpMT(v_InviteRequest, p_SDP_Message_Invite); + v_Protocol := v_InviteRequestWithSdp.RoutingInfo.Protocol; + + IMS_Client.send(cas_IMS_Invite_Request(v_InviteRequestWithSdp.RoutingInfo, v_InviteRequest)); + + // Step 2 - Void + v_MessageHeader_183RX := f_IMS_InviteResponse_183_MessageHeaderRX(v_InviteRequest, tsc_OptionTagList_precondition); + v_MessageHeader_180RX := f_IMS_InviteResponse_180_MessageHeaderRX(v_InviteRequest, -, cr_ContentTypeSDP ifpresent); + v_ExpectedResponse_183RX := cr_Response(c_statusLine183, v_MessageHeader_183RX, cr_MessageBody_SDP); + v_ExpectedResponse_180RX := cr_Response(c_statusLine180, v_MessageHeader_180RX, cr_MessageBody_SDP ifpresent); + + t_Timer.start; + alt { + // @siclog "Step 3" siclog@ + [not v_Trying] a_IMS_ReceiveResponse(v_InviteRequest.msgHeader, + v_Protocol, + cr_Response(c_statusLine100, f_IMS_InviteResponse_100_MessageHeaderRX(v_InviteRequest)), + v_IMS_DATA_RSP) /* @sic R5s140350: v_IMS_DATA_RSP is 'out' parameter sic@ */ + { + v_Trying := true; + repeat; + } + // @siclog "Step 3A or 4" siclog@ + [] a_IMS_ReceiveResponse(v_InviteRequest.msgHeader, + v_Protocol, + (v_ExpectedResponse_183RX, v_ExpectedResponse_180RX), + v_IMS_DATA_RSP) + { + v_Response := v_IMS_DATA_RSP.Response; + v_MessageHeader := v_IMS_DATA_RSP.Response.msgHeader; + f_IMS_Dialog_SetRemoteTag(v_MessageHeader); + f_IMS_MessageHeader_Response_CheckRecordRoute(v_MessageHeader); /* @sic R5s150039 Change 6 sic@ */ + f_IMS_MessageHeader_CheckContactAddr(v_MessageHeader); // check whether contact contains "SIP URI with IP address or FQDN" (see @sic R5s120727 sic@) + } + [] t_Timer.timeout + { + } + } + f_IMS_IPCAN_SendCoOrdMsg(IPCAN); /* trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + @sic R5s140646 sic@ */ + + if (isbound(v_Response)) { // => either 183 or 180 response has been received + select (v_Response.statusLine.statusCode) { + case (183) { + v_Response183 := v_Response; + f_IMS_SIP_SdpMessageBody_DecodeMatchAndCheckSDP(v_Response183.messageBody, p_SDP_Message_183); + // @siclog "Step 3B - 3C (optionally 4)" siclog@ + v_OptionalResponse180 := f_IMS_MTCallSetup_SendPRACK_ReceiveOK(v_InviteRequest, v_Response183.msgHeader, v_ExpectedResponse_180RX); // send PRACK, wait for 200 Ok; in parallel the 180 Ringing may come (optionally) + if (ispresent(v_OptionalResponse180)) { + v_Response180 := valueof(v_OptionalResponse180); + } + } + case (180) { + v_Response180 := v_Response; + } + } + if (not isbound(v_Response180)) { // .. still not got any 180 Ringing ... + // @siclog "Step 4" siclog@ + alt { + [] a_IMS_ReceiveResponse(v_InviteRequest.msgHeader, v_Protocol, v_ExpectedResponse_180RX, v_IMS_DATA_RSP) + { + v_Response180 := v_IMS_DATA_RSP.Response; + } + [] t_Timer.timeout + { + } + } + } + t_Timer.stop; + } + f_IMS_IPCAN_WaitForTrigger(IPCAN); /* wait for completion of RRC/NAS signalling + NOTE: as the coordination ports are not covered by the default behaviour we can just collect the trigger here + @sic R5s140646 sic@ */ + + // @siclog "Step 5 - 6" siclog@ + if (isbound(v_Response180)) { + f_IMS_MessageHeader_Response_CheckRecordRoute(v_MessageHeader); /* @sic R5s150039 Change 6 sic@ */ + f_IMS_MessageHeader_CheckContactAddr(v_Response180.msgHeader); // check whether contact contains "SIP URI with IP address or FQDN" (see @sic R5s120727 sic@) + if (not isbound(v_Response183)) { + f_IMS_Dialog_SetRemoteTag(v_Response180.msgHeader); + } + if (ispresent(v_Response180.messageBody)) { + + if (isbound(v_Response183)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "message body shall only be present in 180 response when there has been no 183 response"); // @sic R5-145728 sic@ + } + + v_SDP_Message180 := f_IMS_SIP_SdpMessageBody_DecodeMatchAndCheckSDP(v_Response180.messageBody, p_SDP_Message_180or200); + } + if (f_MessageHeader_CheckRequire(v_Response180.msgHeader, c_tag100rel)) { + f_IMS_MTCallSetup_SendPRACK_ReceiveOK(v_InviteRequest, v_Response180.msgHeader); + } + } + + // @siclog "Step 6A" siclog@ + f_UT_AnswerCall(MMI); + + // @siclog "Step 7 - 8" siclog@ Receive OK for INVITE, Send ACK + if (not isbound(v_SDP_Message180) and not isbound(v_Response183)) { // @sic R5s140580 change 1 sic@ + v_ExpectedSDP_200 := p_SDP_Message_180or200; + } + v_ResponseWithSdp := f_IMS_MTCallSetup_Common_Steps12_13(v_InviteRequestWithSdp, v_ExpectedSDP_200); + v_ContactUrl := f_MessageHeader_GetContactSipUrl(v_ResponseWithSdp.Response.msgHeader); + + // Step 14-15 + f_IMS_CallReleaseMT(v_InviteRequest, v_ContactUrl); + // f_IMS_CC_ReleaseConnection(IPCAN_MT_SpeechCall); @sic R5s140580 additional change by R&S sic@ + } + + /****************************************************************************/ + /* + * @desc REFERENCE TS 34.229-1 clause 16.2 + * @status APPROVED (IMS) + */ + function f_TC_16_2_IMS() runs on IMS_PTC + { /* @sic R5w140113, R5w140009: enhanced SDP type definitions sic@ */ + /* @sic R5-142994: Reimplementation sic@ */ + var charstring v_ModeSet := "0,2,4,7"; /* @sic R5-140916 sic@ */ + var template (present) SemicolonParam_List v_MediaFormatParametersRX := {cr_Fmtp_ModesetParam(v_ModeSet), *}; + var template (value) SDP_Message v_SDP_Message_Invite; + var template (present) SDP_Message v_SDP_Message_183; + var template (present) SDP_Message v_SDP_Message_180or200; + + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + f_IMS_TestBody_Set(true); + + v_SDP_Message_Invite := fl_IMS_BuildSDP_16_2_Step1(v_ModeSet); + v_SDP_Message_183 := f_IMS_BuildSDP_16_X_RX(cr_RTPMAP_AMR_8000, -, c_none); + v_SDP_Message_180or200 := f_IMS_BuildSDP_16_X_RX(cr_RTPMAP_AMR_8000, v_MediaFormatParametersRX, c_sendrecv); + + fl_TC_16_X_CommonProcedure(v_SDP_Message_Invite, v_SDP_Message_183, v_SDP_Message_180or200); + + f_IMS_TestBody_Set(false); + f_IMS_CC_Postamble(IPCAN_MT_SpeechCall); + } + + /****************************************************************************/ + /* + * @desc REFERENCE TS 34.229-1 clause 16.3 + * @status APPROVED (IMS) + */ + function f_TC_16_3_IMS() runs on IMS_PTC + { /* @sic R5-142994: Reimplementation sic@ */ + var integer v_BandwidthAS := 49; /* @sic R5-144700 sic@ */ + var template (value) SDP_Message v_SDP_Message_Invite; + var template (present) SDP_Message v_SDP_Message_183; + var template (present) SDP_Message v_SDP_Message_180or200; + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + f_IMS_TestBody_Set(true); + + v_SDP_Message_Invite := fl_IMS_BuildSDP_16_3and4_Step1(v_BandwidthAS); + v_SDP_Message_183 := f_IMS_BuildSDP_16_X_RX(cr_RTPMAP_AMR_16000, -, c_none); /* @sic R5-145728 sic@ */ + v_SDP_Message_180or200 := f_IMS_BuildSDP_16_X_RX(cr_RTPMAP_AMR_16000, -, c_sendrecv); + + fl_TC_16_X_CommonProcedure(v_SDP_Message_Invite, v_SDP_Message_183, v_SDP_Message_180or200); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MT_SpeechCall); + } + + /****************************************************************************/ + /* + * @desc REFERENCE TS 34.229-1 clause 16.4 + * @status APPROVED (IMS) + */ + function f_TC_16_4_IMS() runs on IMS_PTC + { /* @sic R5-142994: Reimplementation sic@ */ + var integer v_BandwidthAS := 38; /* @sic R5-144700 sic@ */ + var boolean v_ConnectionInSessionDesc := false; + var charstring v_ModeSet1 := "0,1,2"; /* @sic R5-140917: mode-set changed from "0,2,5,7,8" to "0,1,2" sic@ */ + var charstring v_ModeSet2 := "0,2,4,7"; /* @sic R5-140917: mode-set changed from "0,2,5,7" to "0,2,4,7" sic@ */ + var template (value) SemicolonParam_List v_SemicolonParam_List_ModeSet1 := {cs_Fmtp_ModesetParam(v_ModeSet1)}; + var template (value) SemicolonParam_List v_SemicolonParam_List_ModeSet2 := {cs_Fmtp_ModesetParam(v_ModeSet2)}; + var template (present) SemicolonParam_List v_MediaFormatParametersRX := {cr_Fmtp_ModesetParam(v_ModeSet1), *}; + var template (value) SDP_Message v_SDP_Message_Invite; + var template (present) SDP_Message v_SDP_Message_183; + var template (present) SDP_Message v_SDP_Message_180or200; + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + f_IMS_TestBody_Set(true); + + v_SDP_Message_Invite := fl_IMS_BuildSDP_16_3and4_Step1(v_BandwidthAS, v_SemicolonParam_List_ModeSet1, v_SemicolonParam_List_ModeSet2, v_ConnectionInSessionDesc); + v_SDP_Message_183 := f_IMS_BuildSDP_16_X_RX(cr_RTPMAP_AMR_16000, v_MediaFormatParametersRX, c_none); /* @sic R5-145728 sic@ */ + v_SDP_Message_180or200 := f_IMS_BuildSDP_16_X_RX(cr_RTPMAP_AMR_16000, v_MediaFormatParametersRX, c_sendrecv); + + fl_TC_16_X_CommonProcedure(v_SDP_Message_Invite, v_SDP_Message_183, v_SDP_Message_180or200); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MT_SpeechCall); + } + +} diff --git a/IMS_PART4_IWD_15wk38/IMS/17/IMS_CC_MediaTestcases.ttcn b/IMS_PART4_IWD_15wk38/IMS/17/IMS_CC_MediaTestcases.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..198287824a52deec827231f2e01f46ec8cc5456c --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/17/IMS_CC_MediaTestcases.ttcn @@ -0,0 +1,256 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-16 20:33:09 +0200 (Wed, 16 Sep 2015) $ +// $Rev: 14474 $ +/******************************************************************************/ +module IMS_CC_MediaTestcases { + + import from LibSip_SIPTypesAndValues all; + import from LibSip_SDPTypes all; + import from IP_ASP_TypeDefs all; + import from IMS_Component all; + import from IMS_ASP_TypeDefs all; + import from IMS_ASP_Templates all; + import from IMS_CommonParameters all; + import from IMS_SIP_Templates all; + import from IMS_MessageBody_Templates all; + import from IMS_SDP_Templates all; + import from IMS_SDP_Messages all; + import from IMS_SDP_MessagesVideo all; + import from IMS_CC_CommonFunctions all; + import from IMS_Procedures_CallControl all; + import from IMS_Procedures_Video all; + import from IMS_PTC_CoordMsg all; + import from IMS_CC_IPCAN_Coordination all; + import from UpperTesterFunctions all; + import from IMS_CommonFunctions all; + import from IMS_Procedures_Common all; + + /****************************************************************************/ + + function f_IMS_MOCall_ReleaseVideo_ReceiveInvite(charstring p_FmtAudio, + charstring p_FmtVideo) runs on IMS_PTC return IMS_InviteRequestWithSdp_Type + { + var IMS_DATA_REQ v_IMS_INVITE_REQ; + var SDP_Message v_SDP_Message; + var boolean v_A11 := pc_IMS_Video_FeatureTag; + var boolean v_A12 := false; // as we have video but not voice + + var template (present) SDP_attribute_list v_SDP_MediaAttributes_Audio := { + cr_SDP_Attribute_rtpmap(p_FmtAudio, cr_RTPMAP_AMR_8000), + cr_SDP_Attribute_fmtp(p_FmtAudio) + }; + var template (present) SDP_attribute_list v_SDP_MediaAttributes_Video := { + cr_SDP_Attribute_rtpmap(p_FmtVideo, cr_RTPMAP_H264_90000), + cr_SDP_Attribute_fmtp(p_FmtVideo) + }; + var template (present) SDP_attribute_list v_SDP_PrecondionAttributes_Audio := cr_SDP_PrecondionAttributes(c_sendrecv, c_sendrecv, c_mandatory, c_optional); + var template (present) SDP_attribute_list v_SDP_PrecondionAttributes_Video := cr_SDP_PrecondionAttributes(c_sendrecv, c_sendrecv, c_optional, c_mandatory); + + var template (present) SDP_Message v_SDP_MessageTemplate := f_IMS_BuildSDP_AudioVideo_RX(cr_SDP_Time_Any, + cr_SDP_Media_Audio, + v_SDP_MediaAttributes_Audio, + v_SDP_PrecondionAttributes_Audio, + cr_SDP_Media(c_video, 0, c_rtpAvp, cr_SDP_FmtList_AtLeastOne(p_FmtVideo)), /* port number == 0 => release video stream */ + v_SDP_MediaAttributes_Video, + v_SDP_PrecondionAttributes_Video); + + v_IMS_INVITE_REQ := f_IMS_INVITE_ReceiveRequest(A_2_1_A5, tsc_OptionTagList_precondition, -, -, -, -, v_A11, v_A12); + v_SDP_Message := f_IMS_SIP_SdpMessageBody_DecodeMatchAndCheckSDP(v_IMS_INVITE_REQ.Request.Invite.messageBody, v_SDP_MessageTemplate); + + return f_IMS_InviteRequestWithSdpMO(v_IMS_INVITE_REQ, v_SDP_Message); + } + + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 17.1 + */ + function f_TC_17_1_IMS() runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var INVITE_Request v_InviteRequest; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL; + var MessageHeader v_MessageHeader_Response183; + var template (value) MessageHeader v_MessageHeader_Response; + var template (present) MessageHeader v_MessageHeader_Request; + var SDP_Message v_SDP_LatestOffer; + var charstring v_FmtAudio; + var charstring v_FmtVideo; + var template (present) SipUrl v_CalleeContactUri; + var charstring v_CallIdentification; + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + + // setup MO speech call + v_CallIdentification := f_IMS_CC_StartCall(IPCAN_MO_SpeechCall); + f_IMS_CC_MO_SpeechCall_Signalling(); + + f_IMS_TestBody_Set(true); + + // @siclog "Step 1" siclog@ + f_UT_AddVideoToIMSCall(MMI, v_CallIdentification); + + // @siclog "Step 2" siclog@ + v_InviteRequestWithSdp := f_IMS_MOCallSetup_Video_Step2(AddVideo); + + // @siclog "Step 3 - 4" siclog@ + v_MessageHeader_Response183 := f_IMS_MOCallSetup_Video_Step3_4(AddVideo, v_InviteRequestWithSdp); + + f_IMS_IPCAN_StartProcedure(IPCAN, IPCAN_MO_AddVideo); + + // @siclog "Step 5 - 8" siclog@ + v_SDP_LatestOffer := f_IMS_MOCallSetup_Video_Steps5_8(AddVideo, v_InviteRequestWithSdp, v_MessageHeader_Response183); + + // @siclog "Step 9 - 10" siclog@ + f_IMS_MOCallSetup_AnnexC21C25_Step12_13(v_InviteRequestWithSdp); + + f_IMS_IPCAN_WaitForTrigger(IPCAN); // Wait for trigger from IPCAN to ensure that radio resources have really been established + + // @siclog "Step 10a" siclog@ + f_UT_IMS_RemoveVideoMedia(MMI, v_CallIdentification); + + // @siclog "Step 11" siclog@ + v_FmtAudio := f_SDP_MediaDescr_GetAMR_8000_1(v_InviteRequestWithSdp.SdpOffer.media_list[0]); + v_FmtVideo := f_SDP_MediaDescr_GetH264_90000(v_InviteRequestWithSdp.SdpOffer.media_list[1]); + v_InviteRequestWithSdp := f_IMS_MOCall_ReleaseVideo_ReceiveInvite(v_FmtAudio, v_FmtVideo); + v_InviteRequest := v_InviteRequestWithSdp.Invite; + v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(v_InviteRequestWithSdp.RoutingInfo); + + // @siclog "Step 12" siclog@ + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine100, f_IMS_InviteResponse_100_MessageHeaderTX(v_InviteRequest)))); + + // @siclog "Step 12a" siclog@ + f_IMS_IPCAN_StartProcedure(IPCAN, IPCAN_ReleaseVideo); + + // @siclog "Step 13" siclog@ + v_MessageHeader_Response := f_IMS_OtherResponse_200_MessageHeaderTX(v_InviteRequest.msgHeader); + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine200, v_MessageHeader_Response))); + + // @siclog "Step 14" siclog@ + v_MessageHeader_Request := f_IMS_AckRequest_MessageHeaderRX(v_InviteRequest, c_statusLine200); + v_CalleeContactUri := f_SIP_BuildSipUri_RX(px_IMS_CalleeContactUri); + IMS_Server.receive(car_IMS_Ack_Request(cr_ACK_Request(v_CalleeContactUri, v_MessageHeader_Request))); + + f_IMS_IPCAN_WaitForTrigger(IPCAN); // Wait for trigger from IPCAN to ensure that radio resources have been released + + // @siclog "Step 15 - 16" siclog@ + f_IMS_CallReleaseMO(v_InviteRequest); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MO_SpeechCall); + } + + /****************************************************************************/ + /* + * @desc REFERENCE TS 34.229-1 clause 17.2 + */ + function f_TC_17_2_IMS() runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var IMS_ResponseWithSdp_Type v_ResponseWithSdp; + var IMS_Response_Type v_SessionInProgress183; + var template (value) INVITE_Request v_InviteRequest; + var template (value) SDP_Message v_Tx_SDP; + var template (present) SDP_Message v_Rx_SDP; + var template (value) MessageHeader v_MessageHeader_Invite; + var template (value) MessageHeader v_MessageHeader_Update; + var template (value) MessageHeader v_MessageHeader_Ack; + var template (present) MessageHeader v_MessageHeader_Response; + var template (omit) SDP_attribute v_SDP_Attribute; + var SipUrl v_ContactUrl; + var charstring v_FmtAudio := tsc_SDP_FmtAudio; + var charstring v_FmtVideo := tsc_SDP_FmtVideo; + var InternetProtocol_Type v_Protocol := f_IMS_PTC_ImsInfo_GetTransportProtocol(); + var IMS_DATA_RSP v_IMS_DATA_RSP; + + // preamble MT speech call setup + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + f_IMS_CC_StartCall(IPCAN_MT_SpeechCall); + + // Steps 1 to 4 as defined in Annex C.11 + v_InviteRequestWithSdp := f_IMS_MTCallSetup_AnnexC11_INVITE(); + v_ResponseWithSdp := f_IMS_MTCallSetup_AnnexC11_Steps1_4(v_InviteRequestWithSdp); + v_SessionInProgress183 := v_ResponseWithSdp.Response; + v_ContactUrl := f_MessageHeader_GetContactSipUrl(v_SessionInProgress183.msgHeader); + // Establish Dedicated EPS bearer + // See TS. 36.508 EUTRA/EPS signalling for IMS MT speech call Table 4.5A.7.3-1 Step 9-12 + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MT_SpeechCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + // Steps 5 to 13 as defined in Annex C.11 + f_IMS_MTCallSetup_AnnexC11_Steps5_13(v_InviteRequestWithSdp, v_ResponseWithSdp); + + // MT Call is now established + + f_IMS_TestBody_Set(true); + + // @siclog "Step 1" siclog@ + // Step 1 SS sends re-INVITE with second SDP offer to add video. + v_InviteRequestWithSdp := f_IMS_MTCallSetup_Video_SendInvite(AddVideo, Invite, v_FmtAudio, v_FmtVideo, v_ContactUrl); + v_InviteRequest := v_InviteRequestWithSdp.Invite; + + // @siclog "Step 2: Void" siclog@ + + // @siclog "Step 3" siclog@ + v_ResponseWithSdp := f_IMS_MTCallSetup_Video_Receive183(AddVideo, v_InviteRequestWithSdp, v_FmtAudio, v_FmtVideo); + v_SessionInProgress183 := v_ResponseWithSdp.Response; + + f_IMS_IPCAN_StartProcedure(IPCAN, IPCAN_MT_AddVideo); + f_IMS_IPCAN_WaitForTrigger(IPCAN); + + // @siclog "Step 4 - 5" siclog@ + f_IMS_MTCallSetup_SendPRACK_ReceiveOK(v_InviteRequest, v_SessionInProgress183.msgHeader); + + // @siclog "Step 6" siclog@ + v_SDP_Attribute := f_SDP_AttributeList_GetAttribute(v_ResponseWithSdp.SdpMessage.media_list[0].attributes, cr_SDP_Attribute_curr_qos(c_local, ?)); + v_Tx_SDP := f_IMS_BuildSDP_MTCallAudioVideo_TX(AddVideo, Update, v_FmtAudio, v_FmtVideo, valueof(v_SDP_Attribute.curr.direction)); + v_MessageHeader_Update := f_IMS_UpdateRequest_MessageHeaderTX(v_InviteRequest); + IMS_Client.send(cas_IMS_Update_Request(cs_IMS_RoutingInfo(v_Protocol), cs_UPDATE_Request(v_ContactUrl, v_MessageHeader_Update, cs_MessageBody_SDP(v_Tx_SDP)))); + + // @siclog "Step 7" siclog@ + v_Rx_SDP := f_IMS_BuildSDP_MTCallAudioVideo_RX(AddVideo, Response200, v_FmtAudio, v_FmtVideo); + v_MessageHeader_Response := f_IMS_OtherResponse_200_MessageHeaderRX(v_MessageHeader_Update, cs_ContentTypeSDP); + v_IMS_DATA_RSP := f_IMS_ReceiveResponse(v_MessageHeader_Update, v_Protocol, cr_Response(c_statusLine200, v_MessageHeader_Response, cr_MessageBody_SDP)); + f_IMS_SIP_SdpMessageBody_DecodeMatchAndCheckSDP(v_IMS_DATA_RSP.Response.messageBody, v_Rx_SDP); + + // @siclog "Step 7A" siclog@ + // Step 7A Make UE accept the speech and video offer. + f_UT_AnswerCall(MMI); + + // @siclog "Step 8 - 9" siclog@ + // Step 8 The UE responds to the re-INVITE with a 200 OK final response. + // Step 9 The SS acknowledges the receipt of 200 OK for the re-INVITE. + f_IMS_MTCallSetup_Common_Steps12_13(v_InviteRequestWithSdp); + + // @siclog "Step 10" siclog@ + // Step 10 SS sends a re-INVITE with a SDP offer indicating that the video component is removed from the call + v_InviteRequestWithSdp := f_IMS_MTCallSetup_Video_SendInvite(AddVideo, InviteRemoveVideo, v_FmtAudio, v_FmtVideo, v_ContactUrl); + + // @siclog "Step 11" siclog@ + v_MessageHeader_Invite := v_InviteRequestWithSdp.Invite.msgHeader; + v_MessageHeader_Response := f_IMS_OtherResponse_200_MessageHeaderRX(v_MessageHeader_Invite); + f_IMS_ReceiveResponse(v_MessageHeader_Invite, v_InviteRequestWithSdp.RoutingInfo.Protocol, cr_Response(c_statusLine200, v_MessageHeader_Response)); + + // @siclog "Step 11a" siclog@ + f_IMS_IPCAN_StartProcedure(IPCAN, IPCAN_ReleaseVideo); + + // @siclog "Step 12" siclog@ + v_MessageHeader_Ack := f_IMS_AckRequest_MessageHeaderTX(v_InviteRequestWithSdp.Invite); + IMS_Client.send(cas_IMS_Ack_Request(cs_IMS_RoutingInfo(v_InviteRequestWithSdp.RoutingInfo.Protocol), cs_ACK_Request(v_ContactUrl, v_MessageHeader_Ack))); + + f_IMS_IPCAN_WaitForTrigger(IPCAN); // Wait for trigger from IPCAN to ensure that radio resources have been released + + // Step 13 void // @sic R5-134646 sic@ + // Step 14 and 15. SS sends BYE to release the call; UE sends 200 OK for the BYE request and ends the call + f_IMS_CallReleaseMT(v_InviteRequest, v_ContactUrl); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MT_SpeechCall); + } + +} diff --git a/IMS_PART4_IWD_15wk38/IMS/18/IMS_CC_SMSTestcases.ttcn b/IMS_PART4_IWD_15wk38/IMS/18/IMS_CC_SMSTestcases.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..46f09da3951f0d0211a66071a8cad1423c6b82a4 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/18/IMS_CC_SMSTestcases.ttcn @@ -0,0 +1,127 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-15 15:59:34 +0200 (Tue, 15 Sep 2015) $ +// $Rev: 14409 $ +/******************************************************************************/ + +module IMS_CC_SMSTestcases { + + import from CommonDefs all; + import from LibSip_SIPTypesAndValues all; + import from IP_ASP_TypeDefs all; + import from SMS_TypeDefs all; + import from SMS_Templates all; + import from IMS_Component all; + import from IMS_ASP_TypeDefs all; + import from IMS_ASP_Templates all; + import from IMS_SIP_Templates all; + import from IMS_SMS_Messages all; + import from IMS_MessageBody_Templates all; + import from IMS_CommonFunctions all; + import from IMS_Procedures_CallControl all; + import from IMS_Procedures_Common all; + import from UpperTesterFunctions all; + import from IMS_CC_CommonFunctions all; + import from IMS_PTC_CoordMsg all; + + //============================================================================ + /* + * @desc REFERENCE TS 34.229-1 clause 18.1 + * @status APPROVED (IMS) + */ + function f_TC_18_1_IMS() runs on IMS_PTC + { + var IMS_DATA_REQ v_IMS_DATA_REQ; + + f_IMS_CC_Preamble(IPCAN_SignallingOnly, IMS_REGISTERED); /* @sic R5s140469: test case applicable for GIBA as well sic@ */ + + f_IMS_CC_StartSignalling(IPCAN_MO_IMS_Signalling); + + f_UT_IMS_TriggerSMS(MMI); + + f_IMS_TestBody_Set(true); + + // Step 1. UE sends a short message + // @siclog "Step 1" siclog@ + v_IMS_DATA_REQ := f_IMS_MO_SMS_Step1(); // @sic R5-153757 sic@ + f_IMS_PreliminaryPass(__FILE__, __LINE__, "Step 1"); + + // @siclog "Step 2-8" siclog@ + f_IMS_MO_SMS_Step2to8 (v_IMS_DATA_REQ); // @sic R5-153757 sic@ + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MO_IMS_Signalling); + } + + //============================================================================ + /* + * @desc REFERENCE TS 34.229-1 clause 18.2 + * @status APPROVED (IMS) + */ + function f_TC_18_2_IMS() runs on IMS_PTC + { + var IMS_DATA_REQ v_IMS_DATA_REQ; + var template (value) MessageHeader v_MessageHeader_MessageMT; + var MESSAGE_Request v_MESSAGE_RequestRX; + var SipUrl v_ContactUrl; + var RP_ACK_Type v_RPAck; + var octetstring v_EncodedSMS; + var template (value) RP_DATA_dl_Type v_SMSdl; + var integer v_Port_us; + var InternetProtocol_Type v_Protocol; + var SipUrl v_PAssertedIDUrl; + var CallidString v_PrevCallId; + var CharStringList_Type v_PrevCallIdList := {}; + + f_IMS_CC_Preamble(IPCAN_SignallingOnly, IMS_REGISTERED, IMS_Security); + f_IMS_CC_StartSignalling(IPCAN_MT_IMS_Signalling); /* @sic R5s130183 change 1 sic@ */ + + v_ContactUrl := f_IMS_PTC_ImsInfo_GetContactUrl(); + v_Port_us := f_IMS_PTC_GetPort_us(); + + f_IMS_TestBody_Set(true); + + v_Protocol := f_IMS_PTC_ImsInfo_GetTransportProtocol(); + + // Step 1. The SS sends a Short Message. + // Build MT SMS + // @siclog "Step 1" siclog@ + v_SMSdl := cs_RP_DATA_dl_DELIVER('7788996655'O); + v_EncodedSMS := f_SMS_PDU_EncodeRPDATA(v_SMSdl); + v_MessageHeader_MessageMT := f_IMS_MessageRequest_MessageHeaderTX_MT_SMS(v_Protocol); + IMS_Client.send(cas_IMS_Message_Request(cs_IMS_RoutingInfo(v_Protocol), cs_MESSAGE_Request(v_ContactUrl, v_MessageHeader_MessageMT, cs_MessageBody_SMS(v_EncodedSMS)))); + v_PrevCallId := valueof(v_MessageHeader_MessageMT.callId.callid); // @sic R5-133705 sic@ + v_PrevCallIdList := f_CharStringList_Add(v_PrevCallIdList, v_PrevCallId); + + // Step 2. The UE responds with 200 OK. + // @siclog "Step 2" siclog@ + f_IMS_ReceiveResponse(v_MessageHeader_MessageMT, v_Protocol, cr_Response(c_statusLine200, f_IMS_OtherResponse_200_MessageHeaderRX(v_MessageHeader_MessageMT))); /* @sic R5s140350 sic@ */ + + // Step 3. The UE responds with a delivery report. + // Contents in 34.229-1 Annex A.7.2 + // @siclog "Step 3" siclog@ + v_PAssertedIDUrl := f_Addr_Union_GetSipUrl(v_MessageHeader_MessageMT.pAssertedID.pAssertedIDValueList[0]); // @sic R5-130572 R5s130183 sic@ + + v_IMS_DATA_REQ := f_IMS_MessageRequest_Receive(v_PAssertedIDUrl, + f_IMS_MessageRequest_MessageHeaderRX_DeliveryReport(v_PAssertedIDUrl, v_PrevCallId), + v_PrevCallIdList); // @sic R5s130370 change 1 sic@ + v_MESSAGE_RequestRX := v_IMS_DATA_REQ.Request.Message; + v_EncodedSMS := v_MESSAGE_RequestRX.messageBody.smsMessage; + v_RPAck := f_SMS_PDU_DecodeAndMatchRPACK(v_EncodedSMS, cr_RP_ACK_ul); // @sic R5-130572 sic@ + f_IMS_PreliminaryPass(__FILE__, __LINE__, "Step 3"); + + // Step 4. The SS sends a 202 Accepted + // @siclog "Step 4" siclog@ + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo), cs_Response(c_statusLine202, f_IMS_Accepted_202_MessageHeaderTX(v_MESSAGE_RequestRX.msgHeader)))); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MO_IMS_Signalling); + } +} diff --git a/IMS_PART4_IWD_15wk38/IMS/19/IMS_CC_EmergencyCallTestcases.ttcn b/IMS_PART4_IWD_15wk38/IMS/19/IMS_CC_EmergencyCallTestcases.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..42d80a074e60bdf737484c8d12bbb30cf2ad44d5 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/19/IMS_CC_EmergencyCallTestcases.ttcn @@ -0,0 +1,1017 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-16 14:42:41 +0200 (Wed, 16 Sep 2015) $ +// $Rev: 14457 $ +/******************************************************************************/ +module IMS_CC_EmergencyCallTestcases { + + import from LibSip_SIPTypesAndValues all; + import from LibSip_SDPTypes all; + import from IP_ASP_TypeDefs all; + import from CommonDefs all; + import from IMS_Component all; + import from IMS_CommonParameters all; + import from IMS_CC_CommonFunctions all; + import from IMS_Procedures_Registration all; + import from IMS_Procedures_CallControl all; + import from IMS_Procedures_CallHold all; + import from IMS_Procedures_Common all; + import from SMS_TypeDefs all; + import from SMS_Templates all; + import from IMS_MessageBody_Templates all; + import from IMS_SDP_Messages all; + import from IMS_SMS_Messages all; + import from UpperTesterFunctions all; + import from IMS_PTC_CoordMsg all; + import from IMS_ASP_TypeDefs all; + import from IMS_SIP_Templates all; + import from IMS_SDP_Templates all; + import from IMS_ASP_Templates all; + import from IMS_CommonFunctions all; + import from IMS_EmgFunctions all; + import from IMS_CC_IPCAN_Coordination all; + import from LibSip_MessageBodyTypes all; + import from IMS_XML_Templates all; + import from IMS_CommonDefs all; + import from IMS_IP_Config all; + + //============================================================================ + /* + * @desc Emergency Reregistration + * @param p_OldSecNotRequired (default value: true) + * @param p_RegisterExpiration (default value: tsc_IMS_RegisterExpiration) + * @return REGISTER_Request + * @status APPROVED (IMS) + */ + function fl_IMS_EmergencyReRegistration (boolean p_OldSecNotRequired := true, + charstring p_RegisterExpiration := tsc_IMS_RegisterExpiration) runs on IMS_PTC return REGISTER_Request // @sic R5-140037 sic@ + { + var IMS_DATA_REQ v_IMS_DATA_REQ; + var SecurityClientParams_Type v_SecurityClientParams; + var REGISTER_Request v_RegisterReq; + var boolean v_IsEmergency := true; + var integer v_NonceCount; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo; + + v_NonceCount := 2; + v_IMS_DATA_REQ := f_IMS_REGISTER_SubsequentRequest(-, v_IsEmergency, v_NonceCount); + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + + v_SecurityClientParams := f_IMS_PTC_ReRegistration_SecurityClientParamsGet(); + + f_IMS_Register_SecurityInit(v_RegisterReq, not4b tsc_IMS_AuthRAND); /* generate a new RAND */ + + v_RoutingInfo := f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo); + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo, cs_Response(c_statusLine401, f_IMS_RegisterResponse_401_MessageHeaderTX(v_RegisterReq)))); + + v_NonceCount := 1; // nonce counter is reset to 1 due to re-authentication + + v_IMS_DATA_REQ := f_IMS_REGISTER_SubsequentRequest(-, v_IsEmergency, v_NonceCount); + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + v_RoutingInfo := f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo); /* @sic R5s141326, R5s150245 change 1 sic@ */ + + if (p_OldSecNotRequired) { // @sic R5s141335 sic@ + f_IMS_Register_SecurityRelease(); // @sic R5s140909; R5w150015: v_SecurityInfo is removed sic@ + v_RoutingInfo.Security := protectedContext1; /* @sic R5s141326: by releasing the old security context the new one becomes context 1; R5s150245 change 1 sic@ */ + } + + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo, cs_Response(c_statusLine200, f_IMS_RegisterResponse_200_MessageHeaderTX(v_RegisterReq, v_IsEmergency, p_RegisterExpiration)))); /* @sic R5s150809 sic@ */ + return v_RegisterReq; + } + + function f_TC_19_1_1_IMS1() runs on IMS_PTC + { /* IMS implementation for PDN1 - Registration */ + var boolean v_GeolocationUsage := f_IMS_GetGeolocationUsage (); // the test case intends to use GeoLocationInformation if supported by the UE (PICS) + + f_IMS_CC_Preamble(IPCAN_EmergencyCall, IMS_REGISTERED); + + // Trigger SS to execute location related functions to allow UE to get its position + if (v_GeolocationUsage) { + f_IMS_IPCAN_ModifyConfig (IPCAN, IPCAN_UpdateUELocationInformation); + } + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); + + f_IMS_IMS_WaitForTrigger(OtherPDN); // wait for trigger after IMS call release + + //including step 18: deactivation of emergency bearer context and DRBs1-3 @sic R5-150268 sic@ + f_IMS_CC_Postamble(IPCAN_EmergencyCall_NormalService); + + } + + function f_TC_19_1_1_IMS2() runs on IMS_PTC + { /* IMS implementation for PDN2 - Emergency call */ + var INVITE_Request v_InviteRequest; + var REGISTER_Request v_RegisterRequest; + var boolean v_GeolocationUsage := f_IMS_GetGeolocationUsage (); // the test case intends to use GeoLocationInformation if supported by the UE (PICS) + + f_IMS_PTC_Init(PDN_2); + + f_IMS_IMS_WaitForTrigger(OtherPDN); + + f_IMS_TestBody_Set(true); + + //@siclog "Steps 1-15" siclog@ + f_IMS_CC_StartCall(IPCAN_EmergencyCall_NormalService); // steps 1-15 of 4.5A.4 + + // 1. Emergency registration + // Note: Emergency call tests apply only to UEs supporting full IMS security + v_RegisterRequest := f_IMS_EmergencyRegistration_C20(); + + // 2. IMS emergency call setup with PSAP (Public Safetly Answering Point) + v_InviteRequest := f_IMS_EmergencyCallSetup_AnnexC22(-, v_GeolocationUsage); // geolocation information to be used + + //@siclog "Steps 16-17" siclog@ + f_IMS_EmergencyCallRelease(v_InviteRequest); + + f_IMS_TestBody_Set(false); + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); + } + + //============================================================================ + /* + * @desc REFERENCE TS 34.229-1 clause 19.1.2 + * @status APPROVED (IMS) + */ + function f_TC_19_1_2_IMS1() runs on IMS_PTC + { /* IMS implementation for PDN1 - Registration */ + f_IMS_CC_Preamble(IPCAN_EmergencyCall, IMS_REGISTERED); + f_IMS_IMS_SendCoOrdMsg(OtherPDN); + + f_IMS_IMS_WaitForTrigger(OtherPDN); + + //including step 18: deactivation of emergency bearer context and DRBs1-3 @sic R5-150268 sic@ + f_IMS_CC_Postamble(IPCAN_EmergencyCall_NormalService); // @sic R5s140171 sic@ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 19.1.2 + * @status APPROVED (IMS) + */ + function f_TC_19_1_2_IMS2() runs on IMS_PTC + { /* IMS implementation for PDN2 - Emergency call */ + var INVITE_Request v_InviteRequest; + var REGISTER_Request v_RegisterRequest; + + f_IMS_PTC_Init(PDN_2); + + f_IMS_IMS_WaitForTrigger(OtherPDN); + + f_IMS_TestBody_Set(true); + + //@siclog "Steps 1-15" siclog@ + f_IMS_CC_StartCall(IPCAN_EmergencyCall_NormalService); // steps 1-15 of 4.5A.4 @sic R5s130748 additional change sic@ + + // 1. Emergency registration + // Note: Emergency call tests apply only to UEs supporting full IMS security + v_RegisterRequest := f_IMS_EmergencyRegistration_C20(); + + // 2. IMS emergency call setup with PSAP (Public Safetly Answering Point) + v_InviteRequest := f_IMS_EmergencyCallSetup_AnnexC22(); + + //@siclog "Steps 16-17" siclog@ + f_IMS_EmergencyCallRelease(v_InviteRequest); + + f_IMS_TestBody_Set(false); + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); // @sic R5s140171 sic@ + } + + //============================================================================ + /* + * @desc REFERENCE TS 34.229-1 clause 19.1.5 + * @status APPROVED (IMS) + */ + function f_TC_19_1_5_IMS1() runs on IMS_PTC + { /* first an IMS MO Speech Call is established and afterwards (see PTC IMS2) an IMS Emergency Call + the configuration is done subsequently: first DRB2 and then DRBs 3 and 4 are configured */ + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; /* @sic R5w140112: IMS_InviteRequestWithSdp_Type instead of IMS_DATA_REQ */ + var INVITE_Request v_InviteRequest; + var MessageHeader v_MessageHeader_Response183; + var SDP_Message v_SDP_OriginalOffer; + var SDP_Message v_SDP_HoldResumeOffer; + var boolean v_GeolocationUsage := f_IMS_GetGeolocationUsage(); // the test case intends to use GeoLocationInformation if supported by the UE (PICS) + + f_IMS_CC_Preamble(IPCAN_EmergencyCall, IMS_REGISTERED); /* @sic R5s150412: emergency call configuration sic@ */ + + // Trigger SS to execute location related functions to allow UE to get its position + if (v_GeolocationUsage) { + f_IMS_IPCAN_ModifyConfig(IPCAN, IPCAN_UpdateUELocationInformation); + } + + // Initial conditions: Setup MO speech call + f_IMS_CC_StartCall(IPCAN_MO_SpeechCall); + + v_InviteRequestWithSdp := f_IMS_MOCallSetup_AnnexC21_Step2_A4(); + v_InviteRequest := v_InviteRequestWithSdp.Invite; + + v_MessageHeader_Response183 := f_IMS_MOCallSetup_AnnexC21_Step3_4(v_InviteRequestWithSdp); + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MO_SpeechCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + v_SDP_OriginalOffer := f_IMS_MOCallSetup_AnnexC21_Steps5_13(v_InviteRequestWithSdp, v_MessageHeader_Response183); + + f_IMS_TestBody_Set(true); + + // User initiates hold of ongoing call + //@siclog "Step 1" siclog@ + f_UT_CallHold(MMI); + // Ongoing call is put on hold by UE: Steps defined in annex C.8 + //@siclog "Steps 2-5" siclog@ + v_SDP_HoldResumeOffer := f_IMS_MOCallHoldResume_AnnexC8(HOLD, v_InviteRequest, v_MessageHeader_Response183, v_SDP_OriginalOffer); + f_IMS_PreliminaryPass(__FILE__, __LINE__, ""); + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); + + //@siclog "Steps 19-22" siclog@ + f_IMS_MOCallHoldResume_AnnexC8(RESUME, v_InviteRequest, v_MessageHeader_Response183, v_SDP_OriginalOffer); + f_IMS_PreliminaryPass(__FILE__, __LINE__, ""); + + // UE releases the call + //@siclog "Steps 23-24" siclog@ + f_IMS_CallReleaseMO(v_InviteRequest); + + f_IMS_TestBody_Set(false); + f_IMS_CC_Postamble(IPCAN_MO_Speech_EmergencyCall); /* @sic R5s141286 change 1: IPCAN_MO_Speech_EmergencyCall sic@ */ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 19.1.5 + * @status APPROVED (IMS) + */ + function f_TC_19_1_5_IMS2() runs on IMS_PTC + { /* first an IMS MO Speech Call is established (see PTC IMS1) and afterwards an IMS Emergency Call + the configuration is done subsequently: first DRB2 and then DRBs 3 and 4 are configured */ + + var REGISTER_Request v_RegisterRequest; + var INVITE_Request v_InviteRequestEmergencyCall; + var boolean v_GeolocationUsage := f_IMS_GetGeolocationUsage (); // the test case intends to use GeoLocationInformation if supported by the UE (PICS) + + f_IMS_PTC_Init(PDN_2); + + f_IMS_IMS_WaitForTrigger(OtherPDN); + + // User initiates emergency call + //@siclog "Step 6" siclog@ + f_IMS_CC_StartCall(IPCAN_MO_Speech_EmergencyCall); // steps 1-15 of 4.5A.4 @sic R5s150091 sic@ + + // Steps defined in annex C.20 followed by the steps defined in annex C.22 + //@siclog "Steps 7-15" siclog@ + v_RegisterRequest := f_IMS_EmergencyRegistration_C20(); + v_InviteRequestEmergencyCall := f_IMS_EmergencyCallSetup_AnnexC22(-, v_GeolocationUsage); + f_IMS_PreliminaryPass(__FILE__, __LINE__, ""); + + //@siclog "Step 15A" siclog@ + f_UT_CallResume(MMI); /* @sic R5s141286 change 2 sic@ */ + + // The UE releases the emergency call with BYE + //@siclog "Steps 16-17" siclog@ + f_IMS_EmergencyCallRelease(v_InviteRequestEmergencyCall, true); /* @sic R5s141286 change 2: p_AutonomousCallRelease := true sic@ */ + } + + //============================================================================ + /* + * @desc REFERENCE TS 34.229-1 clause 19.3.1 + * @status APPROVED (IMS) + */ + function f_TC_19_3_1_IMS() runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var MessageHeader v_MessageHeader_Response183; + var IMS_Emergency_Type v_EmergencyType := ASSERTED_EMERGENCY; + var boolean v_GeolocationUsage := f_IMS_GetGeolocationUsage(); // the test case intends to use GeoLocationInformation if supported by the UE (PICS) + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + + // Trigger SS to execute location related functions to allow UE to get its position + if (v_GeolocationUsage) { + f_IMS_IPCAN_ModifyConfig (IPCAN, IPCAN_UpdateUELocationInformation); + } + + f_IMS_TestBody_Set(true); + + // Steps 1-12 of Annex C.7. The UE initiates a non-emergency call. + // Note: Annex C.7 is identical to C.21. Steps 1-12 of Annex C.7 map to Steps 2-13 of Annex C.21. C.7 is to be removed medium term. + //@siclog "Steps 1-12" siclog@ + f_IMS_CC_StartCall(IPCAN_MO_SpeechCall); + + v_InviteRequestWithSdp := f_IMS_MOCallSetup_AnnexC21_Step2_Common(); //@sic R5s150299 r1 sic@ + + // See TS. 36.508 EUTRA/EPS signalling for IMS MO speech call Table 4.5A.6.3-1 Step 9-11 + v_MessageHeader_Response183 := f_IMS_MOCallSetup_AnnexC21_Step3_4(v_InviteRequestWithSdp, -, -, v_EmergencyType); /* emergency number put into the P-Asserted-Identity header field of 183 Session Progress + @sic R5s150692 change 14 sic@ */ + + // See TS. 36.508 EUTRA/EPS signalling for IMS MO speech call Table 4.5A.6.3-1 Step 12 + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MO_SpeechCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + + f_IMS_MOCallSetup_AnnexC21_Steps5_13(v_InviteRequestWithSdp, v_MessageHeader_Response183, -, v_GeolocationUsage, v_EmergencyType); /* @sic R5s141155 change 4 sic@ @sic R5s150193 sic@ @sic R5s150414 sic@ @sic R5s150692 change 14 sic@ */ + + f_IMS_TestBody_Set(false); + f_IMS_CallReleaseMO(v_InviteRequestWithSdp.Invite, -, v_EmergencyType); /* @sic R5s150692 change 14 sic@ */ + f_IMS_CC_Postamble(IPCAN_MO_SpeechCall); //@sic R5s141155 change 4 sic@ + } + + //============================================================================ + /* + * @desc steps 3 and four of test case 19.3.3 + * @param p_RoutingInfo_DL + * @param p_InviteRequest + * @status APPROVED (IMS) + */ + function fl_TC_19_3_3_Steps3To4(template(value) IMS_RoutingInfo_Type p_RoutingInfo_DL, + INVITE_Request p_InviteRequest) runs on IMS_PTC + { + var template (omit) MessageBody v_MessageBody := omit; + var template (present) MessageHeader v_MessageHeader_Ack; + var INVITE_Request v_InviteRequest := p_InviteRequest; + var template (value) MessageHeader v_MessageHeader_AltService_380; + var template(value) IMS_RoutingInfo_Type v_RoutingInfo_DL := p_RoutingInfo_DL; + var charstring v_CallerUri := tsc_IMS_UrnServiceSos_Ambulance; // @sic R5-140920 sic@ @sic R5s140490 sic@ + //Originating UE does not know the Contact info of remote end. It uses public user identity of the remote user. + //acc. 17.1.1.3 of RFC 3261, Request URI equals to value of Original Request ie INVITE in this case. + var template (present) SipUrl v_RequestSipUrl := f_SIP_BuildSipUri_RX(px_IMS_CalleeUri); // @sic R5s140490 sic@ + + // Step 3. The SS responds with a 380 Alternative Service response + /* Send XML contents according to Annex A.4.1 + + emergency + + emergency-registration + + */ + v_MessageHeader_AltService_380 := f_IMS_InviteResponse_380_MessageHeaderTX(v_InviteRequest); + v_MessageHeader_AltService_380.contact := cs_Contact(f_SIP_BuildSipUri_TX(v_CallerUri)); // @sic R5-140920 sic@ + v_MessageBody := cs_MessageBody_XML(cs_Ims_3gpp_Emergency("emergency-registration")); // XSD schema needed according to 24.229 section 7.6.2. + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine380, v_MessageHeader_AltService_380, v_MessageBody))); + + // Step 4. The UE acknowledges the receipt of 380 Alternative Service for INVITE + v_MessageHeader_Ack := f_IMS_AckRequest_MessageHeaderRX(p_InviteRequest, c_statusLine380); + IMS_Server.receive(car_IMS_Ack_Request(cr_ACK_Request(v_RequestSipUrl, v_MessageHeader_Ack))); // @sic R5s140490 sic@ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 19.3.3 + * @status APPROVED (IMS) + */ + function f_TC_19_3_3_IMS1() runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var INVITE_Request v_InviteRequest; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL; + var boolean v_GeolocationUsage := f_IMS_GetGeolocationUsage (); // the test case intends to use GeoLocationInformation if supported by the UE (PICS) + + //Though the Speech is invoked, but DRB2 is never established as MO Call is redirected to emergency call + //with Speech call, DRB2 is established as UM + f_IMS_CC_Preamble(IPCAN_EmergencyCall, IMS_REGISTERED); // @sic R5s140490 sic@ + + // Trigger SS to execute location related functions to allow UE to get its position + if (v_GeolocationUsage) { + f_IMS_IPCAN_ModifyConfig (IPCAN, IPCAN_UpdateUELocationInformation); + } + + f_IMS_TestBody_Set(true); + + //@siclog "Step 1" siclog@ + // MO call is initiated on the UE by dialling a "non emergency" number. + f_IMS_CC_StartCall(IPCAN_MO_SpeechCall); + + //@siclog "Step 2" siclog@ + // UE sends INVITE. Request-URI of the INVITE request matches with the "non emergency" number dialled. + v_InviteRequestWithSdp := f_IMS_MOCallSetup_AnnexC21_Step2_Common(); + v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(v_InviteRequestWithSdp.RoutingInfo); + v_InviteRequest := v_InviteRequestWithSdp.Invite; + + f_IMS_CC_AbortCall(); // MO call aborted, redirected to emergency call @sic R5s140490 sic@ + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); // procedures may run in parallel, thus coordination message needed at this point @sic R5s140490 sic@ + + //@siclog "Steps 3-4" siclog@ + // 380 Alternative Service / ACK + fl_TC_19_3_3_Steps3To4(v_RoutingInfo_DL, v_InviteRequest); + + f_IMS_IMS_WaitForTrigger(OtherPDN); + f_IMS_CC_Postamble(IPCAN_EmergencyCall_NormalService); + } + + /* + * @desc REFERENCE TS 34.229-1 clause 19.3.3 + * @status APPROVED (IMS) + */ + function f_TC_19_3_3_IMS2() runs on IMS_PTC + { + var INVITE_Request v_InviteRequest; + var REGISTER_Request v_RegisterRequest; + var boolean v_GeolocationUsage := f_IMS_GetGeolocationUsage (); // the test case intends to use GeoLocationInformation if supported by the UE (PICS) + var template (present) SipUrl v_CalleeUri := f_SIP_BuildSipUri_RX(tsc_IMS_UrnServiceSos_Ambulance); // @sic R5-140920 sic@ @sic R5s140490 sic@ @sic R5s150204 sic@ + + f_IMS_PTC_Init(PDN_2); + + f_IMS_IMS_WaitForTrigger(OtherPDN); + + // f_EUTRA_IPCAN_MainLoop keeps track of connection status, so there is no need to pass this information at this point + f_IMS_IPCAN_StartProcedure(IPCAN, IPCAN_EmergencyCall_NormalService); // @sic R5s140997 sic@ + + //@siclog "Steps 5-19" siclog@ + // Note: Emergency call tests apply only to UEs supporting full IMS security + v_RegisterRequest := f_IMS_EmergencyRegistration_C20(); + + v_InviteRequest := f_IMS_EmergencyCallSetup_AnnexC22(-, v_GeolocationUsage, v_CalleeUri); // geolocation information to be used @sic R5-140920 sic@ + + //@siclog "Steps 20-21" siclog@ + f_IMS_EmergencyCallRelease(v_InviteRequest); + + f_IMS_TestBody_Set(false); + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); + } + + //============================================================================ + /* + * @desc steps 20..21 of TC_19_3_4 + * @param p_RoutingInfo_DL + * @param p_InviteRequest + * @status APPROVED (IMS) + */ + function fl_TC_19_3_4_Steps20To21(template(value) IMS_RoutingInfo_Type p_RoutingInfo_DL, + INVITE_Request p_InviteRequest) runs on IMS_PTC + { + var template (omit) MessageBody v_MessageBody := omit; + var template (present) MessageHeader v_MessageHeader_Ack; + var INVITE_Request v_InviteRequest := p_InviteRequest; + var template (value) MessageHeader v_MessageHeader_AltService_380; + var template(value) IMS_RoutingInfo_Type v_RoutingInfo_DL := p_RoutingInfo_DL; + var template (present) SipUrl v_RequestSipUrl := f_SIP_BuildSipUri_RX(px_IMS_CalleeUri); // @sic R5s141237 sic@ + + // Step 20. The SS responds with a 380 Alternative Service response + /* Send XML contents according to Annex A.4.1 + + emergency + + emergency-registration + + */ + v_MessageHeader_AltService_380 := f_IMS_InviteResponse_380_MessageHeaderTX(v_InviteRequest); + v_MessageBody := cs_MessageBody_XML(cs_Ims_3gpp_Emergency("emergency-registration")); // XSD schema needed according to 24.229 section 7.6.2. + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine380, v_MessageHeader_AltService_380, v_MessageBody))); + + // Step 21. The UE acknowledges the receipt of 380 Alternative Service for INVITE + v_MessageHeader_Ack := f_IMS_AckRequest_MessageHeaderRX(p_InviteRequest, c_statusLine380); + IMS_Server.receive(car_IMS_Ack_Request(cr_ACK_Request(v_RequestSipUrl, v_MessageHeader_Ack))); // @sic R5s141237 sic@ @sic R5s141337 sic@ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 19.3.4 + * @status APPROVED (IMS) + */ + function f_TC_19_3_4_IMS1() runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; + var INVITE_Request v_InviteRequest; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL; + var boolean v_GeolocationUsage := f_IMS_GetGeolocationUsage (); // the test case intends to use GeoLocationInformation if supported by the UE (PICS) + var charstring v_CalleeUri := px_IMS_CalleeUri; + var template (present) SipUrl v_CalleeSipUrl := f_SIP_BuildSipUri_RX(px_IMS_CalleeUri); // @sic R5s150204 sic@ + + f_IMS_CC_Preamble(IPCAN_EmergencyCall, IMS_REGISTERED); + + // Trigger SS to execute location related functions to allow UE to get its position + if (v_GeolocationUsage) { + f_IMS_IPCAN_ModifyConfig (IPCAN, IPCAN_UpdateUELocationInformation); + } + + f_IMS_TestBody_Set(true); + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); + f_IMS_IMS_WaitForTrigger(OtherPDN); + + //@siclog "Step 18" siclog@ + // MO call is initiated on the UE by dialling a "non emergency" number. + f_UT_RequestIMSCall(MMI, v_CalleeUri); // @sic R5-134070 sic@ + //@siclog "Step 19" siclog@ + // UE sends INVITE. Request-URI of the INVITE request matches with the "non emergency" number dialled. + v_InviteRequestWithSdp := f_IMS_MOCallSetup_AnnexC21_Step2_Common(v_CalleeSipUrl); + v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(v_InviteRequestWithSdp.RoutingInfo); + v_InviteRequest := v_InviteRequestWithSdp.Invite; + //@siclog "Step 20-21" siclog@ + // 380 Alternative Service / ACK + fl_TC_19_3_4_Steps20To21(v_RoutingInfo_DL, v_InviteRequest); + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); + + f_IMS_IMS_WaitForTrigger(OtherPDN); + f_IMS_CC_Postamble(IPCAN_EmergencyCall_NormalService); + } + + /* + * @desc REFERENCE TS 34.229-1 clause 19.3.4 + * @status APPROVED (IMS) + */ + function f_TC_19_3_4_IMS2() runs on IMS_PTC + { + var INVITE_Request v_InviteRequest; + var REGISTER_Request v_RegisterRequest; + var boolean v_GeolocationUsage := f_IMS_GetGeolocationUsage (); // the test case intends to use GeoLocationInformation if supported by the UE (PICS) + + f_IMS_PTC_Init(PDN_2); + + f_IMS_IMS_WaitForTrigger(OtherPDN); + + f_IMS_TestBody_Set(true); + + //@siclog "Steps 1-15" siclog@ + f_IMS_CC_StartCall(IPCAN_EmergencyCall_NormalService); // steps 1-15 of 4.5A.4 + + v_RegisterRequest := f_IMS_EmergencyRegistration_C20(); + + v_InviteRequest := f_IMS_EmergencyCallSetup_AnnexC22(-, v_GeolocationUsage); // geolocation information to be used + + //@siclog "Steps 16-17" siclog@ + f_IMS_EmergencyCallRelease(v_InviteRequest); + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); + f_IMS_IMS_WaitForTrigger(OtherPDN); + + //@siclog "Steps 22-25 Void" siclog@ + + //@siclog "Steps 26-37" siclog@ + v_InviteRequest := f_IMS_EmergencyCallSetup_AnnexC22(-, v_GeolocationUsage); // @sic R5s141237 sic@ + + //@siclog "Steps 38-39" siclog@ + f_IMS_EmergencyCallRelease(v_InviteRequest); + + f_IMS_TestBody_Set(false); + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); + } + + //============================================================================ + + /* + * @desc REFERENCE TS 34.229-1 clause 19.5.6 + * @status APPROVED (IMS) + */ + function f_TC_19_5_6_IMS1() runs on IMS_PTC + { /* IMS implementation for PDN1 - Registration */ + f_IMS_CC_Preamble(IPCAN_EmergencyCall, IMS_REGISTERED); + f_IMS_IMS_SendCoOrdMsg(OtherPDN); + + f_IMS_IMS_WaitForTrigger(OtherPDN); // @sic R5-140037 sic@ + f_IMS_CC_Postamble(IPCAN_EmergencyCall_NormalService); // @sic R5-140037 sic@ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 19.5.6 + * @status APPROVED (IMS) + */ + function f_TC_19_5_6_IMS2() runs on IMS_PTC + { /* IMS implementation for PDN2 - Emergency call */ + var IMS_DATA_REQ v_IMS_DATA_REQ; + var INVITE_Request v_InviteRequest; + var REGISTER_Request v_RegisterRequest; + var integer v_Expiry := 120; + var float v_ReRegistrationTime := int2float(v_Expiry / 2); + + timer t_RegExpireMin := f_IMS_SetTimerToleranceMin(v_ReRegistrationTime); + timer t_RegExpireMax := f_IMS_SetTimerToleranceMax(v_ReRegistrationTime); + + f_IMS_PTC_Init(PDN_2); + + f_IMS_IMS_WaitForTrigger(OtherPDN); + + f_IMS_CC_StartCall(IPCAN_EmergencyCall_NormalService); // steps 1-15 of 4.5A.4 + + // Initial condition: Emergency registration, expiration time is set to 120 seconds + IMS_Server.receive(car_IMS_Register_Request(cr_REGISTER_Request(?))) -> value v_IMS_DATA_REQ; // receive any REGISTER // @sic R5-140037 sic@ + t_RegExpireMin.start; + t_RegExpireMax.start; + v_RegisterRequest := f_IMS_EmergencyRegistration_C20(v_IMS_DATA_REQ, int2str(v_Expiry)); + + // Initial condition: Call setup + v_InviteRequest := f_IMS_EmergencyCallSetup_AnnexC22(); + + f_IMS_TestBody_Set(true); + + //@siclog "Steps 1-4" siclog@ + // re-registration + // The UE shall perform user-initiated emergency reregistration ... if half of the time for the emergency registration has expired and: + // - the UE has emergency related ongoing dialog; or ... + t_RegExpireMin.timeout; // re-registration shall not happen before expiry of TRegExpireMin + v_RegisterRequest := fl_IMS_EmergencyReRegistration(); // @sic R5-140037 sic@ + t_RegExpireMax.stop; // RegExpireMax shall not timeout before re-registration + + f_IMS_TestBody_Set(false); + f_IMS_EmergencyCallRelease(v_InviteRequest); + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); // @sic R5-140037 sic@ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 19.5.7 + * @status + */ + function f_TC_19_5_7_IMS1() runs on IMS_PTC + { /* IMS implementation for PDN1 - Registration */ + f_IMS_CC_Preamble(IPCAN_EmergencyCall, IMS_REGISTERED); + f_IMS_IMS_SendCoOrdMsg(OtherPDN); + + f_IMS_IMS_WaitForTrigger(OtherPDN); + f_IMS_CC_Postamble(IPCAN_EmergencyCall_NormalService); + } + + /* + * @desc REFERENCE TS 34.229-1 clause 19.5.7 + * @status + */ + function f_TC_19_5_7_IMS2() runs on IMS_PTC + { /* IMS implementation for PDN2 - Emergency call */ + var INVITE_Request v_InviteRequest; + var REGISTER_Request v_RegisterRequest; + var integer v_Expiry := 10; // 10 sec used per step 1 of the Expected sequence // @sic R5s140791 sic@ + var float v_ReRegistrationTime := int2float(v_Expiry / 2); // @sic R5s140647 change 1 sic@ + var IMS_DATA_REQ v_IMS_DATA_REQ; + var template(value) IMS_RoutingInfo_Type v_RoutingInfo_DL; + var template (present) SDP_Message v_SDP_Message_Step1; + var SDP_Message v_SDP_Message; + var IMS_Emergency_Type v_EmergencyType := REGULAR_EMERGENCY; /* @sic R5s150692 change 25 sic@ */ + var boolean v_PrackRequiredFor180Ringing := false; /* => there is no PRACK expected to acknowledge the 180 response */ + var charstring v_FmtAudio; + var float v_DelayBeforeSending; + var float v_ReRegistrationElapsedTime; // time elapsed after registration (C.20) and reception of INVITE Request + var boolean v_GeolocationInfoAvailable := false; + var template (present) SipUrl v_CalleeContactSipUri; + var template (value) MessageHeader v_MessageHeader_InviteResponse_200; + var template (present) MessageHeader v_MessageHeader_Ack; + var template (value) SDP_Message v_SDP_Message_Step4; + timer t_RegExpireMax := f_IMS_SetTimerToleranceMax(v_ReRegistrationTime); // more than half of the expiration time + + f_IMS_PTC_Init(PDN_2); + + f_IMS_IMS_WaitForTrigger(OtherPDN); + + f_IMS_CC_StartCall(IPCAN_EmergencyCall_NormalService); // steps 1-15 of 4.5A.4 + + f_IMS_TestBody_Set(true); + //@siclog "Step 1" siclog@ + v_RegisterRequest := f_IMS_EmergencyRegistration_C20(-, int2str(v_Expiry)); // Initial condition: Emergency registration, expiration time is set to 10 seconds // @sic R5s140791 sic@ + + //@siclog "Step 2" siclog@ + t_RegExpireMax.start; // more than half of the expiration time shall elapse, used as well to calculate the elapsed time + v_SDP_Message_Step1 := f_IMS_BuildSDP_AnnexC22_Step1(); + + //@siclog "Step 1 of C.22" siclog@ + // Receive INVITE for an Emergency call + v_IMS_DATA_REQ := f_IMS_INVITE_ReceiveRequest(A_2_1_A7, -, -, -, v_GeolocationInfoAvailable); + v_ReRegistrationElapsedTime := t_RegExpireMax.read; + t_RegExpireMax.stop; // not needed any more + // If INVITE takes too long, t_RegExpireMax will time out and this will fail the TC + + v_InviteRequest := v_IMS_DATA_REQ.Request.Invite; + v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo); + + v_SDP_Message := f_IMS_MessageBody_CheckSdpMessageAndGeolocation(v_InviteRequest.messageBody, v_SDP_Message_Step1, v_GeolocationInfoAvailable); + + v_FmtAudio := f_SDP_MediaDescr_GetAMR_8000_1(v_SDP_Message.media_list[0], omit); // !!!! PROSE ISSUE: prose does not specify how to get the correct fmt !!!! + if (v_FmtAudio == "") { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "no AMR codec found in given media description"); + } + if (v_ReRegistrationElapsedTime > v_ReRegistrationTime) { + FatalError (__FILE__, __LINE__, "Time from Registration to INVITE insufficient for the test case - Reregistation time should be increased"); // @sic R5s140791 sic@ + } + + v_DelayBeforeSending := f_IMS_SetTimerToleranceMin((v_ReRegistrationTime - v_ReRegistrationElapsedTime) / 3.0); // calculate delay before sending before 100 Trying and 180 Ringing @sic R5s140338 sic@ + // total time left before Reregistration divided equally for both messages to be sent after a delay @sic R5s140791 sic@ + + //@siclog "Step 2 of C.22" siclog@ + // SS sends a 100 Trying provisional response. + f_Delay(v_DelayBeforeSending); // delayed sending + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine100, f_IMS_InviteResponse_100_MessageHeaderTX(v_InviteRequest)))); + + //@siclog "Step 3 of C.22" siclog@ + // SS sends a 180 Ringing response. + f_Delay(v_DelayBeforeSending); // delayed sending + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine180, f_IMS_InviteResponse_180_MessageHeaderTX(v_InviteRequest, -, v_PrackRequiredFor180Ringing, v_EmergencyType)))); + + //@siclog "Steps 2A-2D i.e. Steps 1-4 Parallel behaviour" siclog@ + // Parallel behaviour Steps 1 to 4 re-registration + v_RegisterRequest := fl_IMS_EmergencyReRegistration(false, "1200"); // @sic R5s140338 sic@ @sic R5s141335 sic@ @sic R5s150809 sic@ + t_RegExpireMax.stop; + + // Step 3. 200 OK as per step 4 of Annnex C.22, i.e. Response for INVITE sent in step 2 (step 1 of Annex C.22) + v_SDP_Message_Step4 := f_IMS_BuildSDP_AnnexC22_Step4(v_FmtAudio); // @sic R5-145732 sic@ + v_MessageHeader_InviteResponse_200 := f_IMS_OtherResponse_200_MessageHeaderTX(v_InviteRequest.msgHeader, cs_ContentTypeSDP, tsc_IMS_Emergency_TelUri); + v_CalleeContactSipUri := f_Addr_Union_GetSipUrl(v_MessageHeader_InviteResponse_200.contact.contactBody.contactAddresses[0].addressField); + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine200, v_MessageHeader_InviteResponse_200, cs_MessageBody_SDP(v_SDP_Message_Step4)))); + + // Step 4. Response from UE to confirm the dialogue + // ACK will be received on the previous socket connection using the old Security Association or on the socket with the new security association @sic R5-150267 sic@ + v_MessageHeader_Ack := f_IMS_AckRequest_MessageHeaderRX(v_InviteRequest, c_statusLine200, v_EmergencyType); // @sic R5-145732 sic@ @sic R5s141335 sic@ @sic R5s150692 change 25 sic@ + IMS_Server.receive(car_IMS_Ack_Request(cr_ACK_Request(v_CalleeContactSipUri, v_MessageHeader_Ack))) -> value v_IMS_DATA_REQ; // @sic R5s150195 sic@ + + //@siclog "Steps 5-6" siclog@ + // The UE releases the call with BYE + f_IMS_EmergencyCallRelease(v_InviteRequest); // @sic R5-145732 sic@ + + f_IMS_TestBody_Set(false); + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); + } + + //============================================================================ + function f_TC_19_5_8_IMS1() runs on IMS_PTC + { /* IMS implementation for PDN1 - Registration */ + f_IMS_CC_Preamble(IPCAN_EmergencyCall, IMS_REGISTERED); + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); + + f_IMS_IMS_WaitForTrigger(OtherPDN); + f_IMS_CC_Postamble(IPCAN_EmergencyCall_NormalService); + } + + function f_TC_19_5_8_IMS2() runs on IMS_PTC + { /* IMS implementation for PDN2 - Emergency call */ + var IMS_DATA_REQ v_IMS_DATA_REQ; + var IMS_DATA_REQ v_IMS_DATA_REQ_BYE; // to save for later use + var INVITE_Request v_InviteRequest; + var REGISTER_Request v_RegisterRequest; + var BYE_Request v_ByeRequest; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo; + var template (present) MessageHeader v_MessageHeader_Bye; + var InternetProtocol_Type v_Protocol; + var template (value) MessageHeader v_MessageHeader_MessageMT; + var MESSAGE_Request v_MESSAGE_RequestRX; + var SipUrl v_ContactUrl; + var RP_ACK_Type v_RPAck; + var octetstring v_EncodedSMS; + var template (value) RP_DATA_dl_Type v_SMSdl; + var SipUrl v_PAssertedIDUrl; + var CallidString v_PrevCallId; + var CharStringList_Type v_PrevCallIdList := {}; + var integer v_TimestampRegSeconds; + var integer v_TimestampSMStxSeconds; + var H2_Type v_TimestampRegHexSeconds; + var H2_Type v_TimestampSMStxHexSeconds; + var H14_Type v_TimestampReg; + var H14_Type v_TimestampSMStx; + var IMS_Emergency_Type v_EmergencyType := REGULAR_EMERGENCY; /* @sic R5s150692 change 25 sic@ */ + + timer t_WaitForBYE := 7.0; + + f_IMS_PTC_Init(PDN_2); + + f_IMS_IMS_WaitForTrigger(OtherPDN); + + f_IMS_CC_StartCall(IPCAN_EmergencyCall_NormalService); // steps 1-15 of 4.5A.4 + + // Initial condition: Emergency registration + v_RegisterRequest := f_IMS_EmergencyRegistration_C20(-, "20"); // Register expiration time of 20 seconds + t_WaitForBYE.start; + v_TimestampReg := f_BCD_TimestampWithTimezone (); + // Initial condition: Call setup + v_InviteRequest := f_IMS_EmergencyCallSetup_AnnexC22(); + v_ContactUrl := f_MessageHeader_GetContactSipUrl(v_RegisterRequest.msgHeader); + + f_IMS_TestBody_Set(true); + t_WaitForBYE.timeout; + f_IMS_EmergencyCallRelease(v_InviteRequest); + + //@siclog "Step 1" siclog@ + // BYE + v_MessageHeader_Bye := f_IMS_ByeRequest_MessageHeaderRX(v_InviteRequest, v_EmergencyType); /* @sic R5s150692 change 25 sic@ */ + IMS_Server.receive(car_IMS_Bye_Request(cr_BYE_Request(v_InviteRequest.requestLine.requestUri, v_MessageHeader_Bye))) -> value v_IMS_DATA_REQ_BYE; // !!!! most likely requestUri is wrong (has to be "same URI value as the recipient of BYE has earlier sent in its Contact header within the same dialog"; A.2.8) !!!! + v_ByeRequest := v_IMS_DATA_REQ_BYE.Request.Bye; + + //@siclog "Step 2" siclog@ + // The SS sends an MT Short Message 9 seconds after initiation of the emergency call. + // Build MT SMS - copied from 18_2 + f_Delay (1.5); + v_Protocol := f_IMS_PTC_ImsInfo_GetTransportProtocol(); + v_SMSdl := cs_RP_DATA_dl_DELIVER('7788996655'O); + v_EncodedSMS := f_SMS_PDU_EncodeRPDATA(v_SMSdl); + v_MessageHeader_MessageMT := f_IMS_MessageRequest_MessageHeaderTX_MT_SMS(v_Protocol); + IMS_Client.send(cas_IMS_Message_Request(cs_IMS_RoutingInfo(v_Protocol), cs_MESSAGE_Request(v_ContactUrl, v_MessageHeader_MessageMT, cs_MessageBody_SMS(v_EncodedSMS)))); + v_PrevCallId := valueof(v_MessageHeader_MessageMT.callId.callid); + v_PrevCallIdList := f_CharStringList_Add(v_PrevCallIdList, v_PrevCallId); + v_TimestampSMStx := f_BCD_TimestampWithTimezone (); + // Plausibility check: less than 10 sec may elapse in order to satisfy the timely requirements of the test case + v_TimestampRegHexSeconds := substr (v_TimestampReg, 10,2); + v_TimestampSMStxHexSeconds := substr (v_TimestampSMStx, 10,2); + v_TimestampRegSeconds := hex2int(v_TimestampRegHexSeconds); + v_TimestampSMStxSeconds := hex2int(v_TimestampSMStxHexSeconds); + if (v_TimestampSMStxSeconds > v_TimestampRegSeconds) { + if ((v_TimestampSMStxSeconds - v_TimestampRegSeconds) > 10 ) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Time restrictions not satisfied"); + } + } + else + if (v_TimestampRegSeconds > v_TimestampSMStxSeconds) { // measurement stretches over 2 minutes + if (((v_TimestampSMStxSeconds + 60) - v_TimestampRegSeconds) > 10 ) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Time restrictions not satisfied"); + } + } + + //@siclog "Step 2A" siclog@ + // The UE responds with 200 OK. + f_IMS_ReceiveResponse(v_MessageHeader_MessageMT, v_Protocol, cr_Response(c_statusLine200, f_IMS_OtherResponse_200_MessageHeaderRX(v_MessageHeader_MessageMT))); + + //@siclog "Step 2B" siclog@ + // The UE responds with a delivery report. + // Contents in 34.229-1 Annex A.7.2 + v_PAssertedIDUrl := f_Addr_Union_GetSipUrl(v_MessageHeader_MessageMT.pAssertedID.pAssertedIDValueList[0]); + + v_IMS_DATA_REQ := f_IMS_MessageRequest_Receive(v_PAssertedIDUrl, + f_IMS_MessageRequest_MessageHeaderRX_DeliveryReport(v_PAssertedIDUrl, v_PrevCallId), + v_PrevCallIdList); + v_MESSAGE_RequestRX := v_IMS_DATA_REQ.Request.Message; + v_EncodedSMS := v_MESSAGE_RequestRX.messageBody.smsMessage; + v_RPAck := f_SMS_PDU_DecodeAndMatchRPACK(v_EncodedSMS, cr_RP_ACK_ul); + f_IMS_PreliminaryPass(__FILE__, __LINE__, "Step 2A"); + + //@siclog "Step 3" siclog@ + // The SS sends 200 OK for BYE + v_RoutingInfo := f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ_BYE.RoutingInfo); + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo, cs_Response(c_statusLine200, f_IMS_OtherResponse_200_MessageHeaderTX(v_IMS_DATA_REQ_BYE.Request.Bye.msgHeader)))); + + // up to now 9 sec have elapsed after the emergency registration + // After half of the expiration time (=10 sec) the UE performs an emergency reregistration (parallel behaviour) + + // Parallel behaviour Steps 1 to 4 emergency re-registration + v_RegisterRequest := f_IMS_EmergencyRegistration_C20(); // new security information, is reinitialized in this function + + //@siclog "Step 4" siclog@ + // 1 second after the emergency reregistration SIP Timer T1 times out and the SMS delivery report is retransmitted by the UE + // UE resends the SIP MESSAGE request after the timeout as SS did not send a reply + // Contents in 34.229-1 Annex A.7.2 + v_PAssertedIDUrl := f_Addr_Union_GetSipUrl(v_MessageHeader_MessageMT.pAssertedID.pAssertedIDValueList[0]); + + v_IMS_DATA_REQ := f_IMS_MessageRequest_Receive(v_PAssertedIDUrl, + f_IMS_MessageRequest_MessageHeaderRX_DeliveryReport(v_PAssertedIDUrl, v_PrevCallId), + v_PrevCallIdList); + v_MESSAGE_RequestRX := v_IMS_DATA_REQ.Request.Message; + v_EncodedSMS := v_MESSAGE_RequestRX.messageBody.smsMessage; + v_RPAck := f_SMS_PDU_DecodeAndMatchRPACK(v_EncodedSMS, cr_RP_ACK_ul); + f_IMS_PreliminaryPass(__FILE__, __LINE__, "Step 4"); + + //@siclog "Step 5" siclog@ + // The SS sends a 202 Accepted + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo), cs_Response(c_statusLine202, f_IMS_Accepted_202_MessageHeaderTX(v_MESSAGE_RequestRX.msgHeader)))); + + f_IMS_TestBody_Set(false); + + f_IMS_EmergencyCallRelease(v_InviteRequest); + f_IMS_IMS_SendCoOrdMsg(OtherPDN); // IMS call has been released + + } + + //============================================================================ + /* + * @desc Sending of Notify Request and reception 200 response + * @param p_ContactUrl + * @param p_XmlMessage + * @status APPROVED (IMS) + */ + function fl_TC_19_5_9_Steps16To17_Notify(SipUrl p_ContactUrl, + template (value) Reginfo_Type p_XmlMessage) runs on IMS_PTC + { /* @sic R5-153756, R5-153986: p_SubscribeRequest removed as global regEventDialog is used instead sic@ */ + var template (value) MessageHeader v_MessageHeader_Notify; + var template (present) MessageHeader v_MessageHeader_Response; + + v_MessageHeader_Notify := f_IMS_NotifyRequest_MessageHeader_A16(cs_SubscriptionState_Active); /* @sic R5-153756, R5-153986 sic@ */ + IMS_Client.send(cas_IMS_Notify_Request(cs_IMS_RoutingInfo(udp), + cs_NOTIFY_Request(p_ContactUrl, v_MessageHeader_Notify, cs_MessageBody_RegInfo(p_XmlMessage)))); + v_MessageHeader_Response := f_IMS_OtherResponse_200_MessageHeaderRX(v_MessageHeader_Notify); + f_IMS_ReceiveResponse(v_MessageHeader_Notify, udp, cr_Response(c_statusLine200, v_MessageHeader_Response)); /* @sic R5s140350 sic@ */ + } + + /* + * @desc Construction of XML message for Notify + * @param p_RegisterRequest + * @return template (value) Reginfo_Type + * @status APPROVED (IMS) + */ + function fl_TC_19_5_9_XmlMessageForNotify(REGISTER_Request p_RegisterRequest) runs on IMS_PTC return template (value) Reginfo_Type + { + var boolean v_ApplyGRUU := false; /* @sic R5-153760 - implementation of GRUU: GRUU is not considered in the test case prose sic@ */ + var template (value) RegInfo_Registration_Type v_Registration1 := f_XML_RegistrationInfo(p_RegisterRequest, px_IMS_PublicUserIdentity2, "a102", "980", terminated, rejected, -, v_ApplyGRUU); + var template (value) RegInfo_Registration_Type v_Registration2 := f_XML_RegistrationInfo(p_RegisterRequest, px_IMS_AssociatedTelUri, "a101", "981", terminated, rejected, -, v_ApplyGRUU, true); + var template (value) RegInfo_RegistrationList_Type v_RegistrationList := {v_Registration1, v_Registration2}; + return f_XML_RegInfo(partial, 1, v_RegistrationList); + } + + /* + * @desc REFERENCE TS 34.229-1 clause 19.5.9 + * @status APPROVED (IMS) + */ + function f_TC_19_5_9_IMS1() runs on IMS_PTC + { /* IMS implementation for PDN1 - Registration */ + var REGISTER_Request v_RegisterRequest; + var SipUrl v_ContactUrl; + var template (value) Reginfo_Type v_XmlMessage; + + f_IMS_PTC_Init(PDN_1); // @sic R5s140329 sic@ + f_IMS_IPCAN_Init(IPCAN, IPCAN_EmergencyCall); // @sic R5s140329 sic@ + + f_IMS_IPCAN_StartProcedure(IPCAN, IPCAN_InitialRegistration); + v_RegisterRequest := f_IMS_Register(); + f_IMS_Register_SubscribeNotify(v_RegisterRequest); + f_IMS_CC_ReleaseConnection(IPCAN_InitialRegistration); // @sic R5s140329 sic@ + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); + f_IMS_IMS_WaitForTrigger(OtherPDN); // Wait for sync message from other IMS PTC + + //@siclog "Steps 16-17" siclog@ + v_ContactUrl := f_MessageHeader_GetContactSipUrl(v_RegisterRequest.msgHeader); // check and compare with 19.5.8 (EW) + v_XmlMessage := fl_TC_19_5_9_XmlMessageForNotify(v_RegisterRequest); + fl_TC_19_5_9_Steps16To17_Notify(v_ContactUrl, v_XmlMessage); + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); // to release IMS call + + f_IMS_IMS_WaitForTrigger(OtherPDN); + f_IMS_CC_Postamble(IPCAN_EmergencyCall_NormalService); + + } + + /* + * @desc REFERENCE TS 34.229-1 clause 19.5.9 + * @status APPROVED (IMS) + */ + function f_TC_19_5_9_IMS2() runs on IMS_PTC + { /* IMS implementation for PDN2 - Emergency call */ + var INVITE_Request v_InviteRequest; + var REGISTER_Request v_RegisterRequest; + + f_IMS_PTC_Init(PDN_2); + + f_IMS_IMS_WaitForTrigger(OtherPDN); + + f_IMS_TestBody_Set(true); + + //@siclog "Steps 1-15" siclog@ + f_IMS_CC_StartCall(IPCAN_EmergencyCall_NormalService); // steps 1-15 of 4.5A.4 + v_RegisterRequest := f_IMS_EmergencyRegistration_C20(); + v_InviteRequest := f_IMS_EmergencyCallSetup_AnnexC22(); + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); // Send sync message to other IMS PTC (for steps 16/17) + f_IMS_IMS_WaitForTrigger(OtherPDN); // Wait for sync message from other IMS PTC + + //@siclog "Steps 16-17" siclog@ + f_IMS_EmergencyCallRelease(v_InviteRequest); + + f_IMS_TestBody_Set(false); + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); // IMS call has been released + } + + //============================================================================ + /* + * @desc REFERENCE TS 34.229-1 clause 19.5.10 + * @status APPROVED (IMS) + */ + function f_TC_19_5_10_IMS1() runs on IMS_PTC + { /* IMS implementation for PDN1 - Registration */ + f_IMS_CC_Preamble(IPCAN_EmergencyCall, IMS_REGISTERED); + f_IMS_IMS_SendCoOrdMsg(OtherPDN); + f_IMS_IMS_WaitForTrigger(OtherPDN); // @sic R5-140039 sic@ + f_IMS_CC_Postamble(IPCAN_EmergencyCall_NormalService); // @sic R5-140039 sic@ + } + + /* + * @desc REFERENCE TS 34.229-1 clause 19.5.10 + * @status APPROVED (IMS) + */ + function f_TC_19_5_10_IMS2() runs on IMS_PTC + { /* IMS implementation for PDN2 - Emergency call */ + var INVITE_Request v_InviteRequest; + timer t_RegExpire; + + f_IMS_PTC_Init(PDN_2); + + f_IMS_IMS_WaitForTrigger(OtherPDN); + + f_IMS_TestBody_Set(true); + + //@siclog "Steps 1-15" siclog@ + f_IMS_CC_StartCall(IPCAN_EmergencyCall_NormalService); // steps 1-15 of 4.5A.4 + + t_RegExpire.start(f_IMS_SetTimerToleranceMax(100.0)); + // The UE shall not send IMS emergency reregistration within 110 seconds from the IMS emergency registration done within step 1. + f_IMS_EmergencyRegistration_C20(-, "100"); + v_InviteRequest := f_IMS_EmergencyCallSetup_AnnexC22(); + + // Wait 20 seconds + f_Delay(20.0); + //@siclog "Steps 16-17" siclog@ + f_IMS_EmergencyCallRelease(v_InviteRequest); + + // Wait for checking that the UE does not attempt a new re-registration (see 19.10.5) + t_RegExpire.timeout; + f_IMS_PreliminaryPass(__FILE__, __LINE__, ""); + + f_IMS_TestBody_Set(false); + + f_IMS_IMS_SendCoOrdMsg(OtherPDN); // @sic R5-140039 sic@ + } +} diff --git a/IMS_PART4_IWD_15wk38/IMS/20/IMS_CustomizedAlertingTonesTestcases.ttcn b/IMS_PART4_IWD_15wk38/IMS/20/IMS_CustomizedAlertingTonesTestcases.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b6120cfe792aecda328a54f26bbf9fe09f9f0f8c --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/20/IMS_CustomizedAlertingTonesTestcases.ttcn @@ -0,0 +1,139 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-16 20:33:09 +0200 (Wed, 16 Sep 2015) $ +// $Rev: 14474 $ +/******************************************************************************/ +module IMS_CustomizedAlertingTonesTestcases { + + import from LibSip_Common all; + import from LibSip_SIPTypesAndValues all; + import from LibSip_SDPTypes all; + import from IMS_Component all; + import from IMS_ASP_TypeDefs all; + import from IMS_ASP_Templates all; + import from IMS_CommonParameters all; + import from IMS_CommonTemplates all; + import from IMS_CommonDefs all; + import from IMS_SIP_Templates all; + import from IMS_MessageBody_Templates all; + import from IMS_SDP_Templates all; + import from IMS_SDP_Messages all; + import from IMS_CC_CommonFunctions all; + import from IMS_Procedures_CallControl all; + import from IMS_CommonFunctions all; + import from IMS_PTC_CoordMsg all; + + //============================================================================ + // local aux. functions + //---------------------------------------------------------------------------- + + /* + * @desc return template for SDP message at step 9 according to 34.229-1 (derived from f_IMS_BuildSDP_AnnexC21_Step4) + * @param p_SDP_MessageInvite + * @return template (value) SDP_Message + * @status APPROVED (IMS) + */ + function fl_IMS_BuildSDP_CAT_Step9(SDP_Message p_SDP_MessageInvite) runs on IMS_PTC return template (value) SDP_Message + { /* @sic R5s150714: optimization see 4.4 sic@ */ + var boolean v_PreconditionsRequired := false; /* to be added later on */ + var template (value) SDP_Message v_SDP_Message := f_IMS_BuildSDP_AnnexC21_Step4(p_SDP_MessageInvite, v_PreconditionsRequired); + var template (omit) SDP_attribute_list v_SDP_MediaAttributes; + var template (omit) SDP_attribute_list v_SDP_PrecondionAttributes; + + v_SDP_PrecondionAttributes := cs_SDP_PrecondionAttributes(c_sendrecv, c_none, c_mandatory, c_mandatory); + v_SDP_PrecondionAttributes := f_SDP_Attributes_Add_TX(v_SDP_PrecondionAttributes, cs_SDP_Attribute_conf_qos); + + v_SDP_MediaAttributes := f_SDP_Attributes_Add_TX(v_SDP_Message.media_list[0].attributes, cs_SDP_Attribute_content("g.3gpp.cat")); + v_SDP_Message.media_list[0].attributes := f_SDP_Attributes_Concat_TX(v_SDP_MediaAttributes, v_SDP_PrecondionAttributes); + + return v_SDP_Message; + } + + /* + * @desc 34.229-1 CAT 20.1.4, Step 9: send 183 Session In Progress (derived from f_IMS_MOCallSetup_AnnexC21_Step4) + * return MessageHeader of the 183 response + * @param p_InviteRequestWithSdp + * @param p_ContactUri (default value: px_IMS_CalleeContactUri) + * @param p_AditionalContactParams (default value: omit) + * @param p_IsEmergency (default value: NO_EMERGENCY) + * @return MessageHeader + * @status APPROVED (IMS) + */ + function fl_IMS_MOCallSetup_CAT_Step9(IMS_InviteRequestWithSdp_Type p_InviteRequestWithSdp, + charstring p_ContactUri := px_IMS_CalleeContactUri, + template (omit) SemicolonParam_List p_AditionalContactParams := omit, + IMS_Emergency_Type p_IsEmergency := NO_EMERGENCY) runs on IMS_PTC return MessageHeader + { /* @sic R5-142951: tsc_OptionTagList_precondition to be added to the Require header instead of the Supported header sic@ */ + var boolean v_Earlymedia := true; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(p_InviteRequestWithSdp.RoutingInfo); + var INVITE_Request v_InviteRequest := p_InviteRequestWithSdp.Invite; + var SDP_Message v_SDP_MessageInvite := p_InviteRequestWithSdp.SdpOffer; /* @sic R5w140112 sic@ */ + var template (value) MessageHeader v_MessageHeader_Response183; + var template (value) SDP_Message v_SDP_MessageTx := fl_IMS_BuildSDP_CAT_Step9(v_SDP_MessageInvite); /* @sic R5-135020 sic@ */ + // Step 4. Send 183 Session In Progress. + v_MessageHeader_Response183 := f_IMS_InviteResponse_183_MessageHeaderTX(v_InviteRequest, tsc_OptionTagList_precondition, p_ContactUri, p_AditionalContactParams, p_IsEmergency, -, v_Earlymedia); //CAT specific + v_MessageHeader_Response183.toField.toParams[0].paramValue.tokenOrHost := "xyzTC20_1-INVITE-Totag"; /* @sic R5s150714: dialog 2 setting see 4.2 sic@ */ + f_IMS_PTC_ImsInfo_DialogSetLocalTag("xyzTC20_1-INVITE-Totag"); + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine183, v_MessageHeader_Response183, cs_MessageBody_SDP(v_SDP_MessageTx)))); + + return valueof(v_MessageHeader_Response183); + } + + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 20.1 + * @status APPROVED (IMS) + */ + function f_TC_20_1_IMS() runs on IMS_PTC + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; /* @sic R5w140112: IMS_InviteRequestWithSdp_Type instead of IMS_DATA_REQ */ + var MessageHeader v_MessageHeader_Response183; + var boolean v_IsCAT := true; + + f_IMS_CC_Preamble(IPCAN_SpeechCall, IMS_REGISTERED); + + f_IMS_TestBody_Set(true); + + // @siclog "Step 1" siclog@ + f_IMS_CC_StartCall(IPCAN_MO_SpeechCall); + + // @siclog "Step 2" siclog@ + v_InviteRequestWithSdp := f_IMS_MOCallSetup_AnnexC21_Step2_A4(); + + // @siclog "Step 3 - 4" siclog@ + v_MessageHeader_Response183 := f_IMS_MOCallSetup_AnnexC21_Step3_4(v_InviteRequestWithSdp); /* @sic R5w140112 sic@ */ + + // See TS. 36.508 EUTRA/EPS signalling for IMS MO speech call Table 4.5A.6.3-1 Step 9-11 + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MO_SpeechCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + + // Step 5 - 8 (TC 12.12 / C.21) + f_IMS_MOCallSetup_AnnexC21_Steps5_8(v_InviteRequestWithSdp, v_MessageHeader_Response183, false, -, NO_EMERGENCY); //@sic R5s141155 change 3 sic@ + + // Step 9 - 13 (Setup dialog 2): modified Step 4 - 8 (C.21) + /* @sic R5s150714: dialog setting see 4.1 sic@ */ + f_IMS_PTC_ImsInfo_ActivateDialog(secondDialog); + f_IMS_PTC_ImsInfo_DialogInit(dialogRemote, v_InviteRequestWithSdp.Invite.msgHeader); + f_IMS_PTC_ImsInfo_CseqSet(dialogRemote, v_InviteRequestWithSdp.Invite.msgHeader.cSeq.seqNumber); + + v_MessageHeader_Response183 := fl_IMS_MOCallSetup_CAT_Step9(v_InviteRequestWithSdp, "sip:cat-as.home1.net", {cs_GenericParam_Common(tsc_IMS_FeatureParamId_3gpp_icsi_ref, cs_GenValueQuoted(cs_IMS_EncodedFeatureParamValue_3gpp_icsi_ref))}, NO_EMERGENCY); + f_IMS_MOCallSetup_AnnexC21_Steps5_8(v_InviteRequestWithSdp, v_MessageHeader_Response183, false, -, NO_EMERGENCY, v_IsCAT); //@sic R5s141155 change 3 sic@ + + // Steps 14-15 (Step 12 - 13 of C.21) + /* @sic R5s150714: dialog setting see 4.1 sic@ */ + f_IMS_PTC_ImsInfo_ActivateDialog(firstDialog); // Signalling continues on first dialog + f_IMS_MOCallSetup_AnnexC21C25_Step12_13(v_InviteRequestWithSdp, px_IMS_CalleeContactUri); + + // @siclog "Step 16 - 18 (TC 20.1) from Step 14 - 15 (TC 12.12)" + f_IMS_CallReleaseMO(v_InviteRequestWithSdp.Invite); /* @sic R5-134116: parameter p_RecordRouteOfPrevResponse removed sic@ */ + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MO_SpeechCall); + } + +} diff --git a/IMS_PART4_IWD_15wk38/IMS/6/IMS_CC_PDPContextActivationTestcases.ttcn b/IMS_PART4_IWD_15wk38/IMS/6/IMS_CC_PDPContextActivationTestcases.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e7b6e19afcbba53e58b63d2078e5297fa9c2f106 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/6/IMS_CC_PDPContextActivationTestcases.ttcn @@ -0,0 +1,60 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-17 10:15:40 +0200 (Thu, 17 Sep 2015) $ +// $Rev: 14477 $ +/******************************************************************************/ + +module IMS_CC_PDPContextActivationTestcases { + + import from NAS_CommonTypeDefs all; + import from IMS_Component all; + import from IMS_Procedures_Registration all; + import from IMS_PTC_CoordMsg all; + + import from IMS_CC_CommonFunctions all; + import from IMS_CC_IPCAN_Coordination all; + import from IMS_CC_PCO_Handling all; + + /* ************************************************************************** */ + /* + * @desc REFERENCE TS 34.229-1 clause 6.3 + * @status APPROVED (IMS) + */ + function f_TC_6_3_IMS() runs on IMS_PTC + { + var NAS_ProtocolConfigOptions_Type v_ConfigOptionsRx; + var template (value) NAS_ProtocolConfigOptions_Type v_ConfigOptionsTx; + + f_IMS_CC_Preamble(IPCAN_SignallingOnly, IMS_NULL); // @sic R5s150786 sic@ + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + + f_IMS_TestBody_Set(true); + v_ConfigOptionsRx := f_IMS_IPCAN_WaitForPCOs(IPCAN); + // Step 1 - UE sends this PDU by setting the IM CN Subsystem Signalling Flag + // to the GGSN within theProtocol Configuration Options IE + // @siclog "Step 1" siclog@ + if (not f_ProtocolConfigOptions_Check(v_ConfigOptionsRx, tsc_ConfigOptions_IM_CN_SubsystemFlag)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Step 1"); + } else { + f_IMS_PreliminaryPass(__FILE__, __LINE__, "Step 1"); + } + // Step 2 - IM CN Subsystem Signalling Flag is provided to the UE + // Note: Setting this flag in the PCOs is the only difference to test 6.2. + // @siclog "Step 2" siclog@ + v_ConfigOptionsTx := f_IMS_CC_ProtocolConfigOption_GetResponse(v_ConfigOptionsRx); + f_IMS_IPCAN_SendPCOs(IPCAN, v_ConfigOptionsTx); + + // Steps 3 to 5 - Implicitly tested + // @siclog "Step 3 - 5" siclog@ + f_IMS_Registration(); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_InitialRegistration); + } +} diff --git a/IMS_PART4_IWD_15wk38/IMS/7/IMS_CC_P_CSCFDiscoveryTestcases.ttcn b/IMS_PART4_IWD_15wk38/IMS/7/IMS_CC_P_CSCFDiscoveryTestcases.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..86f9d95aa80526b89bc6ea4ebec34665982097e3 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/7/IMS_CC_P_CSCFDiscoveryTestcases.ttcn @@ -0,0 +1,61 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-17 10:15:40 +0200 (Thu, 17 Sep 2015) $ +// $Rev: 14477 $ +/******************************************************************************/ + +module IMS_CC_P_CSCFDiscoveryTestcases { + + import from NAS_CommonTypeDefs all; + import from IMS_Component all; + import from IMS_Procedures_Registration all; + import from IMS_PTC_CoordMsg all; + + import from IMS_CC_CommonFunctions all; + import from IMS_CC_IPCAN_Coordination all; + import from IMS_CC_PCO_Handling all; + + /****************************************************************************/ + /* + * @desc REFERENCE TS 34.229-1 clause 7.1 + * @status APPROVED (IMS) + */ + function f_TC_7_1_IMS() runs on IMS_PTC + { + var NAS_ProtocolConfigOptions_Type v_ConfigOptionsRx; + var template (value) NAS_ProtocolConfigOptions_Type v_ConfigOptionsTx; + + f_IMS_CC_Preamble(IPCAN_SignallingOnly, IMS_NULL); // @sic R5s150786 sic@ + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + + f_IMS_TestBody_Set(true); + // @siclog "Step 1" siclog@ + v_ConfigOptionsRx := f_IMS_IPCAN_WaitForPCOs(IPCAN); + // Step 1 + if ( + (not f_ProtocolConfigOptions_Check(v_ConfigOptionsRx, tsc_ConfigOptions_P_CSCF_IPv6_Request)) and + (not f_ProtocolConfigOptions_Check(v_ConfigOptionsRx, tsc_ConfigOptions_P_CSCF_IPv4_Request))) { // @sic CR R5s120530 TODO: Prose CR needed sic@ + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Step 1"); + } else { + f_IMS_PreliminaryPass(__FILE__, __LINE__, "Step 1"); + } + // Step 2 + // @siclog "Step 2" siclog@ + v_ConfigOptionsTx := f_IMS_CC_ProtocolConfigOption_GetResponse(v_ConfigOptionsRx); + f_IMS_IPCAN_SendPCOs(IPCAN, v_ConfigOptionsTx); + + // Steps 3 to 4 + // @siclog "Step 3 - 4" siclog@ + f_IMS_Registration(); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_InitialRegistration); + } + +} diff --git a/IMS_PART4_IWD_15wk38/IMS/8/IMS_CC_RegistrationTestcases.ttcn b/IMS_PART4_IWD_15wk38/IMS/8/IMS_CC_RegistrationTestcases.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e8befa057956894b52d2f4a149041874093e768e --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/8/IMS_CC_RegistrationTestcases.ttcn @@ -0,0 +1,463 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-11 10:39:38 +0200 (Fri, 11 Sep 2015) $ +// $Rev: 14283 $ +/******************************************************************************/ + +module IMS_CC_RegistrationTestcases { + + import from LibSip_SIPTypesAndValues all; + import from IMS_Component all; + import from IMS_ASP_TypeDefs all; + import from IMS_ASP_Templates all; + import from IMS_CommonDefs all; + import from IMS_SIP_Templates all; + import from IMS_XML_Templates all; + import from IMS_CC_CommonFunctions all; + import from IMS_CommonFunctions all; + import from IMS_Procedures_Registration all; + import from IMS_Procedures_Common all; + import from UpperTesterFunctions all; + import from IMS_PTC_CoordMsg all; + import from IMS_CommonParameters all; + import from IMS_CC_Parameters all; + import from CommonDefs all; + + //============================================================================ + + template (value) MinExpires cs_MinExpires (DeltaSec p_DeltaSec) := + { /* @status APPROVED (IMS) */ + fieldName := MIN_EXPIRES_E, + deltaSec := p_DeltaSec + }; + + /* + * @desc 423 Interval Too Brief for REGISTER (see TS 34.229, A.1.7) + * @param p_RegisterRequest + * @param p_DeltaSec + * @return template (value) MessageHeader + * @status APPROVED (IMS) + */ + function f_IMS_RegisterResponse_423_MessageHeaderTX(REGISTER_Request p_RegisterRequest, + DeltaSec p_DeltaSec) runs on IMS_PTC return template (value) MessageHeader + { + var MessageHeader v_MessageHeader_Register := p_RegisterRequest.msgHeader; + var template (value) MessageHeader v_MessageHeader_Response := cs_MessageHeader_Dummy; + + v_MessageHeader_Response.via := v_MessageHeader_Register.via; + v_MessageHeader_Response.toField := f_IMS_Response_ToHeaderTX(v_MessageHeader_Register); /* @sic R5-131897, R5-132063 - generic handling of to-tags sic@ */ + v_MessageHeader_Response.fromField := v_MessageHeader_Register.fromField; + v_MessageHeader_Response.callId := v_MessageHeader_Register.callId; + v_MessageHeader_Response.sessionId := v_MessageHeader_Register.sessionId; /* @sic R5s130195 BASELINE MOVING 2013 - SessionId sic@ */ + v_MessageHeader_Response.cSeq := v_MessageHeader_Register.cSeq; + v_MessageHeader_Response.minExpires := cs_MinExpires(p_DeltaSec); + + return v_MessageHeader_Response; + } + + template (value) Unsupported cs_Unsupported := + { + fieldName := UNSUPPORTED_E, + optionsTags := {"sec-agree"} + }; + + /****************************************************************************/ + /* + * @desc REFERENCE TS 34.229-1 clause 8.1 + * @status APPROVED (IMS) + */ + function f_TC_8_1_IMS() runs on IMS_PTC + { + var REGISTER_Request v_RegisterReq; + + f_IMS_CC_Preamble(IPCAN_SignallingOnly, IMS_NULL, IMS_Security); + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + + f_IMS_TestBody_Set(true); + // Steps 1 to 4 + // @siclog "Step 1 - 4" siclog@ + v_RegisterReq := f_IMS_Register_NonGIBA(); + // Steps 5 to 8 + // @siclog "Step 5 - 8" siclog@ + f_IMS_Register_SubscribeNotify(v_RegisterReq); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_InitialRegistration); + } + + /****************************************************************************/ + /* + * @desc Re-registration for test case 8.2 + * @param p_TRegExpireMin + * @param p_TRegExpireMax + * @param p_PrevSecurityClientParams + * @param p_Nc + * @param p_NextExpiration + * @param p_ReRegistrationTime + * @return SecurityClientParams_Type + * @status APPROVED (IMS) + */ + function fl_TC_8_2_ReRegistration(timer p_TRegExpireMin, + timer p_TRegExpireMax, + SecurityClientParams_Type p_PrevSecurityClientParams, + integer p_Nc, + charstring p_NextExpiration, + template (omit) float p_ReRegistrationTime := omit) runs on IMS_PTC return SecurityClientParams_Type + { /* @sic R5s130266 change 1.2 - MCC160 Implementation: upper, lower bound for TRegExpire sic@ */ + /* @sic R5-132038 sic@ */ + var IMS_DATA_REQ v_IMS_DATA_REQ; + var REGISTER_Request v_RegisterReq; + var SecurityClientParams_Type v_SecurityClientParams; + var float v_ReRegistrationTime; + + f_IMS_CC_StartSignalling(IPCAN_MO_IMS_Signalling); + + v_IMS_DATA_REQ := f_IMS_PTC_ReRegistration_WaitForRegistration(p_TRegExpireMin, p_TRegExpireMax, p_Nc); + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + v_SecurityClientParams := f_IMS_PTC_ReRegistration_SecurityClientParamsCheck(v_RegisterReq, p_PrevSecurityClientParams); + + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo), + cs_Response(c_statusLine200, f_IMS_RegisterResponse_200_MessageHeaderTX(v_RegisterReq, -, p_NextExpiration)))); + + if (isvalue(p_ReRegistrationTime)) { + v_ReRegistrationTime := valueof(p_ReRegistrationTime); + p_TRegExpireMin.start(f_IMS_SetTimerToleranceMin(v_ReRegistrationTime)); + p_TRegExpireMax.start(f_IMS_SetTimerToleranceMax(v_ReRegistrationTime)); + } + f_IMS_CC_ReleaseConnection(IPCAN_MO_IMS_Signalling); + + return v_SecurityClientParams; + } + + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 8.2 + * @status APPROVED (IMS) + */ + function f_TC_8_2_IMS() runs on IMS_PTC + { + var REGISTER_Request v_RegisterReq; + var SecurityClientParams_Type v_SecurityClientParams; + var charstring v_Expiration; + var integer v_Nc; + var float v_ReRegistrationTime; + timer t_TRegExpireMin; // @sic R5s130266 change 1.2 - MCC160 Implementation sic@ + timer t_TRegExpireMax; // @sic R5s130266 change 1.2 - MCC160 Implementation sic@ + + f_IMS_CC_Preamble(IPCAN_SignallingOnly, IMS_NULL, IMS_Security); + + f_IMS_TestBody_Set(true); + + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + + // STEP 1 - 8 + v_Expiration := "120"; + v_ReRegistrationTime := 60.0; + // @siclog "Step 1 - 4" siclog@ + v_RegisterReq := f_IMS_Register_NonGIBA(-, v_Expiration); // Steps 1-4 + t_TRegExpireMin.start(f_IMS_SetTimerToleranceMin(v_ReRegistrationTime)); + t_TRegExpireMax.start(f_IMS_SetTimerToleranceMax(v_ReRegistrationTime)); + // @siclog "Step 5 - 8" siclog@ + f_IMS_Register_SubscribeNotify(v_RegisterReq); // Steps 5-8 + + v_SecurityClientParams := f_IMS_PTC_ReRegistration_SecurityClientParamsGet(); /* security parameters as used due to authentication + @sic R5-132038: there is no re-authentication i.e. security parameters are as configured after step 3 sic@ */ + f_IMS_CC_ReleaseConnection(IPCAN_InitialRegistration); + + // STEP 9, 10 + v_Nc := 2; + v_Expiration := "1200"; + v_ReRegistrationTime := 600.0; + // @siclog "Step 9 - 10" siclog@ + fl_TC_8_2_ReRegistration(t_TRegExpireMin, t_TRegExpireMax, v_SecurityClientParams, v_Nc, v_Expiration, v_ReRegistrationTime); /* @sic R5-132038: v_SecurityClientParams does not get re-assigned sic@ */ + + // STEP 11, 12 + v_Nc := 3; + v_Expiration := "1800"; + v_ReRegistrationTime := 1200.0; + // @siclog "Step 11 - 12" siclog@ + fl_TC_8_2_ReRegistration(t_TRegExpireMin, t_TRegExpireMax, v_SecurityClientParams, v_Nc, v_Expiration, v_ReRegistrationTime); /* @sic R5-132038: v_SecurityClientParams does not get re-assigned sic@ */ + + // STEP 13, 14 + v_Nc := 4; + // @siclog "Step 13 -14" siclog@ + fl_TC_8_2_ReRegistration(t_TRegExpireMin, t_TRegExpireMax, v_SecurityClientParams, v_Nc, tsc_IMS_RegisterExpiration); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(); // NOTE: conection is already released in fl_TC_8_2_ReRegistration + } + + /****************************************************************************/ + /* + * @desc REFERENCE TS 34.229-1 clause 8.3 + * @status APPROVED (IMS) + */ + function f_TC_8_3_IMS() runs on IMS_PTC + { + f_IMS_CC_Preamble(IPCAN_SignallingOnly, IMS_REGISTERED, IMS_Security); + + f_IMS_TestBody_Set(true); + + f_IMS_CC_StartSignalling(IPCAN_MO_IMS_Signalling); // prepare IPCAN to wait for RRC connection establishment + f_UT_IMS_Deregister(MMI); + + // Steps 1 and 2 + // Receive REGISTER with Expires header set to 0 + // @siclog "Step 1 - 2" siclog@ + f_IMS_PTC_Deregistration(); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_MO_IMS_Signalling, false); /* @sic R5s130901: handling of de-registration sic@ */ + } + + /****************************************************************************/ + /* + * @desc REFERENCE TS 34.229-1 clause 8.4 + * @status APPROVED (IMS) + */ + function f_TC_8_4_IMS() runs on IMS_PTC + { + var IMS_DATA_REQ v_IMS_DATA_REQ; + var REGISTER_Request v_RegisterReq; + var charstring v_RegisterExpiration := "800000"; + var integer v_CseqStep1; + var integer v_CseqStep3; + var SipUrl v_ContactUrl; + + f_IMS_CC_Preamble(IPCAN_SignallingOnly, IMS_NULL, IMS_Security); + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + + f_IMS_TestBody_Set(true); + + // Step 1 + // @siclog "Step 1" siclog@ + v_IMS_DATA_REQ := f_IMS_REGISTER_InitialRequest(); + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + v_CseqStep1 := v_RegisterReq.msgHeader.cSeq.seqNumber; + + // Step 2 + // @siclog "Step 2" siclog@ + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo), cs_Response(c_statusLine423, f_IMS_RegisterResponse_423_MessageHeaderTX(v_RegisterReq, v_RegisterExpiration)))); + + // Step 3 - UE repeats the Register Request + // @siclog "Step 3" siclog@ + v_IMS_DATA_REQ := f_IMS_REGISTER_InitialRequest(-, v_RegisterExpiration); // @sic R5s120945 sic@ + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + v_CseqStep3 := v_RegisterReq.msgHeader.cSeq.seqNumber; + + if (v_CseqStep1 + 1 != v_CseqStep3) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "invalid 'seqNumber'"); + } + + // Continue with Annex C.2 steps 5 to 11 + // @siclog "Step 11 - 18" siclog@ + f_IMS_Register_SecurityInit(v_RegisterReq); + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo), cs_Response(c_statusLine401, f_IMS_RegisterResponse_401_MessageHeaderTX(v_RegisterReq)))); + + v_IMS_DATA_REQ := f_IMS_REGISTER_SubsequentRequest(-, -, -, v_RegisterExpiration); // @sic R5s120945 sic@ + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo), cs_Response(c_statusLine200, f_IMS_RegisterResponse_200_MessageHeaderTX(v_RegisterReq, -, v_RegisterExpiration)))); // @sic R5-130548 sic@ + + // Complete the registratrion procedure + v_ContactUrl := f_MessageHeader_GetContactSipUrl(v_RegisterReq.msgHeader); + + // Steps 8 and 9 + v_IMS_DATA_REQ := f_IMS_SUBSCRIBE_Request(); // @sic R5-130548 R5-131875 sic@ + f_IMS_SUBSCRIBE_Response(regEventDialog, v_IMS_DATA_REQ); // @sic R5-130548 R5-131875 sic@ + + // Steps 10 and 11 + f_IMS_Register_Notify(v_ContactUrl, f_IMS_XmlMessageForNotify_Def(v_RegisterReq)); /* @sic R5-130548 R5-131875 sic@ + @sic R5-153756, R5-153986: p_SubscribeRequest and p_CseqValue removed sic@ */ + f_IMS_TestBody_Set(false); + f_IMS_CC_Postamble(IPCAN_InitialRegistration); + } + + /* ************************************************************************** */ + // Test case 8.14 - See 34.229-1 clause 8.14 + function f_TC_8_14_IMS() runs on IMS_PTC + { + var REGISTER_Request v_RegisterReq; + var SipUrl v_ContactUrl; + var template (value) RegInfo_Registration_Type v_Registration; + + // @siclog "Step 1" siclog@ + f_IMS_CC_Preamble(IPCAN_SignallingOnly, IMS_NULL, IMS_Security); + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + + f_IMS_TestBody_Set(true); + + // Steps 2. Register only the first IMPU + v_RegisterReq := f_IMS_Register_NonGIBA(); + f_IMS_Register_Subscribe(); + v_ContactUrl := f_MessageHeader_GetContactSipUrl(v_RegisterReq.msgHeader); + // @siclog "Step 2" siclog@ + v_Registration := f_XML_RegistrationInfo(v_RegisterReq, f_IMS_PTC_ImsInfo_GetURI(firstId), "a100", "980", active, registered); + f_IMS_Register_Notify(v_ContactUrl, f_XML_RegInfo(full, 0, {v_Registration})); /* @sic R5-153756, R5-153986: p_SubscribeRequest and p_CseqValue removed sic@ */ + + // Steps 3 and 4. Registration of second IMPU + f_UT_IMS_Trigger2ndIMPU(MMI); + v_RegisterReq := f_IMS_Register_NonGIBA(); + f_IMS_Register_Subscribe(); + v_ContactUrl := f_MessageHeader_GetContactSipUrl(v_RegisterReq.msgHeader); + // @siclog "Step 3 -4" siclog@ + v_Registration := f_XML_RegistrationInfo(v_RegisterReq, f_IMS_PTC_ImsInfo_GetURI(secondId), "a102", "982", active, registered); + f_IMS_Register_Notify(v_ContactUrl, f_XML_RegInfo(partial, 1, {v_Registration})); /* @sic R5-153756, R5-153986: p_SubscribeRequest and p_CseqValue removed sic@ */ + + // Steps 5 and 6. Registration of third IMPU + // @siclog "Step 5 - 6" siclog@ + f_UT_IMS_Trigger3rdIMPU(MMI); + v_RegisterReq := f_IMS_Register_NonGIBA(); + f_IMS_Register_Subscribe(); + v_ContactUrl := f_MessageHeader_GetContactSipUrl(v_RegisterReq.msgHeader); + + v_Registration := f_XML_RegistrationInfo(v_RegisterReq, f_IMS_PTC_ImsInfo_GetURI(thirdId), "a103", "983", active, registered); + f_IMS_Register_Notify(v_ContactUrl, f_XML_RegInfo(partial, 2, {v_Registration})); /* @sic R5-153756, R5-153986: p_SubscribeRequest and p_CseqValue removed sic@ */ + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_InitialRegistration); + } + + //---------------------------------------------------------------------------- + /* + * @desc REFERENCE TS 34.229-1 clause 8.16 + * @status APPROVED (IMS) + */ + function f_TC_8_16_IMS() runs on IMS_PTC + { + var REGISTER_Request v_RegisterReq; + var SecurityClientParams_Type v_SecurityClientParams; + var charstring v_Expiration; + var integer v_Nc; + var float v_ReRegistrationTime; + var charstring v_RegisterExpiration := "800000"; + var IMS_DATA_REQ v_IMS_DATA_REQ; + var integer v_CseqStep1, v_CseqStep3; + + timer t_TRegExpireMin; + timer t_TRegExpireMax; + + f_IMS_CC_Preamble(IPCAN_SignallingOnly, IMS_NULL, IMS_Security); + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + + f_IMS_TestBody_Set(true); + + v_Expiration := "120"; + v_ReRegistrationTime := 60.0; + + // @siclog "Step 1 - 8" siclog@ + v_RegisterReq := f_IMS_Register_NonGIBA(-, v_Expiration); + t_TRegExpireMin.start(f_IMS_SetTimerToleranceMin(v_ReRegistrationTime)); + t_TRegExpireMax.start(f_IMS_SetTimerToleranceMax(v_ReRegistrationTime)); + + f_IMS_Register_SubscribeNotify(v_RegisterReq); + + v_SecurityClientParams := f_IMS_PTC_ReRegistration_SecurityClientParamsGet(); /* security parameters as used due to authentication + @sic R5-132038: there is no re-authentication i.e. security parameters are as configured after step 3 sic@ */ + f_IMS_CC_ReleaseConnection(IPCAN_InitialRegistration); + + // @siclog "Step 9" siclog@ + v_Nc := 2; + v_Expiration := "1200"; + v_ReRegistrationTime := 600.0; + + f_IMS_CC_StartSignalling(IPCAN_MO_IMS_Signalling); + + v_IMS_DATA_REQ := f_IMS_PTC_ReRegistration_WaitForRegistration(t_TRegExpireMin, t_TRegExpireMax, v_Nc); + + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + v_CseqStep1 := v_RegisterReq.msgHeader.cSeq.seqNumber; + f_IMS_PTC_ReRegistration_SecurityClientParamsCheck(v_RegisterReq, v_SecurityClientParams); + + // @siclog "Step 10" siclog@ + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo), cs_Response(c_statusLine423, f_IMS_RegisterResponse_423_MessageHeaderTX(v_RegisterReq, v_RegisterExpiration)))); + + // @siclog "Step 11" siclog@ + v_IMS_DATA_REQ := f_IMS_REGISTER_SubsequentRequest(-, -, 3, v_RegisterExpiration); + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + v_CseqStep3 := v_RegisterReq.msgHeader.cSeq.seqNumber; + + if (v_CseqStep1 + 1 != v_CseqStep3) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "Step 11: invalid 'seqNumber'"); + } + + // @siclog "Step 12" siclog@ + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + IMS_Server.send(cas_IMS_DATA_RSP(f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo), cs_Response(c_statusLine200, f_IMS_RegisterResponse_200_MessageHeaderTX(v_RegisterReq, -, v_RegisterExpiration)))); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_InitialRegistration); /* @sic R5s150534 sic@ */ + } + + /****************************************************************************/ + /* + * @desc return Reginfo for NOTIFY message after REFRESH + * @param p_RegisterRequest + * @return template (value) Reginfo_Type + */ + function fl_TC_8_15_Notify_Refresh(REGISTER_Request p_RegisterRequest) runs on IMS_PTC return template (value) Reginfo_Type + { /* @sic R5-130750 sic@ */ + var boolean v_ApplyGRUU := false; /* GRUU is not considered in the test case prose */ + var CharStringList_Type v_PublicUserIdList := f_IMS_PTC_ImsInfo_GetAllIMPUs(); + var template (value) RegInfo_Registration_Type v_Registration1 := f_XML_RegistrationInfo(p_RegisterRequest, v_PublicUserIdList[0], "a100", "980", terminated, deactivated, -, v_ApplyGRUU); + var template (value) RegInfo_Registration_Type v_Registration2 := f_XML_RegistrationInfo(p_RegisterRequest, px_IMS_AssociatedTelUri, "a101", "981", terminated, deactivated, -, v_ApplyGRUU, true); + var template (value) RegInfo_Registration_Type v_Registration3 := f_XML_RegistrationInfo(p_RegisterRequest, v_PublicUserIdList[1], "a102", "982", terminated, deactivated, -, v_ApplyGRUU); + + return f_XML_RegInfo(-, -, cs_RegistrationListOf3 (v_Registration1, v_Registration2, v_Registration3)); + } + + + function f_TC_8_15_IMS() runs on IMS_PTC + { + var REGISTER_Request v_RegisterReq; + var SipUrl v_ContactUrl; + var CharStringList_Type v_PublicUserIdList := f_IMS_PTC_ImsInfo_GetAllIMPUs(); + + f_IMS_CC_Preamble(IPCAN_SignallingOnly, IMS_NULL, IMS_Security); + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + + // Initial conditions (generic test procedure in annex C.2) + // Steps: receive REGISTER, send 401, receive REGISTER, send 200 OK + v_RegisterReq := f_IMS_Register_NonGIBA(); + v_ContactUrl := f_MessageHeader_GetContactSipUrl(v_RegisterReq.msgHeader); + + // Steps: receive SUBSCRIBE, send 200 OK + f_IMS_Register_Subscribe(); + + // Steps: send NOTIFY, receive 200 OK + f_IMS_Register_Notify(v_ContactUrl, f_IMS_XmlMessageForNotify_Def(v_RegisterReq)); /* @sic R5-153756, R5-153986: p_SubscribeRequest and p_CseqValue removed sic@ */ + + f_IMS_TestBody_Set(true); + + // Step 1 + // UT triggers UICC to perform REFRESH + f_UT_IMS_Refresh(MMI, px_IMS_HomeDomainName_Refreshed, px_IMS_Private_UserId_Refreshed, px_IMS_PublicUserIdentity1_Refreshed); + f_Delay(10.0); + + // Steps 2 to 3 + f_IMS_Register_Notify(v_ContactUrl, fl_TC_8_15_Notify_Refresh(v_RegisterReq), cs_SubscriptionState_Terminated); /* @sic R5-153756, R5-153986: p_SubscribeRequest and p_CseqValue removed sic@ */ + + // Step 4 consider new updated IMPU according to clause 8.15.5 + v_PublicUserIdList[0] := px_IMS_PublicUserIdentity1_Refreshed; + f_IMS_PTC_ImsInfo_Refresh(px_IMS_HomeDomainName_Refreshed, px_IMS_Private_UserId_Refreshed, v_PublicUserIdList); + + // Steps: receive REGISTER, send 401, receive REGISTER, send 200 OK + v_RegisterReq := f_IMS_Register_NonGIBA(); + // Steps: receive SUBSCRIBE, send 200 OK + f_IMS_Register_SubscribeNotify(v_RegisterReq); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_InitialRegistration); + } + +} diff --git a/IMS_PART4_IWD_15wk38/IMS/9/IMS_CC_AuthenticationTestcases.ttcn b/IMS_PART4_IWD_15wk38/IMS/9/IMS_CC_AuthenticationTestcases.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..19b5ecd3e752691d478af5893627b241a8d744dd --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/9/IMS_CC_AuthenticationTestcases.ttcn @@ -0,0 +1,285 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-02 11:19:45 +0200 (Wed, 02 Sep 2015) $ +// $Rev: 14152 $ +/******************************************************************************/ + +module IMS_CC_AuthenticationTestcases { + + import from LibSip_Common all; + import from LibSip_SIPTypesAndValues all; + import from IP_ASP_TypeDefs all; + + import from IMS_Component all; + import from IMS_ASP_TypeDefs all; + import from IMS_ASP_Templates all; + import from IMS_CommonDefs all; + import from IMS_SIP_Templates all; + import from NAS_AuthenticationCommon all; + import from IMS_CommonFunctions all; + import from IMS_CommonTemplates all; + import from IMS_Procedures_Registration all; + + import from IMS_PTC_CoordMsg all; + import from IMS_CC_CommonFunctions all; + + + type record of SecurityClientParams_Type SecurityClientParamsList_Type; /* @status APPROVED (IMS) */ + + //---------------------------------------------------------------------------- + + template (present) Authorization cr_Authorization_9_1 := + { /* @status APPROVED (IMS) */ + fieldName := AUTHORIZATION_E, + body := { + { + digestResponse := { + cr_GenericParam_Common("response", cr_GenValue_None), + * + } + } + } + }; + + template (present) Authorization cr_Authorization_9_2(charstring p_Nonce, + charstring p_Opaque) := + { /* @status APPROVED (IMS) */ + fieldName := AUTHORIZATION_E, + body := { + { + digestResponse := { + cr_GenericParam("nonce", p_Nonce), + cr_GenericParam("opaque", p_Opaque), + cr_GenericParam("response", ?), + cr_GenericParam("auts", ?), + * + } + } + } + }; + + //---------------------------------------------------------------------------- + /* + * @desc generate an invalid NONCE + * @param p_AuthenticationError + * @return charstring + * @status APPROVED (IMS) + */ + function fl_GenerateInvalidNonce(AuthenticationError_Type p_AuthenticationError) return charstring + { + var Common_AuthenticationParams_Type v_AuthenticationParams; + + v_AuthenticationParams := f_IMS_AuthenticationInit(tsc_IMS_AuthRAND, p_AuthenticationError); + return f_Bitstring2Base64(v_AuthenticationParams.RandValue & v_AuthenticationParams.AUTN); + } + + /* + * @desc check that spi-c, spi-s and port-c are different than in previous REGISTER requests + * @param p_ListOfPreviousSecurityClientParams + * @param p_RegisterRequest + * @return SecurityClientParamsList_Type + * @status APPROVED (IMS) + */ + function fl_CheckSecurityClientParams(SecurityClientParamsList_Type p_ListOfPreviousSecurityClientParams, + REGISTER_Request p_RegisterRequest) runs on IMS_PTC return SecurityClientParamsList_Type + { + var SecurityClientParams_Type v_CurrentSecurityClientParams := f_IMS_Register_GetSecurityClientParams(p_RegisterRequest); + var SecurityClientParamsList_Type v_ListOfPreviousSecurityClientParams := p_ListOfPreviousSecurityClientParams; + var integer v_NoOfPreviousSecurityClientParams := lengthof(v_ListOfPreviousSecurityClientParams); + var SecurityClientParams_Type v_SecurityClientParams; + var integer i; + + for (i:=0; i < v_NoOfPreviousSecurityClientParams; i:=i+1) { + v_SecurityClientParams := v_ListOfPreviousSecurityClientParams[i]; + if (v_SecurityClientParams.SPI_us == v_CurrentSecurityClientParams.SPI_us or + v_SecurityClientParams.SPI_uc == v_CurrentSecurityClientParams.SPI_uc or + v_SecurityClientParams.Port_uc == v_CurrentSecurityClientParams.Port_uc) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "spi-c, spi-s and port-c shall be different than in previous REGISTER request"); + } + } + v_ListOfPreviousSecurityClientParams[v_NoOfPreviousSecurityClientParams] := v_CurrentSecurityClientParams; + return v_ListOfPreviousSecurityClientParams; + } + + /* + * @desc receive REGISTER with a specific Authorization (given by p_Authorization) + * @param p_CallId + * @param p_Authorization + * @return IMS_DATA_REQ + * @status APPROVED (IMS) + */ + function f_IMS_REGISTER_RequestWithSpecificAuth(charstring p_CallId, + template (present) Authorization p_Authorization) runs on IMS_PTC return IMS_DATA_REQ + { + var IMS_DATA_REQ v_IMS_DATA_REQ; + var MessageHeader v_MessageHeader; + var InternetProtocol_Type v_Protocol; + var template (present) MessageHeader v_MessageHeader_Template; + var integer v_CseqValue := f_IMS_PTC_ImsInfo_CseqIncr(register); + var IP_AddrInfo_Type v_UE_Address := f_IMS_PTC_UE_Address_Get(); + var template (present) SipUrl v_SipUrl := cr_SipUri_HostPort(f_IMS_PTC_ImsInfo_GetHomeDomainName()); + var boolean v_CheckAuthorization; + var boolean v_Match := false; + + IMS_Server.receive(car_IMS_Register_Request(cr_REGISTER_Request(v_SipUrl))) -> value v_IMS_DATA_REQ; // receive any REGISTER + v_MessageHeader := v_IMS_DATA_REQ.Request.Register.msgHeader; + v_Protocol := v_IMS_DATA_REQ.RoutingInfo.Protocol; + + v_MessageHeader_Template := f_IMS_RegisterRequest_MessageHeaderRX_Initial(v_Protocol); // @sic R5s130369 sic@ + // test case specific message contents: + v_MessageHeader_Template.cSeq := cr_CseqDef(v_CseqValue, "REGISTER"); + v_MessageHeader_Template.callId := cr_CallId(p_CallId); + v_MessageHeader_Template.securityVerify := omit; + v_MessageHeader_Template.authorization := p_Authorization; + + v_Match := match(v_MessageHeader, v_MessageHeader_Template); + if (not v_Match) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, "invalid REGISTER Request"); + } + else { + v_CheckAuthorization := false; // Authorization needs to be checked separately + f_IMS_A_1_1_MessageHeader_CommonChecks(v_MessageHeader, v_Protocol, -, v_UE_Address, -, v_CheckAuthorization); + f_IMS_A_1_1_MessageHeader_CheckPublicUserIdentity(v_MessageHeader); // check 'To' and 'From' field (needed for initial registration only) + } + return v_IMS_DATA_REQ; + } + + /****************************************************************************/ + /* + * @desc REFERENCE TS 34.229-1 clause 9.1 + * @status APPROVED (IMS) + */ + function f_TC_9_1_IMS() runs on IMS_PTC + { /* @sic R5-153463: step 6 (403 forbidden) replaced by step 6..12 (completition of registration procedure) sic@ */ + var charstring v_InvalidNonce := fl_GenerateInvalidNonce(macError); // Nonce with invalid MAC + var IMS_DATA_REQ v_IMS_DATA_REQ; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL; + var REGISTER_Request v_RegisterReq; + var charstring v_CallId; + var integer i; + var SecurityClientParamsList_Type v_SecurityClientParamsList; + var template CommaParam_List v_DigestResponseContainingAuts := {cr_GenericParam("auts", ?), *}; + + f_IMS_CC_Preamble(IPCAN_SignallingOnly, IMS_NULL, IMS_Security); + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + + f_IMS_TestBody_Set(true); + + // Step 1 + // @siclog "Step 1" siclog@ + v_IMS_DATA_REQ := f_IMS_REGISTER_InitialRequest(); + v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo); + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + v_CallId := v_RegisterReq.msgHeader.callId.callid; + + f_IMS_Register_SecurityInit(v_RegisterReq); // @sic R5s120947 sic@ + v_SecurityClientParamsList[0] := f_IMS_Register_GetSecurityClientParams(v_RegisterReq); /* @sic R5-144754 sic@ */ + + for (i:=0; i<2; i:=i+1) { + // Step 2/4 + // @siclog "Step 2/4" siclog@ + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine401, f_IMS_RegisterResponse_401_MessageHeaderTX(v_RegisterReq, v_InvalidNonce)))); + + // Step 3/5 + // @siclog "Step 3/5" siclog@ + v_IMS_DATA_REQ := f_IMS_REGISTER_RequestWithSpecificAuth(v_CallId, cr_Authorization_9_1); + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + v_SecurityClientParamsList := fl_CheckSecurityClientParams(v_SecurityClientParamsList, v_RegisterReq); /* @sic R5-144754 sic@ */ + + // Check that digestResponse does not contain (non-empty) "auts" parameter + if (match(v_RegisterReq.msgHeader.authorization.body[0].digestResponse, v_DigestResponseContainingAuts)) { + f_IMS_SetVerdictFailOrInconc(__FILE__, __LINE__, ""); + } else { + f_IMS_PreliminaryPass(__FILE__, __LINE__, ""); + } + } + + // @siclog "Step 6" siclog@ + f_IMS_Register_SecurityInit(v_RegisterReq); + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine401, f_IMS_RegisterResponse_401_MessageHeaderTX(v_RegisterReq)))); + + // @siclog "Step 7" siclog@ + v_IMS_DATA_REQ := f_IMS_REGISTER_SubsequentRequest(); + v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo); /* security has changed to "protected" now */ + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + + // @siclog "Step 8" siclog@ + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine200, f_IMS_RegisterResponse_200_MessageHeaderTX(v_RegisterReq)))); + + // @siclog "Step 9 - 12" siclog@ + f_IMS_Register_SubscribeNotify(v_RegisterReq); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_InitialRegistration); + } + + /****************************************************************************/ + /* + * @desc REFERENCE TS 34.229-1 clause 9.2 + * @status APPROVED (IMS) + */ + function f_TC_9_2_IMS() runs on IMS_PTC + { + var charstring v_InvalidNonce := fl_GenerateInvalidNonce(sqnFailure); + var IMS_DATA_REQ v_IMS_DATA_REQ; + var Common_AuthenticationParams_Type v_AuthenticationParams; + var SecurityClientParamsList_Type v_SecurityClientParamsList; + var template (value) IMS_RoutingInfo_Type v_RoutingInfo_DL; + var REGISTER_Request v_RegisterReq; + var charstring v_CallId; + + f_IMS_CC_Preamble(IPCAN_SignallingOnly, IMS_NULL, IMS_Security); + f_IMS_CC_StartSignalling(IPCAN_InitialRegistration); + + f_IMS_TestBody_Set(true); + + // Step 1 + // @siclog "Step 1" siclog@ + v_IMS_DATA_REQ := f_IMS_REGISTER_InitialRequest(); + v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo); + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + v_CallId := v_RegisterReq.msgHeader.callId.callid; + v_SecurityClientParamsList[0] := f_IMS_Register_GetSecurityClientParams(v_RegisterReq); /* @sic R5-144754 sic@ */ + + // Step 2 + // @siclog "Step 2" siclog@ + /* f_IMS_Register_SecurityInit(v_RegisterReq); @sic R5s130264 Change 2.1: security needs to be initialised just before (first) 401 response is sent sic@ */ + v_AuthenticationParams := f_IMS_AuthenticationInit(tsc_IMS_AuthRAND); + f_IMS_Register_SecurityInitPortsAndSPIs(v_RegisterReq, v_AuthenticationParams); /* @sic R5s131004 - MCC160 implementation sic@ + security needs to be initialised at the IMS PTC otherwise f_IMS_PTC_BuildSecurityServerParam will cause a runtime errror */ + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine401, f_IMS_RegisterResponse_401_MessageHeaderTX(v_RegisterReq, v_InvalidNonce)))); + + // Step 3 + // @siclog "Step 3" siclog@ + v_IMS_DATA_REQ := f_IMS_REGISTER_RequestWithSpecificAuth(v_CallId, cr_Authorization_9_2(v_InvalidNonce, tsc_IMS_Opaque)); + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + v_SecurityClientParamsList := fl_CheckSecurityClientParams(v_SecurityClientParamsList, v_RegisterReq); /* @sic R5-144754 sic@ */ + + // Step 4 + // @siclog "Step 4" siclog@ + f_IMS_Register_SecurityInit(v_RegisterReq); /* @sic R5s130573: IPSec layer needs to be updated acc. to new Security client header sent by the UE sic@ */ + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine401, f_IMS_RegisterResponse_401_MessageHeaderTX(v_RegisterReq)))); + + // Step 5 + // @siclog "Step 5" siclog@ + v_IMS_DATA_REQ := f_IMS_REGISTER_SubsequentRequest(); + v_RoutingInfo_DL := f_IMS_RoutingInfo_ULtoDL(v_IMS_DATA_REQ.RoutingInfo); /* @sic R5s130264 Change 2.2: security has changed to "protected" now sic@ */ + v_RegisterReq := v_IMS_DATA_REQ.Request.Register; + + // Step 6 + // @siclog "Step 6" siclog@ + IMS_Server.send(cas_IMS_DATA_RSP(v_RoutingInfo_DL, cs_Response(c_statusLine200, f_IMS_RegisterResponse_200_MessageHeaderTX(v_RegisterReq)))); + + f_IMS_Register_SubscribeNotify(v_RegisterReq); + + f_IMS_TestBody_Set(false); + + f_IMS_CC_Postamble(IPCAN_InitialRegistration); + } +} diff --git a/IMS_PART4_IWD_15wk38/IMS/Common/IMS_CC_CommonFunctions.ttcn b/IMS_PART4_IWD_15wk38/IMS/Common/IMS_CC_CommonFunctions.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..327969d199610f1d354f0becc731f5f1b54bdcf1 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/Common/IMS_CC_CommonFunctions.ttcn @@ -0,0 +1,265 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-05-25 09:07:10 +0200 (Mon, 25 May 2015) $ +// $Rev: 13594 $ +/******************************************************************************/ + +module IMS_CC_CommonFunctions { + + import from CommonDefs all; + import from IMS_Component all; + import from IMS_CC_IPCAN_Coordination all; + import from IMS_Procedures_Registration all; + import from IMS_Procedures_CallControl all; + import from IMS_Procedures_Common all; + import from IMS_PTC_CoordMsg all; + import from UpperTesterFunctions all; + import from IMS_CommonParameters all; + import from Parameters all; + import from IMS_CommonDefs all; + import from LibSip_SIPTypesAndValues all; + + type enumerated CallType_Type {normalCall, conferenceCall}; /* @status APPROVED (IMS) */ + + //============================================================================ + // postamble / preamble / wrapper functions + //---------------------------------------------------------------------------- + + type enumerated IMS_InitState_Type {IMS_NULL, IMS_REGISTERED}; /* @status APPROVED (IMS) */ + + /* + * @desc common preamble for IMS test cases + * @param p_TestConfiguration + * @param p_InitState + * @param p_SecurityScheme (default value: omit) + * @param p_SigCompIsActive (default value: false) + * @status APPROVED (IMS) + */ + function f_IMS_CC_Preamble(IMS_TestConfiguration_Type p_TestConfiguration, + IMS_InitState_Type p_InitState, + template (omit) IMS_SecurityScheme_Type p_SecurityScheme := omit, + boolean p_SigCompIsActive := false) runs on IMS_PTC + { /* p_TestProcedure .. major test procedure of the test case (=> number/type of DRBs to be configured at SS + * p_InitState .. IDLE => intitial registration including IMS registration is done; RRC connection is released + * NULL => intitial registration is started at the IPCAN but IMS registration shall be controled by the test case */ + /* @sic R5s130133 additional changes: XRES length shall be queried by the IMS PTC i.e. is not returned by f_IMS_IPCAN_StartProcedure_Preamble anymore sic@ */ + /* @sic R5s130347: local GuardTimer sic@ */ + /* @sic R5s130756 additional changes: p_IsGIBA replaced by p_SecurityScheme sic@ */ + + timer t_GuardTimer := tsc_GuardTimePreamble; + + t_GuardTimer.start; + + f_IMS_PTC_Init(PDN_1, -, p_SecurityScheme); /* local initialisation */ + f_IMS_IPCAN_Init(IPCAN, p_TestConfiguration); /* initialisation of IPCAN: + - RAN type is selected by IPCAN PTC acc. to the PIXITs + - cell is created acc. to the RAN type and PIXITs + - Test procedure is handed over as for e.g. EUTRA we need to know in advance which DRBs need to be (pre-)configured at the SS + p_TestcaseName is present If the test case requires a specific IPCAN initialisation e.g. for cell barring */ + if (p_InitState == IMS_REGISTERED) { + f_IMS_IPCAN_StartProcedure(IPCAN, IPCAN_InitialRegistration); + f_IMS_Registration(-, p_SigCompIsActive); + f_IMS_CC_ReleaseConnection(IPCAN_InitialRegistration); + } + + t_GuardTimer.stop; + } + + //---------------------------------------------------------------------------- + /* + * @desc trigger IPCAN to start signalling given for given test procedure + * @param p_TestProcedure + * @status APPROVED (IMS) + */ + function f_IMS_CC_StartSignalling(IMS_TestProcedure_Type p_TestProcedure) runs on IMS_PTC + { /* @sic R5s130133 additional changes: XRES length shall be queried by the IMS PTC i.e. is not returned by f_IMS_IPCAN_StartProcedure_Preamble anymore sic@ */ + + select (p_TestProcedure) { + case (IPCAN_InitialRegistration, IPCAN_MO_IMS_Signalling, IPCAN_XCAP_Signalling) { + f_IMS_IPCAN_StartProcedure(IPCAN, p_TestProcedure); + } + case (IPCAN_MT_IMS_Signalling) { + f_IMS_IPCAN_StartProcedure(IPCAN, p_TestProcedure); + f_IMS_IPCAN_WaitForTrigger(IPCAN); // wait for RRC connection to be established @sic R5s130183 change 3 sic@ + } + case else { + FatalError(__FILE__, __LINE__, ""); + } + } + } + + /* + * @desc Start MO, MT or emergency call (interworking with IPCAN, MMI) + * @param p_TestProcedure + * @param p_SpeechAndVideoCallUri (default value: px_IMS_CalleeUri) + * @param p_CallType (default value: omit) + * @return charstring + * @status APPROVED (IMS) + */ + function f_IMS_CC_StartCall(IMS_TestProcedure_Type p_TestProcedure, + charstring p_SpeechAndVideoCallUri := px_IMS_CalleeUri, + CallType_Type p_CallType := normalCall) runs on IMS_PTC return charstring + { /* @sic new parameters p_SpeechAndVideoCallUri and p_CallType to support conference calls sic@ */ + /* @sic R5-145XXX - test case 17.1: return value for call identification number acc. to 27.007 sic@ */ + var charstring v_CallIdentification := ""; + + f_IMS_IPCAN_StartProcedure(IPCAN, p_TestProcedure); + + select (p_TestProcedure) { + case (IPCAN_MO_SpeechCall) { + select (p_CallType) { + case (normalCall) { + v_CallIdentification := f_UT_RequestIMSCall(MMI, p_SpeechAndVideoCallUri); // @sic R5s130333, R5-134070 sic@ + } + case (conferenceCall) { + f_UT_CallMPTY(MMI); + } + } + } + case (IPCAN_MO_VideoCall) { + f_UT_RequestIMSVideoCall(MMI, p_SpeechAndVideoCallUri); // @sic R5-134070 sic@ + } + case (IPCAN_MT_SpeechCall, IPCAN_MT_VideoCall) { + f_IMS_IPCAN_WaitForTrigger(IPCAN); // wait for RRC connection to be established + } + case (IPCAN_EmergencyCall_NormalService, IPCAN_MO_Speech_EmergencyCall) { // @sic R5s150091 sic@ + f_UT_RequestIMSEmergencyCall(MMI, px_EmergencyCallNumber); // @sic R5-134070 sic@ + } + case else { + FatalError(__FILE__, __LINE__, ""); + } + } + return v_CallIdentification; + } + + /* + * @desc send trigger to IPCAN to abort the ongoing call establishment + * (e.g. when IPCAN is waiting for trigger to continue with bearer establishment but that shall be aborted) + * @status APPROVED (IMS) + */ + function f_IMS_CC_AbortCall() runs on IMS_PTC + { + f_IMS_IPCAN_SendCoOrdMsg(IPCAN, cms_IMS_IPCAN_Abort); + } + + /* + * @desc trigger activation of dedicated bearer at the IPCAN PTC + * @param p_TestProcedure + * @status APPROVED (IMS) + */ + function f_IMS_CC_TriggerDedicatedBearerActivation(IMS_TestProcedure_Type p_TestProcedure) runs on IMS_PTC + { + select (p_TestProcedure) { + case (IPCAN_MO_SpeechCall, IPCAN_MO_VideoCall) { + f_IMS_IPCAN_SendCoOrdMsg(IPCAN); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + } + case (IPCAN_MT_SpeechCall, IPCAN_MT_VideoCall) { + f_IMS_IPCAN_SendCoOrdMsg(IPCAN); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + f_IMS_IPCAN_WaitForTrigger(IPCAN); // wait for completion of RRC/NAS signalling + } + case else { + FatalError(__FILE__, __LINE__, ""); + } + } + } + + //---------------------------------------------------------------------------- + /* + * @desc Release RRC connection + * @param p_TestProcedure + * @param p_TcpCloseHandling (default value: omit) + * @status APPROVED (IMS) + */ + function f_IMS_CC_ReleaseConnection(IMS_TestProcedure_Type p_TestProcedure, + template (omit) IMS_TCP_CloseHandling_Type p_TcpCloseHandling := omit) runs on IMS_PTC + { /* @sic R5s140801: new parameter p_TcpCloseHandling sic@ */ + var IMS_TCP_CloseHandling_Type v_TcpCloseHandling := dontWait; + + if (isvalue(p_TcpCloseHandling )) { /* @sic R5s140801 sic@ */ + v_TcpCloseHandling := valueof(p_TcpCloseHandling ); + } + else{ + select (p_TestProcedure) { + case (IPCAN_InitialRegistration) { /* @sic R5s140219 - MCC160 implementation: wait for possible TCP close of unprotected connection but don't close any further TCP connection sic@ */ + v_TcpCloseHandling := justWait; + } + case else { + } + } + } + if (v_TcpCloseHandling != dontWait) { + f_IMS_TCP_CloseHandling(v_TcpCloseHandling); + } else { + f_Delay(2.0); /* @sic R5s140779: delay to ensure that latest DL SIP message (if any) is sent out before releasing the RRC connection sic@ */ + } + f_IMS_IPCAN_EndProcedure(IPCAN, p_TestProcedure); + } + + //---------------------------------------------------------------------------- + /* + * @desc common postamble for IMS test cases + * @param p_TestProcedure (default value: omit) + * @param p_WaitForDeRegistration (default value: true) + * @param p_TcpCloseHandling (default value: omit) + * @status APPROVED (IMS) + */ + function f_IMS_CC_Postamble(template (omit) IMS_TestProcedure_Type p_TestProcedure := omit, + boolean p_WaitForDeRegistration := true, + template (omit) IMS_TCP_CloseHandling_Type p_TcpCloseHandling := omit) runs on IMS_PTC + { /* @sic R5s140801: new parameter p_TcpCloseHandling sic@ */ + var boolean v_WaitForDeRegistration := pc_SwitchOnOff and p_WaitForDeRegistration; + + if (isvalue(p_TestProcedure)) { + f_IMS_CC_ReleaseConnection(valueof(p_TestProcedure), p_TcpCloseHandling); /* @sic R5s140801: p_TcpCloseHandling sic@ */ + } + IPCAN.send(cms_IMS_IPCAN_ReleaseReq); + + f_IMS_IpcanReleaseWithOptionalDeregistration(v_WaitForDeRegistration); /* @sic R5s140346 - MCC160 implementation: new function f_IMS_CC_IpcanReleaseWithOptionalDeregistrationOr sic@ */ + + } + + //---------------------------------------------------------------------------- + /* + * @desc common call establishement for speech call: signalling only + * @return INVITE_Request + * @status APPROVED (IMS) + */ + function f_IMS_CC_MO_SpeechCall_Signalling() runs on IMS_PTC return INVITE_Request + { + var IMS_InviteRequestWithSdp_Type v_InviteRequestWithSdp; /* @sic R5w140112: IMS_InviteRequestWithSdp_Type instead of IMS_DATA_REQ */ + var MessageHeader v_MessageHeader_Response183; + + // Step 2 + v_InviteRequestWithSdp := f_IMS_MOCallSetup_AnnexC21_Step2_A4(); + + // Step 3, 4 + v_MessageHeader_Response183 := f_IMS_MOCallSetup_AnnexC21_Step3_4(v_InviteRequestWithSdp); /* @sic R5w140112 sic@ */ + + // See TS. 36.508 EUTRA/EPS signalling for IMS MO speech call Table 4.5A.6.3-1 Step 9-11 + f_IMS_CC_TriggerDedicatedBearerActivation(IPCAN_MO_SpeechCall); // trigger IPCAN to continue with activation of secondary PDP context or dedicated EPS bearer + + f_IMS_MOCallSetup_AnnexC21_Steps5_13(v_InviteRequestWithSdp, v_MessageHeader_Response183); + return v_InviteRequestWithSdp.Invite; + } + + //---------------------------------------------------------------------------- + /* + * @desc common call establishement for speech call + * @return INVITE_Request + * @status APPROVED (IMS) + */ + function f_IMS_CC_MO_SpeechCall() runs on IMS_PTC return INVITE_Request + { + // Step 1 + f_IMS_CC_StartCall(IPCAN_MO_SpeechCall); + + // Step 2-13 + return f_IMS_CC_MO_SpeechCall_Signalling(); + } + +} diff --git a/IMS_PART4_IWD_15wk38/IMS/Common/IMS_CC_Component.ttcn b/IMS_PART4_IWD_15wk38/IMS/Common/IMS_CC_Component.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ddcb81c4ca044a3c4bf2fb507b9494356607d0e0 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/Common/IMS_CC_Component.ttcn @@ -0,0 +1,21 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2014-02-01 22:22:56 +0100 (Sat, 01 Feb 2014) $ +// $Rev: 10474 $ +/******************************************************************************/ + +module IMS_CC_Component { + import from IMS_Component all; + import from HTTP_PTC_CoordMsg all; + + type component IMS_XCAP_PTC extends IMS_PTC { /* @status APPROVED (IMS) */ + // ports for XCAP (used by IMS test suite) + port IMS_XCAP_CO_ORD_PORT XCAP; + }; + +} diff --git a/IMS_PART4_IWD_15wk38/IMS/Common/IMS_CC_IPCAN_Coordination.ttcn b/IMS_PART4_IWD_15wk38/IMS/Common/IMS_CC_IPCAN_Coordination.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e9ce28d9f880e85c9a6e1f8d288c83a974c9bf39 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/Common/IMS_CC_IPCAN_Coordination.ttcn @@ -0,0 +1,124 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-04-27 04:04:14 +0200 (Mon, 27 Apr 2015) $ +// $Rev: 13508 $ +/******************************************************************************/ + +module IMS_CC_IPCAN_Coordination { + + import from NAS_CommonTypeDefs all; + import from IMS_PTC_CoordMsg all; + + //============================================================================ + + template (value) IMS_IPCAN_Coordination_MSG cms_IMS_IPCAN_InitReq(IMS_TestConfiguration_Type p_TestConfiguration) := cms_IMS_IPCAN_Command(IPCAN_INIT, p_TestConfiguration); /* @status APPROVED (IMS) */ + template (value) IMS_IPCAN_Coordination_MSG cms_IMS_IPCAN_ConfigReq(IMS_CellConfiguration_Type p_CellConfiguration) := cms_IMS_IPCAN_Command(IPCAN_CONFIG, -, -, p_CellConfiguration); /* @status APPROVED (IMS) */ + template (value) IMS_IPCAN_Coordination_MSG cms_IMS_IPCAN_StartProcedureReq(IMS_TestProcedure_Type p_TestProcedure) := cms_IMS_IPCAN_Command(IPCAN_STARTPROCEDURE, -, p_TestProcedure); /* @status APPROVED (IMS) */ + template (value) IMS_IPCAN_Coordination_MSG cms_IMS_IPCAN_EndProcedureReq(IMS_TestProcedure_Type p_TestProcedure) := cms_IMS_IPCAN_Command(IPCAN_ENDPROCEDURE, -, p_TestProcedure); /* @status APPROVED (IMS) */ + template (value) IMS_IPCAN_Coordination_MSG cms_IMS_IPCAN_ReleaseReq := cms_IMS_IPCAN_Command(IPCAN_RELEASE); /* @status APPROVED (IMS) */ + + //---------------------------------------------------------------------------- + + template (value) IMS_IPCAN_Coordination_MSG cms_IMS_ProtocolConfigurationOptions(template (value) NAS_ProtocolConfigOptions_Type p_ProtocolConfigurationOptions) := + { /* @status APPROVED (IMS) */ + ProtocolConfigOptions := p_ProtocolConfigurationOptions + }; + + template (present) IMS_IPCAN_Coordination_MSG cmr_IMS_ProtocolConfigurationOptions := + { /* @status APPROVED (IMS) */ + ProtocolConfigOptions := ? + }; + + //============================================================================ + /* + * @desc Initialise IPCAN + * @param p_Port + * @param p_TestConfiguration + * @status APPROVED (IMS) + */ + function f_IMS_IPCAN_Init(IMS_IPCAN_CO_ORD_PORT p_Port, + IMS_TestConfiguration_Type p_TestConfiguration) + { /* p_TestConfiguration specifies the DRBs needed by the test cases so that IPCAN can do pre-configuration of DRBs accordingly */ + p_Port.send(cms_IMS_IPCAN_InitReq(p_TestConfiguration)); + alt { + [] p_Port.receive(cmr_IPCAN_IMS_Response) {} + [] a_IMS_IPCAN_Default(p_Port) {} + } + } + + //---------------------------------------------------------------------------- + /* + * @desc trigger IPCAN to modify e.g. SIBs + * @param p_Port + * @param p_CellConfiguration + * @status APPROVED (IMS) + */ + function f_IMS_IPCAN_ModifyConfig(IMS_IPCAN_CO_ORD_PORT p_Port, + IMS_CellConfiguration_Type p_CellConfiguration) + { + p_Port.send(cms_IMS_IPCAN_ConfigReq(p_CellConfiguration)); + f_IMS_IPCAN_WaitForTrigger(p_Port); + } + + //---------------------------------------------------------------------------- + /* + * @desc trigger start of test procedure at the IPCAN PTC (e.g. InitialRegistration, MO Speech Call, etc.) + * @param p_Port + * @param p_TestProcedure + * @status APPROVED (IMS) + */ + function f_IMS_IPCAN_StartProcedure(IMS_IPCAN_CO_ORD_PORT p_Port, + IMS_TestProcedure_Type p_TestProcedure) + { + p_Port.send(cms_IMS_IPCAN_StartProcedureReq(p_TestProcedure)); + } + + //---------------------------------------------------------------------------- + /* + * @desc terminate a (current) test procedure + * @param p_Port + * @param p_TestProcedure + * @status APPROVED (IMS) + */ + function f_IMS_IPCAN_EndProcedure(IMS_IPCAN_CO_ORD_PORT p_Port, + IMS_TestProcedure_Type p_TestProcedure) + { + p_Port.send(cms_IMS_IPCAN_EndProcedureReq(p_TestProcedure)); + f_IMS_IPCAN_WaitForTrigger(p_Port); + } + + //============================================================================ + /* + * @desc Wait for PCOs from IMS/IPCAN PTC + * @param p_Port + * @return NAS_ProtocolConfigOptions_Type + * @status APPROVED (IMS) + */ + function f_IMS_IPCAN_WaitForPCOs(IMS_IPCAN_CO_ORD_PORT p_Port) return NAS_ProtocolConfigOptions_Type + { + var IMS_IPCAN_Coordination_MSG v_CoordinationMsg; + + alt { + [] p_Port.receive(cmr_IMS_ProtocolConfigurationOptions) -> value v_CoordinationMsg {} + [] a_IMS_IPCAN_Default(p_Port) {} + } + return v_CoordinationMsg.ProtocolConfigOptions; + } + + /* + * @desc Send PCOs to the other side (IPCAN PTC) + * @param p_Port + * @param p_ProtocolConfigOptions + * @status APPROVED (IMS) + */ + function f_IMS_IPCAN_SendPCOs(IMS_IPCAN_CO_ORD_PORT p_Port, + template (value) NAS_ProtocolConfigOptions_Type p_ProtocolConfigOptions) + { + f_IMS_IPCAN_SendCoOrdMsg(p_Port, cms_IMS_ProtocolConfigurationOptions(p_ProtocolConfigOptions)); + } +} diff --git a/IMS_PART4_IWD_15wk38/IMS/Common/IMS_CC_PCO_Handling.ttcn b/IMS_PART4_IWD_15wk38/IMS/Common/IMS_CC_PCO_Handling.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2c110810ba99261e408a294af11b7a35aba9c80b --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/Common/IMS_CC_PCO_Handling.ttcn @@ -0,0 +1,83 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-01-18 13:59:16 +0100 (Sun, 18 Jan 2015) $ +// $Rev: 12866 $ +/******************************************************************************/ + +module IMS_CC_PCO_Handling { + import from CommonDefs all; + import from NAS_CommonTypeDefs all; + import from NAS_AuxiliaryDefsAndFunctions all; + + const O2_Type tsc_ConfigOptions_P_CSCF_IPv6_Request := '0001'O; /* @status APPROVED (IMS) */ + const O2_Type tsc_ConfigOptions_IM_CN_SubsystemFlag := '0002'O; /* @status APPROVED (IMS) */ + const O2_Type tsc_ConfigOptions_P_CSCF_IPv4_Request := '000C'O; /* @status APPROVED (IMS) */ + + + //============================================================================ + /* + * @desc Check protocol config options for container id + * @param p_ConfigOptions + * @param p_ContainerId + * @return boolean + * @status APPROVED (IMS) + */ + function f_ProtocolConfigOptions_Check(NAS_ProtocolConfigOptions_Type p_ConfigOptions, + O2_Type p_ContainerId) return boolean + { + var integer i; + + for (i := 0; i < lengthof(p_ConfigOptions); i := i + 1) { + if (p_ConfigOptions[i].protocolID == p_ContainerId) { + return true; + } + } + return false; + } + + //---------------------------------------------------------------------------- + /* + * @desc Evaluate PCOs sent by the UE + * @param p_ConfigOptionsRX + * @return template (value) NAS_ProtocolConfigOptions_Type + * @status APPROVED (IMS) + */ + function f_IMS_CC_ProtocolConfigOption_GetResponse(NAS_ProtocolConfigOptions_Type p_ConfigOptionsRX) return template (value) NAS_ProtocolConfigOptions_Type + { + var boolean v_IgnoreIM_CN_SubsystemSignalingFlag := false; + return f_NAS_GetProtocolConfigOptionList(p_ConfigOptionsRX, -, v_IgnoreIM_CN_SubsystemSignalingFlag); + } + + //---------------------------------------------------------------------------- + +/* function f_ProtocolConfigOption_Remove(NAS_ProtocolConfigOptions_Type p_ConfigOptList, */ +/* O2_Type p_ContainerId) return NAS_ProtocolConfigOptions_Type */ +/* { */ +/* var NAS_ProtocolConfigOptions_Type v_ConfigOptList := {}; */ +/* var integer i; */ +/* var integer k := 0; */ + +/* for (i := 0; i < lengthof(p_ConfigOptList); i := i + 1) { */ +/* if (p_ConfigOptList[i].protocolID != p_ContainerId) { */ +/* v_ConfigOptList[k] := p_ConfigOptList[i]; */ +/* k := k + 1; */ +/* } */ +/* } */ +/* return v_ConfigOptList; */ +/* } */ + + +/* function f_ProtocolConfigOption_GetResponse_No_P_CSCF_Addr(NAS_ProtocolConfigOptions_Type p_ConfigOptionsRx) return NAS_ProtocolConfigOptions_Type */ +/* { */ +/* var NAS_ProtocolConfigOptions_Type v_ConfigOptList := f_IMS_CC_ProtocolConfigOption_GetResponse(p_ConfigOptionsRx); */ +/* v_ConfigOptList := f_ProtocolConfigOption_Remove(v_ConfigOptList, tsc_ConfigOptions_P_CSCF_IPv6_Request); */ +/* v_ConfigOptList := f_ProtocolConfigOption_Remove(v_ConfigOptList, tsc_ConfigOptions_P_CSCF_IPv4_Request); // @sic CR R5s120530 change 1.11 TODO: Prose CR needed sic@ */ +/* return v_ConfigOptList; */ +/* } */ + +} diff --git a/IMS_PART4_IWD_15wk38/IMS/Common/TestcaseProperties.ttcn b/IMS_PART4_IWD_15wk38/IMS/Common/TestcaseProperties.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ddee86732309ed7743486f365e022a2e8528959d --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/Common/TestcaseProperties.ttcn @@ -0,0 +1,136 @@ +/******************************************************************************/ +// AUTOMATICLLY GENERATED MODULE - DO NOT MODIFY +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-06-12 14:58:10 +0200 (Fri, 12 Jun 2015) $ +// $Rev: 13810 $ +/******************************************************************************/ + +module TestcaseProperties { + + function f_GetTestcaseAttrib_3IntraFreq(charstring p_Testcase) return boolean + { + return false; + } + + function f_GetTestcaseAttrib_Mimo(charstring p_Testcase) return boolean + { + return false; + } + + function f_GetTestcaseAttrib_DciFormat1A(charstring p_Testcase) return boolean + { + return false; + } + + function f_GetTestcaseAttrib_DlCcchMsgInSeparateMacPdu(charstring p_Testcase) return boolean + { + return false; + } + + function f_GetTestcaseAttrib_Qbased_Rsrq(charstring p_Testcase) return boolean + { + return false; + } + + function f_GetTestcaseAttrib_Mbms(charstring p_Testcase) return boolean + { + return false; + } + + function f_GetTestcaseAttrib_RetrieveEutraCapabilities(charstring p_Testcase) return boolean + { + return false; + } + + function f_GetTestcaseAttrib_NullIntegrityAlgorithmAllowed(charstring p_Testcase) return boolean + { + return false; + } + + function f_GetTestcaseAttrib_CA_Configured(charstring p_Testcase) return boolean + { + return false; + } + + function f_GetTestcaseAttrib_Eutra_SRVCC(charstring p_Testcase) return boolean + { + return false; + } + + function f_GetTestcaseAttrib_Eutra_NSLP(charstring p_Testcase) return boolean + { + return false; + } + + function f_GetTestcaseAttrib_Eutra_Release(charstring p_Testcase) return charstring + { + select (p_Testcase) { + case ("TC_12_18") { return "rel_9"; } + case ("TC_12_18a") { return "rel_12"; } + case ("TC_12_18b") { return "rel_12"; } + case ("TC_12_19") { return "rel_9"; } + case ("TC_12_19a") { return "rel_12"; } + case ("TC_12_19b") { return "rel_12"; } + case ("TC_12_20") { return "rel_9"; } + case ("TC_12_20a") { return "rel_12"; } + case ("TC_12_23") { return "rel_12"; } + case ("TC_12_24") { return "rel_12"; } + case ("TC_12_25") { return "rel_12"; } + case ("TC_19_1_1") { return "rel_9"; } + case ("TC_19_1_2") { return "rel_9"; } + case ("TC_19_1_5") { return "rel_9"; } + case ("TC_19_3_1") { return "rel_9"; } + case ("TC_19_3_3") { return "rel_9"; } + case ("TC_19_3_4") { return "rel_9"; } + case ("TC_19_5_10") { return "rel_9"; } + case ("TC_19_5_6") { return "rel_9"; } + case ("TC_19_5_7") { return "rel_9"; } + case ("TC_19_5_8") { return "rel_9"; } + case ("TC_19_5_9") { return "rel_9"; } + case ("TC_8_15") { return "rel_10"; } + case ("TC_8_16") { return "rel_9"; } + } + return ""; + } + + function f_GetTestcaseAttrib_UtraFDD_Release(charstring p_Testcase) return charstring + { + return ""; + } + + function f_GetTestcaseAttrib_UtraTDD_Release(charstring p_Testcase) return charstring + { + return ""; + } + + function f_GetTestcaseAttrib_DTMF(charstring p_Testcase) return boolean + { + return false; + } + + function f_GetTestcaseAttrib_SpecificPCO(charstring p_Testcase) return boolean + { + select (p_Testcase) { + case ("TC_6_3") { return true; } + case ("TC_7_1") { return true; } + } + return false; + } + + function f_GetTestcaseAttrib_GeolocationInformation(charstring p_Testcase) return boolean + { + select (p_Testcase) { + case ("TC_19_1_1") { return true; } + case ("TC_19_1_5") { return true; } + case ("TC_19_3_1") { return true; } + case ("TC_19_3_3") { return true; } + case ("TC_19_3_4") { return true; } + } + return false; + } +} diff --git a/IMS_PART4_IWD_15wk38/IMS/PART4_Stubs/MTC_Component_IMS_PART4.ttcn b/IMS_PART4_IWD_15wk38/IMS/PART4_Stubs/MTC_Component_IMS_PART4.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..88afec0fc03e2fcf06c21457eded2597375406f7 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/PART4_Stubs/MTC_Component_IMS_PART4.ttcn @@ -0,0 +1,35 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +/******************************************************************************/ + +module MTC_Component_IMS_PART4 { + + import from CommonDefs all; + + import from IMS_Component all; + + import from PART4_Adaptor all; + + import from UpperTesterPtcToMtcDefs all; + + import from HTTP_Component all; + + type component MTC_IMS { + var PART4_ADAPTOR_PTC ptc_PART4_ADAPTOR; + var HTTP_PTC ptc_HTTP; + var IMS_PTC ptc_IMS1; + var IMS_PTC ptc_IMS2; + + // Ports: + port UT_MTC_PTC_PORT IMS_MMI[tsc_NoOfPDNs]; + port UT_MTC_PTC_PORT IPCAN_MMI; + + }; + type component SYSTEM_IMS extends HTTP_SYSTEM {}; + +} diff --git a/IMS_PART4_IWD_15wk38/IMS/PART4_Stubs/MTC_Main_IMS_PART4.ttcn b/IMS_PART4_IWD_15wk38/IMS/PART4_Stubs/MTC_Main_IMS_PART4.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4cf234341716824380a2a40118b19041dac71db6 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/PART4_Stubs/MTC_Main_IMS_PART4.ttcn @@ -0,0 +1,157 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +/******************************************************************************/ + +module MTC_Main_IMS_PART4 { + import from CommonDefs all; + + import from IMS_Component all; + import from IMS_CC_Component all; + + import from MTC_Component_IMS_PART4 all; + import from PART4_Adaptor all; + + import from HTTP_Component all; + import from HTTP_XCAP_Main all; // f_HTTP_XCAP_Main + + import from UpperTesterPtcToMtcDefs all; + + //-------------------------------------------------------------------------- + /* + * @desc Create parallel test components and connect all MTC ports to the system ports + * @param p_IMS1 + * @param p_IMS2 + */ + function f_MTC_IMS_CreateMapAndConnectPTCs(IMS_PTC p_IMS1, + IMS_PTC p_IMS2, + HTTP_PTC p_HTTP_PTC := null) runs on MTC_IMS + { + f_MTC_IMS_Map(); + + ptc_PART4_ADAPTOR := f_PART4_ADAPTOR_PTC_CreateAndMap(); + ptc_IMS1 := p_IMS1; + ptc_IMS2 := p_IMS2; + ptc_HTTP := null; + + connect(ptc_PART4_ADAPTOR:IMS_CTRL[tsc_Index_PDN1], ptc_IMS1:IMS_CTRL); + connect(ptc_PART4_ADAPTOR:IMS_Server[tsc_Index_PDN1], ptc_IMS1:IMS_Server); + connect(ptc_PART4_ADAPTOR:IMS_Client[tsc_Index_PDN1], ptc_IMS1:IMS_Client); + + connect(ptc_PART4_ADAPTOR:IMS[tsc_Index_PDN1], ptc_IMS1:IPCAN); + + connect(mtc:IMS_MMI[tsc_Index_PDN1], ptc_IMS1:MMI); + + if (p_IMS2 != null) { + connect(ptc_PART4_ADAPTOR:IMS_CTRL[tsc_Index_PDN2], ptc_IMS2:IMS_CTRL); + connect(ptc_PART4_ADAPTOR:IMS_Server[tsc_Index_PDN2], ptc_IMS2:IMS_Server); + connect(ptc_PART4_ADAPTOR:IMS_Client[tsc_Index_PDN2], ptc_IMS2:IMS_Client); + + connect(ptc_PART4_ADAPTOR:IMS[tsc_Index_PDN2], ptc_IMS2:IPCAN); + + connect(mtc:IMS_MMI[tsc_Index_PDN2], ptc_IMS2:MMI); + + connect(ptc_IMS2:OtherPDN, ptc_IMS2:OtherPDN); + } + + connect(mtc:IPCAN_MMI, ptc_PART4_ADAPTOR:MMI); + + if (p_HTTP_PTC != null) { + connect(ptc_PART4_ADAPTOR:HTTPCTRL, p_HTTP_PTC:HTTPCTRL); + connect(ptc_PART4_ADAPTOR:HTTPDATA, p_HTTP_PTC:HTTPDATA); + } + + ptc_PART4_ADAPTOR.start(f_PART4_ADAPTOR_MainLoop()); + f_MTC_IMS_FurtherInitialisation(); + } + + //-------------------------------------------------------------------------- + /* + * @desc Extension for XCAP test cases + * @param p_IMS1 + * @param p_IMS2 + */ + function f_MTC_IMS_XCAP_CreateMapAndConnectPTCs(IMS_XCAP_PTC p_IMS1, + IMS_XCAP_PTC p_IMS2) runs on MTC_IMS + { + ptc_HTTP := f_HTTP_PTC_CreateAndMap(); + connect(p_IMS1:XCAP, ptc_HTTP:IMS); + ptc_HTTP.start(f_HTTP_XCAP_Main()); + + f_MTC_IMS_CreateMapAndConnectPTCs(p_IMS1, p_IMS2, ptc_HTTP); + } + + /* + * @desc stop the IMS PTC + * @param p_Verdict + */ + function f_MTC_IMS_Stop(verdicttype p_Verdict) + { + setverdict(p_Verdict); + all component.stop; + mtc.stop; + } + + //============================================================================ + /* + * @desc MTC main loop; called from the testcases + * NOTE: it is assumed that the IMS_PTC is started just before calling this loop + * @param p_GuardTimer + */ + function f_MTC_IMS_MainLoop(timer p_GuardTimer) runs on MTC_IMS + { + var boolean v_IMS1_Done := (ptc_IMS1 == null); + var boolean v_IMS2_Done := (ptc_IMS2 == null); + + while (not (v_IMS1_Done and v_IMS2_Done)) { + alt { + [not v_IMS1_Done] ptc_IMS1.done { // terminate the loop when the IMS PTC(s) have done its work + v_IMS1_Done := true; + } + [not v_IMS2_Done] ptc_IMS2.done { // terminate the loop when the IMS PTC(s) have done its work + v_IMS2_Done := true; + } + [] a_MTC_IMS_UpperTester(); + [] p_GuardTimer.timeout { + f_MTC_IMS_Stop(inconc); + } + [] any component.killed { + f_MTC_IMS_Stop(inconc); + } + } + } + f_MTC_IMS_Stop(pass); /* Note: "pass" overrules "none" only */ + } + + //============================================================================ + // TO BE IMPLEMENTED: + //-------------------------------------------------------------------------- + + template (present) UT_COMMON_CMD cr_UT_CMD_Any := ?; + + + function f_MTC_IMS_Map() runs on MTC_IMS + { + } + + function f_MTC_IMS_FurtherInitialisation() runs on MTC_IMS + { + } + + altstep a_MTC_IMS_UpperTester() runs on MTC_IMS + { + [] IMS_MMI[tsc_Index_PDN1].receive(cr_UT_CMD_Any) { + + } + [] IMS_MMI[tsc_Index_PDN2].receive(cr_UT_CMD_Any) { + + } + [] IPCAN_MMI.receive(cr_UT_CMD_Any) { + + } + } +} diff --git a/IMS_PART4_IWD_15wk38/IMS/PART4_Stubs/PART4_Adaptor.ttcn b/IMS_PART4_IWD_15wk38/IMS/PART4_Stubs/PART4_Adaptor.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..62c30db5ba8f699eb0c8b975250101cb1865dd82 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/PART4_Stubs/PART4_Adaptor.ttcn @@ -0,0 +1,48 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +/******************************************************************************/ + +module PART4_Adaptor { + import from CommonDefs all; + import from IMS_PTC_CoordMsg all; + import from IMS_ASP_TypeDefs all; + import from HTTP_ASP_TypeDefs all; + import from UpperTesterPtcToMtcDefs all; + + type component PART4_ADAPTOR_PTC { + // IMS interface to IMS PTC: + port IP_IMS_CTRL_PORT IMS_CTRL[tsc_NoOfPDNs]; + port IP_IMS_SERVER_PORT IMS_Server[tsc_NoOfPDNs]; + port IP_IMS_CLIENT_PORT IMS_Client[tsc_NoOfPDNs]; + + // coordination ports to HTTP_PTC + port IP_HTTP_CTRL_PORT HTTPCTRL; + port IP_HTTP_DATA_PORT HTTPDATA; + + // IPCAN interface to IMS PTC: + port IMS_IPCAN_CO_ORD_PORT IMS[tsc_NoOfPDNs]; + + // MMI interface + port UT_PTC_MTC_PORT MMI; + }; + + function f_PART4_ADAPTOR_PTC_CreateAndMap() return PART4_ADAPTOR_PTC + { + var PART4_ADAPTOR_PTC v_PART4_ADAPTOR_PTC := PART4_ADAPTOR_PTC.create alive; + + // insert mapping of system ports here + + return v_PART4_ADAPTOR_PTC; + } + + function f_PART4_ADAPTOR_MainLoop() runs on PART4_ADAPTOR_PTC + { + while (true) { + } + } +} diff --git a/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/HTTP_Component.ttcn b/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/HTTP_Component.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..96f75288ef4c26b320dc9bdf8f9f79ed4631fb77 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/HTTP_Component.ttcn @@ -0,0 +1,53 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2014-05-26 19:34:53 +0200 (Mon, 26 May 2014) $ +// $Rev: 11335 $ +/******************************************************************************/ + +module HTTP_Component { + import from HTTP_PTC_CoordMsg all; + import from HTTP_ASP_TypeDefs all; + import from XCAP_ASP_TypeDefs all; + + type component HTTP_PTC { /* @status APPROVED (IMS) */ + + // port to IMS components + port XCAP_IMS_CO_ORD_PORT IMS; + + port HTTP_CTRL_PORT HTTPCTRL; + port HTTP_DATA_PORT HTTPDATA; + + port XCAP_PORT XCAP; /* Simulates XCAP Server in the NW. See TS 24.623 clause 5.1 */ + }; + + type component HTTP_SYSTEM { /* @status APPROVED (IMS) */ + port XCAP_PORT Xcap; + }; + + //**************************************************************************** + /* + * @desc create and map HTTP PTC + * @return HTTP_PTC + * @status APPROVED (IMS) + */ + function f_HTTP_PTC_CreateAndMap() return HTTP_PTC + { + var HTTP_PTC v_HTTP_PTC := HTTP_PTC.create alive; + + map(v_HTTP_PTC:XCAP, system:Xcap); + + return v_HTTP_PTC; + } + + //---------------------------------------------------------------------------- + + + + + +} diff --git a/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/HTTP_Functions.ttcn b/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/HTTP_Functions.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..35ae4b8ace906f43f90d1fef92f2e9f8138c3fcd --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/HTTP_Functions.ttcn @@ -0,0 +1,529 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-07-15 22:15:47 +0200 (Wed, 15 Jul 2015) $ +// $Rev: 14020 $ +/******************************************************************************/ + +module HTTP_Functions { + + import from CommonDefs all; + import from LibSip_SIPTypesAndValues all; // NOTE: the same header definitions are used for HTTP as for SIP (Authorization, ContentType, WwwAuthenticate, AuthenticationInfo, Expires) + import from LibSip_Common all; + import from HTTP_ASP_TypeDefs all; + import from HTTP_PTC_CoordMsg all; + import from HTTP_Templates all; + import from NAS_AuthenticationCommon all; + import from IMS_CommonDefs all; + import from IMS_CommonFunctions all; + import from IMS_CommonTemplates all; + import from IMS_SIP_Templates all; // NOTE: the same header definitions are used for HTTP as for SIP (cr_AuthorizationDef, cs_WwwAuthChallenge) + import from IP_ASP_TypeDefs all; + import from IMS_CC_Parameters all; + + import from uri_3gpp_gba language "XSD" all; + + + type union HTTP_AuthenticationResult_Type { /* @status APPROVED (IMS) */ + charstring Error, + HTTP_DATA_IND InitialRequest, + Null_Type NoError + }; + + template (value) HTTP_AuthenticationResult_Type cs_HTTP_AuthenticationResult_Error(charstring p_Error) := { Error := p_Error }; /* @status APPROVED (IMS) */ + template (value) HTTP_AuthenticationResult_Type cs_HTTP_AuthenticationResult_Timeout := cs_HTTP_AuthenticationResult_Error("timeout during HTTP authentication"); /* @status APPROVED (IMS) */ + template (value) HTTP_AuthenticationResult_Type cs_HTTP_AuthenticationResult_InitialRequest(HTTP_DATA_IND p_InitialRequest) := { InitialRequest := p_InitialRequest }; /* @status APPROVED (IMS) */ + template (value) HTTP_AuthenticationResult_Type cs_HTTP_AuthenticationResult_NoError := { NoError := true }; + + //---------------------------------------------------------------------------- + // BootstrappingInfo: + + /* + * @desc get system time and return HTTP Date/Time formatted according to RFC2616 cl. 3.3.1 and RFC822 cl. 5.1 + * @return charstring + * @status APPROVED (IMS) + */ + function fl_NextYearSameTime() return charstring + { + var Struct_tm_Type v_LocalTime; + var integer v_TimezoneSeconds; + + fx_GetSystemTime(v_LocalTime, v_TimezoneSeconds); + v_LocalTime.tm_year := v_LocalTime.tm_year + 1; // next year + + return f_UTC_FormatDateTime(v_LocalTime); + } + + template (value) BootstrappingInfo cs_BootstrappingInfo(charstring p_BTid) := + { /* @status APPROVED (IMS) */ + btid := p_BTid, + lifetime := fl_NextYearSameTime(), + extension_ := omit + }; + + //---------------------------------------------------------------------------- + // Key derivation function used for GBA + + /* + * @desc encode single input parameter for KDF + * @param p_Pi + * @return octetstring + * @status APPROVED (IMS) + */ + function fl_KDF_InputParameter(octetstring p_Pi) return octetstring + { + return p_Pi & int2oct(lengthof(p_Pi), 2); + } + + /* + * @desc Derivation of the TMPI acc. to TS 33.220 B.4 + * @param p_AuthParams + * @param p_PrivateUserId + * @param p_BsfServerDomainName + * @return charstring + * @status APPROVED (IMS) + */ + function fl_GBA_TMPI_Derivation(Common_AuthenticationParams_Type p_AuthParams, + charstring p_PrivateUserId, + charstring p_BsfServerDomainName) return charstring + { + var octetstring v_FC := '01'O; + var octetstring v_P0 := char2oct("gba-me"); + var octetstring v_P1 := bit2oct(p_AuthParams.RandValue); + var octetstring v_P2 := char2oct(p_PrivateUserId); + var octetstring v_P3 := char2oct(p_BsfServerDomainName); + var octetstring v_S := v_FC & fl_KDF_InputParameter(v_P0) & fl_KDF_InputParameter(v_P1) & fl_KDF_InputParameter(v_P2) & fl_KDF_InputParameter(v_P3); + var B256_Type v_Ks := p_AuthParams.CK & p_AuthParams.IK; + var B256_Type v_Result := fx_KeyDerivationFunction(tsc_KDF_HMAC_SHA_256, v_Ks, v_S); + var charstring v_TEMP := f_Bitstring2Base64(substr(v_Result, 0, 192)); // base64-encoding of the 24 most significant octets of the output of KDF + + return v_TEMP & "@tmpi.bsf.3gppnetwork.org"; + } + + /* + * @desc Derivation of the TMPI acc. to TS 33.220 B.5 + * @return charstring + * @status APPROVED (IMS) + */ + function fl_GBA_Passwd_Derivation() return charstring + { + var octetstring v_TLS_MK_Extr := int2oct(0, 48); // !!!! TBD - see 33.220 M.6.3 !!!! + var octetstring v_FC := '01'O; + var octetstring v_P0 := char2oct("GBA_Digest_RESP"); + var octetstring v_P1 := v_TLS_MK_Extr; + var octetstring v_S := v_FC & fl_KDF_InputParameter(v_P0) & fl_KDF_InputParameter(v_P1); + var B256_Type v_Key := int2bit(0, 256); // !!!! TBD - H(A1)see 33.220 M.6.3 !!!! + var B256_Type v_Result := fx_KeyDerivationFunction(tsc_KDF_HMAC_SHA_256, v_Key, v_S); + var charstring v_Passwd := f_Bitstring2Base64(v_Result); + + return v_Passwd; + } + + //---------------------------------------------------------------------------- + /* + * @desc build up Authorization header to be used for GBA authentication (34.229-1 cl. C.29.2 step 1 and 3) + * @param p_Username + * @param p_BsfAddress + * @param p_GbaInitialRequest (default value: false) + * @return template (present) Authorization + * @status APPROVED (IMS) + */ + function fl_Authorization_GBA(charstring p_Username, + charstring p_BsfAddress, + boolean p_GbaInitialRequest := false) return template (present) Authorization + { + var template (present) CommaParam_List v_DigestResponse; + var template (present) charstring v_DigestUri := ("/", "http://" & p_BsfAddress); + + v_DigestResponse := { + cr_GenericParam("credentials", "Digest"), + cr_GenericParam("username", p_Username), + cr_GenericParam("digest-uri", v_DigestUri) + }; + // add further parameters for step 3 + if (p_GbaInitialRequest) { + f_CommaParam_List_Add_RX(v_DigestResponse, cr_GenericParam("nonce", "")); + f_CommaParam_List_Add_RX(v_DigestResponse, cr_GenericParam("response", "")); + } + else { + f_CommaParam_List_Add_RX(v_DigestResponse, cr_GenericParam("realm", tsc_GBA_Realm)); + f_CommaParam_List_Add_RX(v_DigestResponse, cr_GenericParam("opaque", tsc_GBA_Opaque)); + f_CommaParam_List_Add_RX(v_DigestResponse, cr_GenericParam_Common("cnonce", ?)); + f_CommaParam_List_Add_RX(v_DigestResponse, cr_GenericParam("nc", "1")); + f_CommaParam_List_Add_RX(v_DigestResponse, cr_GenericParam("algorithm", tsc_AKAv1_MD5)); + } + return cr_Authorization_GBA(superset(all from v_DigestResponse)); + } + + /* + * @desc check digest response sent by the UE; returns error message (if any) or "" + * @param p_ServerName + * @param p_HttpRequest + * @param p_Password + * @return charstring + * @status APPROVED (IMS) + */ + function fl_HTTP_CheckDigestResponse(charstring p_ServerName, + HttpRequest_Type p_HttpRequest, + charstring p_Password) return charstring + { + var Authorization v_Authorization := p_HttpRequest.authorization; + var charstring v_Error := ""; + var bitstring v_XRES := oct2bit(char2oct(p_Password)); // @sic R5-151795: evaluation of the password moved from f_IMS_HTTP_Transaction (IMS_XCAP_PTC) to here sic@ */ + var integer v_XRESLength := lengthof(p_Password); + + // Check digest response + if (not ischosen(v_Authorization.body[0].digestResponse)) { + v_Error := p_ServerName & " - No digestResponse sent in the authorization header"; + } + else if (not f_IMS_Authorization_CheckDigestResponse(p_HttpRequest.requestLine.method, v_Authorization.body[0].digestResponse, v_XRES, v_XRESLength)) { + v_Error := p_ServerName & " - DigestResponse check failed"; + } + return v_Error; + } + + //---------------------------------------------------------------------------- + + template (value) TLSInfo_Type cs_TLSInfo_PSK(template (omit) octetstring p_Psk := omit, + template (omit) TLS_CIPHER_Type p_CipherSuite := psk_3DES_EDE_CBC_SHA) := + { + tlsType := pskTLS, + psk := p_Psk, + cipherSuite := p_CipherSuite + }; + + template (value) HttpServerInfo_Type cs_HttpServerInfo(IP_AddrInfo_Type p_ServerAddr, + PortNumber_Type p_PortNumber, + IP_DrbInfo_Type p_DrbInfo, + template (omit) TLSInfo_Type p_TlsInfo := omit) := + { /* @status APPROVED (IMS) */ + serverAddr := p_ServerAddr, + serverPort := p_PortNumber, + drbInfo := p_DrbInfo, + tlsInfo := p_TlsInfo + }; + + template (value) HTTP_CTRL_REQ cs_HttpCtlReq(template (value) HttpServerList_Type p_HttpServerList) := + { /* @status APPROVED (IMS) */ + httpServerList := p_HttpServerList + }; + + template (present) HTTP_CTRL_CNF cr_HttpCtlCnf := { errorInfo := omit }; /* @status APPROVED (IMS) */ + + //============================================================================ + /* + * @desc Configure the http server + * @param p_HttpCtrlPort + * @param p_XcapServerAddrAndPort_List + * @param p_BsfServerAddrAndPort_List + * @param p_DrbRoutingInfo + * @status APPROVED (IMS) + */ + function f_HTTP_Configure(HTTP_CTRL_PORT p_HttpCtrlPort, + IP_SocketList_Type p_XcapServerAddrAndPort_List, + IP_SocketList_Type p_BsfServerAddrAndPort_List, + IP_DrbInfo_Type p_DrbRoutingInfo) + { /* @sic R5-151795: sic@ + * - p_TLSInfo is currently not used + * - HTTP implementation does not distinguish servers for XCAP or BSF but there can be one or more than one HTTP servers: + * responses sent by the HTTP implementation are sent back using the same connection as the corresponding request */ + var template (value) HttpServerList_Type v_HttpServerList; + var integer i; + var integer k := 0; + + for (i := 0; i < lengthof(p_XcapServerAddrAndPort_List); i := i + 1) { // @sic R5s150148 sic@ + v_HttpServerList[k] := cs_HttpServerInfo(p_XcapServerAddrAndPort_List[i].IpAddr, + p_XcapServerAddrAndPort_List[i].Port, + p_DrbRoutingInfo); + k := k + 1; + } + for (i := 0; i < lengthof(p_BsfServerAddrAndPort_List); i := i + 1) { // @sic R5s150148 sic@ + v_HttpServerList[k] := cs_HttpServerInfo(p_BsfServerAddrAndPort_List[i].IpAddr, + p_BsfServerAddrAndPort_List[i].Port, + p_DrbRoutingInfo); + k := k + 1; + } + p_HttpCtrlPort.send(cs_HttpCtlReq(v_HttpServerList)); + p_HttpCtrlPort.receive(cr_HttpCtlCnf) + } + + //============================================================================ + /* + * @desc Receive Http Request from UE + * @param p_Port + * @param p_Watchdog + * @param p_InactivityDuration (default value: 9999.0) + * @param p_HttpRequest (default value: cr_HttpRequest) + * @return template (omit) HTTP_DATA_IND + * @status APPROVED (IMS) + */ + function f_HTTP_ReceiveRequest(HTTP_DATA_PORT p_Port, + timer p_Watchdog, + float p_InactivityDuration := 9999.0, + template (present) HttpRequest_Type p_HttpRequest := cr_HttpRequest) return template (omit) HTTP_DATA_IND + { + var HTTP_DATA_IND v_DataInd; + var template (omit) HTTP_DATA_IND v_HTTP_DATA_IND := omit; + timer t_InactivityTimer; + + t_InactivityTimer.start(p_InactivityDuration); + + alt { + [] p_Port.receive(cr_HttpDataInd(?, p_HttpRequest)) -> value v_DataInd + { + v_HTTP_DATA_IND := v_DataInd; + } + [] p_Port.receive(cr_HttpDataInd(?, ?)) + { + repeat; // ignore any unexpected messages + } + [] t_InactivityTimer.timeout {} + [] p_Watchdog.timeout {} + } + t_InactivityTimer.stop; + return v_HTTP_DATA_IND; + } + + //---------------------------------------------------------------------------- + /* + * @desc Send Http Response to UE + * @param p_Port + * @param p_HttpRoutingInfo + * @param p_HttpResponse + * @status APPROVED (IMS) + */ + function f_HTTP_SendResponse(HTTP_DATA_PORT p_Port, + template (value) IP_Connection_Type p_HttpRoutingInfo, + template (value) HttpResponse_Type p_HttpResponse) + { + p_Port.send(cs_HttpDataReq(p_HttpRoutingInfo, p_HttpResponse)); + } + + //---------------------------------------------------------------------------- + /* + * @desc build up default receive template for UserAgent header for XCAP + * @return template UserAgent + * @status APPROVED (IMS) + */ + function fl_UserAgentRX_XCAP() return template UserAgent + { + var ServerVal_List v_UserAgentTokens := {}; + + if (pc_HttpGBAAuthentication) { + v_UserAgentTokens := {"3gpp-gba"}; + } + return f_UserAgentRX(v_UserAgentTokens); + } + + //---------------------------------------------------------------------------- + /* + * @desc build up WwwAuthenticate for XCAP authentication + * @param p_AuthenticationMethod + * @param p_HomeDomainName + * @param p_Nonce + * @return template (value) WwwAuthenticate + * @status APPROVED (IMS) + */ + function fl_WwwAuthenticate_XCAP(HTTP_AuthenticationMethod_Type p_AuthenticationMethod, + charstring p_HomeDomainName, + charstring p_Nonce) return template (value) WwwAuthenticate + { + var template (value) CommaParam_List v_ChallangeParams; + var charstring v_Realm; + + select (p_AuthenticationMethod) { + case (httpDigestAndGbaAuthentication) { + v_Realm := "3GPP-bootstrapping@" & p_HomeDomainName; + } + case else { + v_Realm := p_HomeDomainName; + } + } + v_ChallangeParams := { + cs_GenericParamQuoted("realm", v_Realm), + cs_GenericParamQuoted("algorithm", tsc_HTTP_MD5), + cs_GenericParamQuoted("qop", "auth"), + cs_GenericParamQuoted("nonce", p_Nonce), + cs_GenericParamQuoted("opaque", tsc_IMS_Opaque) + }; + return cs_HTTP_WwwAuthenticate(v_ChallangeParams); + } + + //---------------------------------------------------------------------------- + /* + * @desc build up WwwAuthenticate for GBA authentication + * @param p_Nonce + * @return template (value) WwwAuthenticate + * @status APPROVED (IMS) + */ + function fl_WwwAuthenticate_GBA(charstring p_Nonce) return template (value) WwwAuthenticate + { + var template (value) CommaParam_List v_ChallangeParams; + + v_ChallangeParams := { + cs_GenericParamQuoted("challenge", "Digest"), + cs_GenericParamQuoted("realm", "bsf.home1.net"), + cs_GenericParamQuoted("algorithm", tsc_AKAv1_MD5), + cs_GenericParamQuoted("qop", "auth-int"), + cs_GenericParamQuoted("nonce", p_Nonce), + cs_GenericParamQuoted("opaque", tsc_GBA_Opaque) + }; + return cs_HTTP_WwwAuthenticate(v_ChallangeParams); + } + + //---------------------------------------------------------------------------- + /* + * @desc build up AuthenticationInfo for GBA authentication + * @param p_CNonce + * @param p_NextNonce + * @return template (value) AuthenticationInfo + * @status APPROVED (IMS) + */ + function fl_AuthenticationInfo_GBA(charstring p_CNonce, + charstring p_NextNonce) return template (value) AuthenticationInfo + { + var template (value) CommaParam_List v_AuthInfoParams; + + v_AuthInfoParams := { + cs_GenericParamQuoted("qop", "auth-int"), + cs_GenericParamQuoted("rspauth", p_CNonce), + cs_GenericParamQuoted("cnonce", p_CNonce), + cs_GenericParamQuoted("nc", "1"), + cs_GenericParamQuoted("opaque", tsc_GBA_Opaque), + cs_GenericParamQuoted("nextnonce", p_NextNonce) + }; + return cs_AuthenticationInfo(v_AuthInfoParams); + } + + //---------------------------------------------------------------------------- + /* + * @desc HTTP authentication + * @param p_HttpDataPort + * @param p_Watchdog + * @param p_AuthenticationMethod + * @param p_PrivateUserId + * @param p_HomeDomainName + * @param p_XcapUsername + * @return template (value) HTTP_AuthenticationResult_Type + * @status APPROVED (IMS) + */ + function f_HTTP_Authentication(HTTP_DATA_PORT p_HttpDataPort, + timer p_Watchdog, + HTTP_AuthenticationMethod_Type p_AuthenticationMethod, + charstring p_PrivateUserId, + charstring p_HomeDomainName, + charstring p_XcapUsername) return template (value) HTTP_AuthenticationResult_Type + { /* @sic R5-151795: restructuring of authentication procedure sic@ */ + var template (omit) HTTP_DATA_IND v_HTTP_DATA_IND; + var HTTP_DATA_IND v_InitialRequestXCAP; + var HTTP_DATA_IND v_InitialRequestGBA; + var HTTP_DATA_IND v_SubsequentRequestXCAP; + var HTTP_DATA_IND v_SubsequentRequestGBA; + var charstring v_RequestLineUri; + var charstring v_UsernameXCAP := p_XcapUsername; + var charstring v_UsernameGBA; + var charstring v_PasswordXCAP; + var charstring v_PasswordGBA; + var Common_AuthenticationParams_Type v_AuthParams := f_IMS_AuthenticationInit(tsc_IMS_AuthRAND); + var charstring v_Nonce := f_Bitstring2Base64(v_AuthParams.RandValue & v_AuthParams.AUTN); + var charstring v_NextNonce := v_Nonce; + var charstring v_CNonce; + var ServerVal_List v_ProductTokenList; + var template (value) WwwAuthenticate v_WwwAuthenticate; + var template (value) AuthenticationInfo v_AuthenticationInfo; + var template (value) ContentType v_ContentType; + var charstring v_MessageBody; + var template UserAgent v_UserAgent; + var template Authorization v_Authorization; + var charstring v_BsfServerDomainName := "bsf.operator.com"; // !!!! FFS: to be replaced by PIXIT ?? !!!! + var charstring v_BTid := f_Bitstring2Base64(v_AuthParams.RandValue) & "@" & v_BsfServerDomainName; // see 33.220 cl. 4.5.2 + var boolean v_GbaInitialRequest := true; + var charstring v_Error := ""; + + // 29.1 step 2 + v_UserAgent := fl_UserAgentRX_XCAP(); + v_Authorization := *; + v_HTTP_DATA_IND := f_HTTP_ReceiveRequest(p_HttpDataPort, p_Watchdog, -, cr_HttpRequest(-, v_UserAgent, v_Authorization)); + if (not ispresent(v_HTTP_DATA_IND)) { return cs_HTTP_AuthenticationResult_Timeout; } + v_InitialRequestXCAP := valueof(v_HTTP_DATA_IND); + + // 29.1 step 3a + v_ProductTokenList := {"XCAP-Server"}; + v_WwwAuthenticate := fl_WwwAuthenticate_XCAP(p_AuthenticationMethod, p_HomeDomainName, v_Nonce); + f_HTTP_SendResponse(p_HttpDataPort, v_InitialRequestXCAP.routingInfo, cs_HttpResponse_401(v_ProductTokenList, v_WwwAuthenticate)); + + if (p_AuthenticationMethod != httpDigestAndGbaAuthentication) { // HTTP digest authentication only + v_PasswordXCAP := "xcap"; /* @sic R5s130794 Change 25 sic@ + @sic R5-151795: evaluation of the password moved from f_IMS_HTTP_Transaction (IMS_XCAP_PTC) to here sic@ */ + } + else { // GBA authentication + + if (pc_TMPI_forGBA) { + v_UsernameGBA := fl_GBA_TMPI_Derivation(v_AuthParams, p_PrivateUserId, v_BsfServerDomainName); + } else { + v_UsernameGBA := p_PrivateUserId; + } + + // 29.2 step 1 + v_ProductTokenList := {"3gpp-gba-tmpi"}; + v_UserAgent := f_UserAgentRX(v_ProductTokenList); + v_Authorization := fl_Authorization_GBA(v_UsernameGBA, v_BsfServerDomainName, v_GbaInitialRequest); + v_HTTP_DATA_IND := f_HTTP_ReceiveRequest(p_HttpDataPort, p_Watchdog, -, cr_HttpRequest(-, v_UserAgent, v_Authorization)); + if (not ispresent(v_HTTP_DATA_IND)) { return cs_HTTP_AuthenticationResult_Timeout; } + v_InitialRequestGBA := valueof(v_HTTP_DATA_IND); + + // 29.2 step 2 + v_ProductTokenList := {"BSF-Server"}; + v_WwwAuthenticate := fl_WwwAuthenticate_GBA(v_Nonce); + f_HTTP_SendResponse(p_HttpDataPort, v_InitialRequestGBA.routingInfo, cs_HttpResponse_401(v_ProductTokenList, v_WwwAuthenticate)); + + // 29.2 step 3 + v_RequestLineUri := v_InitialRequestGBA.httpRequest.requestLine.uri; // same URI as in previous request */ + v_UserAgent := *; + v_Authorization := fl_Authorization_GBA(v_UsernameGBA, v_BsfServerDomainName); + v_HTTP_DATA_IND := f_HTTP_ReceiveRequest(p_HttpDataPort, p_Watchdog, -, cr_HttpRequest(cr_HttpRequestLine(v_RequestLineUri), v_UserAgent, v_Authorization)); + if (not ispresent(v_HTTP_DATA_IND)) { return cs_HTTP_AuthenticationResult_Timeout; } + v_SubsequentRequestGBA := valueof(v_HTTP_DATA_IND); + + // Check authentication response + v_PasswordGBA := "???"; // !!!! FFS !!!! prose does not say much about the password for GBA authentication + v_Error := fl_HTTP_CheckDigestResponse("BSF-Server", v_SubsequentRequestGBA.httpRequest, v_PasswordGBA); + if (v_Error != "") { + return cs_HTTP_AuthenticationResult_Error(v_Error); + } + v_CNonce := f_SIP_CommaParamList_GetParamValue(v_SubsequentRequestGBA.httpRequest.authorization.body[0].digestResponse, "cnonce"); + + // 29.2 step 4 + v_ProductTokenList := {"BSF-Server", "3gpp-gba-tmpi"}; + v_AuthenticationInfo := fl_AuthenticationInfo_GBA(v_CNonce, v_NextNonce); + v_ContentType := cs_ContentType("application/vnd.3gpp.bsf+xml"); + v_MessageBody := oct2char(bit2oct(encvalue(cs_BootstrappingInfo(v_BTid)))); + + f_HTTP_SendResponse(p_HttpDataPort, + v_SubsequentRequestGBA.routingInfo, + cs_HttpResponse_200(v_ProductTokenList, -, v_AuthenticationInfo, v_ContentType, v_MessageBody)); + + v_PasswordXCAP := fl_GBA_Passwd_Derivation(); + v_UsernameXCAP := v_BTid; + } + + // 29.1 step 3b + v_UserAgent := fl_UserAgentRX_XCAP(); + v_Authorization := cr_AuthorizationCommon(v_UsernameXCAP, p_HomeDomainName, v_Nonce, v_InitialRequestXCAP.httpRequest.requestLine.uri, tsc_HTTP_MD5); + v_HTTP_DATA_IND := f_HTTP_ReceiveRequest(p_HttpDataPort, p_Watchdog, -, cr_HttpRequest(-, v_UserAgent, v_Authorization)); + if (not ispresent(v_HTTP_DATA_IND)) { return cs_HTTP_AuthenticationResult_Timeout; } + v_SubsequentRequestXCAP := valueof(v_HTTP_DATA_IND); + + // Check authentication response + v_Error := fl_HTTP_CheckDigestResponse("XCAP-Server", v_SubsequentRequestXCAP.httpRequest, v_PasswordXCAP); + if (v_Error != "") { + return cs_HTTP_AuthenticationResult_Error(v_Error); + } + + return cs_HTTP_AuthenticationResult_InitialRequest(v_SubsequentRequestXCAP); + } +} diff --git a/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/HTTP_PTC_CoordMsg.ttcn b/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/HTTP_PTC_CoordMsg.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9597a872ef472ecb88f98229ef4bf4ed31b9089b --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/HTTP_PTC_CoordMsg.ttcn @@ -0,0 +1,65 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-06-17 23:23:45 +0200 (Wed, 17 Jun 2015) $ +// $Rev: 13930 $ +/******************************************************************************/ + +module HTTP_PTC_CoordMsg { + + import from CommonDefs all; + import from IP_ASP_TypeDefs all; + + type record HTTP_ConfigurationParams_Type { /* @status APPROVED (IMS) */ + IP_SocketList_Type XcapServerAddrAndPort_List, /* @sic R5s150148 sic@ */ + IP_SocketList_Type BsfServerAddrAndPort_List, /* @sic R5s150148 sic@ */ + IP_DrbInfo_Type DrbRoutingInfo, + HTTP_AuthenticationMethod_Type AuthenticationMethod, + charstring PrivateUserId, + charstring HomeDomainName, + charstring XcapUsername, /* Username to be used for Authorisation */ + charstring XcapUserId, /* public user indentity to be used for XCAP signalling (XUI) */ + charstring XcapRootUri + }; + + type enumerated HTTP_AuthenticationMethod_Type { /* @status APPROVED (IMS) */ + noAuthentication, + httpDigestAuthentication, + httpDigestAndGbaAuthentication + }; + + type record HTTP_TransactionParams_Type { /* @status APPROVED (IMS) */ + float MaxDuration, + float InactivityDuration + }; + + type union IMS_HTTP_Command_Type { /* @status APPROVED (IMS) */ + HTTP_ConfigurationParams_Type Configure, + HTTP_TransactionParams_Type TransactionStart, + Null_Type DocumentGet, + charstring DocumentSet + }; + + type union IMS_HTTP_Response_Type { /* @status APPROVED (IMS) */ + charstring Error, + charstring Result + }; + + type port IMS_XCAP_CO_ORD_PORT message + { /* @status APPROVED (IMS) */ + out IMS_HTTP_Command_Type; + in IMS_HTTP_Response_Type; + }; + + + type port XCAP_IMS_CO_ORD_PORT message + { /* @status APPROVED (IMS) */ + in IMS_HTTP_Command_Type; + out IMS_HTTP_Response_Type; + }; + +} diff --git a/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/HTTP_Templates.ttcn b/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/HTTP_Templates.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d3196edfddf0c447878fcd31e2ee8bbd4a412698 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/HTTP_Templates.ttcn @@ -0,0 +1,323 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-06-17 23:23:45 +0200 (Wed, 17 Jun 2015) $ +// $Rev: 13930 $ +/******************************************************************************/ + +module HTTP_Templates { + + import from CommonDefs all; + import from IP_ASP_TypeDefs all; + import from HTTP_ASP_TypeDefs all; + import from LibSip_SIPTypesAndValues all; // NOTE: the same header definitions are used for HTTP as for SIP (Authorization, ContentType, WwwAuthenticate, AuthenticationInfo, Expires) + import from LibSip_Common all; + import from IMS_SIP_Templates all; // NOTE: the same header definitions are used for HTTP as for SIP (cr_AuthorizationDef, cs_WwwAuthChallenge) + + const charstring tsc_HTTP_Version_1_1 := "HTTP/1.1"; /* @status APPROVED (IMS) */ + const charstring tsc_Simservs_ContentType_Document := "application/vnd.etsi.simservs+xml"; /* @status APPROVED (IMS) */ + const charstring tsc_Simservs_ContentType_Element := "application/xcap-el+xml"; /* @status APPROVED (IMS) */ + const charstring tsc_Simservs_ContentType_Attribute := "application/xcap-att+xml"; /* @status APPROVED (IMS) */ + + const charstring tsc_GBA_Realm := "bsf.home1.net"; /* @status APPROVED (IMS) */ + const charstring tsc_GBA_Opaque := "5ccc069c403ebaf9f0171e9517f30e41"; /* note: this is different than tsc_IMS_Opaque + @status APPROVED (IMS) */ + //---------------------------------------------------------------------------- + + template (value) WwwAuthenticate cs_HTTP_WwwAuthenticate(template (value) CommaParam_List p_ChallangeParams) := + { /* @status APPROVED (IMS) */ + fieldName := WWW_AUTHENTICATE_E, + challenge := { + digestCln := p_ChallangeParams + } + }; + + //---------------------------------------------------------------------------- + + template (value) AuthenticationInfo cs_AuthenticationInfo(template (value) CommaParam_List p_AuthInfoParams) := + { /* @status APPROVED (IMS) */ + fieldName := AUTHENTICATION_INFO_E, + ainfo := p_AuthInfoParams + }; + + //---------------------------------------------------------------------------- + + template (present) Authorization cr_Authorization_GBA(template (present) CommaParam_List p_DigestResponse) := + { /* @status APPROVED (IMS) */ + fieldName := AUTHORIZATION_E, + body := { + { + digestResponse := p_DigestResponse + } + } + }; + + //---------------------------------------------------------------------------- + + template (present) HttpRequestLine_Type cr_HttpRequestLine(template (present) charstring p_Uri := ?) := + { /* @status APPROVED (IMS) */ + method := ("GET", "PUT", "DELETE"), + uri := p_Uri, // XCAP selection expression, RFC 4825 + version := tsc_HTTP_Version_1_1 + }; + + //---------------------------------------------------------------------------- + /* + * @desc returns integer formated as "%02d" + * @param p_Value + * @return charstring + * @status APPROVED (IMS) + */ + function fl_FormatIntegerAsTwoDigits(UInt_Type p_Value) return charstring + { + var UInt_Type v_Value := p_Value mod 100; + var charstring v_String := int2str(v_Value); + + if (v_Value < 10) { + v_String := "0" & v_String; + } + return v_String; + } + + /* + * @desc return HTTP Date/Time formatted according to RFC2616 cl. 3.3.1 and RFC822 cl. 5.1 + * @param p_LocalTime + * @param p_TimezoneSeconds + * @return charstring + * @status APPROVED (IMS) + */ + function f_HTTP_FormatHttpDate(Struct_tm_Type p_LocalTime, + integer p_TimezoneSeconds) return charstring + { + const CharStringList_Type tsc_Month := { "Jan", "Feb","Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; + const CharStringList_Type tsc_WDay := { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" }; + var charstring v_Year := int2str(p_LocalTime.tm_year + 1900); + var charstring v_Month := tsc_Month[p_LocalTime.tm_mon]; + var charstring v_WDay := tsc_WDay[p_LocalTime.tm_wday]; + var charstring v_MDay := fl_FormatIntegerAsTwoDigits(p_LocalTime.tm_mday); + var charstring v_Hour := fl_FormatIntegerAsTwoDigits(p_LocalTime.tm_hour); + var charstring v_Minute := fl_FormatIntegerAsTwoDigits(p_LocalTime.tm_min); + var charstring v_Second := fl_FormatIntegerAsTwoDigits(p_LocalTime.tm_sec); + var integer v_TimezoneSeconds := p_TimezoneSeconds; + var charstring v_TimezoneSign; + var charstring v_TimezoneHours; + var charstring v_TimezoneMinutes; + + if (p_LocalTime.tm_isdst > 0) { // see f_BCD_TimestampWithTimezone + v_TimezoneSeconds := v_TimezoneSeconds + 3600; + } + if (v_TimezoneSeconds < 0) { + v_TimezoneSeconds := -v_TimezoneSeconds; + v_TimezoneSign := "-"; + } else { + v_TimezoneSign := "+"; + } + v_TimezoneHours := fl_FormatIntegerAsTwoDigits(v_TimezoneSeconds / 3600); + v_TimezoneMinutes := fl_FormatIntegerAsTwoDigits((v_TimezoneSeconds mod 3600) / 60); + + return v_WDay & ", " & v_MDay & " " & v_Month & " " & v_Year & " " & v_Hour & ":" & v_Minute & ":" & v_Second & " " & v_TimezoneSign & v_TimezoneHours & v_TimezoneMinutes; + } + + + /* + * @desc format date and time acc. to UTC + * @param p_LocalTime + * @return charstring + * @status APPROVED (IMS) + */ + function f_UTC_FormatDateTime(Struct_tm_Type p_LocalTime) return charstring + { + var charstring v_Year := int2str(p_LocalTime.tm_year + 1900); + var charstring v_Month := fl_FormatIntegerAsTwoDigits(p_LocalTime.tm_mon); + var charstring v_MDay := fl_FormatIntegerAsTwoDigits(p_LocalTime.tm_mday); + var charstring v_Hour := fl_FormatIntegerAsTwoDigits(p_LocalTime.tm_hour); + var charstring v_Minute := fl_FormatIntegerAsTwoDigits(p_LocalTime.tm_min); + var charstring v_Second := fl_FormatIntegerAsTwoDigits(p_LocalTime.tm_sec); + + return v_Year & "-" & v_Month & "-" & v_MDay & "T" & v_Hour & ":" & v_Minute & ":" & v_Second; + } + + /* + * @desc get system time and return HTTP Date/Time formatted according to RFC2616 cl. 3.3.1 and RFC822 cl. 5.1 + * @return charstring + * @status APPROVED (IMS) + */ + function fl_GetHttpDate() return charstring + { + var Struct_tm_Type v_LocalTime; + var integer v_TimezoneSeconds; + + fx_GetSystemTime(v_LocalTime, v_TimezoneSeconds); + + return f_HTTP_FormatHttpDate(v_LocalTime, v_TimezoneSeconds); + } + + template (value) Date cs_HttpDate := + { /* @status APPROVED (IMS) */ + fieldName := DATE_E, + sipDate := fl_GetHttpDate() + }; + + //---------------------------------------------------------------------------- + + template (value) SIP_ETag cs_HttpETag(charstring p_EntityTag) := + { /* @status APPROVED (IMS) */ + fieldName := SIP_ETAG_E, + entityTag := p_EntityTag + }; + + template (value) Server cs_Server(template (value) ServerVal_List p_ProductTokens) := + { /* @status APPROVED (IMS) */ + fieldName := SERVER_E, + serverBody := p_ProductTokens + }; + + template (present) UserAgent cr_UserAgent(template (present) ServerVal_List p_ProductTokens) := + { /* @status APPROVED (IMS) */ + fieldName := USER_AGENT_E, + userAgentBody := p_ProductTokens + }; + + /* + * @desc build up common receive template for UserAgent header + * @param p_ProductTokens + * @return template UserAgent + * @status APPROVED (IMS) + */ + function f_UserAgentRX(template (present) ServerVal_List p_ProductTokens) return template UserAgent + { + var template UserAgent v_UserAgent := *; + var template (present) ServerVal_List v_ProductTokens; + + if (lengthof(p_ProductTokens) > 0) { + v_ProductTokens := superset(all from p_ProductTokens); + v_UserAgent := cr_UserAgent(v_ProductTokens); + } + return v_UserAgent; + } + + //---------------------------------------------------------------------------- + + template (present) HttpRequest_Type cr_HttpRequest(template (present) HttpRequestLine_Type p_HttpRequestLine := cr_HttpRequestLine, + template UserAgent p_UserAgent := *, + template Authorization p_Authorization := *) := + { /* @status APPROVED (IMS) */ + requestLine := p_HttpRequestLine, + userAgent := p_UserAgent, // @sic R5-151795 sic@ + authorization := p_Authorization, + contentType := *, + x3GPPIntendedIdentity := *, + messageBody := * + }; + + template (present) HTTP_DATA_IND cr_HttpDataInd(template (present) IP_Connection_Type p_HttpRoutingInfo, + template (present) HttpRequest_Type p_HttpRequest) := + { /* @status APPROVED (IMS) */ + routingInfo := p_HttpRoutingInfo, + httpRequest := p_HttpRequest + }; + + //---------------------------------------------------------------------------- + /* + * @desc return ContentLength header with valid length or omit when there is no message body + * @param p_MessageBody + * @return template (omit) ContentLength + * @status APPROVED (IMS) + */ + function fl_HttpContentLength(template (omit) charstring p_MessageBody) return template (omit) ContentLength + { + if (isvalue(p_MessageBody)) { + return cs_ContentLength(lengthof(p_MessageBody)); + } + return omit; + } + + //---------------------------------------------------------------------------- + + template (value) HttpStatusLine_Type cs_HttpStatusLine(integer p_Code, + charstring p_ReasonPhrase) := + { /* @status APPROVED (IMS) */ + version := tsc_HTTP_Version_1_1, + code := p_Code, + reasonPhrase := p_ReasonPhrase + }; + + template (value) HttpStatusLine_Type cs_HttpStatusLine_200 := cs_HttpStatusLine(200, "OK"); /* @status APPROVED (IMS) */ + template (value) HttpStatusLine_Type cs_HttpStatusLine_401 := cs_HttpStatusLine(401, "Unauthorized"); /* @status APPROVED (IMS) */ + template (value) HttpStatusLine_Type cs_HttpStatusLine_404 := cs_HttpStatusLine(404, "File Not Found"); /* @status APPROVED (IMS) */ + + template (value) HttpResponse_Type cs_HttpResponse(template (value) HttpStatusLine_Type p_HttpStatusLine, + template (omit) SIP_ETag p_HttpETag := omit, + ServerVal_List p_ServerProductList, + template (omit) WwwAuthenticate p_WwwAuthenticate := omit, + template (omit) AuthenticationInfo p_AuthenticationInfo := omit, + template (omit) Expires p_Expires := omit, + template (omit) ContentType p_ContentType := omit, + template (omit) charstring p_MessageBody := omit) := + { /* @status APPROVED (IMS) */ + statusLine := p_HttpStatusLine, + date := cs_HttpDate, // @sic R5-151795 sic@ + eTag := p_HttpETag, // @sic R5-151795 sic@ + server := cs_Server(p_ServerProductList), // @sic R5-151795 sic@ + wwwauthenticate := p_WwwAuthenticate, + authenticationInfo := p_AuthenticationInfo, + contentType := p_ContentType, + contentLength := fl_HttpContentLength(p_MessageBody), // @sic R5-151795 sic@ + expires := p_Expires, + messageBody := p_MessageBody + }; + + template (value) HttpResponse_Type cs_HttpResponse_200(ServerVal_List p_ServerProductList, // @sic R5-151795 sic@ + template (omit) SIP_ETag p_HttpETag := omit, // @sic R5-151795 sic@ + template (omit) AuthenticationInfo p_AuthenticationInfo := omit, // @sic R5-151795 sic@ + template (omit) ContentType p_ContentType := omit, + template (omit) charstring p_MessageBody := omit) := + /* @status APPROVED (IMS) */ + cs_HttpResponse(cs_HttpStatusLine_200, p_HttpETag, p_ServerProductList, -, p_AuthenticationInfo, -, p_ContentType, p_MessageBody); + + template (value) HttpResponse_Type cs_HttpResponse_401(ServerVal_List p_ServerProductList, // @sic R5-151795 sic@ + template (omit) WwwAuthenticate p_Authorization) := + /* @status APPROVED (IMS) */ + cs_HttpResponse(cs_HttpStatusLine_401, -, p_ServerProductList, p_Authorization); + + template (value) HttpResponse_Type cs_HttpResponse_404(ServerVal_List p_ServerProductList) := // @sic R5-151795 sic@ + /* @status APPROVED (IMS) */ + cs_HttpResponse(cs_HttpStatusLine_404, -, p_ServerProductList); + + //---------------------------------------------------------------------------- + /* + * @desc build HTTP 200 response + * @param p_ServerProductList + * @param p_EntityTag + * @param p_MediaType (default value: omit) + * @param p_MessageBody (default value: omit) + * @return template (value) HttpResponse_Type + * @status APPROVED (IMS) + */ + function f_HttpResponse_200(ServerVal_List p_ServerProductList, + charstring p_EntityTag, + template (omit) charstring p_MediaType := omit, + template (omit) charstring p_MessageBody := omit) return template (value) HttpResponse_Type + { /* @sic R5-151795: new parameters p_Server, p_ETag sic@ */ + var template (omit) ContentType v_ContentType := omit; + var template (value) SIP_ETag v_ETag := cs_HttpETag(p_EntityTag); // @sic R5-151795 sic@ + + if (ispresent(p_MediaType)) { + v_ContentType := cs_ContentType(valueof(p_MediaType)); + } + return cs_HttpResponse_200(p_ServerProductList, v_ETag, -, v_ContentType, p_MessageBody); + } + + template (value) HTTP_DATA_REQ cs_HttpDataReq(template (value) IP_Connection_Type p_HttpRoutingInfo, + template (value) HttpResponse_Type p_HttpResponse) := + { /* @status APPROVED (IMS) */ + routingInfo := p_HttpRoutingInfo, + httpResponse := p_HttpResponse + }; + + +} diff --git a/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/HTTP_XCAP_Main.ttcn b/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/HTTP_XCAP_Main.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fb1f13c68ad9a552848e2bca4f922a9536b8943f --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/HTTP_XCAP_Main.ttcn @@ -0,0 +1,349 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-06-09 10:17:23 +0200 (Tue, 09 Jun 2015) $ +// $Rev: 13695 $ +/******************************************************************************/ + +module HTTP_XCAP_Main { + import from CommonDefs all; + import from LibSip_SIPTypesAndValues all; // NOTE: the same header definitions are used for HTTP as for SIP (Authorization, ContentType, WwwAuthenticate, AuthenticationInfo, Expires) + import from IMS_CommonDefs all; + import from IP_ASP_TypeDefs all; + import from HTTP_Component all; + import from HTTP_PTC_CoordMsg all; + import from HTTP_ASP_TypeDefs all; + import from HTTP_Templates all; + import from HTTP_Functions all; + import from XCAP_ASP_TypeDefs all; + import from XCAP_TemplatesAndFunctions all; + + //---------------------------------------------------------------------------- + /* + * @desc Gets the document selector received in the Http Request line + * @param p_RequestUri + * @return charstring - document selector + * @status APPROVED (IMS) + */ + function fl_DocSelector_FromHttpRequestUri(charstring p_RequestUri) return charstring + { + var charstring v_DocumentSelector; + + v_DocumentSelector := regexp(p_RequestUri, "(*)/~~*", 0); // "~~" is the separator, See RFC 4825 + if (v_DocumentSelector == "") { // i.e. URI does not have any node selector @sic R5s130794 change 18 sic@ + v_DocumentSelector := p_RequestUri + } + return f_URL_Decoding(v_DocumentSelector); + } + + /* + * @desc Calculates the document selector (path) for accessing the XCAP XML document associated with the UserId + * @param p_XcapRootUri + * @param p_UserId + * @return charstring + * @status APPROVED (IMS) + */ + function fl_DocSelector_Build(charstring p_XcapRootUri, + charstring p_UserId) return charstring + { + var charstring v_DocSelector := p_XcapRootUri & "/simservs.ngn.etsi.org/users/" & p_UserId & "/simservs.xml"; /* @sic R5s141051 change 4: "/" before root URI sic@ + @sic R5s150030, R5-150355, R5s150202 "/" shall be part of px_XCAP_RootUri sic@ */ + // FFS convert character ':' to %3A and character '@' to %40 according to the url encoding rules + return v_DocSelector; + } + + /* + * @desc build URI for XCAP server + * @param p_DocSelector + * @param p_NodeSelector (default value: omit) + * @return charstring + * @status APPROVED (IMS) + */ + function fl_XcapUri_Build(charstring p_DocSelector, + template (omit) charstring p_NodeSelector := omit) return charstring + { + var charstring v_XcapUri := p_DocSelector; + + if (ispresent(p_NodeSelector)) { + v_XcapUri := v_XcapUri & "/~~/" & valueof(p_NodeSelector); + } + + return v_XcapUri; + } + + //---------------------------------------------------------------------------- + /* + * @desc get command IMS PTC + * @param p_Port + * @return IMS_HTTP_Command_Type + * @status APPROVED (IMS) + */ + function f_HTTP_IMS_CoordMsg_ReceiveCommand(XCAP_IMS_CO_ORD_PORT p_Port) return IMS_HTTP_Command_Type + { + var template (present) IMS_HTTP_Command_Type v_ExpectedCommand := ?; + var IMS_HTTP_Command_Type v_Command; + + p_Port.receive(v_ExpectedCommand) -> value v_Command; + return v_Command; + } + + /* + * @desc send response to IMS PTC + * @param p_Port + * @param p_Result (default value: "") + * @param p_Error (default value: omit) + * @status APPROVED (IMS) + */ + function f_HTTP_IMS_CoordMsg_SendResponse(XCAP_IMS_CO_ORD_PORT p_Port, + charstring p_Result := "", + template (omit) charstring p_Error := omit) + { + var IMS_HTTP_Response_Type v_Response; + + if (isvalue(p_Error)) { + v_Response.Error := valueof(p_Error); + } else { + v_Response.Result := p_Result; + } + p_Port.send(v_Response); + } + + //---------------------------------------------------------------------------- + /* + * @desc check validity of the request line of an HTTP request + * @param p_RequestUri + * @param p_DocSelector + * @return template (omit) charstring + * @status APPROVED (IMS) + */ + function fl_HTTP_CheckRequestUri(charstring p_RequestUri, + charstring p_DocSelector) return template (omit) charstring + { + var template (omit) charstring v_Error := omit; + + if (p_DocSelector != fl_DocSelector_FromHttpRequestUri(p_RequestUri)) { + v_Error := "invalid doc selector"; + } + return v_Error; + } + + //---------------------------------------------------------------------------- + /* + * @desc check validity of HTTP request + * @param p_HttpRequest + * @param p_DocSelector + * @return template (omit) charstring + * @status APPROVED (IMS) + */ + function fl_HTTP_CheckRequest(HttpRequest_Type p_HttpRequest, + charstring p_DocSelector) return template (omit) charstring + { + var template (omit) charstring v_Error := omit; + var charstring v_RequestUri := p_HttpRequest.requestLine.uri; + var boolean v_UriHasNodeSelector := match(v_RequestUri, pattern "*~~*"); + + v_Error := fl_HTTP_CheckRequestUri(v_RequestUri, p_DocSelector); + if (not isvalue(v_Error)) { + if (p_HttpRequest.requestLine.method == "PUT") { + if (not isvalue(p_HttpRequest.messageBody)) { + v_Error := "missing message body for HTTP PUT"; + } + else if (not isvalue(p_HttpRequest.contentType)) { + v_Error := "missing content type for HTTP PUT"; + } else { /* @sic R5s130794 change 16 sic@ */ + select (valueof(p_HttpRequest.contentType.mediaType)) { + case (tsc_Simservs_ContentType_Document) { + if (v_UriHasNodeSelector) { + v_Error := "invalid content type for HTTP PUT: uri has node selector but content type refers to document"; + } + } + case (tsc_Simservs_ContentType_Element, tsc_Simservs_ContentType_Attribute) { + if (not v_UriHasNodeSelector) { + v_Error := "invalid content type for HTTP PUT: uri has no node selector but content type refers to element/attribute"; + } + } + case else { + v_Error := "invalid content type for HTTP PUT"; + } + } + } + } + } + return v_Error; + } + + /* + * @desc loop to receive HTTP requests and send the respective reponse + * @param p_Watchdog + * @param p_InactivityDuration + * @param p_DocSelector + * @param p_InitialHttpRequest (default value: omit) + * @return template (omit) charstring + * @status APPROVED (IMS) + */ + function fl_HTTP_SendReceiveLoop(timer p_Watchdog, + float p_InactivityDuration, + charstring p_DocSelector, + template (omit) HTTP_DATA_IND p_InitialHttpRequest := omit) runs on HTTP_PTC return template (omit) charstring + { + var template (omit) HTTP_DATA_IND v_HTTP_DATA_IND := p_InitialHttpRequest; + var template (omit) charstring v_Error := omit; + var boolean v_Finished := false; + var float v_InactivityDuration := 9999.0; // => in fact infinity (for first message only) @sic R5s130794 change 20 sic@ + var charstring v_Method; + var template (omit) charstring v_ContentType; + var template (omit) charstring v_XmlBody; + var HttpRequest_Type v_HttpRequest; + var IP_Connection_Type v_HttpRoutingInfo; + var XCAP_RSP v_XcapResponse; + var charstring v_ETag_UpperPart := "478fb2358f7"; // @sic R5-151795 sic@ + var integer v_ETag_LowerPartInteger := 0; // @sic R5-151795 sic@ + var charstring v_ETag; + var ServerVal_List v_ServerProductList := { "XCAP-Server" }; + + while (not v_Finished) { + if (not isvalue(v_HTTP_DATA_IND)) { + v_HTTP_DATA_IND := f_HTTP_ReceiveRequest(HTTPDATA, p_Watchdog, v_InactivityDuration); // returns omit in case of timeout @sic R5s150269: v_InactivityDuration instead of p_InactivityDuration sic@ + } + v_InactivityDuration := p_InactivityDuration; // => apply inactivity timer for all subsequent messages + if (not isvalue(v_HTTP_DATA_IND)) { // timeout + v_Finished := true; + } + else { + v_HttpRequest := valueof(v_HTTP_DATA_IND.httpRequest); + v_HttpRoutingInfo := valueof(v_HTTP_DATA_IND.routingInfo); + v_Error := fl_HTTP_CheckRequest(v_HttpRequest, p_DocSelector); + if (isvalue(v_Error)) { + v_Finished := true; + } + else { + v_Method := v_HttpRequest.requestLine.method; + if (ispresent(v_HttpRequest.contentType)) { + v_ContentType := v_HttpRequest.contentType.mediaType; + v_XmlBody := v_HttpRequest.messageBody; + } else { + v_ContentType := omit; + v_XmlBody := omit; + } + + v_XcapResponse := f_XCAP_GetResponse(XCAP, + v_Method, + v_HttpRequest.requestLine.uri, + v_ContentType, + v_XmlBody); + v_XmlBody := v_XcapResponse.xmlBody; + if ((v_Method == "GET") and not ispresent(v_XmlBody)) { + f_HTTP_SendResponse(HTTPDATA, v_HttpRoutingInfo, cs_HttpResponse_404(v_ServerProductList)); // 404 - File Not Found + } + else { // Send Http Response 200 OK to the UE + v_ETag := v_ETag_UpperPart & oct2str(int2oct(v_ETag_LowerPartInteger, 1)); + if (v_Method == "PUT") { // @sic R5-151795: ETag incremented for each PUT sic@ + v_ETag_LowerPartInteger := v_ETag_LowerPartInteger + 1; + } + f_HTTP_SendResponse(HTTPDATA, v_HttpRoutingInfo, f_HttpResponse_200(v_ServerProductList, v_ETag, v_XcapResponse.contentType, v_XmlBody)); + } + } + } + v_HTTP_DATA_IND := omit; + } + return v_Error; + } + + /* + * @desc Main loop for the HTTP_PTC + * @status APPROVED (IMS) + */ + function f_HTTP_XCAP_Main() runs on HTTP_PTC + { + var IMS_HTTP_Command_Type v_IMS_Command; + var HTTP_ConfigurationParams_Type v_ConfigurationParams; + var HTTP_AuthenticationMethod_Type v_AuthenticationMethod; + var template (value) HTTP_AuthenticationResult_Type v_AuthenticationResult; + var XCAP_RSP v_XcapResponse; + var charstring v_SimservsDocument; + var charstring v_DocSelector; + var template (omit) charstring v_Error; + var template (omit) HTTP_DATA_IND v_InitialHttpRequest; + timer t_Watchdog; + + v_IMS_Command := f_HTTP_IMS_CoordMsg_ReceiveCommand(IMS); + if (not ischosen(v_IMS_Command.Configure)) { + FatalError(__FILE__, __LINE__, "invalid command"); // at the beginning HTTP needs to be configured + } + v_ConfigurationParams := v_IMS_Command.Configure; + v_AuthenticationMethod := v_ConfigurationParams.AuthenticationMethod; + + // Configure HTTP server(s) -> IP_PTC + f_HTTP_Configure(HTTPCTRL, + v_ConfigurationParams.XcapServerAddrAndPort_List, // @sic R5s150148 sic@ + v_ConfigurationParams.BsfServerAddrAndPort_List, // @sic R5s150148 sic@ + v_ConfigurationParams.DrbRoutingInfo); + + // Configure XCAP Server + v_DocSelector := fl_DocSelector_Build(v_ConfigurationParams.XcapRootUri, + v_ConfigurationParams.XcapUserId); + f_XCAP_Initialise(XCAP, v_DocSelector); + f_HTTP_IMS_CoordMsg_SendResponse(IMS); + + while (true) { + + v_IMS_Command := f_HTTP_IMS_CoordMsg_ReceiveCommand(IMS); // Get command from IMS PTC + + if (ischosen(v_IMS_Command.DocumentSet)) { // Set document + v_SimservsDocument := v_IMS_Command.DocumentSet; + f_XCAP_Put(XCAP, fl_XcapUri_Build(v_DocSelector), tsc_Simservs_ContentType_Document, v_SimservsDocument); + f_HTTP_IMS_CoordMsg_SendResponse(IMS); + } + else if (ischosen(v_IMS_Command.DocumentGet)) { // Get document + v_XcapResponse := f_XCAP_Get(XCAP, fl_XcapUri_Build(v_DocSelector)); + if (not ispresent(v_XcapResponse.xmlBody)) { + FatalError(__FILE__, __LINE__, "File Not Found"); + } else { + v_SimservsDocument := v_XcapResponse.xmlBody; + f_HTTP_IMS_CoordMsg_SendResponse(IMS, v_SimservsDocument); + } + } + else if (ischosen(v_IMS_Command.TransactionStart)) { // Start transaction: HTTP requests and responses acc. to 34.229 C.29 + + t_Watchdog.start(v_IMS_Command.TransactionStart.MaxDuration); + v_InitialHttpRequest := omit; + v_Error := omit; + + select (v_AuthenticationMethod) { + case (httpDigestAuthentication, httpDigestAndGbaAuthentication) { + // do authentication: + v_AuthenticationResult := f_HTTP_Authentication(HTTPDATA, + t_Watchdog, + v_AuthenticationMethod, + v_ConfigurationParams.PrivateUserId, + v_ConfigurationParams.HomeDomainName, + v_ConfigurationParams.XcapUsername); + if (ischosen(v_AuthenticationResult.Error)) { + v_Error := v_AuthenticationResult.Error; + } + if (ischosen(v_AuthenticationResult.InitialRequest)) { + v_InitialHttpRequest := v_AuthenticationResult.InitialRequest; + v_Error := fl_HTTP_CheckRequestUri(valueof(v_InitialHttpRequest.httpRequest.requestLine.uri), v_DocSelector); + } + v_AuthenticationMethod := noAuthentication; // no further authentication + } + case else { + // no authentication + } + } + if (not isvalue(v_Error)) { + v_Error := fl_HTTP_SendReceiveLoop(t_Watchdog, v_IMS_Command.TransactionStart.InactivityDuration, v_DocSelector, v_InitialHttpRequest); + } + t_Watchdog.stop; + f_HTTP_IMS_CoordMsg_SendResponse(IMS, -, v_Error); + } + else { + FatalError(__FILE__, __LINE__, "invalid command"); + } + } + } +} diff --git a/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/XCAP_ASP_TypeDefs.ttcn b/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/XCAP_ASP_TypeDefs.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fb6559d0bef390ace273490bdc3f2633b70f4ce4 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/XCAP_ASP_TypeDefs.ttcn @@ -0,0 +1,39 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2014-07-24 19:05:45 +0200 (Thu, 24 Jul 2014) $ +// $Rev: 11846 $ +/******************************************************************************/ +module XCAP_ASP_TypeDefs { + + group XCAP_ASP_Definitions { + + type record XCAP_REQ { /* ASP type for sending a request to the external XCAP server according to RFC 4825 [26] */ + charstring method, /* GET, PUT, DELETE or RESET */ + charstring xcapExpression, /* XCAP expression sent by the UE in its http request line */ + charstring contentType optional, /* media type as contained in the HTTP content type header */ + charstring xmlBody optional /* XML fragment sent by the UE in its http body or simservs document initialised by the test cases */ + }; + + type record XCAP_RSP { /* ASP type for sending the response to the XCAP_REQ from the XCAP server to TTCN */ + charstring errorInfo optional, /* string indicating a system error */ + charstring contentType optional, /* media type as contained in the HTTP content type header */ + charstring xmlBody optional /* Result returned by the XCAP server */ + }; + + } with { encode "XCAPCodec" } + + //============================================================================ + // Port definitions + + type port XCAP_PORT message + { + in XCAP_RSP; + out XCAP_REQ; + }; + +} diff --git a/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/XCAP_TemplatesAndFunctions.ttcn b/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/XCAP_TemplatesAndFunctions.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0cf43585a8ad57641330a80b4208fca407e25a38 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/XCAP_HTTP/XCAP_TemplatesAndFunctions.ttcn @@ -0,0 +1,119 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2014-03-05 19:20:41 +0100 (Wed, 05 Mar 2014) $ +// $Rev: 10922 $ +/******************************************************************************/ + +module XCAP_TemplatesAndFunctions { + import from CommonDefs all; + import from XCAP_ASP_TypeDefs all; + + template (value) XCAP_REQ cs_XcapRequest(charstring p_Method, + charstring p_XcapUri, + template (omit) charstring p_ContentType := omit, + template (omit) charstring p_XmlBody := omit) := + { /* @status APPROVED (IMS) */ + method := p_Method, + xcapExpression := p_XcapUri, + contentType := p_ContentType, + xmlBody := p_XmlBody + }; + + template (value) XCAP_REQ cs_XcapResetReq(charstring p_DocSelector) := cs_XcapRequest("RESET", p_DocSelector); /* @status APPROVED (IMS) */ + + template (present) XCAP_RSP cr_XcapRsp := + { /* @status APPROVED (IMS) */ + errorInfo := *, + contentType := *, + xmlBody := * + }; + + //============================================================================ + /* + * @desc receive response from XCAP server + * @param p_XcapPort + * @return XCAP_RSP + * @status APPROVED (IMS) + */ + function f_XCAP_ReceiveResponse(XCAP_PORT p_XcapPort) return XCAP_RSP + { + var XCAP_RSP v_XCAP_RSP; + p_XcapPort.receive(cr_XcapRsp) -> value v_XCAP_RSP; + if (ispresent(v_XCAP_RSP.errorInfo)) { + FatalError(__FILE__, __LINE__, v_XCAP_RSP.errorInfo); + } + return v_XCAP_RSP; + } + + /* + * @desc get response from XCAP server + * @param p_XcapPort + * @param p_Method + * @param p_XcapUri + * @param p_ContentType (default value: omit) + * @param p_XmlBody (default value: omit) + * @return XCAP_RSP + * @status APPROVED (IMS) + */ + function f_XCAP_GetResponse(XCAP_PORT p_XcapPort, + charstring p_Method, + charstring p_XcapUri, + template (omit) charstring p_ContentType := omit, + template (omit) charstring p_XmlBody := omit) return XCAP_RSP + { + var XCAP_RSP v_XcapResponse; + + p_XcapPort.send(cs_XcapRequest(p_Method, p_XcapUri, p_ContentType, p_XmlBody)); + v_XcapResponse := f_XCAP_ReceiveResponse(p_XcapPort); + return v_XcapResponse; + } + + /* + * @desc Send PUT to XCAP server + * @param p_XcapPort + * @param p_XcapUri + * @param p_ContentType (default value: omit) + * @param p_XmlBody (default value: omit) + * @status APPROVED (IMS) + */ + function f_XCAP_Put(XCAP_PORT p_XcapPort, + charstring p_XcapUri, + template (omit) charstring p_ContentType := omit, + template (omit) charstring p_XmlBody := omit) + { + f_XCAP_GetResponse(p_XcapPort, "PUT", p_XcapUri, p_ContentType, p_XmlBody); + } + + /* + * @desc Send GET to XCAP server + * @param p_XcapPort + * @param p_XcapUri + * @return XCAP_RSP + * @status APPROVED (IMS) + */ + function f_XCAP_Get(XCAP_PORT p_XcapPort, + charstring p_XcapUri) return XCAP_RSP + { + return f_XCAP_GetResponse(p_XcapPort, "GET", p_XcapUri); + } + + //---------------------------------------------------------------------------- + /* + * @desc Initialises the XCAP server with an initial document + * @param p_XcapPort + * @param p_DocSelector + * @status APPROVED (IMS) + */ + function f_XCAP_Initialise(XCAP_PORT p_XcapPort, + charstring p_DocSelector) + { + p_XcapPort.send(cs_XcapResetReq(p_DocSelector)); + f_XCAP_ReceiveResponse(p_XcapPort); + } + +} diff --git a/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/RFC4745-common-policy.xsd b/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/RFC4745-common-policy.xsd new file mode 100644 index 0000000000000000000000000000000000000000..17f89914c4ccd95356c0becab55fe12d5c1a65d5 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/RFC4745-common-policy.xsd @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/TS24109.xsd b/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/TS24109.xsd new file mode 100644 index 0000000000000000000000000000000000000000..2768dd30a3b83449f94d379fea06452c42aa66dc --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/TS24109.xsd @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/TS24604.xsd b/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/TS24604.xsd new file mode 100644 index 0000000000000000000000000000000000000000..102e239bb83089f45c156ce4cd2444e4a79cf2df --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/TS24604.xsd @@ -0,0 +1,64 @@ + + + + + + + + + + + + + This is the communication diversion configuration document. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/TS24607-OIP-OIR.xsd b/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/TS24607-OIP-OIR.xsd new file mode 100644 index 0000000000000000000000000000000000000000..21e62929cb9a182dc4deec13397e9227f2472d2d --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/TS24607-OIP-OIR.xsd @@ -0,0 +1,31 @@ + + + + + Originating Identity presentation Restriction + + + + + + + + + + + + + + + + + + + + + + Originating Identity Presentation + + + + \ No newline at end of file diff --git a/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/TS24608-TIP-TIR R2.xsd b/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/TS24608-TIP-TIR R2.xsd new file mode 100644 index 0000000000000000000000000000000000000000..556b4a3164d7ddd3ccec6f94bbad08597ddc87b7 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/TS24608-TIP-TIR R2.xsd @@ -0,0 +1,31 @@ + + + + + Terminating Identity presentation Restriction + + + + + + + + + + + + + + + + + + + + + + Terminating Identity Presentation + + + + \ No newline at end of file diff --git a/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/TS24611.xsd b/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/TS24611.xsd new file mode 100644 index 0000000000000000000000000000000000000000..842e53fb556716079a1afb0ed6f2ab6ee5ff4a45 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/TS24611.xsd @@ -0,0 +1,50 @@ + + + + + + + + + + + + This is the incoming communication barring configuration document. + + + + + + + + + + + + + + + + + This is the outgoing communication barring configuration document. + + + + + + + + + + + + + + + + + + + + diff --git a/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/XCAP.xsd b/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/XCAP.xsd new file mode 100644 index 0000000000000000000000000000000000000000..3c2ef20dccf3226e1d7c16bca4f71d634b8d2e06 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/XCAP.xsd @@ -0,0 +1,71 @@ + + + + + + XML Schema for data manipulation of Supplementary Services + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/xdm_commonPolicy-V1_0.xsd b/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/xdm_commonPolicy-V1_0.xsd new file mode 100644 index 0000000000000000000000000000000000000000..74b00042c63201ac6275041eceebb43e1e45d0d2 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS/XCAP_XSD/xdm_commonPolicy-V1_0.xsd @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IMS_PART4_IWD_15wk38/IMS_Testsuite_PART4.ttcn b/IMS_PART4_IWD_15wk38/IMS_Testsuite_PART4.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f2e4a80fee74bd3b2db95c0f9e867e494b13ff1d --- /dev/null +++ b/IMS_PART4_IWD_15wk38/IMS_Testsuite_PART4.ttcn @@ -0,0 +1,1819 @@ +/******************************************************************************/ +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +/******************************************************************************/ + +module IMS_Testsuite_PART4 { + + import from MTC_Main_IMS_PART4 all; + import from MTC_Component_IMS_PART4 all; + import from IMS_34229_SelectionExpressions all; + import from IMS_Component all; + import from IMS_CC_Component all; + import from IMS_CC_AuthenticationTestcases all; + import from IMS_CC_CallControlTestcases all; + import from IMS_CC_CodecSelecting all; + import from IMS_CC_EmergencyCallTestcases all; + import from IMS_CC_MediaTestcases all; + import from IMS_CC_NotificationTestcases all; + import from IMS_CC_PDPContextActivationTestcases all; + import from IMS_CC_P_CSCFDiscoveryTestcases all; + import from IMS_CC_RegistrationTestcases all; + import from IMS_CC_SMSTestcases all; + import from IMS_CC_SSConferencingTestcases all; + import from IMS_CC_SSTestcases all; + import from IMS_CC_SSXcapTestcases all; + import from IMS_CC_SubscriptionTestcases all; + import from IMS_CustomizedAlertingTonesTestcases all; + + //---------------------------------------------------------------------------- + testcase TC_10_1() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Invalid Behaviour - 503 Service Unavailable + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_10_1_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_11_1() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Network-initiated deregistration + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_11_1_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_11_2() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Network initiated re-authentication + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_11_2_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_12_12() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MO MTSI Voice Call Successful with preconditions + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_12_12_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_12_13() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MT MTSI Speech call + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_12_13_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_12_16() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MO MTSI Text call + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_12_16_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_12_17() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MT MTSI Text call + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_12_17_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_12_18() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MTSI MO speech call / SSAC / 0% access probability for MTSI MO speech call + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_12_18_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_12_18a() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MTSI MO speech call / SSAC in Connected mode / 0% access probability for MTSI MO speech call + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_12_18a_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_12_18b() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MTSI MO speech call / SSAC in Connected mode / access probability changed for MTSI MO speech call + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_12_18b_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_12_19() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MTSI MO video call / SSAC / 0% access probability for MTSI MO video call + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_12_19_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_12_19a() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MTSI MO video call / SSAC in connected mode / 0% access probability for MTSI MO video call + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_12_19a_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_12_19b() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MTSI MO speech call / SSAC in Connected mode / access probability changed for MTSI MO video call + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_12_19b_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_12_2() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MO Call - 503 Service Unavailable + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_12_2_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_12_20() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Emergency call / Success / SSAC / 0% access propability for MTSI MO speech call + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + v_IMS2 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_12_20_IMS1()); + v_IMS2.start(f_TC_12_20_IMS2()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_12_20a() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Emergency call / Success / SSAC in connected mode / 0% access probability for MTSI MO speech call + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + v_IMS2 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_12_20a_IMS1()); + v_IMS2.start(f_TC_12_20a_IMS2()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_12_21() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MO MTSI Video call + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_12_21_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_12_22() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MT MTSI Video call + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_12_22_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_12_23() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MO MTSI speech call/EVS + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_12_23_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_12_24() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MT MTSI speech call / EVS + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_12_24_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_12_25() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MO MTSI speech call / EVS / AMR-WB + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_12_25_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_12_2a() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MO Call - 504 Server Time-out + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_12_2a_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_1() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Originating Identification Presentation + + var IMS_XCAP_PTC v_IMS1 := null; + var IMS_XCAP_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(720); + + v_IMS1 := IMS_XCAP_PTC.create alive; + + f_MTC_IMS_XCAP_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_1_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_10() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Communication Forwarding on Not logged-in + + var IMS_XCAP_PTC v_IMS1 := null; + var IMS_XCAP_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(720); + + v_IMS1 := IMS_XCAP_PTC.create alive; + + f_MTC_IMS_XCAP_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_10_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_10a() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Communication Forwarding on Not reachable + + var IMS_XCAP_PTC v_IMS1 := null; + var IMS_XCAP_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(720); + + v_IMS1 := IMS_XCAP_PTC.create alive; + + f_MTC_IMS_XCAP_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_10a_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_11() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MO Call Hold without announcement + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_11_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_11a() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MO Video Call Hold without announcement + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_11a_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_12() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MT Call Hold without announcement + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_12_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_12a() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MT Video Call Hold without announcement + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_12a_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_13() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Incoming Communication Barring except for a specific user + + var IMS_XCAP_PTC v_IMS1 := null; + var IMS_XCAP_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(720); + + v_IMS1 := IMS_XCAP_PTC.create alive; + + f_MTC_IMS_XCAP_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_13_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_14a() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Incoming Communication Barring while roaming + + var IMS_XCAP_PTC v_IMS1 := null; + var IMS_XCAP_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(720); + + v_IMS1 := IMS_XCAP_PTC.create alive; + + f_MTC_IMS_XCAP_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_14a_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_14b() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Outgoing Communication Barring while roaming + + var IMS_XCAP_PTC v_IMS1 := null; + var IMS_XCAP_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_XCAP_PTC.create alive; + + f_MTC_IMS_XCAP_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_14b_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_15() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Subscription to the MWI event package + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_15_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_17() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Creating and leaving a conference + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_17_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_19() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Inviting user to conference by sending a REFER request to the conference focus + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_19_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_19a() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Inviting user to conference by sending a REFER request to the conference focus / Video + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_19a_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_2() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Originating Identification Restriction + + var IMS_XCAP_PTC v_IMS1 := null; + var IMS_XCAP_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(720); + + v_IMS1 := IMS_XCAP_PTC.create alive; + + f_MTC_IMS_XCAP_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_2_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_21() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Joining a conference after being invited to it + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_21_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_21a() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Three way session creation + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_21a_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_21b() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Joining a conference after being invited to it / Video + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_21b_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_21c() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Three way session creation / Video + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_21c_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_27() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Communication Waiting and answering the call + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_27_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_28() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Communication Waiting and cancelling the call + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_28_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_29() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // GBA authentication + + var IMS_XCAP_PTC v_IMS1 := null; + var IMS_XCAP_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_XCAP_PTC.create alive; + + f_MTC_IMS_XCAP_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_29_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_3() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Terminating Identification Presentation + + var IMS_XCAP_PTC v_IMS1 := null; + var IMS_XCAP_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(720); + + v_IMS1 := IMS_XCAP_PTC.create alive; + + f_MTC_IMS_XCAP_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_3_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_4() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Terminating Identification Restriction + + var IMS_XCAP_PTC v_IMS1 := null; + var IMS_XCAP_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(720); + + v_IMS1 := IMS_XCAP_PTC.create alive; + + f_MTC_IMS_XCAP_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_4_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_5() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Communication Forwarding unconditional + + var IMS_XCAP_PTC v_IMS1 := null; + var IMS_XCAP_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(720); + + v_IMS1 := IMS_XCAP_PTC.create alive; + + f_MTC_IMS_XCAP_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_5_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_7() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Communication Forwarding on non Reply: activation + + var IMS_XCAP_PTC v_IMS1 := null; + var IMS_XCAP_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(720); + + v_IMS1 := IMS_XCAP_PTC.create alive; + + f_MTC_IMS_XCAP_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_7_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_8() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Communication Forwarding on non reply: MO call initiation + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_8_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_15_9() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Communication Forwarding on Busy + + var IMS_XCAP_PTC v_IMS1 := null; + var IMS_XCAP_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(720); + + v_IMS1 := IMS_XCAP_PTC.create alive; + + f_MTC_IMS_XCAP_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_15_9_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_16_2() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Speech AMR, indicate selective codec modes + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_16_2_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_16_3() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Speech AMR-WB, indicate all codec modes + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_16_3_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_16_4() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Speech AMR-WB, indicate all codec modes + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_16_4_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_17_1() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MO Speech, add video remove video + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_17_1_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_17_2() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // MT Speech, add video remove video + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_17_2_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_18_1() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Mobile Originating SMS + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_18_1_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_18_2() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Mobile Terminating SMS + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_18_2_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_19_1_1() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Emergency call with emergency registration / Success / Location information available + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + v_IMS2 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_19_1_1_IMS1()); + v_IMS2.start(f_TC_19_1_1_IMS2()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_19_1_2() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Emergency call with emergency registration / Success / Location information not available + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + v_IMS2 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_19_1_2_IMS1()); + v_IMS2.start(f_TC_19_1_2_IMS2()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_19_1_5() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Emergency call with emergency registration / Emergency SIP signalling and media in parallel with an other ongoing IM CN subsystem signalling and media + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + v_IMS2 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_19_1_5_IMS1()); + v_IMS2.start(f_TC_19_1_5_IMS2()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_19_3_1() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Non-UE detectable emergency call / IM CN sends a 1xx response / UE geographical location information available + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_19_3_1_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_19_3_3() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Non-UE detectable emergency call / IM CN sends 380 Alternative Service / Emergency IMS registration + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + v_IMS2 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_19_3_3_IMS1()); + v_IMS2.start(f_TC_19_3_3_IMS2()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_19_3_4() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Non-UE detectable emergency call / IM CN sends 380 with an Alternative Service / Previous emergency IMS registration not expired + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + v_IMS2 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_19_3_4_IMS1()); + v_IMS2.start(f_TC_19_3_4_IMS2()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_19_5_10() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Deregistration upon emergency registration expiration + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + v_IMS2 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_19_5_10_IMS1()); + v_IMS2.start(f_TC_19_5_10_IMS2()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_19_5_6() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // User-initiated emergency reregistration / UE has emergency related ongoing dialog + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + v_IMS2 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_19_5_6_IMS1()); + v_IMS2.start(f_TC_19_5_6_IMS2()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_19_5_7() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // User-initiated emergency reregistration / The user initiates an emergency call + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + v_IMS2 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_19_5_7_IMS1()); + v_IMS2.start(f_TC_19_5_7_IMS2()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_19_5_8() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // User-initiated emergency reregistration / Standalone transactions exist + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + v_IMS2 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_19_5_8_IMS1()); + v_IMS2.start(f_TC_19_5_8_IMS2()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_19_5_9() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // In parallel emergency and non-emergency registrations + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + v_IMS2 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_19_5_9_IMS1()); + v_IMS2.start(f_TC_19_5_9_IMS2()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_20_1() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Mobile Originating CAT - Forking Model + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_20_1_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_6_3() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Dedicated PDP Context Establishment + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_6_3_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_7_1() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // P-CSCF Discovery via PDP Context + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_7_1_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_8_1() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Initial registration + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_8_1_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_8_14() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Initial registration for three implicit registration sets + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_8_14_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_8_15() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Refresh for ISIM parameters + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_8_15_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_8_16() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // User initiated re-registration- 423 Interval Too Brief + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_8_16_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_8_2() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // User Initiated Re-Registration + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(3600); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_8_2_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_8_3() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Mobile Initiated Deregistration + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_8_3_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_8_4() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Invalid Behaviour - 423 Interval Too Brief + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_8_4_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_9_1() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Invalid Behaviour - MAC Parameter Invalid + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_9_1_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + testcase TC_9_2() runs on MTC_IMS system SYSTEM_IMS { + // @purpose + // Invalid Behaviour - SQN out of range + + var IMS_PTC v_IMS1 := null; + var IMS_PTC v_IMS2 := null; + + timer t_GuardTimer := int2float(300); + + v_IMS1 := IMS_PTC.create alive; + + f_MTC_IMS_CreateMapAndConnectPTCs(v_IMS1, v_IMS2); + + v_IMS1.start(f_TC_9_2_IMS()); + + t_GuardTimer.start; + + f_MTC_IMS_MainLoop(t_GuardTimer); + } + //---------------------------------------------------------------------------- + control { + if (f_SelectionExpr(IMS34_R)) { execute(TC_10_1()); } + if (f_SelectionExpr(IMS34_R)) { execute(TC_11_1()); } + if (f_SelectionExpr(IMS34_C17)) { execute(TC_11_2()); } + if (f_SelectionExpr(IMS34_C22)) { execute(TC_12_12()); } + if (f_SelectionExpr(IMS34_C27)) { execute(TC_12_13()); } + if (f_SelectionExpr(IMS34_C26)) { execute(TC_12_16()); } + if (f_SelectionExpr(IMS34_C37)) { execute(TC_12_17()); } + if (f_SelectionExpr(IMS34_C68)) { execute(TC_12_18()); } + if (f_SelectionExpr(IMS34_C68)) { execute(TC_12_18a()); } + if (f_SelectionExpr(IMS34_C68)) { execute(TC_12_18b()); } + if (f_SelectionExpr(IMS34_C69)) { execute(TC_12_19()); } + if (f_SelectionExpr(IMS34_C69)) { execute(TC_12_19a()); } + if (f_SelectionExpr(IMS34_C69)) { execute(TC_12_19b()); } + if (f_SelectionExpr(IMS34_C22)) { execute(TC_12_2()); } + if (f_SelectionExpr(IMS34_C64)) { execute(TC_12_20()); } + if (f_SelectionExpr(IMS34_C64)) { execute(TC_12_20a()); } + if (f_SelectionExpr(IMS34_C71)) { execute(TC_12_21()); } + if (f_SelectionExpr(IMS34_C70)) { execute(TC_12_22()); } + if (f_SelectionExpr(IMS34_C83)) { execute(TC_12_23()); } + if (f_SelectionExpr(IMS34_C83)) { execute(TC_12_24()); } + if (f_SelectionExpr(IMS34_C83)) { execute(TC_12_25()); } + if (f_SelectionExpr(IMS34_C22)) { execute(TC_12_2a()); } + if (f_SelectionExpr(IMS34_C43)) { execute(TC_15_1()); } + if (f_SelectionExpr(IMS34_C30)) { execute(TC_15_10()); } + if (f_SelectionExpr(IMS34_C30)) { execute(TC_15_10a()); } + if (f_SelectionExpr(IMS34_C23)) { execute(TC_15_11()); } + if (f_SelectionExpr(IMS34_C77)) { execute(TC_15_11a()); } + if (f_SelectionExpr(IMS34_C23)) { execute(TC_15_12()); } + if (f_SelectionExpr(IMS34_C77)) { execute(TC_15_12a()); } + if (f_SelectionExpr(IMS34_C24)) { execute(TC_15_13()); } + if (f_SelectionExpr(IMS34_C24)) { execute(TC_15_14a()); } + if (f_SelectionExpr(IMS34_Cxx_R5153996)) { execute(TC_15_14b()); } + if (f_SelectionExpr(IMS34_C50)) { execute(TC_15_15()); } + if (f_SelectionExpr(IMS34_C32)) { execute(TC_15_17()); } + if (f_SelectionExpr(IMS34_C32)) { execute(TC_15_19()); } + if (f_SelectionExpr(IMS34_C78)) { execute(TC_15_19a()); } + if (f_SelectionExpr(IMS34_C44)) { execute(TC_15_2()); } + if (f_SelectionExpr(IMS34_C32)) { execute(TC_15_21()); } + if (f_SelectionExpr(IMS34_C61)) { execute(TC_15_21a()); } + if (f_SelectionExpr(IMS34_C78)) { execute(TC_15_21b()); } + if (f_SelectionExpr(IMS34_C79)) { execute(TC_15_21c()); } + if (f_SelectionExpr(IMS34_C57)) { execute(TC_15_27()); } + if (f_SelectionExpr(IMS34_C57)) { execute(TC_15_28()); } + if (f_SelectionExpr(IMS34_C81)) { execute(TC_15_29()); } + if (f_SelectionExpr(IMS34_C48)) { execute(TC_15_3()); } + if (f_SelectionExpr(IMS34_C49)) { execute(TC_15_4()); } + if (f_SelectionExpr(IMS34_C30)) { execute(TC_15_5()); } + if (f_SelectionExpr(IMS34_C30)) { execute(TC_15_7()); } + if (f_SelectionExpr(IMS34_C31)) { execute(TC_15_8()); } + if (f_SelectionExpr(IMS34_C30)) { execute(TC_15_9()); } + if (f_SelectionExpr(IMS34_C27)) { execute(TC_16_2()); } + if (f_SelectionExpr(IMS34_C28)) { execute(TC_16_3()); } + if (f_SelectionExpr(IMS34_C28)) { execute(TC_16_4()); } + if (f_SelectionExpr(IMS34_C71)) { execute(TC_17_1()); } + if (f_SelectionExpr(IMS34_C70)) { execute(TC_17_2()); } + if (f_SelectionExpr(IMS34_C55)) { execute(TC_18_1()); } + if (f_SelectionExpr(IMS34_C56)) { execute(TC_18_2()); } + if (f_SelectionExpr(IMS34_C76)) { execute(TC_19_1_1()); } + if (f_SelectionExpr(IMS34_C59)) { execute(TC_19_1_2()); } + if (f_SelectionExpr(IMS34_C72)) { execute(TC_19_1_5()); } + if (f_SelectionExpr(IMS34_C73)) { execute(TC_19_3_1()); } + if (f_SelectionExpr(IMS34_C59)) { execute(TC_19_3_3()); } + if (f_SelectionExpr(IMS34_C59)) { execute(TC_19_3_4()); } + if (f_SelectionExpr(IMS34_C59)) { execute(TC_19_5_10()); } + if (f_SelectionExpr(IMS34_C59)) { execute(TC_19_5_6()); } + if (f_SelectionExpr(IMS34_C59)) { execute(TC_19_5_7()); } + if (f_SelectionExpr(IMS34_C57)) { execute(TC_19_5_8()); } + if (f_SelectionExpr(IMS34_C59)) { execute(TC_19_5_9()); } + if (f_SelectionExpr(IMS34_C82)) { execute(TC_20_1()); } + if (f_SelectionExpr(IMS34_C04)) { execute(TC_6_3()); } + if (f_SelectionExpr(IMS34_C05)) { execute(TC_7_1()); } + if (f_SelectionExpr(IMS34_C17)) { execute(TC_8_1()); } + if (f_SelectionExpr(IMS34_C17)) { execute(TC_8_14()); } + if (f_SelectionExpr(IMS34_C17)) { execute(TC_8_15()); } + if (f_SelectionExpr(IMS34_C17)) { execute(TC_8_16()); } + if (f_SelectionExpr(IMS34_C17)) { execute(TC_8_2()); } + if (f_SelectionExpr(IMS34_C80)) { execute(TC_8_3()); } + if (f_SelectionExpr(IMS34_C17)) { execute(TC_8_4()); } + if (f_SelectionExpr(IMS34_C17)) { execute(TC_9_1()); } + if (f_SelectionExpr(IMS34_C17)) { execute(TC_9_2()); } + } +} diff --git a/IMS_PART4_IWD_15wk38/PicsPixit/IMS_CC_Parameters.ttcn b/IMS_PART4_IWD_15wk38/PicsPixit/IMS_CC_Parameters.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..91a41a54648b0f4e84d7f09743aaec4e48b5d6ba --- /dev/null +++ b/IMS_PART4_IWD_15wk38/PicsPixit/IMS_CC_Parameters.ttcn @@ -0,0 +1,191 @@ +/******************************************************************************/ +// AUTOMATICALLY GENERATED MODULE - DO NOT MODIFY +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-05-26 16:38:07 +0200 (Tue, 26 May 2015) $ +// $Rev: 13602 $ +/******************************************************************************/ + +module IMS_CC_Parameters { + + import from CommonDefs all; + + //**************************************************************************** + // PIXIT Parameters + //---------------------------------------------------------------------------- + modulepar charstring px_IMS_CalleeContactUri2 := "sip:User-C-Contact@3gpp.org"; + // @desc URI provided by the remote side (i.e. by SS) to be used by the UE as contact address in further SIP signalling of the dialog + // NOTE: in general this URI shall be different than the one in px_CalleeUri + // Reference to other Spec: 34.229-3 + + modulepar charstring px_IMS_CalleeUri2 := "sip:User-C@3gpp.org"; + // @desc URI of Callee, sent by the UE in INVITE (MO call establishment) to address the remote UE + // Reference to other Spec: 34.229-3 + + modulepar charstring px_IMS_ConferenceFactoryUri := "sip:mmtel@conf-factory.3gpp.org"; + // @desc conference factory URI as used by the UE for IMS conferencing + + modulepar charstring px_IMS_FinalConferenceUri := "sip:final@conf-factory.3gpp.org"; + // @desc final conference URI as sent to the UE during MTSI conference creation + + modulepar charstring px_IMS_HomeDomainName_Refreshed := "refreshed3gpp.org"; + // @desc Used in 8.15 + + modulepar charstring px_IMS_MessageAccountIdentity := ""; // @desc message accout identity configured at the UE as used for subscription to message-summary event package + + modulepar charstring px_IMS_Private_UserId_Refreshed := "privateuser@refreshed3gpp.org"; + // @desc Used in 8.15 + + modulepar charstring px_IMS_PublicUserIdentity1_Refreshed := "sip:PublicId1@refreshed3gpp.org"; + // @desc Used in 8.15 + + modulepar charstring px_IMS_TemporaryConferenceUri := "sip:temporary@conf-factory.3gpp.org"; + // @desc temporary conference URI as sent to the UE during MTSI conference creation + + modulepar charstring px_SMS_SMSC_InternationalNumber; // @desc international number of the SMSC: + // It is set to the same value as used in EFPSISMSC if the EF is present on the ISIM (or the USIM ) + // Otherwise it is set to the same value as EFSMSP + // Reference to other Spec: 34.229-3 + + modulepar boolean px_UEwithSIM := false; // @desc UE has a SIM inserted + // Supported values: true,false + // Reference to other Spec: 34.229-3 + + modulepar charstring px_XCAPServerAddress := "10.122.11.26"; // @desc XCAP Server address + // Supported values: IPv4 or IPv6 + // Reference to other Spec: 34.229-3 + + modulepar charstring px_XCAP_RootUri := "/XCAP.3gpp.org"; + // @desc XCAP Root URI + + modulepar charstring px_XCAP_TargetUri := "sip:user@domain.com"; + // @desc Target (SIP or TEL URI) where to forward to + + modulepar charstring px_XCAP_Username; // @desc username to be used for HTTP authentication in case of pc_XCAP_UsernameIsConfiguredInUE==true + + + //**************************************************************************** + // PICS Parameters + //---------------------------------------------------------------------------- + modulepar boolean pc_BidirecVoiceOverIMS := false; // @desc UE capable of initiating a bidirectional voice session over IMS + // Reference: 34.229-2 Table A.12/12 + + modulepar boolean pc_CommunicationHold_DuringEmergencyCall := false; + // @desc UE supports Communication Hold during emergency call + // Reference: 34.229-2, Table A.12/33 + + modulepar boolean pc_EarlyMedia := false; // @desc UE supports early media + // Reference: 34.229-2 Table A.12/45 + + modulepar boolean pc_HttpDigestAuthentication := false; // @desc HTTP Digest XCAP Authentication + // Reference: 34.229-2, Table A.6a/4 + + modulepar boolean pc_HttpGBAAuthentication := false; // @desc GBA XCAP Authentication + // Reference: 34.229-2, Table A.6a/3 + + modulepar boolean pc_IMS_EmergencyCall := false; // @desc UE supports IMS emergency services + // Reference: 34.229-2 Table A.12/26 + + modulepar boolean pc_IMS_TWS := false; // @desc Three way session + // Reference: 34.229-2, Table A.16/14 + + modulepar boolean pc_IndicateSigcomp := false; // @desc Indicate the willingness to receive the responses and requests compressed from initial REGISTER onwards by using the "comp=sigcomp" parameter + // Reference: 34.229-2 Table A.8/5 + + modulepar boolean pc_InitiateP_CSCFDiscovery_viaDHCPv4 := false; // @desc UE capable of being configured to initiate P-CSCF discovery via DHCPv4 + // Reference: 34.229-2 Table A.13/1 + + modulepar boolean pc_InitiateP_CSCFDiscovery_viaDHCPv6 := false; // @desc UE capable of being configured to initiate P-CSCF discovery via DHCPv6 + // Reference: 34.229-2 Table A.12/7 + + modulepar boolean pc_InitiateP_CSCFDiscovery_viaPCO := false; // @desc UE capable of being configured to initiate P-CSCF discovery via PCO + // Reference: 34.229-2 Table A.12/5 + + modulepar boolean pc_InitiatesDedicatedPDPContext := false; // @desc UE capable of being configured to initiate Dedicated PDP Context + // Reference: 34.229-2 Table A.12/4 + + modulepar boolean pc_MTSI_ACR := false; // @desc MTSI supplementary services - Anonymous Communication Rejection + // Reference: 34.229-2 Table A.16/12 + + modulepar boolean pc_MTSI_CommDivert := false; // @desc MTSI supplementary services - Communication Diversion + // Reference: 34.229-2 Table A.16/5 + + modulepar boolean pc_MTSI_CommHold := false; // @desc Communication Hold + // Reference: 34.229-2 Table A.16/6 + + modulepar boolean pc_MTSI_CommWaiting := false; // @desc MTSI supplementary services - Communication Waiting + // Reference: 34.229-2 Table A.16/13 + + modulepar boolean pc_MTSI_Conference := false; // @desc MTSI supplementary services - Conference + // Reference: 34.229-2 Table A.16/9 + + modulepar boolean pc_MTSI_Incoming_CB := false; // @desc MTSI supplementary services - Incoming Communication Barring + // Reference: 34.229-2 Table A.16/7 + + modulepar boolean pc_MTSI_MessageWait := false; // @desc MTSI supplementary services - Message Waiting Indication + // Reference: 34.229-2 Table A.16/8 + + modulepar boolean pc_MTSI_OIP := false; // @desc MTSI supplementary services - Originating Identification Presentation + // Reference: 34.229-2 Table A.16/1 + + modulepar boolean pc_MTSI_OIR := false; // @desc MTSI supplementary services - Originating Identification Restriction + // Reference: 34.229-2 Table A.16/2 + + modulepar boolean pc_MTSI_Outgoing_CB := false; // @desc MTSI supplementary services - Outgoing Communication Barring + // Reference: 34.229-2 Table A.16/15 + + modulepar boolean pc_MTSI_Speech_AMRWB := false; // @desc MTSI media - Speech, AMR wideband + // Reference: 34.229-2 Table A.15/2 + + modulepar boolean pc_MTSI_Speech_EVS := false; // @desc MTSI media - Speech EVS + // Reference: 34.229-2 Table A.15/10 + + modulepar boolean pc_MTSI_TIP := false; // @desc MTSI supplementary services - Terminating Identification Presentation + // Reference: 34.229-2 Table A.16/3 + + modulepar boolean pc_MTSI_TIR := false; // @desc MTSI supplementary services - Terminating Identification Restriction + // Reference: 34.229-2 Table A.16/4 + + modulepar boolean pc_MTSI_Text_RTP := false; // @desc MTSI media - Text, RTP + // Reference: 34.229-2 Table A.15/7 + + modulepar boolean pc_P_CSCFDiscovery_viaDHCP := false; // @desc UE supports P-CSCF Discovery via DHCP + // Reference: 34.229-2 Table A.12/9 + + modulepar boolean pc_P_CSCFDiscovery_viaDHCPv4 := false; // @desc UE supports P-CSCF discovery via DHCPv4 + // Reference: 34.229-2 Table A.13/2 + + modulepar boolean pc_P_CSCFDiscovery_viaDHCPv6 := false; // @desc UE supports P-CSCF discovery via DHCPv6 + // Reference: 34.229-2 Table A.12/10 + + modulepar boolean pc_P_CSCFDiscovery_viaPCO := false; // @desc UE supports P-CSCF Discovery via PCO + // Reference: 34.229-2 Table A.12/8 + + modulepar boolean pc_Preconditions := false; // @desc Integration of resource management and SIP? (use of preconditions) + // Reference: 34.229-2 Table A.4/16 + + modulepar boolean pc_SMS_MO := false; // @desc UE supports SM-over-IP sender + // Reference: 34.229-2 Table A.3A/61 + + modulepar boolean pc_SubscribeConferenceEvent_OutsideINVITEDialog := false; + // @desc UE supports subscription to conference event package outside INVITE dialog + // Reference: 34.229-2 Table A.12/xx + + modulepar boolean pc_TMPI_forGBA := false; // @desc UE uses TMPI in HTTP request for GBA + // Reference: 34.229-2 Table A.12/44 + + modulepar boolean pc_VideoCodecH264CBP := false; // @desc MTSI media - Video codec H.264 CBP Level 1.2 + // Reference: 34.229-2 Table A.15/9 + + modulepar boolean pc_XCAP_UsernameIsConfiguredInUE := false; // @desc UE indicated OMA-TS-XDM_MO-V1_1-20080627-A.doc, section 5.2.8 "Node: //AAUTHNAME" is configured + // Reference: 34.229-2 Table A.12/37 + + modulepar boolean pc_XCAP_XUIisDefaultPublicUserId := false; // @desc UE uses the default public user id received in P-Associated-URI header in 200 OK for REGISTER as XCAP User Identity (XUI) + // Reference: 34.229-2 Table A.12/38 + + +} diff --git a/IMS_PART4_IWD_15wk38/PicsPixit/IMS_CommonParameters.ttcn b/IMS_PART4_IWD_15wk38/PicsPixit/IMS_CommonParameters.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9fc4bddfd84e200bccd1e490e1dde13dfdd845ac --- /dev/null +++ b/IMS_PART4_IWD_15wk38/PicsPixit/IMS_CommonParameters.ttcn @@ -0,0 +1,122 @@ +/******************************************************************************/ +// AUTOMATICALLY GENERATED MODULE - DO NOT MODIFY +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-05-26 16:38:07 +0200 (Tue, 26 May 2015) $ +// $Rev: 13602 $ +/******************************************************************************/ + +module IMS_CommonParameters { + + import from IP_ASP_TypeDefs all; + + //**************************************************************************** + // PIXIT Parameters + //---------------------------------------------------------------------------- + modulepar charstring px_IMS_AssociatedTelUri := "tel:+4989364072"; + // @desc Set as record 3 in EFIMPU as defined in TS 34.229-1[5] + // Reference to other Spec: 34.229-3 + + modulepar charstring px_IMS_CalleeContactUri := "sip:User-B-Contact@3gpp.org"; + // @desc URI provided by the remote side (i.e. by SS) to be used by the UE as contact address in further SIP signalling of the dialog + // NOTE: in general this URI shall be different than the one in px_CalleeUri + // Reference to other Spec: 34.229-3 + + modulepar charstring px_IMS_CalleeUri := "sip:User-B@3gpp.org"; + // @desc URI of Callee, sent by the UE in INVITE (MO call establishment) to address the remote UE + // Reference to other Spec: 34.229-3 + + modulepar IPsec_CipheringAlgorithm_Type px_IMS_CiphAlgo_Def := des_ede3_cbc; // @desc Ciphering Algorithm + // Supported values: + // des_ede3_cbc, + // aes_cbc, + // nociph + // Reference to other Spec: 34.229-3 + + modulepar charstring px_IMS_HomeDomainName := "3gpp.org"; // @desc Home Domain Name. + // When using an ISIM it is set to the same value as EFDOMAIN. + // When not using ISIM just USIM the home domain name is derived from px_IMSI (preceded by 'sip:') + // Reference to other Spec: 34.229-3 + + modulepar IPsec_IntegrityAlgorithm_Type px_IMS_IPSecAlgorithm := hmac_sha_1_96; // @desc Integrity Algorithm + // Supported values: + // hmac_md5_96, + // hmac_sha_1_96 + // Reference to other Spec: 34.229-3 + + modulepar charstring px_IMS_Private_UserId := "privateuser@3gpp.org"; + // @desc Private User Identity.When usingan ISIM this is set to the same value as EFIMPI.When ISIM is not used just USIM the private user identity is derived from px_IMSI. + // + // Reference to other Spec: 34.229-3 + + modulepar charstring px_IMS_PublicUserIdentity1 := "sip:PublicId1@3gpp.org"; + // @desc Public User Identity. It is set to the same value as the first record in EFIMPU. + // Reference to other Spec: 34.229-3 + + modulepar charstring px_IMS_PublicUserIdentity2 := "sip:PublicId2@3gpp.org"; + // @desc Public User Identity. It is set to the same value as the second record in EFIMPU. + // Reference to other Spec: 34.229-3 + + modulepar charstring px_IMS_PublicUserIdentity3 := "sip:PublicId3@3gpp.org"; + // @desc Public User Identity. It is set to the same value as the third record in EFIMPU. + // Reference to other Spec: 34.229-3 + + modulepar charstring px_IMS_Scscf := "scscf.3gpp.org"; + // @desc S-CSCF fully qualified domain name that resolves to the IP address of SS + // Reference to other Spec: 34.229-3 + + modulepar boolean px_UEwithISIM := true; // @desc true - UE has ISIM; false - UE has USIM only + // Reference to other Spec: 34.229-3 + + + //**************************************************************************** + // PICS Parameters + //---------------------------------------------------------------------------- + modulepar boolean pc_IMS_Deregistration := false; // @desc UE has the method that supports IMS deregistration + // Reference: 34.229-2 Table A.12/39 + + modulepar boolean pc_IMS_GIBA_Sec := false; // @desc UE supports GIBA security only + // Reference: 34.229-2 Table A.6a/1 + + modulepar boolean pc_IMS_GRUUsInSIP := false; // @desc UE supports obtaining and using GRUUs in the Session Initiation Protocol (SIP) + // Reference: 34.229-2 Table A.4/53 + + modulepar boolean pc_IMS_Geolocation := false; // @desc UE is capable of obtaining location information + // Reference: 34.229-2 Table A.12/27 + + modulepar boolean pc_IMS_RtcpDuringVoiceSession := false; // @desc RTCP used during voice session. This is mutually exclusive to pc_SendRTCPOnlyOnHold + // Reference: 34.229-2 Table A.12/35 + + modulepar boolean pc_IMS_Sec := false; // @desc UE supports full IMS security + // Reference: 34.229-2 Table A.6a/2 + + modulepar boolean pc_IMS_SessionIdSupported := false; // @desc UE supports session id + // Reference: 34.229-2 Table A.12/30 + + modulepar boolean pc_IMS_Video_FeatureTag := false; // @desc UE indicates video media feature tag in REGISTER and INVITE request + // Reference: 34.229-2 Table A.12/32 + + modulepar boolean pc_InitiateSession := false; // @desc Initiating a session + // Reference: 34.229-2 Table A.4/2B + + modulepar boolean pc_MTSI_Speech := false; // @desc MTSI media - Speech + // Reference: 34.229-2 Table A.15/1 + + modulepar boolean pc_MTSI_Video := false; // @desc MTSI media - Video + // Reference: 34.229-2 Table A.15/3 + + modulepar boolean pc_MultimediaTelephonyService := false; // @desc Multimedia telephony service participant + // Reference: 34.229-2 Table A.3A/50 + + modulepar boolean pc_SMS_MT := false; // @desc UE supports SM-over-IP receiver + // Reference: 34.229-2 Table A.3A/62 + + modulepar boolean pc_SendRTCPOnlyOnHold := true; // @desc UE supports sending RTCP only while call is put on hold. This is mutually exclusive to pc_IMS_RtcpDuringVoiceSession + // Reference: 34.229-2 Table A.12/23 + + +} diff --git a/IMS_PART4_IWD_15wk38/PicsPixit/Parameters.ttcn b/IMS_PART4_IWD_15wk38/PicsPixit/Parameters.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f0dea888a05681498e6782f1d001a6137ec75763 --- /dev/null +++ b/IMS_PART4_IWD_15wk38/PicsPixit/Parameters.ttcn @@ -0,0 +1,1050 @@ +/******************************************************************************/ +// AUTOMATICALLY GENERATED MODULE - DO NOT MODIFY +// @copyright Copyright Notification +// No part may be reproduced except as authorized by written permission. +// The copyright and the foregoing restriction extend to reproduction in all media. +// Trademark 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). +// All rights reserved. +// @version: IWD_15wk38 +// $Date: 2015-09-15 10:30:10 +0200 (Tue, 15 Sep 2015) $ +// $Rev: 14364 $ +/******************************************************************************/ + +module Parameters { + + import from CommonDefs all; + import from NAS_CommonTypeDefs all; + + //**************************************************************************** + // PIXIT Parameters + //---------------------------------------------------------------------------- + modulepar octetstring px_AccessPointName; // @desc Access Point Name + + modulepar EUTRA_ATTACH_TESTED_Type px_AttachTypeTested := EPS_ATTACH_ONLY; // @desc Attach Type to be tested, if UE supports both pc_Attach and pc_Combined_Attach + // Supported values: EPS_ATTACH_ONLY, COMBINED_ATTACH + + modulepar B16_Type px_AuthAMF; // @desc Authentication Management Field (16 bits). The value shall be different from '1111 1111 1111 111'B (AMFresynch). + // Default value: no default value can be proposed + // Reference to other Spec: 34.123-3, Table B.1 + + modulepar B128_Type px_AuthK := oct2bit('000102030405060708090A0B0C0D0E0F'O); + // @desc Authentication Key + // Reference to other Spec: 34.123-3, Table B.1 + + modulepar O43_Type px_ETWS_DigitalSignature; // @desc ETWS Digital Signature + + modulepar O8_Type px_EllipsoidPointWithAltitude; // @desc Ellipsoid Point With Altitude value to be provided in Update UE location information (see 36.509 cl 6.12) + + modulepar charstring px_EmergencyCallNumber := "112"; // @desc Emergency Number used by UE to initiate an emergency call + // Reference to other Spec: 34.123-3, Table B.1.2 + + modulepar integer px_FDD_OperationBand; // @desc The operation band under test, as defined in 34.108 clause 5.1.1. Value 1 means Band 1, 2 means Band 2 etc.This pixit shall be set in synchronisation with the values that are being set to 6 other Pixits viz: px_UARFCN_D_High, px_UARFCN_D_Mid,px_UARFCN_L_Mid + // Reference to other Spec: 34.123-3, Table B.1 + + modulepar O3_Type px_HorizontalVelocity; // @desc Horizontal Velocity to be provided in Update UE location information (see 36.509 cl 6.12) + + modulepar hexstring px_IMEISV_Def; // @desc Default IMEISV value. No default can be proposed as this is a manufacturer defined value + // Reference to other Spec: 34.123-3, Table B.1 + + modulepar hexstring px_IMEI_Def; // @desc Default IMEI value. No default can be proposed as this is a manufacturer defined value + // Reference to other Spec: 34.123-3, Table B.1 + + modulepar hexstring px_IMSI_Def := '001010123456063'H; + // @desc Default IMSI + // Reference to other Spec: 34.123-3, Table B.1 + + modulepar integer px_IP_MTU_Size := 65535; // @desc MTU size. This value is specific to the SS. + + modulepar charstring px_IPv4_Address1_NW; // @desc IPv4 Gateway Address in PDN1 + + modulepar charstring px_IPv4_Address1_RemoteUE; // @desc IPv4 Address of remote UE connected to PDN1 + + modulepar charstring px_IPv4_Address1_UE; // @desc IPv4 Address connected to PDN1 + + modulepar charstring px_IPv4_Address2_NW; // @desc IPv4 Gateway Address in PDN2 + + modulepar charstring px_IPv4_Address2_RemoteUE; // @desc IPv4 Address of remote UE connected to PDN2 + + modulepar charstring px_IPv4_Address2_UE; // @desc IPv4 Address connected to PDN2 + + modulepar charstring px_IPv4_Address2a_UE; // @desc IPv4 Address connected to PDN2a + + modulepar charstring px_IPv4_Address_HomeAgent; // @desc IPv4 Home Address Agent + + modulepar charstring px_IPv6_Address1_NW; // @desc IPv6 Gateway Address in PDN1 + + modulepar charstring px_IPv6_Address1_RemoteUE; // @desc IPv6 Address of remote UE in PDN1 + + modulepar charstring px_IPv6_Address1_UE; // @desc IPv6 Address in PDN1 + + modulepar charstring px_IPv6_Address2_NW; // @desc IPv6 Gateway Address in PDN2 + + modulepar charstring px_IPv6_Address2_RemoteUE; // @desc IPv6 Address of remote UE in PDN2 + + modulepar charstring px_IPv6_Address2_UE; // @desc IPv6 Address in PDN2 + + modulepar charstring px_IPv6_Address2a_UE; // @desc IPv6 Address in PDN2a + + modulepar charstring px_IPv6_Address_HomeAgent; // @desc IPv6 Home Address Agent + + modulepar integer px_MFBI_UTRAN_FrequencyBand; // @desc A supported UTRAN MFBI frequency band. + // Reference to other Spec: 34.123-3, Table B.1.20 + + modulepar octetstring px_PTMSI_Def := 'C2345678'O; // @desc Default PTMSI + // Reference to other Spec: 34.123-3, Table B.1 + + modulepar octetstring px_PTMSI_SigDef := 'AB1234'O; // @desc Default PTMSI signature (3 octets, 3GPP 24.008 / 10.5.5.8). + // Reference to other Spec: 34.123-3, Table B.1 + + modulepar bitstring px_PWS_CB_DataCodingScheme; // @desc CMAS or ETWS data coding scheme of the alphabet/codingand the applied language (see TS 23.401) + + modulepar charstring px_PWS_CB_DataPage1; // @desc ETWS or CMAS Page 1 warning data message + + modulepar charstring px_PWS_CB_DataPage2; // @desc ETWS or CMAS Page 2 warning data message + + modulepar charstring px_PWS_CB_DataPage3; // @desc CMAS or ETWS Page 3 warning data message + + modulepar charstring px_PWS_CB_DataPage4; // @desc CMAS or ETWS Page 4 warning data message + + modulepar RATComb_Tested_Type px_RATComb_Tested := EUTRA_UTRA; // @desc This parameter represents the network RAT capability/preference and indicates which, if any is supported, RAT combination is to be tested + // Supported values: EUTRA_UTRA, EUTRA_GERAN, EUTRA_Only + + modulepar boolean px_SMS_ChkMsgReceived := true; // @desc Whether the operator can check an MT Short Message received + + modulepar integer px_SMS_IndexOffset := 0; // @desc Memory location index at UE for SMS storage, used in +CMSS command + // Reference to other Spec: 34.123-3, Table B.1.2 + + modulepar charstring px_SMS_MsgFrmt := "1"; // @desc SMS message format (see TS 27.005 cl.3.2.). NOTE: Default value is for text mode. Change value to 0 to execute tests with PDU mode + + modulepar charstring px_SMS_PrefMem1 := "SM"; // @desc SMS Preferred Memory 1 of TS 27.005 [31], clause 3.2.2 + // Reference to other Spec: 34.123-3, Table B.1.2 + + modulepar charstring px_SMS_PrefMem2 := "SM"; // @desc SMS Preferred Memory 2 of TS 27.005 [31], clause 3.2.2 + // Reference to other Spec: 34.123-3, Table B.1.2 + + modulepar charstring px_SMS_PrefMem3 := "MT"; // @desc SMS Preferred Memory 3 of TS 27.005 [31], clause 3.2.2 + // Reference to other Spec: 34.123-3, Table B.1.2 + + modulepar charstring px_SMS_Service := "0"; // @desc SMS Service of TS 27.005 [31], clause 3.2.1 + // Reference to other Spec: 34.123-3, Table B.1.2 + + modulepar SinglePLMN_TestedType px_SinglePLMN_Tested := MultiPLMN; // @desc This parameter represents the network capability/preference to support multi PLMNs on the same test Band and indicates the preference of multi PLMNs or single PLMN test environment + // Supported values: SinglePLMN, MultiPLMN, MultiPLMNinPrimaryBand, MultiPLMNinSecondaryBand + + modulepar octetstring px_TMSI_Def := '12345678'O; // @desc Default TMSI + // Reference to other Spec: 34.123-3, Table B.1 + + modulepar O1_Type px_TestLoopModeB_Delay := '5A'O; // @desc This parameter represents the IP PDU delay to be used for UE test loop mode B intest cases, where long delay may be needed e.g. because of user interaction. + + modulepar CS_PS_MODE px_UE_CS_PS_UsageSetting_Tested := VOICE_CENTRIC; + // @desc specifies which CS/PS mode is under test @sic R5s120274 sic@ + // Supported values: VOICE_CENTRIC, DATA_CENTRIC + + modulepar PS_MODE px_UE_PS_UsageSetting_Tested := VOICE_CENTRIC; // @desc specifies which PS mode is under test @sic R5s120274 sic@ + // Supported values: VOICE_CENTRIC, DATA_CENTRIC + + modulepar UTRAN_FDD_TDD_Type px_UTRAN_ModeUnderTest := UTRAN_FDD; // @desc specifies which radio access technology is being tested in UTRAN + // Supported values: UTRAN_FDD, UTRAN_TDD + + modulepar integer px_UTRAN_OverlappingNotSupportedFrequencyBandMFBI; + // @desc A not supported UTRAN frequency band that is overlapping with a supported MFBI band (px_MFBI_UTRAN_FrequencyBand). This pixit shall be set also in accordance with the values of the 3 Pixits: px_UARFCN_D_High, px_UARFCN_D_Mid,px_UARFCN_L_Mid. + + modulepar B128_Type px_eAuthRAND := oct2bit('A3DE0C6D363E30C364A4078F1BF8D577'O); + // @desc Random Challenge + + modulepar NAS_Mcc px_eJapanMCC_Band6 := '442'H; // @desc Japan MCC code to be used for Band 6. The same value will be used for E-UTRAN and Inter-RAT cells. Type is different to that defined in 34.123-3. + + + //**************************************************************************** + // PICS Parameters + //---------------------------------------------------------------------------- + modulepar boolean pc_1xCSfallback := false; // @desc Support of 1xCS fallback + // Reference: 36.523-2, A.4.2.1.1-1/3 + + modulepar boolean pc_1xRTT := false; // @desc UE supports CDMA2000 1xRTT band class + // Reference: 36.523-2, A.4.1-1/4 + + modulepar boolean pc_A5_4_CS := false; // @desc Support of A5/4 + // Reference: 51.010-2, A.2/87 + + modulepar boolean pc_Allowed_CSG_list := false; // @desc Support of Allowed CSG list + // Reference: 36.523-2 A.4.4-1/2 + + modulepar boolean pc_Attach := false; // @desc Support EPS attach (with or without pre-configuration) + // Reference: 36.523-2 A.4.4-2/1 + + modulepar boolean pc_Auto_PDN_Connectivity := false; // @desc Support of automatic PDN Connectivity in EUTRAN + // Reference: 36.523-2 A.4.4-1/68 + + modulepar boolean pc_Automatic_EPS_Re_Attach := false; // @desc Support of automatic re-activation of the EPS bearer(s) + // Reference: 36.523-2 A.4.4-1/64 + + modulepar boolean pc_Automatic_Re_Attach := false; // @desc Support of automatic re-activation of the EPS bearer(s) during Network Initiated Detach with detach type set to re-attach required + // Reference: 36.523-2 A.4.4-1/27 + + modulepar boolean pc_Available_PLMNs_AcT_Ind := false; // @desc Support of AccessTechnology indication in available PLMNs list + // Reference: 36.523-2 A.4.4-1/78 + + modulepar boolean pc_BSRVCC := false; // @desc UE indicates g.3gpp.ps2cs-srvcc-orig-pre-alerting media feature tag in INVITE request + // Reference: 34.229-2 A.12/36 + + modulepar boolean pc_CMAS_Message := false; // @desc Support of CMAS message + // Reference: 36.523-2 A.4.4-1/58 + + modulepar boolean pc_CS := false; // @desc UE supports CS domain services + // Reference: 34.123-2 A.3/1 + + modulepar boolean pc_CS_Em_Call_in_1xRTT := false; // @desc Support for establishing the emergency call using the CS domain in 1xRTT + // Reference: 36.523-2 A.4.4-1/37 + + modulepar boolean pc_CS_Em_Call_in_GERAN := false; // @desc Support for establishing the emergency call using the CS domain in GERAN + // Reference: 36.523-2 A.4.4-1/36 + + modulepar boolean pc_CS_Em_Call_in_UTRA := false; // @desc Support for establishing the emergency call using the CS domain in UTRA + // Reference: 36.523-2 A.4.4-1/35 + + modulepar boolean pc_CS_Fallback := false; // @desc The UE supports CS fallback for voice calls. If true, pc_CS and at least one of pc_FDD, pc_TDD_HCR, pc_TDD_LCR, pc_TDD_VHCR or pc_UMTS_GSM is also true. + // Reference: 36.523-2, A.4.2.1.1-1/1 + + modulepar boolean pc_CS_PS_data_centric := false; // @desc Support of CS/PS mode 2 + // Reference: 36.523-2 A.4.4-2/5 + + modulepar boolean pc_CS_PS_voice_centric := false; // @desc Support of configuring the UE to voice centric + // Reference: 36.523-2 A.4.4-2/4 + + modulepar boolean pc_Combined_Attach := false; // @desc Support combined EPS/IMSI attach (with or without pre-configuration) + // Reference: 36.523-2 A.4.4-2/2 + + modulepar boolean pc_DL_IntraBand_ContCaBWclassB := false; // @desc DL Intra-band contiguous CA BW class B + // Reference: 36.523-2 A.4.3.3.1-1/1 + + modulepar boolean pc_DL_IntraBand_ContCaBWclassC := false; // @desc DL Intra-band contiguous CA BW class C + // Reference: 36.523-2 A.4.3.3.1-1/2 + + modulepar boolean pc_DL_interBand_CaBwClassComb_AA := false; // @desc DL Inter-band contiguous CA BW class A-A + // Reference: 36.523-2 A.4.3.3.3-1/1 + + modulepar boolean pc_DL_intraBand_nonContCaBwClassComb_AA := false; + // @desc Support of DL intra-band non-contiguous CA BW Class Combination A-A + // Reference: 36.523-2 A.4.3.3.2-1/1 + + modulepar boolean pc_DSMIPv6 := false; // @desc Support of Mobility management based on Dual-Stack Mobile IPv6 + // Reference: 36.523-2 A.4.4-1/6 + + modulepar boolean pc_DaylightSavingTime := false; // @desc UE stores/updates the daylight saving time when receives information + // Reference: 36.523-2 A.4.4-1/93 + + modulepar boolean pc_DualRM_Coding := false; // @desc Dual RM Coding + // Reference: 36.523/2 ???? + + modulepar boolean pc_EAB := false; // @desc Support of Extended Access Barring + // Reference: 36.523-2 A.4.4-1A/4 + + modulepar boolean pc_EAB_override := false; // @desc Support of Extended Access Barring Override + // Reference: 36.523-2 A.4.4-1/91 + + modulepar boolean pc_EDTM := false; // @desc Support for EDTM + // Reference: 36.523-2 A.4.4-1/38 + + modulepar boolean pc_EMM_Information := false; // @desc Support of EMM Information message + // Reference: 36.523-2 A.4.4-1/9 + + modulepar boolean pc_EPS_Services_Disable := false; // @desc Support of disabling of EPS services + // Reference: 36.523-2 A.4.4-1/26 + + modulepar boolean pc_ESM_MO_Bearer_Allocation := false; // @desc Support of ESM UE requested bearer resource allocation procedure + // Reference: 36.523-2 A.4.4-1/10 + + modulepar boolean pc_ESM_MO_Bearer_Modification := false; // @desc Support of ESM UE requested bearer resource modification procedure + // Reference: 36.523-2 A.4.4-1/11 + + modulepar boolean pc_ESM_Notification := false; // @desc Support of ESM Notification procedure + // Reference: 36.523-2 A.4.4.1-71 + + modulepar boolean pc_ESM_UE_Modification_NW_TFT := false; // @desc Support for UE requested modification of network allocated TFTs + // Reference: 36.523-2 A.4.4-1/54 + + modulepar boolean pc_ETWS_message := false; // @desc Support of ETWS message + // Reference: 36.523-2 A.4.4-1/20 + + modulepar boolean pc_E_UTRAN_2_GERAN_PSHO := false; // @desc Support for inter-RAT PS handover from E_UTRAN to GERAN + // Reference: 36.523-2 A.4.4-1/52 + + modulepar boolean pc_EmergSpeech := false; // @desc Emergency Call + // Reference: 34.123-2 A.2/2 + + modulepar boolean pc_Enhanced_1xCSfallback := false; // @desc Support of Enhanced 1xCS fallback + // Reference: 36.523-2, A.4.2.1.1-1/6 + + modulepar boolean pc_FDD := false; // @desc UE supports UTRA band as defined in TS 25.101 + // Reference: 34.123-2 A.1/1 + + modulepar boolean pc_FeatrGrp_101_F := false; // @desc DMRS with OCC (orthogonal cover code) and SGH (sequence group hopping) disabling + // Reference: 36.523-2 A.4.5-3a/1 + + modulepar boolean pc_FeatrGrp_101_T := false; // @desc DMRS with OCC (orthogonal cover code) and SGH (sequence group hopping) disabling + // Reference: 36.523-2 A.4.5-3b/1 + + modulepar boolean pc_FeatrGrp_102_F := false; // @desc Trigger type 1 SRS (aperiodic SRS) transmission (Up to X ports) + // Reference: 36.523-2 A.4.5-3a/2 + + modulepar boolean pc_FeatrGrp_102_T := false; // @desc Trigger type 1 SRS (aperiodic SRS) transmission (Up to X ports) + // Reference: 36.523-2 A.4.5-3b/2 + + modulepar boolean pc_FeatrGrp_103_F := false; // @desc PDSCH transmission mode 9 when up to 4 CSI reference signal ports are configured + // Reference: 36.523-2 A.4.5-3a/3 + + modulepar boolean pc_FeatrGrp_103_T := false; // @desc PDSCH transmission mode 9 when up to 4 CSI reference signal ports are configured + // Reference: 36.523-2 A.4.5-3b/3 + + modulepar boolean pc_FeatrGrp_104_F := false; // @desc PDSCH transmission mode 9 for TDD when 8 CSI reference signal ports are configured + // Reference: 36.523-2 A.4.5-3a/4 + + modulepar boolean pc_FeatrGrp_104_T := false; // @desc PDSCH transmission mode 9 for TDD when 8 CSI reference signal ports are configured + // Reference: 36.523-2 A.4.5-3b/4 + + modulepar boolean pc_FeatrGrp_105_F := false; // @desc Periodic CQI/PMI/RI reporting on PUCCH: Mode 2-0:UE selected subband CQI without PMI, when PDSCH transmission mode 9 is configured.Periodic CQI/PMI/RI reporting on PUCCH: Mode 2-1:UE selected subband CQI with single PMI, when PDSCH transmission mode 9 and up to 4 CSI reference signal ports are configured + // Reference: 36.523-2 A.4.5-3a/5 + + modulepar boolean pc_FeatrGrp_105_T := false; // @desc Periodic CQI/PMI/RI reporting on PUCCH: Mode 2-0:UE selected subband CQI without PMI, when PDSCH transmission mode 9 is configured.Periodic CQI/PMI/RI reporting on PUCCH: Mode 2-1:UE selected subband CQI with single PMI, when PDSCH transmission mode 9 and up to 4 CSI reference signal ports are configured + // Reference: 36.523-2 A.4.5-3b/5 + + modulepar boolean pc_FeatrGrp_106_F := false; // @desc Periodic CQI/PMI/RI/PTI reporting on PUCCH: Mode 2-1: UE selected subband CQI with single PMI, when PDSCH transmission mode 9 and 8 CSI reference signal ports are configured + // Reference: 36.523-2 A.4.5-3a/6 + + modulepar boolean pc_FeatrGrp_106_T := false; // @desc Periodic CQI/PMI/RI/PTI reporting on PUCCH: Mode 2-1: UE selected subband CQI with single PMI, when PDSCH transmission mode 9 and 8 CSI reference signal ports are configured + // Reference: 36.523-2 A.4.5-3b/6 + + modulepar boolean pc_FeatrGrp_107_F := false; // @desc Aperiodic CQI/PMI/RI reporting on PUSCH: Mode 2-0: UE selected subband CQI without PMI, when PDSCH transmission mode 9 is configured. Aperiodic CQI/PMI/RI reporting on PUSCH: Mode 2-2: UE selected subband CQI with multiple PMI, when PDSCH transmission mode 9 and up to 4 CSI reference signal ports are configured + // Reference: 36.523-2 A.4.5-3a/7 + + modulepar boolean pc_FeatrGrp_107_T := false; // @desc Aperiodic CQI/PMI/RI reporting on PUSCH: Mode 2-0: UE selected subband CQI without PMI, when PDSCH transmission mode 9 is configured. Aperiodic CQI/PMI/RI reporting on PUSCH: Mode 2-2: UE selected subband CQI with multiple PMI, when PDSCH transmission mode 9 and up to 4 CSI reference signal ports are configured + // Reference: 36.523-2 A.4.5-3b/7 + + modulepar boolean pc_FeatrGrp_108_F := false; // @desc Aperiodic CQI/PMI/RI reporting on PUSCH: Mode 2-2: UE selected subband CQI with multiple PMI, when PDSCH transmission mode 9 and 8 CSI reference signal ports are configured + // Reference: 36.523-2 A.4.5-3a/8 + + modulepar boolean pc_FeatrGrp_108_T := false; // @desc Aperiodic CQI/PMI/RI reporting on PUSCH: Mode 2-2: UE selected subband CQI with multiple PMI, when PDSCH transmission mode 9 and 8 CSI reference signal ports are configured + // Reference: 36.523-2 A.4.5-3b/8 + + modulepar boolean pc_FeatrGrp_109_F := false; // @desc Periodic CQI/PMI/RI reporting on PUCCH Mode 1-1, submode 1 + // Reference: 36.523-2 A.4.5-3a/9 + + modulepar boolean pc_FeatrGrp_109_T := false; // @desc Periodic CQI/PMI/RI reporting on PUCCH Mode 1-1, submode 1 + // Reference: 36.523-2 A.4.5-3b/9 + + modulepar boolean pc_FeatrGrp_10_F := false; // @desc Support of EUTRA RRC_CONNECTED to GERAN (Packet_)Idle by Cell Change Order, EUTRA RRC_CONNECTED to GERAN (Packet_)Idle by Cell Change Order with NACC (Network Assisted Cell Change) + // Reference: 36.523-2 A.4.5-1a/10 + + modulepar boolean pc_FeatrGrp_10_T := false; // @desc Support of EUTRA RRC_CONNECTED to GERAN (Packet_)Idle by Cell Change Order, EUTRA RRC_CONNECTED to GERAN (Packet_)Idle by Cell Change Order with NACC (Network Assisted Cell Change) + // Reference: 36.523-2 A.4.5-1b/10 + + modulepar boolean pc_FeatrGrp_110_F := false; // @desc Periodic CQI/PMI/RI reporting on PUCCH Mode 1-1, submode 2 + // Reference: 36.523-2 A.4.5-3a/10 + + modulepar boolean pc_FeatrGrp_110_T := false; // @desc Periodic CQI/PMI/RI reporting on PUCCH Mode 1-1, submode 2 + // Reference: 36.523-2 A.4.5-3b/10 + + modulepar boolean pc_FeatrGrp_111_F := false; // @desc Measurement reporting trigger Event A6 + // Reference: 36.523-2 A.4.5-3a/11 + + modulepar boolean pc_FeatrGrp_111_T := false; // @desc Measurement reporting trigger Event A6 + // Reference: 36.523-2 A.4.5-3b/11 + + modulepar boolean pc_FeatrGrp_112_F := false; // @desc SCell addition within the Handover to EUTRA procedure + // Reference: 36.523-2 A.4.5-3a/12 + + modulepar boolean pc_FeatrGrp_112_T := false; // @desc SCell addition within the Handover to EUTRA procedure + // Reference: 36.523-2 A.4.5-3b/12 + + modulepar boolean pc_FeatrGrp_113_F := false; // @desc Trigger type 0 SRS (periodic SRS) transmission on X Serving Cells + // Reference: 36.523-2 A.4.5-3a/13 + + modulepar boolean pc_FeatrGrp_113_T := false; // @desc Trigger type 0 SRS (periodic SRS) transmission on X Serving Cells + // Reference: 36.523-2 A.4.5-3b/13 + + modulepar boolean pc_FeatrGrp_114_F := false; // @desc Reporting of both UTRA CPICH RSCP and Ec/N0 in a Measurement Report + // Reference: 36.523-2 A.4.5-3a/14 + + modulepar boolean pc_FeatrGrp_114_T := false; // @desc Reporting of both UTRA CPICH RSCP and Ec/N0 in a Measurement Report + // Reference: 36.523-2 A.4.5-3b/14 + + modulepar boolean pc_FeatrGrp_115_F := false; // @desc time domain ICIC RLM/RRM measurement subframe restriction for the serving cell. time domain ICIC RRM measurement subframe restriction for neighbour cells. time domain ICIC CSI measurement subframe restriction + // Reference: 36.523-2 A.4.5-3a/15 + + modulepar boolean pc_FeatrGrp_115_T := false; // @desc time domain ICIC RLM/RRM measurement subframe restriction for the serving cell. time domain ICIC RRM measurement subframe restriction for neighbour cells. time domain ICIC CSI measurement subframe restriction + // Reference: 36.523-2 A.4.5-3b/15 + + modulepar boolean pc_FeatrGrp_116_F := false; // @desc Relative transmit phase continuity for spatial multiplexing in UL + // Reference: 36.523-2 A.4.5-3a/16 + + modulepar boolean pc_FeatrGrp_116_T := false; // @desc Relative transmit phase continuity for spatial multiplexing in UL + // Reference: 36.523-2 A.4.5-3b/16 + + modulepar boolean pc_FeatrGrp_11_F := false; // @desc Support of EUTRA RRC_CONNECTED to 1xRTT CS Active handover + // Reference: 36.523-2 A.4.5-1a/11 + + modulepar boolean pc_FeatrGrp_11_T := false; // @desc Support of EUTRA RRC_CONNECTED to 1xRTT CS Active handover + // Reference: 36.523-2 A.4.5-1b/11 + + modulepar boolean pc_FeatrGrp_12_F := false; // @desc Support of EUTRA RRC_CONNECTED to HRPD Active handover + // Reference: 36.523-2 A.4.5-1a/12 + + modulepar boolean pc_FeatrGrp_12_T := false; // @desc Support of EUTRA RRC_CONNECTED to HRPD Active handover + // Reference: 36.523-2 A.4.5-1b/12 + + modulepar boolean pc_FeatrGrp_13_F := false; // @desc Support of Inter-frequency handover (within FDD or TDD) + // Reference: 36.523-2 A.4.5-1a/13 + + modulepar boolean pc_FeatrGrp_13_T := false; // @desc Support of Inter-frequency handover (within FDD or TDD) + // Reference: 36.523-2 A.4.5-1b/13 + + modulepar boolean pc_FeatrGrp_14_F := false; // @desc Support of Measurement reporting event: Event A4 - Neighbour > threshold, Measurement reporting event: Event A5 - Serving < threshold1 & Neighbour > threshold2 + // Reference: 36.523-2 A.4.5-1a/14 + + modulepar boolean pc_FeatrGrp_14_T := false; // @desc Support of Measurement reporting event: Event A4 - Neighbour > threshold, Measurement reporting event: Event A5 - Serving < threshold1 & Neighbour > threshold2 + // Reference: 36.523-2 A.4.5-1b/14 + + modulepar boolean pc_FeatrGrp_15_F := false; // @desc Support of Measurement reporting event: Event B1 - Neighbour > threshold + // Reference: 36.523-2 A.4.5-1a/15 + + modulepar boolean pc_FeatrGrp_15_T := false; // @desc Support of Measurement reporting event: Event B1 - Neighbour > threshold + // Reference: 36.523-2 A.4.5-1b/15 + + modulepar boolean pc_FeatrGrp_16_F := false; // @desc Support of Periodical measurement reporting for non-ANR related measurements + // Reference: 36.523-2 A.4.5-1a/16 + + modulepar boolean pc_FeatrGrp_16_T := false; // @desc Support of Periodical measurement reporting for non-ANR related measurements + // Reference: 36.523-2 A.4.5-1b/16 + + modulepar boolean pc_FeatrGrp_17_F := false; // @desc Support of Periodical measurement reporting for SON / ANR and ANR related intra-frequency measurement reporting events + // Reference: 36.523-2 A.4.5-1a/17 + + modulepar boolean pc_FeatrGrp_17_T := false; // @desc Support of Periodical measurement reporting for SON / ANR and ANR related intra-frequency measurement reporting events + // Reference: 36.523-2 A.4.5-1b/17 + + modulepar boolean pc_FeatrGrp_18_F := false; // @desc Support of ANR related inter-frequency measurement reporting events + // Reference: 36.523-2 A.4.5-1a/18 + + modulepar boolean pc_FeatrGrp_18_T := false; // @desc Support of ANR related inter-frequency measurement reporting events + // Reference: 36.523-2 A.4.5-1b/18 + + modulepar boolean pc_FeatrGrp_19_F := false; // @desc Support of ANR related inter-RAT measurement reporting events + // Reference: 36.523-2 A.4.5-1a/19 + + modulepar boolean pc_FeatrGrp_19_T := false; // @desc Support of ANR related inter-RAT measurement reporting events + // Reference: 36.523-2 A.4.5-1b/19 + + modulepar boolean pc_FeatrGrp_1_F := false; // @desc Support of Intra-subframe frequency hopping for PUSCH scheduled by UL grant, Extended cyclic prefix with f = 7.5kHz for DL resource block, DCI format 3a (TPC commands for PUCCH and PUSCH with single bit power adjustments), Multi-user MIMO for PDSCH, Aperiodic CQI/PMI/RI reporting on PUSCH: Mode 2-0 - UE selected subband CQI without PMI, Aperiodic CQI/PMI/RI reporting on PUSCH: Mode 2-2 - UE selected subband CQI with multiple PMI + // Reference: 36.523-2 A.4.5-1a/1 + + modulepar boolean pc_FeatrGrp_1_T := false; // @desc Support of Intra-subframe frequency hopping for PUSCH scheduled by UL grant, Extended cyclic prefix with f = 7.5kHz for DL resource block, DCI format 3a (TPC commands for PUCCH and PUSCH with single bit power adjustments), Multi-user MIMO for PDSCH, Aperiodic CQI/PMI/RI reporting on PUSCH: Mode 2-0 - UE selected subband CQI without PMI, Aperiodic CQI/PMI/RI reporting on PUSCH: Mode 2-2 - UE selected subband CQI with multiple PMI + // Reference: 36.523-2 A.4.5-1b/1 + + modulepar boolean pc_FeatrGrp_20_F := false; // @desc Support of RB combination: SRB1 and SRB2 for DCCH + x AM DRB + x UM DRB + // Reference: 36.523-2 A.4.5-1a/20 + + modulepar boolean pc_FeatrGrp_20_T := false; // @desc Support of RB combination: SRB1 and SRB2 for DCCH + x AM DRB + x UM DRB + // Reference: 36.523-2 A.4.5-1b/20 + + modulepar boolean pc_FeatrGrp_21_F := false; // @desc Support of Predefined intra-subframe frequency hopping for PUSCH with N_sb > 1, Predefined inter-subframe frequency hopping for PUSCH with N_sb > 1 + // Reference: 36.523-2 A.4.5-1a/21 + + modulepar boolean pc_FeatrGrp_21_T := false; // @desc Support of Predefined intra-subframe frequency hopping for PUSCH with N_sb > 1, Predefined inter-subframe frequency hopping for PUSCH with N_sb > 1 + // Reference: 36.523-2 A.4.5-1b/21 + + modulepar boolean pc_FeatrGrp_22_F := false; // @desc Support of UTRAN measurements and reporting in E-UTRA connected mode + // Reference: 36.523-2 A.4.5-1a/22 + + modulepar boolean pc_FeatrGrp_22_T := false; // @desc Support of UTRAN measurements and reporting in E-UTRA connected mode + // Reference: 36.523-2 A.4.5-1b/22 + + modulepar boolean pc_FeatrGrp_23_F := false; // @desc Support of GERAN measurements and reporting in E-UTRA connected mode + // Reference: 36.523-2 A.4.5-1a/23 + + modulepar boolean pc_FeatrGrp_23_T := false; // @desc Support of GERAN measurements and reporting in E-UTRA connected mode + // Reference: 36.523-2 A.4.5-1b/23 + + modulepar boolean pc_FeatrGrp_24_F := false; // @desc Support of cdma2000 measurements and reporting in E-UTRA connected mode + // Reference: 36.523-2 A.4.5-1a/24 + + modulepar boolean pc_FeatrGrp_24_T := false; // @desc Support of cdma2000 measurements and reporting in E-UTRA connected mode + // Reference: 36.523-2 A.4.5-1b/24 + + modulepar boolean pc_FeatrGrp_25_F := false; // @desc Support of Inter-frequency measurements and reporting in E-UTRA connected mode + // Reference: 36.523-2 A.4.5-1a/25 + + modulepar boolean pc_FeatrGrp_25_T := false; // @desc Support of Inter-frequency measurements and reporting in E-UTRA connected mode + // Reference: 36.523-2 A.4.5-1b/25 + + modulepar boolean pc_FeatrGrp_26_F := false; // @desc Support of HRPD measurements, reporting and measurement reporting event B2 in E-UTRA connected mode + // Reference: 36.523-2 A.4.5-1a/26 + + modulepar boolean pc_FeatrGrp_26_T := false; // @desc Support of HRPD measurements, reporting and measurement reporting event B2 in E-UTRA connected mode + // Reference: 36.523-2 A.4.5-1b/26 + + modulepar boolean pc_FeatrGrp_27_F := false; // @desc Support of EUTRA RRC_CONNECTED to UTRA CELL_DCH CS handover + // Reference: 36.523-2 A.4.5-1a/27 + + modulepar boolean pc_FeatrGrp_27_T := false; // @desc Support of EUTRA RRC_CONNECTED to UTRA CELL_DCH CS handover + // Reference: 36.523-2 A.4.5-1b/27 + + modulepar boolean pc_FeatrGrp_28_F := false; // @desc Support of TTI bundling + // Reference: 36.523-2 A.4.5-1a/28 + + modulepar boolean pc_FeatrGrp_28_T := false; // @desc Support of TTI bundling + // Reference: 36.523-2 A.4.5-1b/28 + + modulepar boolean pc_FeatrGrp_29_F := false; // @desc Support of Semi-Persistent Scheduling + // Reference: 36.523-2 A.4.5-1a/29 + + modulepar boolean pc_FeatrGrp_29_T := false; // @desc Support of Semi-Persistent Scheduling + // Reference: 36.523-2 A.4.5-1b/29 + + modulepar boolean pc_FeatrGrp_2_F := false; // @desc Support of Simultaneous CQI and ACK/NACK on PUCCH, i.e. PUCCH format 2a and 2b, Absolute TPC command for PUSCH, Resource allocation type 1 for PDSCH, Periodic CQI/PMI/RI reporting on PUCCH: Mode 2- 0 - UE selected subband CQI without PMI, Periodic CQI/PMI/RI reporting on PUCCH: Mode 2-1 - UE selected subband CQI with single PMI + // Reference: 36.523-2 A.4.5-1a/2 + + modulepar boolean pc_FeatrGrp_2_T := false; // @desc Support of Simultaneous CQI and ACK/NACK on PUCCH, i.e. PUCCH format 2a and 2b, Absolute TPC command for PUSCH, Resource allocation type 1 for PDSCH, Periodic CQI/PMI/RI reporting on PUCCH: Mode 2- 0 - UE selected subband CQI without PMI, Periodic CQI/PMI/RI reporting on PUCCH: Mode 2-1 - UE selected subband CQI with single PMI + // Reference: 36.523-2 A.4.5-1b/2 + + modulepar boolean pc_FeatrGrp_30_F := false; // @desc Support of Handover between FDD and TDD + // Reference: 36.523-2 A.4.5-1a/30 + + modulepar boolean pc_FeatrGrp_30_T := false; // @desc Support of Handover between FDD and TDD + // Reference: 36.523-2 A.4.5-1b/30 + + modulepar boolean pc_FeatrGrp_31_F := false; // @desc Support of the mechanisms defined for cells broadcasting multi band information i.e. comprehending multiBandInfoList + // Reference: 36.523-2 A.4.5-1a/31 + + modulepar boolean pc_FeatrGrp_31_T := false; // @desc Support of the mechanisms defined for cells broadcasting multi band information i.e. comprehending multiBandInfoList + // Reference: 36.523-2 A.4.5-1b/31 + + modulepar boolean pc_FeatrGrp_33_F := false; // @desc Inter-RAT ANR features for UTRAN including: Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to reportStrongestCellsForSON + // Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to reportCGI + // Reference: 36.523-2 A.4.5-1d/1 + + modulepar boolean pc_FeatrGrp_33_T := false; // @desc Inter-RAT ANR features for UTRAN including: + // Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to reportStrongestCellsForSON + // Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to reportCGI + // Reference: 36.523-2 A.4.5-1e/1 + + modulepar boolean pc_FeatrGrp_34_F := false; // @desc Inter-RAT ANR features for GERAN including: + // Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to reportStrongestCells + // Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to reportCGI + // Reference: 36.523-2 A.4.5-1d/2 + + modulepar boolean pc_FeatrGrp_34_T := false; // @desc Inter-RAT ANR features for GERAN including: + // Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to reportStrongestCells + // Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to reportCGI + // Reference: 36.523-2 A.4.5-1e/2 + + modulepar boolean pc_FeatrGrp_35_F := false; // @desc Inter-RAT ANR features for 1xRTT including: + // Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to reportStrongestCellsForSON + // Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to reportCGI + // Reference: 36.523-2 A.4.5-1d/3 + + modulepar boolean pc_FeatrGrp_35_T := false; // @desc Inter-RAT ANR features for 1xRTT including: + // Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to reportStrongestCellsForSON + // Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to reportCGI + // Reference: 36.523-2 A.4.5-1e/3 + + modulepar boolean pc_FeatrGrp_36_F := false; // @desc Inter-RAT ANR features for HRPD including: + // Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to reportStrongestCellsForSON + // Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to reportCGI + // Reference: 36.523-2 A.4.5-1d/4 + + modulepar boolean pc_FeatrGrp_36_T := false; // @desc Inter-RAT ANR features for HRPD including: Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to portStrongestCellsForSON + // Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to reportCGI + // Reference: 36.523-2 A.4.5-1e/4 + + modulepar boolean pc_FeatrGrp_37_F := false; // @desc Inter-RAT ANR features for UTRAN TDD including: + // Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to reportStrongestCellsForSON + // Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to reportCGI + // Reference: 36.523-2 A.4.5-1d/5 + + modulepar boolean pc_FeatrGrp_37_T := false; // @desc Inter-RAT ANR features for UTRAN TDD including: + // Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to reportStrongestCellsForSON + // Inter-RAT periodical measurement reporting where triggerType is set to periodical and purpose is set to reportCGI + // Reference: 36.523-2 A.4.5-1e/5 + + modulepar boolean pc_FeatrGrp_38_F := false; // @desc EUTRA RRC_CONNECTED to UTRA TDD CELL_DCH PS handover, if the UE supports both UTRAN FDD and UTRAN TDD + // Reference: 36.523-2 A.4.5-1d/6 + + modulepar boolean pc_FeatrGrp_38_T := false; // @desc EUTRA RRC_CONNECTED to UTRA TDD CELL_DCH PS handover, if the UE supports both UTRAN FDD and UTRAN TDD + // Reference: 36.523-2 A.4.5-1e/6 + + modulepar boolean pc_FeatrGrp_39_F := false; // @desc UTRAN TDD measurements, reporting and measurement reporting event B2 in E-UTRA connected mode, if the UE supports both UTRAN FDD and UTRAN TDD + // Reference: 36.523-2 A.4.5-1d/7 + + modulepar boolean pc_FeatrGrp_39_T := false; // @desc UTRAN TDD measurements, reporting and measurement reporting event B2 in E-UTRA connected mode, if the UE supports both UTRAN FDD and UTRAN TDD + // Reference: 36.523-2 A.4.5-1e/7 + + modulepar boolean pc_FeatrGrp_3_F := false; // @desc Support of Semi-persistent scheduling, TTI bundling, 5bit RLC UM SN, 7bit PDCP SN + // Reference: 36.523-2 A.4.5-1a/3 + + modulepar boolean pc_FeatrGrp_3_T := false; // @desc Support of Semi-persistent scheduling, TTI bundling, 5bit RLC UM SN, 7bit PDCP SN + // Reference: 36.523-2 A.4.5-1b/3 + + modulepar boolean pc_FeatrGrp_40_F := false; // @desc EUTRA RRC_CONNECTED to UTRA TDD CELL_DCH CS handover, if the UE supports both UTRAN FDD and UTRAN TDD + // Reference: 36.523-2 A.4.5-1d/8 + + modulepar boolean pc_FeatrGrp_40_T := false; // @desc EUTRA RRC_CONNECTED to UTRA TDD CELL_DCH CS handover, if the UE supports both UTRAN FDD and UTRAN TDD + // Reference: 36.523-2 A.4.5-1e/8 + + modulepar boolean pc_FeatrGrp_41_F := false; // @desc Measurement reporting event: Event B1 Neighbour > threshold for UTRAN FDD, if the UE supports UTRAN FDD and has set bit number 22 to 1 + // Reference: 36.523-2 A.4.5-1d/9 + + modulepar boolean pc_FeatrGrp_41_T := false; // @desc Measurement reporting event: Event B1 Neighbour > threshold for UTRAN FDD, if the UE supports UTRAN FDD and has set bit number 22 to 1 + // Reference: 36.523-2 A.4.5-1e/9 + + modulepar boolean pc_FeatrGrp_4_F := false; // @desc Support of Short DRX cycle + // Reference: 36.523-2 A.4.5-1a/4 + + modulepar boolean pc_FeatrGrp_4_T := false; // @desc Support of Short DRX cycle + // Reference: 36.523-2 A.4.5-1b/4 + + modulepar boolean pc_FeatrGrp_5_F := false; // @desc Support of Long DRX cycle, DRX command MAC control element + // Reference: 36.523-2 A.4.5-1a/5 + + modulepar boolean pc_FeatrGrp_5_T := false; // @desc Support of Long DRX cycle, DRX command MAC control element + // Reference: 36.523-2 A.4.5-1b/5 + + modulepar boolean pc_FeatrGrp_6_F := false; // @desc Support of Piroritized bit rate + // Reference: 36.523-2 A.4.5-1a/6 + + modulepar boolean pc_FeatrGrp_6_T := false; // @desc Support of Piroritized bit rate + // Reference: 36.523-2 A.4.5-1b/6 + + modulepar boolean pc_FeatrGrp_7_F := false; // @desc Support of RLC UM + // Reference: 36.523-2 A.4.5-1a/7 + + modulepar boolean pc_FeatrGrp_7_T := false; // @desc Support of RLC UM + // Reference: 36.523-2 A.4.5-1b/7 + + modulepar boolean pc_FeatrGrp_8_F := false; // @desc Support of EUTRA RRC_CONNECTED to UTRA CELL_DCH PS handover + // Reference: 36.523-2 A.4.5-1a/8 + + modulepar boolean pc_FeatrGrp_8_T := false; // @desc Support of EUTRA RRC_CONNECTED to UTRA CELL_DCH PS handover + // Reference: 36.523-2 A.4.5-1b/8 + + modulepar boolean pc_FeatrGrp_9_F := false; // @desc Support of EUTRA RRC_CONNECTED to GERAN GSM_Dedicated handover + // Reference: 36.523-2 A.4.5-1a/9 + + modulepar boolean pc_FeatrGrp_9_T := false; // @desc Support of EUTRA RRC_CONNECTED to GERAN GSM_Dedicated handover + // Reference: 36.523-2 A.4.5-1b/9 + + modulepar boolean pc_FullNameNetwork := false; // @desc Support of storage of the network full name + // Reference: 36.523-2 A.4.4-1/12 + + modulepar boolean pc_GERAN := false; // @desc UE Supports GSM and/or GPRS + // Reference: 36.523-2 A.4.1-1/7 + + modulepar boolean pc_GERAN_2_E_UTRAN_PSHO := false; // @desc Support of GERAN to E-UTRAN PS Handover + // Reference: 36.523-2 A.4.4-1/29 + + modulepar boolean pc_GERAN_2_E_UTRAN_meas := false; // @desc Supports Neighbour Cell measurements and Network controlled & autonomous cell reselection to E-UTRAN + // Reference: 36.523-2 A.4.4-1/21 + + modulepar boolean pc_GERAN_2_E_UTRAN_measreporting_CCN := false; // @desc Supports CCN towards E-UTRAN, E-UTRAN Neighbour cell measurement reporting and Network controlled cell reselection to E-UTRAN + // Reference: 36.523-2 A.4.4-1/39 + + modulepar boolean pc_HO_from_UTRA_to_eFDD := false; // @desc Support of Inter-RAT PS handover to E-UTRA from UTRA (FDD) + // Reference: 36.523-2 A.4.4-1/8 + + modulepar boolean pc_HO_from_UTRA_to_eTDD := false; // @desc Support of Inter-RAT PS handover to E-UTRA from UTRA (TDD) + // Reference: 36.523-2 A.4.4-1/53 + + modulepar boolean pc_HRPD := false; // @desc UE supports CDMA2000 HRPD band class + // Reference: 36.523-2, A.4.1-1/3 + + modulepar boolean pc_IMS := false; // @desc Support of IMS + // Reference: 36.523-2 A.4.4-1/25 + + modulepar boolean pc_IMSI_Detach := false; // @desc Support of detach for non-EPS services + // Reference: 36.523-2 A.4.4-1/34 + + modulepar boolean pc_IMS_APN_default := false; // @desc Configured with IMS APN as default APN + // Reference: 36.523-2 A.4.4-2/11 + + modulepar boolean pc_IMS_CS_PS_SRVCC := false; // @desc UE Supports CS to PS SRVCC + // Reference: 34.229-2 A.12/40 + + modulepar boolean pc_IMS_CS_PS_SRVCCAlert := false; // @desc UE Supports CS to PS SRVCC in alerting state + // Reference: 34.229-2 A.12/41 + + modulepar boolean pc_IMS_CS_PS_SRVCCMidCall := false; // @desc UE Supports CS to PS SRVCC and the MSC server assisted mid-call feature + // Reference: 34.229-2 A.12/42 + + modulepar boolean pc_IMS_SRVCCAlert := false; // @desc UE indicates g.3gpp.srvcc-alerting media feature tag in INVITE request or 180 response + // Reference: 34.229-2 A.12/34 + + modulepar boolean pc_IMS_emergency_call := false; // @desc Support of MS emergency call + // Reference: 36.523-2, A.4.2.1.1-1/4 + + modulepar boolean pc_IPv4 := false; // @desc UE supports IPv4 (used IMS PICS as currently not defined in LTE) + // Reference: 34.229-2 A.7/1 + + modulepar boolean pc_IPv6 := false; // @desc UE supports IPv6 (used IMS PICS as currently not defined in LTE) + // Reference: 34.229-2 A.7/2 + + modulepar boolean pc_ISR := false; // @desc Support of ISR + // Reference: 36.523-2 A.4.4-1/5 + + modulepar boolean pc_ImmConnect := false; // @desc Immediate connection supported for all circuit switched basic services + // Reference: 34.123-2 A.20/6 + + modulepar boolean pc_InterFreq_ProximityIndication := false; // @desc Support of Inter Frequency Proximity Indication + // Reference: 36.523-2 A.4.4.1-b + + modulepar boolean pc_IntraFreq_ProximityIndication := false; // @desc Support of Intra Frequency Proximity Indication + // Reference: 36.523-2 A.4.4.1-a + + modulepar boolean pc_KeepEpsBearerParametersAfterNormalDetach := false; + // @desc If the UE supports this, then the next ATTACH after DETACH shall be done using AT command AT+CGATT=1. + // Otherwise it shall be done using AT+CGDCONT=1,"IP" followed by AT+CGACT=1 + // Reference: 36.523-2 A.4.4.2-10 + + modulepar boolean pc_LAP_override := false; // @desc Support of Low Access Prioirty Override + // Reference: 36.523-2 A.4.4-1/90 + + modulepar boolean pc_LocalTimeZone := false; // @desc Support of storage of the local time zone + // Reference: 36.523-2 A.4.4-1/14 + + modulepar boolean pc_LoggedMeasurementsIdle := false; // @desc Support of logged measurements in RRC_IDLE + // Reference: 36.523-2 A.4.4-1/62 + + modulepar boolean pc_Manual_CSG_Selection := false; // @desc Support of Manual CSG selection + // Reference: 36.523-2 A.4.4-1/49 + + modulepar boolean pc_Multiple_PDN := false; // @desc Support for multiple PDN connections + // Reference: 36.523-2 A.4.4-1/30 + + modulepar boolean pc_PLMN_EF_LRPLMNSI_Automatic_Mode_Exception := false; + // @desc Support of Automatic Mode EF_LRPLMSI PLMN Selection Expression + // Reference: 36.523-2 A.4.4-1/N1 + + modulepar boolean pc_PLMN_Manual_Mode_Exception := false; // @desc Support of Manual Mode PLMN Selection Expression + // Reference: 36.523-2 A.4.4-1/N2 + + modulepar boolean pc_PS := false; // @desc Packet Switched + // Reference: 34.123-2 A.3/2 + + modulepar boolean pc_PS_data_centric := false; // @desc Support of configuring the UE to PS data centric + // Reference: 36.523-2 A.4.4-2/8 + + modulepar boolean pc_PS_voice_centric := false; // @desc Support of configuring the UE to PS voice centric + // Reference: 36.523-2 A.4.4-2/7 + + modulepar boolean pc_PWS_UpperLayer := false; // @desc Presence of PWS upper layer for functions like duplicate definition + // Reference: 36.523-2 A.4.4-1/67 + + modulepar boolean pc_Provide_IMS_APN := false; // @desc Configured to provide IMS APN during initial attach + // Reference: 36.523-2 A.4.4-2/13 + + modulepar boolean pc_Provide_IMS_as_second_APN := false; // @desc Configured to provide IMS APN as the 2nd PDN connection + // Reference: 36.523-2 A.4.4-2/14 + + modulepar boolean pc_Provide_Internet_as_second_APN := false; // @desc Configured to provide Internet APN as the 2nd PDN connection + // Reference: 36.523-2 A.4.4-2/15 + + modulepar boolean pc_RLF_ReportForInterRAT_MRO := false; // @desc Support of Radio Link Failure Report for InterRAT MRO + // Reference: 36.523-2 A.4.4-1/xx + + modulepar boolean pc_ROHC_profile0x0001 := false; // @desc Support for ROHC profile0x0001 + // Reference: 36.523-2 A.4.4-1/40 + + modulepar boolean pc_ROHC_profile0x0002 := false; // @desc Support for ROHC profile0x0002 + // Reference: 36.523-2 A.4.4-1/41 + + modulepar boolean pc_ROHC_profile0x0003 := false; // @desc Support for ROHC profile0x0003 + // Reference: 36.523-2 A.4.4-1/42 + + modulepar boolean pc_ROHC_profile0x0004 := false; // @desc Support for ROHC profile0x0004 + // Reference: 36.523-2 A.4.4-1/43 + + modulepar boolean pc_ROHC_profile0x0006 := false; // @desc Support for ROHC profile0x0006 + // Reference: 36.523-2 A.4.4-1/44 + + modulepar boolean pc_ROHC_profile0x0101 := false; // @desc Support for ROHC profile0x0101 + // Reference: 36.523-2 A.4.4-1/45 + + modulepar boolean pc_ROHC_profile0x0102 := false; // @desc Support for ROHC profile0x0102 + // Reference: 36.523-2 A.4.4-1/46 + + modulepar boolean pc_ROHC_profile0x0103 := false; // @desc Support for ROHC profile0x0103 + // Reference: 36.523-2 A.4.4-1/47 + + modulepar boolean pc_ROHC_profile0x0104 := false; // @desc Support for ROHC profile0x0104 + // Reference: 36.523-2 A.4.4-1/48 + + modulepar boolean pc_Rach_Report := false; // @desc Support of delivery of rachReport upon request from the network + // Reference: 36.523-2 A.4.4-1/85 + + modulepar boolean pc_Re_Attach_AfterDetachColl := false; // @desc Support of automatic re-activation of the EPS bearers during network initiated detach, even though UE has initiated a detach procedure with detach type set to EPS detach or combined EPS/IMSI detach + // Reference: 36.523-2 A.4.4-1/55 + + modulepar boolean pc_RequestIPv4HAAddress_DuringAttach := false; // @desc Support for being configured to request the IPv4 address of the Home Agent during Attach procedure + // Reference: 36.523-2 A.4.4-1/23 + + modulepar boolean pc_RequestIPv6HAAddress_DuringAttach := false; // @desc Support for being configured to request the IPv6 address of the Home Agent during Attach procedure + // Reference: 36.523-2 A.4.4-1/22 + + modulepar boolean pc_SI_Neighbour_UMTS_Autonomous_Gaps := false; // @desc Upon configuration of si-RequestForHO by the network, supports acquistion of relevant information from a neighbouring UMTS cell by reading the SI of the neighbouring cell using autonomous gaps and reporting + // Reference: 36.523-2, A.4.4-1/xxx + + modulepar boolean pc_SI_Neighbour_interFreq_Autonomous_Gaps := false; + // @desc Supports upon configuration of si-requestForHO by the network acquisition of relevant information from a neighbouring intrer-frequency cell by reading the SI of the neighouring cell using autonomous gaps and reporting + // Reference: 36.523-2, A.4.4-1/zz2 + + modulepar boolean pc_SI_Neighbour_intraFreq_Autonomous_Gaps := false; + // @desc Supports upon configuration of si-requestForHO by the network acquisition of relevant information from a neighbouring intra-frequency cell by reading the SI of the neighouring cell using autonomous gaps and reporting + // Reference: 36.523-2, A.4.4-1/zz1 + + modulepar boolean pc_SMS_SGs := false; // @desc The UE supports SMS over SGs and is configured for SMS over SGs. If true, at least one of pc_SMS_SGs_MT and pc_SMS_SGs_MO is true. If it is set to true, pc_combined_attach shall be set to true + // + // Reference: 36.523-2, A.4.2.1.1-1/2 + + modulepar boolean pc_SMS_SGs_MO := false; // @desc Support of Short Message Service (SMS) MO over SGs + // Reference: 36.523-2 A.4.4-1/4 + + modulepar boolean pc_SMS_SGs_MT := false; // @desc Support of Short Message Service (SMS) MT over SGs + // Reference: 36.523-2 A.4.4-1/3 + + modulepar boolean pc_SMS_SGs_Multi_MO := false; // @desc Support of sending concatenated multiple short message over SGs + // Reference: 36.523-2 A.4.4.1-72 + + modulepar boolean pc_SRVCC_GERAN_UTRAN := false; // @desc Support for SRVCC from E-UTRAN to GERAN/UTRAN + // Reference: 36.523-2 A.4.4-1/32 + + modulepar boolean pc_Semi_Persistence_Scheduling := false; // @desc Support of semi persistance scheduling + // Reference: 36.523-2 A.4.4-1/50 + + modulepar boolean pc_ShortNameNetwork := false; // @desc Support of storage of the network short name + // Reference: 36.523-2 A.4.4-1/13 + + modulepar boolean pc_Speech := false; // @desc UE supports Speech + // Reference: 34.123-2 A.2/1 + + modulepar boolean pc_Squal_based_CellReselection_between_E_UTRAN_and_GERAN := false; + // @desc Support of Squal based cell reselection to E-UTRAN from GERAN + // Reference: 36.523-2 A.4.4-1/79 + + modulepar boolean pc_Squal_based_CellReselection_to_E_UTRAN_from_UTRAN := false; + // @desc Support of Squal based cell reselection to E-UTRAN from UTRAN + // Reference: 36.523-2 A.4.4-1/57 + + modulepar boolean pc_Squal_based_CellReselection_to_UTRAN_from_E_UTRAN := false; + // @desc Support of Squal based cell reselection to UTRAN from E-UTRAN + // Reference: 36.523-2 A.4.4-1/56 + + modulepar boolean pc_StandaloneGNSS_Location := false; // @desc Support of standalone GNSS receiver to provide detailed location information in RRC measurement report and logged measurements in RRC_IDLE + // Reference: 36.523-2 A.4.4-1/63 + + modulepar boolean pc_SupportOpModeA := false; // @desc UE supports Operation Mode A + // Reference: 34.123-2 A.3/3 + + modulepar boolean pc_SwitchOnOff := false; // @desc switch on/off supported + // Reference: 36.523-2, A4.4-1/10 + + modulepar boolean pc_TAU_connected_in_IMS := false; // @desc Support of TAU in connected mode. Applicable when configured to pc_voice_PS_1_CS_2 and pc_Attach + // Reference: 36.523-2 A.4.4.1-73 + + modulepar boolean pc_TAU_idle_in_IMS := false; // @desc Support of TAU in idle mode. Applicable when configured to pc_voice_PS_1_CS_2 and pc_Attach + // Reference: 36.523-2 A.4.4.1-74 + + modulepar boolean pc_TDD_HCR := false; // @desc UE supports UTRA band as defined in TS 25.102 + // Reference: 34.123-2 A.1/2 + + modulepar boolean pc_TDD_LCR := false; // @desc UE supports UTRA band as defined in TS 25.102 + // Reference: 34.123-2 A.1/3 + + modulepar boolean pc_TDD_VHCR := false; // @desc UE supports UTRA band as defined in TS 25.102 + // Reference: 34.123-2 A.1/8 + + modulepar boolean pc_TTI_Bundling := false; // @desc Support of TTI Bundling + // Reference: 36.523-2 A.4.4-1/51 + + modulepar boolean pc_TestModeforCSGproximity := false; // @desc Support of UE radio bearer test mode for CSG proximity testing + // Reference: 36.523-2 A.4.4-1/92 + + modulepar boolean pc_UE_supports_user_initiated_PDN_disconnect := false; + // @desc UE supports user initiated PDN disconnect + // Reference: 36.523-2 A.4.4-2/16 + + modulepar boolean pc_UL_CA := false; // @desc Support of UL CA + // Reference: 36.523-2, ??? + + modulepar boolean pc_UL_IntraBand_ContCaBWclassB := false; // @desc UL Intra-band contiguous CA BW class B + // Reference: 36.523-2 A.4.3.3.1-2/1 + + modulepar boolean pc_UL_IntraBand_ContCaBWclassC := false; // @desc UL Intra-band contiguous CA BW class C + // Reference: 36.523-2 A.4.3.3.1-2/2 + + modulepar boolean pc_UL_MIMO := false; // @desc Support of UL MIMO + // Reference: 36.523-2 A.4.4-170 + + modulepar boolean pc_UL_SupportedInAllBandsInCAComb := false; // @desc UL (Pcell) supported in each band of Inter-band CA combination under test + // Reference: 36.523-2 A.4.3.3.3-2/2 + + modulepar boolean pc_UL_interBand_CaBwClassComb_AA := false; // @desc UL Inter-band contiguous CA BW class A-A + // Reference: 36.523-2 A.4.3.3.3-2/1 + + modulepar boolean pc_UL_intraBand_nonContCaBwClassComb_AA := false; + // @desc Support of UL intra-band non-contiguous CA BW Class Combination A-A + // Reference: 36.523-2 A.4.3.3.2-2/1 + + modulepar boolean pc_UMI_ProcNeeded_DuringCSFB := false; // @desc Requiring UMI proceeding to paging response + // Reference: 36.523-2 A.4.4-2/6 + + modulepar boolean pc_USIM_Removal := false; // @desc USIM removable without power down supported + // Reference: 36.523-2, A4.4-1/1 + + modulepar boolean pc_UTRA := false; // @desc UE supports UTRA + // Reference: 36.523-2 A.4.1-1/6 + + modulepar boolean pc_UTRAN_ANR := false; // @desc Support of UTRAN ANR + // Reference: 36.523-2 A.4.4-1/65 + + modulepar boolean pc_UTRAN_ProximityIndication := false; // @desc Support of UTRAN Proximity Indication + // Reference: 36.523-2 A.4.4.1-c + + modulepar boolean pc_UTRA_FeatrGrp_1 := false; // @desc Support of UTRA CELL_PCH and URA_PCH to RRC_IDLE cell reselection + // Reference: 36.523-2 A.4.5-2/1 + + modulepar boolean pc_UTRA_FeatrGrp_2 := false; // @desc Support of EUTRAN measurements and reporting in connected mode + // Reference: 36.523-2 A.4.5-2/2 + + modulepar boolean pc_UeAssistedAgps := false; // @desc Support of UE assisted Network Assisted GPS L1 C/A + // Reference: 37.571-3 A.4.3-1/11 + + modulepar boolean pc_UeBasedAgps := false; // @desc Support of UE based Network Assisted GPS L1 C/A + // Reference: 37.571-3 A.4.3-1/10 + + modulepar boolean pc_UniversalAndLocalTimeZone := false; // @desc Support of storage of the universal time and local time zone + // Reference: 36.523-2 A.4.4-1/15 + + modulepar boolean pc_UpdateUE_LocationInformation := false; // @desc Update UE Location Information + // Reference: 36.523-2 A.4.3-2/3 + + modulepar boolean pc_UserInitiatedPLMN_Reselection := false; // @desc Support user initiated PLMN reselection in automatic mode + // Reference: 36.523-2 A.4.4-1/69 + + modulepar boolean pc_VoLTE := false; // @desc Support of VoLTE in GSMA PRD IR.92: "IMS profile for Voice and SMS" + // Reference: 36.523-2 A.4.4-1/33 + + modulepar boolean pc_XCAP_only_APN := false; // @desc Configured with an APN for XCAP only usage + // Reference: 36.523-2 A.4.4-2/12 + + modulepar boolean pc_XCAP_over_Internet_APN := false; // @desc Configured to use Internet APN for XCAP signalling + // Reference: 36.523-2 A.4.4-2/17 + + modulepar boolean pc_eFDD := false; // @desc UE supports EUTRA FDD + // Reference: 36.523-2 A.4.1-1/1 + + modulepar boolean pc_eFDD_MultiBand := false; // @desc Support of multiple E-UTRA FDD bands + // Reference: 36.523-2 A.4.1-2/1 + + modulepar boolean pc_eMBMS := false; // @desc Support of eMBMS + // Reference: 36.523-2 A.4.2.1.1.-1/5 + + modulepar boolean pc_eMBMS_SC := false; // @desc Support of eMBMS service continuity + // Reference: 36.523-2 A.4.2.1.1.-1/7 + + modulepar boolean pc_eRedirectionUTRA := false; // @desc Support of use of the UTRA system information provided by RRCConnectionRelease upon redirection + // Reference: 36.523-2 A.4.4-1/31 + + modulepar boolean pc_eTDD := false; // @desc UE supports EUTRA TDD + // Reference: 36.523-2 A.4.1-1/2 + + modulepar boolean pc_eTDD_MultiBand := false; // @desc Support of multiple E-UTRA TDD bands + // Reference: 36.523-2 A.4.1-2/2 + + modulepar boolean pc_multipleTimingAdvance := false; // @desc Support of multiple timing advances + // Reference: 36.523-2 A.4.4-1A/3 + + modulepar boolean pc_ue_CategoryDL_0 := false; // @desc UE Category DL 0 + // Reference: 36.523-2 A.4.3.2-2/1 + + modulepar boolean pc_ue_CategoryDL_10 := false; // @desc UE Category DL 10 + // Reference: 36.523-2 A.4.3.2-2/5 + + modulepar boolean pc_ue_CategoryDL_11 := false; // @desc UE Category DL 11 + // Reference: 36.523-2 A.4.3.2-2/6 + + modulepar boolean pc_ue_CategoryDL_12 := false; // @desc UE Category DL 12 + // Reference: 36.523-2 A.4.3.2-2/7 + + modulepar boolean pc_ue_CategoryDL_13 := false; // @desc UE Category DL 13 + // Reference: 36.523-2 A.4.3.2-2/8 + + modulepar boolean pc_ue_CategoryDL_14 := false; // @desc UE Category DL 14 + // Reference: 36.523-2 A.4.3.2-2/9 + + modulepar boolean pc_ue_CategoryDL_6 := false; // @desc UE Category DL 6 + // Reference: 36.523-2 A.4.3.2-2/2 + + modulepar boolean pc_ue_CategoryDL_7 := false; // @desc UE Category DL 7 + // Reference: 36.523-2 A.4.3.2-2/3 + + modulepar boolean pc_ue_CategoryDL_9 := false; // @desc UE Category DL 9 + // Reference: 36.523-2 A.4.3.2-2/4 + + modulepar boolean pc_ue_CategoryUL_0 := false; // @desc UE Category UL 0 + // Reference: 36.523-2 A.4.3.2-3/1 + + modulepar boolean pc_ue_CategoryUL_13 := false; // @desc UE Category UL 13 + // Reference: 36.523-2 A.4.3.2-3/6 + + modulepar boolean pc_ue_CategoryUL_3 := false; // @desc UE Category UL 3 + // Reference: 36.523-2 A.4.3.2-3/2 + + modulepar boolean pc_ue_CategoryUL_5 := false; // @desc UE Category UL 5 + // Reference: 36.523-2 A.4.3.2-3/3 + + modulepar boolean pc_ue_CategoryUL_7 := false; // @desc UE Category UL 7 + // Reference: 36.523-2 A.4.3.2-3/4 + + modulepar boolean pc_ue_CategoryUL_8 := false; // @desc UE Category UL 8 + // Reference: 36.523-2 A.4.3.2-3/5 + + modulepar boolean pc_ue_Category_1 := false; // @desc UE Category 1 + // Reference: 36.523-2 A.4.3.2-1/1 + + modulepar boolean pc_ue_Category_10 := false; // @desc UE Category 10 + // Reference: 36.523-2 A.4.3.2-1/10 + + modulepar boolean pc_ue_Category_11 := false; // @desc UE Category 11 + // Reference: 36.523-2 A.4.3.2-1/11 + + modulepar boolean pc_ue_Category_12 := false; // @desc UE Category 12 + // Reference: 36.523-2 A.4.3.2-1/12 + + modulepar boolean pc_ue_Category_2 := false; // @desc UE Category 2 + // Reference: 36.523-2 A.4.3.2-1/2 + + modulepar boolean pc_ue_Category_3 := false; // @desc UE Category 3 + // Reference: 36.523-2 A.4.3.2-1/3 + + modulepar boolean pc_ue_Category_4 := false; // @desc UE Category 4 + // Reference: 36.523-2 A.4.3.2-1/4 + + modulepar boolean pc_ue_Category_5 := false; // @desc UE Category 5 + // Reference: 36.523-2 A.4.3.2-1/5 + + modulepar boolean pc_ue_Category_6 := false; // @desc UE Category 6 + // Reference: 36.523-2 A.4.3.2-1/6 + + modulepar boolean pc_ue_Category_7 := false; // @desc UE Category 7 + // Reference: 36.523-2 A.4.3.2-1/7 + + modulepar boolean pc_ue_Category_8 := false; // @desc UE Category 8 + // Reference: 36.523-2 A.4.3.2-1/8 + + modulepar boolean pc_ue_Category_9 := false; // @desc UE Category 9 + // Reference: 36.523-2 A.4.3.2-1/9 + + modulepar boolean pc_voice_PS_1_CS_2 := false; // @desc Configured voice domain preference + // Reference: 36.523-2 A.4.4.2-n + + +} diff --git a/templates/EUTRA_CommonDefs.ttcnm b/templates/EUTRA_CommonDefs.ttcnm deleted file mode 100644 index 540539e599a7599feaf6349b4eb33ed0bf9ac3c1..0000000000000000000000000000000000000000 --- a/templates/EUTRA_CommonDefs.ttcnm +++ /dev/null @@ -1,2983 +0,0 @@ - - - - - - - - - - - - - "ASN.1:2002" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/templates/IMS_XML_Templates.ttcnm b/templates/IMS_XML_Templates.ttcnm deleted file mode 100644 index 70ceefc17662763df5e0e9849af7b82826108e91..0000000000000000000000000000000000000000 --- a/templates/IMS_XML_Templates.ttcnm +++ /dev/null @@ -1,1534 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/templates/MTC_Main_LTE_IRAT.ttcnm b/templates/MTC_Main_LTE_IRAT.ttcnm deleted file mode 100644 index b42a8d9e2047fd80d4a214d3b6207e7b3d05e0f8..0000000000000000000000000000000000000000 --- a/templates/MTC_Main_LTE_IRAT.ttcnm +++ /dev/null @@ -1,2417 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - ; - ; - ; - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - diff --git a/templates/UTRAN_CommonAspDefs.ttcnm b/templates/UTRAN_CommonAspDefs.ttcnm deleted file mode 100644 index 2dd52e4f94298a2dcf45e9977dde483acb6dc62e..0000000000000000000000000000000000000000 --- a/templates/UTRAN_CommonAspDefs.ttcnm +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - - - "ASN.1:2002" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/templates/UTRAN_CommonDefs.ttcnm b/templates/UTRAN_CommonDefs.ttcnm deleted file mode 100644 index 903d2e75e2e44c43d2cf2b9d76a16c2dba7b9809..0000000000000000000000000000000000000000 --- a/templates/UTRAN_CommonDefs.ttcnm +++ /dev/null @@ -1,3452 +0,0 @@ - - - - - - - - - - - - - "ASN.1:2002" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - ; - - - - - - -