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: https://origsvn.digium.com/svn/asterisk/trunk@93163 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Olle Johansson
2007-12-16 10:51:53 +00:00
parent 4d0ceb96ba
commit 17afebc1a6
24 changed files with 242 additions and 122 deletions

View File

@@ -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;