Page 1 of 1

I need to divert (forward) an incoming call to a SIP

Posted: Sun Jun 16, 2013 8:11 pm
by mody26
Hello
I want to forward the incoming calls come to a certain SIP Provider name "Nonoh1" to be forward to: mody12345@sip.interncalls.com with no delay, means forward calls without ringing the ATA at all so I can receive this call to that SIP account, all other incoming call processed like the current dial plan with no change
my incoming dial plan for incoming is:
if sys.In then
# Do your INCOMING call processing customisations here.
if sys.IsAvailable() then
sys.Dial("#{sys.Username}@local",60)
sys.Respond(480, "#{sys.Username} Not available")
else
sys.Dial("Enter Number@nonoh",30)
sys.Respond(480, "#{sys.Username} Not available")
end


thank you in advance

Re: I need to divert (forward) an incoming call to a SIP

Posted: Mon Jun 17, 2013 11:43 am
by Aaron
1. Change the Reigster Contact for your Nonoh1 provider to nonoh1.username (replace username with your own),

2. Edit your dialplan along the lines shown below:

Code: Select all

if sys.In then
  # Do your INCOMING call processing customisations here.
  if req.URI.User == "nonoh1.username" then
    sys.Dial("mody12345@sip.interncalls.com",60)
  elsif sys.IsAvailable() then
    sys.Dial("#{sys.Username}@local",60)
    sys.Respond(480, "#{sys.Username} Not available") 
  else
    sys.Dial("Enter Number@nonoh",30)
    sys.Respond(480, "#{sys.Username} Not available")
  end
end

Re: I need to divert (forward) an incoming call to a SIP

Posted: Mon Jun 17, 2013 1:50 pm
by mody26
Thank you for your reply, but it's not working although I did what you told me to change
do you mean the username is only the username for logging the sipsorcery.com or the full username? means: mamoha22 only or full vodafone.mamoha22@sipsorcery.com

Re: I need to divert (forward) an incoming call to a SIP

Posted: Tue Jun 18, 2013 11:05 am
by Aaron
It should be only "vodafone.mamoha22".

Code: Select all

if sys.In then
  # Do your INCOMING call processing customisations here.
  if req.URI.User == "vodafone.mamoha22" then
    sys.Dial("mody12345@sip.interncalls.com",60)
  elsif sys.IsAvailable() then
    sys.Dial("#{sys.Username}@local",60)
    sys.Respond(480, "#{sys.Username} Not available") 
  else
    sys.Dial("Enter Number@nonoh",30)
    sys.Respond(480, "#{sys.Username} Not available")
  end
end