Thread: inbound routing
View Single Post
Unread 11-17-2010, 03:42 AM   #2
emoci
 
Join Date: Jul 2007
Location: Toronto, Canada
Posts: 1,422
Thanks: 123
Thanked 369 Times in 282 Posts
emoci is a name known to allemoci is a name known to allemoci is a name known to allemoci is a name known to all
Default

The forwarding feature just does not support that type of of forwarding (Forward if Unavailable) at the moment.

My suggestion... if you have a SipSorcery acct. ... is to use something like:

Code:
#Ruby 
sys.log("***Starting New Call Event***")

sys.log("***Incoming Call Starting***")
sys.log("Incoming Call From  #{req.Header.From.FromName} at #{req.Header.From.FromURI.User}@#{req.Header.From.FromURI.Host}")
sys.log("Call is for #{req.URI.User}")
cid = req.Header.From.FromURI.User
trunk = req.URI.User
sys.log("*** CID: #{cid} ***")
sys.log("*** Trunk: #{trunk} ***")

#****Have Calls Ring ATA or Forward if Offline****

sys.Log("Accepting Call") 
      
      if sys.IsAvailable() then 
             sys.Log("The ATA is online.") 
             sys.Dial("123456@voxalot.com") 
          else 
            sys.Log("The ATA is off-line.") 
            sys.Dial("1416222333@VoXalot")  
         end
For this to work... you would need to simultaneously register to both VoXalot and SipSorcery ... and when disconected be disconnected from both (after all SipSorcery can't exactly check that you're connected to VoXalot).

If it sees you're connected... it'll send your calls to VoXalot SIP URI... if not connected it'll use VoXalot (you'll have to add it as an outgoing provider in SipSorcery) to dial your cell/landline number (as per your Smart Call/Dial plan).

The only other reliable (cheap but not free) alternative I know that'll do what you want, is Voip.ms (about 25 cents/month and 0.1 cents/min for incoming)
emoci is offline   Reply With Quote