What entries in conf files for Call Forwarding in Asterisk?

I am trying to learn how i can add call forwarding facility for few phones by default in Asterisk via conf files entries. My Asterisk version 1.6.2.6
I read voip-info.org/wiki/view/Aste … forwarding
In my scenario i have 3 entries like 10,11,12 which always answer the calls.
But i am trying to do call forwarding ie if 10 busy then call should go to 11, if 11 busy then call goes to 12,if 12 then call end with recorded tape that ‘all are busy’. For that i read above link data, as per my knowledge i have to change my dial plan. but in examples all showing first i should click # key & save it. but i need by default call forwarding. As if phone 50 calls 10 then if 10 not busy then it goes to 10 only. But if 51 calls 10 then it goes to 11 because 10 busy with 50. I am giving example of phone 10 entries in Asterisk conf files same for other also. My extension.conf entries:

exten => 0010,1,Wait(0.05)
exten => 0010,2,Queue(0010)
exten => 0110,1,Dial(SIP/0110)
exten => 0210,1,Dial(SIP/0210)

My sip.conf entries:

[0010]
username = 0010
secret = 0010
type = friend
insecure = port,invite
host = dynamic
context = users
[0110]
username = 0110
secret = 0110
type = friend
insecure = port,invite
host = dynamic
context = users
[0210]
username = 0210
secret = 0210
type = friend
insecure = port,invite
host = dynamic
context = users

My queues.conf entries:-

[0010]
member => SIP/0010

Where & what i should add in above entries so call forwarding done by default in my Asterisk?
I need to call forwarding for only 00 entities of 10,11,12.
Please need help. I try, if succeed then i will post what i done.

You are using an obsolete version of Asterisk, and you are using the non-final version of that obsolete version, so you will have known security bugs.

The simple call forward busy/no answer sequence for SIP devices aaa, bbb and ccc called from extension 555, with a no answer timeout of 15 seconds at each stage, is:

exten => 555,1,Dial(SIP/aaa,15)
exten => 555,n,Dial(SIP/bbb,15)
exten => 555,n,DIal(SIP/ccc,15)
exten => 555,n,Answer() ; Playback should answer by default, but make it explicit
exten => 555,n,Playback(…)

You can test the values of DIALSTATUS and HANGUPCAUSE between each step, and use more complex logic to decide whether to continue, but that is the basic logic… This should all be fairly obvious if you have the minimum understanding of dialplans needed to use Asterisk effectively. There is at least one example of this (although slighlty more complicated, in the sample configuraton file which acts as the primary documentation.

Also, you have insecure=invite on your local device entries in sip.conf. That is very insecure and makes you very vulnerable to toll fraud.

Thanks david55 for giving clue & information.

As per my project there is needed very basic dial plan which use for basic demo.Currently no worry about hacking etc. I am the only user who use 5-6 phone for study in Own LAN & pc with no internet.
So i need to show very basic call forwarding functionality. For understanding how call should forward in Asterisk Your example is useful. But i need to call forward for entity 00 which not completely in extensions.conf some part in queues.conf
As compare my code with your example
i will try in extensions.conf:-

exten => 0010,1,Wait(0.05)
exten => 0010,2,Queue(0010)
exten => 0010,n,Dial(SIP/0011,15)
exten => 0010,n,Dial(SIP/0012,15)
exten => 0110,1,Dial(SIP/0110)
exten => 0210,1,Dial(SIP/0210)

As per my understanding if some one try to call extension 10 then first it use 2nd line & establish call
If 10 busy then it use 3rd line where we write to connect 0011 after 15 sec. & same for 0012 in 4th line.
For playback etc i will write those line afterword when i understood this step by step!
Am i right in understanding?
Should i write some thing in queues.conf also?

You will need a timeout on the Queue application call. The whole point of queuse is to handle busy cases, so you obviously should only be interested in timeouts for the for Queue case.

Thanks david55 & khiremandar for asking this question & giving clue.
Now question arise that How will add a timeout on the Queue application call.

Please Help

Type “core show application queue” at the CLI prompt and read the definitions of the parameters.

Hi,

As you have suggested to find defination parameters by giving command “core show application queue”

So After giving this command I got I need to use
[Syntax]
Queue(queuename[,options[,URL[,announceoverride[,timeout[,AGI[,macro[,gosub[,rule]]]]]]]])

I don’t want to use announceoverride,only timeout i want to use for call forwarding

Please suggest How I’ll use above syntax for for my extension 0030,Please refer details I’ve given below also

“extension.conf”

exten => 0030,1,Wait(0.05)
exten => 0030,2,Queue(0030)
exten => 0130,1,Dial(SIP/0130)
exten => 0230,1,Dial(SIP/0230)

“Sip.conf”

[0030]
username = 0030
secret = 0030
type = friend
insecure = port,invite
host = dynamic
context = users
[0130]
username = 0130
secret = 0130
type = friend
insecure = port,invite
host = dynamic
context = users
[0230]
username = 0230
secret = 0230
type = friend
insecure = port,invite
host = dynamic
context = users

“queues.conf”

[0030]
member => SIP/0030

Try the obvious.

As per your suggestion I made following change in “queues.conf” for call forwarding

“queues.conf”

[0030]
member => SIP/0030

;Queue(queuename[,options[,URL[,announceoverride[,timeout[,AGI[,macro[,gosub[,rule]]]]]]]])

Queue(0031[,t[,[,[,45[,[,[,[,]]]]]]]])

Note:Assumption is if 0030 entity will be busy then call will be forwarded to 0031 entity

Please make me correct if I’m wrong. :confused:

There is a 40 year old convention that […] means optional!

Hi David55!

I’m using Asterisk 10,centos 6. and I’V done changes in conf file as below for call forwarding

"extension.conf"
exten => 0010,1,Wait(0.05)
exten => 0010,2,Queue(0010)
exten => 0010,n,Dial(SIP/0011,15)
exten => 0010,n,Dial(SIP/0012,15)
exten => 0110,1,Dial(SIP/0110)
exten => 0210,1,Dial(SIP/0210)

“queues.conf”
;----------------------QUEUE TIMING OPTIONS------------------------------------
timeout = 15
retry = 5
;timeoutpriority = app|conf
timeoutpriority = conf

[0010]
member => SIP/0010
[0011]
member => SIP/0011
[0012]
member => SIP/0012

Please Help David wheather i’m right :smile: