Hi all I'd like to log the client IP addr and port used for SIP and RTP *during* in a call. The IPs must be the real source IPs (internet accessible). How are these parameters available from dialplan? For instance, ${SIPURI} holds the internal "IP:port" if the client is behind NAT. I need the external IP:port Regards Ethy
http://www.voip-info.org/wiki/view/Asterisk+func+sip_header On 2016-11-09 08:13 AM, Ethy H. Brito wrote:> Hi all > > I'd like to log the client IP addr and port used for SIP and RTP *during* in a > call. > > The IPs must be the real source IPs (internet accessible). > > How are these parameters available from dialplan? > > For instance, ${SIPURI} holds the internal "IP:port" if the client is behind NAT. > I need the external IP:port > > Regards > > Ethy >
Hi Ethy, Am 09.11.2016 um 17:13 schrieb Ethy H. Brito:> How are these parameters available from dialplan? > > For instance, ${SIPURI} holds the internal "IP:port" if the client is behind NAT. > I need the external IP:portYou can get the peer's signalling IP address from ${CHANNEL(recvip)} and the RTP address with ${CHANNEL(rtpsource)} resp. ${CHANNEL(rtpdest)}. If you need more information (like the codecs used) you can find other channel variables on https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Function_CHANNEL Please note that, if you have not disabled re-invites, the RTP address may change while the call is running. Max -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20161110/743b1548/attachment.pgp>
On Thu, 10 Nov 2016 00:35:54 +0100 Max Grobecker <max.grobecker at ml.grobecker.info> wrote:> Hi Ethy,Hi Max and All.> > > Am 09.11.2016 um 17:13 schrieb Ethy H. Brito: > > > How are these parameters available from dialplan? > > > > For instance, ${SIPURI} holds the internal "IP:port" if the client is > > behind NAT. I need the external IP:port > > > You can get the peer's signalling IP address from ${CHANNEL(recvip)} and the > RTP address with ${CHANNEL(rtpsource)} resp. ${CHANNEL(rtpdest)}. If you need > more information (like the codecs used) you can find other channel variables > on https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Function_CHANNELHmmmm. ${CHANNEL(rtpsource)} is always returning something like "0.0.0.0:ppppp" where p=[0-9] and ${CHANNEL(rtpdest)} returns the internal (not accessible) IP addr if the caller is behind NAT, therefore, not what I need. Wouldn't these two variables have correct values only after the callee answers the call??> > Please note that, if you have not disabled re-invites, the RTP address may > change while the call is running.Interesting observation. Thanx Ethy