Condensing my dialplan for incoming

Getting started with the SIP Sorcery
Post Reply
englen
Posts: 3
Joined: Mon Jul 02, 2012 4:54 pm

Condensing my dialplan for incoming

Post by englen » Thu Jul 05, 2012 10:51 am

At the moment I am using several accounts and dial plans to cover my needs, but would like to condense them into one IN dialplan and one out.
Looking at:

Code: Select all

case req.URI.User
  when "sipgate.fredsin" then sys.Dial("1234@provider1")
  when "callcentric.fredsin" then sys.Dial("5678@provider2")
  else sys.Dial("youraccount@sipsorcery.com")
end
For arguments sake I have 2 providers and an email.
provider1.fredsin
provider2.fredsin
callcentric.fredsin

What I want to do:
calls from provider1.fredsin ring myaccount@local for 15secs
<if no answer> then
ring 12345678@provider for 15 secs
else ring callcentric voice mail.

My first attempts are:

Code: Select all

sys.Dial("myaccount@local&12345678@provider2[dt=15]|17772xxxxx0@in.callcentric.com[fu=864236145]")
but this only delays the call to provider2.

Any suggestions welcomed.

Aaron
Site Admin
Posts: 4652
Joined: Thu Jul 12, 2007 12:13 am

Re: Condensing my dialplan for incoming

Post by Aaron » Fri Jul 06, 2012 7:52 am

To failover with a ring timeout you need to use a separate dialplans.

Code: Select all

sys.Dial("myaccount@local", 15)
sys.Dial("12345678@provider2", 15)
sys.Dial("myaccount@local&17772xxxxx0@in.callcentric.com[fu=864236145]")

Post Reply