[asterisk-users] Passing parameter to Queue-called macro

Stefan Viljoen viljoens at verishare.co.za
Tue May 8 08:16:38 CDT 2018


Hi all

I need to pass a parameter in a thread-safe manner to the Queue pickup
macro. This is to know when (and who) picked up an incoming call to a queue
and log that to my back-office system with a CURL to a HTTP endpoint.

However, the Queue application does not appear to allow passing of
parameters to the called queue pickup macro.

E. g. non-working code is:

[queuetest]
timeout = 60
retry = 2
member=>SIP/testnum

[macro-verdianswer]
exten=>s,1,NoOp(Entering Verdi answer macro)
exten=>s,n,NoOp(Value: ${ARG1})
exten=>s,n,MacroExit

[incomingcontext]

exten=>tstqueue,1,NoOp(Incoming call for VerDi)
same=>n,Set(curlResult=${SHELL(/usr/src/verdi/bash/verdiIncGetUUID.sh)})
same=>n,Set(curlResultLength=${LEN(${curlResult})})
same=>n,NoOp(Curl result for incoming call UUID from VerDi: ${curlResult})
same=>n,Set(CDR(accountcode)=${curlResult})
same=>n,Set(curIncAccCode=${curlResult},g)
same=>n,Macro(VCRECORD,stefantestEXT${CALLERID(num)}ACC${CDR(accountcode)},$
{EXTEN})
same=>n,Queue(queuetest,trhc,,,60,,verdianswer(${curIncAccCode}))
same=>n,Hangup()

This results, when executed, in:

 [May  8 15:14:50] WARNING[20921]: app_macro.c:309 _macro_exec: No such
context 'macro-verdianswer(2018050815141huzzu4
' for macro 'verdianswer(2018050815141huzzu4

How can one pass a paramter into the macro called by the Asterisk queue
application on queue pickup?

Alternatively, how can a global variable or ASTDB entry be made thread safe
to do the same?

Thank you

Stefan






More information about the asterisk-users mailing list