Asterisk 11,Queue&本地渠道状态

时间:2017-06-29 08:37:27

标签: asterisk

我在星号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

但是当会员接听电话时,会员不会被标记为“使用中”

我想做的是:   - 存储在星号内部数据库真实成员扩展中   - 会员将使用带有LocalChannel(如Local / 001 @ test-queue-member)的“假”分机号码拨打,该号码将从数据库中获得真正的成员分机   - 向该成员发布公告   - 当会员回答(比如记录)时做一些事情

首先,成员扩展名为:

[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/001@test-queue-member to test-queue

但是当我这样做时,当用户呼叫时,输入队列和成员答案,成员不是“InUse”,并且有“No callers”

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/001@test-queue-member (ringinuse disabled) (dynamic) (Not in use) has taken 1 calls (last was 916 secs ago)
   No Callers

我如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

在做自己的&#34;宠物排队之前&#34;阅读它应该如何,这是个好主意,例如在freepbx.org源代码/ dialplan。

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

有关提示的详细信息,请参阅此页https://wiki.asterisk.org/wiki/display/AST/Extension+State+and+Hints