Transfer to an external phone number after 20 seconds

Hi everybody !!

I’m trying to transfer a call after 20 seconds timeout but i can’t find the dialplan to use.
in extensions.conf I have this :

[3258]
exten => _X.,1,Answer
exten => _X.,2,Dial(SIP/3258,20,TtHhXx)
exten => _X.,3,Hangup

After my 20 seconds, I want the call to be automatically transfered to an external number (like cell phone).

Is there someone here able to help me with this “tiny” issue.
I can assume this is a dummy question, but I can’t figure out what to do about this.

Thanks a lot for your help.

Deleted misplaced post - got confused about position in browser history after repeated connectiity losses to the Digium servers.

[quote=“david55”]Asterisk is open source.

The programming required isn’t entirely trivial because the code that would detect the X-FAX is seperate from that which would need to generate it.

This only works with early offer SDP, as late offer SDP would require one to know one needed to send X-FAX before you received it![/quote]

Hum… I don’t understand. What is X-FAX ?
I just want, when a phone in my office is ringing since 20 seconds with no response, the incoming call to be transfered to an other, external, number.
Is there a way to do that ? :s
Thanks in advance.

The Dial() application will return to the next step in the dialplan after the timeout. In your sample, the next step is a Hangup(), you will want to add another Dial() statement to get to the desired PSTN number. If you have a SIP trunk, it would be something like ‘Dial(SIP/myproviderinfo/destination_phone_number)’.

Oh, Ok.
I don’t really know how to configure it.
I figured out how to solve this issue directly with the web manager of the phone.
I can add a rule for transferring every unanswered call (after 20 seconds by default) to a phone number (external or not).
Problem unsolved in dialplan, but topic closed :wink:

Thanks for your help :smile:

Looks like as well as posting a reply to the wrong thread, I lost my original reply to this thread.

As you’ve already been told, you can just make step three a Dial to the new target. You can also make it a Goto, to the handling for the new target number, as though it had been dialed directly, or you can use Transfer to do a real transfer. I wouldn’t reccommend the last option, as the implementation of transfer is not very good especially as you have already answered.

Note, there is no need for your original step 3 and, in most cases, your step 1 is also undesirable. Also, best current practice is to use n for all except the first priority (step) number.

Thnaks for your advices !
I’ll see what I can do.
I’m not expert on this technology and neither are everyone working with me.
So I may let that as it is just to be sure not to make any mistake.

Thanks again !

To make a long story short:

[3258]
exten => _X.,1,Answer
exten => _X.,2,Dial(SIP/3258,20)
exten => _X.,3,Dial(SIP/Provider_Peer/Phone_Number,20)
exten => _X.,4,Hangup

Provider_Peer = Peer of Friend defined in sip.conf that connects Asterisk to a SIP provider
Phone_Number = External phone number to which you want to transfer a call after first 20 seconds

To make it even shorter:

[3258] exten => _X.,1,Dial(SIP/3258,20) exten => _X.,n,Dial(SIP/Provider_Peer/Phone_Number)Note no second timeout.

Although I might really expect:

[code][default]
exten => 3258,1,Dial(SIP/3258,20)
exten => 3258,n,Goto(internal,Phone_Number,1)

[internal]
include => default
exten => _XXXXX.,1,Dial(SIP/Provider_Peer/${EXTEN})[/code]

This particular configuation, if used with the normal usage of default and internal, would forward external callers to the external number if they would have rung 3258, but not allowed them access to other external numbers. I have used 3258 for both the extension and device name, but that is against best current security practice.

Yes David, you are right. I missed the initial Answer(), and I always use Hangup() at the end of an extension definition (call it force of habit :wink:)

@tjibaut - use David’s first dialplan. It should work OK, just substitute the variables with proper values.

Thanks for all your answers.
It works fine !

Hi all !

We want to add a little something to this dialplan :
We want that, after “X” seconds, the call to be tranferred to 3, 4 or 5 different internal numbers…
Is it possible ?

Thanks a lot !

Use “&” between dialstrings on the Dial, or did you mean something different.

like that :

[3258] exten => _X.,1,Dial(SIP/3258,20) exten => _X.,n,Dial(SIP/[EXTEN1]&[EXTEN2]&[...])

SIP/&SIP/&SIP/…

It works just FINE !!

Thanks a lot !