How to embed custom fields for recording file name into sip header

To send headers to the extension, you need to use the correct dialplan hook. See this thread: Hooking for fun and income

You don’t want to use SipAddHeader, use the native FreePBX subroutines.