cesar at codinet.com.mx
2009-May-07 18:20 UTC
[asterisk-users] Macro arguments on app_queue
hi list, i have a question about the args of queue: when we use Queue() app, there are some arguments than can use. help from CLI: Queue(queuename[,options[,URL[,announceoverride[,timeout[,AGI[,macro[,gosub[,rule]]]]]]]]) well.. i'm trying to identify who has taken the call on a queue, and, when agent conected, launch a macro with some args based on who takes the call i do: exten => s,1,answer() exten => s,1,Queue(myQueue,,,,,,myMacro) but, there is no arguments there, right? what about use exten => s,1,answer() exten => s,1,Queue(myQueue,,,,,,myMacro,arg1) (remember that macro works like exten => s,n,Macro(myMacro,myArg1,myArg2), that means, concatenate args after macro name, separate with comas. but.... Queue takes that thing after comas like other arguments OF QUEUE, not subargs of args. this is, my second example says, Queue(myQueue,,,,,,myMacro,arg1), but "arg1" is taken like queue argument means Gosub entry... there is way of call that macro into queue, but with macro arguments ??? in the queues.conf if i put membermacro=myMacro,myArgument works fine.. except that, i can't use membermacro=myMacro,${MYVAR} because ${MYVAR} is taken like String, not the var value help mee!! please sorry for my very bad english
Here is what I do: [macro-cfmc_queue_private] ; 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. ; We need to look for Agent/<number> is either CHANNEL or MEMBERINTERFACE and it will be in one or the other exten => s,1,UserEvent(DidQueue,ActionID:${Local_CfMC_ActionID} & ${UNIQUEID} & ${CHANNEL} & ${Local_CfMC_AgentToUse} & ${Local_CfMC_DialInfo} & ${Local_CfMC_QueueToUse} & ${MEMBERINTERFACE} & ${MEMBERNAME}) exten => queue_answer,1,Answer() exten => queue_answer,n,Set(CfMC_AMDValue="NotChecked") exten => queue_answer,n,GotoIf($["${CfMC_DoAMD}"!="Yes"]?NoAMD) exten => queue_answer,n,AMD() ; AMDSTATUS - MACHINE HUMAN NOTSURE HANGUP exten => queue_answer,n,Set(CfMC_AMDValue="${AMDSTATUS}") exten => queue_answer,n(NoAMD),Wait(0.3) exten => queue_answer,n,UserEvent(BeforeQueue,ActionID:${CfMC_ActionID} & ${UNIQUEID} & ${CHANNEL} & ${CfMC_AgentToUse} & ${CfMC_DialInfo} & ${CfMC_QueueToUse} & ${CfMC_AMDValue} & ${AMDCAUSE}) exten => queue_answer,n,GotoIf($[${CfMC_AMDValue} & "NotChecked"]?QueueIt) exten => queue_answer,n,GotoIf($[${CfMC_AMDValue}!="HUMAN"]?ForceHangUp) ; 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. ; 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(). exten => queue_answer,n(QueueIt),Set(_Local_CfMC_ActionID=${CfMC_ActionID}) exten => queue_answer,n,Set(_Local_CfMC_AgentToUse=${CfMC_AgentToUse}) exten => queue_answer,n,Set(_Local_CfMC_DialInfo=${CfMC_DialInfo}) exten => queue_answer,n,Set(_Local_CfMC_QueueToUse=${CfMC_QueueToUse}) exten => queue_answer,n,Queue(${CfMC_QueueToUse},cn,,,20,,cfmc_queue_private) ; QUEUESTATUS - TIMEOUT FULL JOINEMPTY LEAVEEMPTY JOINUNAVAIL LEAVEUNAVAIL CONTINUE exten => queue_answer,n,UserEvent(AfterQueue,ActionID:${CfMC_ActionID} & ${UNIQUEID} & ${CHANNEL} & ${CfMC_AgentToUse} & ${CfMC_DialInfo} & ${CfMC_QueueToUse} & ${QUEUESTATUS}) exten => queue_answer,n(ForceHangUp),Hangup() -- Jim Dickenson mailto:dickenson at cfmc.com CfMC http://www.cfmc.com/> From: <cesar at codinet.com.mx> > Reply-To: Asterisk Users Mailing List - Non-Commercial Discussion > <asterisk-users at lists.digium.com> > Date: Thu, 07 May 2009 13:20:02 -0500 > To: <asterisk-users at lists.digium.com> > Subject: [asterisk-users] Macro arguments on app_queue > > hi list, i have a question about the args of queue: > > when we use Queue() app, there are some arguments than can use. help from > CLI: > > Queue(queuename[,options[,URL[,announceoverride[,timeout[,AGI[,macro[,gosub[,r > ule]]]]]]]]) > > well.. i'm trying to identify who has taken the call on a queue, and, when > agent conected, launch a macro with some args based on who takes the call > > i do: > > exten => s,1,answer() > exten => s,1,Queue(myQueue,,,,,,myMacro) > > but, there is no arguments there, right? > > what about use > > > exten => s,1,answer() > exten => s,1,Queue(myQueue,,,,,,myMacro,arg1) > > (remember that macro works like exten => s,n,Macro(myMacro,myArg1,myArg2), > that means, concatenate args after macro name, separate with comas. > > but.... > > Queue takes that thing after comas like other arguments OF QUEUE, not > subargs of args. this is, my second example says, > Queue(myQueue,,,,,,myMacro,arg1), but "arg1" is taken like queue argument > means Gosub entry... > > there is way of call that macro into queue, but with macro arguments ??? > > in the queues.conf > > if i put > > membermacro=myMacro,myArgument > > works fine.. except that, i can't use > > membermacro=myMacro,${MYVAR} > > because ${MYVAR} is taken like String, not the var value > > help mee!! please > > sorry for my very bad english > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090507/4e43c699/attachment.htm