星号不会通过AGI记录对话

2024-06-09 00:29:24 发布

您现在位置:Python中文网/ 问答频道 /正文

from asterisk.agi import *

agi = AGI()
agi.verbose("python agi started")
agi.record_file('/tmp/qwerty', timeout=10, format='gsm', escape_digits='0')
agi.hangup()

我正试图将对话写入文件。将创建一个空文件(大小为零,但不进行写入)。在给出答案后,连接立即断开

我的分机号码:

[test_forcall]
exten => 111111,1,Answer()
exten => 111111,2,AGI(asteriskAgi)

Agi调试:

 -- SIP/200-0000000c answered
    -- Executing [111111@test_forcall:1] Answer("SIP/200-0000000c", "") in new stack
    -- Executing [111111@test_forcall:2] AGI("SIP/200-0000000c", "asteriskAgi") in new stack
    -- Launched AGI Script /usr/share/asterisk/agi-bin/asteriskAgi
<SIP/200-0000000c>AGI Tx >> agi_request: asteriskAgi
<SIP/200-0000000c>AGI Tx >> agi_channel: SIP/200-0000000c
<SIP/200-0000000c>AGI Tx >> agi_language: en
<SIP/200-0000000c>AGI Tx >> agi_type: SIP
<SIP/200-0000000c>AGI Tx >> agi_uniqueid: 1510050624.24
<SIP/200-0000000c>AGI Tx >> agi_version: 13.13.1~dfsg-4ubuntu1
<SIP/200-0000000c>AGI Tx >> agi_callerid: 200
<SIP/200-0000000c>AGI Tx >> agi_calleridname: RobotGalina
<SIP/200-0000000c>AGI Tx >> agi_callingpres: 0
<SIP/200-0000000c>AGI Tx >> agi_callingani2: 0
<SIP/200-0000000c>AGI Tx >> agi_callington: 0
<SIP/200-0000000c>AGI Tx >> agi_callingtns: 0
<SIP/200-0000000c>AGI Tx >> agi_dnid: unknown
<SIP/200-0000000c>AGI Tx >> agi_rdnis: unknown
<SIP/200-0000000c>AGI Tx >> agi_context: test_forcall
<SIP/200-0000000c>AGI Tx >> agi_extension: 111111
<SIP/200-0000000c>AGI Tx >> agi_priority: 2
<SIP/200-0000000c>AGI Tx >> agi_enhanced: 0.0
<SIP/200-0000000c>AGI Tx >> agi_accountcode: 
<SIP/200-0000000c>AGI Tx >> agi_threadid: 139782415746816
<SIP/200-0000000c>AGI Tx >> 
       > 0x7f21cc003790 -- Probation passed - setting RTP source address to 127.0.0.1:8000
<SIP/200-0000000c>AGI Tx >> 200 result=1
<SIP/200-0000000c>AGI Rx << RECORD FILE "111" "gsm" "#" 10
<SIP/200-0000000c>AGI Tx >> 200 result=0 (timeout) endpos=0

Golang上的实现也有类似的行为


Tags: 文件answerintesttimeoutasteriskgsmsip
1条回答
网友
1楼 · 发布于 2024-06-09 00:29:24

成功了!当我将超时设置为-1时,我仍然不理解为什么超时为>;一,

agi.record_file('/tmp/qwerty', timeout=-1, format='gsm', escape_digits='0'

相关问题 更多 >