<HTML><BODY><div>Hello everebody!</div>

<div> </div>

<div>My opensips works as proxy. Get INVITE from one side and communicates with a remote web server via rest. Opensips sends a request to the web server and receives a lot of custom data, which it converts to SIP X-header. In the end I get 10 different SIP X-headers</div>

<div> </div>

<div>$var(i) = 0; <br>
            while( $json(resp/headers[$var(i)]) )<br>
            {<br>
                $var(header)=$json(resp/headers[$var(i)]/header);<br>
                $var(value)=$json(resp/headers[$var(i)]/value);<br>
                $var(i) = $var(i) + 1;           <br>
                # add sip headers<br>
                append_hf("$var(header):$var(value)\r\n");<br>
            } <br>
        route(BALANCE);<br>
        route(RELAY);  </div>

<div> </div>

<div> Everything works. Now, In the next route (BALANCE), I want to output the header that was just added to the log</div>

<div><span style="color: rgb(51, 51, 51); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(248, 248, 248); text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">xlog("L_INFO", "$X-My-Custom-Header: $(hdr(X-My-Custom-Header))");</span></div>

<div> </div>

<div>But in the log I always see null. Although in the INVITE wich opensips sends, all SIP X-header in place. </div>

<div>Does this mean I can't get the value of the newly added SIP X-header? What should I do to get these values?</div>

<div> </div>

<div> </div>

<div> </div>

<div> </div>

<div> </div>

<div data-signature-widget="container">
<div data-signature-widget="content">
<div>--<br>
Олег Подгуйко</div>
</div>
</div>
</BODY></HTML>