Custom SIP header on outgoing calls

Hi Daniel:

This dialplan will allow you to set a custom header on all outbound calls for a specific trunk:

[macro-dialout-trunk-predial-hook]
exten => s,1,Noop(Entering user defined context macro-dialout-trunk-predial-hook in extensions_custom.conf)
exten => s,n,ExecIF($["${OUT_${DIAL_TRUNK}_SUFFIX}"!=""]?Set(trunk_name=${OUT_${DIAL_TRUNK}_SUFFIX}):Set(trunk_name=${OUT_${DIAL_TRUNK}}))
exten => s,n,Noop(Trunk Name: ${trunk_name})
exten => s,n,GoSubIf($["${trunk_name}"="<< name of trunk >>"]?func-set-sipheader,s,1(X-SDX-survey_sip_token,d63f04e0-c499-11g9-b7d0 -29bc03531d2))
exten => s,n,MacroExit

You must edit the GoSubIf line with the actual trunk name you want the header on.

3 Likes