### Description
According to [RFC4594](https://datatracker.ietf.org/doc/html/rfc4594#page-19) ``` ------------------------------------------------------------------ | Service | DSCP | DSCP | Application | | Class Name | Name | Value | Examples | |===============+=========+=============+==========================| |Network Control| CS6 | 110000 | Network routing | |---------------+---------+-------------+--------------------------| | Telephony | EF | 101110 | IP Telephony bearer | |---------------+---------+-------------+--------------------------| | Signaling | CS5 | 101000 | IP Telephony signaling | |---------------+---------+-------------+--------------------------| ``` Kamailio should relay SIP messages with DCSP value `CS5` To set this value I can use in config file ``` tos=0xA0 ``` This works as expected But when I use text form this does not work ``` tos=IPTOS_PREC_CRITIC_ECP ``` `IPTOS_PREC_CRITIC_ECP` defined in the `/usr/include/linux/ip.h` as ``` #define IPTOS_PREC_CRITIC_ECP 0xa0 ``` I expect both forms `0xA0` and `IPTOS_PREC_CRITIC_ECP` should works.
Tested on 5.6.2 version
Thanks for the issue. As it works with the flag, it should be considered a feature request. Could be probably added to the parser. If no developer add code to implement this, the issue will be closed again after some waiting period.
The config scripting language is not the same with C programming language to be able to use directly symbols from C libraries/header files. Moreover, the macro (define) tokens are only in the C source code, not in the compiled binary, so practically at runtime there is no `IPTOS_PREC_CRITIC_ECP` anymore, the compiler replaced it with the associated value.
While the scripting language can be extended to translate from a string token to an integer value via lex/flex and yacc/bisson files from the core, it is not realistic to expect any C token to be just available in the config scripting language.
Moreover, probably there other defines for more possible tos values. If someone wants to extend the scripting language with tokens corresponding to tos values C defines, it is fine, just make pull requests, it is no reason to have a tracker item for it given such a broad purpose.
Closed #3368 as completed.