<HTML>
<HEAD>
<TITLE>Re: [asterisk-users] Macro arguments on app_queue</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>Here is what I do:<BR>
<BR>
[macro-cfmc_queue_private]<BR>
; Due to a change around version 1.6.0.8 MEMBERINTERFACE and MEMBERNAME are not set but CHANNEL has the agent we are connected with.<BR>
; We need to look for Agent/<number> is either CHANNEL or MEMBERINTERFACE and it will be in one or the other<BR>
exten => s,1,UserEvent(DidQueue,ActionID:${Local_CfMC_ActionID} & ${UNIQUEID} & ${CHANNEL} & ${Local_CfMC_AgentToUse} & ${Local_CfMC_DialInfo} & ${Local_CfMC_QueueToUse} & ${MEMBERINTERFACE} & ${MEMBERNAME})<BR>
<BR>
<BR>
<BR>
exten => queue_answer,1,Answer()<BR>
exten => queue_answer,n,Set(CfMC_AMDValue="NotChecked")<BR>
exten => queue_answer,n,GotoIf($["${CfMC_DoAMD}"!="Yes"]?NoAMD)<BR>
exten => queue_answer,n,AMD()<BR>
; AMDSTATUS - MACHINE HUMAN NOTSURE HANGUP<BR>
exten => queue_answer,n,Set(CfMC_AMDValue="${AMDSTATUS}")<BR>
exten => queue_answer,n(NoAMD),Wait(0.3)<BR>
exten => queue_answer,n,UserEvent(BeforeQueue,ActionID:${CfMC_ActionID} & ${UNIQUEID} & ${CHANNEL} & ${CfMC_AgentToUse} & ${CfMC_DialInfo} & ${CfMC_QueueToUse} & ${CfMC_AMDValue} & ${AMDCAUSE})<BR>
exten => queue_answer,n,GotoIf($[${CfMC_AMDValue} & "NotChecked"]?QueueIt)<BR>
exten => queue_answer,n,GotoIf($[${CfMC_AMDValue}!="HUMAN"]?ForceHangUp)<BR>
; Some time around version 1.6.0.8 * hangs up a channel before it used to so the channel pointed at macro cfmc_queue_private is not the same one.<BR>
; This causes us to be looking at a different channel thus some of our variables were not there. We need to propogate them upward so do Set().<BR>
exten => queue_answer,n(QueueIt),Set(_Local_CfMC_ActionID=${CfMC_ActionID})<BR>
exten => queue_answer,n,Set(_Local_CfMC_AgentToUse=${CfMC_AgentToUse})<BR>
exten => queue_answer,n,Set(_Local_CfMC_DialInfo=${CfMC_DialInfo})<BR>
exten => queue_answer,n,Set(_Local_CfMC_QueueToUse=${CfMC_QueueToUse})<BR>
exten => queue_answer,n,Queue(${CfMC_QueueToUse},cn,,,20,,cfmc_queue_private)<BR>
; QUEUESTATUS - TIMEOUT FULL JOINEMPTY LEAVEEMPTY JOINUNAVAIL LEAVEUNAVAIL CONTINUE<BR>
exten => queue_answer,n,UserEvent(AfterQueue,ActionID:${CfMC_ActionID} & ${UNIQUEID} & ${CHANNEL} & ${CfMC_AgentToUse} & ${CfMC_DialInfo} & ${CfMC_QueueToUse} & ${QUEUESTATUS})<BR>
exten => queue_answer,n(ForceHangUp),Hangup()<BR>
<BR>
-- <BR>
Jim Dickenson<BR>
<a href="mailto:dickenson@cfmc.com">mailto:dickenson@cfmc.com</a><BR>
<BR>
CfMC<BR>
<a href="http://www.cfmc.com/">http://www.cfmc.com/</a><BR>
<BR>
<BR>
<BR>
<FONT COLOR="#0000FF">> From: <cesar@codinet.com.mx><BR>
> Reply-To: Asterisk Users Mailing List - Non-Commercial Discussion <BR>
> <asterisk-users@lists.digium.com><BR>
> Date: Thu, 07 May 2009 13:20:02 -0500<BR>
> To: <asterisk-users@lists.digium.com><BR>
> Subject: [asterisk-users] Macro arguments on app_queue<BR>
> <BR>
> hi list, i have a question about the args of queue:<BR>
> <BR>
> when we use Queue() app, there are some arguments than can use. help from<BR>
> CLI:<BR>
> <BR>
> Queue(queuename[,options[,URL[,announceoverride[,timeout[,AGI[,macro[,gosub[,r<BR>
> ule]]]]]]]])<BR>
> <BR>
> well.. i'm trying to identify who has taken the call on a queue, and, when<BR>
> agent conected, launch a macro with some args based on who takes the call<BR>
> <BR>
> i do:<BR>
> <BR>
> exten => s,1,answer()<BR>
> exten => s,1,Queue(myQueue,,,,,,myMacro)<BR>
> <BR>
> but, there is no arguments there, right?<BR>
> <BR>
> what about use<BR>
> <BR>
> <BR>
> exten => s,1,answer()<BR>
> exten => s,1,Queue(myQueue,,,,,,myMacro,arg1)<BR>
> <BR>
> (remember that macro works like exten => s,n,Macro(myMacro,myArg1,myArg2),<BR>
> that means, concatenate args after macro name, separate with comas.<BR>
> <BR>
> but....<BR>
> <BR>
> Queue takes that thing after comas like other arguments OF QUEUE, not<BR>
> subargs of args. this is, my second example says,<BR>
> Queue(myQueue,,,,,,myMacro,arg1), but "arg1" is taken like queue argument<BR>
> means Gosub entry...<BR>
> <BR>
> there is way of call that macro into queue, but with macro arguments ???<BR>
> <BR>
> in the queues.conf <BR>
> <BR>
> if i put<BR>
> <BR>
> membermacro=myMacro,myArgument<BR>
> <BR>
> works fine.. except that, i can't use<BR>
> <BR>
> membermacro=myMacro,${MYVAR}<BR>
> <BR>
> because ${MYVAR} is taken like String, not the var value<BR>
> <BR>
> help mee!! please<BR>
> <BR>
> sorry for my very bad english<BR>
> <BR>
> _______________________________________________<BR>
> -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com">http://www.api-digital.com</a> --<BR>
> <BR>
> asterisk-users mailing list<BR>
> To UNSUBSCRIBE or update options visit:<BR>
> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><BR>
</FONT></SPAN></FONT>
</BODY>
</HTML>