Generate Unique Identifier

I am looking for a way to generate an unique identifier in a dialplan during a call and meet following conditions:

  • Several identifiers are generated during one call
  • Several calls generate identifiers at exactly same time

These identifiers will be given to recorded file names located in one directory. If files is deleted, I don’t want to have another file created with same name.

This identifier could be ${UNIQUEID}, but it’s only unique per call
Could be ${CHANNEL}, but can’t be used for filename and it’s too long
Could be ${EPOCH}, but it can’t be unique
Could be ${EPOCH}${UNIQUEID} combination, but it’s too long, contains dot and somehow I don’t like this combination.

looking for other ideas… :unamused: