我正在使用 C 语言中的 AGI 在 Asterisk 中进行基本的呼叫中心设置
[PUNDIT]
exten =>92186,1,agi(Pundit/PunditBin)
exten=>92186,2,Hangup
PunditBin 是一个 C 应用程序。收到呼叫后,应用程序直接拨打代理 SIP URI,它可以正常工作(代理电话响铃)。
fprintf(stdout,"EXEC Dial SIP/%s,50\n",Free_Pundit);
但问题是我必须在应用程序本身中包含 ACD 逻辑。但是,我想使用 Asterisk Queue 和 ACD 机制。
我以下列方式配置了 Asterisk ACD:-
**queues.conf:-**
[exchat_pundit]
musicclass=default ; play [default] music
strategy=rrmemory ; use the Round Robin Memory strategy
joinempty=no ; do not join the queue when no members available
leavewhenempty=yes ; leave the queue when no members available
ringinuse=no ; don't ring members when already InUse (prevents
context=QueueMemberFunctions
**Extension.conf**
//Moving the call to Queue of agents
[Queues]
exten => 7001,1,Verbose(2,${CALLERID(all)} entering the chat Pundit queue)
same => n,Queue(exchat_pundit)
same => n,Hangup()
[LocalSets]
include => Queues ; allow phones to call queues
//Agent Registration, Pause etc..
[QueueMemberFunctions]
exten => *54,1,Verbose(2,Logging In Queue Member)
same => n,Set(MemberChannel=${CHANNEL(channeltype)}/${CHANNEL(peername)})
same => n,AddQueueMember(exchat_pundit,${MemberChannel})
; ${AQMSTATUS}
; ADDED
; MEMBERALREADY
; NOSUCHQUEUE
exten => *56,1,Verbose(2,Logging Out Queue Member)
same => n,Set(MemberChannel=${CHANNEL(channeltype)}/${CHANNEL(peername)})
same => n,RemoveQueueMember(exchat_pundit,${MemberChannel})
; ${RQMSTATUS}:
; REMOVED
; NOTINQUEUE
; NOSUCHQUEUE
exten => *72,1,Verbose(2,Pause Queue Member)
same => n,Set(MemberChannel=${CHANNEL(channeltype)}/${CHANNEL(peername)})
same => n,PauseQueueMember(exchat_pundit,${MemberChannel})
; ${PQMSTATUS}:
; PAUSED
; NOTFOUND
exten => *87,1,Verbose(2,Unpause Queue Member)
same => n,Set(MemberChannel=${CHANNEL(channeltype)}/${CHANNEL(peername)})
same => n,UnpauseQueueMember(exchat_pundit,${MemberChannel})
; ${UPQMSTATUS}:
; UNPAUSED
; NOTFOUND
**Sip.conf:-**
//Agents
[ABC]
type=friend; 'user' takes incoming calls
secret=welcome ; password for authenticating the user
nat=yes
disallow=all ; Disallow all codecs for this peer or user definition.
allow=speex
allow=gsm
allow=ulaw
allow=alaw
host=dynamic ; what kind of host you are dealing with and the value .dynamic.
context=QueueMemberFunctions; this is what ties up the Asterisk SIP user with the dialplan in
username=ABC; this field specifies the user name for authentication.
regexten=ABC;
[XYZ]
type=friend; 'user' takes incoming calls
secret=welcome ; password for authenticating the user
disallow=all ; Disallow all codecs for this peer or user definition.
allow=speex
allow=gsm
allow=ulaw
allow=alaw
host=dynamic
context=QueueMemberFunctions
username=XYZ;
regexten=XYZ;
现在,当我直接使用 sip 电话拨打分机 7001 时,我的电话以循环方式发送给座席,它可以正常工作。
问题是当我从我的 C 代码中拨打分机 7001 时,它不起作用。
fprintf(stdout,"EXEC Dial 7001,50\n");
我无法将来电发送到代理队列。
请帮我解决问题。
问候, 拉古文德拉库马尔