gpt4 book ai didi

c - 如何通过 Asterisk 中的 AGI C 程序将传入调用路由到代理队列

转载 作者:太空宇宙 更新时间:2023-11-04 08:30:49 24 4
gpt4 key购买 nike

我正在使用 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");

我无法将传入调用发送到代理队列。

请帮我解决这个问题。

问候,拉格文德拉·库马尔

最佳答案

您可以像这样使用本地 channel 拨号来拨号规则

Dial(Local/7001@Queues,,n)

或在通用人工智能中

fprintf(stdout,"EXEC Dial \"Local/7001@Queues,50\"\n");

关于c - 如何通过 Asterisk 中的 AGI C 程序将传入调用路由到代理队列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28454747/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com