Initiate Call Recording From Call File

I had this setup before, but lost the file that I had it working on.

I’m trying to record calls initiated with call files, and I can’t remember how it was done:

Snippet from php file:

  fwrite($FileHandle,"Channel: SIP/XXXX/$Source_No\n");
  fwrite($FileHandle,"Application: Dial\n");
  fwrite($FileHandle,"Data: SIP/XXXX/$Dest_No\n");
  fwrite($FileHandle,"Callerid: <XXXXXXXXXX>\n");
  fwrite($FileHandle,"Context: internal\n");
  fwrite($FileHandle,"MaxRetries: 1\n");
  fwrite($FileHandle,"RetryTime: 60\n");
  fwrite($FileHandle,"Priority: 1\n");
  fwrite($FileHandle,"WaitTime: 20\n");