SendDTMF in eagi script python

Hi everyone, is it possible to send DTMF tones from a eagi script in python?

I tried to use the following function from the script but it didn’t work:
agi.execute(“SendDTMF”,“1”)

I saw a small example in php in the following link: Send DTMF in AGI
However, when using something similar in python, it terminates the call automatically.

Thanks in advance.

Is possible, but you need to make sure there is not any library issue, as the method will vary depending on the programming language

And the class library.

The first clue will be a snippet (in preformatted tags) of the console output (with AGI debugging enabled).

Thanks for answering. The library that I use in python does communicate correctly with asterisk. However when I debug the script in asterisk it tells me that the “SendDTMF” command does not exist. I have also tried SENDDTMF.
AGI Rx << SendDTMF 5
AGI Tx >> 510 Invalid or unknown command

What could be the problem?

“SendDTMF” is not a valid AGI command. SendDTMF is a dialplan application, which can be executed using the “EXEC” AGI command.

You are right! I was able to fix it using python appexec function. It works like a charm. Thank you all for replying.

1 Like