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

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2026-07-06T11:11:57+02:00

jsonrpcs: rpc exec locking

---

Modified: src/modules/jsonrpcs/jsonrpcs_mod.c

---

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

---

diff --git a/src/modules/jsonrpcs/jsonrpcs_mod.c 
b/src/modules/jsonrpcs/jsonrpcs_mod.c
index 3950c0a5f48..4c94d0fada7 100644
--- a/src/modules/jsonrpcs/jsonrpcs_mod.c
+++ b/src/modules/jsonrpcs/jsonrpcs_mod.c
@@ -1367,6 +1367,7 @@ static int ki_jsonrpcs_dispatch(sip_msg_t *msg)
        srjson_t *nj = NULL;
        str val;
        unsigned int rdata;
+       int lidx = -1;
 
        if(!IS_HTTP(msg)) {
                LM_DBG("Got non HTTP msg\n");
@@ -1443,6 +1444,7 @@ static int ki_jsonrpcs_dispatch(sip_msg_t *msg)
        }
        if(nj != NULL)
                ctx->req_node = nj->child;
+       lidx = ksr_rpc_exec_locks_set_get(&val);
        rpce->r.function(&func_param, ctx);
 
 send_reply:
@@ -1450,6 +1452,7 @@ static int ki_jsonrpcs_dispatch(sip_msg_t *msg)
                ret = jsonrpc_send(ctx);
        }
        jsonrpc_clean_context(ctx);
+       ksr_rpc_exec_locks_set_release_idx(lidx);
        if(ret < 0)
                return -1;
        return 1;
@@ -1474,6 +1477,7 @@ int jsonrpc_exec_ex(str *cmd, str *rpath, str *spath)
        str scmd;
        unsigned int rdata = 0;
        int mode;
+       int lidx = -1;
 
        scmd = *cmd;
 
@@ -1591,6 +1595,7 @@ int jsonrpc_exec_ex(str *cmd, str *rpath, str *spath)
        }
        if(nj != NULL)
                ctx->req_node = nj->child;
+       lidx = ksr_rpc_exec_locks_set_get(&val);
        rpce->r.function(&func_param, ctx);
        ret = 1;
 
@@ -1599,6 +1604,7 @@ int jsonrpc_exec_ex(str *cmd, str *rpath, str *spath)
                ret = jsonrpc_send_mode(ctx, mode);
        }
        jsonrpc_clean_context(ctx);
+       ksr_rpc_exec_locks_set_release_idx(lidx);
        if(ret < 0)
                return -1;
        return 1;

_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to