0
votes

I'm sending DTMF to Asterisk using python and pyst. The code is:

def playDTMF(self, channel, digit):
        print "DTMF: Sending %s to %s" % (digit, channel)
        response = self.manager.send_action({
            "Action" : "PlayDTMF",
            "Channel" : channel,
            "Digit" : digit
        })
        print "DTMF: %s - %s" % (response['Response'], response['Message'])

Output of the script is good:

DTMF: Sending 1 to SIP/S3bc9c3c-00000081
DTMF: Success - DTMF successfully queued

But Asterisk reacts to it like that:

[Jul  2 17:48:53] DEBUG[6967] manager.c: Running action 'PlayDTMF'
[Jul  2 17:48:53] DEBUG[6967] channel.c: Set channel SIP/S3bc9c3c-00000081 to write format slin
[Jul  2 17:48:53] DEBUG[6967] channel.c: Scheduling timer at (50 requested / 50 actual) timer ticks per second
[Jul  2 17:48:53] DEBUG[6967] channel.c: Thread 140629726328576 Blocking 'SIP/S3bc9c3c-00000081', already blocked by thread 140628353554176 in procedure ast_
waitfor_nandfds

The interesting thing is that this happens only on SIP channel. On "Local" channel it works as expected:

[Jul  2 18:00:07] DTMF[7951]: channel.c:4083 __ast_read: DTMF begin '1' received on Local/901@AC000001-19ca;1
[Jul  2 18:00:07] DTMF[7951]: channel.c:4093 __ast_read: DTMF begin passthrough '1' on Local/901@AC000001-19ca;1

How can I let DTMF play properly on SIP channel?

UPD

Found this on Asterisk bugtracker: https://issues.asterisk.org/jira/browse/ASTERISK-13224

Seems that if I send DTMF to SIP channel phone just plays it for himself, and it doesn't go further to Asterisk. Is there any way to deal with it?

2
what version of * are you using, does the call continues normally after that (ie. if dtmf 1 than foo; else bar)mirkobrankovic
It reacts somehow, phone beeps and playback stops. Call continues as usual. Besides, while using rfc2833 there is no beep or any other reaction.Ilya Khaustov
The bug was closed as not-a-bug, and it's dated closed as June, 2011. So I'm pretty sure that's not the problem. I'll try and recreate your problem on my PBX this afternoon and get back to you.MichelV69

2 Answers

0
votes

use SendDTMF appliction. SendDTMF(digits[|timeout_ms])

0
votes

In your SIP.CONF, ensure you have

dtmfmode=rfc2833

for your appropriate SIP trunk. Often sending DTMF inband (audio) with SIP doesn't work as well as you might hope.