Reputation: 87
I am using AGI in C Language for a basic Call Centre Setup in Asterisk
[PUNDIT]
exten =>92186,1,agi(Pundit/PunditBin)
exten=>92186,2,Hangup
PunditBin is a C application. On receiving the call the app dail Agent SIP URI directly and it works (Agent Phone Rings).
fprintf(stdout,"EXEC Dial SIP/%s,50\n",Free_Pundit);
But the problem is that i have to include the ACD logic in the app itself. However, I want to use Asterisk Queue and ACD mechanism.
I have configured the Asterisk ACD in following manner:-
**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;
Now when i make a call to extension 7001 using a sip phone directly, my call is sent to the agent in round robin manner it works per fine.
Problem is when i dial the extension 7001 from my C code as following, it does not work.
fprintf(stdout,"EXEC Dial 7001,50\n");
I am not able to send the incoming call to queue of agents.
Please help me to resolve the issue.
Regards, Raghuvendra Kumar
Upvotes: 0
Views: 3654
Reputation: 15259
You can use dial with Local channel to dialplan like this
Dial(Local/7001@Queues,,n)
or in AGI
fprintf(stdout,"EXEC Dial \"Local/7001@Queues,50\"\n");
Upvotes: 2