Module: kamailio
Branch: master
Commit: f68f0864c77e8556e48db4d5681ba8dc3ea06f62
URL: 
https://github.com/kamailio/kamailio/commit/f68f0864c77e8556e48db4d5681ba8dc3ea06f62

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2016-10-31T20:18:34+01:00

dmq_usrloc: use usigned int for contact info values

- switched to using json helper macros for numbers

---

Modified: modules/dmq_usrloc/usrloc_sync.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/f68f0864c77e8556e48db4d5681ba8dc3ea06f62.diff
Patch: 
https://github.com/kamailio/kamailio/commit/f68f0864c77e8556e48db4d5681ba8dc3ea06f62.patch

---

diff --git a/modules/dmq_usrloc/usrloc_sync.c b/modules/dmq_usrloc/usrloc_sync.c
index 9fd6322..5cc7cf5 100644
--- a/modules/dmq_usrloc/usrloc_sync.c
+++ b/modules/dmq_usrloc/usrloc_sync.c
@@ -316,10 +316,12 @@ int usrloc_dmq_handle_msg(struct sip_msg* msg, 
peer_reponse_t* resp, dmq_node_t*
        srjson_t *it = NULL;
        static ucontact_info_t ci;
 
-       int action, expires, cseq, flags, cflags, q, last_modified, methods, 
reg_id;
+       unsigned int action, expires, cseq, flags, cflags, q, last_modified,
+                                methods, reg_id;
        str aor, ruid, c, received, path, callid, user_agent, instance;
 
-       action = expires = cseq = flags = cflags = q = last_modified = methods 
= reg_id = 0;
+       action = expires = cseq = flags = cflags = q = last_modified
+               = methods = reg_id = 0;
 
        parse_from_header(msg);
        body = ((struct to_body*)msg->from->parsed)->uri;
@@ -360,7 +362,7 @@ int usrloc_dmq_handle_msg(struct sip_msg* msg, 
peer_reponse_t* resp, dmq_node_t*
                if (it->string == NULL) continue;
 
                if (strcmp(it->string, "action")==0) {
-                       action = it->valueint;
+                       action = SRJSON_GET_UINT(it);
                } else if (strcmp(it->string, "aor")==0) {
                        aor.s = it->valuestring;
                        aor.len = strlen(aor.s);
@@ -386,21 +388,21 @@ int usrloc_dmq_handle_msg(struct sip_msg* msg, 
peer_reponse_t* resp, dmq_node_t*
                        instance.s = it->valuestring;
                        instance.len = strlen(instance.s);
                } else if (strcmp(it->string, "expires")==0) { //
-                       expires = it->valueint;
+                       expires = SRJSON_GET_UINT(it);
                } else if (strcmp(it->string, "cseq")==0) {
-                       cseq = it->valueint;
+                       cseq = SRJSON_GET_UINT(it);
                } else if (strcmp(it->string, "flags")==0) {
-                       flags = it->valueint;
+                       flags = SRJSON_GET_UINT(it);
                } else if (strcmp(it->string, "cflags")==0) {
-                       cflags = it->valueint;
+                       cflags = SRJSON_GET_UINT(it);
                } else if (strcmp(it->string, "q")==0) {
-                       q = it->valueint;
+                       q = SRJSON_GET_UINT(it);
                } else if (strcmp(it->string, "last_modified")==0) {
-                       last_modified = it->valueint;
+                       last_modified = SRJSON_GET_UINT(it);
                } else if (strcmp(it->string, "methods")==0) {
-                       methods = it->valueint;
+                       methods = SRJSON_GET_UINT(it);
                } else if (strcmp(it->string, "reg_id")==0) {
-                       reg_id = it->valueint;
+                       reg_id = SRJSON_GET_UINT(it);
                } else {
                        LM_ERR("unrecognized field in json object\n");
                }


_______________________________________________
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to