Edit 5/14/2017 - Added more information from further testing. Plus I was a bit to excited once I made some headway.
BAM! Looks like I was able to get some header injection into a transfer Outbound SIP call. Bear with me because this is going to a bit lengthy. TLDR: Read it anyway. :)
Support Response:
I opened a support case to inquire about a Tool Step that had a field "CustomHeaders" and also to poll support on the ability to add Full Custom headers to outbound. Really the response back from support was to use Eic_ISDNUUIData call attribute. So below is the summary of work to get me the custom headers.
Problem with using Eic_ISDNUUIData:
The problem with this attribute in 2017 R4 (I am currently only running R4) is that it is putting the string value in the header as HEX and I need it plain text/ascii. Changing the line configuration to user-to-user encoding ascii or extended ascii did not have any effect. Even change the line defualt in DSedit to ascii hoping that would help, but it did not. So user-to-user encoding is either broke or I am fubaring something. So went in search of another method.
Product Management Response:
I also received a response from product management in regards to this very topic. Big shout out to Cindy Herrington in product management for the follow up with more info. Copy paste a relevant portion of her response:
You also can customize the System_IntitiateCallRequest.ihd handler to add header/value pairs by setting the variable sCustomHeaders which is used in toolstep81:OutBoundCall.
sCustomHeaders should be a pair of valid SIP header value pairs for example; "Remote-Party-ID=<sip:101@10.22.254.26>;privacy=id" will add two headers to the outgoing sip INVITE message.
'Allow Full Custom Headers' will allow adding of non-standard (Custom headers) using above header/value pair method, if not only standard SIP headers will be allowed.
I have not tested their method for an Outbound initiated call as of yet. However I can state that for a transfer this only works if SIP REFER option is turned off on the line configuration as you can see below in the body of work section.
***Warning - I am modifying a system handler with no custom routine.
The tool step states that it will fail if used in any other handler. F1 "Help" is no good to you as well since that field is not documented.
Body of work:
SIP Line Configuration:
You have to turn off Enable sending SIP REFER messages on the "Call Putback" tab. This only works for a blind transfer that uses INVITE only. If you turn on SIP REFER the header is not inserted in any SIP message.
Target Handler: System_TransferCallRequest
Target Tool Step: Complete External Blind Transfer
Target Tool Step field: Custom Headers
The "Custom Header" field uses the variable CustomHeader which holds a string. This is where I started play. Thanks to the logs I quickly diagnosed my first issue which had to do with the string format.
First attempt: string "CustomHeader1 SomeValue"
tsserver log:
CSIPSystem::TokenizeCustomHeaders : Tokenizing custom headers = CustomHeader1 SomeValue
CSIPSystem::TokenizeCustomHeaders : Invalid custom header found, header-value-pair=CustomHeader1 SomeValue
CSIPSystem::SendOutboundReq : Aborting outbound req due to invalid custom header CustomHeader1 SomeValue
Those 3 trace log entries helped me out. Since this is a string and not a list of strings I had to find the correct string format to get the pair "Tokenized".
Second attempt : string "CustomHeader1=SomeValue" (after some string tokenization C# C++ format google searches)
The result from this attempt using the above string produced the result I was looking for. A wireshark capture on the CIC server showed an Outbound INVITE message containing the custom header and value that I wanted. YAY!!!
One last hurdle. I need the ability to insert multiple headers.
Third attempt: string "CustomHeader1=SomeValue;CustomHeader2=SomeMoreValue"
To refrain documenting all my attempts the end result was using a semi-colon ";" to separate the header/value pairs. Again a Wireshark capture showed the insertion of both headers.
Remaining problems:
1. The TS process does not adhere to the case sensitivity. You headers and values will not maintain any upper case. (Very disappointed)
2. SIP Refer Message does not carry the modified headers. (Would love this ability)