ALL: Hi, here is my lua script: ``` local body = '{"ip":"172.16.4.111", "ports":[5261, 5260]}' local resp = "" local code = KSR.http_client.curl_connect_post("configapi", "", "application/json", body, resp) ``` the error is : ``` 24(2406) DEBUG: app_lua [app_lua_api.c:1024]: sr_kemi_lua_exec_func_ex(): param[0] for: curl_connect_post is str: configapi 24(2406) DEBUG: app_lua [app_lua_api.c:1024]: sr_kemi_lua_exec_func_ex(): param[1] for: curl_connect_post is str: 24(2406) DEBUG: app_lua [app_lua_api.c:1024]: sr_kemi_lua_exec_func_ex(): param[2] for: curl_connect_post is str: application/json 24(2406) DEBUG: app_lua [app_lua_api.c:1024]: sr_kemi_lua_exec_func_ex(): param[3] for: curl_connect_post is str: {"ip":"172.16.4.111", "ports":[5261, 5260]} 24(2406) DEBUG: app_lua [app_lua_api.c:1024]: sr_kemi_lua_exec_func_ex(): param[4] for: curl_connect_post is str: 24(2406) ERROR: <core> [core/pvapi.c:429]: pv_cache_get(): invalid parameters 24(2406) ERROR: http_client [http_client.c:739]: ki_curl_connect_post(): failed to get pv spec for: ``` I know the error means: "resp" type is not right, what is the correct type ? I search google for this issue, no one knows, someone please help me.
Thinks
Hello,
set the local resp to "$var(resp)" or another writable Kamailio config variable name.
Cheers, Daniel
On 14.08.24 11:31, 17603019528--- via sr-users wrote:
ALL: Hi, here is my lua script: ``` local body = '{"ip":"172.16.4.111", "ports":[5261, 5260]}' local resp = "" local code = KSR.http_client.curl_connect_post("configapi", "", "application/json", body, resp) ``` the error is :
24(2406) DEBUG: app_lua [app_lua_api.c:1024]: sr_kemi_lua_exec_func_ex(): param[0] for: curl_connect_post is str: configapi 24(2406) DEBUG: app_lua [app_lua_api.c:1024]: sr_kemi_lua_exec_func_ex(): param[1] for: curl_connect_post is str: 24(2406) DEBUG: app_lua [app_lua_api.c:1024]: sr_kemi_lua_exec_func_ex(): param[2] for: curl_connect_post is str: application/json 24(2406) DEBUG: app_lua [app_lua_api.c:1024]: sr_kemi_lua_exec_func_ex(): param[3] for: curl_connect_post is str: {"ip":"172.16.4.111", "ports":[5261, 5260]} 24(2406) DEBUG: app_lua [app_lua_api.c:1024]: sr_kemi_lua_exec_func_ex(): param[4] for: curl_connect_post is str: 24(2406) ERROR: <core> [core/pvapi.c:429]: pv_cache_get(): invalid parameters 24(2406) ERROR: http_client [http_client.c:739]: ki_curl_connect_post(): failed to get pv spec for:
I know the error means: "resp" type is not right, what is the correct type ? I search google for this issue, no one knows, someone please help me.
Thinks __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
Daniel-Constantin: Hello, Think you so much, this is really userful. Recently I am trying to build sbc through KEMI modules, but I am not familiar with this part, I have encountered a lot of problems, and there is no official example, do you have a relevant example here? such as "KSR.ndb_redis.redis_cmd("srv1","HSCAN sbc 0 count 20", "res")" , the third param type is correct ? how to get result array by "res"?
Best wishes to you