# Method Custom module return type

**URL:** <https://openvidu.discourse.group/t/method-custom-module-return-type/3747>\
**Category:** Issues developing apps\
**Tags:** v2\
**Created:** [February 11, 2022, 10:03am UTC](https://openvidu.discourse.group/t/method-custom-module-return-type/3747 "2022-02-11T10:03:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![OllyJ](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/ollyj/32/1841_2.png) [@OllyJ](https://openvidu.discourse.group/u/OllyJ)\
**Post date:** [February 11, 2022, 10:03am UTC](https://openvidu.discourse.group/t/method-custom-module-return-type/3747/1 "2022-02-11T10:03:48Z")

</div>

Hello,

I am building a module for the KMS and was wondering if you can return a value from a method, all the examples I’ve seen seem to be void methods. However, I have looked at the code for the KMS core: [kms-core/core.kmd.json at cf111ef4e4e3e196792ffb60bfb48dbd7bef8512 · Kurento/kms-core · GitHub](https://github.com/Kurento/kms-core/blob/cf111ef4e4e3e196792ffb60bfb48dbd7bef8512/src/server/interface/core.kmd.json#L179-L191) and it appears that uses a return. But looking at the code for execMethod it appears it only returns a void promise therefore no return type.

/\*\*  
\* Executes a filter method. Available methods are specific for each filter  
\*  
\* @param method Name of the method  
\* @param params Parameters of the method  
\*/  
execMethod(method: string, params: Object): Promise;

> <https://github.com/OpenVidu/openvidu/blob/f88ea86bed134e5f1fd508805edabca7c923e898/openvidu-browser/src/OpenVidu/Filter.ts#L92-L129>

I am basically looking to read files from the server in a certain directory and return all the files with a particular .extension. Will this have to be achieved through an event listener?

---

<div class="post-metadata">

**Author:** ![micael.gallego](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/micael.gallego/32/2_2.png) [@micael.gallego](https://openvidu.discourse.group/u/micael.gallego)\
**Post date:** [February 12, 2022, 4:40pm UTC](https://openvidu.discourse.group/t/method-custom-module-return-type/3747/2 "2022-02-12T16:40:10Z")

</div>

Kurento custom modules are designed for video/audio manipulation.

It seems the OpenVidu support to execute methods in modules ignore return values. This is an important limitation.
