I want to dial a number back after hangup

SO I havbe thought about this for a long time and tried many things Maybe I need a Hangup Handler as I read about.

I want that when an extension calls 1191 that it plays the digits then a busy signal till the person hangs up (or the person can hang up immediately)

Then asterisk should call back the extension.

So what I have right now (one of many things I have tried over the years)

; ring phone
exten => 1191,1,Answer
exten => 1191,2,Wait(2)
exten => 1191,3,Set(CallingID=${CALLERID(num)})
exten => 1191,4,SayDigits(${CALLERID(num)})
exten => 1191,5,Playtones(busy)
exten => 1191,6,Wait(20)
exten => 1191,7,Dial(LOCAL/${CallingID})
exten => 1191,8,Hangup

What happens is when the person hangs up the whole thing stops and exits.

Note I set the $CallingID variable to ghopefully keep the Caller ID variable even after hangup but not sure that this even works.

I need it to keep running numbers 7 and 8

How can I make this work?

I am using Chan_sip

I would use the h extension for this.

See: Docs - PhreakNet

You are going to need to use Originate, as you cannot run Dial on a channel that has been hung up (not even from the h extension). Also this Dial is trying to connect the caller to themselves, which is not what I think you want to achieve.

Also, h extensions are not supposed to be long running, and you may get warning messages ab out being unable to complete the technology specific shutdown on the original call, and you may get messages referring to having an owner in place. You should put any delay in the originate, which will generally mean using a local channel as the A leg, and putting the wait in that.

I’d actually suggest using call files, as Originate only makes one attempt.

Something similar to this, but normally without the incoming call ever being answered, is a fairly common request, so Google might even provide a worked example.

I do not really need to answer the incoming call but searched high and low and can not find the answer.

Capture the caller ID, initiate Originate, Hangup the caller.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.