Channel variables

In call files, I’ve noticed I can set channel variables, and it is quite handy. I am wondering if there is a way to pass variables from an existing file outside of an outbound call via call file.

If I had a file that was CALLERID(num).info stored in my /tmp/ folder, is there a way in the dialplan to search for the file based on the incoming callers number matching the file name, then open the matching file, and use the setvar variables set inside for that call?

The thought was I could write variables and save them somewhere, then when a caller calls in again, if I could lookup and pull in that file, I could give them different options, based on what happened in previous calls.

Thanks for any guidance here.

I’ve been reading more on this and it seems like a local option for accomplishing this might be to use AstDB to set the variables. The family could be the caller’s Caller ID number and a key could be what I want to store and evaluate on subsequent calls from that caller.

I plan on testing this out next week, but before I go too far, does anyone know if there is anything to be wary/aware of with this approach?

I’m thinking of using this to remember if a caller needed an interpreter when they last called and to streamline bridging an interpter if the caller needs one.

I’m on FreePBX/Asterisk 14

Cool application. Just be sure to stay away from stomping on keys that ASTDB is already using and you should be fine.

You should “root” your data under a keyword to facilitate tree manipulation. (You might one day want to deltree the whole structure



Watching. Let us know your findings.

This works, and dicko’s suggestion to build families by the type of data we are querying (instead of making the caller id number the family) is the right call.

Some of the initial data elements we are looking at storing are:

Translator language
Last satisfaction survey score
If they have opted into or rejected services like callback assist before
Last person they spoke to (queue agents)
Last queue they entered
Last time they called in
If they have opted into sms messaging

If anyone does something similar, I’d love to hear what you’re storing and for what too!

1 Like