michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: MARIONETTE_HEAD_JS = "stk_helper.js"; michael@0: michael@0: function testSetupCall(command, expect) { michael@0: log("STK CMD " + JSON.stringify(command)); michael@0: is(command.typeOfCommand, iccManager.STK_CMD_SET_UP_CALL, expect.name); michael@0: is(command.commandQualifier, expect.commandQualifier, expect.name); michael@0: is(command.options.confirmMessage, expect.confirmMessage, expect.name); michael@0: is(command.options.address, expect.address, expect.name); michael@0: is(command.options.callMessage, expect.callMessage, expect.name); michael@0: michael@0: let duration = command.options.duration; michael@0: if (duration) { michael@0: is(duration.timeUnit, expect.duration.timeUnit, expect.name); michael@0: is(duration.timeInterval, expect.duration.timeInterval, expect.name); michael@0: } michael@0: michael@0: runNextTest(); michael@0: } michael@0: michael@0: let tests = [ michael@0: {command: "d01e81030110008202818385084e6f7420627573798609911032042143651c2c", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_1", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "Not busy", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d01d81030110028202818385074f6e20686f6c648609911032042143651c2c", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_2", michael@0: commandQualifier: 0x02, michael@0: confirmMessage: "On hold", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d020810301100482028183850a446973636f6e6e6563748609911032042143651c2c", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_3", michael@0: commandQualifier: 0x04, michael@0: confirmMessage: "Disconnect", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d02b81030110008202818385114361706162696c69747920636f6e6669678609911032042143651c2c870201a0", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_4", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "Capability config", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d01c81030110018202818386119110325476981032547698103254769810", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_5", michael@0: commandQualifier: 0x01, michael@0: address: "+01234567890123456789012345678901"}}, michael@0: {command: "d081fd8103011001820281838581ed54687265652074797065732061726520646566696e65643a202d2073657420757020612063616c6c2c20627574206f6e6c79206966206e6f742063757272656e746c792062757379206f6e20616e6f746865722063616c6c3b202d2073657420757020612063616c6c2c2070757474696e6720616c6c206f746865722063616c6c732028696620616e7929206f6e20686f6c643b202d2073657420757020612063616c6c2c20646973636f6e6e656374696e6720616c6c206f746865722063616c6c732028696620616e79292066697273742e20466f722065616368206f662074686573652074797065732c2086029110", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_6", michael@0: commandQualifier: 0x01, michael@0: confirmMessage: "Three types are defined: - set up a call, but only if not currently busy on another call; - set up a call, putting all other calls (if any) on hold; - set up a call, disconnecting all other calls (if any) first. For each of these types, ", michael@0: address: "+01"}}, michael@0: {command: "d02b810301100082028183850c43616c6c65642070617274798609911032042143651c2c880780509595959595", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_7", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "Called party", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d02281030110018202818385084475726174696f6e8609911032042143651c2c8402010a", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_8", michael@0: commandQualifier: 0x01, michael@0: confirmMessage: "Duration", michael@0: address: "+012340123456,1,2", michael@0: duration: {timeUnit: iccManager.STK_TIME_UNIT_SECOND, michael@0: timeInterval: 0x0A}}}, michael@0: {command: "d028810301100082028183850c434f4e4649524d4154494f4e8609911032042143651c2c850443414c4c", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_9", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION", michael@0: callMessage: "CALL", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d03081030110008202818385165365742075702063616c6c2049636f6e20332e312e318609911032042143651c2c9e020101", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_10", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "Set up call Icon 3.1.1", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d03081030110008202818385165365742075702063616c6c2049636f6e20332e322e318609911032042143651c2c9e020001", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_11", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "Set up call Icon 3.2.1", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d03081030110008202818385165365742075702063616c6c2049636f6e20332e332e318609911032042143651c2c9e020102", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_12", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "Set up call Icon 3.3.1", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d04c81030110008202818385165365742075702063616c6c2049636f6e20332e342e318609911032042143651c2c9e02000185165365742075702063616c6c2049636f6e20332e342e329e020001", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_13", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "Set up call Icon 3.4.1", michael@0: callMessage: "Set up call Icon 3.4.2", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e00b4d004000600b4", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_14", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 1", michael@0: callMessage: "CALL 1", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_15", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 2", michael@0: callMessage: "CALL 2", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e01b4d004000601b4", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_16", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 1", michael@0: callMessage: "CALL 1", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_17", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 2", michael@0: callMessage: "CALL 2", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e02b4d004000602b4", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_18", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 1", michael@0: callMessage: "CALL 1", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_19", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 2", michael@0: callMessage: "CALL 2", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e04b4d004000604b4", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_20", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 1", michael@0: callMessage: "CALL 1", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d038810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032d004000e00b4d004000600b4", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_21", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 2", michael@0: callMessage: "CALL 2", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20338609911032042143651c2c850643414c4c2033", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_22", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 3", michael@0: callMessage: "CALL 3", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e08b4d004000608b4", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_23", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 1", michael@0: callMessage: "CALL 1", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d038810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032d004000e00b4d004000600b4", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_24", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 2", michael@0: callMessage: "CALL 2", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20338609911032042143651c2c850643414c4c2033", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_25", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 3", michael@0: callMessage: "CALL 3", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e10b4d004000610b4", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_26", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 1", michael@0: callMessage: "CALL 1", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d038810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032d004000e00b4d004000600b4", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_27", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 2", michael@0: callMessage: "CALL 2", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20338609911032042143651c2c850643414c4c2033", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_28", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 3", michael@0: callMessage: "CALL 3", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e20b4d004000620b4", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_29", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 1", michael@0: callMessage: "CALL 1", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d038810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032d004000e00b4d004000600b4", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_30", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 2", michael@0: callMessage: "CALL 2", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20338609911032042143651c2c850643414c4c2033", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_31", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 3", michael@0: callMessage: "CALL 3", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e40b4d004000640b4", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_32", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 1", michael@0: callMessage: "CALL 1", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d038810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032d004000e00b4d004000600b4", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_33", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 2", michael@0: callMessage: "CALL 2", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20338609911032042143651c2c850643414c4c2033", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_34", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 3", michael@0: callMessage: "CALL 3", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e80b4d004000680b4", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_35", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 1", michael@0: callMessage: "CALL 1", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d038810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032d004000e00b4d004000600b4", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_36", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 2", michael@0: callMessage: "CALL 2", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20338609911032042143651c2c850643414c4c2033", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_37", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 3", michael@0: callMessage: "CALL 3", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e00b4d0040006004b", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_38", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 1", michael@0: callMessage: "CALL 1", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_39", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "CONFIRMATION 2", michael@0: callMessage: "CALL 2", michael@0: address: "+012340123456,1,2"}}, michael@0: {command: "d02d810301100082028183851980041704140420041004120421042204120423041904220415860791103204214365", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_40", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "ЗДРАВСТВУЙТЕ", michael@0: address: "+012340123456"}}, michael@0: {command: "d04c810301100082028183851b800417041404200410041204210422041204230419042204150031860791103204214365851b800417041404200410041204210422041204230419042204150032", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_41", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "ЗДРАВСТВУЙТЕ1", michael@0: callMessage: "ЗДРАВСТВУЙТЕ2", michael@0: address: "+012340123456"}}, michael@0: {command: "d0198103011000820281838505804e0d5fd9860791103204214365", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_42", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "不忙", michael@0: address: "+012340123456"}}, michael@0: {command: "d022810301100082028183850580786e5b9a860791103204214365850780625375358bdd", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_43", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "确定", michael@0: callMessage: "打电话", michael@0: address: "+012340123456"}}, michael@0: {command: "d01781030110008202818385038030eb860791103204214365", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_44", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "ル", michael@0: address: "+012340123456"}}, michael@0: {command: "d02081030110008202818385058030eb003186079110320421436585058030eb0032", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_45", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "ル1", michael@0: callMessage:"ル2", michael@0: address: "+012340123456"}}, michael@0: {command: "d029810301100482028182050a446973636f6e6e6563748609811032042143651c2c05074d657373616765", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_46", michael@0: commandQualifier: 0x04, michael@0: confirmMessage: "Disconnect", michael@0: address: "012340123456,1,2", michael@0: callMessage: "Message"}}, michael@0: {command: "d02281030110008202818385084E6F7420627573798609911032042143651C2C8402010A", michael@0: func: testSetupCall, michael@0: expect: {name: "setup_call_cmd_47", michael@0: commandQualifier: 0x00, michael@0: confirmMessage: "Not busy", michael@0: address: "+012340123456,1,2", michael@0: duration: {timeUnit: iccManager.STK_TIME_UNIT_SECOND, michael@0: timeInterval: 0x0A}}}, michael@0: michael@0: ]; michael@0: michael@0: runNextTest();