[OpenSIPS-Users] Take the value of the newly added SIP X-header for the log
Oleg Podguyko
podguiko at mail.ru
Thu Sep 26 13:47:26 EDT 2019
Hello everebody!
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
$var(i) = 0;
while( $json(resp/headers[$var(i)]) )
{
$var(header)=$json(resp/headers[$var(i)]/header);
$var(value)=$json(resp/headers[$var(i)]/value);
$var(i) = $var(i) + 1;
# add sip headers
append_hf("$var(header):$var(value)\r\n");
}
route(BALANCE);
route(RELAY);
Everything works. Now, In the next route (BALANCE), I want to output the header that was just added to the log
xlog("L_INFO", "$X-My-Custom-Header: $(hdr(X-My-Custom-Header))");
But in the log I always see null. Although in the INVITE wich opensips sends, all SIP X-header in place.
Does this mean I can't get the value of the newly added SIP X-header? What should I do to get these values?
--
Олег Подгуйко
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20190926/0cc098a8/attachment.html>
More information about the Users
mailing list