簡體   English   中英

應答呼叫后無法獲取通道變量。 (星號)

[英]Unable to get channel variables once call is answered. (Asterisk)

我正在使用Asterisk和dot net發出將播放預錄消息的呼叫。 建議在撥號方案中使用Dial命令。 我的撥號方案

[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

和原始命令

Action: Originate
Channel: local/7062675733@cpc_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

我想知道這是撥打電話的正確方法嗎? 接聽電話后,如何訪問已設置的通道變量?

謝謝

使用sip呼叫時,必須使用本地頻道。 通道掛斷后,var消失了。 您可以使用本地頻道解決此問題。

這是執行此操作的好資源:

https://blogs.reucon.com/asterisk-java/originate-using-asterisk-local-channels-566/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM