I am using softphone XLite.
I want to route a incoming call. Please provide me with dial plan example.

E.g. if there are extensions 1001, 1002, 1003 , 1004 , 1005 available in the company
and 1001, 1003, 1005 are busy.

Then incoming call should get diverted to either 1002 or 1005.

How to know that 1001, 1003, 1005 are busy?
How should my dialplan be? Or suggest operations that I can use?

you can do this with call-limit = 1 in sip.conf so the user is busy if another call is comming in.

then you can make it as complex as you need if you also want to transfer a incomming call if it was not answered you can do it simple with.

exten = 1001,1,Dial(sip/1001,20)
exten = 1001,2,Dial(sip/1003)

or you can have a look at the link below for more complex routing. … DIALSTATUS

Thank you. It worked.