Flexible table-controlled dialplan, Version 2
Re: Flexible table-controlled dialplan, Version 2
You're getting "Wrong number" because I used to_ENUM to convert white-listed numbers into ENUM format (that's why you could write '(408) 454-4455' instead of must less attractive '14084544455'). '(403) 222-*' is not what to_ENUM expects (refer to my so-called "manual"), that's why you end up with "wrong number" exception.
I understand your question but the best idea I have at the moment is to use the same format as in ExcludedPrefixes table. It means that you won't be able to write 7-digit or 10-digit number and automatically have it converted into ENUM. You'll have to write white-listed numbers in full ENUM format, starting with country code.
Do you have a better idea?
I understand your question but the best idea I have at the moment is to use the same format as in ExcludedPrefixes table. It means that you won't be able to write 7-digit or 10-digit number and automatically have it converted into ENUM. You'll have to write white-listed numbers in full ENUM format, starting with country code.
Do you have a better idea?
Re: Flexible table-controlled dialplan, Version 2
OK, I see it now
This is not a problem, I can always list all allowed numbers. Your dial plan is more than I expected.
Thanks again
nozyczek
Ps. It is time for me to learn some ruby
Code: Select all
num.gsub!(/[^0-9*+]/,'') # Delete all fancy chars (only digits, '+' and '*' allowed)
Thanks again
nozyczek
Ps. It is time for me to learn some ruby
Re: Flexible table-controlled dialplan, Version 2
So, did you want to make the changes yourself? It could make a good training task...
Re: Flexible table-controlled dialplan, Version 2
I would like to make changes but I don't think I'm capable to do it myself.
Re: Flexible table-controlled dialplan, Version 2
Okay, let's work on the specs. Do you want white list entries to match the beginning of number and that's it?
'+1 (403) 222' will match all numbers beginning with 1403222
'+1 (403) 223-1234' will match only this particular number
Or you want a full-fledged regular expression?
'+1 (403) 222' will match all numbers beginning with 1403222
'+1 (403) 223-1234' will match only this particular number
Or you want a full-fledged regular expression?
Re: Flexible table-controlled dialplan, Version 2
I would like to use both
specified number
'+1 (403) 223-1234'
and match all numbers that begins with 1403222xxxx
'+1 (403) 222'
specified number
'+1 (403) 223-1234'
and match all numbers that begins with 1403222xxxx
'+1 (403) 222'
Re: Flexible table-controlled dialplan, Version 2
Code: Select all
rexp = WhiteList.map {|n| n.gsub(/\D/,'')}.join('|')
if !((30..745) === @t.hour*100 + @t.min) or (@cid =~ /^(#{rexp})/)
callswitch("#{@user}@local[fu=#{@cid}]",45)
end
Code: Select all
WhiteList = [
'+1 (403) 222',
'+1 (403) 223-1234',
]
'+1 (403) 222-*',
but it will be ignored, as any other non-digit. Hope it's what you wanted.
BTW, check out the update (opening post in this thread).
Re: Flexible table-controlled dialplan, Version 2
Great I will give it a try tomorrow and will report back
Thx
Thx
Re: Flexible table-controlled dialplan, Version 2
Could you satisfy my curiosity? I'm wondering why would one need wildcards in the WhiteList... typically WhiteList is quite short (a few relatives and, probably, the boss). I can't imagine why would one need to include 1000 numbers beginning with 1-403-222 ...
Re: Flexible table-controlled dialplan, Version 2
I'm providing 24/7 support for the company that I work for and they have allocated hundreds of 1-403-222-xxxx phone numbers. I never know who and from what building will call me so I was looking for this functionality.MikeTelis wrote:Could you satisfy my curiosity? I'm wondering why would one need wildcards in the WhiteList... typically WhiteList is quite short (a few relatives and, probably, the boss). I can't imagine why would one need to include 1000 numbers beginning with 1-403-222 ...
I was able to test all of the changes you provided. Everything is working great. I also incorporated 7/26 dial plan updates with no problems. I will need to do more testing when I get home but everything looks good so far.
Thanks again for your help and this great dial plan
nozyczek