Пример #1
0
 def mt_originate_call(self):
     """
     Originates a mobile terminated call.
     """
     self.get_logger().info("Network originated call")
     (err, msg) = W.MtOriginateCall(self.get_root())
     self.__error_check(err, msg)
Пример #2
0
 def set_mt_originate_call_timeout(self, timeout):
     """
     Set Originates a mobile terminated call timeout.
     :type delay: integer
     :param config: the maximum timeout before aborting call setup to set (0..60).
     """
     (err, msg) = W.SetMtOriginateCallTimeout(self.get_root(), int(timeout))
     self.__error_check(err, msg)
Пример #3
0
    def is_voice_call_connected(self, connection_time=0, blocking=True):
        """
        Tests if the voice call is established between equipment and DUT for
        connection_time seconds. If connection_time is <= 0, only one test
        is performed.
        :type connection_time: integer
        :param connection_time: expected minimum connection time
        :type blocking: boolean
        :param blocking: raise or not an exception
        :rtype: boolean
        :return:
            - true if the voice call is established for connection_time seconds or if
        voice call is connected
            - false otherwise
        :raise: TestEquipmentException (error code, error message) in case of failure.
        """
        self.get_logger().info(
            "Check if voice call connected for %d seconds",
            connection_time)

        timer = 0
        (err, status, msg) = W.GetCallControlStatus(self.get_root())
        self.__error_check(err, msg)

        while (timer < connection_time) and (status == "CONN"):
            (err, status, msg) = W.GetCallControlStatus(self.get_root())
            self.__error_check(err, msg)
            time.sleep(1)
            timer += 1

        if status != "CONN":  # Fail
            if blocking:
                msg = "Voice call interrupted after %d seconds!" % (timer)
                self.get_logger().error(msg)
                raise TestEquipmentException(TestEquipmentException.TIMEOUT_REACHED, msg)
            else:
                msg = "Voice call interrupted after %d seconds!" % (timer)
                self.get_logger().info(msg)
                return False

        self.get_logger().info(
            "Voice call still connected after %d seconds!",
            connection_time)
        return True
Пример #4
0
    def set_audio_codec(self, codec):
        """
        Sets the audio codec.
        :type codec: str
        :param codec: the audio codec to set. Possible values:
            - "FR" | "EFR" | "HR"
            - "FR_AMR_NB_1220" | "FR_AMR_NB_1020" | "FR_AMR_NB_795" | "FR_AMR_NB_740"
            - "FR_AMR_NB_670"  | "FR_AMR_NB_590"  | "FR_AMR_NB_515" | "FR_AMR_NB_475"
            - "HR_AMR_NB_795"  | "HR_AMR_NB_740"  | "HR_AMR_NB_670" | "HR_AMR_NB_590"
            - "HR_AMR_NB_515"  | "HR_AMR_NB_475"
            - Following WFSP codecs are not supported by CMU200 :
                - "AMR_WB_1265" | "AMR_WB_885" | "AMR_WB_660"
        """
        cmu_codec = None
        # Transform ACS codecs name into the codec name understood by Agilent 8960
        if codec == "FR":
            cmu_codec = "FR"
        elif codec == "EFR":
            cmu_codec = "EFR"
        elif codec == "HR":
            cmu_codec = "HR"
        elif codec == "FR_AMR_NB_1220":
            cmu_codec = "FR_AMR_1220"
        elif codec == "FR_AMR_NB_1020":
            cmu_codec = "FR_AMR_1020"
        elif codec == "FR_AMR_NB_795":
            cmu_codec = "FR_AMR_795"
        elif codec == "FR_AMR_NB_740":
            cmu_codec = "FR_AMR_740"
        elif codec == "FR_AMR_NB_670":
            cmu_codec = "FR_AMR_670"
        elif codec == "FR_AMR_NB_590":
            cmu_codec = "FR_AMR_590"
        elif codec == "FR_AMR_NB_515":
            cmu_codec = "FR_AMR_515"
        elif codec == "FR_AMR_NB_475":
            cmu_codec = "FR_AMR_475"
        elif codec == "HR_AMR_NB_795":
            cmu_codec = "HR_AMR_795"
        elif codec == "HR_AMR_NB_740":
            cmu_codec = "HR_AMR_740"
        elif codec == "HR_AMR_NB_670":
            cmu_codec = "HR_AMR_670"
        elif codec == "HR_AMR_NB_590":
            cmu_codec = "HR_AMR_590"
        elif codec == "HR_AMR_NB_515":
            cmu_codec = "HR_AMR_515"
        elif codec == "HR_AMR_NB_475":
            cmu_codec = "HR_AMR_475"
        else:
            raise TestEquipmentException(
                TestEquipmentException.INVALID_PARAMETER,
                "%s is an Unknown CODEC or is not supported by the equipment" % codec)

        (err, msg) = W.SetAudioCodec(self.get_root(), cmu_codec)
        self.__error_check(err, msg)
