mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-06 04:11:52 +00:00
anti-venom for a nasty python byte
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5098 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -22,9 +22,9 @@ switch_status_t PythonDTMFCallback(switch_core_session_t *session,
|
||||
PyObject *result;
|
||||
switch_status_t dres = SWITCH_STATUS_FALSE;
|
||||
|
||||
func = (PyObject *) globalDTMFCallbackFunction; // Get Python function
|
||||
arglist = Py_BuildValue("(sisi)",input,itype,buf,buflen); // Build argument list
|
||||
result = PyEval_CallObject(func,arglist); // Call Python
|
||||
func = (PyObject *) buf; // Get Python function
|
||||
arglist = Py_BuildValue("(si)", input, itype); // Build argument list
|
||||
result = PyEval_CallObject(func, arglist); // Call Python
|
||||
Py_DECREF(arglist); // Trash arglist
|
||||
if (result) { // If no errors, return double
|
||||
dres = (switch_status_t) PyInt_AsLong(result);
|
||||
@@ -33,5 +33,22 @@ switch_status_t PythonDTMFCallback(switch_core_session_t *session,
|
||||
return dres;
|
||||
}
|
||||
|
||||
|
||||
void console_log(char *level_str, char *msg)
|
||||
{
|
||||
switch_log_level_t level = SWITCH_LOG_DEBUG;
|
||||
if (level_str) {
|
||||
level = switch_log_str2level(level_str);
|
||||
}
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, level, msg);
|
||||
}
|
||||
|
||||
void console_clean_log(char *msg)
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN,SWITCH_LOG_DEBUG, msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
%}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user