right  Talk To Us!

action result

Contains the result of a previous action for those actions that generate a result.

Used by actions connect, connect to conference, get input, get number, receive fax, record, run menu, run speech menu, send fax, start transcription and in HTTP Request

language wrappers and examples

It contains the following properties:

PropertyAvailabilityDescription
actionalwaysThe name of the action that generated this result.
resultalways unless interrupted A JSON object that contains the result of the action specified. The following actions generate an action result: record, get number, get input, run menu, run speech menu, connect, connect to conference, send fax and receive fax. See these actions for details of the contents of this object.
If interrupted is true this property will be omitted.
interruptedinterrupted actions onlyA boolean to indicate whether the action was interrupted by the web-services interrupt command

  • Examples:

    • The action result of a record action:

      	{
      		"action" : "record",
      		"result" :
      		{
      			"filename" : "/rest_api/recordings/2013/07/16/14_35_03_04f01fb92e8913a8.62100.wav",
      			"contains_sound" : true,
      			"seconds_duration" : 16.7
      		}
      	}
      
    • The action result of an interrupted get input action:

      	{
      		"action" : "get_input",
      		"interrupted" : true
      	}
      
  • ActionResult Class
    Namespace: Aculab.Cloud.RestAPIWrapper
    Assembly: Aculab.Cloud.RestAPIWrapper.dll

    Base class for all result classes. These provide result information for an action.

    • public class ActionResult 
      {
          // Members
          public string Action;
          public bool Interrupted;
      }
      

      Examples:

      • Get the details of the recording from the result of a record action:

        // Unpack the request
        var telephonyRequest = new TelephonyRequest(Request);
        
        var recordResult = (RecordResult)telephonyRequest.InstanceInfo.ActionResult;
        var filename = recordResult.Filename;
        
      • Get the action that was interrupted:

        // Unpack the request
        var telephonyRequest = new TelephonyRequest(Request);
        
        var actionResult = telephonyRequest.InstanceInfo.ActionResult;
        if (actionResult.Interrupted)
        {
            // Determine which ation was interrupted
            var actionInterrupted = actionResult.Action;
            
            // ...
        }
        
    • public class ActionResult 
      {
          // Members
          public string Action;
          public bool Interrupted;
      }
      

      Examples:

      • Get the details of the recording from the result of a record action:

        // Unpack the request
        var telephonyRequest = new TelephonyRequest(Request);
        
        var recordResult = (RecordResult)telephonyRequest.InstanceInfo.ActionResult;
        var filename = recordResult.Filename;
        
      • Get the action that was interrupted:

        // Unpack the request
        var telephonyRequest = new TelephonyRequest(Request);
        
        var actionResult = telephonyRequest.InstanceInfo.ActionResult;
        if (actionResult.Interrupted)
        {
            // Determine which ation was interrupted
            var actionInterrupted = actionResult.Action;
            
            // ...
        }
        
    • public class ActionResult 
      {
          // Members
          public string Action;
          public bool Interrupted;
      }
      

      Examples:

      • Get the details of the recording from the result of a record action:

        // Unpack the request
        var telephonyRequest = await TelephonyRequest.UnpackRequestAsync(Request);
        
        var recordResult = (RecordResult)telephonyRequest.InstanceInfo.ActionResult;
        var filename = recordResult.Filename;
        
      • Get the action that was interrupted:

        // Unpack the request
        var telephonyRequest = await TelephonyRequest.UnpackRequestAsync(Request);
        
        var actionResult = telephonyRequest.InstanceInfo.ActionResult;
        if (actionResult.Interrupted)
        {
            // Determine which ation was interrupted
            var actionInterrupted = actionResult.Action;
            
            // ...
        }
        
  • ActionResult Class
    Namespace: Aculab.Cloud.RestAPIWrapper
    Assembly: Aculab.Cloud.RestAPIWrapper.dll

    Base class for all result classes. These provide result information for an action.

    • Public Class ActionResult
          ' Members
          Public Property Action As String
          Public Property Interrupted As Bool
      End Class
      

      Examples:

      • Get the details of the recording from the result of a record action:

        ' Unpack the request
        Dim telephonyRequest = New TelephonyRequest(Request)
        
        Dim recordResult As RecordResult = telephonyRequest.InstanceInfo.ActionResult
        Dim filename = recordResult.Filename
        
      • Get the action that was interrupted:

        ' Unpack the request
        Dim telephonyRequest = New TelephonyRequest(Request)
        
        Dim actionResult = telephonyRequest.InstanceInfo.ActionResult
        If actionResult.Interrupted Then
            ' Determine which ation was interrupted
            Dim actionInterrupted = actionResult.Action
            
            ' ...
        End If
        
    • Public Class ActionResult
          ' Members
          Public Property Action As String
          Public Property Interrupted As Bool
      End Class
      

      Examples:

      • Get the details of the recording from the result of a record action:

        ' Unpack the request
        Dim telephonyRequest = New TelephonyRequest(Request)
        
        Dim recordResult As RecordResult = telephonyRequest.InstanceInfo.ActionResult
        Dim filename = recordResult.Filename
        
      • Get the action that was interrupted:

        ' Unpack the request
        Dim telephonyRequest = New TelephonyRequest(Request)
        
        Dim actionResult = telephonyRequest.InstanceInfo.ActionResult
        If actionResult.Interrupted Then
            ' Determine which ation was interrupted
            Dim actionInterrupted = actionResult.Action
            
            ' ...
        End If
        
  • class ActionResult

    Base class for all result classes. These provide result information for an action.

    Class synopsis:

    // Members:
    public final String getAction()
    public final boolean getInterrupted()
    

    Examples:

    • Get the details of the recording from the result of a record action:

      TelephonyRequest myRequest = new TelephonyRequest(request);
      ActionResult actionResult = myRequest.getInstanceInfo().getActionResult();
      
      if (actionResult.getAction() == "record")
      {
          RecordResult recordResult = (RecordResult)actionResult;
          String filename = recordResult.getFilename();
          boolean containsSound = recordResult.containsSound();
          double secsDurection = recordResult.getSecondsDuration();
      
          // Your code here...
      }
      
    • Get the action that was interrupted:

      TelephonyRequest myRequest = new TelephonyRequest(request);
      ActionResult actionResult = myRequest.getInstanceInfo().getActionResult();
      
      if (actionResult.getAction() == "get_input")
      {
          if (actionResult.getInterrupted())
          {
              // The GetInput action was interrupted
      
              // Your code here...
          }
      }
      
  • TelephonyRequest.get_action_result()

    Returns a dictionary that represents a Action Result support class.

    Examples:

    • Get the details of the recording from the result of a record action:

      my_request = TelephonyRequest(request)
      action_result = my_request.get_action_result() 
      
      if action_result.get("action") == "record": 
          is_interrupted = action_result.get("interrupted", False)
          
          if is_interrupted == False:
              result = action_result.get("result")
              filename = result.get("filename")
              contains_sound = result.get("contains_sound")
              seconds_duration = result.get("seconds_duration")
      
    • Get the action that was interrupted:

      if action_result.get("action") == "get_input":
          is_interrupted = action_result.get("interrupted", False)
          
          if is_interrupted == True:
              print("action result unavailable - get input was interrupted")
      
  • The ActionResult class

    Introduction

    Represents the result of an action.

    Class synopsis

    class ActionResult extends PropertyHolder {
    
        /* methods */
        public string getAction()
        public boolean getInterrupted()
    }
    

    Examples:

    • Get the details of the recording from the result of a record action:

      $info = InstanceInfo::getInstanceInfo();
      $recordResult = $info->getActionResult();
      $filename = $recordResult->getFilename();
      $containsSound = $recordResult->getContainsSound();
      $duration = $recordResult->getSecondsDuration();
      
    • Get the action that was interrupted:

      $info = InstanceInfo::getInstanceInfo();
      $actionResult = $info->getActionResult();
      if ($actionResult->getInterrupted()) {
          $interruptedAction = $actionResult->getAction();
      }