### 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
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3368
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3368(a)github.com>
Module: kamailio
Branch: master
Commit: ae3e52daec9be45c4663708cb216b13864521a35
URL: https://github.com/kamailio/kamailio/commit/ae3e52daec9be45c4663708cb216b13…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-02-13T09:51:51+01:00
core: select - cast to uint64_t when using time_t value
---
Modified: src/core/select_core.c
---
Diff: https://github.com/kamailio/kamailio/commit/ae3e52daec9be45c4663708cb216b13…
Patch: https://github.com/kamailio/kamailio/commit/ae3e52daec9be45c4663708cb216b13…
---
diff --git a/src/core/select_core.c b/src/core/select_core.c
index ff5d6ef6b3..333f7a4513 100644
--- a/src/core/select_core.c
+++ b/src/core/select_core.c
@@ -13,8 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
@@ -26,7 +26,8 @@
* Module: \ref core
*/
-#include <stdlib.h>
+#include <stdlib.h>
+#include <stdint.h>
#include "select.h"
#include "select_core.h"
#include "select_buf.h"
@@ -60,7 +61,7 @@
#include "rand/kam_rand.h"
#define RETURN0_res(x) {*res=(x);return 0;}
-#define TRIM_RET0_res(x) {*res=(x);trim(res);return 0;}
+#define TRIM_RET0_res(x) {*res=(x);trim(res);return 0;}
#define TEST_RET_res_body(x) if (x){*res=(x)->body;return 0;}else return 1;
#define TEST_RET_res_value(x) if (x){*res=(x)->value;return 0;}else return 1;
@@ -1485,7 +1486,7 @@ int select_sys_unique(str* res, select_t* s, struct sip_msg* msg) {
c = int2str_base_0pad(getpid(), &l, 16, UNIQUE_ID_PID_LEN);
memcpy(uniq_id, c, UNIQUE_ID_PID_LEN);
uniq_id[UNIQUE_ID_PID_LEN] = '-';
- c = int2str_base_0pad(time(NULL), &l, 16, UNIQUE_ID_TIME_LEN);
+ c = int2str_base_0pad((unsigned int)(uint64_t)time(NULL), &l, 16, UNIQUE_ID_TIME_LEN);
memcpy(uniq_id+UNIQUE_ID_PID_LEN+1, c, UNIQUE_ID_TIME_LEN);
uniq_id[UNIQUE_ID_PID_LEN+1+UNIQUE_ID_TIME_LEN] = '-';
@@ -1525,7 +1526,7 @@ int select_sys_unique(str* res, select_t* s, struct sip_msg* msg) {
int select_sys_now(str* res, select_t* s, struct sip_msg* msg) {
- return uint_to_static_buffer(res, time(NULL));
+ return uint_to_static_buffer(res, (unsigned int)(uint64_t)time(NULL));
}
int select_sys_now_fmt(str* res, select_t* s, struct sip_msg* msg)