[Asterisk-code-review] chan_sip: DiffServ/ToS not only on UDP but also on TCP and TLS sockets. (asterisk[master])

Friendly Automation asteriskteam at digium.com
Thu Apr 16 10:20:37 CDT 2020


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/14211 )

Change subject: chan_sip: DiffServ/ToS not only on UDP but also on TCP and TLS sockets.
......................................................................

chan_sip: DiffServ/ToS not only on UDP but also on TCP and TLS sockets.

ASTERISK-27195
Reported by: Joshua Roys

Change-Id: I6e72ecb874200dec7a3865c7babaf5ac0d3101de
---
M channels/chan_sip.c
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit



diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 078cf10..9bc282b 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -29696,6 +29696,8 @@
 		goto create_tcptls_session_fail;
 	}
 
+	ast_set_qos(s->fd, global_tos_sip, global_cos_sip, "SIP");
+
 	return s->fd;
 
 create_tcptls_session_fail:
@@ -33510,6 +33512,7 @@
 			if (setsockopt(sip_tcp_desc.accept_fd, SOL_SOCKET, SO_KEEPALIVE, &flags, sizeof(flags))) {
 				ast_log(LOG_ERROR, "Error enabling TCP keep-alive on sip socket: %s\n", strerror(errno));
 			}
+			ast_set_qos(sip_tcp_desc.accept_fd, global_tos_sip, global_cos_sip, "SIP");
 		}
 	}
 
@@ -33537,6 +33540,7 @@
 				ast_log(LOG_ERROR, "Error enabling TCP keep-alive on sip socket: %s\n", strerror(errno));
 				sip_tls_desc.tls_cfg = NULL;
 			}
+			ast_set_qos(sip_tls_desc.accept_fd, global_tos_sip, global_cos_sip, "SIP");
 		}
 	} else if (sip_tls_desc.tls_cfg->enabled) {
 		sip_tls_desc.tls_cfg = NULL;

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/14211
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I6e72ecb874200dec7a3865c7babaf5ac0d3101de
Gerrit-Change-Number: 14211
Gerrit-PatchSet: 2
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200416/563da8ce/attachment.html>


More information about the asterisk-code-review mailing list