Queue - Get who answered the call via Macro/AGI

Hi All,
Greetings

I’m working on a scenario where I need to integrate CRM call on call pickup in queue.

I have an option of calling CRM URL either with URL/macro/AGI params

Queue(queuename,options,URL,announceoverride,timeout,AGI,macro,gosub,rule,position)

But I’m note sure how can I obtain assigned agent id (called agent-id) from Queue to be passed in CRM URL.

I read while googling ${MEMBERINTERFACE} contains this info but, in testing neither it worked in AGI or Macro.

Can you assist with correct way of doing it in dial plan. My sample dial plan is

[from-pstn]
exten => _X.,1,Goto(s,1)
exten => s,1,Answer
exten => s,n,Set(STARTTIME=${STRFTIME(${EPOCH},%d-%m-%Y %H:%M:%S)})
exten => s,n,Set(CALLID=${CALLERID(number)})
exten => s,n,Queue(testqueue,t,3000,crm_call,)
exten => s,n,Hangup

[macro-crm_call]
exten => _X.,1,Noop( *** Info From Queue : ${MEMBERINTERFACE} ***)

=> Nothing in Macro :frowning:

I’m not sure but… I think You should pass the member macro as argument from previous context. Try something like:

[code]Queue(testqueue,t,3000,crm_call^${MEMBERINTERFACE},)

[macro-crm_call]
exten => _X.,1,Noop( *** Info From Queue : ${ARG1} ***)[/code]

Already tested, FAILED !!!

with ${BRIDGEDPEER} is the same?

${BRIDGEDPEER} to be passed as argument in Macro?

Haven’t tested yet, will give it a try

Assuming AgentId is nothing but a membername option while adding an agent to Queue, I suggest you to check for ${MEMBERNAME} variable.

–Satish Barot

check this!!!

extensions.conf
[macro-mymacro]
exten => s,1,NoOp(${MEMBERINTERFACE})

[queue]
exten => s,1,Queue(queue)

queues.conf
setinterfacevar=yes
membermacro=mymacro

biguitarman

[code]queues.conf

[420786]
setinterfacevar=yes
setqueuevar=yes
setqueueentryvar=yes
membermacro=queuemacro

autofill=no
eventmemberstatus=no
eventwhencalled=no
joinempty=yes
leavewhenempty=no
maxlen=0
reportholdtime=no
retry=5
ringinuse=yes
servicelevel=60
strategy=ringall
timeout=15
weight=0
wrapuptime=0

member => SIP/991
member => SIP/999

extensions.conf

[from-pstn-queue]
exten => _X.,1,Goto(s,1)
exten => s,n,Ringing()
exten => s,n,Set(MSISDN=${CALLERID(number)})
;exten => s,n,Queue(420786,queuemacro^${MSISDN}) ---- Doesn’t work
exten => s,n,Queue(420786,queuemacro) ;---- Works
exten => s,n,Hangup

[macro-queuemacro]
exten => s,1,Set(PICKUPOPER=${CALLERID(num)})
exten => s,n,Noop(*** MACRO : Queue Macro : ${ARG1} – ${PICKUPOPER} – ${MEMBERNAME} – ${MEMBERINTERFACE} – ***)

------ CLI Output ----------

-- Executing [s@from-pstn-queue:10] Queue("SIP/421-0000001c", "420786,,,,,,queuemacro") in new stack
-- Started music on hold, class 'default', on SIP/421-0000001c

== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– SIP/999-0000001d connected line has changed. Saving it until answer for SIP/421-0000001c
– SIP/999-0000001d is ringing
– SIP/999-0000001d connected line has changed. Saving it until answer for SIP/421-0000001c
– SIP/999-0000001d answered SIP/421-0000001c
– Stopped music on hold on SIP/421-0000001c
– Executing [s@macro-queuemacro:1] Set(“SIP/999-0000001d”, “PICKUPOPER=999”) in new stack
– Executing [s@macro-queuemacro:2] NoOp(“SIP/999-0000001d”, “*** MACRO : Queue Macro : – 999 – SIP/999 – SIP/999 – ***”) in new stack
– Locally bridging SIP/421-0000001c and SIP/999-0000001d
== Spawn extension (from-pstn-queue, s, 10) exited non-zero on ‘SIP/421-0000001c’

[/code]

This is final code I got my original concern addressed, but the issue open is I can’t pass variables to macro in queue (highlighted ${MSISDN}). If I do that macro simply fails or never executes

Now I can get agent who picked the call BUT, callerid of caller is missing :frowning:

So, I figured it out

Setting Global variable is the solution I tried.

Using Global variable will lead you to some other issues as they retain their value across all the channels.
Better use Variable inheritance (wiki.asterisk.org/wiki/display/ … nce+Basics) and you’ll be in a position to use calling channel variables in Queue Macro (Remember Queue Macro runs on called channel and not on calling channel).

–Satish Barot

Thanks for explanation Satish. Will give it a try.

Hi nikhilmaggu,

I just want to know if you found finaly something to retrieve the callerid into your macro ?

Thanks,
William.

I found my problem (I tried to read ${_var1} instead of ${var1} in the Macro)
http://forums.asterisk.org/viewtopic.php?f=1&t=84149&start=0