480 user is aslepp. instead of refuse calls. go to voicemail

Catalog of dial plans
Post Reply
qubo
Posts: 127
Joined: Tue Apr 12, 2011 6:11 am

480 user is aslepp. instead of refuse calls. go to voicemail

Post by qubo » Thu Sep 01, 2011 12:24 am

HI. I have the code of mike tellis and when a call arrives in the range 300..700 the call is refuse.
so I want to achieve 2 things.

1) for a reason the whitelist does not work. the numbers that are local phones are refused if the call is between the 300..700 that is 3 am to 7 am

2) instead of refuse the call. i want that voice mail answer the calls between that range how I can implement that. my voicemail is at 177724xxxxx@in.callcentric.com

thanks so much

# ******************** i n c o m i n g C a l l *************************

def incomingCall
sys.SetFromHeader(formatNum(@cname || @cid,true), nil, Host) # Set FromName & FromHost for sys.Dial

# Forward call to the bindings (ATA / softphone)
# Change FromURI when forwarding to @local, or else Bria won't find contact in its phonebook!

WhiteList = [
'10311702',
'15920766',
'38240083',
'10319999',
'36420040',
'38130134',
'10312255',
]

if !((300..700) === @t.hour*100 + @t.min) or WhiteList.map {|n| to_ENUM(n)}.include?(@cid)
callswitch("#{@user}@local&177724xxxxx@in.callcentric.com[dt=24][fu=#{@cid}]",45)
end

@code, @reason = 480, "#{@user} is asleep" unless @code # if nothing else, must be the night hour
@code = 486 if @trunk =~ /IPCOMM/i ## *** temporary fix for IPCOMMS ***
end

MikeTelis
Posts: 1582
Joined: Wed Jul 30, 2008 6:48 am

Re: 480 user is aslepp. instead of refuse calls. go to voice

Post by MikeTelis » Thu Sep 01, 2011 6:29 am

Replace

Code: Select all

if !((300..700) === @t.hour*100 + @t.min) or WhiteList.map {|n| to_ENUM(n)}.include?(@cid)
  callswitch("#{@user}@local&177724xxxxx@in.callcentric.com[dt=24][fu=#{@cid}]",45)
end
with

Code: Select all

if !((300..700) === @t.hour*100 + @t.min) or WhiteList.map {|n| to_ENUM(n)}.include?(@cid)
  callswitch("#{@user}@local&177724xxxxx@in.callcentric.com[dt=24][fu=#{@cid}]",45)
else
  callswitch("177724xxxxx@in.callcentric.com[fu=#{@cid}]",45)
end

qubo
Posts: 127
Joined: Tue Apr 12, 2011 6:11 am

Re: 480 user is aslepp. instead of refuse calls. go to voice

Post by qubo » Thu Sep 01, 2011 5:02 pm

thanks so much mike
and about the whitelist it is fine or why these numbers are refused when the call in that range time ?

MikeTelis
Posts: 1582
Joined: Wed Jul 30, 2008 6:48 am

Re: 480 user is aslepp. instead of refuse calls. go to voice

Post by MikeTelis » Fri Sep 02, 2011 3:00 am

White-listed numbers should ring bound (registered to SIP account) devices regardless of the time. If no bound devices or you don't answer the call within 24 sec, it should go to voicemail.

If it's not so, check out console log, you should see the problem in there.

Post Reply