Techincal Tip - SIP Useful Commands
Techincal Tip - SIP Useful Commands
Products
FortiGate
Description
This article shows some useful commands for troubleshooting SIP traffic.
Solution
Several commands are used to troubleshoot this issue, depending on the mode used by firewall (sip session-helper or SIP-
ALG).
Diagnosing calls
Use following commands to display status information about the SIP sessions being processed by the SIP ALG.
# diagnose sys sip-proxy calls list
# diagnose sys sip-proxy stats <----- This is the most useful as it shows what type of packets are
blocked.
# diagnose sys sip-proxy stats clear <----- To clear the old statistics and make recent tests more
obvious.
# diagnose sys sip status
# diagnose sys sip dialog list
# diagnose sys sip mapping list
https://kb.fortinet.com/kb/microsites/search.do?cmd=displayKC&docType=kc&externalId=FD38920&sliceId=1&docTypeID=DT_KCARTICLE_1_1… 1/4
27.05.2021 Techincal Tip: SIP useful Commands
Received: packets of certain type that FortiGate received. These are packets seen as passing over the FortiGate (no
action taken by FortiGate)
Blocked: packets that the FortiGate actively blocked. They can be either ‘request’ or ‘response’
Unknown form: The header may be familiar to FortiGate but the content may have certain extensions or field contents
that are not recognized, or completely strange in format. Unknown SIP requests are by default blocked (set block-
unknown enable). Malformed headers are by default set to pass in the SIP section of the default voip profile
Long headers: Certain packets contain a lot of non-standard extensions than enhance the SIP call. But this data needs
more space on a header’s line. Long lines/headers are by default blocked (set block-long-lines enable)
According to the output of '# diagnose sys sip-proxy stats', it is possible to make adjustments on the default voip
profile,
or create a new profile to be used in policies. Common changes are highlighted:
https://kb.fortinet.com/kb/microsites/search.do?cmd=displayKC&docType=kc&externalId=FD38920&sliceId=1&docTypeID=DT_KCARTICLE_1_1… 2/4
27.05.2021 Techincal Tip: SIP useful Commands
block-update Enable/disable block UPDATE requests.
register-contact-trace Enable/disable trace original IP/port within the
contact header of REGISTER requests.
rfc2543-branch Enable/disable support via branch compliant with RFC
2543.
log-violations Enable/disable logging of SIP violations.
log-call-summary Enable/disable logging of SIP call summary.
nat-trace Enable/disable preservation of original IP in SDP i
line.
subscribe-rate SUBSCRIBE request rate limit (per second, per
policy).
message-rate MESSAGE request rate limit (per second, per policy).
notify-rate NOTIFY request rate limit (per second, per policy).
refer-rate REFER request rate limit (per second, per policy).
update-rate UPDATE request rate limit (per second, per policy).
options-rate OPTIONS request rate limit (per second, per policy).
ack-rate ACK request rate limit (per second, per policy).
prack-rate PRACK request rate limit (per second, per policy).
info-rate INFO request rate limit (per second, per policy).
publish-rate PUBLISH request rate limit (per second, per policy).
bye-rate BYE request rate limit (per second, per policy).
cancel-rate CANCEL request rate limit (per second, per policy).
preserve-override Override i line to preserve original IPS (default:
append).
no-sdp-fixup Enable/disable no SDP fix-up.
contact-fixup Fixup contact anyway even if contact's IP:port
doesn't match session's IP:port.
max-idle-dialogs Maximum number established but idle dialogs to retain
(per policy).
block-geo-red-options Enable/disable block OPTIONS requests, but OPTIONS
requests still notify for redundancy.
hosted-nat-traversal Hosted NAT Traversal (HNT).
hnt-restrict-source-ip Enable/disable restrict RTP source IP to be the same
as SIP source IP when HNT is enabled.
max-body-length Maximum SIP message body length (0 meaning no limit).
unknown-header Action for unknown SIP header.
malformed-request-line Action for malformed request line.
malformed-header-via Action for malformed VIA header.
malformed-header-from Action for malformed From header.
malformed-header-to Action for malformed To header.
malformed-header-call-id Action for malformed Call-ID header.
malformed-header-cseq Action for malformed CSeq header.
malformed-header-rack Action for malformed RAck header.
malformed-header-rseq Action for malformed RSeq header.
malformed-header-contact Action for malformed Contact header.
malformed-header-record-route Action for malformed Record-Route header.
malformed-header-route Action for malformed Route header.
malformed-header-expires Action for malformed Expires header.
malformed-header-content-type Action for malformed Content-Type header.
malformed-header-content-length Action for malformed Content-Length header.
malformed-header-max-forwards Action for malformed Max-Forwards header.
malformed-header-allow Action for malformed Allow header.
malformed-header-p-asserted-identity Action for malformed P-Asserted-Identity header.
malformed-header-sdp-v Action for malformed SDP v line.
malformed-header-sdp-o Action for malformed SDP o line.
malformed-header-sdp-s Action for malformed SDP s line.
malformed-header-sdp-i Action for malformed SDP i line.
malformed-header-sdp-c Action for malformed SDP c line.
malformed-header-sdp-b Action for malformed SDP b line.
malformed-header-sdp-z Action for malformed SDP z line.
malformed-header-sdp-k Action for malformed SDP k line.
malformed-header-sdp-a Action for malformed SDP a line.
malformed-header-sdp-t Action for malformed SDP t line.
malformed-header-sdp-r Action for malformed SDP r line.
malformed-header-sdp-m Action for malformed SDP m line.
provisional-invite-expiry-time Expiry time for provisional INVITE (10 - 3600 sec).
ips-rtp Enable/disable allow IPS on RTP.
ssl-mode SSL/TLS mode for encryption & decryption of traffic.
Troubleshooting SIP-helper is not as easy, as we can only check whether the session expectation is created correctly.
Also, with SIP session-helper there are not many changes that can be operated for special topologies.
Since SIP session-helper is not commonly used, this guide will not focus on troubleshooting it.
# diagnose sys sip stat <----- Can be used to check if the sip-helper is used.
Related links.
https://docs.fortinet.com/document/fortigate/6.4.5/administration-guide/858887/voip-solutions
https://docs.fortinet.com/document/fortigate/6.2.7/cookbook/858887/voip-solutions
https://pub.kb.fortinet.com/ksmcontent/Fortinet-Public/current/FortiGate_6_0/fortigate-sip-603.pdf
https://kb.fortinet.com/kb/documentLink.do?popup=true&externalID=fortigate-voip-sip-521pdf
Related Articles
Technical Tip: Enabling the SIP Application Layer Gateway (ALG)
SIP and SCCP Traffic is Handled by the VoIP ALG/Proxy by default in FortiOS 5.2
https://kb.fortinet.com/kb/microsites/search.do?cmd=displayKC&docType=kc&externalId=FD38920&sliceId=1&docTypeID=DT_KCARTICLE_1_1… 3/4
27.05.2021 Techincal Tip: SIP useful Commands
Technical Tip: Disabling VoIP Inspection
Technical Tip: How to use the SIP ALG to prevent unwanted calls
Technical Tip: How to confirm if FortiGate is using SIP Session Helper or SIP ALG
Technical Tip: VOIP calls (using SIP)
https://kb.fortinet.com/kb/microsites/search.do?cmd=displayKC&docType=kc&externalId=FD38920&sliceId=1&docTypeID=DT_KCARTICLE_1_1… 4/4