Yes, add $si to the list of extra Radius attributes logged in accounting, for example:
modparam("acc", "radius_extra", "Sip-RPid=$avp(s:rpid); \ Source-IP=$si; \ Source-Port=$sp; \ Canonical-URI=$avp(can_uri); \ Billing-Party=$avp (billing_party); \ Divert-Reason=$avp (s:divert_reason); \ X-RTP-Stat=$avp (s:rtp_statistics); \ From-Header=$hdr(from); \ User-Agent=$hdr(user-agent); \ Contact=$hdr(contact); \ Event=$hdr(event); \ SIP-Proxy-IP=$avp (s:sip_proxy_ip)")
Adrian
Andreas Sikkema andreas.sikkema at bbeyond.nl Thu Aug 9 17:39:12 CEST 2007
Previous message: [OpenSER-Users] [Openser Users]Differences between SIP Server andPBX Next message: [OpenSER-Users] Saving public IP in CDR Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
I'm trying to do add accounting to our OpenSER server. Getting accounting to work is easy but I'm having trouble saving client IP addresses with every CDR.
Most of our SIP UAs are behind some form of NAT and to "prove" that calls have originated at the client I want to save the public IP address and as extra service also the private IP address of the UA.
Saving the private IP address is easy, $Ri contains this value. I'm having trouble finding out what to do to save the public IP address. I thought that since I'm using fix_contact() I could save the contact header body, but $ct still contained the private IP address.
Is this even possible?
Adrian,
Yes, add $si to the list of extra Radius attributes logged in accounting, for example:
Unfortunately, as far as I can see (but I'm using a slightly outdated OpenSER version) $si contains the reported remote IP address, not the public IP address that the message has been received from.
Andreas,
another option in your case could be $src_ip
DanB
On 8/10/07, Andreas Sikkema andreas.sikkema@bbeyond.nl wrote:
Adrian,
Yes, add $si to the list of extra Radius attributes logged in accounting, for example:
Unfortunately, as far as I can see (but I'm using a slightly outdated OpenSER version) $si contains the reported remote IP address, not the public IP address that the message has been received from.
-- Andreas Sikkema
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Andreas,
What is the version you are using (openser -V). Would it be possible to upgrade?
DanB
On 8/10/07, Andreas Sikkema andreas.sikkema@bbeyond.nl wrote:
Dan-Cristian,
another option in your case could be $src_ip
Unfortunately the version I'm using doesn't support it. I get a parse error during configuration load...
-- Andreas Sikkema BBeyond Software Engineer Planeetbaan 4 +31 (0)23 7074342 2132 HZ Hoofddorp
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
El Friday 10 August 2007 11:47:07 Andreas Sikkema escribió:
Adrian,
Yes, add $si to the list of extra Radius attributes logged in accounting, for example:
Unfortunately, as far as I can see (but I'm using a slightly outdated OpenSER version) $si contains the reported remote IP address, not the public IP address that the message has been received from.
Received IP address $Ri - reference to IP address of the interface where the request has been received
El Friday 10 August 2007 12:07:37 Andreas Sikkema escribió:
Received IP address $Ri - reference to IP address of the interface where the request has been received
This refers to the interface on the server, not the client unfortunately...
Yes, that is, I comment it to you because you said:
"Unfortunately [...] $si contains the reported remote IP address, not the public IP address that the message has been received from."
I think you are trying to get something impossible: the last router IP through which the packet arrieved to your OpenSer. That's not possible, note that layer 3 (IP) doesn't notify the intermediary IP address in the received message, you just can see the source and destination.
Yes, that is, I comment it to you because you said:
"Unfortunately [...] $si contains the reported remote IP address, not the public IP address that the message has been received from."
I think you are trying to get something impossible: the last router IP through which the packet arrieved to your OpenSer. That's not possible, note that layer 3 (IP) doesn't notify the intermediary IP address in the received message, you just can see the source and destination.
No, I'm trying to get to the public IP address of a NATted SIP UA. This address is not found in the SIP message, but OpenSER knows it otherwise it couldn't reply to it ;-)
El Friday 10 August 2007 12:23:43 Andreas Sikkema escribió:
Yes, that is, I comment it to you because you said:
"Unfortunately [...] $si contains the reported remote IP address, not the public IP address that the message has been received from."
I think you are trying to get something impossible: the last router IP through which the packet arrieved to your OpenSer. That's not possible, note that layer 3 (IP) doesn't notify the intermediary IP address in the received message, you just can see the source and destination.
No, I'm trying to get to the public IP address of a NATted SIP UA. This address is not found in the SIP message, but OpenSER knows it otherwise it couldn't reply to it ;-)
Ok, then that is $si. But I've already read that in your case it means the privati IP of the source. Hummm...
On Friday 10 August 2007 12:23, Andreas Sikkema wrote:
Yes, that is, I comment it to you because you said:
"Unfortunately [...] $si contains the reported remote IP address, not the public IP address that the message has been received from."
I think you are trying to get something impossible: the last router IP through which the packet arrieved to your OpenSer. That's not possible, note that layer 3 (IP) doesn't notify the intermediary IP address in the received message, you just can see the source and destination.
No, I'm trying to get to the public IP address of a NATted SIP UA. This address is not found in the SIP message, but OpenSER knows it otherwise it couldn't reply to it ;-)
You could try to parse the Via headers to find the correct IP.