我使用python和pyst将DTMF发送给Asterisk。该代码是:脚本星号AMI:在SIP通道上未收到DTMF
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'])
输出还是不错的:
DTMF: Sending 1 to SIP/S3bc9c3c-00000081
DTMF: Success - DTMF successfully queued
但是Asterisk的反应是这样的:
[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
有趣的是,这种情况只在SIP渠道。在“本地”频道上按预期工作:
[Jul 2 18:00:07] DTMF[7951]: channel.c:4083 __ast_read: DTMF begin '1' received on Local/[email protected];1
[Jul 2 18:00:07] DTMF[7951]: channel.c:4093 __ast_read: DTMF begin passthrough '1' on Local/[email protected];1
如何让DTMF在SIP通道上正常播放?
UPD
发现这个Asterisk的错误追踪:https://issues.asterisk.org/jira/browse/ASTERISK-13224
看来,如果我发送DTMF到SIP通道手机只是扮演它自己,它不会进一步去星号。有什么方法可以处理它吗?
你使用的是什么版本的'*',通话后通话是否继续正常(即,如果dtmf 1比foo;否则吧) – mirkobrankovic
它以某种方式反应,手机发出嘟嘟声和回放停止。通话继续照常进行。此外,在使用rfc2833时,不会发出哔哔声或任何其他反应。 –
该错误被封闭为非错误,并且截止日期为2011年6月。所以我非常确定这不是问题。我会在今天下午尝试在我的PBX上重新创建您的问题并回复您。 – MichelV69