Delay 15sec then start to dial cellphone

Here is what I am trying to do:

When * get a inbound call, it should ring 101 and 102 (both are SIP extension registered on the * box), if 101 and 102 does not answer within 15 sec then the * box will keep ringing 101 and 102, meanwhile, it should start dial my cellphone(6383279158) as well.

So I did this:

exten => s,1,Dial(SIP/101&SIP/102&SIP/158) exten => 158,1,Wait(15) exten => 158,2,Dial(SIP/VoipProvider/6383279158)

Now it seems the problem is how to make 158 registered on *box as a SIP extension. (custome extension? how?)

If I dial 158 from 101, the *box do wait 15sec then dial my cellphone.

How to make this works? Thanks for help.

I think you’re looking for something like this:

exten => s,1,Answer()
exten => s,n,Dial(SIP/101&SIP/102,15,r)
exten => s,n,Dial(SIP/101&SIP/102&SIP/VoipProvider/6383279158)
exten => s,n,Hangup()

First line answers call, second rings 101 and 102 for 15 secs, and third dials cell phone, 101, and 102.

Milenko, thank you for the quick reply.

Your suggestion almost works. The only thing is as soon as the Answer() executed, the caller no longer get the ringing tone. I removed it and now it is working. Here is the final code:

exten => s,1,Dial(SIP/101&SIP/102,15,r) exten => s,n,Dial(SIP/101&SIP/102&SIP/VoipProvider/6383279158) exten => s,n,Hangup()

Huh… Something strange…

I changed the above code a little bit:

exten => s,1,Dial(SIP/101&SIP/102,15,r) exten => s,n,Dial(SIP/101&SIP/102&SIP/VoipProvider/6383279158,15,r) exten => s,n,Hangup()

Now, when I try to dial use my wife’s cellphone, 101, 102 rings for 15sec, after that my cellphone start ringing for another 15sec. Then I can see that the Hangup() executed in CLI and 101/102/my_cellphone all stopped ringing. (The cellphone will show “Missed call”.) So far everything runs good. BUT, my wife’s cellphone still keep ringing as of it still try to connect. I put a Congestion() before the Hangup() it still the same.

Here are the last few lines from CLI log:

-- Nobody picked up in 15000 ms -- Executing [6382685561@mydomain-incoming:3] Hangup("SIP/6382685561-406181f8", "") in new stack == Spawn extension (mydomain-incoming, 6382685561, 3) exited non-zero on 'SIP/6382685561-406181f8'

By the way, I am using Asterisk 1.4

Hrm, * is hanging up the channel, but it’s not making it through to the calling party. Maybe your VOIP provider isn’t sending the disconnection? What happens if you call out from 101 or 102 to a cell phone, does the cell get the disconnect when you hangup from inside *?

I had issues with this when I was using analog lines with a TDM400. It was because my local telco didn’t use disconnect supervision on the phone lines. When either party hungup the line, the other party would still be on the line until * decided to time it out.

Not sure what is the problem. If I call my cell from 101 or 102, everything seems normal. Hangup from 101 will give the cellphone a congestion tone.

Anyway, now I managed works like this:

exten => s,1,Dial(SIP/101&SIP/102,15,r) exten => s,n,Dial(SIP/101&SIP/102&SIP/VoipProvider/6383279158,15,r) exten => s,n, Answer exten => s,n, Playtones(congestion) exten => s,n,Hangup()
So after the two 15sec ringing, * will answer the phone and give the caller a congestion tone immediately, follow by hangup the channel. :wink:

I don’t like the Answer() but I have to keep it here, otherwise the following just won’t work. Sometime I want * hangup certain incoming call without answer it.