[asterisk-users] How to log caller IP address in the CDR?

Joshua Colp jcolp at digium.com
Fri Oct 5 07:26:09 CDT 2012


Benoit Panizzon wrote:
> Hello

Hola,

<snipped out parts, check archives for those who are curious>

> Well for this case it is too late now. But is there a way to get the IP
> Address of the SIP Client being logged in each CDR?

You can access the IP address of the received signaling traffic 
(provided it has not been spoofed) using ${CHANNEL(recvip)} in the 
dialplan. If the CDR module you are using supports storing custom 
variables you can do something like:

exten => _X.,1,Set(CDR(recvip)=${CHANNEL(recvip)})

To store this in the custom variable field 'recvip'.

If it does not you can store it in the userfield instead like:

exten => _X.,1,Set(CDR(userfield)=${CHANNEL(recvip)})

Cheers,

-- 
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at:  www.digium.com  & www.asterisk.org



More information about the asterisk-users mailing list