Пример #5
0
 def voice_call_network_release(self):
     """
     Wraps to VoiceCallNetworkRelease driver function
     :raise TestEquipmentException: failed to call VoiceCallNetworkRelease
     driver function
     :rtype: integer
     :return: the error code of the driver function
     """
     (err, msg) = W.VoiceCallNetworkRelease(self.get_root())
     self.__error_check(err, msg)
Пример #6
0
 def is_voice_call_idle(self):
     """
     Tests if voice call is idle (disconnected).
     :rtype: boolean
     :return:
         - true if the voice Call status is idle
         - false otherwise
     :raise: raises TestEquipmentException (error code, error message) in case of failure.
     """
     (err, status, msg) = W.GetCallControlStatus(self.get_root())
     self.__error_check(err, msg)
     # Idle status can be IDLE (ON) or OFF or SYNC RS CMU200 cell state
     return (status == "IDLE") or (status == "OFF") or (status == "SYNC")
Пример #7
0
    def is_dut_registered(self, dut_imsi):
        """
        Test if DUT is synchronized with equipment
        :type dut_imsi: str
        :param dut_imsi: IMSI retrieved from CDK.
        :rtype: boolean
        :return: true if the DUT is synchronized with the equipment, false otherwise
        """

        (err, state, msg) = WVC.GetCallControlStatus(self.get_root())
        self.__error_check(err, msg)
        state = state.replace('"', '')  # pylint: disable=E1101

        return state == "SYNC"
Пример #8
0
    def check_call_state(self, state, timeout=0, blocking=True):
        """
        Checks that equipment call state is set to the expected sate
        before the given timeout. If timeout is <= 0, only one test is performed.
        :type state: str
        :param state: the expected state.
        :type timeout: integer
        :param timeout: allowed time in seconds to reach the expected state
        :raise: raises TestEquipmentException (error code, error message) in case of failure.
        """
        self.get_logger().info(
            "Check call state is %s before timeout %d seconds",
            state,
            timeout)

        timer = timeout
        (err, current_state, msg) = W.GetCallControlStatus(self.get_root())
        self.__error_check(err, msg)

        while (timer > 0) and (current_state != state):
            time.sleep(1)
            (err, current_state, msg) = W.GetCallControlStatus(self.get_root())
            self.__error_check(err, msg)
            timer -= 1

        if current_state == state:  # Expected state has been reached
            self.get_logger().info("Call state is %s !", state)
        else:
            if blocking:
                # Timeout to reach desired state
                msg = "Check Call state to %s timeout !" % state
                self.get_logger().error(msg)
                raise TestEquipmentException(TestEquipmentException.TIMEOUT_REACHED, msg)
            else:
                # Timeout to reach desired state (Test failed no TestEquipmentException raised)
                self.get_logger().info("Check Call state to %s timeout !", state)
Пример #9
0
 def set_speech_configuration(self, config):
     """
     Sets the speech configuration.
     :type config: str
     :param config: the speech configuration to set. Possible values:
         - "ECHO"
         - "NONE"
         - "PRBS15"
         - "PRBS9"
         - "SIN300"
         - "SIN1000"
         - "SIN3000"
         - "MULTITONE"
         - "CUST": custom
     """
     (err, msg) = W.SetSpeechConfiguration(self.get_root(), config)
     self.__error_check(err, msg)