
#
# 40asterisk
#
{
    my $iax = $asterisk{'AllowExternalIAX'} || 'disabled';
    my $webrtc = $asterisk{'AllowExternalWebRTC'} || 'disabled';
    my $sips = $asterisk{'AllowExternalSIPS'} || 'disabled';
    if ($iax eq 'enabled') {
        $OUT .= "# Enable IAX from red interfaces\n";
        $OUT .= "?COMMENT Enable IAX from red interfaces\n";
        $OUT .= "ACCEPT\tnet\t\$FW\tudp\t4569,5036\n";
    }
    if ($webrtc eq 'enabled') {
        $OUT .= "# Enable WebRTC from red interfaces\n";
        $OUT .= "?COMMENT Enable WebRTC from red interfaces\n";
        $OUT .= "ACCEPT\tnet\t\$FW\ttcp\t8089\n";
    }
    if ($sips eq 'enabled') {
        $OUT .= "# Enable SIP Secure from red interfaces\n";
        $OUT .= "?COMMENT Enable SIPS from red interfaces\n";
        $OUT .= "ACCEPT\tnet\t\$FW\ttcp\t5061\n";
    }
    #open RTP ports if sip or webrtc are enabled
    if ($sips eq 'enabled' or $webrtc eq 'enabled') {
        $OUT .= "# Enable RTP from red interfaces\n";
        $OUT .= "?COMMENT Enable RTP from red interfaces\n";
        $OUT .= "ACCEPT\tnet\t\$FW\tudp\t10000:20000\n";
    }


    $OUT .= "?COMMENT\n";
}
