Диалплан
[debt_autodial]
exten => _8XXXXXXXXXX,1,Dial(SIP/0123456789/${EXTEN},60)
exten => _8XXXXXXXXXX,n,NoOp(Call ended with status: &{DIALSTATUS})
exten => _8XXXXXXXXXX,n,Hangup
[debt_autoinform]
exten => 2222,1,NoOp(Starting call)
same => n,UserEvent(CallHasStarted,UniqueId: ${UNIQUEID})
same => n,Answer
same => n,UserEvent(CallWasAnswered,UniqueId: ${UNIQUEID})
same => n,Wait(1)
same => n,Playback(/home/abc/debt_audio)
same => n,NoOp(Ending call)
same => n,Hangup()
exten => h,1,NoOp(Call was hung up)
same => n,UserEvent(CallWasHungUp,UniqueId: ${UNIQUEID})
Action Asterisk AMI для вызова звонка
def make_call(phone_number):
action = SimpleAction(
'Originate',
Channel='Local/' + phone_number + '@debt_autodial',
Context='debt_autoinform',
Exten='2222',
Priority=1,
Timeout=30000,
Callerid='2222',
Async=True
)
logger.conf
console => notice,warning,error,dtmf
messages => notice,warning,error
full => notice,warning,error,debug,verbose,dtmf,fax
events => verbose,notice,warning,error