2015-02-11 33 views
0
要排隊的,雖然AGI C程序代理我使用AGI

C語言中的一個基本的呼叫中心設置在Asterisk的如何路由來電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隊列和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; 

現在,當我做出延長7001直接呼叫使用SIP電話,我的電話被髮送到代理在循環賽的方式它的工作原理每罰款。

問題是當我從我的C代碼撥打擴展7001如下,它不起作用。

fprintf(stdout,"EXEC Dial 7001,50\n"); 

我無法將來電發送到座席隊列。

請幫我解決問題。

問候, Raghuvendra庫馬爾

回答

2

您可以使用本地通道轉盤撥號方案這樣

Dial(Local/[email protected],,n) 

或AGI

fprintf(stdout,"EXEC Dial \"Local/[email protected],50\"\n"); 
+0

它的工作就像一個魅力。感謝您的支持。還有一個問題,如果我想用AMI做同樣的事情,我需要使用網橋動作: - api.BridgeAction bc =新的BridgeAction(A-Party-Channel,B-Party-Channel,false) - 用於連接派對。如何使用AMI連接到隊列 – 2015-02-12 07:58:37

+0

如果使用撥號命令,它將自動橋接答案。否則 - 取決於方法。使用channelredirect重定向其他dialplan擴展(包括隊列) – arheops 2015-02-13 10:23:35