Dialplan for engaged line

Hi

I’m looking to implement a special dial plan.
I googled but I couldn’t find any helpful answer.

Local extension------->101 DID-------->441234567890

1 dial outbound number from 101------->441234567890.
2 if 441234567890 is engaged then it should give an option for retry
3 if user select option yes for retry
4 Then it’s should retry until line become available.
5 Then dial the extension call made from

is it possible achieve this?
if yes please post some sample dial plan please

Regards,
Sathees

It may be possible, depending on the channel technology used on the B side and whether the provider on that side passes though the proper clearing cause code, and, doesn’t, for example, just signal the cause by early media tones.

You check ${HANGUPCAUSE}, or if that isn’t precise enough, use channel technology specific functions to read the protocol specific rejection causes

3 is a standard IVR case.

4 probably involves using originate to decouple from the incoming call.

5 is just the B side of the originate.

Supplying and supporting supplied dialplan is a consultancy job and I don’t currently take those on.

As this sort of call back scenario has been asked before, you could also search the forum to see what answer they got then.

Note that Asterisk does have a mechanism for handling this sort of case https://wiki.asterisk.org/wiki/display/AST/The+Call+Completion+Process but, for it to work, the network needs to be able to signal that the number is free, and I very much doubt that will be true in your case.

I’m going to test on UK landline first.
I thought I could retry in loop every 10 second until line become available. I don’t know maybe I’m wrong. What do you think?

If by UK landline, you mean a standard, PSTN, analogue line, you will not get any BUSY indication that Asterisk will understand.

The looping on retrying was understood. The difficulties are in detecting busy and in disassociating the call from the caller and then re-associating it.

Also note that what you are proposing to do may be illegal in the UK. At least it used to be illegal. The particular problem case it the little old lady who keeps getting called with an automated wrong number.