# How to get DTMF input in Python script?

**URL:** <https://community.asterisk.org/t/how-to-get-dtmf-input-in-python-script/100700>\
**Category:** Asterisk APIs\
**Created:** [January 30, 2024, 2:54am UTC](https://community.asterisk.org/t/how-to-get-dtmf-input-in-python-script/100700 "2024-01-30T02:54:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eagle131377](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eagle131377](https://community.asterisk.org/u/eagle131377)\
**Post date:** [January 30, 2024, 2:54am UTC](https://community.asterisk.org/t/how-to-get-dtmf-input-in-python-script/100700/1 "2024-01-30T02:54:17Z")

</div>

Hello Everyone.

I use Python to make an outbound call using Asterisk.

And I was successful the first outbound call, but during that call interaction with my customer, I need to get DTMF input from the customer.

Asterisk Diaplan can get that DTMF input value using Read() application, but I don’t have any idea how to carry this DTMF value into Python script.

I have been trying to find a solution but haven’t found any solution.

Please help me.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [January 30, 2024, 9:14am UTC](https://community.asterisk.org/t/how-to-get-dtmf-input-in-python-script/100700/2 "2024-01-30T09:14:28Z")

</div>

Asterisk provides many interfaces for doing things, you’d need to specify which one you’re using. For example, are you using AMI? If so you could use UserEvent in the dialplan to raise a custom event that your application could use.

---

<div class="post-metadata">

**Author:** ![eagle131377](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eagle131377](https://community.asterisk.org/u/eagle131377)\
**Post date:** [January 30, 2024, 11:10am UTC](https://community.asterisk.org/t/how-to-get-dtmf-input-in-python-script/100700/3 "2024-01-30T11:10:50Z")

</div>

Yes, I’m using AMI.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [February 29, 2024, 11:11am UTC](https://community.asterisk.org/t/how-to-get-dtmf-input-in-python-script/100700/4 "2024-02-29T11:11:45Z")

</div>

Closed on February 29, 2024, 11:11am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
