DTMF_Received Callback Is Being Called Two Times With Subscribed Endpoint

Using ARI I subscribed my endpoint so I can watch if it goes up or down or its associated channels change. On the other hand, I have a DTMF_received callback set on one of its associated channels. By pressing any DTMF, Asterisk calls the callback twice. I’ve tested this by sending DTMFs as SIP info, still have the problem.
Is there any way I can fix it?

The only logs I could get is here:

DTMF[2841]: channel.c:3909 __ast_read: DTMF begin ‘1’ received on SIP/406-00000001
DTMF[2841]: channel.c:3920 __ast_read: DTMF begin passthrough ‘1’ on SIP/406-00000001
DTMF[2841]: channel.c:3823 __ast_read: DTMF end ‘1’ received on SIP/406-00000001, duration 100 ms
DTMF[2841]: channel.c:3864 __ast_read: DTMF end accepted with begin ‘1’ on SIP/406-00000001
DTMF[2841]: channel.c:3879 __ast_read: DTMF end ‘1’ detected to have actual duration 79 on the wire, emulation will be triggered on SIP/406-00000001
DTMF[2841]: channel.c:3886 __ast_read: DTMF end ‘1’ has duration 79 but want minimum 80, emulating on SIP/406-00000001
DTMF[2841]: channel.c:3943 __ast_read: DTMF end emulation of ‘1’ queued on SIP/406-00000001

Although I don’t think it’s related to my problem.

Any idea Mr. Colp? @jcolp

Tagging people is impolite. I just returned to the forum after the weekend and am working through a backlog of posts. I’d suggest providing the actual ARI events that were received.

Let me begin by apologizing, I didn’t mean to rush you into the subject. Since you’ve changed topic’s category and didn’t answer, I just mentioned you to serve as a reminder.

About your suggestion, I have to ask since I didn’t totally understand; You mean ARI’s log on events that were received?

ARI sends events to the ARI application in JSON format, which then does what it wants with them. Knowing the events that were sent to the application are important to understanding what is happening and better isolates the precise problem. If there are two DTMF events, then that isolates things to the Asterisk side. If there is one then that isolates things to the application side. The “ari set debug all on” CLI command will enable debug, and should show the events going out.

I just remembered, subscribing to the endpoint may get you all of the channel events too - so if you are also subscribed to the channel you may get the related events twice.

Here is the DTMF logs:

asterisk*CLI> 
       > 0x7f310.1.7ed0 -- Strict RTP learning complete - Locking on source address 10.1.7.156:7078
[Mar  4 17:01:18] DTMF[9487]: channel.c:3823 __ast_read: DTMF end '*' received on SIP/406-00000006, duration 250 ms
[Mar  4 17:01:18] DTMF[9487]: channel.c:3850 __ast_read: DTMF begin emulation of '*' with duration 250 queued on SIP/406-00000006
<--- Sending ARI event to 10.1.7.156:51552 --->
{"application":"switchmanager_afzoun","digit":"*","type":"ChannelDtmfReceived","timestamp":"2019-03-04T17:01:18.841+0330","asterisk_id":"00:0c:29:e3:35:d5","duration_ms":250,"channel":{"dialplan":{"context":"afzoun","priority":1,"exten":""},"id":"352ec80997c94246ad18a186ae51d64e","name":"SIP/406-00000006","caller":{"name":"","number":"70001"},"accountcode":"","state":"Up","creationtime":"2019-03-04T17:01:10.966+0330","connected":{"name":"","number":"70001"},"language":"en"}}
<--- Sending ARI event to 10.1.7.156:51552 --->
{"application":"switchmanager_afzoun","digit":"*","type":"ChannelDtmfReceived","timestamp":"2019-03-04T17:01:18.841+0330","asterisk_id":"00:0c:29:e3:35:d5","duration_ms":250,"channel":{"dialplan":{"context":"afzoun","priority":1,"exten":""},"id":"352ec80997c94246ad18a186ae51d64e","name":"SIP/406-00000006","caller":{"name":"","number":"70001"},"accountcode":"","state":"Up","creationtime":"2019-03-04T17:01:10.966+0330","connected":{"name":"","number":"70001"},"language":"en"}}
asterisk*CLI>

I’ve also attached the full log of this call.
ari_dtmf.txt (61.5 KB)

You’re right, I am also subscribed to one of that endpoint’s channels.
I’m an amateur in Asterisk world actually, so, what is your solution for me in this case? I must unsubscribe one of them?

P.S. Thanks for the command you mentioned above. It’s very helpful and I couldn’t find it anywhere. :slight_smile:

Yes, don’t subscribe to one. Subscribing to the endpoint means “show me all events involving this endpoint” which includes the channels for the endpoint.

Thank you very much :slight_smile: