FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
abanga
Staff
Staff
Article Id 203336
Description

This article describes how SIP ALG processes VoIP traffic and how it may one-way audio issues.

Scope VoIP with FortiGate.
Solution

SIP ALG translates SIP and SDP parameters when the packet is sent to the SIP provider. 

Most SIP providers recommend disabling SIP ALG.

 

Why SIP ALG is required:

 

Both sides send Connection Information (c=IN) to establish an RTP/Audio session.

If a private IP is sent in the connection information, RTP traffic on the private IP will fail.

 

abanga_0-1642467479529.png

 

If SIP ALG is enabled, the Firewall will perform layer 7 Translation to translate the private IP in SDP to a public IP (in this case, SIP ALG is recommended).

 

abanga_1-1642467479535.png

 

An issue arises when phones or the PBX are already configured to send the Public IP in c=IN, meaning the firewall translates that IP as well when SIP ALG is enabled.  

 

In these cases, disable SIP ALG to disable Layer 7 translation.

 

abanga_2-1642467479540.png

 

Note:

The SIP provider will confirm whether SIP ALG needs to be enabled or disabled. 

 

The firewall uses SIP ALG when:

 

- SIP traffic matches a firewall policy with the VoIP profile. SIP ALG is always used, regardless of the default-voip-alg-mode setting.

- Traffic does not match a policy with a VoIP profile and VoIP mode is set to proxy-based.

 

FortiGate uses SIP ALG, depending on the configuration.

By default, SIP ALG is enabled ('set default-voip-alg-mode proxy-based').

 

Setting the VoIP Mode:

 

# config system setting

set default-voip-alg-mode [proxy-based | kernel-helper-based]

end

 

Run the following command on FortiGate to verify if the traffic is being processed by SIP ALG.

 

If there is no output, traffic is not processed by SIP ALG.

 

# diag sys sip-proxy call list

sip calls
vdom 0 (root) call 7f27378a0400
    call-id: HaHF1ajUKf
    txn 7f273785b000 (REGISTER)
      cseq 21 dir 0 state 5 status 200 expiry 3509 HA 0
      i_session: 7f273788ac00  r_session: 7f273788ac00
      register: present
      from: sip:1195@10.10.10.156
      to: sip:1195@10.10.10.156
      src: 172.31.196.139:4612
      dst: 10.15.0.2:5060

 

Another way to verify if the traffic is being processed by SIP ALG is to take packet captures for an SIP call on the inside and outside interfaces, then verify the 'Connection Information' in the SDP header of the packet captures (search for SIP/SDP in the protocol field).

 

Check for the IP and Audio/RTP port.

Connection information changing (IP/Port changing) will be visible if the traffic is processed by SIP ALG.

 

Below are examples of sample packets:

 

Packet capture on an inside interface:

 

Frame 44: 863 bytes on wire (6904 bits), 863 bytes captured (6904 bits)
Ethernet II, Src: Cisco_51:93:bf (00:26:0b:XX:93:XX), Dst: Fortinet_50:57:25 (70:4c:a5:XX:57:XX)
Internet Protocol Version 4, Src: 10.15.0.2, Dst: 172.X.X.139
User Datagram Protocol, Src Port: 5060, Dst Port: 25310
Session Initiation Protocol (200)

Status-Line: SIP/2.0 200 OK

Message Header

Message Body

Session Description Protocol

Session Description Protocol Version (v): 0

Owner/Creator, Session Id (o): Mitel-5000-ICP 172382904 1638985328 IN IP4 10.10.10.155

Session Name (s): SIP Call

Connection Information (c): IN IP4 10.10.10.155

Time Description, active time (t): 0 0
Session Attribute (a): sendrecv
Session Attribute (a): rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics

Media Description, name and address (m): audio 6080 RTP/AVP 0
Media Attribute (a): rtpmap:0 PCMU/8000/1
Media Attribute (a): ptime:20
Media Attribute (a): rtcp-fb:* trr-int 1000
Media Attribute (a): rtcp-fb:* ccm tmmbr
Media Attribute (a): sendrecv
[Generated Call-ID: NSxUWC5KDe]

 

Packet capture on an outside interface:

 

Frame 38: 872 bytes on wire (6976 bits), 872 bytes captured (6976 bits)
Ethernet II, Src: Fortinet_50:57:2c (70:4c:a5:XX:57:XX), Dst: Cisco_08:3e:81 (40:ce:24:XX:3e:XX)
Internet Protocol Version 4, Src: XX.92.XX.156, Dst: 172.X.X.139
User Datagram Protocol, Src Port: 5060, Dst Port: 25310
Session Initiation Protocol (200)

Status-Line: SIP/2.0 200 OK

Message Header

Message Body

Session Description Protocol

Session Description Protocol Version (v): 0
Owner/Creator, Session Id (o): Mitel-5000-ICP 172382904 1638985328 IN IP4 10.11.12.156
Session Name (s): SIP Call
Connection Information (c): IN IP4 10.11.12.156
Time Description, active time (t): 0 0
Session Attribute (a): sendrecv
Session Attribute (a): rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
Media Description, name and address (m): audio 64506 RTP/AVP 0
           

To disable SIP ALG, see this article and consider the implications. Then, run the following configuration on the FortiGate:

 

FortiWiFi-61E # config sys settings

FortiWiFi-61E (settings) set default-voip-alg-mode kernel-helper-based

FortiWiFi-61E (settings) end

 

Note:

It is necessary to clear all of the sessions for port 5060 (clearing 5060 session will drop all of the active calls passing through FortiGate).

 

FortiWiFi-61E # diag sys session filter  clear

FortiWiFi-61E # diag sys session filter dport 5060

FortiWiFi-61E # diag sys session clear

 

FortiWiFi-61E # diag sys session filter  clear

FortiWiFi-61E # diag sys session filter sport 5060

FortiWiFi-61E # diag sys session clear