diff options
author | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-16 10:51:53 +0000 |
---|---|---|
committer | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-16 10:51:53 +0000 |
commit | b9b03966fb8526497e726b00cf53252268b9fcef (patch) | |
tree | 1737bbf754fc80795d7da8a7e44ef757640a050f /main/netsock.c | |
parent | 85bbad5334db6eecb6024f1e2b8316a18acfdd74 (diff) |
HUGE improvements to QoS/CoS handling by IgorG
- Refer to the proper documentation
- Implement separate signalling/media QoS/CoS in many channels using RTP
- Improve warnings and verbose messages
- Deprecate some old settings
Minor modifications by me, a big effort from IgorG.
Thanks!
Reported by: IgorG
Patches:
qoscleanup-89394-4-trunk.patch uploaded by IgorG (license 20)
Tested by: IgorG
(closes issue #11145)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@93163 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/netsock.c')
-rw-r--r-- | main/netsock.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/main/netsock.c b/main/netsock.c index d10c0c344..27def180c 100644 --- a/main/netsock.c +++ b/main/netsock.c @@ -117,7 +117,7 @@ struct ast_netsock *ast_netsock_bindaddr(struct ast_netsock_list *list, struct i return NULL; } - ast_netsock_set_qos(netsocket, tos, cos); + ast_netsock_set_qos(netsocket, tos, cos, "IAX2"); ast_enable_packet_fragmentation(netsocket); @@ -143,20 +143,20 @@ struct ast_netsock *ast_netsock_bindaddr(struct ast_netsock_list *list, struct i return ns; } -int ast_netsock_set_qos(int netsocket, int tos, int cos) +int ast_netsock_set_qos(int netsocket, int tos, int cos, const char *desc) { int res; if ((res = setsockopt(netsocket, IPPROTO_IP, IP_TOS, &tos, sizeof(tos)))) - ast_log(LOG_WARNING, "Unable to set TOS to %d\n", tos); - else - ast_verb(2, "Using TOS bits %d\n", tos); + ast_log(LOG_WARNING, "Unable to set %s TOS to %d, may be you have no root privileges\n", desc, tos); + else if (tos) + ast_verb(2, "Using %s TOS bits %d\n", desc, tos); #if defined(linux) if (setsockopt(netsocket, SOL_SOCKET, SO_PRIORITY, &cos, sizeof(cos))) - ast_log(LOG_WARNING, "Unable to set CoS to %d\n", cos); - else - ast_verb(2, "Using CoS mark %d\n", cos); + ast_log(LOG_WARNING, "Unable to set %s CoS to %d\n", desc, cos); + else if (cos) + ast_verb(2, "Using %s CoS mark %d\n", desc, cos); #endif return res; |