I already read this article many times, but without any luck, for example, if I used this one and I have 3 extensions in my queue
[macro-dialout-one-predial-hook]
exten = s,1,Noop(Entering user defined context macro-dialout-one-predial-hook in extensions_custom.conf)
exten = s,n,Set(CHANNEL(hangup_handler_push)=lgaetz-do-this-on-hangup,s,1)
exten = s,n,MacroExit
[lgaetz-do-this-on-hangup]
exten = s,1,Noop(Entering user defined context lgaetz-do-this-on-hangup in extensions_custom.conf)
exten => s,n,Return
I will get this
[2021-07-07 12:30:22] VERBOSE[32302][C-00005a64] pbx.c: Executing [s@macro-dialout-one-predial-hook:2] Set("Local/987@from-queue-000002e9;2", "CHANNEL(hangup_handler_push)=lgaetz-do-this-on-hangup,s,1") i n new stack
[2021-07-07 12:30:23] VERBOSE[32301][C-00005a64] pbx.c: Executing [s@macro-dialout-one-predial-hook:2] Set("Local/399@from-queue-000002e8;2", "CHANNEL(hangup_handler_push)=lgaetz-do-this-on-hangup,s,1") i n new stack
[2021-07-07 12:30:23] VERBOSE[32303][C-00005a64] pbx.c: Executing [s@macro-dialout-one-predial-hook:2] Set("Local/220@from-queue-000002ea;2", "CHANNEL(hangup_handler_push)=lgaetz-do-this-on-hangup,s,1") i n new stack
for example, if 220 answered,
[2021-07-07 12:30:22] VERBOSE[32302][C-00005a64] pbx.c: Executing [s@macro-dialout-one-predial-hook:2] Set("Local/987@from-queue-000002e9;2", "CHANNEL(hangup_handler_push)=lgaetz-do-this-on-hangup,s,1") i n new stack
[2021-07-07 12:30:23] VERBOSE[32301][C-00005a64] pbx.c: Executing [s@macro-dialout-one-predial-hook:2] Set("Local/399@from-queue-000002e8;2", "CHANNEL(hangup_handler_push)=lgaetz-do-this-on-hangup,s,1") i n new stack
I will get the rest of the extensions one by one so my AGI scrip will be fired 2 times, I just want to get the status of the queue if someone answered or no one does.