Ejemplo n.º 1
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..999).
     """
     (err, msg) = W.SetMtOriginateCallTimeout(self.get_root(), int(timeout))
     self.__error_check(err, msg)
Ejemplo n.º 2
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. Possible values:
        - "ALER" : Alerting
        - "CONN" : Connected
        - "DISC" : Disconnected
        - "IDLE" : Idle
        - "SREQ" : Setup Request

        :type timeout: integer
        :param timeout: allowed time in seconds to reach the expected state

        :type blocking: boolean
        :param blocking: boolean to know if the function raises an error
        or simply return true or false if the status is reached or not
        :raise: raises ServiceException (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)
Ejemplo n.º 3
0
 def set_echo_loopback_delay(self, delay):
     """
     Sets echo loopback delay.
     :type delay: double
     :param config: the speech echo loopback delay to set. A double
     from 0 to 4 with a resolution of 0.2 (in seconds).
     """
     (err, msg) = W.SetEchoLoopbackDelay(self.get_root(), delay)
     self.__error_check(err, msg)
Ejemplo n.º 4
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
Ejemplo n.º 5
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)
     return status == "IDLE"
Ejemplo n.º 6
0
    def set_speech_configuration(self, config):
        """
        Sets the speech configuration.
        :type config: str
        :param config: the speech configuration to set. Possible values:
                - "ECHO"
                - "SPEECH_OUTPUT"
        """

        if config not in ["SPEECH_OUTPUT", "ECHO"]:
            raise TestEquipmentException(
                TestEquipmentException.INVALID_PARAMETER,
                "Speech configuration must be SPEECH_OUTPUT or ECHO")

        if config == "SPEECH_OUTPUT":
            config = "RTV"
        else:
            config = "ECHO"

        (err, msg) = W.SetSpeechConfiguration(self.get_root(), config)
        self.__error_check(err, msg)
Ejemplo n.º 7
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"
            - "AMR_WB_1265" | "AMR_WB_885" | "AMR_WB_660"
        """
        agilent_codec = None
        # Transform ACS codecs name into the codec name understood by Agilent 8960
        if codec == "FR":
            agilent_codec = "FS"
        elif codec == "EFR":
            agilent_codec = "EFS"
        elif codec == "HR":
            agilent_codec = "HS"
        elif codec == "FR_AMR_NB_1220":
            agilent_codec = "AFS12200"
        elif codec == "FR_AMR_NB_1020":
            agilent_codec = "AFS10200"
        elif codec == "FR_AMR_NB_795":
            agilent_codec = "AFS7950"
        elif codec == "FR_AMR_NB_740":
            agilent_codec = "AFS7400"
        elif codec == "FR_AMR_NB_670":
            agilent_codec = "AFS6700"
        elif codec == "FR_AMR_NB_590":
            agilent_codec = "AFS5900"
        elif codec == "FR_AMR_NB_515":
            agilent_codec = "AFS5150"
        elif codec == "FR_AMR_NB_475":
            agilent_codec = "AFS4750"
        elif codec == "HR_AMR_NB_795":
            agilent_codec = "AHS7950"
        elif codec == "HR_AMR_NB_740":
            agilent_codec = "AHS7400"
        elif codec == "HR_AMR_NB_670":
            agilent_codec = "AHS6700"
        elif codec == "HR_AMR_NB_590":
            agilent_codec = "AHS5900"
        elif codec == "HR_AMR_NB_515":
            agilent_codec = "AHS5150"
        elif codec == "HR_AMR_NB_475":
            agilent_codec = "AHS4750"
        elif codec == "AMR_WB_1265":
            agilent_codec = "WFS12650"
        elif codec == "AMR_WB_885":
            agilent_codec = "WFS8850"
        elif codec == "AMR_WB_660":
            agilent_codec = "WFS6600"
        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(), agilent_codec)
        self.__error_check(err, msg)
Ejemplo n.º 8
0
 def mt_originate_call(self):
     """
     Originates a mobile terminated call.
     """
     (err, msg) = W.MtOriginateCall(self.get_root())
     self.__error_check(err, msg)
Ejemplo n.º 9
0
 def voice_call_network_release(self):
     """
     Releases a voice call.
     """
     (err, msg) = W.VoiceCallNetworkRelease(self.get_root())
     self.__error_check(err, msg)