How can I get the income IP address

Hi All,

How can I get in the CDR the income IP address that make the call?
I need it to bill.


Details depend on the channel technology used.

I am using the SIP extensions.

I assume by SIP extensions, you mean SIP phones with no intermediate proxy?

Which technology driver are you using (chan_sip or chan_pjsip).

There will typically be a function that returns the IP address, although, in most real world configurations, the channel name contains the peer name, which is a more stable indication of the phone than the IP address, and is already logged in the CDRs.

Yes, I have no use proxy in my environment.

I use chan_sip.

I believe it is ${CHANNEL(peerip)}

1 Like

and how can I add this in the Asterisk Realtime to the table CDR?

I assume you do it in essentially the same way as if you weren’t using ARA, with the normal translation from extensions.conf to database tables.