2017-06-29 22 views
0

我使用一个队列中的星号11:星号11,排队机与本地信道状态

CLI> core show version 
Asterisk 11.13.1~dfsg-2+b1 built by buildd @ brahms on a x86_64 running Linux on 2015-01-05 21:34:10 UTC 

但是当部件已经应答该呼叫时,构件是不标记为“INUSE”

我想要做的是: - 存储在星号内部数据库真实成员分机 - 会员将与一个“假”分机号码与LocalChannel(如本地/ 001 @测试队列成员)将得到真正的会员扩展数据库 - 播放该会员的通告 - 做一些东西,当t他会员回答(如日志)

首先,成员分机:

[999] 
username=999 
Callerid="999" <999> 
secret=0999 
context=test-queue-ctx 
type=friend 
language=fr 
host=dynamic 
dtmfmode=RFC2833 
dtmfmode=info 
qualify=yes 
nat=yes 
canreinvite=no 
insecure=invite,port 
call-limit=1 
callcounter=yes 
deny=0.0.0.0/0.0.0.0 
permit=0.0.0.0/0.0.0.0 

下一个队列的conf:

[test-queue] 
music=blank 
strategy=rrmemory 
timeout=9 
retry=1 
wrapuptime=2 
maxlen=0 
announce-frequency=0 
announce-holdtime=no 
ringinuse=no 
setinterfacevar=yes 
setqueueentryvar=yes 
setqueuevar=yes 
eventwhencalled=yes 
eventmemberstatus=yes 
autofill=no 

而且这里的拨号方案:

[test-queue-ctx] 
exten => _X.,1,Noop() 
    same => n,Ringing() 
    ;; Queue options 
    ;;  c: continue in the dialplan if the callee hangs up 
    ;;  i: ignore call forward requests from queue members and do nothing when they are requested 
    ;;  r: ring instead of playing MOH 
    ;;  R: stops moh and rings once an agent is ringing 
    ;;  h: allow callee to hang up by pressing *. 
    ;;  H: allow caller to hang up by pressing *. 
    same => n,Queue(test-queue,cirRhH,,,300,,,test-announce) 
    same => n,NoOp("Dialstatus=${DIALSTATUS}") 

[test-announce] 
exten => s,1,NoOp() 
    same => n,Playback(hello-world) 
    same => n,Return() 

[test-queue-member] 
exten => _X.,1,NoOp(Dialling ${EXTEN}) 
    same => n,Macro(test-queue-dial,${EXTEN}) 

[macro-test-queue-dial] 
exten => s,1,NoOp(Dialling ARG1=${ARG1}) 
    same => n,GotoIf($["${DB(AGENT/${ARG1}/PHONE)}" != ""]?dial,1:dial-NOPHONE,1) 

exten => dial,1,NoOp(AgentDial,agent_id: ${ARG1},phone: ${DB(AGENT/${ARG1}/PHONE)}) 
    same => n,Dial(SIP/${DB(AGENT/${ARG1}/PHONE)},10,rotwhgU(test-queue-answer^${ARG1})) ; Ring the interface, 10 seconds maximum 
    same => n,NoOp("DialStatus=${DIALSTATUS}") 
    same => n,GotoIf($[${DIALSTATUS} != "ANSWER"]?dial-${DIALSTATUS},1) 
exten => dial-NOANSWER,1,Hangup() 
exten => dial-BUSY,1,Busy() 
exten => dial-CHANUNAVAIL,1,Hangup() 
exten => dial-CONGESTION,1,Congestion() 
exten => dial-NOPHONE,1,Hangup() 

[test-queue-answer] 
exten => s,1,NoOp("test-queue-answer") 
    same => n,Return() 

最后,我将成员添加到队列中的星号CLI:

CLI> database put AGENT/001 PHONE 999 
CLI> queue add member Local/[email protected] to test-queue 

但是,当我这样做,当用户呼叫,请输入队列和会员回答,成员不是“INUSE”,并有“不来电”

CLI> queue show test-queue 
test-queue has 0 calls (max unlimited) in 'rrmemory' strategy (1s holdtime, 3s talktime), W:0, C:1, A:5, SL:0.0% within 0s 
    Members: 
     Local/[email protected] (ringinuse disabled) (dynamic) (Not in use) has taken 1 calls (last was 916 secs ago) 
    No Callers 

如何我可以修复这个?

回答

0

在做自己的“宠物队列”之前,先阅读它应该是什么样的想法,例如在freepbx.org源代码/ dialplan中。

如果你想拥有状态,你应该使用带有状态的通道或者通过提示手动执行状态。本地通道不是为单线连接而设计的,因此没有状态。

关于提示的更多信息,看本页https://wiki.asterisk.org/wiki/display/AST/Extension+State+and+Hints