Re: [asterisk-users] SIP and RTP port and IP addresses

2016-11-10 Thread Matthew Jordan
On Thu, Nov 10, 2016 at 7:15 AM, Ethy H. Brito 
wrote:

> On Thu, 10 Nov 2016 00:35:54 +0100
> Max Grobecker  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_CHANNEL
>
> H.
>
> ${CHANNEL(rtpsource)} is always returning something like "0.0.0.0:p"
> where
> p=[0-9]
>
>
You've bound to the 'bind all' address - hence why you get '0.0.0.0'. The
'p' values are the RTP port that was chosen for that call. RTP port ranges,
by default, are from 5000 to 31000.



> and ${CHANNEL(rtpdest)} returns the internal (not accessible) IP addr if
> the
> caller is behind NAT, therefore, not what I need.
>
>
The RTP destination is going to be what is negotiated in the SDP. If that's
a private IP address, then that's what you'd see there.

If you have symmetric RTP enabled, then this will switch to the address
that we are receiving RTP from. That may or may not be the original
negotiated address - if the remote end is behind a NAT, it will most likely
switch to the public IP address that we are receiving media from.




> Wouldn't these two variables have correct values only after the callee
> answers
> the call??
>
>
No. In fact, as Asterisk is a B2BUA, there are always going to be two sets
of RTP values:

 - The source/destination of the RTP stream to the inbound channel
 - The source/destination of the RTP stream to the outbound channel

The inbound channel will have its set of RTP addresses when Asterisk either
sends a Progress indication or Answers the inbound channel. The outbound
channel will have its set of RTP addresses when the far end sends a
Progress indication or Answers the outbound channel.

All of these RTP addresses may change due to:
 * NAT settings (symmetric RTP)
 * re-INVITEs, either due to Asterisk directmedia settings or re-INVITEs
initiated by the far endpoints (call hold, etc.)
 * ICE negotiation



> >
> > Please note that, if you have not disabled re-invites, the RTP address
> may
> > change while the call is running.
>
> Interesting observation.
>
> Thanx
>
> Ethy
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.
> org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>



-- 
Matthew Jordan
Digium, Inc. | CTO
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] SIP and RTP port and IP addresses

2016-11-10 Thread Ethy H. Brito
On Thu, 10 Nov 2016 00:35:54 +0100
Max Grobecker  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_CHANNEL

H.

${CHANNEL(rtpsource)} is always returning something like "0.0.0.0:p" 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

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] SIP and RTP port and IP addresses

2016-11-09 Thread Max Grobecker
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: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_CHANNEL

Please note that, if you have not disabled re-invites, the RTP address may 
change while the call is running.



Max



signature.asc
Description: OpenPGP digital signature
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] SIP and RTP port and IP addresses

2016-11-09 Thread Gao


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




--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] SIP and RTP port and IP addresses

2016-11-09 Thread Ethy H. Brito

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

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users