<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi,
      <br>
      I am trying to add a custom header to my calls to map several
      call-legs into a global call for viewing.
      <br>
      <br>
      For this to work I read the call-id from pjsip-channel and write
      it into X-CID:
      <br>
      <br>
      ######
      <br>
          -- Executing [s@macro-dialout-trunk-predial-hook:4]
      Set("PJSIP/10-00000006",
      "pjsipCallId=313530363933383438363436353930-1gh0bjceo933") in new
      stack
      <br>
          -- Executing [s@macro-dialout-trunk-predial-hook:5]
      Set("PJSIP/10-00000006",
      "PJSIP_HEADER(add,X-CID)=313530363933383438363436353930-1gh0bjceo933")
      in new stack
      <br>
          -- Executing [s@macro-dialout-trunk:18]
      GotoIf("PJSIP/10-00000006", "0?bypass,1") in new stack
      <br>
          -- Executing [s@macro-dialout-trunk:19]
      ExecIf("PJSIP/10-00000006",
      "1?Set(CONNECTEDLINE(num,i)=0xxxxxxxxxxxxxx)") in new stack
      <br>
          -- Executing [s@macro-dialout-trunk:20]
      ExecIf("PJSIP/10-00000006", "1?Set(CONNECTEDLINE(name,i)=<a
        class="moz-txt-link-freetext" href="CID:3xxxxx">CID:3xxxxx</a>)")
      in new stack
      <br>
          -- Executing [s@macro-dialout-trunk:21]
      ExecIf("PJSIP/10-00000006", "0?Set(CONNECTEDLINE(name,i)=<a
        class="moz-txt-link-freetext" href="CID:%28Hidden%293xxxxx%29">CID:(Hidden)3xxxxx)</a>")
      in new stack
      <br>
          -- Executing [s@macro-dialout-trunk:22]
      GotoIf("PJSIP/10-00000006", "0?customtrunk") in new stack
      <br>
          -- Executing [s@macro-dialout-trunk:23]
      Dial("PJSIP/10-00000006", "PJSIP/0xxxxxxxxxxxxxx@3xxxxx,300,T") in
      new stack
      <br>
          -- Called PJSIP/0xxxxxxxxxxxxxx@3xxxxx
      <br>
      <--- Transmitting SIP request (991 bytes) to
      UDP:217.23.24.100:5060 --->
      <br>
      INVITE <a class="moz-txt-link-abbreviated"
        href="mailto:sip:0xxxxxxxxxxxxxx@sip.provid.er:5060">sip:0xxxxxxxxxxxxxx@sip.provid.er:5060</a>
      SIP/2.0
      <br>
      Via: SIP/2.0/UDP
192.168.253.185:15070;rport;branch=z9hG4bKPj453d15e0-de58-4945-8b95-d05b16b9e4c3<br>
      From: <a class="moz-txt-link-rfc2396E"
        href="mailto:sip:+49xxxxxxxxxxx@sip.provid.er"><sip:+49xxxxxxxxxxx@sip.provid.er></a>;tag=080788ac-7c10-4cf3-86b3-359764ffb5a2
      <br>
      To: <a class="moz-txt-link-rfc2396E"
        href="mailto:sip:0xxxxxxxxxxxxxx@sip.provid.er"><sip:0xxxxxxxxxxxxxx@sip.provid.er></a>
      <br>
      Contact: <a class="moz-txt-link-rfc2396E"
        href="mailto:sip:+49xxxxxxxxx@192.168.253.185:15070"><sip:+49xxxxxxxxx@192.168.253.185:15070></a>
      <br>
      Call-ID: de41b93b-51d8-44b5-9c34-f2c0928192b0
      <br>
      CSeq: 1519 INVITE
      <br>
      Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE,
      CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
      <br>
      Supported: 100rel, timer, replaces, norefersub
      <br>
      Session-Expires: 1800
      <br>
      Min-SE: 90
      <br>
      Max-Forwards: 70
      <br>
      User-Agent: FPBX-14.0.1.10(14.6.2)
      <br>
      Content-Type: application/sdp
      <br>
      Content-Length:   308
      <br>
      <br>
      v=0
      <br>
      o=- 1719768133 1719768133 IN IP4 192.168.253.185
      <br>
      s=Asterisk
      <br>
      c=IN IP4 192.168.253.185
      <br>
      t=0 0
      <br>
      m=audio 55112 RTP/AVP 107 9 8 3 101
      <br>
      a=rtpmap:107 opus/48000/2
      <br>
      a=rtpmap:9 G722/8000
      <br>
      a=rtpmap:8 PCMA/8000
      <br>
      a=rtpmap:3 GSM/8000
      <br>
      a=rtpmap:101 telephone-event/8000
      <br>
      a=fmtp:101 0-16
      <br>
      a=ptime:20
      <br>
      a=maxptime:20
      <br>
      a=sendrecv
      <br>
      <br>
      <--- Received SIP response (559 bytes) from
      UDP:217.23.24.100:5060 --->
      <br>
      [...]
      <br>
      <br>
      ######
      <br>
      <br>
      <br>
      <br>
      <br>
      But I can't see that header anywhere in my call-legs. What am I
      missing?
      <br>
      <br>
      <br>
      kind regards,
      <br>
      andre</p>
  </body>
</html>