exten => s,n,Set(DB(test/${CAllERID(NUMBER)})=${TimeStamp

I am talking about the current call. Because there is probably a delay of 1 second or a fraction of a second until the script is done I am afraid this might mess up the variables if let’s say there is 50 calls coming in and 5 of them happen to be at the same time.

exten => s,1,Answer() exten => s,n,Set(START=${EPOCH}) ; Set the ${START} channel variable to be the current epoch exten => s,n,Noop("Some long process here") ; Replace this with some long running process exten => s,n,NoOp("${START} is the epoch this started"); You can pick up the START variable again in some other commands to process

Does this help make it more clear?

Then you could do your gotoif’s based on the ${START} variable or whatever other apps you are using it with.

Thanks for the example. But let me get this straight :smile: So, ${START} is a reserved variable for Asterisk? Is that why it works?

Also, just to give another example of my situation, if first call came in and let’s say START = 5:00:01 and before my long process is done another call came in at 5:00:02 then START value for the second channel would = 5:00:02 and yet START for the first channel would = 5:00:01 ?

If Yes, then when I read START at a later time which value would I get? 5:00:01 or 5:00:02 (While both calls are still going on). Is Asterisk smart to enough to actually channelize things I guess?! And if it is that smart then what is the need for using $START ?

Sorry to confuse you, I am trying to understand this.

Thanks again

START is an arbitrary variable name that was set to EPOCH earlier. You can set any number of variables you want to follow the channel. You can also set global variables but that is not what you are looking for. For reference, read The Future of Telephony 2nd Edition pages 135-136. You can download the pdf of it from O’Reilly.