SIP ALG là gì ? Và cách xử lý khi bị lỗi âm thanh một chiều

Khi bạn đã thiết lập xong hệ thống điện thoại VoIP của mình, nhưng đang gặp phải tình trạng bị ngắt cuộc gọi, có cuộc gọi nhưng không nghe thấy âm thanh sau khi bạn nhấc máy. Bạn có thể giải quyết ngay lập tức các vấn đề về Voice over IP sau khi bạn tắt SIP ALG.

Trong hướng dẫn này, chúng tôi sẽ trình bày lý do tại sao phải tắt SIP ALG để tối ưu hóa mạng của bạn cho dịch vụ điện thoại VoIP .

Hướng dẫn này hoàn hảo cho người mới cũng như người dùng nâng cao. Bắt đầu nào!

SIP ALG là gì?

SIP ALG là cổng của lớp ứng dụng giao thức khởi tạo phiên. Công nghệ này, còn được gọi là cổng cấp ứng dụng, có sẵn trên hầu hết các bộ định tuyến thương mại và nó giúp người dùng bắt đầu các cuộc gọi SIP một cách đáng tin cậy hơn, ngay cả khi ở sau mạng LAN có cấu hình tường lửa an toàn. ALG là một công cụ dịch địa chỉ mạng (NAT) để thay đổi các địa chỉ IP và cổng riêng thành địa chỉ IP công cộng và các cổng. 

SIP ALG hoạt động như một chương trình phần sụn độc lập để ngăn chặn các sự cố liên quan đến tường lửa trên bộ định tuyến. Nó kiểm tra phần SDP của các gói dữ liệu và sửa đổi chúng để chúng gửi một cách chính xác. Hãy nhớ rằng, tất cả VoIP đều thay đổi dữ liệu âm thanh (thoại) thành các gói sau đó được gửi qua mạng, vì vậy về mặt lý thuyết, điều này sẽ đảm bảo chất lượng cuộc gọi. 

Thật không may, công nghệ này thường cản trở chất lượng của các cuộc gọi SIP do tính chất đa quy trình của SIP và sự mỏng manh của các gói dữ liệu. Đây là lý do tại sao nhiều nhà cung cấp SIP hàng đầu yêu cầu bạn tắt tính năng này trên bộ định tuyến của bạn.

Để hiểu tại sao SIP ALG lại là vấn đề đối với các hệ thống điện thoại SIP hiện đại, hãy xem quy trình năm bước liên quan khi bạn đang cố gắng thực hiện cuộc gọi SIP. SIP giúp mở và chấm dứt kết nối dữ liệu nhưng với cuộc gọi SIP có một vài bước ở giữa. Đây là năm điều quan trọng nhất:

  1. Giai đoạn Invite Stage: Điều này xảy ra khi bạn bắt đầu cuộc gọi. gói tin Invite sẽ bắt đầu gửi từ phía bạn.
  2. Giai đoạn Invite Response Stage: Khi kết nối xảy ra, phản hồi sẽ được gửi trở lại trình quay số ban đầu.
  3. Giai đoạn Answering Stage: Giai đoạn trả lời là xác nhận cuộc gọi đến, không phải chính cuộc gọi. Phần này của quá trình cũng bắt đầu ở bên nhận.
  4. Giai đoạn Confirmation Stage: Đây là xác nhận cuối cùng của kết nối cuộc gọi. Điều này được gửi từ phía cuối của bạn (người khởi tạo).
  5. Giai đoạn Call Stage: Khi bốn bước này đã được hoàn thành, cuộc gọi sẽ xảy ra. Đây là kết nối hai chiều.

Mặc dù đây có vẻ là một quá trình dài và phức tạp gửi dữ liệu, nhưng nó được thực hiện chỉ trong vài giây. Vấn đề với điều này từ góc độ kết nối là có một quá trình kết nối gồm năm phần có nghĩa là nguy cơ mất gói cao hơn khi ALG đang sửa đổi dữ liệu đồng thời gói tin được gửi đến.

Dấu hiệu SIP ALG ảnh hưởng đến cuộc gọi VoIP

Có một số hiện tượng SIP ALG gây ảnh hưởng đến điện thoại VoIP. Nó không phải lúc nào cũng rõ ràng, đặc biệt là vì những vấn đề này thường diễn ra âm thầm mà người dùng không biết.

  • Âm thanh một chiều (chỉ một người có thể nghe thấy người kia)
  • Điện thoại không đổ chuông khi được gọi
  • Cuộc gọi bị ngắt sau khi được kết nối

