On 2/23/19 1:15 PM, Joshua C. Colp wrote:> On Sat, Feb 23, 2019, at 8:06 AM, hw wrote: >> On 2/22/19 7:56 PM, Joshua C. Colp wrote: >>> On Fri, Feb 22, 2019, at 2:48 PM, hw wrote: >>>> >>>> Hi, >>>> >>>> when trying to use SRTP, I can see UDP traffic from phones to the >>>> asterisk server being dropped be the firewall on arbitrary ports. >>> >>> There is no separate port range used for SRTP, and Asterisk does not control the port that the phone uses for sending to Asterisk. That's up to the endpoint. >> >> Thanks! >> >> The phones do not have any settings with which I could limit the ports >> used for SRTP. >> >>>> Where do I configure the SRTP port range (like the rtp port range)? >>>> >>>> Why aren't the clients talking to each other directly but apparenty try >>>> to send the SRTP traffic to the server? >>> >>> DIrect media with SRTP is not supported. All media when SRTP goes through Asterisk. >> >> Well, how are we supposed to handle this in firewalls? I do not want to >> open all ports for UDP traffic directed to the server. > > It's expected that traffic to the RTP port range that Asterisk is configured to use is let through to Asterisk to ensure audio flow. >The phones don't seem to be using the RTP port range specified in rtp.conf when they are using SRTP. When they are using RTP, they do not send the RTP traffic via asterisk, though they can do that without the ports for this opened in the firewall (perhaps the router uses a conntrack helper for RTP; I'd have to find out). When the phones use SRTP, the ports they're using are all over the place. I'd either have to open all UDP ports for their traffic to go via the server or stick to unencrypted phone calls. There must be some solution for this. That phone calls are encrypted schould be the default, especially since they are all going over the internet nowadays.
On Sat, Feb 23, 2019, at 9:21 AM, hw wrote: <snip>> > The phones don't seem to be using the RTP port range specified in > rtp.conf when they are using SRTP. When they are using RTP, they do not > send the RTP traffic via asterisk, though they can do that without the > ports for this opened in the firewall (perhaps the router uses a > conntrack helper for RTP; I'd have to find out). > > When the phones use SRTP, the ports they're using are all over the > place. I'd either have to open all UDP ports for their traffic to go > via the server or stick to unencrypted phone calls. > > There must be some solution for this. That phone calls are encrypted > schould be the default, especially since they are all going over the > internet nowadays.The rtp.conf file configures the port range that Asterisk uses for its RTP ports. It does not, and can not, control the remote endpoint. It's up to the endpoint and if NAT Is involved the router as to what source port is used for media originating from the endpoint. -- Joshua C. Colp Digium - A Sangoma Company | Senior Software Developer 445 Jan Davis Drive NW - Huntsville, AL 35806 - US Check us out at: www.digium.com & www.asterisk.org
*DIrect media with SRTP is not supported. All media when SRTP goes through Asterisk.* So you have to open ports on your firewall and disable directmedia=yes on your configuration. Only open a range of ports that you really use: for example is you have maximum 10 simultaneous calls, open only 40 ports (4 ports for each call, two for RTP and two for RTCP). Then change rtp.conf configuration reflect the range of ports you using. Other option is using another PBX/SWITCH that support SRTP flow direct between endpoints. Regards --- I'm SoCIaL, MayBe -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20190223/e41cad2c/attachment.html>
On 2/23/19 2:39 PM, Social Boh wrote:> *DIrect media with SRTP is not supported. All media when SRTP goes > through Asterisk.* > > So you have to open ports on your firewall and disable directmedia=yes > on your configuration.directmedia is not explicitly enabled; I guess it's the default. Joshua basically says there is no way to control which ports are being used for SRTP because that it is "up the endpoint". Such endpoints, in this case, are mobile phones with software like csipsimple or gs-wave (or perhaps zoiper), and I see no way in these programs to define which ports to use for SRTP. Since I have no way to define which ports endpoints use for SRTP, I would have to open all UDP ports in the firewall, and I don't want to do that. Nat is currently not involved yet. I want to get this to work first and then look into nat issues.> Only open a range of ports that you really use: for example is you have > maximum 10 simultaneous calls, open only 40 ports (4 ports for each > call, two for RTP and two for RTCP). Then change rtp.conf configuration > reflect the range of ports you using.So how would I control which ports are being used for SRTP? Some ports being open on the firewall doesn't mean the phones will automagically use them, does it?> Other option is using another PBX/SWITCH that support SRTP flow direct > between endpoints.Which one does that? And does that work through foreign firewalls I have no control over and when NAT becomes involved?