### Description
Kamailio segfaults when KEMI functions are invoked from app_python script
### Troubleshooting
The same code was running ok with the 5.6 branch.
It seems that the function sr_apy_kemi_exec_func_ex has been re-written in 5.7 with the following main changes :
- The long IF/ELSE statement was replace by a FOR loop - The call to PyArg_ParseTuple function was replaced by the call to PyList_GetItem ==> **This seems to be the cause. The value returned by this function is alway NULL**
#### Reproduction
Any call to KSR.pv.seti function from a PYTHON 2 script would cause this error.
#### Log Messages
``` sbin/kamailio[18449]: ERROR: app_python [apy_kemi.c:280]: sr_apy_kemi_exec_func_ex(): null parameter - func: seti idx: 0 argc: 2
Feb 6 11:34:16 .../sbin/kamailio[18509]: CRITICAL: <core> [core/pass_fd.c:281]: receive_fd(): EOF on 37 Feb 6 11:34:16 .../sbin/kamailio[18380]: ALERT: <core> [main.c:793]: handle_sigs(): child process 18449 exited by a signal 11 Feb 6 11:34:16 .../sbin/kamailio[18380]: ALERT: <core> [main.c:796]: handle_sigs(): core was not generated Feb 6 11:34:16 .../sbin/kamailio[18380]: INFO: <core> [main.c:818]: handle_sigs(): terminating due to SIGCHLD Feb 6 11:34:16 .../sbin/kamailio[18509]: INFO: <core> [main.c:874]: sig_usr(): signal 15 received Feb 6 11:34:16 .../sbin/kamailio[18502]: INFO: <core> [main.c:874]: sig_usr(): signal 15 received Feb 6 11:34:16 .../sbin/kamailio[18495]: INFO: <core> [main.c:874]: sig_usr(): signal 15 received Feb 6 11:34:16 .../sbin/kamailio[18482]: INFO: <core> [main.c:874]: sig_usr(): signal 15 received ```
Try to get a core dump file and then get the full backtrace and past it here, it is useful for troubleshooting:
- https://www.kamailio.org/wikidocs/tutorials/troubleshooting/coredumpfile/#ho...
Also, add the snippet of the python code that causes the crash.
On the other hand, you should switch to using app_python3 or app_python3s, the app_python is for Python2 which is no longer supported, so this module might get also deprecated very soon.
This issue is stale because it has been open 6 weeks with no activity. Remove stale label or comment or this will be closed in 2 weeks.
Closed #3746 as not planned.