Điều đang xảy ra là một số lưu lượng gói tin VoIP bị mất giữa điện thoại và nhà cung cấp dịch vụ VoIP. Lưu lượng này rất cần thiết để duy trì tính khả dụng của điện thoại và chọn codec âm thanh thích hợp.

Cách tắt SIP ALG trên bộ định tuyến của bạn

Đầu tiên cần xác định loại thiết bị định tuyến bạn đang sử dụng và đăng nhập vào bộ định tuyến thông qua trình duyệt với IP, Username và Password của bộ định tuyến đã cài đặt trước đó với. Dưới đây là hướng dẫn cách tắt SIP ALG những loại thiết bị định tuyến thông dụng.

Nhà sản xuất Các bước tắt SIP ALG
Actiontec Select Advanced, click Yes to accept the warning, then click ALG’s.
Ensure SIP ALG is disabled by removing the check.
Click Apply.
Select Advanced, click Yes to accept the warning, then click Remote Administration.
Click the checkbox to Allow Incoming WAN ICMP Echo Requests (for traceroute and ping), then click Apply.
Adtran Under Firewall, go to Firewall / ACLs.
Click on ALG Settings.
Uncheck the box labeled SIP ALG
Click Apply.
If you are using the terminal, issue the following command:
no ip firewall alg sip
Arris Most Arris broadband gateways:
Navigate to the gateway’s IP (192.168.0.1).
Username: admin
Password: motorola
Navigate to Advanced, then Options.
Uncheck the SIP box.Click Apply.

Arris BGW210:
Navigate to 192.168.1.254.
Authenticate without a username, and use the password located on the unit’s sticker.
Under the Firewall section, click on Advanced Firewall.
Change the Set SIP ALG setting to off.
Turn off the Authentication Header Forwarding.
Turn off ESP Header Forwarding.
Click Save.
Asus Under the Advanced Settings section, click WAN.
Click the NAT Passthrough tab.
Change the SIP Passthrough setting to “Disable.”
Click Apply.
AT&T U-Verse Pace 5268AC Gateway
This broadband gateway does not support disabling SIP ALG.
We recommend configuring your gateway to function only as a modem, not a router (Bridge Mode).
You will need to use another router that supports disabling SIP ALG.
Cisco Cisco General and Enterprise-Class routers:
no ip nat service sip tcp port 5060
no ip nat service sip udp port 5060

Cisco PIX routers:
no fixup protocol sip 5060
no fixup protocol sip udp 5060


Cisco ASA routers:
Locate ‘Class inspection_default’ under ‘Policy-map global_policy’. Execute this command: no inspect sip
D-Link Click on Advanced Settings.
Locate the Application Level Gateway (ALG) Configuration.
Uncheck the SIP option.
Click Save.

DIR-655:
Click Advanced, located along the top.
Click Firewall Settings on the left side of the screen.
Uncheck Enable SPI
Set both UDP and TCP Endpoint Filtering to Endpoint Independent.
Uncheck SIP from Application Level Gateway Configuration.
Click Save.
Fortinet Use the following commands from the CLI interface:
config system session-helper
show system session-helper
Find the SIP session instance, typically indicated by #12
Delete #12 or the appropriate number
Confirm its deletion by executing this command:
show system session-helper
Linksys Linksys Smart Wi-Fi (E-series):
On the left side of the screen, click on Connectivity.
Click the Administration tab.
Under Application Layer Gateway, verify SIP is unchecked.
Click Apply or Save.

Older Linksys models:
Go to the ‘Advanced’ section on the Admin page
Disable the SIP ALG feature.

Linksys BEFSR41 routers:
Click on Applications and Gaming on the Admin page.
Click on Port Triggering.
Type in ‘TCP’ as the application.
Type in ‘5060’ into the Start Port and End Port for the ‘Triggering Range’ and ‘Forwarded Range’ fields.
Check ‘Enable’.
Click on Save and Reboot.
Mikrotik For Mikrotik routers, SIP ALG is known as SIP Helper.
Use the company’s winbox software.Navigate to IP, then Firewall.
Click on the Service Ports tab and disable it through the GUI.
You may also run this command from the terminal:
/ip firewall service-port disable sip
Netgear For Netgear routers with the Genie interface:
Select the Advanced tab at the top.
Expand the Setup menu on the left side of the screen.Click WAN Setup. Check the box labeled Disable SIP ALG.

