我正在努力制作一个系统,以自动拨出拖欠租金的租户号码,并读取他们欠多少钱。当拨打的号码被接听或在拨号时发送"忙音"时,一切正常。不幸的是,当电话响铃足够长,答录机(或语音邮件)可以自行接听时,拨号计划上下文和分机根本不会启动。我必须执行哪些操作才能在答录机或语音邮件应答时启动拨号计划?我在 2 部手机上对此进行了测试,两者都做同样的事情。
下面是启动调用的代码。脚本有效,将拨打我的电话:
fputs($socket, "Action: Loginrn");
fputs($socket, "UserName: $usernamern");
fputs($socket, "Secret: $secretrnrn");
fputs($socket, "Command: sip show peersrnrn");
fputs($socket, "Action: Originatern");
fputs($socket, "Channel: $number_outrn");
fputs($socket, "Context: $contextrn");
fputs($socket, "Exten: $extenrn");
fputs($socket, "Priority: 1rn");
fputs($socket, "Timeout: 20000rn");
fputs($socket, "Variable: NAME=$namern");
fputs($socket, "Variable: LOCATION=$locationrn");
fputs($socket, "Variable: AMOUNT=$amountrn");
fputs($socket, "Variable: TENSE=$tensern");
fputs($socket, "Variable: CALLDIR={$cd['calls_out_dir']}rn");
fputs($socket, "Variable: CALLFILE=$callFilern");
fputs($socket, "Variable: ICOID=${cd['ico_id']}rn");
fputs($socket, "Variable: LIVEORDEVEL=html-develrn");
fputs($socket, "Variable: TIMESTAMP=$timestamprn");
fputs($socket, "Callerid: "$cid_name" <$cid_num>rn");
fputs($socket, "Action: Logoffrnrn");
以下是拨号计划的相关部分:
[out-tenant-collections]
exten => s,1,Wait(1)
exten => s,2,AMD()
exten => s,3,Monitor(gsm,"${CALLDIR}${CALLFILE}",m)
exten => s,n,NOOP(AMDSTATUS = ${AMDSTATUS} DIALSTATUS = ${DIALSTATUS})
exten => s,n,GotoIf($[${AMDSTATUS}=HUMAN]?humn:mach)
exten => s,n(mach),agi(/var/www/${LIVEORDEVEL}/asterisk-programs/ivr_collections_out_response.php,${ICOID},0,${CALLDIR}${CALLFILE}.gsm,${TIMESTAMP})
exten => s,n,Wait(10)
exten => s,n(humn),agi(googletts.agi,"You ${TENSE} at ${LOCATION}. Your rent is overdue by ${AMOUNT}., If you already made a payment in full, press 1. If you already mailed payment or intend to pay within two days, press 2., If you feel$
exten => s,n,NOOP(ICOID: ${ICOID})
; the wait exten command will let you interupt the above googletts agi app and go to the extension dialed in (1,2,3 or 4) if a digit is dialed that is not recognized it will go to the i extension
exten => s,n,WaitExten()
; they entered something other than 1,2,3 or 4
exten => i,1,agi(googletts.agi,"Sorry I did not catch that.",en,,1.1)
exten => i,n,Goto(s,4)
;; They hit 1, register that they said they paid their full amount
exten => 1,1,agi(/var/www/${LIVEORDEVEL}/asterisk-programs/ivr_collections_out_response.php,${ICOID},1,${CALLDIR}${CALLFILE}.gsm,${TIMESTAMP})
exten => 1,2,agi(googletts.agi,"Thank you, we will double check our records, if the payment has been recorded you will not recieve any more calls.",en,,1.1)
exten => s,n,Hangup
;; They hit 2, register that they said they mailed a payment
exten => 2,1,agi(/var/www/${LIVEORDEVEL}/asterisk-programs/ivr_collections_out_response.php,${ICOID},2,${CALLDIR}${CALLFILE}.gsm,${TIMESTAMP})
exten => 2,2,agi(googletts.agi,"Thank you, we will await your payment.",en,,1.1)
exten => s,n,Hangup
;; They hit 3, register that they said it was an error to get this call
exten => 3,1,agi(/var/www/${LIVEORDEVEL}/asterisk-programs/ivr_collections_out_response.php,${ICOID},3,${CALLDIR}${CALLFILE}.gsm,${TIMESTAMP})
exten => 3,2,agi(googletts.agi,"Please explain why you feel you have recieved this message in error, after the beep.",en,,1.1)
exten => 3,3,Wait(1)
exten => 3,4,Playback(beep)
exten => 3,5,Wait(30)
exten => 3,n,Hangup
;; They hit 4, they want the message repeated
exten => 4,1,Goto(s,4)
;; The waitexten command timed out with no response
exten => t,1,agi(/var/www/${LIVEORDEVEL}/asterisk-programs/ivr_collections_out_response.php,${ICOID},0,${CALLDIR}${CALLFILE}.gsm,${TIMESTAMP})
exten => t,2,Hangup
请发布您用于生成外出呼叫的代码。 在我看来,您没有将呼出呼叫的"您的一侧"作为拨号命令的一部分发送到此上下文中。
事实证明,当答录机或语音邮件使用特殊分机号接听时,您需要进行处理。我将以下行添加到我的拨号计划中。需要注意的重要一点是扩展的名称:"失败",这是应答机接听时执行的默认扩展。
;; if the answering machine picks up when no user answers or sends a busy tone
exten => failed,1,Goto(s,mach)