Creates an ExternalServiceRequest2 object used to send an external request.
(Replaces the deprecated createExternalServiceRequest method.)
@event::createExternalServiceRequest2()
None
(script object) @ExternalServiceRequest2
The following example uses the createExternalServiceRequest2 method to perform an external ping request:
@serviceRequest = @event::createExternalServiceRequest2()
$serviceRequest.request_text = "pingdevice"
$serviceRequest.device = $event.device
$requestTimedOut = false
@serviceRequest::send()
$timeout = 300
UNTIL($serviceRequest.completed, $timeout)
@external_response = @serviceRequest::getResponse()
IF ($serviceRequest.completed)
@phone::play("phrase", $external_response.pingresult)
ELSE
@phone::play("phrase", "Ping timed out")
ENDIF