[sr-dev] git:master:f95fda89: app_lua: count also the special function when generating the rpc response

Daniel-Constantin Mierla miconda at gmail.com
Fri Nov 24 19:50:47 CET 2017


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-11-24T19:50:05+01:00

app_lua: count also the special function when generating the rpc response

---

Modified: src/modules/app_lua/app_lua_mod.c

---

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

---

diff --git a/src/modules/app_lua/app_lua_mod.c b/src/modules/app_lua/app_lua_mod.c
index b4a44fab70..ac536878c9 100644
--- a/src/modules/app_lua/app_lua_mod.c
+++ b/src/modules/app_lua/app_lua_mod.c
@@ -673,12 +673,17 @@ static void app_lua_rpc_api_list(rpc_t* rpc, void* ctx)
 		rpc->fault(ctx, 500, "Internal error root reply");
 		return;
 	}
+
+	/* count the number of exported functions */
 	n = 0;
 	for(i=0; i<SR_KEMI_LUA_EXPORT_SIZE; i++) {
 		ket = sr_kemi_lua_export_get(i);
 		if(ket==NULL) continue;
 		n++;
 	}
+	for(i=0; sr_kemi_app_lua_rpc_exports[i].fname.s!=NULL; i++) {
+		n++;
+	}
 
 	if(rpc->struct_add(th, "d[",
 				"msize", n,




More information about the sr-dev mailing list