Playing a warning 30 seconds before a TIMEOUT(absolute) is due in a channel

In the dialplan for an incoming call I a have set:
same => n,Set(TIMEOUT(absolute)=600)
In the dialplan the caller enters a queue.
A agent will answer the call from the queue and I would like to play a message to the agent 30 seconds before the call is ended by the TIMEOUT(absolute).

Any ideas how this could be achieved.

I’m thinking to define a AGI in the Queue command.
In the agi I can get the TIMEOUT(absolute) as a remaining time.
In the agi get the channel
Launch another script with the remaining time and the channel and wait for the remaining time -/- 30 to execute a ChannelSpy.

But I’m sure there is a more clever way to do it.

Thanks
Geert

I think it should be easier if you use DIAL with L option.

The L option for the Dial command seems to be a good idea, but the issue here is that it seems that he is not originating a call , he is just receiving a call , so if he want to use Dial() command he can use it with Local Channel when receiving the call and this could make the trick

Yes, I think you are right. I will give a try first to direct the incoming call to the local channel with the Dial with L option.

Thanks for your brains output.

Geert

1 Like