Dial plan variables and functions

Is there a list of variable and functions in vital?

I need to read the variable queue # and queue name or ring group # or ring group name in the context.

Same as reading CallerID(name)

Can you elaborate a bit more?

The functions are Asterisk functions, you should be able to see all available functions by running

asterisk -x"core show functions"

If you want to see all variables on a channel, then run

asterisk -x"core show channel <channel name>"

Or do a DumpChan() in th dialplan

I need RingGroup Extension # and name to display in the following dialplan same as ${CALLERID(num)}

#exten => s,1,noop(*test_curl_zammad*)
same=>n,Set(Answer=${CURL(https://service.canadatel.net/api/v1/cti/QYBM7nJoDOdsGBdxLlPfR7GWCjE,[event=newCall&from=${CALLERID(num)}&queue=Canadatel-EmailTest-60010&to=${CALLERID(dnid)}&direction=in&callId=${CHANNEL(LINKEDID)}])})
same => n,verbose(${Answer})
same => n,Return

Where in the call flow is this getting called?

DID terminates into ring group
Ring group dials external number. Custom app and queue

This looks a bit of a rusty solution to me. What are you trying to achieve?

in the following code, I am just trying to automate the RG name and number so I don’t have to hardcode this text and the same script can be used for multiple RGs.

“Phone - Incoming Call to IT” → replace with Ring Group Name and Number variables.

[service-noti-email-60010]
exten=> s,1,Noop( checking the callerid ${CALLERID(num)})
same=>n,TrySystem(echo “Incoming Call - From: ${CALLERID(name)} ${CALLERID(number)} received at ${STRFTIME(${EPOCH},%l:%M:%S %p %Z on %A %B %e)}” | mail -s “Phone - Incoming Call to IT” -r ${mailg} support@example.com, ${SHELL(mysql -s customerinfo -u admin -pPASSWORD -h IPADDRESS --skip-column-names -e ‘select email from account where phone="${CALLERID(num)}"’):0:-1})

You can technically create the following dialplan:

[email-notify]
exten=> _.,1,Noop(checking the callerid ${CALLERID(num)})
 same=>n,TrySystem(echo “Incoming Call - From: ${CALLERID(name)} ${CALLERID(number)} received at ${STRFTIME(${EPOCH},%l:%M:%S %p %Z on %A %B %e)}” | mail -s “Phone - Incoming Call to ${EXTEN}” -r ${mailg} support@example.com, ${SHELL(mysql -s customerinfo -u admin -pPASSWORD -h IPADDRESS --skip-column-names -e ‘select email from account where phone="${CALLERID(num)}"’):0:-1})
 same=>n,Goto(${ARG1},${ARG2},${ARG3})

And then you can create a custom context for each ring group as shown below:

For sales -

For Customer Service -

You can technically also split the EXTEN variable based on the hyphen, ${CUT(EXTEN,-,1)} to get the name, and ${CUT(EXTEN,-,2)} to get the number.

Also, I assume you only use the ring group so you can call the custom context with the queue simultaneously. If so, then with this solution, in the custom context you can point the destination directly to the queue. This will definitely make your CDR more cleaner.

Important note: You cannot enter any spaces in the custom context’s extension field. I filed a feature request to allow passing arguments, where then you will be able to pass an argument that contains a space.

Thanks, I will try this

I am not very familiar with aestrix dialplan, what is ${ARG1},${ARG2},${ARG3} ?

The custom context destination is passed as arguments, so in order to send the call to the destination specified in the custom context module, you have to do it as described above with the ARG1 ARG2 and ARG3

Thanks, working as expected

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.