MoveFile command

The MoveFile command is used for moving your source file into a specified target directory. A target directory could only be the installed directory of the Ozeki Phone System, the Voicemails directory which contains the old, new and the attachment directories of an extension and the directory of your uploaded files.

<MoveFile> command example usage:

It is widely used as a Voicemail (more information about the Voicemail please click here) functionality when you would like to move your listened message into the „old messages” directory.

Parameters:

Parameter name Value Description Mandatory
SourceFile string value,
e.g. $item.message
Your choosen file to move to the target directory. This is the full access path of the file. Yes
TargetDirectory string value,
e.g. $oldmessagepath
The TargetDirectory is for giving a destination for the source file to be saved on it. Yes

OzML simple example:

It moves all of your message files into the target directory which is the old messages directory.
<?xml version="1.0"?>
<Response>
	<ForEach source='voicemails'>
	 	<MoveFile SourceFile='$item.message' TargetDirectory='$oldmessagepath'></MoveFile>
	</ForEach>
</Response>

Detailed voicemail example:

This speaks the 2 sentences between the <InitialCommands></InitialCommands> nodes repeatedly with a 5 second delay and scans the pressed numbers at the same time.

By pressing 1 the system will go through your old voicemails array with the ForEach loop and it will play them. If you press 1 again, you can delete the current message with the <DeleteFile></DeleteFile> command.
<?xml version="1.0"?>
<Response>
    <UserInput repeat ='true'digits ='1'>
        <InitialCommands>
            <Speak>This is the voicemail of user $username .</Speak>
            <Speak>To listen to your new messages, press 1.</Speak>
            <Delay>5</Delay>
        </InitialCommands>
        <Inputs>
            <Input key ='1'>
                <ForEach source ='voicemails'>
                    <Speak>This voicemail has been recorded at $item.date from $item.from .</Speak>
                    <Play>$item.message</Play>
                    <MoveFile SourceFile='$item.message' TargetDirectory='$oldmessagepath'></MoveFile>
                </ForEach>
                <Speak>You have no new messages.</Speak>
            </Input>
        </Inputs>
    </UserInput>
</Response>
MoveFile command is used in OzML responses to these Api Extension Control notifications:
DeleteFile, Var, ForEach, Call, BlindTransfer, Array, SendSMS

More information