<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Oh my bad, I got now.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
on reply route , you can get some variables. Have you tried "<span style="font-size: 10pt;">TMX module Pseudo-Variables"</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-size: 10pt;"><a href="https://www.kamailio.org/wiki/cookbooks/5.2.x/pseudovariables" id="LPlnk768883">https://www.kamailio.org/wiki/cookbooks/5.2.x/pseudovariables</a><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> sr-users <sr-users-bounces@lists.kamailio.org> on behalf of YAS0 CANER <caner_yaso@hotmail.com><br>
<b>Sent:</b> Thursday, January 3, 2019 9:01 AM<br>
<b>To:</b> Sergiu Pojoga; Kamailio (SER) - Users Mailing List<br>
<b>Subject:</b> Re: [SR-Users] logging destination IP and proto on reponse</font>
<div> </div>
</div>
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hello,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
you can use accounting module to log them.You can append new variables,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<table style="box-sizing:border-box; border-collapse:collapse; border-spacing:0px; tab-size:8; color:rgb(36,41,46); font-size:14px; background-color:rgb(255,255,255)">
<tbody style="box-sizing:border-box">
<tr style="box-sizing:border-box">
<td style="box-sizing:border-box; padding:0px 10px; line-height:20px; vertical-align:top; font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:12px">
modparam(<span style="box-sizing:border-box; color:rgb(3,47,98)"><span style="box-sizing:border-box">"</span>acc<span style="box-sizing:border-box">"</span></span>,
<span style="box-sizing:border-box; color:rgb(3,47,98)"><span style="box-sizing:border-box">"</span>log_extra<span style="box-sizing:border-box">"</span></span>,</td>
</tr>
<tr style="box-sizing:border-box">
<td style="box-sizing:border-box; padding:0px 10px; color:rgba(27,31,35,0.3); font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:12px; line-height:20px; min-width:50px; text-align:right; vertical-align:top; width:50.4px">
</td>
<td style="box-sizing:border-box; padding:0px 10px; line-height:20px; vertical-align:top; font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:12px">
<span style="box-sizing:border-box; color:rgb(3,47,98)"><span style="box-sizing:border-box">"</span>src_user=$fU;src_domain=$fd;src_ip=$si;<span style="box-sizing:border-box">"</span></span></td>
</tr>
<tr style="box-sizing:border-box">
<td style="box-sizing:border-box; padding:0px 10px; color:rgba(27,31,35,0.3); font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:12px; line-height:20px; min-width:50px; text-align:right; vertical-align:top; width:50.4px">
</td>
<td style="box-sizing:border-box; padding:0px 10px; line-height:20px; vertical-align:top; font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; font-size:12px">
<span style="box-sizing:border-box; color:rgb(3,47,98)"><span style="box-sizing:border-box">"</span>dst_ouser=$tU;dst_user=$rU;dst_domain=$rd<span style="box-sizing:border-box">"</span></span>)</td>
</tr>
</tbody>
</table>
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
</div>
<div>in addition, there is a onsend_route to help what you need.</div>
<div><br>
</div>
<div><a href="https://www.kamailio.org/wiki/cookbooks/5.2.x/core#onsend_route" id="LPlnk608998">https://www.kamailio.org/wiki/cookbooks/5.2.x/core#onsend_route</a><br>
</div>
<div id="LPBorder_GTaHR0cHM6Ly93d3cua2FtYWlsaW8ub3JnL3dpa2kvY29va2Jvb2tzLzUuMi54L2NvcmUjb25zZW5kX3JvdXRl" class="x_LPBorder469509" style="width: 100%; margin-top: 16px; margin-bottom: 16px; max-width: 800px; min-width: 424px; position: relative;">
<table id="LPContainer469509" role="presentation" style="padding:12px 36px 12px 12px; width:100%; border-width:1px; border-style:solid; border-color:rgb(200,200,200); border-radius:2px">
<tbody>
<tr valign="top" style="border-spacing:0px">
<td style="width:100%">
<div id="LPTitle469509" style="font-size:21px; font-weight:300; margin-right:8px; font-family:wf_segoe-ui_light,"Segoe UI Light","Segoe WP Light","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; margin-bottom:12px">
<a target="_blank" id="LPUrlAnchor469509" href="https://www.kamailio.org/wiki/cookbooks/5.2.x/core#onsend_route" style="text-decoration:none">cookbooks:5.2.x:core [Kamailio SIP Server Wiki]</a></div>
<div id="LPDescription469509" style="font-size:14px; max-height:100px; color:rgb(102,102,102); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; margin-bottom:12px; margin-right:8px; overflow:hidden">
This is the second section of the configuration file, containing the directives to load modules and set their parameters. It contains the directives loadmodule and modparam.In the default configuration file starts with the line setting the path to modules (the
 assignment to mpath core parameter.. Example of content:</div>
<div id="LPMetadata469509" style="font-size:14px; font-weight:400; color:rgb(166,166,166); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif">
www.kamailio.org</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<div><br>
</div>
<div>
<h3 style="font-weight:bold; line-height:1.2; clear:left; font-size:1.125em; margin:0px 0px 0.888em; font-family:Arial,sans-serif">
onsend_route</h3>
<pre style="margin:0px 0px 1.4em; padding:0.7em 1em; font-family:Consolas,"Andale Mono WT","Andale Mono","Bitstream Vera Sans Mono","Nimbus Mono L",Monaco,"Courier New",monospace; font-size:14px; text-align:left; background-color:rgb(251,250,249); border-radius:2px; overflow:auto; border:1px solid rgb(204,204,204)">  onsend_route <span style="color:rgb(102,204,102)">{</span>
    <span style="color:rgb(177,177,0)">if</span><span style="color:rgb(102,204,102)">(</span>to_ip<span style="color:rgb(102,204,102)">==</span>1.2.3.4 <span style="color:rgb(102,204,102)">&&</span> <span style="color:rgb(102,204,102)">!</span>isflagset<span style="color:rgb(102,204,102)">(</span><span style="color:rgb(204,102,204)">12</span><span style="color:rgb(102,204,102)">)</span><span style="color:rgb(102,204,102)">)</span><span style="color:rgb(102,204,102)">{</span>
      <a href="http://www.opengroup.org/onlinepubs/009695399/functions/log.html" style="outline:none; color:rgb(43,115,183)"><span style="color:rgb(0,0,102)">log</span></a><span style="color:rgb(102,204,102)">(</span><span style="color:rgb(204,102,204)">1</span><span style="color:rgb(102,204,102)">,</span> <span style="color:rgb(255,0,0)">"message blocked<span style="color:rgb(0,0,153); font-weight:bold">\n</span>"</span><span style="color:rgb(102,204,102)">)</span><span style="color:rgb(102,204,102)">;</span>
      drop<span style="color:rgb(102,204,102)">;</span>
    <span style="color:rgb(102,204,102)">}</span>
  <span style="color:rgb(102,204,102)">}</span></pre>
<br>
</div>
<div><br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> sr-users <sr-users-bounces@lists.kamailio.org> on behalf of Sergiu Pojoga <pojogas@gmail.com><br>
<b>Sent:</b> Thursday, January 3, 2019 4:01 AM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List<br>
<b>Subject:</b> Re: [SR-Users] logging destination IP and proto on reponse</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">$sel(via[2].host) should give the 'destination' of the reply, provided that the original request wasn't from behind NAT and one single proxy in between UAs.<br>
</div>
<div dir="ltr"><br>
</div>
<div>Don't take my answer for granted, as I don't think it's complete and/or accurate.</div>
<div dir="ltr"><br>
</div>
</div>
<br>
<div class="x_x_gmail_quote">
<div dir="ltr">On Wed, Jan 2, 2019 at 5:11 PM Andrew Chen <<a href="mailto:achen@fuze.com">achen@fuze.com</a>> wrote:<br>
</div>
<blockquote class="x_x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">Hey all,
<div><br>
</div>
<div>Any way to log destination IP and proto of SIP responses?  I'd tried to use majority of the pseudovars, but they all just return <null>.</div>
<div><br>
</div>
<div>Thanks.</div>
<div><br>
</div>
<div>-- <br>
<div dir="ltr" class="x_x_gmail-m_5522927323885035965gmail_signature">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr" style="font-size:12.8px">Andy Chen</div>
<div dir="ltr" style="font-size:12.8px">
<div><a href="mailto:achen@thinkingphones.com" target="_blank">achen@</a><a href="http://fuze.com" target="_blank">fuze.com</a></div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">*Confidentiality Notice: The information contained in this e-mail and any</span><br style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">attachments may be confidential. If you are not an intended recipient, you</span><br style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">are hereby notified that any dissemination, distribution or copying of this</span><br style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">e-mail is strictly prohibited. If you have received this e-mail in error,</span><br style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">please notify the sender and permanently delete the e-mail and any</span><br style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">attachments immediately. You should not retain, copy or use this e-mail or</span><br style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">any attachment for any purpose, nor disclose all or any part of the</span><br style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">contents to any other person. Thank you.*</span>_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote>
</div>
</div>
</div>
</body>
</html>