Hey all! If this has been answered I’m so sorry I’ve searched for hours to try to find something that works. This is a repost from the FreePBX forum as someone rightfully suggested I post here instead. We have a ticket platform we’d like calls sent to a queue to trigger an API via email. Here is what I have so far, the only thing missing is the DID the caller dialed or the Queue name they hit? I’ve manually added the queue and just plan to make a new custom extension per queue if needed, but I cannot fake which inbound route was used to get to the queue. Is there a variable I’m missing?
Both of these work, 9990002 is the test I was using to dump as many variables out I could think might help me… They unfortunately do not.
exten => 9990001,1,NoOp(Entering user defined context [send-email] in extensions_custom.conf)
exten => 9990001,n,System(echo ‘{ “calleridname”: “${CALLERID(name)}”, “calleridnum”: “${CALLERID(number)}”, “queue”: “stinoc”}’ | mail -s ‘PBX-01’ ‘emailaddresshere’)
exten => 9990001,n,Congestion
exten => 9990002,1,NoOp(Entering user defined context [send-email] in extensions_custom.conf)
exten => 9990002,n,System(echo ‘{ “calleridname”: “${CALLERID(name)}”, “calleridnum”: “${CALLERID(number)}”, “queue”: “vienoc”}’ | mail -s ‘PBX-01’ ‘emailaddresshere’)
exten => 9990002,n,NoOp(ACCOUNTCODE=${ACCOUNTCODE})
exten => 9990002,n,NoOp(ANSWEREDTIME=${ANSWEREDTIME})
exten => 9990002,n,NoOp(BLINDTRANSFER=${BLINDTRANSFER})
exten => 9990002,n,NoOp(CALLERID=${CALLERID(all)})
exten => 9990002,n,NoOp(CALLERID(name)=${CALLERID(name)})
exten => 9990002,n,NoOp(CALLERID(number)=${CALLERID(number)})
exten => 9990002,n,NoOp(CALLINGPRES=${CALLINGPRES})
exten => 9990002,n,NoOp(CHANNEL=${CHANNEL})
exten => 9990002,n,NoOp(CONTEXT=${CONTEXT})
exten => 9990002,n,NoOp(DATETIME=${STRFTIME(${EPOCH},%d%m%Y-%H:%M:%S)})
exten => 9990002,n,NoOp(DIALEDPEERNAME=${DIALEDPEERNAME})
exten => 9990002,n,NoOp(DIALEDPEERNUMBER=${DIALEDPEERNUMBER})
exten => 9990002,n,NoOp(DIALEDTIME=${DIALEDTIME})
exten => 9990002,n,NoOp(DIALSTATUS=${DIALSTATUS})
exten => 9990002,n,NoOp(DNID=${CALLERID(dnid)})
exten => 9990002,n,NoOp(EPOCH=${EPOCH})
exten => 9990002,n,NoOp(EXTEN=${EXTEN})
exten => 9990002,n,NoOp(HANGUPCAUSE=${HANGUPCAUSE})
exten => 9990002,n,NoOp(INVALID_EXTEN=${INVALID_EXTEN})
exten => 9990002,n,NoOp(LANGUAGE=${LANGUAGE()})
exten => 9990002,n,NoOp(MEETMESECS=${MEETMESECS})
exten => 9990002,n,NoOp(PRIORITY=${PRIORITY})
exten => 9990002,n,NoOp(RDNIS=${CALLERID(rdnis)}})
exten => 9990002,n,NoOp(SIPDOMAIN=${SIPDOMAIN})
exten => 9990002,n,NoOp(SIP_CODEC=${SIP_CODEC})
exten => 9990002,n,NoOp(SIPCALLID=${SIPCALLID})
exten => 9990002,n,NoOp(SIPUSERAGENT=${SIPUSERAGENT})
exten => 9990002,n,NoOp(TXTCIDNAME=${TXTCIDNAME})
exten => 9990002,n,NoOp(UNIQUEID=${UNIQUEID})
exten => 9990002,n,NoOp(TOUCH_MONITOR=${TOUCH_MONITOR})
exten => 9990002,n,NoOp(MACRO_CONTEXT=${MACRO_CONTEXT})
exten => 9990002,n,NoOp(MACRO_EXTEN=${MACRO_EXTEN})
exten => 9990002,n,NoOp(MACRO_PRIORITY=${MACRO_PRIORITY})
exten => 9990002,n,NoOp(CDRDID=${CDR(did)})
exten => 9990002,n,Congestion
Logs from these tests:
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:1] NoOp(“Local/9990002@from-queue-000000a1;2”, “Entering user defined context [send-email] in extensions_custom.conf”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:2] System(“Local/9990002@from-queue-000000a1;2”, “echo ‘{ “calleridname”: “redacted KARA”, “calleridnum”: “redacted”, “queue”: “vienoc”}’ | mail -s ‘PBX-01’ ‘email’”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:3] NoOp(“Local/9990002@from-queue-000000a1;2”, “ACCOUNTCODE=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:4] NoOp(“Local/9990002@from-queue-000000a1;2”, “ANSWEREDTIME=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:5] NoOp(“Local/9990002@from-queue-000000a1;2”, “BLINDTRANSFER=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:6] NoOp(“Local/9990002@from-queue-000000a1;2”, “CALLERID=“VIE NOC:redeacted” ”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:7] NoOp(“Local/9990002@from-queue-000000a1;2”, “CALLERID(name)=VIE NOC:redacted”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:8] NoOp(“Local/9990002@from-queue-000000a1;2”, “CALLERID(number)=redacted”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:9] NoOp(“Local/9990002@from-queue-000000a1;2”, “CALLINGPRES=0”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:10] NoOp(“Local/9990002@from-queue-000000a1;2”, “CHANNEL=Local/9990002@from-queue-000000a1;2”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:11] NoOp(“Local/9990002@from-queue-000000a1;2”, “CONTEXT=from-internal”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:12] NoOp(“Local/9990002@from-queue-000000a1;2”, “DATETIME=08122023-23:51:49”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:13] NoOp(“Local/9990002@from-queue-000000a1;2”, “DIALEDPEERNAME=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:14] NoOp(“Local/9990002@from-queue-000000a1;2”, “DIALEDPEERNUMBER=9990002@from-queue/n”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:15] NoOp(“Local/9990002@from-queue-000000a1;2”, “DIALEDTIME=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:16] NoOp(“Local/9990002@from-queue-000000a1;2”, “DIALSTATUS=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:17] NoOp(“Local/9990002@from-queue-000000a1;2”, “DNID=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:18] NoOp(“Local/9990002@from-queue-000000a1;2”, “EPOCH=1702079509”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:19] NoOp(“Local/9990002@from-queue-000000a1;2”, “EXTEN=9990002”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:20] NoOp(“Local/9990002@from-queue-000000a1;2”, “HANGUPCAUSE=26”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:21] NoOp(“Local/9990002@from-queue-000000a1;2”, “INVALID_EXTEN=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:22] NoOp(“Local/9990002@from-queue-000000a1;2”, “LANGUAGE=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:23] NoOp(“Local/9990002@from-queue-000000a1;2”, “MEETMESECS=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:24] NoOp(“Local/9990002@from-queue-000000a1;2”, “PRIORITY=24”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:25] NoOp(“Local/9990002@from-queue-000000a1;2”, “RDNIS=}”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:26] NoOp(“Local/9990002@from-queue-000000a1;2”, “SIPDOMAIN=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:27] NoOp(“Local/9990002@from-queue-000000a1;2”, “SIP_CODEC=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:28] NoOp(“Local/9990002@from-queue-000000a1;2”, “SIPCALLID=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:29] NoOp(“Local/9990002@from-queue-000000a1;2”, “SIPUSERAGENT=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:30] NoOp(“Local/9990002@from-queue-000000a1;2”, “TXTCIDNAME=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:31] NoOp(“Local/9990002@from-queue-000000a1;2”, “UNIQUEID=1702079509.617”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:32] NoOp(“Local/9990002@from-queue-000000a1;2”, “TOUCH_MONITOR=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:33] NoOp(“Local/9990002@from-queue-000000a1;2”, “MACRO_CONTEXT=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:34] NoOp(“Local/9990002@from-queue-000000a1;2”, “MACRO_EXTEN=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:35] NoOp(“Local/9990002@from-queue-000000a1;2”, “MACRO_PRIORITY=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:36] NoOp(“Local/9990002@from-queue-000000a1;2”, “CDRDID=”) in new stack
[2023-12-08 23:51:49] VERBOSE[7360][C-00000011] pbx.c: Executing [9990002@from-internal:37] Congestion(“Local/9990002@from-queue-000000a1;2”, “”) in new stack