2012-09-29 71 views
1

我正在使用Asterisk和dot net發送將播放預先錄製的消息的呼叫。有人建議我在撥號方案中使用撥號命令。 我的撥號計劃應答呼叫後,無法獲取通道變量。 (星號)

[cpc_sendcall] 
exten => _X.,1,Set(CHANNEL(userfield)=${actionid}) 
same => n,NoOp(RecordCall: ${dorec}) 
same => n,GotoIf($[${dorec}=1]?record:norecord) 
same => n(record),mixmonitor(${recfile}.gsm) 
same => n(norecord),dial(SIP/${EXTEN}@${carrier},45,G(cpc_doamd,s,1)) 
same => n,hangup 
same => n,CELGenUserEvent(CPC-Failed,${myactionid},HC:${HANGUPCAUSE},DS:${DIALSTATUS}) 

[cpc_doamd] 
exten => s,1,answer 
same => n,AMD 
same => n,GotoIf($[${AMDSTATUS}=HUMAN]?humn:mach) 
same => n(humn),CELGenUserEvent(CPC-LiveAnswer,${myactionid}) 
same => n,WaitForSilence(500) 
same => n,NoOp(ProductLA: ${myproductla}) 
same => n,goto(${myproductla},s,1) 
same => n,Hangup 
same => n(mach),CELGenUserEvent(CPC-AnsweringMachine,${myactionid}) 
same => n,NoOp(ToneDigit: ${mytonedigit}) 
same => n,goto(cpc_tonevmdigit,${mytonedigit},1) 
same => n,NoOp(ProductAM: ${myproductam}) 
same => n,goto(${myproductam},s,1) 
same => n,Hangup 

[cpc_tonevmdigit] 
exten => _X,1,senddtmf(${EXTEN}) 
same => n,return 
exten => 10,1,senddtmf(*) 
same => n,return 
exten => 11,1,senddtmf(#) 
same => n,return 
exten => 12,1,WaitForSilence(2000,1,120) 
same => n,WaitForSilence(200,2,1) 
same => n,return 

和originate命令

Action: Originate 
Channel: local/[email protected]_sendcall 
Exten: 7062675733 
Context: gp_playintro 
Async: 1 
Priority: 1 
Timeout: 60000 
ActionID: GNE-1-1-1-0-0-1-7062675733-40304 
Variable: assignmentid=ff830065-2419-4134-be89-36873d99e7c3,dorec=0,tonedigit=12,predigits=-1,postdigits=-1,playcompanygreeting=0,pin=-1,dosvr=0,playSurveyNotice=0,dolat=0,playlatnotice=0,playcompanytrailer=0,productam=gpstart,productla=gpstart,actionid=GNE-1-1-1-0-0-1-7062675733-40304,carrier=excel 
CallerId: 4053084474 
Account: G1 

我想知道這是正確的方式,使這個電話嗎? 一旦接聽電話,我如何訪問我設置的頻道變量?

謝謝

回答