Other Netgear routers:
Under the Security/Firewall, click on Advanced Settings.
Disable SIP ALG.
Locate Session Limit under Security/Firewall.
Increase the UDP timeout to 300 sec.
SonicWall Under System Setup on the left side of the screen, click on VoIP.
Check ‘Enable Consistent NAT’
Uncheck ‘Enable SIP Transformations’.
Click Accept.
To increase UDP timeouts, navigate to the Firewall Settings, then Flood Protection.
Click on the UDP tab and modify the default UDP connection timeout to 300 seconds.
Click the Accept button to save the changes.
TP-Link Newer TP-Link routers (Archer series):
Click on the Advanced Tab.
Expand the NAT Forwarding menu on the left side of the screen.
Uncheck SIP ALG, RTSP ALG, and H323 ALG checkboxes.
Click Save.

Older TP-Link routers:
Use the Telnet client from the Command Prompt.
Apply the following command:
ip nat service sip sw off
UBEE Go to Advanced, then Options.
Uncheck the SIP and the RTSP checkboxes.
Click Apply.
Ubiquiti UniFi Security Gateway
Sign in to your UniFi security gateway.
Click on Routing & Firewall along the left side.
Click the Firewall tab at the top and click Settings from the sub-menu.
Toggle H.323 and SIP to off.
Click the Apply Changes button.

EdgeRouters (ER-x)
Access the router’s administrative interface, typically at 192.168.1.1. Use the Config Tree or a command-line interface to disable SIP ALG.
Config Tree:
Select config tree in the top right-hand corner.
Expand system, conntrack, modules, and sip.
Click the plus sign next to disable.
Click the Preview option.
Click Apply.
Command Line Interface:
From the administrative interface, choose CLI located at the top right corner of the screen.
From here, we can also increase UDP timeouts as well.
Enter these commands into the terminal:
configure
set system conntrack modules sip disable
set system conntrack timeout udp stream 300
set system conntrack timeout udp other 300
commit
save
exit
DrayTek DrayTek Vigor 2760
The option can be found in the regular interface at Network -> NAT -> ALG. If your device does not have a web interface then you’ll need a telnet client.
You will be prompted to provide a username and/or password.
These are the same credentials used to access the router’s web interface.
Afterwards, type in these commands:
sys sip_alg 0
sys commit On

Draytek Vigor2750 and Vigor2130
Please use these commands instead:
kmodule_ctl nf_nat_sip disable
kmodule_ctl nf_conntrack_sip disable
ZyXEL ZyXEL ZyWALL/USG60:
Click on Configuration and expand the Network settings.
Click ALG along the left side.
Uncheck all the checkboxes on the right side:
Uncheck Enable SIP ALG.
Uncheck
Enable SIP Transformations.
Click Apply.

ZyXEL C1000Z/C1100Z (CenturyLink):
Click on Advanced Setup.
Click on SIP ALG along the left side.
Toggle the SIP ALG setting to Disable.
Click Apply.

ZyXEL P600:
Telnet to the router (192.168.1.1) and enter the password.The default password is 1234. Type “24” and press enter.Then “8” and press enter.Provide this
command:
ip nat service sip active 0
When done, press Enter.

Sau khi thực hiện bất kỳ thay đổi nào trong số này, nguyên tắc chung là khởi động lại bộ định tuyến để giữ các thay đổi. Sau khi các thay đổi được thực hiện, bạn sẽ gặp ít vấn đề về chất lượng cuộc gọi hơn trên các kết nối SIP so với khi ALG quản lý các liên kết.

VoiceCloud cung cấp cho các doanh nghiệp giải pháp về tổng đài ảo đáng tin cậy và có uy tín. Nếu bạn quan tâm đến dịch vụ của chúng tôi, xin vui lòng liên hệ theo địa chỉ:

CÔNG TY TNHH TMDV CÔNG NGHỆ SONG THÀNH

Địa Chỉ: Tầng lửng, An Phú Plaza, 117-119 Lý Chính Thắng, P.7, Q.3, TP.HCM

Văn phòng giao dịch: 337 Hồng Bàng, Phường 11, Quận 5, TP. Hồ Chí Minh

Hotline: 1900 2028

Email: info@voicecloud.vn