How to add custom header to outbound invite

I am trying to add custom header using PJSIP_HEADER as follows. Looks like it’s not working. Please help.

exten => +1111111111,1,NoOp(debug info , to ${EXTEN} from ${CALLERID(all)})
  same => n,Answer()
  same => n,Set(PJSIP_HEADER(add,X-my-header)=abcdef)
  same => n,Goto(38wlkxioC9LP1OA9ogKam)
  same => n(38wlkxioC9LP1OA9ogKam),NoOp(Dialing john)
  same => n,Dial(PJSIP/john)

You need to add it to the outbound channel, which you access with the “b” option on Dial.

1 Like

Thank you. It works :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.