Unable to send dtmf using dial_dtmf
I was trying to send dtmf events using dial_dtmf method but always returns PJ_EINVAL. I tried with string and bytes as well. I looked into your code and found the method PyUnicode_ToPJ which is doing the conversion. The method uses PyUnicode_Check(obj). It seems Python3 str object is not passing this method. I tried following:
call.dial_dtmf(b'5551234567#')
`call.dial_dtmf('5551234567#')
None worked.
I have commented PyBytes_Check in the method to make DTMF work: `static PyObject *py_pjsua_call_dial_dtmf(PyObject *pSelf, PyObject *pArgs) { int call_id; PyObject *pDigits; pj_str_t digits; int status;
PJ_UNUSED_ARG(pSelf);
if (!PyArg_ParseTuple(pArgs, "iO", &call_id, &pDigits)) {
return NULL;
}
/*
if (!PyBytes_Check(pDigits))
return Py_BuildValue("i", PJ_EINVAL);
*/
digits = PyUnicode_ToPJ(pDigits);
status = pjsua_call_dial_dtmf(call_id, &digits);
return Py_BuildValue("i", status);
}`
After send dtmf calling is suspend, no errors